[vlc-commits] [Git][videolan/vlc][master] 3 commits: modules: Cargo.toml: expose workspace for modules
Alexandre Janniaux pushed to branch master at VideoLAN / VLC Commits: 7825cee9 by Alexandre Janniaux at 2024-06-27T17:26:49+00:00 modules: Cargo.toml: expose workspace for modules The workspace references the core crate from `src/rust/*` and allow modules to inherit from them. This unify where to finds the crates for the modules. - - - - - e8bb3391 by Alexandre Janniaux at 2024-06-27T17:26:49+00:00 src: Cargo.toml: expose common workspace keys Expose the version and license keys to every members of the workspace. The rationale is that every core crates merged into `src/rust/` will be versioned under the same revision as the core. - - - - - 163c7868 by Alexandre Janniaux at 2024-06-27T17:26:49+00:00 vlcrs-message: Cargo.toml: use workspace data Inherit the version and license keys from the workspace so that they are defined only once. - - - - - 3 changed files: - + modules/Cargo.toml - src/rust/Cargo.toml - src/rust/vlcrs-messages/Cargo.toml Changes: = modules/Cargo.toml = @@ -0,0 +1,6 @@ +[workspace] +resolver = "2" +members = [] + +[workspace.dependencies] +vlcrs-messages = { path = "../src/rust/vlcrs-messages" } = src/rust/Cargo.toml = @@ -4,3 +4,7 @@ members = [ "vlcrs-sys-generator" ] resolver = "2" + +[workspace.package] +version = "4.0.0" +license = "LGPL-2.1-or-later" = src/rust/vlcrs-messages/Cargo.toml = @@ -1,8 +1,8 @@ [package] name = "vlcrs-messages" -version = "0.0.0" edition = "2021" -license = "LGPL-2.1-or-later" +version.workspace = true +license.workspace = true [dependencies] vlcrs-utils = { path = "../vlcrs-utils" } View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ffb6cc6933c44cfc475aadfc553d21ca3100ee33...163c786896c5c99a4c2af7dff191473902453d56 -- This project does not include diff previews in email notifications. View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ffb6cc6933c44cfc475aadfc553d21ca3100ee33...163c786896c5c99a4c2af7dff191473902453d56 You're receiving this email because of your account on code.videolan.org. VideoLAN code repository instance___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] [Git][videolan/vlc][master] meson: Add missing headers and source declarations for RoundImage resource access
Alexandre Janniaux pushed to branch master at VideoLAN / VLC Commits: 743c3708 by Vikram Kangotra at 2024-04-09T21:34:33+05:30 meson: Add missing headers and source declarations for RoundImage resource access MR !5153 omitted to include the necessary header and source declarations, resulting in a failed build when using Meson. - - - - - 1 changed file: - modules/gui/qt/meson.build Changes: = modules/gui/qt/meson.build = @@ -123,6 +123,7 @@ moc_headers = files( 'util/base_model.hpp', 'util/color_scheme_model.hpp', 'util/color_svg_image_provider.hpp', +'util/vlcaccess_image_provider.hpp', 'util/csdbuttonmodel.hpp', 'util/imageluminanceextractor.hpp', 'util/keyhelper.hpp', @@ -409,6 +410,8 @@ some_sources = files( 'util/color_scheme_model.hpp', 'util/color_svg_image_provider.cpp', 'util/color_svg_image_provider.hpp', +'util/vlcaccess_image_provider.cpp', +'util/vlcaccess_image_provider.hpp', 'util/covergenerator.cpp', 'util/covergenerator.hpp', 'util/csdbuttonmodel.cpp', View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/743c37082dcdf4d1fb27416ce438a54e798c1808 -- View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/743c37082dcdf4d1fb27416ce438a54e798c1808 You're receiving this email because of your account on code.videolan.org. VideoLAN code repository instance___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] [Git][videolan/vlc][master] qt: Makefile.am: symlink vlc-qt-check to modules/
Alexandre Janniaux pushed to branch master at VideoLAN / VLC Commits: cd3a5912 by Alexandre Janniaux at 2023-12-20T17:23:17+00:00 qt: Makefile.am: symlink vlc-qt-check to modules/ vlc-qt-check is found using VLC_PKG_LIBEXEC_DIR which falls back to VLC_LIB_PATH. In vlc-static, VLC_LIB_PATH is defined by the following snippet: #ifdef TOP_BUILDDIR setenv ("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", 1); setenv ("VLC_DATA_PATH", TOP_SRCDIR"/share", 1); setenv ("VLC_LIB_PATH", TOP_BUILDDIR"/modules", 1); #endif With the previous changes in ddfc6d0de8ae0f450895ec5cee6626e4efacb422, the vlc-qt-check executable is not built into TOP_BUILDDIR/modules/ anymore, but in TOP_BUILDDIR/modules/gui/qt/ instead, and won't be found on platforms requiring it. When installing, it is still located at the right place, but this commit adds a symbolic link to modules/ to ensure we can also find it with vlc-static. - - - - - 1 changed file: - modules/gui/qt/Makefile.am Changes: = modules/gui/qt/Makefile.am = @@ -1150,6 +1150,10 @@ BUILT_SOURCES += $(nodist_libqt_plugin_la_SOURCES) if !HAVE_WIN32 if !HAVE_OS2 pkglibexec_PROGRAMS = vlc-qt-check +all-local: $(builddir)/../../vlc-qt-check + +$(builddir)/../../vlc-qt-check: vlc-qt-check + $(AM_V_GEN)cd ../../ && $(LN_S) -f gui/qt/vlc-qt-check . && chmod +x vlc-qt-check endif endif View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cd3a5912b5f91598ccbb484d219370fdd382162e -- View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cd3a5912b5f91598ccbb484d219370fdd382162e You're receiving this email because of your account on code.videolan.org. VideoLAN code repository instance___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] [Git][videolan/vlc][master] 10 commits: libplacebo: add new color primaries enum members
Alexandre Janniaux pushed to branch master at VideoLAN / VLC Commits: ccad653c by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: add new color primaries enum members Not really that important or useful, but they're supported upstream so there's also no real reason not to expose them. - - - - - ca206a51 by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: add support for BT.2390 EETF This has already been the default in most libplacebo versions, in that `pl_color_map_default_params.tone_mapping_algo` was equal to this value. Despite this, it was never exposed in the UI, meaning users could not actually manually select it. Update the string to make it clear that this is the intended/recommended default. - - - - - 31351641 by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: add colorimetric gamut clipping option New upstream feature. Simply needs to be exposed in the UI. - - - - - 231ea4de by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: remove unneeded counter field This field was left-over from an early API design, and never used for anything in libplacebo. Recent versions have since deprecated it. - - - - - fe6ec4ce by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: rewrite picture placement logic Recent versions of libplacebo use `pl_frame.crop` instead of `pl_render_target.dst_rect`, for which the latter is now merely a fallback. Unfortunately, `pl_render_target_from_swapchain` ends up setting the former field to values based on the swapchain dimensions, so the values we set in `dst_rect` accidentally ended up ignored. In retrospect, this was caused by the upstream decision to make the new field override the old field if both are present, and having that logic the other way around would also have avoided this bug. Bite the bullet and make it conditional on the PL_API_VER. All that said - merely fixing this bug, however, exposed serious shortcomings in the video placement logic, in particular the lack of proper flipping support for OpenGL. Fix it by rewriting the video placement logic completely, based on the observation that `vout_display_PlacePicture` is a relatively cheap function to call. There's no need to awkwardly cache it inside `sys`. - - - - - e4a584e3 by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: fix use-after-free on uninit `pl->ops->close` destroys the GPU instance, after which the swapchain is undefined. Fix it by moving the swapchain destruction to `ops->close` itself, where it can be done in the correct order. (This also fixes a bug where, technically, the opengl instance attempted destroying the swapchain while the context was not current on the thread) - - - - - fb4e794c by Niklas Haas at 2021-06-04T10:37:08+00:00 opengl: drop redundant code path This is redundant with the minimum version requirement being 1.7. I sure can't wait until the next bump up to 1.29.0. All these ifdefs keep reminding me of my failure to design a good API on my first try. - - - - - 71a72062 by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: remove trailing \ Cosmetic. Side note: I really, *really* hope this commit title breaks something, somewhere. - - - - - 7de45dac by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: add support for custom LUTs Unfortunately the UI for loading these is a bit clunky as they're hidden behind so many layers of menu and advanced options, plus the fact that the new LUTs still only get applied on vout reinit. But it's still a feature that a lot of users have requested heavily, so supporting them at all is a good thing. The implementation is rather straightforward even though the amount of #ifdef's are really getting on my nerves. Can somebody just time travel me into a future universe in which I can make libplacebo v4 the minimum dependency? - - - - - db6f8b7c by Niklas Haas at 2021-06-04T10:37:08+00:00 libplacebo: add support for custom shaders It's finally time to use RAVU/FSRCNN(X)/NNEDI3/Anime4K in VLC. Currently limited to only one shader, which isn't a huge limitation seeing as you can just `cat` together as many shaders as you want to use into one big file. But patches welcome(tm). - - - - - 6 changed files: - modules/video_output/libplacebo/display.c - modules/video_output/libplacebo/instance.c - modules/video_output/libplacebo/instance_opengl.c - modules/video_output/libplacebo/instance_vulkan.c - modules/video_output/libplacebo/utils.h - modules/video_output/opengl/sampler.c Changes: = modules/video_output/libplacebo/display.c = @@ -30,6 +30,7 @@ #include #include #include +#include #include "utils.h" #include "instance.h" @@ -38,6 +39,10 @@ #include #include +#if PL_API_VER >= 113 +# include +#endif + struct vout_display_sys_t { vlc_placebo_t *pl; @@ -49,10 +54,6 @@ struct vout_display_sys_t const struct pl
[vlc-commits] skins2: window_manager: use C++ for: loops
vlc | branch: master | Alexandre Janniaux | Sun Apr 4 15:39:01 2021 +0200| [08e0f12a170a0cc1583c71aabf151fd291b3e1d0] | committer: Alexandre Janniaux skins2: window_manager: use C++ for: loops > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08e0f12a170a0cc1583c71aabf151fd291b3e1d0 --- modules/gui/skins2/src/window_manager.cpp | 149 +- 1 file changed, 64 insertions(+), 85 deletions(-) diff --git a/modules/gui/skins2/src/window_manager.cpp b/modules/gui/skins2/src/window_manager.cpp index 9663b79721..2d3791509d 100644 --- a/modules/gui/skins2/src/window_manager.cpp +++ b/modules/gui/skins2/src/window_manager.cpp @@ -156,11 +156,8 @@ void WindowManager::move( TopWindow &rWindow, int left, int top ) const checkAnchors( &rWindow, xOffset, yOffset ); // Move all the windows -WinSet_t::const_iterator it; -for( it = m_movingWindows.begin(); it != m_movingWindows.end(); ++it ) -{ -(*it)->move( (*it)->getLeft() + xOffset, (*it)->getTop() + yOffset ); -} +for( auto *window : m_movingWindows ) +window->move( window->getLeft() + xOffset, window->getTop() + yOffset ); } @@ -183,29 +180,27 @@ void WindowManager::startResize( GenericLayout &rLayout, Direction_t direction ) const AncList_t &ancList1 = rLayout.getAnchorList(); // Iterate through all the hanged windows -for( itWin = m_dependencies[rLayout.getWindow()].begin(); - itWin != m_dependencies[rLayout.getWindow()].end(); ++itWin ) +for( auto *window : m_dependencies[rLayout.getWindow()] ) { // Now, check for anchoring between the 2 windows const AncList_t &ancList2 = -(*itWin)->getActiveLayout().getAnchorList(); -for( itAnc1 = ancList1.begin(); itAnc1 != ancList1.end(); ++itAnc1 ) +window->getActiveLayout().getAnchorList(); +for( auto *anc1 : ancList1 ) { -for( itAnc2 = ancList2.begin(); - itAnc2 != ancList2.end(); ++itAnc2 ) +for( auto *anc2 : ancList2 ) { -if( (*itAnc1)->isHanging( **itAnc2 ) ) +if( anc1->isHanging( *anc2 ) ) { // Add the dependencies of the hanged window to one of the // lists of moving windows Position::Ref_t aRefPos = -(*itAnc1)->getPosition().getRefLeftTop(); +anc1->getPosition().getRefLeftTop(); if( aRefPos == Position::kRightTop ) -buildDependSet( m_resizeMovingE, *itWin ); +buildDependSet( m_resizeMovingE, window ); else if( aRefPos == Position::kLeftBottom ) -buildDependSet( m_resizeMovingS, *itWin ); +buildDependSet( m_resizeMovingS, window ); else if( aRefPos == Position::kRightBottom ) -buildDependSet( m_resizeMovingSE, *itWin ); +buildDependSet( m_resizeMovingSE, window ); break; } } @@ -285,33 +280,32 @@ void WindowManager::resize( GenericLayout &rLayout, rLayout.refreshAll(); // Move all the anchored windows -WinSet_t::const_iterator it; if( m_direction == kResizeE || m_direction == kResizeSE ) { -for( it = m_resizeMovingE.begin(); it != m_resizeMovingE.end(); ++it ) +for( auto *window : m_resizeMovingE ) { -(*it)->move( (*it)->getLeft() + xNewOffset, - (*it)->getTop() ); +window->move( window->getLeft() + xNewOffset, + window->getTop() ); } } if( m_direction == kResizeS || m_direction == kResizeSE ) { -for( it = m_resizeMovingS.begin(); it != m_resizeMovingS.end(); ++it ) +for( auto *window : m_resizeMovingS ) { -(*it)->move( (*it)->getLeft(), - (*it)->getTop( )+ yNewOffset ); +window->move( window->getLeft(), + window->getTop( )+ yNewOffset ); } } if( m_direction == kResizeE || m_direction == kResizeS || m_direction == kResizeSE ) { -for( it = m_resizeMovingSE.begin(); it != m_resizeMovingSE.end(); ++it ) +for( auto *window : m_resizeMovingSE ) { -(*it)->move( (*it)->getLeft() + xNewOffset, - (*it)->getTop() + yNewOffset ); +window->move( window->getLeft() + xNewOffset, + window->getTop() + yNewOffset ); } } } @@ -365,13 +359,12 @@ void WindowManager::unmaximize( TopWindow &rWindow ) void WindowManager::synchVisibility() const { -
[vlc-commits] skins2: window_manager: use std::unique_ptr
vlc | branch: master | Alexandre Janniaux | Sun Apr 4 16:34:22 2021 +0200| [5dcd99509e6b539f326dba301e2713638da5d7b3] | committer: Alexandre Janniaux skins2: window_manager: use std::unique_ptr > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5dcd99509e6b539f326dba301e2713638da5d7b3 --- modules/gui/skins2/src/window_manager.cpp | 11 +++ modules/gui/skins2/src/window_manager.hpp | 3 ++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/gui/skins2/src/window_manager.cpp b/modules/gui/skins2/src/window_manager.cpp index 2d3791509d..10ee635af1 100644 --- a/modules/gui/skins2/src/window_manager.cpp +++ b/modules/gui/skins2/src/window_manager.cpp @@ -33,7 +33,7 @@ WindowManager::WindowManager( intf_thread_t *pIntf ): SkinObject( pIntf ), m_magnet( 0 ), m_alpha( 255 ), m_moveAlpha( 255 ), m_opacityEnabled( false ), m_opacity( 255 ), m_direction( kNone ), -m_maximizeRect(0, 0, 50, 50), m_pTooltip( NULL ), m_pPopup( NULL ) +m_maximizeRect(0, 0, 50, 50), m_pPopup( NULL ) { // Create and register a variable for the "on top" status VarManager *pVarManager = VarManager::instance( getIntf() ); @@ -47,12 +47,7 @@ WindowManager::WindowManager( intf_thread_t *pIntf ): m_opacity = 255 * var_InheritFloat( getIntf(), "qt-opacity" ); } - -WindowManager::~WindowManager() -{ -delete m_pTooltip; -} - +WindowManager::~WindowManager() = default; void WindowManager::registerWindow( TopWindow &rWindow ) { @@ -597,7 +592,7 @@ void WindowManager::createTooltip( const GenericFont &rTipFont ) // Create the tooltip window if( !m_pTooltip ) { -m_pTooltip = new Tooltip( getIntf(), rTipFont, 500 ); +m_pTooltip = std::make_unique( getIntf(), rTipFont, 500 ); } else { diff --git a/modules/gui/skins2/src/window_manager.hpp b/modules/gui/skins2/src/window_manager.hpp index 47cf875d83..6f6358e194 100644 --- a/modules/gui/skins2/src/window_manager.hpp +++ b/modules/gui/skins2/src/window_manager.hpp @@ -31,6 +31,7 @@ #include #include #include +#include class GenericFont; @@ -219,7 +220,7 @@ private: /// Rect of the last maximized window SkinsRect m_maximizeRect; /// Tooltip -Tooltip *m_pTooltip; +std::unique_ptr m_pTooltip; /// Active popup, if any Popup *m_pPopup; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] skins2: window_manager: remove trailing lines
vlc | branch: master | Alexandre Janniaux | Sun Apr 4 15:39:25 2021 +0200| [0be3db86360d50533e036a5948e4d57f26f5d5a5] | committer: Alexandre Janniaux skins2: window_manager: remove trailing lines > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0be3db86360d50533e036a5948e4d57f26f5d5a5 --- modules/gui/skins2/src/window_manager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/gui/skins2/src/window_manager.cpp b/modules/gui/skins2/src/window_manager.cpp index 10ee635af1..ede5318fe0 100644 --- a/modules/gui/skins2/src/window_manager.cpp +++ b/modules/gui/skins2/src/window_manager.cpp @@ -632,4 +632,3 @@ void WindowManager::setActiveLayout( TopWindow &rWindow, // Rebuild the dependencies stopMove(); } - ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] kms: fix use-after-free on device string
vlc | branch: master | Alexandre Janniaux | Fri Apr 16 20:26:40 2021 +0200| [540437b0537b5eae85b4fc4bc6455097ea21b6b2] | committer: Alexandre Janniaux kms: fix use-after-free on device string > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=540437b0537b5eae85b4fc4bc6455097ea21b6b2 --- modules/video_output/kms.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c index 9965f3a8ef..d1b6dbc7d6 100644 --- a/modules/video_output/kms.c +++ b/modules/video_output/kms.c @@ -525,12 +525,14 @@ static int OpenDisplay(vout_display_t *vd) free(psz_device); return VLC_EGENERIC; } -free(psz_device); drmSetClientCap(sys->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); if (!ChromaNegotiation(vd)) +{ +free(psz_device); goto err_out; +} msg_Dbg(vd, "Using VLC chroma '%.4s', DRM chroma '%.4s'", (char*)&sys->vlc_fourcc, (char*)&sys->drm_fourcc); @@ -538,8 +540,10 @@ static int OpenDisplay(vout_display_t *vd) ret = drmGetCap(sys->drm_fd, DRM_CAP_DUMB_BUFFER, &dumbRet); if (ret < 0 || !dumbRet) { msg_Err(vd, "Device '%s' does not support dumb buffers", psz_device); +free(psz_device); goto err_out; } +free(psz_device); modeRes = drmModeGetResources(sys->drm_fd); if (modeRes == NULL) { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] configure.ac: simplify bitstream package check
vlc | branch: master | Alexandre Janniaux | Fri Apr 16 10:34:35 2021 +0200| [89201f247f4c4ff8097ef2b0b109b14c3f071344] | committer: Alexandre Janniaux configure.ac: simplify bitstream package check > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=89201f247f4c4ff8097ef2b0b109b14c3f071344 --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8dddeb148b..f9eeafbea6 100644 --- a/configure.ac +++ b/configure.ac @@ -4278,8 +4278,7 @@ AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"]) dnl dnl Bitstream dnl -PKG_CHECK_MODULES([BITSTREAM], [bitstream > 1.4],[have_bitstream="yes"], [have_bitstream="no"]) -AM_CONDITIONAL([HAVE_BITSTREAM], [test "${have_bitstream}" = "yes"]) +PKG_HAVE_WITH_MODULES([BITSTREAM], [bitstream > 1.4]) dnl dnl SRT plugin ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] VLCVideoUIView: signal initial size during the opening
vlc | branch: master | Alexandre Janniaux | Sat Feb 20 10:23:59 2021 +0100| [7f86b3a939d278e3640c4db24f992b3b64d7f133] | committer: Alexandre Janniaux VLCVideoUIView: signal initial size during the opening It avoids the display to open with a size bigger than the device's screen, which could lead to out-of-memory failures. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f86b3a939d278e3640c4db24f992b3b64d7f133 --- modules/video_output/apple/VLCVideoUIView.m | 5 + 1 file changed, 5 insertions(+) diff --git a/modules/video_output/apple/VLCVideoUIView.m b/modules/video_output/apple/VLCVideoUIView.m index d5fc143beb..d0abdf2dba 100644 --- a/modules/video_output/apple/VLCVideoUIView.m +++ b/modules/video_output/apple/VLCVideoUIView.m @@ -120,6 +120,11 @@ _tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized:)]; +CGSize size = _viewContainer.bounds.size; +[self reportEvent:^{ +vout_window_ReportSize(_wnd, size.width, size.height); +}]; + return self; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] configure.ac: simplify GBM package check
vlc | branch: master | Alexandre Janniaux | Fri Apr 16 10:28:06 2021 +0200| [82f607772c4e72a6e7ca858caa5e2db4faef67bd] | committer: Alexandre Janniaux configure.ac: simplify GBM package check > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82f607772c4e72a6e7ca858caa5e2db4faef67bd --- configure.ac | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index b774a34ddc..8dddeb148b 100644 --- a/configure.ac +++ b/configure.ac @@ -4470,20 +4470,7 @@ AS_IF([test "${enable_osx_notifications}" != "no"], [ dnl dnl Check for GBM dnl -AC_ARG_ENABLE([gbm], - AS_HELP_STRING([--enable-gbm], -[Use GBM for egl_pbuffer (default enabled)])) -have_gbm="no" -AS_IF([test "${enable_gbm}" != "no"], [ - PKG_CHECK_MODULES([GBM], [gbm], [have_gbm="yes"], [ -AS_IF([test -n "${enable_gbm}"], [ - AC_MSG_ERROR([${GBM_PKG_ERRORS}.]) -], [ - AC_MSG_WARN([${GBM_PKG_ERRORS}.]) -]) - ]) -]) -AM_CONDITIONAL([HAVE_GBM], [test "${have_gbm}" = "yes"]) +PKG_HAVE_WITH_MODULES([GBM], [gbm]) dnl dnl Libnotify notification plugin ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] VLCOpenGLES2VideoView: enforce initial frame size
vlc | branch: master | Alexandre Janniaux | Thu Feb 18 15:01:12 2021 +0100| [e952d4e4186118d62cc490a8a59a612a4fbd973d] | committer: Alexandre Janniaux VLCOpenGLES2VideoView: enforce initial frame size The UIView should have a well-defined size from the start. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e952d4e4186118d62cc490a8a59a612a4fbd973d --- modules/video_output/apple/VLCOpenGLES2VideoView.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/video_output/apple/VLCOpenGLES2VideoView.m b/modules/video_output/apple/VLCOpenGLES2VideoView.m index 0d617d30b6..fb452bba81 100644 --- a/modules/video_output/apple/VLCOpenGLES2VideoView.m +++ b/modules/video_output/apple/VLCOpenGLES2VideoView.m @@ -470,8 +470,7 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height) /* setup the actual OpenGL ES view */ dispatch_sync(dispatch_get_main_queue(), ^{ gl->sys = (__bridge_retained void*)[[VLCOpenGLES2VideoView alloc] - // TODO better rect - initWithFrame:CGRectMake(0.,0.,320.,240.) gl:gl]; + initWithFrame:CGRectMake(0.,0.,width,height) gl:gl]; }); if (gl->sys == NULL) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] VLCVideoUIView: report event in another thread
vlc | branch: master | Alexandre Janniaux | Thu Feb 18 16:23:54 2021 +0100| [14fdbf872d48473894c1ad8e4da09fd9c3753346] | committer: Alexandre Janniaux VLCVideoUIView: report event in another thread Report events from a different thread than the main thread, and continue to execute the main CFRunLoop, but filter the events to only execute the ones queued by potential display, ie. those tagged with the mode "vlc_runloop". The vlc_runloop mode is designed to be executed even when an event is being reported by the vout_window used, ie. when there is a call to CFRunLoopInMode(CFRunLoopGetMain(), CFSTR("vlc_runloop"), ..). Clients should ensure they also tag their blocks with the default mode too. Otherwise, they are likely to never be executed. Async tasks can still be dispatched without the "vlc_runloop" mode but every sync tasks in the display must be done under this mode to prevent deadlock from happening between the main thread and the vout_thread, typically with the following code: /* The main loop to run the block into */ CFRunLoopRef runloop = CFRunLoopGetMain(); /* The modes to execute the block in */ CFStringRef modes_cfstrings[] = { kCFRunLoopDefaultMode, CFSTR("vlc_runloop") }; CFArrayRef modes = CFArrayCreate(NULL, (const void **)modes_cfstrings, ARRAY_SIZE(modes_cfstrings), &kCFTypeArrayCallBacks); CFRunLoopPerformBlock(runloop, modes, ^{ /* The block content to execute */ }); /* Don't forget to signal the runloop CFRunLoopWakeUp(runloop); CFRelease(modes); To achieve a blocking/sync behaviour, clients can share a binary semaphore between the block and the outside of the block. When using a vlc_sem_t object, it must be qualified with __block to be modified inside of the block. Refs #23571 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=14fdbf872d48473894c1ad8e4da09fd9c3753346 --- modules/video_output/apple/VLCVideoUIView.m | 46 ++--- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/modules/video_output/apple/VLCVideoUIView.m b/modules/video_output/apple/VLCVideoUIView.m index 3a4c749816..d5fc143beb 100644 --- a/modules/video_output/apple/VLCVideoUIView.m +++ b/modules/video_output/apple/VLCVideoUIView.m @@ -161,6 +161,20 @@ } } +- (void)reportEvent:(void(^)())eventBlock +{ +CFStringRef mode = CFSTR("org.videolan.vlccore.window"); +CFRunLoopRef runloop = CFRunLoopGetCurrent(); +CFRunLoopPerformBlock(runloop, mode, ^{ +dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{ +(eventBlock)(); +CFRunLoopStop(runloop); +}); +}); +CFRunLoopWakeUp(runloop); +CFRunLoopRunInMode(mode, 0, NO); +} + - (void)detachFromParent { /* We need to lock because we consider that _wnd might be destroyed @@ -263,11 +277,16 @@ /* We need to lock to ensure _wnd is still valid, see detachFromParent. */ vlc_mutex_lock(&_mutex); if (_wnd == NULL) -goto end; -vout_window_ReportSize(_wnd, -viewSize.width * scaleFactor, -viewSize.height * scaleFactor); -end: +{ +vlc_mutex_unlock(&_mutex); +return; +} + +[self reportEvent:^{ +vout_window_ReportSize(_wnd, +viewSize.width * scaleFactor, +viewSize.height * scaleFactor); +}]; vlc_mutex_unlock(&_mutex); } @@ -280,12 +299,17 @@ end: /* We need to lock to ensure _wnd is still valid, see detachFromParent. */ vlc_mutex_lock(&_mutex); if (_wnd == NULL) -goto end; -vout_window_ReportMouseMoved(_wnd, -(int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor); -vout_window_ReportMousePressed(_wnd, MOUSE_BUTTON_LEFT); -vout_window_ReportMouseReleased(_wnd, MOUSE_BUTTON_LEFT); -end: +{ +vlc_mutex_unlock(&_mutex); +return; +} + +[self reportEvent:^{ +vout_window_ReportMouseMoved(_wnd, +(int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor); +vout_window_ReportMousePressed(_wnd, MOUSE_BUTTON_LEFT); +vout_window_ReportMouseReleased(_wnd, MOUSE_BUTTON_LEFT); +}]; vlc_mutex_unlock(&_mutex); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] VLCOpenGLES2VideoView: use dedicated CFRunLoop mode
vlc | branch: master | Alexandre Janniaux | Thu Feb 18 15:01:12 2021 +0100| [b4c7561cadc93293fde611363379f847d3ad07a7] | committer: Alexandre Janniaux VLCOpenGLES2VideoView: use dedicated CFRunLoop mode The vlc_runloop mode is designed to be executed even when an event is being reported by the vout_window used, ie when there is a call to CFRunLoopInMode(CFRunLoopGetMain(), CFSTR("vlc_runloop"), ..). By adding the default mode too, it ensures it would run in the normal CFRunLoop too. Async tasks can still be dispatched without the "vlc_runloop" mode but every sync task in the display must be done under this mode to prevent deadlock from happening between the main thread and the vout_thread. Fixes #23571 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b4c7561cadc93293fde611363379f847d3ad07a7 --- modules/video_output/apple/VLCOpenGLES2VideoView.m | 37 -- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/modules/video_output/apple/VLCOpenGLES2VideoView.m b/modules/video_output/apple/VLCOpenGLES2VideoView.m index fb452bba81..fc6ba8e274 100644 --- a/modules/video_output/apple/VLCOpenGLES2VideoView.m +++ b/modules/video_output/apple/VLCOpenGLES2VideoView.m @@ -79,6 +79,35 @@ - (void)detachFromWindow; @end +static void vlc_dispatch_sync(void (^block_function)()) +{ +CFRunLoopRef runloop = CFRunLoopGetMain(); + +__block vlc_sem_t performed; +vlc_sem_init(&performed, 0); + +CFStringRef modes_cfstrings[] = { +kCFRunLoopDefaultMode, +CFSTR("org.videolan.vlccore.window"), +}; + +CFArrayRef modes = CFArrayCreate(NULL, (const void **)modes_cfstrings, +ARRAY_SIZE(modes_cfstrings), +&kCFTypeArrayCallBacks); + +/* NOTE: we're using CFRunLoopPerformBlock with a custom mode tag + * to avoid deadlocks between the window module (main thread) and the + * display module, which would happen when using dispatch_sycn here. */ +CFRunLoopPerformBlock(runloop, modes, ^{ +(block_function)(); +vlc_sem_post(&performed); +}); +CFRunLoopWakeUp(runloop); + +vlc_sem_wait(&performed); +CFRelease(modes); +} + /* * vlc_gl_t callbacks */ @@ -466,9 +495,11 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height) if (wnd->type != VOUT_WINDOW_TYPE_NSOBJECT) return VLC_EGENERIC; - @autoreleasepool { -/* setup the actual OpenGL ES view */ -dispatch_sync(dispatch_get_main_queue(), ^{ +@autoreleasepool { +/* NOTE: we're using CFRunLoopPerformBlock with the "vlc_runloop" tag + * to avoid deadlocks between the window module (main thread) and the + * display module, which would happen when using dispatch_sycn here. */ +vlc_dispatch_sync(^{ gl->sys = (__bridge_retained void*)[[VLCOpenGLES2VideoView alloc] initWithFrame:CGRectMake(0.,0.,width,height) gl:gl]; }); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] inhibit: add UIKit-based inhibiter
vlc | branch: master | Alexandre Janniaux | Wed Apr 14 11:42:58 2021 +0200| [a24a9b28992c66731354c2c8448e31f5f4ed37ba] | committer: Alexandre Janniaux inhibit: add UIKit-based inhibiter The inhibiter code is taken from VLCKit inhibiter's handling, and is meant to replace this handling. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a24a9b28992c66731354c2c8448e31f5f4ed37ba --- modules/misc/Makefile.am | 12 ++- modules/misc/inhibit/uikit-inhibit.m | 67 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/modules/misc/Makefile.am b/modules/misc/Makefile.am index bc3252ab22..ef024f3a20 100644 --- a/modules/misc/Makefile.am +++ b/modules/misc/Makefile.am @@ -52,6 +52,17 @@ libiokit_inhibit_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,-framework,CoreFoundation misc_LTLIBRARIES += libiokit_inhibit_plugin.la endif +libuikit_inhibit_plugin_la_SOURCES = misc/inhibit/uikit-inhibit.m +libuikit_inhibit_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,-framework,UIKit,-framework,Foundation +libuikit_inhibit_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) -fobjc-arc +if HAVE_IOS +misc_LTLIBRARIES += libuikit_inhibit_plugin.la +endif + +if HAVE_TVOS +misc_LTLIBRARIES += libuikit_inhibit_plugin.la +endif + libxdg_screensaver_plugin_la_SOURCES = misc/inhibit/xdg.c if HAVE_XCB if !HAVE_WIN32 @@ -129,4 +140,3 @@ libmedialibrary_plugin_la_LIBADD = $(MEDIALIBRARY_LIBS) libmedialibrary_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(miscdir)' EXTRA_LTLIBRARIES += libmedialibrary_plugin.la misc_LTLIBRARIES += $(LTLIBmedialibrary) - diff --git a/modules/misc/inhibit/uikit-inhibit.m b/modules/misc/inhibit/uikit-inhibit.m new file mode 100644 index 00..ab5536d4e6 --- /dev/null +++ b/modules/misc/inhibit/uikit-inhibit.m @@ -0,0 +1,67 @@ +/* + * Copyright © 2021 Videolabs + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + */ + +/** + * \file uikit-inhibit.m + * \brief iOS display and idle sleep inhibitor using UIKit + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#include + +static void UpdateInhibit(vlc_inhibit_t *ih, unsigned mask) +{ +[UIApplication sharedApplication].idleTimerDisabled = +(mask & VLC_INHIBIT_DISPLAY) == VLC_INHIBIT_DISPLAY; +} + +static int OpenInhibit(vlc_object_t *obj) +{ +vlc_inhibit_t *ih = (vlc_inhibit_t *)obj; +vout_window_t *wnd = vlc_inhibit_GetWindow(ih); +if (wnd->type != VOUT_WINDOW_TYPE_NSOBJECT) +return VLC_EGENERIC; + +UIView * view = (__bridge UIView*)wnd->handle.nsobject; + +if (unlikely(![view respondsToSelector:@selector(isKindOfClass:)])) +return VLC_EGENERIC; + +if (![view isKindOfClass:[UIView class]]) +return VLC_EGENERIC; + +ih->inhibit = UpdateInhibit; +return VLC_SUCCESS; +} + +vlc_module_begin() +set_shortname("UIKit sleep inhibition") +set_description("UIKit screen sleep inhibition for iOS and tvOS") +set_category(CAT_ADVANCED) +set_subcategory(SUBCAT_ADVANCED_MISC) +set_capability("inhibit", 10) +set_callback(OpenInhibit) +vlc_module_end() ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] avcodec: encoder: fix comment location
vlc | branch: master | Alexandre Janniaux | Wed Apr 14 10:05:29 2021 +0200| [9c05197257f479469ac1ef403f7245685cfb00a5] | committer: Alexandre Janniaux avcodec: encoder: fix comment location > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c05197257f479469ac1ef403f7245685cfb00a5 --- modules/codec/avcodec/encoder.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c index 15b19a756b..21f21b0673 100644 --- a/modules/codec/avcodec/encoder.c +++ b/modules/codec/avcodec/encoder.c @@ -227,10 +227,6 @@ static const uint16_t mpeg4_default_non_intra_matrix[64] = { static const int DEFAULT_ALIGN = 0; - -/* - * InitVideoEnc: probe the encoder - */ static void probe_video_frame_rate( encoder_t *p_enc, AVCodecContext *p_context, AVCodec *p_codec ) { /* if we don't have i_frame_rate_base, we are probing and just checking if we can find codec @@ -292,6 +288,9 @@ static void add_av_option_float( encoder_t *p_enc, AVDictionary** pp_dict, const msg_Warn( p_enc, "Failed to set encoder option %s", psz_name ); } +/* + * InitVideoEnc: probe the encoder + */ int InitVideoEnc( vlc_object_t *p_this ) { encoder_t *p_enc = (encoder_t *)p_this; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: Makefile.am: compile vlccoreios for tvOS
vlc | branch: master | Alexandre Janniaux | Sat Feb 20 16:59:34 2021 +0100| [64b2d98d664c97fb557c172a363e092bd5c856df] | committer: Alexandre Janniaux test: Makefile.am: compile vlccoreios for tvOS > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=64b2d98d664c97fb557c172a363e092bd5c856df --- test/Makefile.am | 4 1 file changed, 4 insertions(+) diff --git a/test/Makefile.am b/test/Makefile.am index 693acf0edc..1142d55387 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -300,3 +300,7 @@ vlccoreios_LDADD = ../lib/libvlc.la ../src/libvlccore.la if HAVE_IOS noinst_PROGRAMS += vlccoreios endif + +if HAVE_TVOS +noinst_PROGRAMS += vlccoreios +endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: iosvlc: disable pinchRecognizer on tvOS
vlc | branch: master | Alexandre Janniaux | Sun Feb 21 14:35:51 2021 +0100| [54c392d7be7f73af6fabcf542c3c2670db00ff1a] | committer: Alexandre Janniaux test: iosvlc: disable pinchRecognizer on tvOS The pinch recognizer cannot work on tvOS, since tvOS doesn't have a touchscreen. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=54c392d7be7f73af6fabcf542c3c2670db00ff1a --- test/iosvlc.m | 10 ++ 1 file changed, 10 insertions(+) diff --git a/test/iosvlc.m b/test/iosvlc.m index 12c1391343..f95fa5fee2 100644 --- a/test/iosvlc.m +++ b/test/iosvlc.m @@ -32,12 +32,17 @@ #include #include +#include + @interface AppDelegate : UIResponder { @public libvlc_instance_t *_libvlc; UIWindow *window; UIView *subview; + +#if TARGET_OS_IOS UIPinchGestureRecognizer *_pinchRecognizer; +#endif CGRect _pinchRect; CGPoint _pinchOrigin; @@ -47,6 +52,7 @@ @implementation AppDelegate +#if TARGET_OS_IOS - (void)pinchRecognized:(UIPinchGestureRecognizer *)pinchRecognizer { UIGestureRecognizerState state = [pinchRecognizer state]; @@ -78,6 +84,8 @@ _pinchPreviousCenter.x + newPosition.x - _pinchOrigin.x, _pinchPreviousCenter.y + newPosition.y - _pinchOrigin.y); } +#endif + /* Called after application launch */ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { @@ -112,9 +120,11 @@ [window addSubview:subview]; [window makeKeyAndVisible]; +#if TARGET_OS_IOS _pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchRecognized:)]; [window addGestureRecognizer:_pinchRecognizer]; +#endif /* Start glue interface, see code below */ libvlc_add_intf(_libvlc, "ios_interface,none"); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] video_output: fix comment and move do_snapshot
vlc | branch: master | Alexandre Janniaux | Mon Mar 22 10:14:40 2021 +0100| [4290c57223bfa8f24e6467d00d024085c7be6fdb] | committer: Alexandre Janniaux video_output: fix comment and move do_snapshot The comment /* Get the subpicture to be displayed */ was written twice in places where no subpictures were involved. In addition, do_snapshot was computed where the rendering date was computed although it was not used there. Move the do_snapshot computation just before it's used, replace the misplaced comments by comment actually describing what's follow, and rewrite the removed comment where spu_Render actually returns the subpicture. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4290c57223bfa8f24e6467d00d024085c7be6fdb --- src/video_output/video_output.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 00dd9ac9ce..8db6746725 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -1126,9 +1126,8 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now) vlc_mutex_lock(&sys->display_lock); /* - * Get the subpicture to be displayed + * Get the rendering date for the current subpicture to be displayed. */ -const bool do_snapshot = vout_snapshot_IsRequested(sys->snapshot); vlc_tick_t system_now = vlc_tick_now(); vlc_tick_t render_subtitle_date; if (sys->pause.is_on) @@ -1150,8 +1149,11 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now) } /* - * Get the subpicture to be displayed + * Check whether we let the display draw the subpicture itself (when + * do_dr_spu=true), and if we can fallback to blending the subpicture + * ourselves (do_early_spu=true). */ +const bool do_snapshot = vout_snapshot_IsRequested(sys->snapshot); const bool do_dr_spu = !do_snapshot && vd->info.subpicture_chromas && *vd->info.subpicture_chromas != 0; @@ -1203,6 +1205,7 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now) } } +/* Get the subpicture to be displayed. */ video_format_t fmt_spu_rot; video_format_ApplyRotation(&fmt_spu_rot, &fmt_spu); subpicture_t *subpic = !sys->spu ? NULL : ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] block: double the possible allocation size
vlc | branch: master | Alexandre Janniaux | Thu Apr 8 15:07:25 2021 +0200| [b0ed24abab66fd07155a5476cb02c50b7baf57d4] | committer: Alexandre Janniaux block: double the possible allocation size An 8k RGB image doesn't fit within the maximum allocation size constraint installed in block_Alloc. Indeed, 2^27 is 134217728 while the RGB 8k jpeg image sample in #19979 will allocate 201326592. In general, 8k with 4 byte per pixel can go up to 132710400, without taking into account additional padding, so doubling the allocation size is enough to handle those pictures, while keeping a limit for the maximum allocation size. Fixes #19979 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b0ed24abab66fd07155a5476cb02c50b7baf57d4 --- src/misc/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/block.c b/src/misc/block.c index 74da567145..a334c33a23 100644 --- a/src/misc/block.c +++ b/src/misc/block.c @@ -107,7 +107,7 @@ static void BlockMetaCopy( block_t *restrict out, const block_t *in ) block_t *block_Alloc (size_t size) { -if (unlikely(size >> 27)) +if (unlikely(size >> 28)) { errno = ENOBUFS; return NULL; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] egl_pbuffer: fix missing file for distcheck
vlc | branch: master | Alexandre Janniaux | Wed Mar 31 10:53:42 2021 +0200| [462670f4d4bb58f9d30b0b8844d98625de4dccf9] | committer: Alexandre Janniaux egl_pbuffer: fix missing file for distcheck > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=462670f4d4bb58f9d30b0b8844d98625de4dccf9 --- modules/video_output/opengl/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/video_output/opengl/Makefile.am b/modules/video_output/opengl/Makefile.am index d496093d75..2273a737e9 100644 --- a/modules/video_output/opengl/Makefile.am +++ b/modules/video_output/opengl/Makefile.am @@ -106,7 +106,7 @@ endif endif libegl_pbuffer_filter_plugin_la_SOURCES = video_filter/egl_pbuffer.c \ -video_output/opengl/egl_display.c +video_output/opengl/egl_display.c video_output/opengl/egl_display.h libegl_pbuffer_filter_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_FLAGS) libegl_pbuffer_filter_plugin_la_LIBADD = $(EGL_LIBS) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] egl_display: add GBM platform support
vlc | branch: master | Alexandre Janniaux | Mon Mar 22 16:06:25 2021 +0100| [db48d216824315ddf5240bd73175cbe7fbfe220d] | committer: Alexandre Janniaux egl_display: add GBM platform support GBM platform allows to provide an EGL context even without display server. Co-authored-by: Romain Vimont > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=db48d216824315ddf5240bd73175cbe7fbfe220d --- configure.ac | 18 modules/video_output/opengl/Makefile.am | 9 ++ modules/video_output/opengl/egl_display_gbm.c | 132 ++ 3 files changed, 159 insertions(+) diff --git a/configure.ac b/configure.ac index ea0bb759f3..b774a34ddc 100644 --- a/configure.ac +++ b/configure.ac @@ -4467,6 +4467,24 @@ AS_IF([test "${enable_osx_notifications}" != "no"], [ VLC_ADD_PLUGIN([osx_notifications]) ]) +dnl +dnl Check for GBM +dnl +AC_ARG_ENABLE([gbm], + AS_HELP_STRING([--enable-gbm], +[Use GBM for egl_pbuffer (default enabled)])) +have_gbm="no" +AS_IF([test "${enable_gbm}" != "no"], [ + PKG_CHECK_MODULES([GBM], [gbm], [have_gbm="yes"], [ +AS_IF([test -n "${enable_gbm}"], [ + AC_MSG_ERROR([${GBM_PKG_ERRORS}.]) +], [ + AC_MSG_WARN([${GBM_PKG_ERRORS}.]) +]) + ]) +]) +AM_CONDITIONAL([HAVE_GBM], [test "${have_gbm}" = "yes"]) + dnl dnl Libnotify notification plugin dnl diff --git a/modules/video_output/opengl/Makefile.am b/modules/video_output/opengl/Makefile.am index c7cbdedfb6..d496093d75 100644 --- a/modules/video_output/opengl/Makefile.am +++ b/modules/video_output/opengl/Makefile.am @@ -96,6 +96,15 @@ if HAVE_EGL vout_LTLIBRARIES += libegl_display_generic_plugin.la endif +libegl_display_gbm_plugin_la_SOURCES = video_output/opengl/egl_display_gbm.c +libegl_display_gbm_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_FLAGS) $(GBM_CFLAGS) +libegl_display_gbm_plugin_la_LIBADD = $(EGL_LIBS) $(GBM_LIBS) +if HAVE_EGL +if HAVE_GBM +vout_LTLIBRARIES += libegl_display_gbm_plugin.la +endif +endif + libegl_pbuffer_filter_plugin_la_SOURCES = video_filter/egl_pbuffer.c \ video_output/opengl/egl_display.c libegl_pbuffer_filter_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_FLAGS) diff --git a/modules/video_output/opengl/egl_display_gbm.c b/modules/video_output/opengl/egl_display_gbm.c new file mode 100644 index 00..ab2635cd12 --- /dev/null +++ b/modules/video_output/opengl/egl_display_gbm.c @@ -0,0 +1,132 @@ +/* + * egl_display_gbm.c + * + * Copyright (C) 2021 Videolabs + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "egl_display.h" + +struct sys +{ +struct gbm_device *device; +int fd; +}; + +static void Close(struct vlc_egl_display *display) +{ +struct sys *sys = display->sys; + +assert(sys->device); +assert(sys->fd >= 0); + +gbm_device_destroy(sys->device); +vlc_close(sys->fd); + +free(sys); +} + +static int +OpenDeviceFd(const char **out_path) +{ +static const char *default_drm_device_paths[] = { +"/dev/dri/renderD128", +"/dev/dri/card0", +"/dev/dri/renderD129", +"/dev/dri/card1", +}; + +for (size_t i = 0; i < ARRAY_SIZE(default_drm_device_paths); ++i) +{ +const char *path = default_drm_device_paths[i]; +int fd = vlc_open(path, O_RDWR); +if (fd >= 0) +{ +*out_path = path; +return fd; +} +} + +return -1; +} + +static vlc_egl_display_open_fn Open; +static int +Open(struct vlc_egl_display *display) +{ +struct sys *sys = display->sys = malloc(sizeof(*sys)); +if (!sys) +return VLC_EGENERIC; + +const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); +if (!exte
[vlc-commits] egl_pbuffer: add support for surfaceless context
vlc | branch: master | Alexandre Janniaux | Mon Mar 22 16:06:23 2021 +0100| [ab9699749c6f862529c29ee5551f2b206ef520af] | committer: Alexandre Janniaux egl_pbuffer: add support for surfaceless context If the EGL extension EGL_KHR_surfaceless_context is available, create a surfaceless context. Co-authored-by: Romain Vimont > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab9699749c6f862529c29ee5551f2b206ef520af --- modules/video_filter/egl_pbuffer.c | 37 ++--- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/modules/video_filter/egl_pbuffer.c b/modules/video_filter/egl_pbuffer.c index 64bee6b403..7ac4ebf0b7 100644 --- a/modules/video_filter/egl_pbuffer.c +++ b/modules/video_filter/egl_pbuffer.c @@ -158,7 +158,11 @@ static int InitEGL(vlc_gl_t *gl, unsigned width, unsigned height) #endif ); -const EGLint conf_attr[] = { +const char *extensions = eglQueryString(sys->display, EGL_EXTENSIONS); +bool need_surface = +!vlc_gl_StrHasToken(extensions, "EGL_KHR_surfaceless_context"); + +static const EGLint conf_attr_surface[] = { EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, @@ -170,6 +174,19 @@ static int InitEGL(vlc_gl_t *gl, unsigned width, unsigned height) EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, EGL_NONE, }; + +static const EGLint conf_attr_surfaceless[] = { +#ifdef USE_OPENGL_ES2 +EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, +#else +EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, +#endif +EGL_NONE, +}; + +const EGLint *conf_attr = need_surface ? conf_attr_surface + : conf_attr_surfaceless; + EGLConfig cfgv[1]; EGLint cfgc; @@ -187,14 +204,20 @@ static int InitEGL(vlc_gl_t *gl, unsigned width, unsigned height) goto error; } -/* Create a drawing surface */ -sys->surface = eglCreatePbufferSurface(sys->display, cfgv[0], surface_attr); -if (sys->surface == EGL_NO_SURFACE) +if (need_surface) { -msg_Err (gl, "cannot create EGL window surface"); -assert(false); -goto error; +/* Create a drawing surface */ +sys->surface = eglCreatePbufferSurface(sys->display, cfgv[0], + surface_attr); +if (sys->surface == EGL_NO_SURFACE) +{ +msg_Err (gl, "cannot create EGL window surface"); +assert(false); +goto error; +} } +else +sys->surface = EGL_NO_SURFACE; #ifdef USE_OPENGL_ES2 if (eglBindAPI (EGL_OPENGL_ES_API) != EGL_TRUE) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: mp4: remove duplicated if branch
vlc | branch: master | Alexandre Janniaux | Sat Mar 20 10:54:42 2021 +0100| [be3c563b570a7e114012b12ad9d3965cf6731ac5] | committer: Alexandre Janniaux demux: mp4: remove duplicated if branch This is exactly the same code as right above. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=be3c563b570a7e114012b12ad9d3965cf6731ac5 --- modules/demux/mp4/mp4.c | 8 1 file changed, 8 deletions(-) diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c index fe739f0893..4dac835a4d 100644 --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -2717,14 +2717,6 @@ static int TrackCreateSamplesIndex( demux_t *p_demux, i_cts_shift = -ctts->pi_sample_offset[i]; } } -else if( ctts->i_entry_count ) /* Compute for Quicktime */ -{ -for( uint32_t i = 0; i < ctts->i_entry_count; i++ ) -{ -if( ctts->pi_sample_offset[i] < 0 && ctts->pi_sample_offset[i] < -i_cts_shift ) -i_cts_shift = -ctts->pi_sample_offset[i]; -} -} /* Create pts-dts table per chunk */ uint32_t i_index = 0; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] display: assert that we handle all crop cases
vlc | branch: master | Alexandre Janniaux | Mon Mar 22 10:01:45 2021 +0100| [4d04dd0981d7f9823a3d2887cfe41707aadd2b82] | committer: Alexandre Janniaux display: assert that we handle all crop cases Otherwise, left/right/top/bottom will not be initialized when used, probably leading to strange cropping being used. It fixes -Wmaybe-uninitialized warnings with GCC 10.2.0. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d04dd0981d7f9823a3d2887cfe41707aadd2b82 --- src/video_output/display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_output/display.c b/src/video_output/display.c index 06dd9533db..ff665d2af5 100644 --- a/src/video_output/display.c +++ b/src/video_output/display.c @@ -471,6 +471,9 @@ static int vout_UpdateSourceCrop(vout_display_t *vd) right = -(int)osys->crop.border.right; bottom = -(int)osys->crop.border.bottom; break; +default: +/* left/top/right/bottom must be initialized */ +vlc_assert_unreachable(); } const int right_max = osys->source.i_x_offset ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dvdnav: use designated initializer for callback structure
vlc | branch: master | Alexandre Janniaux | Mon Mar 15 18:15:36 2021 +0100| [69742a6224b28dfdad6bd9c73e2e282f1503681a] | committer: Alexandre Janniaux dvdnav: use designated initializer for callback structure So that we don't give an uninitialized field if the structure expands in dvdnav. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=69742a6224b28dfdad6bd9c73e2e282f1503681a --- modules/access/dvdnav.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c index 29170ae832..d673a7348f 100644 --- a/modules/access/dvdnav.c +++ b/modules/access/dvdnav.c @@ -422,8 +422,7 @@ static int AccessDemuxOpen ( vlc_object_t *p_this ) /* Open dvdnav */ psz_path = ToLocale( psz_file ); #if DVDNAV_VERSION >= 60100 -dvdnav_logger_cb cbs; -cbs.pf_log = DvdNavLog; +dvdnav_logger_cb cbs = { .pf_log = DvdNavLog }; if( dvdnav_open2( &p_dvdnav, p_demux, &cbs, psz_path ) != DVDNAV_STATUS_OK ) #else if( dvdnav_open( &p_dvdnav, psz_path ) != DVDNAV_STATUS_OK ) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] dvdread: use designated initializer for callback structure
vlc | branch: master | Alexandre Janniaux | Mon Mar 15 18:15:35 2021 +0100| [c3cb5de81f2eb9f38ccba60435bbb8f3bfcc898b] | committer: Alexandre Janniaux dvdread: use designated initializer for callback structure So that we don't give an uninitialized field if the structure expands in dvdread. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3cb5de81f2eb9f38ccba60435bbb8f3bfcc898b --- modules/access/dvdread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c index bd5cb84b3a..4f1c8ae9f7 100644 --- a/modules/access/dvdread.c +++ b/modules/access/dvdread.c @@ -205,8 +205,7 @@ static int Open( vlc_object_t *p_this ) /* Open dvdread */ const char *psz_path = ToLocale( psz_file ); #if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0) -dvd_logger_cb cbs; -cbs.pf_log = DvdReadLog; +dvd_logger_cb cbs = { .pf_log = DvdReadLog }; dvd_reader_t *p_dvdread = DVDOpen2( p_demux, &cbs, psz_path ); #else dvd_reader_t *p_dvdread = DVDOpen( psz_path ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: Info.plist: allow vlccoreios to share documents
vlc | branch: master | Alexandre Janniaux | Thu Mar 18 14:20:25 2021 +0100| [04eb0e857dac1df48909ccffd662333fa2fdc5ea] | committer: Alexandre Janniaux apple: Info.plist: allow vlccoreios to share documents > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04eb0e857dac1df48909ccffd662333fa2fdc5ea --- extras/package/apple/Info.plist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extras/package/apple/Info.plist b/extras/package/apple/Info.plist index e1d8d28d7f..046b6d5b2f 100644 --- a/extras/package/apple/Info.plist +++ b/extras/package/apple/Info.plist @@ -49,6 +49,8 @@ 1 2 + UIFileSharingEnabled + UILaunchImages ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] package: raspberry: remove set -x
vlc | branch: master | Alexandre Janniaux | Sat Jan 9 10:43:15 2021 +0100| [ded741dd0388a460a9bf028ef82a77daef48ad3d] | committer: Alexandre Janniaux package: raspberry: remove set -x > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ded741dd0388a460a9bf028ef82a77daef48ad3d --- extras/package/raspberry/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/extras/package/raspberry/build.sh b/extras/package/raspberry/build.sh index a3c4dff2f2..1e8c06427f 100755 --- a/extras/package/raspberry/build.sh +++ b/extras/package/raspberry/build.sh @@ -1,7 +1,6 @@ #!/bin/sh set -e -set -x info() { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] configure.ac: fix mmal CFLAGS/LDFLAGS definition
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:51 2021 +0100| [d9552fa0ba5eb0d9ff2473f07bc723d94c710b2a] | committer: Alexandre Janniaux configure.ac: fix mmal CFLAGS/LDFLAGS definition The MMAL_CFLAGS / MMAL_LIBS will be used in the Makefile.am instead of the plugin defined flags, since there are multiple plugins, and in addition of a HAVE_MMAL conditional. In addition, -L flags are LIBADD flags, and not LDFLAGS flags, so it's actually put into MMAL_LIBS instead of defining a MMAL_LDFLAGS. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d9552fa0ba5eb0d9ff2473f07bc723d94c710b2a --- configure.ac | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a82c956c70..decb95652e 100644 --- a/configure.ac +++ b/configure.ac @@ -3756,6 +3756,8 @@ AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"]) dnl dnl MMAL plugin dnl +MMAL_CFLAGS="" +MMAL_LIBS="" AC_ARG_ENABLE([mmal], AS_HELP_STRING([--enable-mmal], [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)])) @@ -3769,8 +3771,11 @@ if test "${enable_mmal}" != "no"; then VLC_ADD_PLUGIN([mmal]) VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ]) VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ]) -VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) ], [ - AS_IF([test "${enable_mmal}" = "yes"], +VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) +MMAL_CFLAGS="-isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux" +MMAL_LIBS="-L/opt/vc/lib -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm" +],[ +AS_IF([test "${enable_mmal}" = "yes"], [ AC_MSG_ERROR([Cannot find bcm library...]) ], [ AC_MSG_WARN([Cannot find bcm library...]) ]) ], @@ -3780,6 +3785,8 @@ if test "${enable_mmal}" != "no"; then [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ]) VLC_RESTORE_FLAGS fi +AC_SUBST([MMAL_CFLAGS]) +AC_SUBST([MMAL_LIBS]) AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"]) dnl ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mmal: Makefile.am: fix mmal plugin definition
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:52 2021 +0100| [38db98d6ceb14f970d6b4bb965408fde04c39552] | committer: Alexandre Janniaux mmal: Makefile.am: fix mmal plugin definition Use only the MMAL_CFLAGS/MMAL_LIBS instead of sharing the flags of a non-existant plugin. In addition, LDFLAGS is for linker flags different from the -l or -L ones, and -rpath only needs to be defined when using conditional compilation from autoconf (LTLIB and VLC_ADD_PLUGIN) so the MMAL_LIBS must go to LIBADD. In prevision of the removal of the recursive Makefile.am, use the MMAL_CFLAGS on every targets that needs them. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38db98d6ceb14f970d6b4bb965408fde04c39552 --- modules/hw/mmal/Makefile.am | 42 +++--- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/modules/hw/mmal/Makefile.am b/modules/hw/mmal/Makefile.am index 023adb774a..3d899645dd 100644 --- a/modules/hw/mmal/Makefile.am +++ b/modules/hw/mmal/Makefile.am @@ -1,39 +1,35 @@ include $(top_srcdir)/modules/common.am mmaldir = $(pluginsdir)/mmal -AM_CFLAGS += $(CFLAGS_mmal) -AM_LDFLAGS += -rpath '$(mmaldir)' $(LDFLAGS_mmal) - libmmal_vout_plugin_la_SOURCES = vout.c subpic.c subpic.h mmal_picture.c mmal_picture.h \ mmal_cma.c mmal_cma.h -libmmal_vout_plugin_la_CFLAGS = $(AM_CFLAGS) -libmmal_vout_plugin_la_LDFLAGS = $(AM_LDFLAGS) -lm -libmmal_vout_plugin_la_LIBADD = $(LIBS_mmal) -mmal_LTLIBRARIES = libmmal_vout_plugin.la +libmmal_vout_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) +libmmal_vout_plugin_la_LIBADD = $(MMAL_LIBS) $(LIBM) libmmal_codec_plugin_la_SOURCES = codec.c subpic.c subpic.h mmal_picture.c mmal_picture.h \ mmal_cma.c mmal_cma.h -libmmal_codec_plugin_la_CFLAGS = $(AM_CFLAGS) -libmmal_codec_plugin_la_LDFLAGS = $(AM_LDFLAGS) -libmmal_codec_plugin_la_LIBADD = $(LIBS_mmal) -mmal_LTLIBRARIES += libmmal_codec_plugin.la +libmmal_codec_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) +libmmal_codec_plugin_la_LIBADD = $(MMAL_LIBS) libmmal_converter_plugin_la_SOURCES = converter.c subpic.c subpic.h mmal_picture.c mmal_picture.h \ mmal_cma.c mmal_cma.h -libmmal_converter_plugin_la_CFLAGS = $(AM_CFLAGS) -libmmal_converter_plugin_la_LDFLAGS = $(AM_LDFLAGS) -libmmal_converter_plugin_la_LIBADD = $(LIBS_mmal) -mmal_LTLIBRARIES += libmmal_converter_plugin.la +libmmal_converter_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) +libmmal_converter_plugin_la_LIBADD = $(MMAL_LIBS) libmmal_deinterlace_plugin_la_SOURCES = deinterlace.c mmal_picture.c mmal_picture.h \ mmal_cma.c mmal_cma.h -libmmal_deinterlace_plugin_la_CFLAGS = $(AM_CFLAGS) -libmmal_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -libmmal_deinterlace_plugin_la_LIBADD = $(LIBS_mmal) -mmal_LTLIBRARIES += libmmal_deinterlace_plugin.la +libmmal_deinterlace_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) +libmmal_deinterlace_plugin_la_LIBADD = $(MMAL_LIBS) libmmal_device_plugin_la_SOURCES = decoder_device.c mmal_picture.h -libmmal_device_plugin_la_CFLAGS = $(AM_CFLAGS) -libmmal_device_plugin_la_LDFLAGS = $(AM_LDFLAGS) -libmmal_device_plugin_la_LIBADD = $(LIBS_mmal) -mmal_LTLIBRARIES += libmmal_device_plugin.la +libmmal_device_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) +libmmal_device_plugin_la_LIBADD = $(MMAL_LIBS) + +if HAVE_MMAL +mmal_LTLIBRARIES = \ + libmmal_device_plugin.la \ + libmmal_deinterlace_plugin.la \ + libmmal_converter_plugin.la \ + libmmal_codec_plugin.la \ + libmmal_vout_plugin.la +endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] Makefile.am: mmal: remove recursive Makefile target
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:55 2021 +0100| [4ef3f338ee382f8a897d6f1669605d14b99b656b] | committer: Alexandre Janniaux Makefile.am: mmal: remove recursive Makefile target Sort of revert 1d2b56c68bbc3287e17f6140bdf8c8c3efe08fdc but it actually finish the work done in ticket #9367 by removing the last recursive makefile target in modules/. It allows faster make (though not significant here) but most of all, sharing the same variable definition scope in modules/ for all makefiles. In particular, this facilitate for future work implementing partial linking at the module level, which actually needs the list of all plugins being compiled. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ef3f338ee382f8a897d6f1669605d14b99b656b --- configure.ac| 1 - modules/Makefile.am | 8 +--- modules/hw/mmal/Makefile.am | 16 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index ce7e36f186..ea0bb759f3 100644 --- a/configure.ac +++ b/configure.ac @@ -4645,7 +4645,6 @@ AC_CONFIG_FILES([ lib/Makefile bin/Makefile test/Makefile - modules/hw/mmal/Makefile share/vlc.appdata.xml.in ]) diff --git a/modules/Makefile.am b/modules/Makefile.am index e9f48422e0..a9b573ae8c 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -6,15 +6,8 @@ check_PROGRAMS = pkglibexec_PROGRAMS = EXTRA_DIST = -EXTRA_SUBDIRS = \ - hw/mmal SUBDIRS = . -DIST_SUBDIRS = . $(EXTRA_SUBDIRS) -if HAVE_MMAL -SUBDIRS += hw/mmal -endif - TESTS = dist_noinst_SCRIPTS = module.rc.in @@ -37,6 +30,7 @@ include hw/d3d9/Makefile.am include hw/d3d11/Makefile.am include hw/vaapi/Makefile.am include hw/vdpau/Makefile.am +include hw/mmal/Makefile.am include keystore/Makefile.am include logger/Makefile.am include lua/Makefile.am diff --git a/modules/hw/mmal/Makefile.am b/modules/hw/mmal/Makefile.am index 0815e37870..6ac3735340 100644 --- a/modules/hw/mmal/Makefile.am +++ b/modules/hw/mmal/Makefile.am @@ -1,28 +1,28 @@ -include $(top_srcdir)/modules/common.am mmaldir = $(pluginsdir)/mmal -libvlc_mmal_la_SOURCES = subpic.c subpic.h mmal_picture.c mmal_picture.h \ - mmal_cma.c mmal_cma.h +libvlc_mmal_la_SOURCES = hw/mmal/subpic.c hw/mmal/subpic.h \ + hw/mmal/mmal_picture.c hw/mmal/mmal_picture.h \ + hw/mmal/mmal_cma.c hw/mmal/mmal_cma.h libvlc_mmal_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) libvlc_mmal_la_LIBADD = $(MMAL_LIBS) -libmmal_vout_plugin_la_SOURCES = vout.c +libmmal_vout_plugin_la_SOURCES = hw/mmal/vout.c libmmal_vout_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) libmmal_vout_plugin_la_LIBADD = $(LIBM) libvlc_mmal.la -libmmal_codec_plugin_la_SOURCES = codec.c +libmmal_codec_plugin_la_SOURCES = hw/mmal/codec.c libmmal_codec_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) libmmal_codec_plugin_la_LIBADD = libvlc_mmal.la -libmmal_converter_plugin_la_SOURCES = converter.c +libmmal_converter_plugin_la_SOURCES = hw/mmal/converter.c libmmal_converter_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) libmmal_converter_plugin_la_LIBADD = libvlc_mmal.la -libmmal_deinterlace_plugin_la_SOURCES = deinterlace.c +libmmal_deinterlace_plugin_la_SOURCES = hw/mmal/deinterlace.c libmmal_deinterlace_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) libmmal_deinterlace_plugin_la_LIBADD = libvlc_mmal.la -libmmal_device_plugin_la_SOURCES = decoder_device.c +libmmal_device_plugin_la_SOURCES = hw/mmal/decoder_device.c libmmal_device_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) libmmal_device_plugin_la_LIBADD = libvlc_mmal.la ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] nvdec: Makefile.am: remove redundant LDFLAGS definition
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:56 2021 +0100| [c5181b2187f13373d09fc9f0f9dad53fa9f5ac8a] | committer: Alexandre Janniaux nvdec: Makefile.am: remove redundant LDFLAGS definition Without conditional activation of the plugins through autoconf, -rpath is always defined when adding the plugin libtool archive target to codec_LTLIBRARIES or nvdec_LTLIBRARIES. If the target's LDFLAGS is not defined, it will also use AM_LDFLAGS by default. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c5181b2187f13373d09fc9f0f9dad53fa9f5ac8a --- modules/hw/nvdec/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hw/nvdec/Makefile.am b/modules/hw/nvdec/Makefile.am index eaeeb89e0a..90e8c2796d 100644 --- a/modules/hw/nvdec/Makefile.am +++ b/modules/hw/nvdec/Makefile.am @@ -9,7 +9,6 @@ codec_LTLIBRARIES += libnvdec_plugin.la endif libnvdec_chroma_plugin_la_SOURCES = hw/nvdec/chroma.c hw/nvdec/nvdec_fmt.h -libnvdec_chroma_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(nvdecdir)' if HAVE_NVDEC nvdec_LTLIBRARIES = libnvdec_chroma_plugin.la endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] nvdec: Makefile.am: move nvdec plugin into nvdecdir
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:57 2021 +0100| [931ec8b2de2c8be30ad272157da462afbbf35634] | committer: Alexandre Janniaux nvdec: Makefile.am: move nvdec plugin into nvdecdir Like all other hw plugins. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=931ec8b2de2c8be30ad272157da462afbbf35634 --- modules/hw/nvdec/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/hw/nvdec/Makefile.am b/modules/hw/nvdec/Makefile.am index 90e8c2796d..39982910ce 100644 --- a/modules/hw/nvdec/Makefile.am +++ b/modules/hw/nvdec/Makefile.am @@ -1,16 +1,17 @@ nvdecdir = $(pluginsdir)/nvdec +nvdec_LTLIBRARIES = libnvdec_plugin_la_SOURCES = \ hw/nvdec/nvdec.c hw/nvdec/nvdec_fmt.h \ hw/nvdec/hw_pool.c hw/nvdec/hw_pool.h libnvdec_plugin_la_LIBADD = $(LIBDL) libvlc_hxxxhelper.la if HAVE_NVDEC -codec_LTLIBRARIES += libnvdec_plugin.la +nvdec_LTLIBRARIES += libnvdec_plugin.la endif libnvdec_chroma_plugin_la_SOURCES = hw/nvdec/chroma.c hw/nvdec/nvdec_fmt.h if HAVE_NVDEC -nvdec_LTLIBRARIES = libnvdec_chroma_plugin.la +nvdec_LTLIBRARIES += libnvdec_chroma_plugin.la endif libglinterop_nvdec_plugin_la_SOURCES = hw/nvdec/nvdec_gl.c \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mmal: Makefile.am: use convenience library for mmal
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:54 2021 +0100| [1fdebc28dc83a55c5d3d0f6048bec6c7e37a8130] | committer: Alexandre Janniaux mmal: Makefile.am: use convenience library for mmal The convenience library factors the mmal libs and the object between the different plugins. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1fdebc28dc83a55c5d3d0f6048bec6c7e37a8130 --- modules/hw/mmal/Makefile.am | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/hw/mmal/Makefile.am b/modules/hw/mmal/Makefile.am index 3d899645dd..0815e37870 100644 --- a/modules/hw/mmal/Makefile.am +++ b/modules/hw/mmal/Makefile.am @@ -1,31 +1,33 @@ include $(top_srcdir)/modules/common.am mmaldir = $(pluginsdir)/mmal -libmmal_vout_plugin_la_SOURCES = vout.c subpic.c subpic.h mmal_picture.c mmal_picture.h \ - mmal_cma.c mmal_cma.h +libvlc_mmal_la_SOURCES = subpic.c subpic.h mmal_picture.c mmal_picture.h \ + mmal_cma.c mmal_cma.h +libvlc_mmal_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) +libvlc_mmal_la_LIBADD = $(MMAL_LIBS) + +libmmal_vout_plugin_la_SOURCES = vout.c libmmal_vout_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) -libmmal_vout_plugin_la_LIBADD = $(MMAL_LIBS) $(LIBM) +libmmal_vout_plugin_la_LIBADD = $(LIBM) libvlc_mmal.la -libmmal_codec_plugin_la_SOURCES = codec.c subpic.c subpic.h mmal_picture.c mmal_picture.h \ - mmal_cma.c mmal_cma.h +libmmal_codec_plugin_la_SOURCES = codec.c libmmal_codec_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) -libmmal_codec_plugin_la_LIBADD = $(MMAL_LIBS) +libmmal_codec_plugin_la_LIBADD = libvlc_mmal.la -libmmal_converter_plugin_la_SOURCES = converter.c subpic.c subpic.h mmal_picture.c mmal_picture.h \ - mmal_cma.c mmal_cma.h +libmmal_converter_plugin_la_SOURCES = converter.c libmmal_converter_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) -libmmal_converter_plugin_la_LIBADD = $(MMAL_LIBS) +libmmal_converter_plugin_la_LIBADD = libvlc_mmal.la -libmmal_deinterlace_plugin_la_SOURCES = deinterlace.c mmal_picture.c mmal_picture.h \ - mmal_cma.c mmal_cma.h +libmmal_deinterlace_plugin_la_SOURCES = deinterlace.c libmmal_deinterlace_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) -libmmal_deinterlace_plugin_la_LIBADD = $(MMAL_LIBS) +libmmal_deinterlace_plugin_la_LIBADD = libvlc_mmal.la -libmmal_device_plugin_la_SOURCES = decoder_device.c mmal_picture.h +libmmal_device_plugin_la_SOURCES = decoder_device.c libmmal_device_plugin_la_CFLAGS = $(AM_CFLAGS) $(MMAL_CFLAGS) -libmmal_device_plugin_la_LIBADD = $(MMAL_LIBS) +libmmal_device_plugin_la_LIBADD = libvlc_mmal.la if HAVE_MMAL +noinst_LTLIBRARIES += libvlc_mmal.la mmal_LTLIBRARIES = \ libmmal_device_plugin.la \ libmmal_deinterlace_plugin.la \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mmal: fix typo
vlc | branch: master | Alexandre Janniaux | Sat Jan 9 10:43:00 2021 +0100| [b448334861dcd74e45a5230b0b0b37aba0335bc5] | committer: Alexandre Janniaux mmal: fix typo > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b448334861dcd74e45a5230b0b0b37aba0335bc5 --- modules/hw/mmal/codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c index e3bdeffc16..09df0dd7ef 100644 --- a/modules/hw/mmal/codec.c +++ b/modules/hw/mmal/codec.c @@ -74,7 +74,7 @@ typedef struct vlc_video_context *vctx; -// Lock to avoid pic update & allocate happenening simultainiously +// Lock to avoid pic update & allocate happening simultaneously // * We should be able to arrange life s.t. this isn't needed // but while we are confused apply belt & braces vlc_mutex_t pic_lock; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] configure.ac: remove previous mmal virtual plugin
vlc | branch: master | Alexandre Janniaux | Sat Mar 13 18:07:53 2021 +0100| [8e3b8b91b032d302a583c996a57a85fb7a870a98] | committer: Alexandre Janniaux configure.ac: remove previous mmal virtual plugin The plugin's values are not used anymore. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e3b8b91b032d302a583c996a57a85fb7a870a98 --- configure.ac | 4 1 file changed, 4 deletions(-) diff --git a/configure.ac b/configure.ac index decb95652e..ce7e36f186 100644 --- a/configure.ac +++ b/configure.ac @@ -3768,10 +3768,6 @@ if test "${enable_mmal}" != "no"; then AC_CHECK_HEADERS([interface/mmal/mmal.h], [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [ have_mmal="yes" -VLC_ADD_PLUGIN([mmal]) -VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ]) -VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ]) -VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) MMAL_CFLAGS="-isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux" MMAL_LIBS="-L/opt/vc/lib -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm" ],[ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: bundle: remove install_name_tool usage
vlc | branch: master | Alexandre Janniaux | Thu Mar 11 17:58:50 2021 +0100| [82b51438aabd0cbfbd9dc168d252a038ca3dbc45] | committer: Alexandre Janniaux apple: bundle: remove install_name_tool usage It was needed because the -rpath option wasn't set correctly on the test sample. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82b51438aabd0cbfbd9dc168d252a038ca3dbc45 --- extras/package/apple/bundle.sh | 8 1 file changed, 8 deletions(-) diff --git a/extras/package/apple/bundle.sh b/extras/package/apple/bundle.sh index 80681beade..5e7def1d51 100755 --- a/extras/package/apple/bundle.sh +++ b/extras/package/apple/bundle.sh @@ -28,16 +28,8 @@ rm -f "$IPA" rm -rf "Payload/" mkdir -p "$APP" -# Find install_name tool in order to set rpath on executable -INSTALL_NAME_TOOL=$(which install_name_tool || echo "") -if [ -z "$INSTALL_NAME_TOOL" ]; then -echo "install_name_tool not found, aborting..." -exit 1 -fi - # VLC core test binary compiled for iOS cp "${BUILD_DIR}/test/${APP_EXECUTABLE}" "${APP}/${APP_NAME}" -${INSTALL_NAME_TOOL} "${APP}/${APP_NAME}" -add_rpath "@executable_path/Frameworks" # Convert Info.plist from XML to binary CONVERT_PLIST "${SCRIPT_DIR}/Info.plist" "Payload/vlccore.app/Info.plist" ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: Makefile.am: fix darwin RPATH for iOS sample
vlc | branch: master | Alexandre Janniaux | Thu Mar 11 17:31:31 2021 +0100| [8b24c0e2fdce68d1f3a788c8d73037de3273e80b] | committer: Alexandre Janniaux test: Makefile.am: fix darwin RPATH for iOS sample The rpath value was incorrectly pointing to $(libdir) whereas the executable is launched from a bundle and should have pointed to @executable_path/Frameworks/ where the dylibs are installed. It was working previously because the apple/bundle.sh script was redefining the rpath manually through install_name_tool. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b24c0e2fdce68d1f3a788c8d73037de3273e80b --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 783e79239c..693acf0edc 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -294,7 +294,7 @@ endif vlccoreios_SOURCES = iosvlc.m vlccoreios_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,Foundation,-framework,UIKit -vlccoreios_LDFLAGS += -Xlinker -rpath -Xlinker "$(libdir)" +vlccoreios_LDFLAGS += -Xlinker -rpath -Xlinker "@executable_path/Frameworks/" vlccoreios_OBJCFLAGS = -fobjc-arc vlccoreios_LDADD = ../lib/libvlc.la ../src/libvlccore.la if HAVE_IOS ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: Makefile.am: rename vlc-ios into vlccoreios
vlc | branch: master | Alexandre Janniaux | Thu Feb 25 14:10:08 2021 +0100| [72e5ed84f446b32451004287b46915ab7fcb8e4a] | committer: Alexandre Janniaux test: Makefile.am: rename vlc-ios into vlccoreios vlc-ios is not valid for the iOS package name and vlcios might be confusing with the VLC for iOS app outside of this project. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=72e5ed84f446b32451004287b46915ab7fcb8e4a --- test/Makefile.am | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 779c6a89a1..783e79239c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -292,11 +292,11 @@ if HAVE_LIBFUZZER noinst_PROGRAMS += vlc-demux-libfuzzer vlc-demux-dec-libfuzzer vlc-demux-run vlc-demux-dec-run endif -vlc_ios_SOURCES = iosvlc.m -vlc_ios_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,Foundation,-framework,UIKit -vlc_ios_LDFLAGS += -Xlinker -rpath -Xlinker "$(libdir)" -vlc_ios_OBJCFLAGS = -fobjc-arc -vlc_ios_LDADD = ../lib/libvlc.la ../src/libvlccore.la +vlccoreios_SOURCES = iosvlc.m +vlccoreios_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,Foundation,-framework,UIKit +vlccoreios_LDFLAGS += -Xlinker -rpath -Xlinker "$(libdir)" +vlccoreios_OBJCFLAGS = -fobjc-arc +vlccoreios_LDADD = ../lib/libvlc.la ../src/libvlccore.la if HAVE_IOS -noinst_PROGRAMS += vlc-ios +noinst_PROGRAMS += vlccoreios endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: iosvlc: add pinch gesture recognizer
vlc | branch: master | Alexandre Janniaux | Tue Feb 16 16:01:02 2021 +0100| [904998afec0b2d4192e877c19c7e5295bcaf4c67] | committer: Alexandre Janniaux test: iosvlc: add pinch gesture recognizer Allow the test application to be resized to test the behaviour of libvlccore resizing. Later, this should probably be enabled by a feature flag or an environment variable. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=904998afec0b2d4192e877c19c7e5295bcaf4c67 --- test/iosvlc.m | 40 1 file changed, 40 insertions(+) diff --git a/test/iosvlc.m b/test/iosvlc.m index 23b2c236b4..12c1391343 100644 --- a/test/iosvlc.m +++ b/test/iosvlc.m @@ -37,11 +37,47 @@ libvlc_instance_t *_libvlc; UIWindow *window; UIView *subview; +UIPinchGestureRecognizer *_pinchRecognizer; + +CGRect _pinchRect; +CGPoint _pinchOrigin; +CGPoint _pinchPreviousCenter; } @end @implementation AppDelegate +- (void)pinchRecognized:(UIPinchGestureRecognizer *)pinchRecognizer +{ +UIGestureRecognizerState state = [pinchRecognizer state]; + +switch (state) +{ +case UIGestureRecognizerStateBegan: +_pinchRect = [subview frame]; +_pinchOrigin = [pinchRecognizer locationInView:nil]; +_pinchPreviousCenter = [subview center]; +return; +case UIGestureRecognizerStateEnded: +return; +case UIGestureRecognizerStateChanged: +break; +default: +return; +} + +CGFloat scale = pinchRecognizer.scale; +CGRect viewBounds = _pinchRect; +if (scale >= 1.0 && (viewBounds.size.width == 0 || viewBounds.size.height == 0)) +viewBounds.size.width = viewBounds.size.height = 1; +viewBounds.size.width *= scale; +viewBounds.size.height *= scale; +subview.frame = viewBounds; +CGPoint newPosition = [pinchRecognizer locationInView:nil]; +subview.center = CGPointMake( +_pinchPreviousCenter.x + newPosition.x - _pinchOrigin.x, +_pinchPreviousCenter.y + newPosition.y - _pinchOrigin.y); +} /* Called after application launch */ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { @@ -76,6 +112,10 @@ [window addSubview:subview]; [window makeKeyAndVisible]; +_pinchRecognizer = [[UIPinchGestureRecognizer alloc] +initWithTarget:self action:@selector(pinchRecognized:)]; +[window addGestureRecognizer:_pinchRecognizer]; + /* Start glue interface, see code below */ libvlc_add_intf(_libvlc, "ios_interface,none"); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: iosvlc: use subview for rendering
vlc | branch: master | Alexandre Janniaux | Tue Feb 16 15:53:57 2021 +0100| [96bee41831849597448a2414aa06faa1ee837a38] | committer: Alexandre Janniaux test: iosvlc: use subview for rendering Using a subview instead of the UIWindow is useful for testing the resize of the view and adding color markers on the views. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=96bee41831849597448a2414aa06faa1ee837a38 --- test/iosvlc.m | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/iosvlc.m b/test/iosvlc.m index fc73205c67..23b2c236b4 100644 --- a/test/iosvlc.m +++ b/test/iosvlc.m @@ -36,6 +36,7 @@ @public libvlc_instance_t *_libvlc; UIWindow *window; +UIView *subview; } @end @@ -69,6 +70,10 @@ window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; window.rootViewController = [UIViewController alloc]; window.backgroundColor = [UIColor whiteColor]; + +subview = [[UIView alloc] initWithFrame:window.bounds]; +subview.backgroundColor = [UIColor blueColor]; +[window addSubview:subview]; [window makeKeyAndVisible]; /* Start glue interface, see code below */ @@ -91,9 +96,9 @@ int main(int argc, char * argv[]) { static int Open(vlc_object_t *obj) { AppDelegate *d = (AppDelegate *)[[UIApplication sharedApplication] delegate]; -assert(d != nil && d->window != nil); +assert(d != nil && d->subview != nil); var_SetAddress(vlc_object_instance(obj), "drawable-nsobject", - (__bridge void *)d->window); + (__bridge void *)d->subview); return VLC_SUCCESS; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: bundle.sh: check that we have dylibs before copying them
vlc | branch: master | Alexandre Janniaux | Tue Feb 23 18:30:22 2021 +0100| [6cd0570d97a50887207c48898ba9ccd91223797b] | committer: Alexandre Janniaux apple: bundle.sh: check that we have dylibs before copying them We don't want to copy dylibs if we built the test sample statically. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6cd0570d97a50887207c48898ba9ccd91223797b --- extras/package/apple/bundle.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extras/package/apple/bundle.sh b/extras/package/apple/bundle.sh index e52761af82..80681beade 100755 --- a/extras/package/apple/bundle.sh +++ b/extras/package/apple/bundle.sh @@ -50,9 +50,11 @@ echo "APPL" > "$APP/PkgInfo" # Frameworks/ directory, but since it is only designed for development usage # we can just put them there without further processing. mkdir -p "$APP/Frameworks" +if [ -f "${BUILD_DIR}/lib/.libs/libvlc.dylib" ]; then cp "${BUILD_DIR}/lib/.libs/libvlc.dylib" "$APP/Frameworks" cp "${BUILD_DIR}/src/.libs/libvlccore.dylib" "$APP/Frameworks" find "${BUILD_DIR}/modules/.libs/" -name "*.dylib" -exec cp {} "$APP/Frameworks" \; +fi # Archive the bundle into a .ipa file. zip -r "$IPA" Payload ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: bundle.sh: add executable name for packaging
vlc | branch: master | Alexandre Janniaux | Tue Feb 23 18:30:22 2021 +0100| [94ce9a2a1eeb6168be36cdbc66f7ca06ec19dc28] | committer: Alexandre Janniaux apple: bundle.sh: add executable name for packaging It allows multiple test executable to be packaged, while providing a handy way to package whether or not libtool generates a wrapper script (when linked to dynamic libraries) without having to install. If the APP_EXECUTABLE is not provided, it defaults to using the APP_NAME. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=94ce9a2a1eeb6168be36cdbc66f7ca06ec19dc28 --- extras/package/apple/bundle.sh | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/extras/package/apple/bundle.sh b/extras/package/apple/bundle.sh index 1a38192f06..e52761af82 100755 --- a/extras/package/apple/bundle.sh +++ b/extras/package/apple/bundle.sh @@ -4,9 +4,10 @@ set -eu readonly SCRIPT_DIR="$(cd "${BASH_SOURCE%/*}"; pwd)" readonly BUILD_DIR="$(cd "$1"; pwd)" - -APP="Payload/vlccore.app" -IPA="vlccore_unsigned.ipa" +readonly APP_NAME="$2" +readonly APP_EXECUTABLE="${3:-${APP_NAME}}" +readonly APP="Payload/${APP_NAME}.app" +readonly IPA="${APP_NAME}_unsigned.ipa" # CONVERT_PLIST # Convert a plist file into binary1 format in order to put it @@ -35,8 +36,8 @@ if [ -z "$INSTALL_NAME_TOOL" ]; then fi # VLC core test binary compiled for iOS -cp "${BUILD_DIR}/test/.libs/vlc-ios" "$APP/vlccore" -${INSTALL_NAME_TOOL} "$APP/vlccore" -add_rpath "@executable_path/Frameworks" +cp "${BUILD_DIR}/test/${APP_EXECUTABLE}" "${APP}/${APP_NAME}" +${INSTALL_NAME_TOOL} "${APP}/${APP_NAME}" -add_rpath "@executable_path/Frameworks" # Convert Info.plist from XML to binary CONVERT_PLIST "${SCRIPT_DIR}/Info.plist" "Payload/vlccore.app/Info.plist" ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: build.sh: explicitely forward ac_cv_ vars
vlc | branch: master | Alexandre Janniaux | Sat Feb 20 10:17:19 2021 +0100| [c4acef442fe306c743550a991a18def2e8e1f570] | committer: Alexandre Janniaux apple: build.sh: explicitely forward ac_cv_ vars > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4acef442fe306c743550a991a18def2e8e1f570 --- extras/package/apple/build.sh | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh index 7877bf9676..460851a468 100755 --- a/extras/package/apple/build.sh +++ b/extras/package/apple/build.sh @@ -588,9 +588,6 @@ else echo "Building contribs for $VLC_HOST_ARCH" fi -# Set symbol blacklist for autoconf -vlcSetSymbolEnvironment > /dev/null - # Combine settings from config file VLC_CONTRIB_OPTIONS=( "${VLC_CONTRIB_OPTIONS_BASE[@]}" ) @@ -625,8 +622,10 @@ write_config_mak "-Werror=partial-availability" if [ "$VLC_USE_PREBUILT_CONTRIBS" -gt "0" ]; then # Fetch prebuilt contribs if [ -z "$VLC_PREBUILT_CONTRIBS_URL" ]; then +vlcSetSymbolEnvironment \ $MAKE prebuilt || abort_err "Fetching prebuilt contribs failed" else +vlcSetSymbolEnvironment \ $MAKE prebuilt PREBUILT_URL="$VLC_PREBUILT_CONTRIBS_URL" \ || abort_err "Fetching prebuilt contribs from ${VLC_PREBUILT_CONTRIBS_URL} failed" fi @@ -638,10 +637,12 @@ else $MAKE fetch # Build contribs +vlcSetSymbolEnvironment \ $MAKE || abort_err "Building contribs failed" # Make prebuilt contribs package if [ "$VLC_MAKE_PREBUILT_CONTRIBS" -gt "0" ]; then +vlcSetSymbolEnvironment \ $MAKE package || abort_err "Creating prebuilt contribs package failed" fi fi @@ -692,6 +693,7 @@ cd "${VLC_BUILD_DIR}/build" || abort_err "Failed cd to VLC build dir" # Create VLC install dir if it does not already exist mkdir -p "$VLC_INSTALL_DIR" +vlcSetSymbolEnvironment \ hostenv ../../configure \ --with-contrib="$VLC_CONTRIB_INSTALL_DIR" \ --host="$VLC_HOST_TRIPLET" \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: build.sh: use config.mak for symbol blacklist
vlc | branch: master | Alexandre Janniaux | Thu Feb 25 09:48:46 2021 +0100| [7f1d7ea3da4cc57502e7f80bcc364475039ad2a8] | committer: Alexandre Janniaux apple: build.sh: use config.mak for symbol blacklist The list is written by the build script the first time, allowing further tweaking and running `make` in the contrib build directory without reexporting those ac_cv_ symbols again. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f1d7ea3da4cc57502e7f80bcc364475039ad2a8 --- extras/package/apple/build.sh | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh index 460851a468..1d030b3e63 100755 --- a/extras/package/apple/build.sh +++ b/extras/package/apple/build.sh @@ -344,6 +344,13 @@ hostenv() "$@" } +ac_var_to_export_ac_var() +{ +for ac_var in "$@"; do +echo "export $ac_var" +done +} + # Write config.mak for contribs # Globals: # VLC_DEPLOYMENT_TARGET_CFLAG @@ -385,6 +392,10 @@ write_config_mak() printf '%s := %s\n' "STRIP" "${VLC_HOST_STRIP}" >&3 printf '%s := %s\n' "RANLIB" "${VLC_HOST_RANLIB}" >&3 printf '%s := %s\n' "NM" "${VLC_HOST_NM}" >&3 + +# Add the ac_cv_ var exports in the config.mak for the contribs +echo "Appending ac_cv_ vars to config.mak" +vlcSetSymbolEnvironment ac_var_to_export_ac_var >&3 } # Generate the source file with the needed array for @@ -622,10 +633,8 @@ write_config_mak "-Werror=partial-availability" if [ "$VLC_USE_PREBUILT_CONTRIBS" -gt "0" ]; then # Fetch prebuilt contribs if [ -z "$VLC_PREBUILT_CONTRIBS_URL" ]; then -vlcSetSymbolEnvironment \ $MAKE prebuilt || abort_err "Fetching prebuilt contribs failed" else -vlcSetSymbolEnvironment \ $MAKE prebuilt PREBUILT_URL="$VLC_PREBUILT_CONTRIBS_URL" \ || abort_err "Fetching prebuilt contribs from ${VLC_PREBUILT_CONTRIBS_URL} failed" fi @@ -637,12 +646,10 @@ else $MAKE fetch # Build contribs -vlcSetSymbolEnvironment \ $MAKE || abort_err "Building contribs failed" # Make prebuilt contribs package if [ "$VLC_MAKE_PREBUILT_CONTRIBS" -gt "0" ]; then -vlcSetSymbolEnvironment \ $MAKE package || abort_err "Creating prebuilt contribs package failed" fi fi ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] gitignore: unblacklist build.sh script
vlc | branch: master | Alexandre Janniaux | Fri Feb 19 23:20:00 2021 +0100| [1cff424af81f9ce1fdfb2a12a89c2383dffe4a31] | committer: Alexandre Janniaux gitignore: unblacklist build.sh script > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1cff424af81f9ce1fdfb2a12a89c2383dffe4a31 --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fc368212c8..d9d5a09907 100644 --- a/.gitignore +++ b/.gitignore @@ -50,7 +50,7 @@ patches/* include/vlc/libvlc_version.h # Ignore build dirs -build* +build*/ contrib-* install-* - +!extras/package/apple/build.sh ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] package: macosx: forward ac_cv symbols to $@
vlc | branch: master | Alexandre Janniaux | Fri Feb 19 23:20:10 2021 +0100| [bb8f7212bcabfc95340456b03218d7d52de93f52] | committer: Alexandre Janniaux package: macosx: forward ac_cv symbols to $@ configure will store the command used when reconfiguring as long as the ac_cv_ variables are passed as parameter to the configure execution instead of being an environment variable. So as to stay compatible with other clients of this script, use export as default command when no argument is given to keep the previous behaviour. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bb8f7212bcabfc95340456b03218d7d52de93f52 --- extras/package/macosx/env.build.sh | 60 ++ 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/extras/package/macosx/env.build.sh b/extras/package/macosx/env.build.sh index ef1316465a..7fc9409f23 100755 --- a/extras/package/macosx/env.build.sh +++ b/extras/package/macosx/env.build.sh @@ -77,36 +77,46 @@ vlcSetBaseEnvironment() { } vlcSetSymbolEnvironment() { -echo "Setting symbol environment" +# If the command is called without argument, default to exporting +# all the ac_cv_* symbols to the environment. Else we'll pass the +# symbol values to the command in the first argument, after the +# command's arguments. +# +# It's typically made to work with cmd="configure" to write the +# configuration into the config.status script or cmd="echo" to +# write the variables into a config.mak file for the contribs. +local cmd="${1:-export}"; [ "$#" -ge 1 ] && shift # The following symbols do not exist on the minimal macOS / iOS, so they are disabled # here. This allows compilation also with newer macOS SDKs. # List assumes macOS 10.10 / iOS 8 at minimum. -# Added symbols in macOS 10.12 / iOS 10 / watchOS 3 -export ac_cv_func_basename_r=no -export ac_cv_func_clock_getres=no -export ac_cv_func_clock_gettime=no -export ac_cv_func_clock_settime=no -export ac_cv_func_dirname_r=no -export ac_cv_func_getentropy=no -export ac_cv_func_mkostemp=no -export ac_cv_func_mkostemps=no -export ac_cv_func_timingsafe_bcmp=no - -# Added symbols in macOS 10.13 / iOS 11 / watchOS 4 / tvOS 11 -export ac_cv_func_open_wmemstream=no -export ac_cv_func_fmemopen=no -export ac_cv_func_open_memstream=no -export ac_cv_func_futimens=no -export ac_cv_func_utimensat=no - -# Added symbol in macOS 10.14 / iOS 12 / tvOS 9 -export ac_cv_func_thread_get_register_pointer_values=no - -# Added symbols in macOS 10.15 / iOS 13 / tvOS 13 -export ac_cv_func_aligned_alloc=no -export ac_cv_func_timespec_get=no +# - Added symbols in macOS 10.12 / iOS 10 / watchOS 3 +# - Added symbols in macOS 10.13 / iOS 11 / watchOS 4 / tvOS 11 +# - Added symbol in macOS 10.14 / iOS 12 / tvOS 9 +# - Added symbols in macOS 10.15 / iOS 13 / tvOS 13 +"${cmd}" "$@" \ +\ +ac_cv_func_basename_r=no \ +ac_cv_func_clock_getres=no \ +ac_cv_func_clock_gettime=no \ +ac_cv_func_clock_settime=no \ +ac_cv_func_dirname_r=no \ +ac_cv_func_getentropy=no \ +ac_cv_func_mkostemp=no \ +ac_cv_func_mkostemps=no \ +ac_cv_func_timingsafe_bcmp=no \ +\ +ac_cv_func_open_wmemstream=no \ +ac_cv_func_fmemopen=no \ +ac_cv_func_open_memstream=no \ +ac_cv_func_futimens=no \ +ac_cv_func_utimensat=no \ +\ +ac_cv_func_thread_get_register_pointer_values=no \ +\ +ac_cv_func_aligned_alloc=no \ +ac_cv_func_timespec_get=no } vlcSetContribEnvironment() { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: build.sh: remove let
vlc | branch: master | Alexandre Janniaux | Fri Mar 12 14:23:59 2021 +0100| [c9a631d794d225bdb99dcace5d5b5eab11459feb] | committer: Alexandre Janniaux apple: build.sh: remove let `let foo=0` return the error code 1, thuse can make the script fails if set -e is used in the build script. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c9a631d794d225bdb99dcace5d5b5eab11459feb --- extras/package/apple/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh index 4190938f86..7877bf9676 100755 --- a/extras/package/apple/build.sh +++ b/extras/package/apple/build.sh @@ -93,7 +93,7 @@ VLC_PREBUILT_CONTRIBS_URL=${VLC_PREBUILT_CONTRIBS_URL:-""} # The number of cores to compile on CORE_COUNT=$(sysctl -n machdep.cpu.core_count || nproc || echo 0) let VLC_USE_NUMBER_OF_CORES=$CORE_COUNT+1 -let VLC_REQUESTED_CORE_COUNT=0 +VLC_REQUESTED_CORE_COUNT=0 # whether to disable debug mode (the default) or not VLC_DISABLE_DEBUG=0 # whether to compile with bitcode or not ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] m4: with_pkg: fix PKG_HAVE_WITH_MODULES macro
vlc | branch: master | Alexandre Janniaux | Thu Feb 25 12:51:18 2021 +0100| [d0dd9745762b05d97a869cf7d911324a8d72bbba] | committer: Alexandre Janniaux m4: with_pkg: fix PKG_HAVE_WITH_MODULES macro The macro was checking for $with_foo to be set but only $enabled_foo was set correctly by the PKG_WITH_MODULES macro. In addition, this patch adds an intermediate macro for the name to be readable. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0dd9745762b05d97a869cf7d911324a8d72bbba --- m4/with_pkg.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/m4/with_pkg.m4 b/m4/with_pkg.m4 index 39439b792f..b6c51756e4 100644 --- a/m4/with_pkg.m4 +++ b/m4/with_pkg.m4 @@ -71,8 +71,10 @@ AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) +m4_pushdef([with_arg], m4_tolower([$1])) AM_CONDITIONAL([HAVE_][$1], - [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) + [test "$AS_TR_SH([enable_]with_arg)" = "yes"]) +m4_popdef([with_arg]) ]) dnl PKG_ENABLE_MODULES_VLC(VARIABLE-PREFIX, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mediacodec: defer mediacodec flush to release
vlc | branch: master | Alexandre Janniaux | Tue Feb 16 14:46:40 2021 +0100| [57323ddadbe6579697cc9ecdef0de2fbc6831dac] | committer: Alexandre Janniaux mediacodec: defer mediacodec flush to release Avoid flushing mediacodec when the decoder has been drained at the VLC decoder_t level, because the picture output by the decoder are inflight pictures that will not stay valid when the decoder will be flushed. Instead, only flush it when every pictures have been released. This is too pessimistic currently, the best alternative being doing the flush when every picture have been rendered. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=57323ddadbe6579697cc9ecdef0de2fbc6831dac --- modules/codec/omxil/mediacodec.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c index 2bcc27c704..18e761d53a 100644 --- a/modules/codec/omxil/mediacodec.c +++ b/modules/codec/omxil/mediacodec.c @@ -577,11 +577,21 @@ static struct picture_context_t *PictureContextCopy(struct picture_context_t *ct return ctx; } +static void AbortDecoderLocked(decoder_sys_t *p_dec); static void CleanFromVideoContext(void *priv) { android_video_context_t *avctx = priv; decoder_sys_t *p_sys = avctx->dec_opaque; +vlc_mutex_lock(&p_sys->lock); +/* Unblock output thread waiting in dequeue_out */ +DecodeFlushLocked(p_sys); +/* Cancel the output thread */ +AbortDecoderLocked(p_sys); +vlc_mutex_unlock(&p_sys->lock); + +vlc_join(p_sys->out_thread, NULL); + CleanDecoder(p_sys); } @@ -1064,8 +1074,21 @@ static void CloseDecoder(vlc_object_t *p_this) decoder_sys_t *p_sys = p_dec->p_sys; vlc_mutex_lock(&p_sys->lock); -p_sys->b_closed = true; +p_sys->b_decoder_dead = true; +vlc_mutex_unlock(&p_sys->lock); + +if (p_sys->video.ctx) +{ +/* If we have a video context, we're using Surface with inflight + * pictures, which might already have been queued, and flushing + * them would make them invalid, breaking mechanism like waiting + * on OnFrameAvailableListener.*/ +vlc_video_context_Release(p_sys->video.ctx); +CleanInputVideo(p_dec); +return; +} +vlc_mutex_lock(&p_sys->lock); /* Unblock output thread waiting in dequeue_out */ DecodeFlushLocked(p_sys); /* Cancel the output thread */ @@ -1075,11 +1098,7 @@ static void CloseDecoder(vlc_object_t *p_this) vlc_join(p_sys->out_thread, NULL); CleanInputVideo(p_dec); - -if (p_sys->video.ctx) -vlc_video_context_Release(p_sys->video.ctx); -else -CleanDecoder(p_sys); +CleanDecoder(p_sys); } static int Video_ProcessOutput(decoder_t *p_dec, mc_api_out *p_out, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mediacodec: release pictures after decoder close
vlc | branch: master | Alexandre Janniaux | Tue Feb 16 14:46:39 2021 +0100| [1fa05cf40605a459c6a256a2073c96b9ac21c15f] | committer: Alexandre Janniaux mediacodec: release pictures after decoder close Avoid trying to queue picture after the closing of the decoder. Indeed, the mediacodec loop cannot be killed yet at the decoder close function because it is still needed for the integrity of the picture still used in the pipeline. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1fa05cf40605a459c6a256a2073c96b9ac21c15f --- modules/codec/omxil/mediacodec.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c index 07e1107879..2bcc27c704 100644 --- a/modules/codec/omxil/mediacodec.c +++ b/modules/codec/omxil/mediacodec.c @@ -115,6 +115,11 @@ typedef struct decoder_sys_t boolb_aborted; boolb_drained; boolb_adaptive; + +/* If true, the decoder_t object has been closed and decoder_* functions + * are now unavailable. */ +boolb_decoder_dead; + int i_decode_flags; enum es_format_category_e cat; @@ -846,6 +851,7 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init) p_sys->video.i_mpeg_dar_num = 0; p_sys->video.i_mpeg_dar_den = 0; p_sys->video.surfacetexture = NULL; +p_sys->b_decoder_dead = false; if (pf_init(&p_sys->api) != 0) { @@ -1058,6 +1064,8 @@ static void CloseDecoder(vlc_object_t *p_this) decoder_sys_t *p_sys = p_dec->p_sys; vlc_mutex_lock(&p_sys->lock); +p_sys->b_closed = true; + /* Unblock output thread waiting in dequeue_out */ DecodeFlushLocked(p_sys); /* Cancel the output thread */ @@ -1415,8 +1423,9 @@ static void *OutThread(void *data) vlc_mutex_lock(&p_sys->lock); -/* Ignore dequeue_out errors caused by flush */ -if (p_sys->b_flush_out) +/* Ignore dequeue_out errors caused by flush, or late picture being + * dequeued after close. */ +if (p_sys->b_flush_out || p_sys->b_decoder_dead) { /* If i_index >= 0, Release it. There is no way to know if i_index * is owned by us, so don't check the error. */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mediacodec: switch API function to using p_sys
vlc | branch: master | Alexandre Janniaux | Tue Feb 16 14:46:38 2021 +0100| [f2603332943e0c93b6f3efcea1d38d593142fad7] | committer: Alexandre Janniaux mediacodec: switch API function to using p_sys These functions will be used with the decoder_t object closed, but the p_sys still alive, and they are only using the p_sys object. No functional changes. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f2603332943e0c93b6f3efcea1d38d593142fad7 --- modules/codec/omxil/mediacodec.c | 48 ++-- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c index f8435f342c..07e1107879 100644 --- a/modules/codec/omxil/mediacodec.c +++ b/modules/codec/omxil/mediacodec.c @@ -62,7 +62,8 @@ typedef int (*dec_on_new_block_cb)(decoder_t *, block_t **); /** * Callback called when decoder is flushing. */ -typedef void (*dec_on_flush_cb)(decoder_t *); +struct decoder_sys_t; +typedef void (*dec_on_flush_cb)(struct decoder_sys_t *); /** * Callback called when DecodeBlock try to get an output buffer (pic or block). @@ -78,7 +79,7 @@ struct android_picture_ctx atomic_int index; }; -typedef struct +typedef struct decoder_sys_t { mc_api api; @@ -156,17 +157,17 @@ static int Video_OnNewBlock(decoder_t *, block_t **); static int VideoHXXX_OnNewBlock(decoder_t *, block_t **); static int VideoMPEG2_OnNewBlock(decoder_t *, block_t **); static int VideoVC1_OnNewBlock(decoder_t *, block_t **); -static void Video_OnFlush(decoder_t *); +static void Video_OnFlush(decoder_sys_t *); static int Video_ProcessOutput(decoder_t *, mc_api_out *, picture_t **, block_t **); static int DecodeBlock(decoder_t *, block_t *); static int Audio_OnNewBlock(decoder_t *, block_t **); -static void Audio_OnFlush(decoder_t *); +static void Audio_OnFlush(decoder_sys_t *); static int Audio_ProcessOutput(decoder_t *, mc_api_out *, picture_t **, block_t **); -static void DecodeFlushLocked(decoder_t *); +static void DecodeFlushLocked(decoder_sys_t *); static void DecodeFlush(decoder_t *); static void StopMediaCodec(decoder_sys_t *); static void *OutThread(void *); @@ -1026,10 +1027,8 @@ static int OpenDecoderJni(vlc_object_t *p_this) return OpenDecoder(p_this, MediaCodecJni_Init); } -static void AbortDecoderLocked(decoder_t *p_dec) +static void AbortDecoderLocked(decoder_sys_t *p_sys) { -decoder_sys_t *p_sys = p_dec->p_sys; - if (!p_sys->b_aborted) { p_sys->b_aborted = true; @@ -1060,9 +1059,9 @@ static void CloseDecoder(vlc_object_t *p_this) vlc_mutex_lock(&p_sys->lock); /* Unblock output thread waiting in dequeue_out */ -DecodeFlushLocked(p_dec); +DecodeFlushLocked(p_sys); /* Cancel the output thread */ -AbortDecoderLocked(p_dec); +AbortDecoderLocked(p_sys); vlc_mutex_unlock(&p_sys->lock); vlc_join(p_sys->out_thread, NULL); @@ -1350,9 +1349,8 @@ static int Audio_ProcessOutput(decoder_t *p_dec, mc_api_out *p_out, } } -static void DecodeFlushLocked(decoder_t *p_dec) +static void DecodeFlushLocked(decoder_sys_t *p_sys) { -decoder_sys_t *p_sys = p_dec->p_sys; bool b_had_input = p_sys->b_input_dequeued; p_sys->b_input_dequeued = false; @@ -1362,11 +1360,11 @@ static void DecodeFlushLocked(decoder_t *p_dec) /* Resend CODEC_CONFIG buffer after a flush */ p_sys->i_csd_send = 0; -p_sys->pf_on_flush(p_dec); +p_sys->pf_on_flush(p_sys); if (b_had_input && p_sys->api.flush(&p_sys->api) != VLC_SUCCESS) { -AbortDecoderLocked(p_dec); +AbortDecoderLocked(p_sys); return; } @@ -1381,7 +1379,7 @@ static void DecodeFlush(decoder_t *p_dec) decoder_sys_t *p_sys = p_dec->p_sys; vlc_mutex_lock(&p_sys->lock); -DecodeFlushLocked(p_dec); +DecodeFlushLocked(p_dec->p_sys); vlc_mutex_unlock(&p_sys->lock); } @@ -1576,7 +1574,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block, if (!p_sys->b_drained) { msg_Err(p_dec, "OutThread timed out"); -AbortDecoderLocked(p_dec); +AbortDecoderLocked(p_sys); } p_sys->b_drained = false; } @@ -1584,7 +1582,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block, return VLC_SUCCESS; error: -AbortDecoderLocked(p_dec); +AbortDecoderLocked(p_sys); return VLC_EGENERIC; } @@ -1617,7 +1615,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_in_block) { if (p_sys->b_output_ready) QueueBlockLocked(p_dec, NULL, true); -DecodeFlushLocked(p_dec); +DecodeFlushLocked(p_sys); if (p_sys->b_aborted) goto end; if (p_in_block->i_fla
[vlc-commits] opengl: add CreateOffscreen API
vlc | branch: master | Alexandre Janniaux | Fri Feb 26 18:10:32 2021 +0100| [abe92e99c61a726c3592708e526ac824e1372696] | committer: Alexandre Janniaux opengl: add CreateOffscreen API This will allow offscreen OpenGL implementations, which will produce picture_t. Co-authored-by: Romain Vimont Signed-off-by: Alexandre Janniaux > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=abe92e99c61a726c3592708e526ac824e1372696 --- include/vlc_opengl.h | 24 - src/libvlccore.sym| 1 + src/video_output/opengl.c | 54 +++ 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h index a99c6ced64..f91f387bf7 100644 --- a/include/vlc_opengl.h +++ b/include/vlc_opengl.h @@ -37,6 +37,8 @@ struct vout_display_cfg; * A VLC GL context (and its underlying surface) */ typedef struct vlc_gl_t vlc_gl_t; +struct vlc_decoder_device; +struct vlc_video_context; enum vlc_gl_api_type { VLC_OPENGL, @@ -47,14 +49,24 @@ struct vlc_gl_t { struct vlc_object_t obj; +struct vlc_decoder_device *device; struct vout_window_t *surface; module_t *module; void *sys; +vlc_fourcc_t offscreen_chroma_out; +struct vlc_video_context *offscreen_vctx_out; +/* Flag to indicate if the OpenGL implementation produces upside-down + * pictures */ +bool offscreen_vflip; + int (*make_current)(vlc_gl_t *); void (*release_current)(vlc_gl_t *); void (*resize)(vlc_gl_t *, unsigned, unsigned); -void (*swap)(vlc_gl_t *); +union { +void (*swap)(vlc_gl_t *); +picture_t *(*swap_offscreen)(vlc_gl_t *); +}; void*(*get_proc_address)(vlc_gl_t *, const char *); void (*destroy)(vlc_gl_t *); @@ -99,6 +111,11 @@ struct vlc_gl_t */ VLC_API vlc_gl_t *vlc_gl_Create(const struct vout_display_cfg *cfg, unsigned flags, const char *name) VLC_USED; +VLC_API vlc_gl_t *vlc_gl_CreateOffscreen(vlc_object_t *parent, + struct vlc_decoder_device *device, + unsigned width, unsigned height, + unsigned flags, const char *name); + VLC_API void vlc_gl_Release(vlc_gl_t *); VLC_API void vlc_gl_Hold(vlc_gl_t *); @@ -123,6 +140,11 @@ static inline void vlc_gl_Swap(vlc_gl_t *gl) gl->swap(gl); } +static inline picture_t *vlc_gl_SwapOffscreen(vlc_gl_t *gl) +{ +return gl->swap_offscreen(gl); +} + static inline void *vlc_gl_GetProcAddress(vlc_gl_t *gl, const char *name) { return gl->get_proc_address(gl, name); diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 71267d5dfc..0c130543e5 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -695,6 +695,7 @@ vlc_queue_Enqueue vlc_queue_Dequeue vlc_queue_DequeueAll vlc_gl_Create +vlc_gl_CreateOffscreen vlc_gl_Release vlc_gl_Hold vlc_gl_surface_Create diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c index 8355c16135..cf0db8567f 100644 --- a/src/video_output/opengl.c +++ b/src/video_output/opengl.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "libvlc.h" #include @@ -96,6 +97,59 @@ vlc_gl_t *vlc_gl_Create(const struct vout_display_cfg *restrict cfg, return &glpriv->gl; } +vlc_gl_t *vlc_gl_CreateOffscreen(vlc_object_t *parent, + struct vlc_decoder_device *device, + unsigned width, unsigned height, + unsigned flags, const char *name) +{ +struct vlc_gl_priv_t *glpriv; +const char *type; + +switch (flags /*& VLC_OPENGL_API_MASK*/) +{ +case VLC_OPENGL: +type = "opengl offscreen"; +break; +case VLC_OPENGL_ES2: +type = "opengl es2 offscreen"; +break; +default: +return NULL; +} + +glpriv = vlc_custom_create(parent, sizeof (*glpriv), "gl"); +if (unlikely(glpriv == NULL)) +return NULL; + +vlc_gl_t *gl = &glpriv->gl; + +gl->offscreen_chroma_out = VLC_CODEC_UNKNOWN; +gl->offscreen_vflip = false; +gl->offscreen_vctx_out = NULL; + +gl->surface = NULL; +gl->device = device ? vlc_decoder_device_Hold(device) : NULL; +gl->module = vlc_module_load(gl, type, name, true, vlc_gl_start, gl, width, + height); +if (gl->module == NULL) +{ +vlc_object_delete(gl); +return NULL; +} + +/* The implementation must initialize the output chroma */ +assert(gl->offscreen_chroma_out != VLC_CODEC_UNKNOWN); + +vlc_atomic_rc_init(&glpriv->rc); + +assert(gl->make_current); +assert(gl->release_current); +assert(gl->swap_offscreen); +assert(gl->get_pr
[vlc-commits] video_filter: add opengl filter executor
vlc | branch: master | Alexandre Janniaux | Fri Feb 26 18:10:35 2021 +0100| [f977952c30b975a5269a2cfcbf5e9b7cb3c4c2b0] | committer: Alexandre Janniaux video_filter: add opengl filter executor Add a video filter to execute OpenGL filters. It can be used as follow: ./vlc file.mkv --video-filter=opengl --opengl-filter=FILTERNAME ./vlc file.mkv --video-filter=opengl{filter=FILTERNAME} Co-authored-by: Romain Vimont Signed-off-by: Alexandre Janniaux > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f977952c30b975a5269a2cfcbf5e9b7cb3c4c2b0 --- modules/video_filter/Makefile.am | 29 modules/video_filter/opengl.c| 327 +++ 2 files changed, 356 insertions(+) diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am index 1c856b393b..68383eb3fc 100644 --- a/modules/video_filter/Makefile.am +++ b/modules/video_filter/Makefile.am @@ -124,6 +124,35 @@ libci_filters_plugin_la_LDFLAGS += -Wl,-framework,OpenGLES video_filter_LTLIBRARIES += libci_filters_plugin.la endif +libopengl_filter_plugin_la_SOURCES = video_filter/opengl.c + +if HAVE_LINUX +if HAVE_ANDROID +libopengl_filter_plugin_la_LIBADD = libvlc_opengles.la +libopengl_filter_plugin_la_CFLAGS = -DUSE_OPENGL_ES2=1 +else +libopengl_filter_plugin_la_LIBADD = libvlc_opengl.la +endif +video_filter_LTLIBRARIES += libopengl_filter_plugin.la +endif + +if HAVE_IOS +libopengl_filter_plugin_la_LIBADD = libvlc_opengles.la +libopengl_filter_plugin_la_CFLAGS = -DUSE_OPENGL_ES2=1 +video_filter_LTLIBRARIES += libopengl_filter_plugin.la +endif + +if HAVE_TVOS +libopengl_filter_plugin_la_LIBADD = libvlc_opengles.la +libopengl_filter_plugin_la_CFLAGS = -DUSE_OPENGL_ES2=1 +video_filter_LTLIBRARIES += libopengl_filter_plugin.la +endif + +if HAVE_OSX +libopengl_filter_plugin_la_LIBADD = libvlc_opengl.la +video_filter_LTLIBRARIES += libopengl_filter_plugin.la +endif + libdeinterlace_common_la_SOURCES = video_filter/deinterlace/common.c video_filter/deinterlace/common.h libdeinterlace_common_la_LDFLAGS = -static noinst_LTLIBRARIES += libdeinterlace_common.la diff --git a/modules/video_filter/opengl.c b/modules/video_filter/opengl.c new file mode 100644 index 00..dab1645fa9 --- /dev/null +++ b/modules/video_filter/opengl.c @@ -0,0 +1,327 @@ +/* + * opengl.c: OpenGL filter + * + * Copyright (C) 2020 Videolabs + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../video_output/opengl/vout_helper.h" +#include "../video_output/opengl/filters.h" +#include "../video_output/opengl/gl_api.h" +#include "../video_output/opengl/gl_common.h" +#include "../video_output/opengl/interop.h" + +#define OPENGL_CFG_PREFIX "opengl-" +static const char *const opengl_options[] = { "filter", NULL }; + +typedef struct +{ +vlc_gl_t *gl; +struct vlc_gl_filters *filters; +struct vlc_gl_interop *interop; +struct vlc_gl_api api; +} filter_sys_t; + +static picture_t *Filter(filter_t *filter, picture_t *input) +{ +filter_sys_t *sys = filter->p_sys; + +if (vlc_gl_MakeCurrent(sys->gl) != VLC_SUCCESS) +return NULL; + +int ret = vlc_gl_filters_UpdatePicture(sys->filters, input); +if (ret != VLC_SUCCESS) +{ +vlc_gl_ReleaseCurrent(sys->gl); +return NULL; +} + +ret = vlc_gl_filters_Draw(sys->filters); +if (ret != VLC_SUCCESS) +{ +vlc_gl_ReleaseCurrent(sys->gl); +return NULL; +} + +picture_t *output = vlc_gl_SwapOffscreen(sys->gl); +vlc_gl_ReleaseCurrent(sys->gl); + +if (output == NULL) +goto end; + +output->date = input->date; +output->b_force = input->b_force; +output->b_still = input->b_still; + +output->format.i_frame_rate = +filter->fmt_out.video.i_frame_rate; +output->format.i
[vlc-commits] video_filter: add egl_pbuffer filter plugin
vlc | branch: master | Alexandre Janniaux | Fri Feb 26 18:10:33 2021 +0100| [7f81aadd273385c4d5b194efd0543716ec779288] | committer: Alexandre Janniaux video_filter: add egl_pbuffer filter plugin The video filter egl_pbuffer allows running OpenGL filters inside an EGL pixel buffer context, using multiple framebuffers. It is enabled only on Android, where the display EGL_DEFAULT_DISPLAY is refcounted. Co-authored-by: Romain Vimont Signed-off-by: Alexandre Janniaux > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f81aadd273385c4d5b194efd0543716ec779288 --- modules/video_filter/egl_pbuffer.c | 467 modules/video_output/opengl/Makefile.am | 10 + modules/video_output/opengl/gl_api.c| 3 + modules/video_output/opengl/gl_common.h | 17 ++ 4 files changed, 497 insertions(+) diff --git a/modules/video_filter/egl_pbuffer.c b/modules/video_filter/egl_pbuffer.c new file mode 100644 index 00..0ecc2562d0 --- /dev/null +++ b/modules/video_filter/egl_pbuffer.c @@ -0,0 +1,467 @@ +/* + * egl_pbuffer.c: OpenGL filter in EGL offscreen framebuffer + * + * Copyright (C) 2020 Videolabs + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "../video_output/opengl/vout_helper.h" +#include "../video_output/opengl/filters.h" +#include "../video_output/opengl/gl_api.h" +#include "../video_output/opengl/gl_common.h" +#include "../video_output/opengl/interop.h" +#include +#include + +#define BUFFER_COUNT 4 + +struct pbo_picture_context +{ +struct picture_context_t context; +void *buffer_mapping; +int rc; +vlc_mutex_t *lock; +vlc_cond_t *cond; +}; + +struct vlc_gl_pbuffer +{ +vlc_gl_t*gl; +vlc_mutex_t lock; +vlc_cond_t cond; + +video_format_t fmt_out; + +struct vlc_gl_api api; + +size_t current_flip; +GLuint pixelbuffers[BUFFER_COUNT]; +GLuint framebuffers[BUFFER_COUNT]; +GLuint textures[BUFFER_COUNT]; +struct pbo_picture_context picture_contexts[BUFFER_COUNT]; + +EGLDisplay display; +EGLSurface surface; +EGLContext context; + +PFNEGLCREATEIMAGEKHRPROCeglCreateImageKHR; +PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR; + +bool current; +}; + +static int MakeCurrent (vlc_gl_t *gl) +{ +struct vlc_gl_pbuffer *sys = gl->sys; + +assert(!sys->current); +if (eglMakeCurrent (sys->display, sys->surface, sys->surface, +sys->context) != EGL_TRUE) +return VLC_EGENERIC; + +sys->current = true; +return VLC_SUCCESS; +} + +static void ReleaseCurrent (vlc_gl_t *gl) +{ +struct vlc_gl_pbuffer *sys = gl->sys; + +assert(sys->current); +eglMakeCurrent (sys->display, EGL_NO_SURFACE, EGL_NO_SURFACE, +EGL_NO_CONTEXT); + +sys->current = false; +} + +static void *GetSymbol(vlc_gl_t *gl, const char *procname) +{ +(void) gl; +return (void *)eglGetProcAddress (procname); +} + +static const char *QueryString(vlc_gl_t *gl, int32_t name) +{ +struct vlc_gl_pbuffer *sys = gl->sys; + +return eglQueryString(sys->display, name); +} + +static void *CreateImageKHR(vlc_gl_t *gl, unsigned target, void *buffer, +const int32_t *attrib_list) +{ +struct vlc_gl_pbuffer *sys = gl->sys; + +return sys->eglCreateImageKHR(sys->display, NULL, target, buffer, + attrib_list); +} + +static bool DestroyImageKHR(vlc_gl_t *gl, void *image) +{ +struct vlc_gl_pbuffer *sys = gl->sys; + +return sys->eglDestroyImageKHR(sys->display, image); +} + +static int InitEGL(vlc_gl_t *gl, unsigned width, unsigned height) +{ +struct vlc_gl_pbuffer *sys = gl->sys; + +sys->
[vlc-commits] video_output: fix leak of config_chain_t
vlc | branch: master | Alexandre Janniaux | Mon Feb 22 18:00:09 2021 +0100| [009dcf422daa8334597b153a653395565fa5564a] | committer: Alexandre Janniaux video_output: fix leak of config_chain_t If a video filter has parameters, then a config_chain_t was leaked: ./vlc --video-filter='sharpen{sigma=0.05}' video.mkv Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f37f3e8ee8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x7f37f370b196 in config_ChainParseOptions ../../src/config/chain.c:198 #2 0x7f37f370b5c6 in config_ChainCreate ../../src/config/chain.c:245 #3 0x7f37f3839bb1 in ThreadChangeFilters ../../src/video_output/video_output.c:867 #4 0x7f37f383db35 in ThreadDisplayPicture ../../src/video_output/video_output.c:1362 #5 0x7f37f3840bfe in Thread ../../src/video_output/video_output.c:1785 #6 0x7f37f3d69ea6 in start_thread nptl/pthread_create.c:477 Co-authored-by: Romain Vimont Signed-off-by: Alexandre Janniaux > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=009dcf422daa8334597b153a653395565fa5564a --- src/video_output/video_output.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index d04d3f4d11..be501eaea8 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -911,13 +911,11 @@ static void ThreadChangeFilters(vout_thread_sys_t *vout) filter_t *filter = filter_chain_AppendFilter(chain, e->name, e->cfg, NULL); if (!filter) -{ msg_Err(&vout->obj, "Failed to add filter '%s'", e->name); -config_ChainDestroy(e->cfg); -} else if (a == 1) /* Add callbacks for interactive filters */ filter_AddProxyCallbacks(&vout->obj, filter, FilterRestartCallback); +config_ChainDestroy(e->cfg); free(e->name); free(e); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] lib: media: wait preparse end before release
vlc | branch: master | Alexandre Janniaux | Fri Feb 12 12:28:27 2021 +0100| [7f19eca5892bb33632e11e993aee5dde3e879c08] | committer: Alexandre Janniaux lib: media: wait preparse end before release This is a quick fix for #25296 actually reverting the commit a708c988091d6bc770212f5deeaba45e2395f4b2, replacing the Hold/Release lifecycle used there by an ad-hoc Hold/Release which actually defer the actual release by blocking instead of releasing in the preparser thread. Indeed, libvlc_media is holding the instance used to create it, though it only needs it for preparsing. If the last reference of the media is hold by the preparser, libvlc_media will be released by the preparser thread and the libvlc_instance potentially released from there too. Since killing the libvlc_instance will join the preparser thread, it cannot be done from the preparser thread, or would lead to the failure detailed in #25296. Written differently, only the final client should make use of Hold/Release, directly through the adequate function or indirectly through the creation of new objects. In addition, a708c988091d6bc770212f5deeaba45e2395f4b2 cannot just be reverted as it was fixing cases where the libvlc_media_t object were released before preparsing is finished, and the libvlc application cannot just wait for the preparsing event to arrive since it must still typically unlock the event manager and manage subitems. Ideally, the libvlc_media would just not have a strong reference to the libvlc instance, which would allow detaching the libvlc state from the libvlccore state, but it cannot be done just yet, since the preparsing API must be splitted from libvlc_media first. Fix #25296 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f19eca5892bb33632e11e993aee5dde3e879c08 --- lib/media.c | 29 ++--- lib/media_internal.h | 6 ++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/media.c b/lib/media.c index 19283d4f44..9bac37a8dc 100644 --- a/lib/media.c +++ b/lib/media.c @@ -432,7 +432,12 @@ static void input_item_preparse_ended(input_item_t *item, return; } send_parsed_changed( p_md, new_status ); -libvlc_media_release( p_md ); + +vlc_mutex_lock(&p_md->parsed_lock); +assert(p_md->worker_count > 0); +p_md->worker_count--; +vlc_cond_signal(&p_md->idle_cond); +vlc_mutex_unlock(&p_md->parsed_lock); } /** @@ -508,6 +513,9 @@ libvlc_media_t * libvlc_media_new_from_input_item( vlc_mutex_init(&p_md->parsed_lock); vlc_mutex_init(&p_md->subitems_lock); +vlc_cond_init(&p_md->idle_cond); +p_md->worker_count = 0; + p_md->state = libvlc_NothingSpecial; /* A media descriptor can be a playlist. When you open a playlist @@ -652,6 +660,12 @@ void libvlc_media_release( libvlc_media_t *p_md ) /* Cancel asynchronous parsing (if any) */ libvlc_MetadataCancel( p_md->p_libvlc_instance->p_libvlc_int, p_md ); +/* Wait for all async tasks to stop. */ +vlc_mutex_lock( &p_md->parsed_lock ); +while( p_md->worker_count > 0 ) +vlc_cond_wait( &p_md->idle_cond, &p_md->parsed_lock ); +vlc_mutex_unlock( &p_md->parsed_lock ); + if( p_md->p_subitems ) libvlc_media_list_release( p_md->p_subitems ); @@ -862,13 +876,22 @@ static int media_parse(libvlc_media_t *media, bool b_async, if (parse_flag & libvlc_media_do_interact) parse_scope |= META_REQUEST_OPTION_DO_INTERACT; -libvlc_media_retain(media); +/* Note: we cannot keep parsed_lock when calling libvlc_MetadataRequest + * because it might also be used to submit the state synchronously + * which would result in recursive lock. */ +vlc_mutex_lock(&media->parsed_lock); +media->worker_count++; +vlc_mutex_unlock(&media->parsed_lock); + ret = libvlc_MetadataRequest(libvlc, item, parse_scope, &input_preparser_callbacks, media, timeout, media); if (ret != VLC_SUCCESS) { -libvlc_media_release(media); +vlc_mutex_lock(&media->parsed_lock); +assert(media->worker_count > 0); +media->worker_count--; +vlc_mutex_unlock(&media->parsed_lock); return ret; } } diff --git a/lib/media_internal.h b/lib/media_internal.h index b8646abce2..511a0aad15 100644 --- a/lib/media_internal.h +++ b/lib/media_internal.h @@ -48,6 +48,12 @@ struct libvlc_media_t vlc_mutex_t parsed_lock; vlc_mutex_t subitems_lock; +/* Idle protection to prevent the media from being released during + * preparsing. The preparse will be cancelled but the release will + * be blocking until no async code is using the media anymore. */
[vlc-commits] interop_cvpx: assert that chroma matches input format
vlc | branch: master | Alexandre Janniaux | Fri Jan 29 10:31:04 2021 +0100| [21eeb380e0cfaa3747de26ee6b81170021aa5ac8] | committer: Alexandre Janniaux interop_cvpx: assert that chroma matches input format > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21eeb380e0cfaa3747de26ee6b81170021aa5ac8 --- modules/video_output/opengl/interop_cvpx.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/video_output/opengl/interop_cvpx.m b/modules/video_output/opengl/interop_cvpx.m index abe95721d0..8131314863 100644 --- a/modules/video_output/opengl/interop_cvpx.m +++ b/modules/video_output/opengl/interop_cvpx.m @@ -57,6 +57,9 @@ tc_cvpx_update(const struct vlc_gl_interop *interop, GLuint *textures, (void) plane_offset; struct priv *priv = interop->priv; +/* Sanity check, don't change format behind interop's back. */ +assert(pic->format.i_chroma == interop->fmt_in.i_chroma); + CVPixelBufferRef pixelBuffer = cvpxpic_get_ref(pic); for (unsigned i = 0; i < interop->tex_count; ++i) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] gl_common: disable GL_ASSERT_NOERROR in release
vlc | branch: master | Alexandre Janniaux | Fri Feb 5 10:36:40 2021 +0100| [dca989173cf9fe355897662acd323735b37b1fcc] | committer: Alexandre Janniaux gl_common: disable GL_ASSERT_NOERROR in release ...and remove the obsolete comment, the cases have been fixed and should be fixed if it happens again. We don't need "proper event handling" as most errors are coming from programmation errors, except in a few tests (like 16bit texture test) which have been fixed already. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dca989173cf9fe355897662acd323735b37b1fcc --- modules/video_output/opengl/gl_common.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/video_output/opengl/gl_common.h b/modules/video_output/opengl/gl_common.h index 198e1b8e0b..90bfc0fb13 100644 --- a/modules/video_output/opengl/gl_common.h +++ b/modules/video_output/opengl/gl_common.h @@ -160,12 +160,7 @@ # define APIENTRY #endif -/* FIXME: GL_ASSERT_NOERROR disabled for now because: - * Proper GL error handling need to be implemented - * glClear(GL_COLOR_BUFFER_BIT) throws a GL_INVALID_FRAMEBUFFER_OPERATION on macOS - * assert fails on vout_display_opengl_Delete on iOS - */ -#if 0 +#ifndef NDEBUG # define HAVE_GL_ASSERT_NOERROR #endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] pva: remove trailing characters
vlc | branch: master | Alexandre Janniaux | Mon Feb 1 11:35:17 2021 +0100| [d8bdf8998ddb9ae5a288ec6f668ee97fb740600b] | committer: Alexandre Janniaux pva: remove trailing characters > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d8bdf8998ddb9ae5a288ec6f668ee97fb740600b --- modules/demux/pva.c | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/demux/pva.c b/modules/demux/pva.c index 252de09298..f87a86be89 100644 --- a/modules/demux/pva.c +++ b/modules/demux/pva.c @@ -456,4 +456,3 @@ static void ParsePES( demux_t *p_demux ) } es_out_Send( p_demux->out, p_sys->p_audio, p_pes ); } - ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] adaptive: BasePeriod: mark getPeriodDuration as override
vlc | branch: master | Alexandre Janniaux | Tue Feb 9 15:03:07 2021 +0100| [2906b93d005de3212bca73896ac8143cd4138286] | committer: Alexandre Janniaux adaptive: BasePeriod: mark getPeriodDuration as override Fix the warning: ../../modules/demux/smooth/playlist/../../adaptive/playlist/BasePeriod.h:49:36: warning: 'getPeriodDuration' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual vlc_tick_t getPeriodDuration() const; ^ > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2906b93d005de3212bca73896ac8143cd4138286 --- modules/demux/adaptive/playlist/BasePeriod.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/demux/adaptive/playlist/BasePeriod.h b/modules/demux/adaptive/playlist/BasePeriod.h index 3d9b81571f..5e40a2364c 100644 --- a/modules/demux/adaptive/playlist/BasePeriod.h +++ b/modules/demux/adaptive/playlist/BasePeriod.h @@ -46,7 +46,7 @@ namespace adaptive voiddebug (vlc_object_t *,int = 0) const; virtual vlc_tick_t getPeriodStart() const override; -virtual vlc_tick_t getPeriodDuration() const; +virtual vlc_tick_t getPeriodDuration() const override; virtual BasePlaylist *getPlaylist() const override; Property duration; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] adaptive: AbstractAdapatiationLogic: mark getPeriodDuration as override
vlc | branch: master | Alexandre Janniaux | Tue Feb 9 15:03:06 2021 +0100| [e57bd2aca049bc9ad2a014c2a552b6c68235a5ed] | committer: Alexandre Janniaux adaptive: AbstractAdapatiationLogic: mark getPeriodDuration as override Fix the warning: ../../modules/demux/adaptive/logic/AbstractAdaptationLogic.h:51:45: warning: 'updateDownloadRate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual voidupdateDownloadRate (const ID &, size_t, vlc_tick_t); ^ > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e57bd2aca049bc9ad2a014c2a552b6c68235a5ed --- modules/demux/adaptive/logic/AbstractAdaptationLogic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/demux/adaptive/logic/AbstractAdaptationLogic.h b/modules/demux/adaptive/logic/AbstractAdaptationLogic.h index 33becd4aca..b75bce3051 100644 --- a/modules/demux/adaptive/logic/AbstractAdaptationLogic.h +++ b/modules/demux/adaptive/logic/AbstractAdaptationLogic.h @@ -48,7 +48,7 @@ namespace adaptive virtual ~AbstractAdaptationLogic(); virtual BaseRepresentation* getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) = 0; -virtual voidupdateDownloadRate (const ID &, size_t, vlc_tick_t); +virtual voidupdateDownloadRate (const ID &, size_t, vlc_tick_t) override; virtual voidtrackerEvent (const TrackerEvent &) override {} voidsetMaxDeviceResolution (int, int); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] libmp4mux: fix zero initialization
vlc | branch: master | Alexandre Janniaux | Wed Feb 10 11:49:57 2021 +0100| [51b69b7f5def3f1f1905585e28a195d080be4c5e] | committer: Alexandre Janniaux libmp4mux: fix zero initialization The first element (initialized here by the = { 0 }) is an array, and require braces. To avoid clunky braces, use the designated zero initialization with a known simpler field. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=51b69b7f5def3f1f1905585e28a195d080be4c5e --- modules/mux/mp4/libmp4mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c index dc94af2a9a..f8086485ab 100644 --- a/modules/mux/mp4/libmp4mux.c +++ b/modules/mux/mp4/libmp4mux.c @@ -777,7 +777,7 @@ static bo_t *GetHvcCTag(const uint8_t *p_extra, size_t i_extra, return hvcC; } -struct hevc_dcr_params params = { 0 }; +struct hevc_dcr_params params = { .i_vps_count = 0 }; const uint8_t *p_nal; size_t i_nal; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] adaptive: Segment: mark debug as override
vlc | branch: master | Alexandre Janniaux | Tue Feb 9 15:03:05 2021 +0100| [f65953ef4db7b14ae99884dd6a5ca62dc1991837] | committer: Alexandre Janniaux adaptive: Segment: mark debug as override Fix warning: ../../modules/demux/dash/mp4/../mpd/../../adaptive/playlist/Segment.h:103:30: warning: 'debug' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual void debug(vlc_object_t *,int = 0) const; > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f65953ef4db7b14ae99884dd6a5ca62dc1991837 --- modules/demux/adaptive/playlist/Segment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/demux/adaptive/playlist/Segment.h b/modules/demux/adaptive/playlist/Segment.h index 39166dc7ee..978aad17c0 100644 --- a/modules/demux/adaptive/playlist/Segment.h +++ b/modules/demux/adaptive/playlist/Segment.h @@ -100,7 +100,7 @@ namespace adaptive virtual void setSourceUrl( const std::string &url ); virtual Url getUrlSegment() const override; virtual const std::vector & subSegments() const; -virtual void debug(vlc_object_t *,int = 0) const; +virtual void debug(vlc_object_t *,int = 0) const override; virtual void addSubSegment(SubSegment *); protected: ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] d3d11va: return ENOMEM for malloc error
vlc | branch: master | Alexandre Janniaux | Fri Feb 12 15:34:23 2021 +0100| [26f60f9d783edf90998bd3e05ced2d73a047f6a8] | committer: Alexandre Janniaux d3d11va: return ENOMEM for malloc error > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=26f60f9d783edf90998bd3e05ced2d73a047f6a8 --- modules/codec/avcodec/d3d11va.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c index 87c80ed1e2..bd11cbb02c 100644 --- a/modules/codec/avcodec/d3d11va.c +++ b/modules/codec/avcodec/d3d11va.c @@ -205,7 +205,7 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data) if (unlikely(pic->context == NULL)) { va_surface_Release(va_surface); -return VLC_ENOITEM; +return VLC_ENOMEM; } data[3] = (uint8_t*)sys->hw_surface[va_surface_GetIndex(va_surface)]; return VLC_SUCCESS; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] adaptive: SegmentBase: remove unused lambda capture
vlc | branch: master | Alexandre Janniaux | Wed Feb 10 11:50:25 2021 +0100| [1c6c7f23b236f7daedd6473d966dc9cfbf92e41d] | committer: Alexandre Janniaux adaptive: SegmentBase: remove unused lambda capture > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1c6c7f23b236f7daedd6473d966dc9cfbf92e41d --- modules/demux/adaptive/playlist/SegmentBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/demux/adaptive/playlist/SegmentBase.cpp b/modules/demux/adaptive/playlist/SegmentBase.cpp index 43bb91fb06..d4dc8630ea 100644 --- a/modules/demux/adaptive/playlist/SegmentBase.cpp +++ b/modules/demux/adaptive/playlist/SegmentBase.cpp @@ -54,7 +54,7 @@ vlc_tick_t SegmentBase::getMinAheadTime(uint64_t curnum) const stime_t minTime = 0; std::for_each(subsegments.cbegin() + curnum + 1, subsegments.cend(), -[&minTime,timescale](const Segment * seg){ +[&minTime](const Segment * seg){ minTime += seg->duration.Get(); }); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] qsv: use ARRAY_SIZE
vlc | branch: master | Alexandre Janniaux | Wed Feb 10 10:15:08 2021 +0100| [21bd29b1ef1f39fbc926901ac83cf85a53aca23c] | committer: Alexandre Janniaux qsv: use ARRAY_SIZE > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21bd29b1ef1f39fbc926901ac83cf85a53aca23c --- modules/codec/qsv.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c index e996b2ae21..45e9add4ca 100644 --- a/modules/codec/qsv.c +++ b/modules/codec/qsv.c @@ -353,7 +353,6 @@ static uint64_t qsv_params_get_value(const char *const *text, if (unlikely(!sel)) return list[0]; -size /= sizeof(list[0]); for (size_t i = 0; i < size; i++) if (!strcmp(sel, text[i])) { result = i; @@ -477,16 +476,16 @@ static int Open(vlc_object_t *this) sys->params.mfx.NumSlice= var_InheritInteger(enc, SOUT_CFG_PREFIX "num-slice"); sys->params.mfx.NumRefFrame = var_InheritInteger(enc, SOUT_CFG_PREFIX "num-ref-frame"); sys->params.mfx.TargetUsage = qsv_params_get_value(target_usage_text, -target_usage_list, sizeof(target_usage_list), +target_usage_list, ARRAY_SIZE(target_usage_list), var_InheritString(enc, SOUT_CFG_PREFIX "target-usage")); if (enc->fmt_out.i_codec == VLC_CODEC_H264) { sys->params.mfx.CodecId = MFX_CODEC_AVC; sys->params.mfx.CodecProfile = qsv_params_get_value(profile_h264_text, -profile_h264_list, sizeof(profile_h264_list), +profile_h264_list, ARRAY_SIZE(profile_h264_list), var_InheritString(enc, SOUT_CFG_PREFIX "h264-profile")); sys->params.mfx.CodecLevel = qsv_params_get_value(level_h264_text, -level_h264_list, sizeof(level_h264_list), +level_h264_list, ARRAY_SIZE(level_h264_list), var_InheritString(enc, SOUT_CFG_PREFIX "h264-level")); msg_Dbg(enc, "Encoder in H264 mode, with profile %d and level %d", sys->params.mfx.CodecProfile, sys->params.mfx.CodecLevel); @@ -494,10 +493,10 @@ static int Open(vlc_object_t *this) } else { sys->params.mfx.CodecId = MFX_CODEC_MPEG2; sys->params.mfx.CodecProfile = qsv_params_get_value(profile_mpeg2_text, -profile_mpeg2_list, sizeof(profile_mpeg2_list), +profile_mpeg2_list, ARRAY_SIZE(profile_mpeg2_list), var_InheritString(enc, SOUT_CFG_PREFIX "mpeg2-profile")); sys->params.mfx.CodecLevel = qsv_params_get_value(level_mpeg2_text, -level_mpeg2_list, sizeof(level_mpeg2_list), +level_mpeg2_list, ARRAY_SIZE(level_mpeg2_list), var_InheritString(enc, SOUT_CFG_PREFIX "mpeg2-level")); msg_Dbg(enc, "Encoder in MPEG2 mode, with profile %d and level %d", sys->params.mfx.CodecProfile, sys->params.mfx.CodecLevel); @@ -507,7 +506,7 @@ static int Open(vlc_object_t *this) char *psz_rc = var_InheritString(enc, SOUT_CFG_PREFIX "rc-method"); msg_Dbg(enc, "Encoder using '%s' Rate Control method", psz_rc ); sys->params.mfx.RateControlMethod = qsv_params_get_value(rc_method_text, -rc_method_list, sizeof(rc_method_list), psz_rc ); +rc_method_list, ARRAY_SIZE(rc_method_list), psz_rc ); if (sys->params.mfx.RateControlMethod == MFX_RATECONTROL_CQP) { sys->params.mfx.QPI = sys->params.mfx.QPB = sys->params.mfx.QPP = ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] qsv: avoid displaying NULL
vlc | branch: master | Alexandre Janniaux | Wed Feb 10 10:45:44 2021 +0100| [57994187013fb362f7dcf5a5a2bd32177410df36] | committer: Alexandre Janniaux qsv: avoid displaying NULL > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=57994187013fb362f7dcf5a5a2bd32177410df36 --- modules/codec/qsv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c index 45e9add4ca..0abdcf4c9c 100644 --- a/modules/codec/qsv.c +++ b/modules/codec/qsv.c @@ -504,7 +504,8 @@ static int Open(vlc_object_t *this) param_out.mfx.CodecId = sys->params.mfx.CodecId; char *psz_rc = var_InheritString(enc, SOUT_CFG_PREFIX "rc-method"); -msg_Dbg(enc, "Encoder using '%s' Rate Control method", psz_rc ); +msg_Dbg(enc, "Encoder using '%s' Rate Control method", +psz_rc ? psz_rc : rc_method_text[0]); sys->params.mfx.RateControlMethod = qsv_params_get_value(rc_method_text, rc_method_list, ARRAY_SIZE(rc_method_list), psz_rc ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] test: iosvlc: fix -fobjc-arc
vlc | branch: master | Alexandre Janniaux | Sat Feb 6 19:22:42 2021 +0100| [0bfe88030104d2e9c962c24c144ce5c17294f146] | committer: Alexandre Janniaux test: iosvlc: fix -fobjc-arc The -fobjc-arc was defined on CFLAGS whereas the only file compiled is an objective-C file, thus it was unused. With the flag moved to OBJCFLAGS, ARC is breaking the compilation because of a missing __bridge cast. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0bfe88030104d2e9c962c24c144ce5c17294f146 --- test/Makefile.am | 2 +- test/iosvlc.m| 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 54666fdc85..779c6a89a1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -295,7 +295,7 @@ endif vlc_ios_SOURCES = iosvlc.m vlc_ios_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,Foundation,-framework,UIKit vlc_ios_LDFLAGS += -Xlinker -rpath -Xlinker "$(libdir)" -vlc_ios_CFLAGS = -fobjc-arc +vlc_ios_OBJCFLAGS = -fobjc-arc vlc_ios_LDADD = ../lib/libvlc.la ../src/libvlccore.la if HAVE_IOS noinst_PROGRAMS += vlc-ios diff --git a/test/iosvlc.m b/test/iosvlc.m index 2752e5dc7b..fc73205c67 100644 --- a/test/iosvlc.m +++ b/test/iosvlc.m @@ -92,7 +92,8 @@ static int Open(vlc_object_t *obj) { AppDelegate *d = (AppDelegate *)[[UIApplication sharedApplication] delegate]; assert(d != nil && d->window != nil); -var_SetAddress(vlc_object_instance(obj), "drawable-nsobject", d->window); +var_SetAddress(vlc_object_instance(obj), "drawable-nsobject", + (__bridge void *)d->window); return VLC_SUCCESS; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] video_filter: Makefile: fix ci_filters's LDFLAGS
vlc | branch: master | Alexandre Janniaux | Tue Feb 2 16:26:16 2021 +0100| [c82c99522446be5f50296721d5716ae604eed426] | committer: Alexandre Janniaux video_filter: Makefile: fix ci_filters's LDFLAGS The libci_filter_plugin_la_LDFLAGS must always contains the value of $(AM_LDFLAGS) since it is at least defined once. Otherwise, automake won't automatically define it to $(AM_LDFLAGS) $(LDFLAGS) and the plugin won't be built correctly (ie, built as a convenience library because of the lack of -rpath definition in LDFLAGS). In addition, the frameworks were not correctly set for iOS, which was not a problem in static build because there is no linkage, nor in dynamic build before because the plugin was built as a convenience library, thus not linked nor installed to the device with the bundle script. Since the frameworks are mostly common between MacOSX and iOS, just add the corresponding OpenGL framework for each target, and define the other frameworks out of any automake condition. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c82c99522446be5f50296721d5716ae604eed426 --- modules/video_filter/Makefile.am | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am index d265d44f2f..1c856b393b 100644 --- a/modules/video_filter/Makefile.am +++ b/modules/video_filter/Makefile.am @@ -111,14 +111,16 @@ video_filter_LTLIBRARIES = \ # macOS / iOS hardware video filters libci_filters_plugin_la_SOURCES = video_filter/ci_filters.m codec/vt_utils.c codec/vt_utils.h -if HAVE_OSX libci_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(video_filterdir)' \ -Wl,-framework,Foundation -Wl,-framework,CoreGraphics -Wl,-framework,CoreImage \ - -Wl,-framework,CoreVideo -Wl,-framework,OpenGL + -Wl,-framework,CoreVideo +if HAVE_OSX +libci_filters_plugin_la_LDFLAGS += -Wl,-framework,OpenGL video_filter_LTLIBRARIES += libci_filters_plugin.la endif if HAVE_IOS +libci_filters_plugin_la_LDFLAGS += -Wl,-framework,OpenGLES video_filter_LTLIBRARIES += libci_filters_plugin.la endif ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] configure.ac: fix AC_PROG_LEX warning
vlc | branch: master | Alexandre Janniaux | Sat Jan 30 18:43:44 2021 +0100| [824b3d4551e6c19e34e31bedb6f8843cfda35ca0] | committer: Alexandre Janniaux configure.ac: fix AC_PROG_LEX warning With autoconf 2.70, the following warnings are emitted: configure.ac:56: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete ./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from... ./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from... configure.ac:56: the top level The documentation[1] of autoconf now states: > Prior to Autoconf 2.70, AC_PROG_LEX did not take any arguments, and > its behavior was different from either of the above possibilities: it > would search for a library that defines yywrap, and would set LEXLIB > to that library if it finds one. However, if a library that defines > this function could not be found, LEXLIB would be left empty and LEX > would not be reset. This behavior was due to a bug, but several > packages came to depend on it, so AC_PROG_LEX still does this if > neither the yywrap nor the noyywrap option is given. > > Usage of AC_PROG_LEX without choosing one of the yywrap or noyywrap > options is deprecated. It is usually better to use noyywrap and define > the yywrap function yourself, as this almost always renders the LEXLIB > unnecessary. The behaviour of the argument on autoconf < 2.70 is to ignore the argument, so there are no issues with adding the option. [1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/html_node/Particular-Programs.html#Particular-Programs > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=824b3d4551e6c19e34e31bedb6f8843cfda35ca0 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d57114af22..a82c956c70 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ AC_PROG_EGREP AC_PROG_MAKE_SET AC_PROG_INSTALL AM_PROG_AS -AC_PROG_LEX +AC_PROG_LEX([noyywrap]) AC_PROG_YACC AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files]) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] contrib: libarchive: fix CPP being detected incorrectly
vlc/vlc-3.0 | branch: master | Alexandre Janniaux | Mon Jan 11 15:27:22 2021 +0100| [2b94f1527bc9f494c2215ebfebb115fd17600fe8] | committer: Alexandre Janniaux contrib: libarchive: fix CPP being detected incorrectly The preprocessor is not detected and it leads to failure with empty $CPP variable being used on la_TYPE_UID_T, leading to a cascade of detection errors and redefinition of some types. PR sent upstream as https://github.com/libarchive/libarchive/pull/1481. Cherry-picked from 17652505b49e98721a6351102c8fd7b026bc61dc. Signed-off-by: Alexandre Janniaux > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=2b94f1527bc9f494c2215ebfebb115fd17600fe8 --- .../libarchive/configure.ac-add-AC_PROG_CPP.patch | 27 ++ contrib/src/libarchive/rules.mak | 1 + 2 files changed, 28 insertions(+) diff --git a/contrib/src/libarchive/configure.ac-add-AC_PROG_CPP.patch b/contrib/src/libarchive/configure.ac-add-AC_PROG_CPP.patch new file mode 100644 index 00..cdec009ef1 --- /dev/null +++ b/contrib/src/libarchive/configure.ac-add-AC_PROG_CPP.patch @@ -0,0 +1,27 @@ +From b4c5bf51436d876631e12ed8533e86405f8581d7 Mon Sep 17 00:00:00 2001 +From: Alexandre Janniaux +Date: Mon, 11 Jan 2021 12:31:53 +0100 +Subject: [PATCH] configure.ac: add AC_PROG_CPP + +Otherwise, the preprocessor is not detected and it leads to failure with +empty $CPP variable being used on la_TYPE_UID_T, leading to a cascade of +detection errors and redefinition of some types. +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index 3b4602f5..d51fa19c 100644 +--- a/configure.ac b/configure.ac +@@ -107,6 +107,7 @@ AC_SUBST(PLATFORMCPPFLAGS) + AC_PROG_CC + AC_PROG_CC_C99 + AM_PROG_CC_C_O ++AC_PROG_CPP + AC_USE_SYSTEM_EXTENSIONS + AC_LIBTOOL_WIN32_DLL + AC_PROG_LIBTOOL +-- +2.30.0 + diff --git a/contrib/src/libarchive/rules.mak b/contrib/src/libarchive/rules.mak index 76eb29e13a..6c6f3cb039 100644 --- a/contrib/src/libarchive/rules.mak +++ b/contrib/src/libarchive/rules.mak @@ -25,6 +25,7 @@ endif ifdef HAVE_WINSTORE $(APPLY) $(SRC)/libarchive/winrt.patch endif + $(APPLY) $(SRC)/libarchive/configure.ac-add-AC_PROG_CPP.patch $(call pkg_static,"build/pkgconfig/libarchive.pc.in") $(MOVE) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mediacodec: fix orientation in --no-mediacodec-dr
vlc/vlc-3.0 | branch: master | Alexandre Janniaux | Fri Jan 22 16:34:00 2021 +0100| [aad6ab89fe4ee0931c9d04a81e210e8b40e77d30] | committer: Alexandre Janniaux mediacodec: fix orientation in --no-mediacodec-dr Fix #25210 Cherry-picked from 8e37293767c5c00eab6fae2c3dd488c78e0d9fef. Signed-off-by: Alexandre Janniaux > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=aad6ab89fe4ee0931c9d04a81e210e8b40e77d30 --- modules/codec/omxil/mediacodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c index fb0e74d92e..1affbd1c00 100644 --- a/modules/codec/omxil/mediacodec.c +++ b/modules/codec/omxil/mediacodec.c @@ -453,10 +453,10 @@ static int UpdateVout(decoder_t *p_dec) /* If MediaCodec can handle the rotation, reset the orientation to * Normal in order to ask the vout not to rotate. */ +p_dec->fmt_out.video.orientation = p_dec->fmt_in.video.orientation; if (p_sys->video.i_angle != 0) { assert(p_dec->fmt_out.i_codec == VLC_CODEC_ANDROID_OPAQUE); -p_dec->fmt_out.video.orientation = p_dec->fmt_in.video.orientation; video_format_TransformTo(&p_dec->fmt_out.video, ORIENT_NORMAL); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] interop_cvpx: hold previous texture on iOS too
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 17:57:44 2021 +0100| [0b68f2cf79a66c6db9b6192e451963f9900160a2] | committer: Alexandre Janniaux interop_cvpx: hold previous texture on iOS too Otherwise, the buffer might get written while being in use in the interop. This also initialize the initial stored picture to NULL which was initialized through calloc on MacOSX. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b68f2cf79a66c6db9b6192e451963f9900160a2 --- modules/video_output/opengl/interop_cvpx.m | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/video_output/opengl/interop_cvpx.m b/modules/video_output/opengl/interop_cvpx.m index ec8681d174..abe95721d0 100644 --- a/modules/video_output/opengl/interop_cvpx.m +++ b/modules/video_output/opengl/interop_cvpx.m @@ -42,9 +42,9 @@ struct priv CVOpenGLESTextureCacheRef cache; CVOpenGLESTextureRef last_cvtexs[PICTURE_PLANE_MAX]; #else -picture_t *last_pic; CGLContextObj gl_ctx; #endif +picture_t *last_pic; }; #if TARGET_OS_IPHONE @@ -68,6 +68,10 @@ tc_cvpx_update(const struct vlc_gl_interop *interop, GLuint *textures, } } +if (priv->last_pic != NULL) +picture_Release(priv->last_pic); +priv->last_pic = picture_Hold(pic); + CVOpenGLESTextureCacheFlush(priv->cache, 0); for (unsigned i = 0; i < interop->tex_count; ++i) @@ -132,12 +136,9 @@ tc_cvpx_update(const struct vlc_gl_interop *interop, GLuint *textures, } } -if (priv->last_pic != pic) -{ -if (priv->last_pic != NULL) -picture_Release(priv->last_pic); -priv->last_pic = picture_Hold(pic); -} +if (priv->last_pic != NULL) +picture_Release(priv->last_pic); +priv->last_pic = picture_Hold(pic); return VLC_SUCCESS; } @@ -155,10 +156,9 @@ Close(struct vlc_gl_interop *interop) CFRelease(priv->last_cvtexs[i]); } CFRelease(priv->cache); -#else +#endif if (priv->last_pic != NULL) picture_Release(priv->last_pic); -#endif free(priv); } @@ -283,6 +283,8 @@ Open(vlc_object_t *obj) for (unsigned i = 0; i < interop->tex_count; ++i) priv->last_cvtexs[i] = NULL; #endif + +priv->last_pic = NULL; interop->priv = priv; static const struct vlc_gl_interop_ops ops = { .update_textures = tc_cvpx_update, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] interop_cvpx: init last_cvtexs the first time
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 17:57:43 2021 +0100| [33dc00be6f26ff93e8b08183e212791df2fae0c5] | committer: Alexandre Janniaux interop_cvpx: init last_cvtexs the first time It was initialized to zero because of calloc(). > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=33dc00be6f26ff93e8b08183e212791df2fae0c5 --- modules/video_output/opengl/interop_cvpx.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/video_output/opengl/interop_cvpx.m b/modules/video_output/opengl/interop_cvpx.m index 7fc985508e..ec8681d174 100644 --- a/modules/video_output/opengl/interop_cvpx.m +++ b/modules/video_output/opengl/interop_cvpx.m @@ -279,6 +279,9 @@ Open(vlc_object_t *obj) #if TARGET_OS_IPHONE interop->handle_texs_gen = true; + +for (unsigned i = 0; i < interop->tex_count; ++i) +priv->last_cvtexs[i] = NULL; #endif interop->priv = priv; static const struct vlc_gl_interop_ops ops = { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] ios: display: delete obsolete display module
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 17:57:42 2021 +0100| [9b00ccc44bed6e758d49ea1f6cce53f2cb208692] | committer: Alexandre Janniaux ios: display: delete obsolete display module Now that the Core Animation layer baked EAGL implementation is available as an usual vlc_gl_t opengl es2 provider, and that the UI interaction with the UIView has been moved to a specific vout window module, we don't need a specific display code for OpenGL on iOS and can rely on the usual linux/android module. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b00ccc44bed6e758d49ea1f6cce53f2cb208692 --- modules/video_output/ios.m | 265 - po/POTFILES.in | 1 - 2 files changed, 266 deletions(-) diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m deleted file mode 100644 index cd2e760e58..00 --- a/modules/video_output/ios.m +++ /dev/null @@ -1,265 +0,0 @@ -/* - * ios.m: iOS OpenGL ES provider - * - * Copyright (C) 2001-2017 VLC authors and VideoLAN - * - * Authors: Pierre d'Herbemont - * Felix Paul Kühne - * David Fuhrmann - * Rémi Denis-Courmont - * Laurent Aimar - * Eric Petit - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - */ - -/* - * Preamble - */ - -#import -#import -#import -#import -#import -#import - -#ifdef HAVE_CONFIG_H -# import "config.h" -#endif - -#import -#import -#import -#import -#import -#import "opengl/filter_draw.h" -#import "opengl/renderer.h" -#import "opengl/vout_helper.h" - -/** - * Forward declarations - */ -static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, -video_format_t *fmt, vlc_video_context *context); -static void Close(vout_display_t *vd); - -static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t); -static void PictureDisplay(vout_display_t *, picture_t *); -static int Control(vout_display_t*, int); - -/** - * Module declaration - */ -vlc_module_begin () -set_shortname("iOS vout") -set_description("iOS OpenGL video output") -set_category(CAT_VIDEO) -set_subcategory(SUBCAT_VIDEO_VOUT) -set_callback_display(Open, 300) - -add_shortcut("vout_ios2", "vout_ios") -add_glopts() - -add_opengl_submodule_renderer() -add_opengl_submodule_draw() -vlc_module_end () - -struct vout_display_sys_t -{ -VLCOpenGLES2VideoView *glESView; - -vlc_gl_t *gl; - -vout_window_t *embed; -}; - -struct gl_sys -{ -VLCOpenGLES2VideoView *glESView; -vout_display_opengl_t *vgl; -GLuint renderBuffer; -GLuint frameBuffer; -EAGLContext *previousEaglContext; -}; - - -static int SetViewpoint(vout_display_t *vd, const vlc_viewpoint_t *vp) -{ -vout_display_sys_t *sys = vd->sys; -struct gl_sys *glsys = sys->gl->sys; -return vout_display_opengl_SetViewpoint (glsys->vgl, vp); -} - -static const struct vlc_display_operations ops = { -Close, PictureRender, PictureDisplay, Control, NULL, SetViewpoint, -}; - -static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, -video_format_t *fmt, vlc_video_context *context) -{ -vout_window_t *wnd = cfg->window; -if (wnd->type != VOUT_WINDOW_TYPE_NSOBJECT) -return VLC_EGENERIC; - -vout_display_sys_t *sys = vlc_obj_calloc(VLC_OBJECT(vd), 1, sizeof(*sys)); - -if (!sys) -return VLC_ENOMEM; - -vd->sys = sys; -sys->gl = NULL; - -@autoreleasepool { -/* setup the actual OpenGL ES view */ - -[VLCOpenGLES2VideoView performSelectorOnMainThread:@selector(getNewView:) -withObject:[NSArray arrayWithObjects: - [NSValue v
[vlc-commits] ios: move caeagl implementation out of display
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 17:57:41 2021 +0100| [d0a49a87f82e5348e1e7d0bd94d319e73b9efc2b] | committer: Alexandre Janniaux ios: move caeagl implementation out of display > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0a49a87f82e5348e1e7d0bd94d319e73b9efc2b --- modules/video_output/Makefile.am | 15 +- modules/video_output/apple/VLCOpenGLES2VideoView.m | 495 + modules/video_output/ios.m | 482 3 files changed, 505 insertions(+), 487 deletions(-) diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am index 47afbbdc39..8879321dfb 100644 --- a/modules/video_output/Makefile.am +++ b/modules/video_output/Makefile.am @@ -48,27 +48,32 @@ libglinterop_cvpx_plugin_la_CFLAGS = $(AM_CFLAGS) -DUSE_OPENGL_ES2 libglinterop_cvpx_plugin_la_LDFLAGS += -Wl,-framework,IOSurface,-framework,OpenGLES endif -libvout_ios_plugin_la_SOURCES = video_output/ios.m +libvout_ios_plugin_la_SOURCES = video_output/opengl/display.c libvout_ios_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) -DUSE_OPENGL_ES2 libvout_ios_plugin_la_LIBADD = libvlc_opengles.la -libvout_ios_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \ - -Wl,-framework,Foundation,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit libuiview_window_plugin_la_SOURCES = video_output/apple/VLCVideoUIView.m libuiview_window_plugin_la_LDFLAGS = $(AM_LDFLAGS) \ -Wl,-framework,Foundation,-framework,QuartzCore,-framework,UIKit libuiview_window_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) -fobjc-arc +libcaeagl_ios_plugin_la_SOURCES = video_output/apple/VLCOpenGLES2VideoView.m +libcaeagl_ios_plugin_la_LDFLAGS = $(AM_LDFLAGS) \ + -Wl,-framework,Foundation,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit +libcaeagl_ios_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) -fobjc-arc + if HAVE_IOS vout_LTLIBRARIES += libvout_ios_plugin.la \ libglinterop_cvpx_plugin.la \ - libuiview_window_plugin.la + libuiview_window_plugin.la \ + libcaeagl_ios_plugin.la endif if HAVE_TVOS vout_LTLIBRARIES += \ libvout_ios_plugin.la \ libglinterop_cvpx_plugin.la \ - libuiview_window_plugin.la + libuiview_window_plugin.la \ + libcaeagl_ios_plugin.la endif libglinterop_vaapi_plugin_la_SOURCES = video_output/opengl/interop_vaapi.c \ diff --git a/modules/video_output/apple/VLCOpenGLES2VideoView.m b/modules/video_output/apple/VLCOpenGLES2VideoView.m new file mode 100644 index 00..0d617d30b6 --- /dev/null +++ b/modules/video_output/apple/VLCOpenGLES2VideoView.m @@ -0,0 +1,495 @@ +/* + * VLCOpenGLES2VideoView.m: iOS OpenGL ES provider through CAEAGLLayer + * + * Copyright (C) 2001-2017 VLC authors and VideoLAN + * Copyright (C) 2021 Videolabs + * + * Authors: Pierre d'Herbemont + * Felix Paul Kühne + * David Fuhrmann + * Rémi Denis-Courmont + * Laurent Aimar + * Eric Petit + * Alexandre Janniaux + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + */ + +/* + * Preamble + */ + +#import +#import +#import +#import +#import +#import + +#ifdef HAVE_CONFIG_H +# import "config.h" +#endif + +#import +#import +#import +#import +#import +#import "../opengl/vout_helper.h" +#import "../opengl/gl_api.h" + +@interface VLCOpenGLES2VideoView : UIView { +vlc_gl_t *_gl; + +EAGLContext *_eaglContext; +EAGLContext *_previousEaglContext; +CAEAGLLayer *_layer; + +vlc_mutex_t _mutex; +vlc_cond_t _gl_attached_wait; +BOOL_gl_attached; + +BOOL _bufferNeedReset; +BOOL _appActive; +BOOL _eaglEnabled; + +GLuint _renderBuffer; +GLuint _frameBuffer; + +struct vlc_gl_api _api; +} + +- (id)initWithFrame:(CGRect)frame
[vlc-commits] opengl: makefile.am: clean opengl targets
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 12:11:13 2021 +0100| [16e577ca70efaa1ab7c08525efd3d071c263b234] | committer: Alexandre Janniaux opengl: makefile.am: clean opengl targets > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=16e577ca70efaa1ab7c08525efd3d071c263b234 --- modules/video_output/opengl/Makefile.am | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/video_output/opengl/Makefile.am b/modules/video_output/opengl/Makefile.am index 9e08ec09fc..76f6df47a0 100644 --- a/modules/video_output/opengl/Makefile.am +++ b/modules/video_output/opengl/Makefile.am @@ -55,7 +55,7 @@ endif ### OpenGL ### libgles2_plugin_la_SOURCES = video_output/opengl/display.c libgles2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES2_CFLAGS) -DUSE_OPENGL_ES2 -libgles2_plugin_la_LIBADD = $(GLES2_LIBS) libvlc_opengles.la +libgles2_plugin_la_LIBADD = libvlc_opengles.la libgles2_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' if HAVE_GLES2 vout_LTLIBRARIES += libgles2_plugin.la @@ -64,10 +64,6 @@ endif libgl_plugin_la_SOURCES = video_output/opengl/display.c libgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS) $(OPENGL_COMMONCFLAGS) libgl_plugin_la_LIBADD = libvlc_opengl.la -if HAVE_WIN32 -libgl_plugin_la_CFLAGS += -DHAVE_GL_CORE_SYMBOLS -libgl_plugin_la_LIBADD += $(GL_LIBS) -endif if HAVE_GL vout_LTLIBRARIES += libgl_plugin.la ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] vlc_opengl: expose vlc_gl_api_type
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 12:11:10 2021 +0100| [8fb7688cfef363989268b9cf04b439674938de56] | committer: Alexandre Janniaux vlc_opengl: expose vlc_gl_api_type It will be used to determine whether we should use OpenGL or OpenGL ES during the runtime. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8fb7688cfef363989268b9cf04b439674938de56 --- include/vlc_opengl.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h index 79e165e72b..ffb81a651d 100644 --- a/include/vlc_opengl.h +++ b/include/vlc_opengl.h @@ -38,6 +38,11 @@ struct vout_display_cfg; */ typedef struct vlc_gl_t vlc_gl_t; +enum vlc_gl_api_type { +VLC_OPENGL, +VLC_OPENGL_ES2, +}; + struct vlc_gl_t { struct vlc_object_t obj; @@ -77,11 +82,7 @@ struct vlc_gl_t const char *(*getExtensionsString)(vlc_gl_t *); } wgl; }; -}; -enum { -VLC_OPENGL, -VLC_OPENGL_ES2, }; /** ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] video_output: Makefile.am: remove OpenGLES from uiview
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 17:57:39 2021 +0100| [3f136d3359da7dd8a98f1508d00d617a6911230a] | committer: Alexandre Janniaux video_output: Makefile.am: remove OpenGLES from uiview The UIView-based video output doesn't use OpenGLES. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f136d3359da7dd8a98f1508d00d617a6911230a --- modules/video_output/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am index b77fefda36..47afbbdc39 100644 --- a/modules/video_output/Makefile.am +++ b/modules/video_output/Makefile.am @@ -56,7 +56,7 @@ libvout_ios_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \ libuiview_window_plugin_la_SOURCES = video_output/apple/VLCVideoUIView.m libuiview_window_plugin_la_LDFLAGS = $(AM_LDFLAGS) \ - -Wl,-framework,Foundation,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit + -Wl,-framework,Foundation,-framework,QuartzCore,-framework,UIKit libuiview_window_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) -fobjc-arc if HAVE_IOS ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] opengl: gl_api: load symbols from loader on GL ES2
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 12:11:12 2021 +0100| [de6322e38a0dc90ff6127e1cea1c08e77b059899] | committer: Alexandre Janniaux opengl: gl_api: load symbols from loader on GL ES2 The clients are egl and iOS, which both supports the extension EGL_KHR_get_all_proc_address or equivalent (through dlsym for instance). > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de6322e38a0dc90ff6127e1cea1c08e77b059899 --- modules/video_output/opengl/gl_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/video_output/opengl/gl_api.c b/modules/video_output/opengl/gl_api.c index dd8f37c9ba..8cbce7a41d 100644 --- a/modules/video_output/opengl/gl_api.c +++ b/modules/video_output/opengl/gl_api.c @@ -34,7 +34,7 @@ int vlc_gl_api_Init(struct vlc_gl_api *api, vlc_gl_t *gl) { -#if defined(USE_OPENGL_ES2) || defined(HAVE_GL_CORE_SYMBOLS) +#if defined(HAVE_GL_CORE_SYMBOLS) #define GET_PROC_ADDR_CORE(name) api->vt.name = gl##name #else #define GET_PROC_ADDR_CORE(name) GET_PROC_ADDR_EXT(name, true) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] opengl: forward api type in vlc_gl_api_Init
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 12:11:11 2021 +0100| [df6bc9dedd034423221b437fbcc74fa18f8f98f6] | committer: Alexandre Janniaux opengl: forward api type in vlc_gl_api_Init Instead of defining it at compile time. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df6bc9dedd034423221b437fbcc74fa18f8f98f6 --- include/vlc_opengl.h | 2 ++ modules/video_output/caopengllayer.m | 1 + modules/video_output/ios.m | 1 + modules/video_output/macosx.m| 1 + modules/video_output/opengl/gl_api.c | 44 ++-- src/video_output/opengl.c| 5 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h index ffb81a651d..a99c6ced64 100644 --- a/include/vlc_opengl.h +++ b/include/vlc_opengl.h @@ -83,6 +83,8 @@ struct vlc_gl_t } wgl; }; +/* Defined by the core for libvlc_opengl API loading. */ +enum vlc_gl_api_type api_type; }; /** diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m index 587817d153..6873a1b450 100644 --- a/modules/video_output/caopengllayer.m +++ b/modules/video_output/caopengllayer.m @@ -191,6 +191,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg, sys->gl->release_current = OpenglUnlock; sys->gl->swap = OpenglSwap; sys->gl->get_proc_address = OurGetProcAddress; +sys->gl->api_type = VLC_OPENGL; struct gl_sys *glsys = sys->gl->sys = malloc(sizeof(*glsys)); if (!sys->gl->sys) diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m index 443c23d417..1a67a2de72 100644 --- a/modules/video_output/ios.m +++ b/modules/video_output/ios.m @@ -202,6 +202,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, sys->gl->release_current = GLESReleaseCurrent; sys->gl->swap = GLESSwap; sys->gl->get_proc_address = OurGetProcAddress; +sys->gl->api_type = VLC_OPENGL_ES2; if (vlc_gl_MakeCurrent(sys->gl) != VLC_SUCCESS) goto bailout; diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m index ee1feaad09..9420abaf90 100644 --- a/modules/video_output/macosx.m +++ b/modules/video_output/macosx.m @@ -227,6 +227,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg, sys->gl->release_current = OpenglUnlock; sys->gl->swap = OpenglSwap; sys->gl->get_proc_address = OurGetProcAddress; +sys->gl->api_type = VLC_OPENGL; const vlc_fourcc_t *subpicture_chromas; diff --git a/modules/video_output/opengl/gl_api.c b/modules/video_output/opengl/gl_api.c index d990493832..dd8f37c9ba 100644 --- a/modules/video_output/opengl/gl_api.c +++ b/modules/video_output/opengl/gl_api.c @@ -39,6 +39,7 @@ vlc_gl_api_Init(struct vlc_gl_api *api, vlc_gl_t *gl) #else #define GET_PROC_ADDR_CORE(name) GET_PROC_ADDR_EXT(name, true) #endif + #define GET_PROC_ADDR_EXT(name, critical) do { \ api->vt.name = vlc_gl_GetProcAddress(gl, "gl"#name); \ if (api->vt.name == NULL && critical) { \ @@ -46,13 +47,19 @@ vlc_gl_api_Init(struct vlc_gl_api *api, vlc_gl_t *gl) return VLC_EGENERIC; \ } \ } while(0) -#if defined(USE_OPENGL_ES2) -#define GET_PROC_ADDR(name) GET_PROC_ADDR_CORE(name) -#define GET_PROC_ADDR_CORE_GL(name) GET_PROC_ADDR_EXT(name, false) /* optional for GLES */ -#else -#define GET_PROC_ADDR(name) GET_PROC_ADDR_EXT(name, true) -#define GET_PROC_ADDR_CORE_GL(name) GET_PROC_ADDR_CORE(name) -#endif + +#define GET_PROC_ADDR(name) \ +if (gl->api_type == VLC_OPENGL_ES2) \ +GET_PROC_ADDR_CORE(name); \ +else \ +GET_PROC_ADDR_EXT(name, true) + +#define GET_PROC_ADDR_CORE_GL(name) \ +if (gl->api_type == VLC_OPENGL_ES2) \ +GET_PROC_ADDR_EXT(name, false); /* optional for GLES */ \ +else \ +GET_PROC_ADDR_CORE(name) + #define GET_PROC_ADDR_OPTIONAL(name) GET_PROC_ADDR_EXT(name, false) /* GL 3 or more */ GET_PROC_ADDR_CORE(BindTexture); @@ -167,16 +174,19 @@ vlc_gl_api_Init(struct vlc_gl_api *api, vlc_gl_t *gl) while (error != GL_NO_ERROR) error = api->vt.GetError(); -#ifdef USE_OPENGL_ES2 -api->is_gles = true; -/* OpenGL ES 2 includes support for non-power of 2 textures by specification - * so checks for extensions are bound to fail. Check for OpenGL ES version instead. */ -api->supports_npot = true; -#else -api->is_gles = false; -api->supports_npot = vlc_gl_StrHasToken(api->extensions, "GL_ARB_texture_non_power_of_two") || - vlc_gl_StrHasToken(api->extensions, "GL_APPLE_texture_2D_limited_npot"); -#endif +if (gl->api_type == VLC_OPENGL_ES2) +{ +api->is_gles = t
[vlc-commits] lib: media: remove libvlc_MediaFreed
vlc | branch: master | Alexandre Janniaux | Wed Jan 27 17:11:14 2021 +0100| [ff8775c96546a9904523cbb0ede35a05af5faed6] | committer: Alexandre Janniaux lib: media: remove libvlc_MediaFreed It has little rationale and is fairly unused. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ff8775c96546a9904523cbb0ede35a05af5faed6 --- include/vlc/libvlc_events.h | 13 - lib/media.c | 8 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h index 826a0f4562..bda9d89ca0 100644 --- a/include/vlc/libvlc_events.h +++ b/include/vlc/libvlc_events.h @@ -70,16 +70,15 @@ enum libvlc_event_e { * libvlc_media_parse_stop() */ libvlc_MediaParsedChanged, -/** - * A \link #libvlc_media_t media item\endlink was freed - */ -libvlc_MediaFreed, + +/* Removed: libvlc_MediaFreed, */ + /** * \link #libvlc_state_t State\endlink of the \link * #libvlc_media_t media item\endlink changed * \see libvlc_media_get_state() */ -libvlc_MediaStateChanged, +libvlc_MediaStateChanged = libvlc_MediaParsedChanged + 2, /** * Subitem tree was added to a \link #libvlc_media_t media item\endlink */ @@ -263,10 +262,6 @@ typedef struct libvlc_event_t int new_status; /**< see @ref libvlc_media_parsed_status_t */ } media_parsed_changed; struct -{ -libvlc_media_t * md; -} media_freed; -struct { int new_state; /**< see @ref libvlc_state_t */ } media_state_changed; diff --git a/lib/media.c b/lib/media.c index 6f7911e0a2..19283d4f44 100644 --- a/lib/media.c +++ b/lib/media.c @@ -657,14 +657,6 @@ void libvlc_media_release( libvlc_media_t *p_md ) input_item_Release( p_md->p_input_item ); -/* Construct the event */ -libvlc_event_t event; -event.type = libvlc_MediaFreed; -event.u.media_freed.md = p_md; - -/* Send the event */ -libvlc_event_send( &p_md->event_manager, &event ); - libvlc_event_manager_destroy( &p_md->event_manager ); libvlc_release( p_md->p_libvlc_instance ); free( p_md ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] opengl: display: flip configuration before applying it
vlc | branch: master | Alexandre Janniaux | Tue Jan 26 18:59:37 2021 +0100| [dd3396d1e29eb9e357707337f782b99d4ee5dfba] | committer: Alexandre Janniaux opengl: display: flip configuration before applying it This was done everywhere except at the initialization. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd3396d1e29eb9e357707337f782b99d4ee5dfba --- modules/video_output/opengl/display.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c index c62ab37298..d95ce8fb6e 100644 --- a/modules/video_output/opengl/display.c +++ b/modules/video_output/opengl/display.c @@ -97,6 +97,16 @@ static const struct vlc_display_operations ops = { Close, PictureRender, PictureDisplay, Control, NULL, SetViewpoint, }; +static void +FlipVerticalAlign(vout_display_cfg_t *cfg) +{ +/* Reverse vertical alignment as the GL tex are Y inverted */ +if (cfg->align.vertical == VLC_VIDEO_ALIGN_TOP) +cfg->align.vertical = VLC_VIDEO_ALIGN_BOTTOM; +else if (cfg->align.vertical == VLC_VIDEO_ALIGN_BOTTOM) +cfg->align.vertical = VLC_VIDEO_ALIGN_TOP; +} + /** * Allocates a surface and an OpenGL context for video output. */ @@ -143,7 +153,10 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, if (sys->gl == NULL) goto error; -vout_display_PlacePicture(&sys->place, vd->source, cfg); + +vout_display_cfg_t flipped_cfg = *cfg; +FlipVerticalAlign(&flipped_cfg); +vout_display_PlacePicture(&sys->place, vd->source, &flipped_cfg); sys->place_changed = true; vlc_gl_Resize (sys->gl, cfg->display.width, cfg->display.height); @@ -222,16 +235,6 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic) } } -static void -FlipVerticalAlign(vout_display_cfg_t *cfg) -{ -/* Reverse vertical alignment as the GL tex are Y inverted */ -if (cfg->align.vertical == VLC_VIDEO_ALIGN_TOP) -cfg->align.vertical = VLC_VIDEO_ALIGN_BOTTOM; -else if (cfg->align.vertical == VLC_VIDEO_ALIGN_BOTTOM) -cfg->align.vertical = VLC_VIDEO_ALIGN_TOP; -} - static int Control (vout_display_t *vd, int query) { vout_display_sys_t *sys = vd->sys; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] opengl: api: drain error in case of error
vlc | branch: master | Alexandre Janniaux | Wed Jan 27 18:13:45 2021 +0100| [41b34d1188acd469d5bc2d3e83112162fd36a570] | committer: Alexandre Janniaux opengl: api: drain error in case of error Otherwise, the error might be detected afterwards in an unrelated part of the code, leading to potential failure or assertion depending on the compilation options. Indeed, an OpenGL call can lead to multiple errors and glGetError must be called in loop, as mentioned by the documentation. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml > To allow for distributed implementations, there may be several error > flags. If any single error flag has recorded an error, the value of > that flag is returned and that flag is reset to GL_NO_ERROR when > glGetError is called. If more than one flag has recorded an error, > glGetError returns and clears an arbitrary error flag value. Thus, > glGetError should always be called in a loop, until it returns > GL_NO_ERROR, if all error flags are to be reset. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=41b34d1188acd469d5bc2d3e83112162fd36a570 --- modules/video_output/opengl/gl_api.c | 4 1 file changed, 4 insertions(+) diff --git a/modules/video_output/opengl/gl_api.c b/modules/video_output/opengl/gl_api.c index 1264dde2a1..d990493832 100644 --- a/modules/video_output/opengl/gl_api.c +++ b/modules/video_output/opengl/gl_api.c @@ -163,6 +163,10 @@ vlc_gl_api_Init(struct vlc_gl_api *api, vlc_gl_t *gl) */ api->supports_multisample = version >= 3 && error == GL_NO_ERROR; +/* Drain the errors before continuing. */ +while (error != GL_NO_ERROR) +error = api->vt.GetError(); + #ifdef USE_OPENGL_ES2 api->is_gles = true; /* OpenGL ES 2 includes support for non-power of 2 textures by specification ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] wgl: forward all symbols through GetProcAddress
vlc | branch: master | Alexandre Janniaux | Thu Jan 28 09:08:23 2021 +0100| [c7caeda551f1b1949a99c49b8f6a303a113711e4] | committer: Alexandre Janniaux wgl: forward all symbols through GetProcAddress Mimic the EGL_KHR_get_all_proc_address extension and forward every OpenGL client function through the get_proc_address callback. Effectively fix the glwin32 display which wasn't working anymore since the split into libvlc_opengl da1853b2c2db853f337dc95dbf0164922d050a1b. Refs #25234 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7caeda551f1b1949a99c49b8f6a303a113711e4 --- modules/video_output/Makefile.am | 2 +- modules/video_output/win32/wgl.c | 16 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am index 8f56e4f734..b77fefda36 100644 --- a/modules/video_output/Makefile.am +++ b/modules/video_output/Makefile.am @@ -160,7 +160,7 @@ libwgl_plugin_la_SOURCES = video_output/win32/wgl.c libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid libvlc_opengl.la libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 libvlc_opengl.la -libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) -DHAVE_GL_CORE_SYMBOLS +libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) libwgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) libglwin32_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' diff --git a/modules/video_output/win32/wgl.c b/modules/video_output/win32/wgl.c index ec02c2dc6e..0622e3e590 100644 --- a/modules/video_output/win32/wgl.c +++ b/modules/video_output/win32/wgl.c @@ -62,6 +62,7 @@ struct vout_display_sys_t HWND hvideownd; HDC hGLDC; HGLRC hGLRC; +HMODULE hOpengl; vlc_gl_t *gl; HDC affinityHDC; // DC for the selected GPU @@ -173,6 +174,7 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height) sys->hvideownd = wnd->handle.hwnd; sys->hGLDC = GetDC(sys->hvideownd); +sys->hOpengl = LoadLibraryA("opengl32.dll"); if (sys->hGLDC == NULL) { msg_Err(gl, "Could not get the device context"); @@ -256,6 +258,8 @@ static void Close(vlc_gl_t *gl) wglDeleteContext(sys->hGLRC); if (sys->hGLDC) ReleaseDC(sys->hvideownd, sys->hGLDC); +if (sys->hOpengl) +FreeLibrary(sys->hOpengl); DestroyGPUAffinityDC(gl); @@ -270,8 +274,16 @@ static void Swap(vlc_gl_t *gl) static void *OurGetProcAddress(vlc_gl_t *gl, const char *name) { -VLC_UNUSED(gl); -return wglGetProcAddress(name); +vout_display_sys_t *sys = gl->sys; + +/* See https://www.khronos.org/opengl/wiki/Load_OpenGL_Functions */ +void *f= (void *)wglGetProcAddress(name); +if(f == 0 || (f == (void*)0x1) || (f == (void*)0x2) || + (f == (void*)0x3) || (f == (void*)-1) ) +{ +f = (void *)GetProcAddress(sys->hOpengl, name); +} +return f; } static int MakeCurrent(vlc_gl_t *gl) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] vlc_es: define ORIENT_MAX
vlc | branch: master | Alexandre Janniaux | Mon Jan 25 11:00:25 2021 +0100| [90feff25c89ba3bfe2c38f6ce895a74d08c1b4a8] | committer: Alexandre Janniaux vlc_es: define ORIENT_MAX > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=90feff25c89ba3bfe2c38f6ce895a74d08c1b4a8 --- include/vlc_es.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/vlc_es.h b/include/vlc_es.h index 404a937d83..193c61bff6 100644 --- a/include/vlc_es.h +++ b/include/vlc_es.h @@ -184,6 +184,7 @@ typedef enum video_orientation_t ORIENT_LEFT_BOTTOM, /**< Rotated 90 degrees anti-clockwise */ ORIENT_RIGHT_TOP, /**< Rotated 90 degrees clockwise */ ORIENT_RIGHT_BOTTOM, /**< Anti-transposed */ +#define ORIENT_MAX ((size_t)ORIENT_RIGHT_BOTTOM) ORIENT_NORMAL = ORIENT_TOP_LEFT, ORIENT_TRANSPOSED = ORIENT_LEFT_TOP, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] ios: remove variable ios-eaglcontext
vlc | branch: master | Alexandre Janniaux | Tue Jan 26 10:37:12 2021 +0100| [d15b3c1c5bb40ae1dec76032fe49e97ae8119812] | committer: Alexandre Janniaux ios: remove variable ios-eaglcontext Unused since cb6b1d5fb6c28893479f737a94da2bc753cbe8b9. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d15b3c1c5bb40ae1dec76032fe49e97ae8119812 --- modules/video_output/ios.m | 7 --- 1 file changed, 7 deletions(-) diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m index aa43020eed..443c23d417 100644 --- a/modules/video_output/ios.m +++ b/modules/video_output/ios.m @@ -169,8 +169,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, vd->sys = sys; sys->gl = NULL; -var_Create(vlc_object_parent(vd), "ios-eaglcontext", VLC_VAR_ADDRESS); - @autoreleasepool { /* setup the actual OpenGL ES view */ @@ -181,7 +179,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, waitUntilDone:YES]; if (!sys->glESView) { msg_Err(vd, "Creating OpenGL ES 2 view failed"); -var_Destroy(vlc_object_parent(vd), "ios-eaglcontext"); return VLC_EGENERIC; } @@ -255,7 +252,6 @@ static void Close(vout_display_t *vd) [sys->glESView cleanAndRelease:flushed]; } -var_Destroy(vlc_object_parent(vd), "ios-eaglcontext"); } /* @@ -396,9 +392,6 @@ static void GLESSwap(vlc_gl_t *gl) } [self releaseCurrent:previousEaglContext]; -/* Set "ios-eaglcontext" to be used by cvpx fitlers/glconv */ -var_SetAddress(vlc_object_parent(_voutDisplay), "ios-eaglcontext", _eaglContext); - _layer = (CAEAGLLayer *)self.layer; _layer.drawableProperties = [NSDictionary dictionaryWithObject:kEAGLColorFormatRGBA8 forKey: kEAGLDrawablePropertyColorFormat]; _layer.opaque = YES; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] configure.ac: fix deprecated mention with newer autoconf
vlc | branch: master | Alexandre Janniaux | Wed Jan 27 13:00:23 2021 +0100| [7eb922bcb2cb9b4a023597a25871074c6fd9e42a] | committer: Alexandre Janniaux configure.ac: fix deprecated mention with newer autoconf > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7eb922bcb2cb9b4a023597a25871074c6fd9e42a --- configure.ac | 38 +- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index d3ea76c423..b62718e82e 100644 --- a/configure.ac +++ b/configure.ac @@ -818,15 +818,14 @@ dnl Check for struct sockaddr_storage AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if does not define.]) dnl ` (fix VIM syntax highlight AH_TEMPLATE(ss_family, [Define to `sa_family' if does not define.]) dnl ` (fix VIM syntax highlight AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage, - [AC_TRY_COMPILE( -[#include + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #if defined( _WIN32 ) # include #else # include - #endif], [struct sockaddr_storage addr;], - ac_cv_struct_sockaddr_storage=yes, - ac_cv_struct_sockaddr_storage=no)]) + #endif]], [[struct sockaddr_storage addr;]])], + [ac_cv_struct_sockaddr_storage=yes], + [ac_cv_struct_sockaddr_storage=no])]) AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [ AC_DEFINE(sockaddr_storage, sockaddr) AC_DEFINE(ss_family, sa_family) @@ -984,8 +983,8 @@ AC_LANG_PUSH(C++) AC_CACHE_CHECK([if C++ headers define locale_t], [ac_cv_cxx_locale_t], [ac_cv_cxx_locale_t=no - AC_TRY_COMPILE([#include ], [locale_t loc;], -[ac_cv_cxx_locale_t=yes])]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[locale_t loc;]])], +[ac_cv_cxx_locale_t=yes],[])]) if test "${ac_cv_cxx_locale_t}" != "no"; then AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t) fi @@ -1283,7 +1282,7 @@ AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [ AS_IF([test "${SYS}" = "mingw32"], [ LDFLAGS="${LDFLAGS} -lssp" AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [ -AC_TRY_LINK([#include ],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char buf[100]; fgets(buf, sizeof(buf), stdin);]])],[ ac_cv_ld_ssp="yes" ], [ ac_cv_ld_ssp="no" @@ -1302,7 +1301,7 @@ AS_IF([test "${SYS}" = "mingw32"], [ VLC_SAVE_FLAGS LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic" AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [ - AC_TRY_LINK([],, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ ac_cv_ld_bsymbolic="-Wl,-Bsymbolic" ], [ ac_cv_ld_bsymbolic="" @@ -1315,7 +1314,7 @@ AC_SUBST([SYMBOLIC_LDFLAGS]) VLC_SAVE_FLAGS LDFLAGS="${LDFLAGS} -Wl,-z,defs" AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [ - AC_TRY_LINK([],, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ ac_cv_ld_z_defs="yes" ], [ ac_cv_ld_z_defs="no" @@ -1327,8 +1326,9 @@ dnl Check for __attribute__((packed)) AC_CACHE_CHECK([for __attribute__((packed))], [ac_cv_c_attribute_packed], [ac_cv_c_attribute_packed=no - AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;], -[ac_cv_c_attribute_packed=yes])]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], +[[struct __attribute__((__packed__)) foo { int a; } b; (void)b;]])], + [ac_cv_c_attribute_packed=yes],[])]) if test "${ac_cv_c_attribute_packed}" != "no"; then AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs) fi @@ -1811,10 +1811,14 @@ AS_IF([test "${enable_altivec}" = "yes"], [ VLC_SAVE_FLAGS AC_CACHE_CHECK([if $CC groks AltiVec inline assembly], [ac_cv_altivec_inline], -[AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");], - ac_cv_altivec_inline="yes", - [CFLAGS="${CFLAGS} -Wa,-maltivec" - AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");], +[AC_COMPILE_IFELSE([ +AC_LANG_PROGRAM([[]], +[[asm volatile("vperm 0,1,2,3");]])], + [ac_cv_altivec_inline="yes"], + [CFLAGS="${CFLAGS} -Wa,-maltivec" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[]], +[[asm volatile("vperm 0,1,2,3");]])], [ac_cv_altivec_inline="-Wa,-maltivec"], ac_cv_altivec_inline=no) ])]) @@ -1856,7 +1860,7 @@ AS_IF([test "${enable_altivec}" = "yes"], [ LDFLAGS="
[vlc-commits] test: media: fix memory leak
vlc | branch: master | Alexandre Janniaux | Wed Jan 27 16:07:58 2021 +0100| [daac6d85e279fa7c9abe5534c338b0fa55a2714a] | committer: Alexandre Janniaux test: media: fix memory leak > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=daac6d85e279fa7c9abe5534c338b0fa55a2714a --- test/libvlc/media.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/libvlc/media.c b/test/libvlc/media.c index 65673c855f..2d27cbb1d6 100644 --- a/test/libvlc/media.c +++ b/test/libvlc/media.c @@ -367,6 +367,7 @@ int main(int i_argc, char *ppsz_argv[]) test_media_preparsed (vlc, psz_test_path, psz_test_url, libvlc_media_parse_network, libvlc_media_parsed_status_done); +libvlc_release(vlc); return 0; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] es_format: display orientation with video format
vlc | branch: master | Alexandre Janniaux | Mon Jan 25 11:00:26 2021 +0100| [93ae689589d11261a4847d389c0266b1ece11209] | committer: Alexandre Janniaux es_format: display orientation with video format > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93ae689589d11261a4847d389c0266b1ece11209 --- src/misc/es_format.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/misc/es_format.c b/src/misc/es_format.c index 77c512a90a..fb61f7df2c 100644 --- a/src/misc/es_format.c +++ b/src/misc/es_format.c @@ -374,16 +374,35 @@ bool video_format_IsSimilar( const video_format_t *f1, } return true; } + +static const char *orient_to_string[] = +{ +[ORIENT_NORMAL] = "normal", +[ORIENT_TRANSPOSED] = "transposed", +[ORIENT_ANTI_TRANSPOSED]= "antitransposed", +[ORIENT_HFLIPPED] = "hflip", +[ORIENT_VFLIPPED] = "vflip", +[ORIENT_ROTATED_180]= "80", +[ORIENT_ROTATED_270]= "270", +[ORIENT_ROTATED_90] = "90", +}; + void video_format_Print( vlc_object_t *p_this, const char *psz_text, const video_format_t *fmt ) { +const char *orient; +if ( fmt->orientation >= 0 && fmt->orientation < ARRAY_SIZE(orient_to_string) ) +orient = orient_to_string[fmt->orientation]; +else orient = "error"; + msg_Dbg( p_this, - "%s sz %ux%u, of (%u,%u), vsz %ux%u, 4cc %4.4s, sar %u:%u, msk r0x%" PRIx32 " g0x%" PRIx32 " b0x%" PRIx32, + "%s sz %ux%u, of (%u,%u), vsz %ux%u, 4cc %4.4s, sar %u:%u, orient: %s, msk r0x%" PRIx32 " g0x%" PRIx32 " b0x%" PRIx32, psz_text, fmt->i_width, fmt->i_height, fmt->i_x_offset, fmt->i_y_offset, fmt->i_visible_width, fmt->i_visible_height, (char*)&fmt->i_chroma, fmt->i_sar_num, fmt->i_sar_den, + orient, fmt->i_rmask, fmt->i_gmask, fmt->i_bmask ); } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] transcode: encoder: apply framerate to encoder input
vlc | branch: master | Alexandre Janniaux | Tue Jan 26 14:49:09 2021 +0100| [9c9cebb1c3e36fcc8c23237722e57cc906a48635] | committer: Alexandre Janniaux transcode: encoder: apply framerate to encoder input Similar change to ad0e707bd6f096dffd48e9942cd61c2ddf61c994, p_enc_in is supposed to be updated from previous filters, in opposition to p_enc_out. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c9cebb1c3e36fcc8c23237722e57cc906a48635 --- modules/stream_out/transcode/encoder/video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c index 5e7a3690ea..3444759219 100644 --- a/modules/stream_out/transcode/encoder/video.c +++ b/modules/stream_out/transcode/encoder/video.c @@ -250,9 +250,9 @@ void transcode_encoder_video_configure( vlc_object_t *p_obj, p_enc_in->i_chroma = p_enc->p_encoder->fmt_in.i_codec; -transcode_video_framerate_apply( p_src, p_enc_out ); -p_enc_in->i_frame_rate = p_enc_out->i_frame_rate; -p_enc_in->i_frame_rate_base = p_enc_out->i_frame_rate_base; +transcode_video_framerate_apply( p_src, p_enc_in ); +p_enc_out->i_frame_rate = p_enc_in->i_frame_rate; +p_enc_out->i_frame_rate_base = p_enc_in->i_frame_rate_base; msg_Dbg( p_obj, "source fps %u/%u, destination %u/%u", p_dec_out->i_frame_rate, p_dec_out->i_frame_rate_base, p_enc_in->i_frame_rate, p_enc_in->i_frame_rate_base ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] macosx: remove variable macosx-glcontext
vlc | branch: master | Alexandre Janniaux | Tue Jan 26 15:03:52 2021 +0100| [5ef7ba041e68bed4f8baa067f92be0c65e3f252c] | committer: Alexandre Janniaux macosx: remove variable macosx-glcontext Unused since cb6b1d5fb6c28893479f737a94da2bc753cbe8b9. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ef7ba041e68bed4f8baa067f92be0c65e3f252c --- modules/video_output/macosx.m | 6 -- 1 file changed, 6 deletions(-) diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m index 9ce48deaaf..ee1feaad09 100644 --- a/modules/video_output/macosx.m +++ b/modules/video_output/macosx.m @@ -162,8 +162,6 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg, sys->vgl = NULL; sys->gl = NULL; -var_Create(vlc_object_parent(vd), "macosx-glcontext", VLC_VAR_ADDRESS); - /* Get the drawable object */ id container = var_CreateGetAddress (vd, "drawable-nsobject"); if (!container) { @@ -230,9 +228,6 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg, sys->gl->swap = OpenglSwap; sys->gl->get_proc_address = OurGetProcAddress; -var_SetAddress(vlc_object_parent(vd), "macosx-glcontext", - [[sys->glView openGLContext] CGLContextObj]); - const vlc_fourcc_t *subpicture_chromas; if (vlc_gl_MakeCurrent(sys->gl) != VLC_SUCCESS) @@ -273,7 +268,6 @@ static void Close(vout_display_t *vd) [sys->glView setVoutDisplay:nil]; var_Destroy (vd, "drawable-nsobject"); -var_Destroy(vlc_object_parent(vd), "macosx-glcontext"); if (sys->vgl != NULL) { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] transcode: video: inline fps check
vlc | branch: master | Alexandre Janniaux | Tue Jan 26 14:38:51 2021 +0100| [da986038c623a8979719d6f44ae71eeab4754a82] | committer: Alexandre Janniaux transcode: video: inline fps check The intermediate boolean brings no value here since the original condition's operands are accessible and there are no other users. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=da986038c623a8979719d6f44ae71eeab4754a82 --- modules/stream_out/transcode/video.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c index 079ab4ada6..b36ed90bbf 100644 --- a/modules/stream_out/transcode/video.c +++ b/modules/stream_out/transcode/video.c @@ -271,7 +271,6 @@ static inline bool transcode_video_filters_configured( const sout_stream_id_sys_ static int transcode_video_filters_init( sout_stream_t *p_stream, const sout_filters_config_t *p_cfg, - bool b_master_sync, const es_format_t *p_src, vlc_video_context *src_ctx, const es_format_t *p_dst, @@ -298,7 +297,7 @@ static int transcode_video_filters_init( sout_stream_t *p_stream, src_ctx = filter_chain_GetVideoCtxOut( id->p_f_chain ); } -if( b_master_sync ) +if( id->p_enccfg->video.fps.num > 0 ) { filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, p_src ); p_src = filter_chain_GetFmtOut( id->p_f_chain ); @@ -495,7 +494,6 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id, { if( transcode_video_filters_init( p_stream, id->p_filterscfg, - (id->p_enccfg->video.fps.num > 0), &id->decoder_out, picture_GetVideoContext(p_pic), transcode_encoder_format_in( id->encoder ), ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] transcode: video: fix insertion of fps filter
vlc | branch: master | Alexandre Janniaux | Tue Jan 26 14:40:30 2021 +0100| [57cd4abb46c64985188d7c3da62c014daa19111b] | committer: Alexandre Janniaux transcode: video: fix insertion of fps filter The fps filter must be added when the target framerate is different from the source framerate, not when we define the fps parameter. We also check that fps.den > 0 to avoid divide-by-zero errors. Probably regression from 030183d79045a1747d891572b2fe77d8cd0fd946 in which the target framerate was defined in the destination format. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=57cd4abb46c64985188d7c3da62c014daa19111b --- modules/stream_out/transcode/video.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c index b36ed90bbf..ce657088ad 100644 --- a/modules/stream_out/transcode/video.c +++ b/modules/stream_out/transcode/video.c @@ -297,11 +297,19 @@ static int transcode_video_filters_init( sout_stream_t *p_stream, src_ctx = filter_chain_GetVideoCtxOut( id->p_f_chain ); } -if( id->p_enccfg->video.fps.num > 0 ) +if( id->p_enccfg->video.fps.num > 0 && +id->p_enccfg->video.fps.den > 0 && + ( id->p_enccfg->video.fps.num != p_src->video.i_frame_rate || +id->p_enccfg->video.fps.den != p_src->video.i_frame_rate_base ) ) { -filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, p_src ); +es_format_t dst; +es_format_Copy(&dst, p_src); +dst.video.i_frame_rate = id->p_enccfg->video.fps.num; +dst.video.i_frame_rate_base = id->p_enccfg->video.fps.den; +filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, &dst ); p_src = filter_chain_GetFmtOut( id->p_f_chain ); src_ctx = filter_chain_GetVideoCtxOut( id->p_f_chain ); +es_format_Clean(&dst); } /* User filters */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: build.sh: rework MAKEFLAGS jobs count
vlc | branch: master | Alexandre Janniaux | Fri Jan 22 10:53:23 2021 +0100| [a5dc0a00e504db427345cbea73e3b33620b88782] | committer: Alexandre Janniaux apple: build.sh: rework MAKEFLAGS jobs count Forward the global MAKEFLAGS but adds the job count as is: - pass the number of core by default to keep the current behaviour of the script. - if the number of core is forwarded to MAKEFLAGS, use them instead of the previous. - if the number of core is explicitly given to the buildscript through the -j option, use them instead of the previous. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5dc0a00e504db427345cbea73e3b33620b88782 --- extras/package/apple/build.sh | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh index 6ea15a75a9..1868c8f1f4 100755 --- a/extras/package/apple/build.sh +++ b/extras/package/apple/build.sh @@ -92,6 +92,7 @@ VLC_PREBUILT_CONTRIBS_URL=${VLC_PREBUILT_CONTRIBS_URL:-""} # The number of cores to compile on CORE_COUNT=$(sysctl -n machdep.cpu.core_count || nproc || echo 0) let VLC_USE_NUMBER_OF_CORES=$CORE_COUNT+1 +let VLC_REQUESTED_CORE_COUNT=0 # whether to disable debug mode (the default) or not VLC_DISABLE_DEBUG=0 # whether to compile with bitcode or not @@ -448,7 +449,7 @@ do VLC_PREBUILT_CONTRIBS_URL="${1#VLC_PREBUILT_CONTRIBS_URL=}" ;; -j*) -VLC_USE_NUMBER_OF_CORES=${1#-j} +VLC_REQUESTED_CORE_COUNT=${1#-j} ;; *) echo >&2 "ERROR: Unrecognized option '$1'" @@ -459,6 +460,11 @@ do shift done +export MAKEFLAGS="-j${VLC_USE_NUMBER_OF_CORES} ${MAKEFLAGS}" +if [ "${VLC_REQUESTED_CORE_COUNT}" != "0" ]; then +export MAKEFLAGS="${MAKEFLAGS} -j${VLC_REQUESTED_CORE_COUNT}" +fi + # Validate arguments if [ "$VLC_MAKE_PREBUILT_CONTRIBS" -gt "0" ] && [ "$VLC_USE_PREBUILT_CONTRIBS" -gt "0" ]; then @@ -552,9 +558,9 @@ echo "Building needed tools (if missing)" cd "$VLC_SRC_DIR/extras/tools" || abort_err "Failed cd to tools dir" ./bootstrap || abort_err "Bootstrapping tools failed" -$MAKE -j$VLC_USE_NUMBER_OF_CORES || abort_err "Building tools failed" +$MAKE || abort_err "Building tools failed" if [ $VLC_HOST_ARCH = "armv7" ]; then -$MAKE -j$VLC_USE_NUMBER_OF_CORES .buildgas \ +$MAKE .buildgas \ || abort_err "Building gas-preprocessor tool failed" fi echo "" @@ -614,10 +620,10 @@ else $MAKE list # Download source packages -$MAKE fetch -j$VLC_USE_NUMBER_OF_CORES +$MAKE fetch # Build contribs -$MAKE -j$VLC_USE_NUMBER_OF_CORES || abort_err "Building contribs failed" +$MAKE || abort_err "Building contribs failed" # Make prebuilt contribs package if [ "$VLC_MAKE_PREBUILT_CONTRIBS" -gt "0" ]; then @@ -678,7 +684,7 @@ hostenv ../../configure \ "${VLC_CONFIG_OPTIONS[@]}" \ || abort_err "Configuring VLC failed" -$MAKE -j$VLC_USE_NUMBER_OF_CORES || abort_err "Building VLC failed" +$MAKE || abort_err "Building VLC failed" $MAKE install || abort_err "Installing VLC failed" ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] apple: build.sh: add automatic nproc jobs count
vlc | branch: master | Alexandre Janniaux | Fri Jan 22 10:53:22 2021 +0100| [a2700c735673ff9b1aa9d70d20ae0383c8c1b6d0] | committer: Alexandre Janniaux apple: build.sh: add automatic nproc jobs count Use the maximum number of core just like darwin by default. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a2700c735673ff9b1aa9d70d20ae0383c8c1b6d0 --- extras/package/apple/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh index 4dd9202c12..6ea15a75a9 100755 --- a/extras/package/apple/build.sh +++ b/extras/package/apple/build.sh @@ -89,8 +89,8 @@ VLC_USE_PREBUILT_CONTRIBS=0 # User-provided URL from where to fetch contribs, empty # for the default chosen by contrib system VLC_PREBUILT_CONTRIBS_URL=${VLC_PREBUILT_CONTRIBS_URL:-""} -# The number of cores to compile on, or 0 + 1 if not darwin -CORE_COUNT=$(sysctl -n machdep.cpu.core_count || echo 0) +# The number of cores to compile on +CORE_COUNT=$(sysctl -n machdep.cpu.core_count || nproc || echo 0) let VLC_USE_NUMBER_OF_CORES=$CORE_COUNT+1 # whether to disable debug mode (the default) or not VLC_DISABLE_DEBUG=0 ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] stream_out: stats: display current track duration
vlc | branch: master | Alexandre Janniaux | Thu Jan 21 15:12:17 2021 +0100| [8c620d8ba84aaefb10b5999b104ad8ed59339fc3] | committer: Alexandre Janniaux stream_out: stats: display current track duration > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8c620d8ba84aaefb10b5999b104ad8ed59339fc3 --- modules/stream_out/stats.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/stream_out/stats.c b/modules/stream_out/stats.c index f05a048faa..4a1f24e860 100644 --- a/modules/stream_out/stats.c +++ b/modules/stream_out/stats.c @@ -131,6 +131,10 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer ) vlc_tick_t dts_difference = VLC_TICK_INVALID; if( likely( id->previous_dts != VLC_TICK_INVALID ) ) dts_difference = p_block->i_dts - id->previous_dts; + +id->track_duration += p_block->i_length ? p_block->i_length : dts_difference; +id->previous_dts = p_block->i_dts; + if( p_sys->output ) { /* Write data in a form that it's easy to plot for example with gnuplot*/ @@ -139,12 +143,10 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer ) p_block->i_length, outputhash ); } else { -msg_Dbg( p_stream, "%s: track:%d type:%s segment_number:%"PRIu64" dts_difference:%"PRId64" length:%"PRId64" md5:%16s", +msg_Dbg( p_stream, "%s: track:%d type:%s segment_number:%"PRIu64" dts_difference:%"PRId64" length:%"PRId64" current_duration:%"PRId64" md5:%16s", p_sys->prefix, id->id, id->type, ++id->segment_number, dts_difference, - p_block->i_length, outputhash ); + p_block->i_length, id->track_duration, outputhash ); } -id->track_duration += p_block->i_length ? p_block->i_length : dts_difference; -id->previous_dts = p_block->i_dts; p_block = p_block->p_next; } return VLC_SUCCESS; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] chromecast: fix deprecation warning
vlc | branch: master | Alexandre Janniaux | Wed Jan 20 12:16:57 2021 +0100| [0c6490e368dc67a86ac2144ab7498a0273df9350] | committer: Alexandre Janniaux chromecast: fix deprecation warning ByteSizeLong is available since 2016-09-23 version 3.1.0 according to protobuf CHANGES.txt. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c6490e368dc67a86ac2144ab7498a0273df9350 --- modules/stream_out/chromecast/chromecast_communication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/stream_out/chromecast/chromecast_communication.cpp b/modules/stream_out/chromecast/chromecast_communication.cpp index 217d7a0e56..71bf51be75 100644 --- a/modules/stream_out/chromecast/chromecast_communication.cpp +++ b/modules/stream_out/chromecast/chromecast_communication.cpp @@ -437,7 +437,7 @@ unsigned ChromecastCommunication::msgPlayerSetVolume( const std::string& destina */ int ChromecastCommunication::sendMessage( const castchannel::CastMessage &msg ) { -int i_size = msg.ByteSize(); +size_t i_size = msg.ByteSizeLong(); uint8_t *p_data = new(std::nothrow) uint8_t[PACKET_HEADER_LEN + i_size]; if (p_data == NULL) return VLC_ENOMEM; @@ -451,7 +451,7 @@ int ChromecastCommunication::sendMessage( const castchannel::CastMessage &msg ) ssize_t i_ret = vlc_tls_Write(m_tls, p_data, PACKET_HEADER_LEN + i_size); delete[] p_data; -if (i_ret > 0 && i_ret == PACKET_HEADER_LEN + i_size) +if (i_ret > 0 && (size_t)i_ret == PACKET_HEADER_LEN + i_size) return VLC_SUCCESS; msg_Warn( m_module, "failed to send message %s (%s)", msg.payload_utf8().c_str(), strerror( errno ) ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits