Skip to content

Commit

Permalink
Merge pull request #70 from wtsnz/feature/device-name
Browse files Browse the repository at this point in the history
Show device names
  • Loading branch information
wtsnz authored Feb 15, 2021
2 parents 907fa7d + 4157b07 commit e707174
Show file tree
Hide file tree
Showing 185 changed files with 41,122 additions and 25 deletions.
1 change: 1 addition & 0 deletions CI/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ cmake .. \
-DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
&& make -j4
8 changes: 2 additions & 6 deletions CI/download-obs-deps.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
if not exist %DepsBasePath% (
curl -o %DepsBasePath%.zip -kLO https://obsproject.com/downloads/dependencies2017.zip -f --retry 5 -C -
7z x %DepsBasePath%.zip -o%DepsBasePath%
) else (
echo "OBS dependencies are already there. Download skipped."
)
curl -o %DepsBasePath%.zip -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -C -
7z x %DepsBasePath%.zip -o%DepsBasePath% -aoa
2 changes: 1 addition & 1 deletion CI/install-dependencies-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echo "[obs-ios-camera-plugin] Updating Homebrew.."
brew update >/dev/null
echo "[obs-ios-camera-plugin] Checking installed Homebrew formulas.."
BREW_PACKAGES=$(brew list)
BREW_DEPENDENCIES="ffmpeg libav cmake"
BREW_DEPENDENCIES="ffmpeg libav cmake opensll"

for DEPENDENCY in ${BREW_DEPENDENCIES}; do
if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then
Expand Down
7 changes: 7 additions & 0 deletions CI/install-ios-camera-dependencies.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd c:\vcpkg
vcpkg integrate install

vcpkg install dirent:x86-windows-static
vcpkg install dirent:x64-windows-static
vcpkg install openssl:x86-windows-static
vcpkg install openssl:x64-windows-static
5 changes: 3 additions & 2 deletions CI/prepare-windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mkdir build32
mkdir build64

cd build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -Dw32-pthreads_DIR="%OBSPath%\build32\deps\w32-pthreads" -DW32_PTHREADS_LIB="%OBSPath%\build32\deps\w32-pthreads\%build_config%\w32-pthreads.lib" -DLibObs_DIR="%OBSPath%\build32\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -Dw32-pthreads_DIR="%OBSPath%\build32\deps\w32-pthreads" -DW32_PTHREADS_LIB="%OBSPath%\build32\deps\w32-pthreads\%build_config%\w32-pthreads.lib" -DLibObs_DIR="%OBSPath%\build32\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" -DCMAKE_TOOLCHAIN_FILE=%vcpkgToolchain% -DOPENSSL_ROOT_DIR="%OpenSSL32%" -DVCPKG_DEFAULT_TRIPLET="%VCPKG_DEFAULT_TRIPLET_86%" ..

cd ..\build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -Dw32-pthreads_DIR="%OBSPath%\build64\deps\w32-pthreads" -DW32_PTHREADS_LIB="%OBSPath%\build64\deps\w32-pthreads\%build_config%\w32-pthreads.lib" -DLibObs_DIR="%OBSPath%\build64\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -Dw32-pthreads_DIR="%OBSPath%\build64\deps\w32-pthreads" -DW32_PTHREADS_LIB="%OBSPath%\build64\deps\w32-pthreads\%build_config%\w32-pthreads.lib" -DLibObs_DIR="%OBSPath%\build64\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" -DCMAKE_TOOLCHAIN_FILE=%vcpkgToolchain% -DOPENSSL_ROOT_DIR="%OpenSSL64%" -DVCPKG_DEFAULT_TRIPLET="%VCPKG_DEFAULT_TRIPLET_64%" ..
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ add_library(portal STATIC
${portal_SOURCES}
${portal_HEADERS})

add_subdirectory(deps/libimobiledevice)

target_link_libraries(portal
libusbmuxd
libimobiledevice
)


## --

set(ENABLE_PROGRAMS false)
Expand Down
35 changes: 29 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
DepsPath32: '$(DepsBasePath)\win32'
DepsPath64: '$(DepsBasePath)\win64'
QtBaseDir: 'D:\QtDep'
vcpkgToolchain: 'c:/vcpkg/scripts/buildsystems/vcpkg.cmake'
VCPKG_DEFAULT_TRIPLET_64: 'x64-windows-static'
VCPKG_DEFAULT_TRIPLET_86: '86-windows-static'
OpenSSL32: 'c:/vcpkg/installed/x86-windows-static'
OpenSSL64: 'c:/vcpkg/installed/x64-windows-static'
QTDIR32: '$(QtBaseDir)\5.10.1\msvc2017'
QTDIR64: '$(QtBaseDir)\5.10.1\msvc2017_64'
OBSPath: 'D:\obs-studio'
Expand All @@ -31,12 +36,25 @@ jobs:
env:
QtBaseDir: $(QtBaseDir)

- task: Cache@2
displayName: Restore cached iOS Camera Plugin Dependencies
inputs:
key: 'obscam-cache-3 | "$(Agent.OS)"'
restoreKeys: |
obscam-cache-3 | "$(Agent.OS)"
path: 'c:\vcpkg\installed\'

- script: ./CI/install-ios-camera-dependencies.cmd
displayName: 'Install iOS Camera Plugin Dependencies'
env:
vcpkgToolchain: '$(vcpkgToolchain)'

- task: Cache@2
displayName: Restore cached OBS Studio dependencies
inputs:
key: 'obsdeps | "$(Agent.OS)"'
key: 'obsdeps-3 | "$(Agent.OS)"'
restoreKeys: |
obsdeps | "$(Agent.OS)"
obsdeps-3 | "$(Agent.OS)"
path: $(DepsBasePath)

- script: ./CI/download-obs-deps.cmd
Expand All @@ -45,9 +63,9 @@ jobs:
- task: Cache@2
displayName: Restore cached OBS Studio builds
inputs:
key: 'obs | "$(Agent.OS)"'
key: 'obs-build-2 | "$(Agent.OS)"'
restoreKeys: |
obs | "$(Agent.OS)"
obs-build-2 | "$(Agent.OS)"
path: $(OBSPath)

- script: ./CI/checkout-cmake-obs-windows.cmd
Expand Down Expand Up @@ -79,6 +97,11 @@ jobs:
QTDIR32: $(QTDIR32)
QTDIR64: $(QTDIR64)
OBSPath: $(OBSPath)
vcpkgToolchain: $(vcpkgToolchain)
VCPKG_DEFAULT_TRIPLET_64: ${VCPKG_DEFAULT_TRIPLET_64}
VCPKG_DEFAULT_TRIPLET_86: ${VCPKG_DEFAULT_TRIPLET_86}
OpenSSL32: $(OpenSSL32)
OpenSSL64: $(OpenSSL64)

- task: MSBuild@1
displayName: 'Build obs-ios-camera-source 32-bit'
Expand Down Expand Up @@ -137,5 +160,5 @@ jobs:
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: './release'
artifactName: 'macos_build'
artifactName: 'macos_build'

