diff options
author | Erik Kundiman <erik@megapahit.org> | 2023-07-29 14:29:52 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2023-07-29 14:29:52 +0800 |
commit | c2e755287eee1e9c9af4f918b20a4b2fa5f361f7 (patch) | |
tree | 1ca6dc4d8b43e973f20a127cb60c6e168a80cb9e /indra | |
parent | 7fb72b646d7f13caa8e4ec392da09caf1ecd00f0 (diff) |
Start adding LibVLC support when using system libs
Streaming is not working yet, though. Until it's made sure that the
dynamic library and plugins needed are on the paths the executable is
expecting them to be.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/cmake/LibVLCPlugin.cmake | 17 | ||||
-rw-r--r-- | indra/media_plugins/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/newview/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 13 |
4 files changed, 38 insertions, 4 deletions
diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 599ce02844..271202be4d 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,9 +5,26 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) +if (USE_AUTOBUILD_3P OR USE_CONAN) use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") +else () + include(FindPkgConfig) + if (DARWIN) + set(CMAKE_PREFIX_PATH /opt/local/libexec/vlc3/lib/pkgconfig) + pkg_check_modules(Libvlc REQUIRED libvlc) + target_link_libraries( ll::libvlc INTERFACE vlccore ) + else () + pkg_check_modules(Libvlc REQUIRED libvlc vlc-plugin) + endif () + target_include_directories( ll::libvlc SYSTEM INTERFACE ${Libvlc_INCLUDE_DIRS} ) + target_link_directories( ll::libvlc INTERFACE ${Libvlc_LIBRARY_DIRS} ) + target_link_libraries( ll::libvlc INTERFACE ${Libvlc_LIBRARIES} ) + set(LIBVLCPLUGIN ON CACHE BOOL + "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") + return() +endif () if (WINDOWS) target_link_libraries( ll::libvlc INTERFACE diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 972bb7dd2d..726ccf90ed 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -2,6 +2,12 @@ add_subdirectory(base) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + add_subdirectory(libvlc) + add_subdirectory(example) + return() +endif () + if (LINUX) #add_subdirectory(gstreamer010) add_subdirectory(example) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 74805178b6..d6c8adfeab 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -58,6 +58,7 @@ include(VisualLeakDetector) include(ZLIBNG) include(URIPARSER) include(LLPrimitive) +include(LibVLCPlugin) if ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV) # When using HAVOK_TPV, the library is precompiled, so no need for this @@ -1917,6 +1918,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLPHYSICSEXTENSIONS_LIBRARIES} ll::bugsplat ll::tracy + ll::libvlc ) if( TARGET ll::intel_memops ) @@ -2081,7 +2083,11 @@ if (DARWIN) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) + if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef) + else () + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc) + endif () if (ENABLE_SIGNING) set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}") diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 29f1fa6e4d..23e6b16103 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -131,10 +131,12 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" -#if !LL_LINUX && !LL_FREEBSD +//#if !LL_LINUX +#ifndef LL_USESYSTEMLIBS #include "cef/dullahan_version.h" +#endif #include "vlc/libvlc_version.h" -#endif // LL_LINUX +//#endif // LL_LINUX #if LL_DARWIN #include "llwindowmacosx.h" @@ -3338,7 +3340,8 @@ LLSD LLAppViewer::getViewerInfo() const info["VOICE_VERSION"] = LLTrans::getString("NotConnected"); } -#if !LL_LINUX && !LL_FREEBSD +//#if !LL_LINUX && !LL_FREEBSD && !LL_DARWIN +#ifndef LL_USESYSTEMLIBS std::ostringstream cef_ver_codec; cef_ver_codec << "Dullahan: "; cef_ver_codec << DULLAHAN_VERSION_MAJOR; @@ -3368,7 +3371,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = "Undefined"; #endif -#if !LL_LINUX && !LL_FREEBSD +//#if !LL_LINUX std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; @@ -3376,9 +3379,11 @@ LLSD LLAppViewer::getViewerInfo() const vlc_ver_codec << "."; vlc_ver_codec << LIBVLC_VERSION_REVISION; info["LIBVLC_VERSION"] = vlc_ver_codec.str(); +/* #else info["LIBVLC_VERSION"] = "Undefined"; #endif +*/ S32 packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) |