48 changes: 48 additions & 0 deletions deps/libimobiledevice/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.vs/
Win32/
x64/
Debug/
*.user
# git-ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
*.[oa]
*~
*.po
*.lo
*.la
autom4te.cache/*
*.in
*/.deps/*
m4/*
swig/*
*.swp
*.patch
aclocal.m4
config.h
config.log
config.sub
config.guess
config.status
configure
depcomp
install-sh
compile
main
ltmain.sh
missing
mkinstalldirs
libtool
*Makefile
py-compile
stamp-h1
src/.libs
docs/html
libimobiledevice-1.0.pc
tools/.libs/*
tools/idevice*
!tools/idevice*.[ch]
cython/.libs/*
cython/*.c
doxygen.cfg
21 changes: 21 additions & 0 deletions deps/libimobiledevice/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Bastien Nocera
Bryan Forbes
Christophe Fergeau
Geoff Paul
Ingmar Vanhassel
John Maguire
Jonathan Beck
Joshua Hill
Julien Lavergne
Martin Aumueller
Martin Szulecki
Marty Rosenberg
Matt Colyer
Nikias Bassen
Patrick Walton
Paul Sladen
Peter Hoepfner
Petr Uzel
Todd Zullinger
Zach C
Zoltan Balaton
139 changes: 139 additions & 0 deletions deps/libimobiledevice/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
project(libimobiledevice)
cmake_minimum_required(VERSION 3.2)

set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED)
set(OPENSSL_USE_STATIC_LIBS TRUE)

message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")

message("other: ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES}")

set(libimobiledevice_HEADERS
#common/debug.h
#common/socket.h
#common/thread.h
#common/userpref.h
#common/utils.h

src/afc.h
src/companion_proxy.h
src/debugserver.h
src/device_link_service.h
src/diagnostics_relay.h
src/file_relay.h
src/heartbeat.h
src/house_arrest.h
src/idevice.h
src/installation_proxy.h
src/lockdown.h
src/misagent.h
src/mobile_image_mounter.h
src/mobileactivation.h
src/mobilebackup.h
src/mobilebackup2.h
src/mobilesync.h
src/notification_proxy.h
src/preboard.h
src/property_list_service.h
src/restore.h
src/sbservices.h
src/screenshotr.h
src/service.h
src/syslog_relay.h
src/webinspector.h
)

set(libimobiledevice_SOURCES
common/debug.c
common/socket.c
common/thread.c
common/userpref.c
common/utils.c

src/afc.c
src/companion_proxy.c
src/debugserver.c
src/device_link_service.c
src/diagnostics_relay.c
src/file_relay.c
src/heartbeat.c
src/house_arrest.c
src/idevice.c
src/installation_proxy.c
src/lockdown.c
src/misagent.c
src/mobile_image_mounter.c
src/mobileactivation.c
src/mobilebackup.c
src/mobilebackup2.c
src/mobilesync.c
src/notification_proxy.c
src/pinvoke.c
src/preboard.c
src/property_list_service.c
src/restore.c
src/sbservices.c
src/screenshotr.c
src/service.c
src/syslog_relay.c
src/webinspector.c
)

include_directories(libimobiledevice
include/
${OPENSSL_INCLUDE_DIR}
)

add_library(libimobiledevice STATIC
${libimobiledevice_SOURCES}
${libimobiledevice_HEADERS}
)

target_include_directories(libimobiledevice
PUBLIC include
)

# if(WIN32)
# find_path(DIRENT_INCLUDE_DIRS "dirent.h")
# target_include_directories(libimobiledevice PRIVATE ${DIRENT_INCLUDE_DIRS})
# endif()

target_link_libraries(libimobiledevice
PRIVATE
libplist
libusbmuxd
)

target_link_libraries(libimobiledevice PRIVATE
OpenSSL::SSL
OpenSSL::Crypto
)

# https://gitlab.kitware.com/cmake/cmake/-/issues/19263
if(WIN32)
target_link_libraries(libimobiledevice PRIVATE Crypt32 ws2_32)
endif()

check_function_exists(stpcpy HAVE_STPCPY)
if(${HAVE_STPCPY})
add_compile_definitions(libimobiledevice HAVE_STPCPY)
endif()

check_function_exists(stpncpy HAVE_STPNCPY)
if(${HAVE_STPNCPY})
add_compile_definitions(libimobiledevice HAVE_STPNCPY)
endif()

check_function_exists(asprintf HAVE_ASPRINTF)
if(${HAVE_ASPRINTF})
add_compile_definitions(libimobiledevice HAVE_ASPRINTF)
endif()

check_function_exists(vasprintf HAVE_VASPRINTF)
if(${HAVE_VASPRINTF})
add_compile_definitions(libimobiledevice HAVE_VASPRINTF)
endif()

add_compile_definitions(libimobiledevice HAVE_OPENSSL)
Loading

0 comments on commit e707174

Please sign in to comment.