Projects
Extra
vlc-beta
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
vlc-beta.spec
Changed
@@ -37,8 +37,6 @@ Source1: %name.changes Source3: %name-rpmlintrc Patch0: vlc-beta.patch -Patch1: vlc.a52dec.patch -Patch2: vlc.hostname.patch %ifarch x86_64 aarch64 Requires: libqtquickcontrols2plugin.so()(64bit) @@ -171,10 +169,8 @@ BuildRequires: pkgconfig(libswscale) >= 5 BuildRequires: pkgconfig(libpostproc) >= 55 BuildRequires: pkgconfig(faad2) -%if 0%{?suse_version} > 1500 BuildRequires: pkgconfig(rav1e) -%endif -BuildRequires: pkgconfig(dav1d) >= 0.5.0 +BuildRequires: pkgconfig(dav1d) >= 1.0.0 BuildRequires: pkgconfig(vpx) >= 1.5.0 BuildRequires: pkgconfig(twolame) %if %{with fdk_aac} @@ -408,11 +404,8 @@ --enable-postproc \ --enable-faad \ --disable-aom \ -%if 0%{?suse_version} > 1500 --enable-rav1e \ -%endif --enable-dav1d \ - --disable-vpx \ --enable-vpx \ --enable-twolame \ %if %{with fdk_aac}
View file
vlc-beta.patch
Changed
@@ -1,9 +1,15 @@ -control/cli/cli.c: In function 'Run': -control/cli/cli.c:541:1: error: no return statement in function returning non-void -Werror=return-type - --- a/configure.ac +++ b/configure.ac -@@ -2105,7 +2105,7 @@ AS_IF(test "$SYS" = "linux" -a "${enabl +@@ -10,7 +10,7 @@ VERSION_EXTRA=0 + VERSION_DEV=dev + + # libvlc .so version values +-LIBVLC_ABI_MAJOR=12 ++LIBVLC_ABI_MAJOR=123 + LIBVLC_ABI_MINOR=0 + LIBVLC_ABI_MICRO=0 + +@@ -2054,7 +2054,7 @@ AS_IF(test "$SYS" = "linux" -a "${enable_linsys}" != "no", dnl dnl dvdread module: check for libdvdread dnl @@ -12,7 +18,7 @@ dnl dnl libdvdnav plugin -@@ -2443,7 +2443,7 @@ AC_ARG_ENABLE(mod, +@@ -2369,7 +2369,7 @@ AC_ARG_ENABLE(mod, AS_HELP_STRING(--disable-mod, do not use libmodplug (default auto))) if test "${enable_mod}" != "no" ; then @@ -21,9 +27,40 @@ VLC_ADD_PLUGIN(mod) VLC_ADD_CXXFLAGS(mod,$LIBMODPLUG_CFLAGS) VLC_ADD_CFLAGS(mod,$LIBMODPLUG_CFLAGS) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod +@@ -4658,7 +4658,7 @@ AS_IF(test -z "$VLC_COMPILE_HOST", + VLC_COMPILE_HOST=`hostname -f 2>/dev/null || hostname` + ) + AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "$VLC_COMPILE_HOST", host which ran configure) +-AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", compiler) ++AC_DEFINE_UNQUOTED(VLC_COMPILER, "gcc", compiler) + dnl + dnl Handle substvars that use $(top_srcdir) + dnl +--- a/include/vlc/libvlc_version.h ++++ b/include/vlc/libvlc_version.h +@@ -54,7 +54,7 @@ + + + /** LibVLC ABI major version number, updated when incompatible changes are added */ +-# define LIBVLC_ABI_VERSION_MAJOR (12) ++# define LIBVLC_ABI_VERSION_MAJOR (123) + + /** LibVLC ABI minor version number, updated when compatible changes are added */ + # define LIBVLC_ABI_VERSION_MINOR (0) +--- a/modules/codec/a52.c ++++ b/modules/codec/a52.c +@@ -300,7 +300,7 @@ static int Open( vlc_object_t *p_this ) + p_sys->i_flags |= A52_ADJUST_LEVEL; + + /* Initialize liba52 */ +- p_sys->p_liba52 = a52_init( 0 ); ++ p_sys->p_liba52 = a52_init(); + if( p_sys->p_liba52 == NULL ) + { + msg_Err( p_this, "unable to initialize liba52" ); --- a/modules/control/cli/cli.c +++ b/modules/control/cli/cli.c -@@ -529,9 +529,8 @@ static void cli_client_delete(struct cli +@@ -537,9 +537,8 @@ static void cli_client_delete(struct cli_client *cl) free(cl); } @@ -34,7 +71,7 @@ intf_sys_t *sys = intf->p_sys; vlc_thread_set_name("vlc-cli-server"); -@@ -566,6 +565,13 @@ static void *Run(void *data) +@@ -576,6 +575,13 @@ static void *Run(void *data) } } @@ -48,3 +85,14 @@ #else static void msg_vprint(intf_thread_t *p_intf, const char *psz_fmt, va_list args) { +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -559,7 +559,7 @@ libvlccore_la_LDFLAGS = \ + $(LDFLAGS_libvlccore) \ + -no-undefined \ + -export-symbols $(srcdir)/libvlccore.sym \ +- -version-info 9:0:0 ++ -version-info 123:0:0 + libvlccore_la_DEPENDENCIES = libvlccore.sym + if HAVE_WIN32 + libvlccore_la_DEPENDENCIES += libvlccore_win32_rc.$(OBJEXT)
View file
vlc.a52dec.patch
Deleted
@@ -1,11 +0,0 @@ ---- a/modules/codec/a52.c -+++ b/modules/codec/a52.c -@@ -302,7 +302,7 @@ static int Open( vlc_object_t *p_this ) - p_sys->i_flags |= A52_ADJUST_LEVEL; - - /* Initialize liba52 */ -- p_sys->p_liba52 = a52_init( 0 ); -+ p_sys->p_liba52 = a52_init(); - if( p_sys->p_liba52 == NULL ) - { - msg_Err( p_this, "unable to initialize liba52" );
View file
vlc.hostname.patch
Deleted
@@ -1,11 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -4208,7 +4208,7 @@ AC_SUBST(VERSION_MINOR) - VLC_COMPILE_HOST=`hostname -f 2>/dev/null || hostname` - ) - AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "$VLC_COMPILE_HOST", host which ran configure) --AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", compiler) -+AC_DEFINE_UNQUOTED(VLC_COMPILER, "gcc", compiler) - dnl - dnl Handle substvars that use $(top_srcdir) - dnl
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/dshow/vlc_dshow.h
Deleted
@@ -1,376 +0,0 @@ -/***************************************************************************** - * vlc_dshow.h : DirectShow access module for vlc - ***************************************************************************** - * Copyright (C) 2002, 2004, 2010-2011 VLC authors and VideoLAN - * - * Author: Gildas Bazin <gbazin@videolan.org> - * - * 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 - *****************************************************************************/ -#ifndef VLC_DSHOW_H -#define VLC_DSHOW_H - -#ifdef __MINGW32__ -# include <_mingw.h> -#endif - -#include <wtypes.h> -#include <unknwn.h> -#include <ole2.h> -#include <limits.h> -#include <strmif.h> -#include <ksmedia.h> -#include <wmcodecdsp.h> -#include <ddraw.h> - -#ifndef __MINGW64_VERSION_MAJOR - -#include <dshow.h> - -namespace dshow { - -/***************************************************************************** - * DirectShow GUIDs. - *****************************************************************************/ - -/* IAM */ -DEFINE_GUID(IID_IAMBufferNegotiation ,0x56ed71a0, 0xaf5f, 0x11d0, 0xb3, 0xf0, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5); -DEFINE_GUID(IID_IAMTVAudio ,0x83EC1C30, 0x23D1, 0x11d1, 0x99, 0xE6, 0x00, 0xA0, 0xC9, 0x56, 0x02, 0x66); -DEFINE_GUID(IID_IAMCrossbar ,0xC6E13380, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56); -DEFINE_GUID(IID_IAMTVTuner ,0x211A8766, 0x03AC, 0x11d1, 0x8D, 0x13, 0x00, 0xAA, 0x00, 0xBD, 0x83, 0x39); - -/* Video Format -MEDIASUBTYPEs and FORMAT */ -DEFINE_GUID(MEDIASUBTYPE_ARGB32 ,0x773c9ac0, 0x3274, 0x11d0, 0xb7, 0x24, 0x0, 0xaa, 0x0, 0x6c, 0x1a, 0x1); -/* Packed YUV formats */ -DEFINE_GUID(MEDIASUBTYPE_YUYV ,0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); -/* Planar YUV formats */ -DEFINE_GUID(MEDIASUBTYPE_IYUV ,0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); /* identical to YV12 */ -DEFINE_GUID(MEDIASUBTYPE_I420 ,0x30323449, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); -/* MPEG2 formats */ -DEFINE_GUID(MEDIASUBTYPE_MPEG2_VIDEO ,0xe06d8026, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); -DEFINE_GUID(MEDIASUBTYPE_MPEG2_PROGRAM ,0xe06d8022, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); -DEFINE_GUID(MEDIASUBTYPE_MPEG2_TRANSPORT ,0xe06d8023, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); -DEFINE_GUID(FORMAT_MPEG2Video ,0xe06d80e3, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); - -/* float */ -DEFINE_GUID(MEDIASUBTYPE_IEEE_FLOAT ,0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); - - -/**************************************************************************** - * The following should be in ks.h and ksmedia.h, but since they are not in - * the current version of Mingw, we will be defined here. - ****************************************************************************/ - -/* http://msdn.microsoft.com/en-us/library/ff567297%28VS.85%29.aspx */ -typedef enum { - KS_AnalogVideo_None = 0x00000000, - KS_AnalogVideo_NTSC_M = 0x00000001, - KS_AnalogVideo_NTSC_M_J = 0x00000002, - KS_AnalogVideo_NTSC_433 = 0x00000004, - KS_AnalogVideo_PAL_B = 0x00000010, - KS_AnalogVideo_PAL_D = 0x00000020, - KS_AnalogVideo_PAL_G = 0x00000040, - KS_AnalogVideo_PAL_H = 0x00000080, - KS_AnalogVideo_PAL_I = 0x00000100, - KS_AnalogVideo_PAL_M = 0x00000200, - KS_AnalogVideo_PAL_N = 0x00000400, - KS_AnalogVideo_PAL_60 = 0x00000800, - KS_AnalogVideo_SECAM_B = 0x00001000, - KS_AnalogVideo_SECAM_D = 0x00002000, - KS_AnalogVideo_SECAM_G = 0x00004000, - KS_AnalogVideo_SECAM_H = 0x00008000, - KS_AnalogVideo_SECAM_K = 0x00010000, - KS_AnalogVideo_SECAM_K1 = 0x00020000, - KS_AnalogVideo_SECAM_L = 0x00040000, - KS_AnalogVideo_SECAM_L1 = 0x00080000, - KS_AnalogVideo_PAL_N_COMBO = 0x00100000 -} KS_AnalogVideoStandard; - -/* http://msdn.microsoft.com/en-us/library/ff567800%28VS.85%29.aspx and following */ -typedef enum { - KSPROPERTY_TUNER_CAPS, // R -overall device capabilities - KSPROPERTY_TUNER_MODE_CAPS, // R -capabilities in this mode - KSPROPERTY_TUNER_MODE, // RW -set a mode (TV, FM, AM, DSS) - KSPROPERTY_TUNER_STANDARD, // R -get TV standard (only if TV mode) - KSPROPERTY_TUNER_FREQUENCY, // RW -set/get frequency - KSPROPERTY_TUNER_INPUT, // RW -select an input - KSPROPERTY_TUNER_STATUS, // R -tuning status - - /* Optional */ - KSPROPERTY_TUNER_IF_MEDIUM, // R O-Medium for IF or Transport Pin - - /* Mandatory for Vista and + */ - KSPROPERTY_TUNER_SCAN_CAPS, // R -overall device capabilities for scanning - - /* Optional ones */ - KSPROPERTY_TUNER_SCAN_STATUS, // R -status of scan - KSPROPERTY_TUNER_STANDARD_MODE, // RW -autodetect mode for signal standard - KSPROPERTY_TUNER_NETWORKTYPE_SCAN_CAPS // R -network type specific tuner capabilities -} KSPROPERTY_TUNER; - -/* http://msdn.microsoft.com/en-us/library/ff567689%28v=VS.85%29.aspx */ -typedef enum { - KS_TUNER_TUNING_EXACT = 1, // Tunes directly to the right freq - KS_TUNER_TUNING_FINE, // Comprehensive search to the right freq - KS_TUNER_TUNING_COARSE, // Fast search -}KS_TUNER_TUNING_FLAGS; - -/* http://msdn.microsoft.com/en-us/library/ff567687%28v=VS.85%29.aspx */ -typedef enum { - KS_TUNER_STRATEGY_PLL = 0X01, // Phase locked loop (PLL) offset tuning - KS_TUNER_STRATEGY_SIGNAL_STRENGTH = 0X02, // Signal strength tuning - KS_TUNER_STRATEGY_DRIVER_TUNES = 0X04, // Driver tunes -}KS_TUNER_STRATEGY; - -/* http://msdn.microsoft.com/en-us/library/ff562676%28VS.85%29.aspx */ -typedef struct { - union { - struct { - GUID Set; - ULONG Id; - ULONG Flags; - }; - LONGLONG Alignment; - }; -} KSIDENTIFIER, *PKSIDENTIFIER; - -typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY; - -/* http://msdn.microsoft.com/en-us/library/ff565872%28v=VS.85%29.aspx */ -typedef struct { - KSPROPERTY Property; - ULONG Mode; // KSPROPERTY_TUNER_MODE_* - ULONG StandardsSupported; // KS_AnalogVideo_* (if Mode is TV or DSS) - ULONG MinFrequency; // Hz - ULONG MaxFrequency; // Hz - ULONG TuningGranularity; // Hz - ULONG NumberOfInputs; // number of inputs - ULONG SettlingTime; // milliSeconds - ULONG Strategy; // KS_TUNER_STRATEGY -} KSPROPERTY_TUNER_MODE_CAPS_S, *PKSPROPERTY_TUNER_MODE_CAPS_S; - -/* http://msdn.microsoft.com/en-us/library/ff565839%28v=VS.85%29.aspx */ -typedef struct { - KSPROPERTY Property; - ULONG Frequency; // Hz - ULONG LastFrequency; // Hz (last tuned) - ULONG TuningFlags; // KS_TUNER_TUNING_FLAGS - ULONG VideoSubChannel; // DSS - ULONG AudioSubChannel; // DSS - ULONG Channel; // VBI decoders - ULONG Country; // VBI decoders -} KSPROPERTY_TUNER_FREQUENCY_S, *PKSPROPERTY_TUNER_FREQUENCY_S; - -/* http://msdn.microsoft.com/en-us/library/ff565918%28v=VS.85%29.aspx */ -typedef struct { - KSPROPERTY Property; - ULONG Standard; // KS_AnalogVideo_* -} KSPROPERTY_TUNER_STANDARD_S, *PKSPROPERTY_TUNER_STANDARD_S; -/* End of ks */ - - -/* Define missing interfaces from wine's header */ -/* http://msdn.microsoft.com/en-us/library/dd373441%28v=vs.85%29.aspx */ -typedef enum tagAMTunerModeType { - AMTUNER_MODE_DEFAULT = 0x0000, - AMTUNER_MODE_TV = 0x0001, - AMTUNER_MODE_FM_RADIO = 0x0002, - AMTUNER_MODE_AM_RADIO = 0x0004, - AMTUNER_MODE_DSS = 0x0008 -} AMTunerModeType; - -#define AMPROPERTY_PIN_CATEGORY 0
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/preparser/preparser.h
Deleted
@@ -1,91 +0,0 @@ -/***************************************************************************** - * preparser.h - ***************************************************************************** - * Copyright (C) 1999-2008 VLC authors and VideoLAN - * - * Authors: Samuel Hocevar <sam@zoy.org> - * Clément Stenac <zorglub@videolan.org> - * - * 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. - *****************************************************************************/ - -#ifndef _INPUT_PREPARSER_H -#define _INPUT_PREPARSER_H 1 - -#include <vlc_input_item.h> -/** - * Preparser opaque structure. - * - * The preparser object will retrieve the meta data of any given input item in - * an asynchronous way. - * It will also issue art fetching requests. - */ -typedef struct input_preparser_t input_preparser_t; - -/** - * This function creates the preparser object and thread. - */ -input_preparser_t *input_preparser_New( vlc_object_t * ); - -/** - * This function enqueues the provided item to be preparsed. - * - * The input item is retained until the preparsing is done or until the - * preparser object is deleted. - * - * @param timeout maximum time allowed to preparse the item. If -1, the default - * "preparse-timeout" option will be used as a timeout. If 0, it will wait - * indefinitely. If > 0, the timeout will be used (in milliseconds). - * @param id unique id provided by the caller. This is can be used to cancel - * the request with input_preparser_Cancel() - * @returns VLC_SUCCESS if the item was scheduled for preparsing, an error code - * otherwise - * If this returns an error, the on_preparse_ended will *not* be invoked - */ -int input_preparser_Push( input_preparser_t *, input_item_t *, - input_item_meta_request_option_t, - const input_preparser_callbacks_t *cbs, - void *cbs_userdata, - int timeout, void *id ); - -void input_preparser_fetcher_Push( input_preparser_t *, input_item_t *, - input_item_meta_request_option_t, - const input_fetcher_callbacks_t *cbs, - void *cbs_userdata ); - -/** - * This function cancel all preparsing requests for a given id - * - * @param id unique id given to input_preparser_Push() - */ -void input_preparser_Cancel( input_preparser_t *, void *id ); - -/** - * This function destroys the preparser object and thread. - * - * All pending input items will be released. - */ -void input_preparser_Delete( input_preparser_t * ); - -/** - * This function deactivates the preparser - * - * All pending requests will be removed, and it will block until the currently - * running entity has finished (if any). - */ -void input_preparser_Deactivate( input_preparser_t * ); - -#endif -
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/compat/aligned_alloc.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/compat/aligned_alloc.c
Changed
@@ -56,9 +56,7 @@ #elif defined(HAVE_MEMALIGN) return memalign(align, size); -#elif defined (_WIN32) && defined(__MINGW32__) - return __mingw_aligned_malloc(size, align); -#elif defined (_WIN32) && defined(_MSC_VER) +#elif defined (_WIN32) return _aligned_malloc(size, align); #else /* align must be valid/supported */
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/contrib/src/rav1e/SHA512SUMS -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/contrib/src/rav1e/SHA512SUMS
Changed
@@ -1,1 +1,1 @@ -c3c2717103ba87264550fd5bebfd36ffaab00325f764dadd8229bc9aae6fe4e5ef195da23a263e2e4d8505f8b690dd440346b014a4c556428fe8fac5fb64eaa5 rav1e-0.6.3.tar.gz +49c003e2ab978072467264cfd0d4f10b4ada486785d53fd58ab3a1e69392b2547634c8d024802634f59a4d635ed5d08c3d988726f21f9c69271d5fbfe8706291 rav1e-0.6.4.tar.gz
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/contrib/src/rav1e/rules.mak -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/contrib/src/rav1e/rules.mak
Changed
@@ -1,6 +1,6 @@ # rav1e -RAV1E_VERSION := 0.6.3 +RAV1E_VERSION := 0.6.4 RAV1E_URL := https://crates.io/api/v1/crates/rav1e/$(RAV1E_VERSION)/download ifdef BUILD_RUST
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/contrib/src/soxr/aarch64.patch
Added
@@ -0,0 +1,21 @@ +diff --git a/cmake/Modules/FindSIMD32.cmake b/cmake/Modules/FindSIMD32.cmake +index 9e4237358f..580e9ca87b 100644 +--- a/cmake/Modules/FindSIMD32.cmake ++++ b/cmake/Modules/FindSIMD32.cmake +@@ -24,6 +24,16 @@ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") + return !vgetq_lane_u32(vceqq_f32(a,b),0); + } + ") ++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") ++ set (TRIAL_C_FLAGS ++ " ") ++ set (TEST_C_SOURCE " ++ #include <arm_neon.h> ++ int main(int c, char * * v) { ++ float32x4_t a = vdupq_n_f32((float)c), b = vdupq_n_f32((float)!!v); ++ return !vgetq_lane_u32(vceqq_f32(a,b),0); ++ } ++ ") + else () + if (WIN32) # Safety for when mixed lib/app compilers (but performance hit) + set (GCC_WIN32_SIMD32_OPTS "-mincoming-stack-boundary=2")
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/contrib/src/soxr/rules.mak -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/contrib/src/soxr/rules.mak
Changed
@@ -22,6 +22,7 @@ $(APPLY) $(SRC)/soxr/0004-arm-fix-SIGILL-when-doing-divisions-on-some-old-arch.patch $(APPLY) $(SRC)/soxr/find_ff_pkgconfig.patch $(APPLY) $(SRC)/soxr/soxr-check-function.patch + $(APPLY) $(SRC)/soxr/aarch64.patch $(call pkg_static,"src/soxr.pc.in") $(MOVE)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/doc/libvlc/d3d11_player.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/doc/libvlc/d3d11_player.cpp
Changed
@@ -13,7 +13,7 @@ #include <windows.h> #include <d3d11.h> #include <d3dcompiler.h> -#include <assert.h> +#include <cassert> #include <d3d11_1.h> #include <dxgi1_2.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/extras/ci/gitlab-ci.yml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/extras/ci/gitlab-ci.yml
Changed
@@ -383,6 +383,7 @@ after_script: - export VLC_CONTRIB_SHA="$(extras/ci/get-contrib-sha.sh)" - mv extras/package/snap/parts/vlc/build/contrib/vlc-contrib-*.tar.bz2 contrib/vlc-contrib-${TRIPLET}-${VLC_CONTRIB_SHA}.tar.bz2 2>/dev/null || true + allow_failure: true variables: *variables-snap snap:
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/extras/package/apple/build.sh -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/extras/package/apple/build.sh
Changed
@@ -423,7 +423,6 @@ done printf "\ -#include \"config.h\"\\n\ #include <vlc_common.h>\\n\ #include <vlc_plugin.h>\\n\ %b\\n\
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/extras/package/macosx/VLC.xcodeproj/project.pbxproj -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/extras/package/macosx/VLC.xcodeproj/project.pbxproj
Changed
@@ -79,6 +79,8 @@ 5317FE04294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5317FE03294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.m */; }; 5325C57D29302E6800B2B63A /* VLCLibraryAudioViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5325C57B29302E6800B2B63A /* VLCLibraryAudioViewController.m */; }; 534E8E3A29A06325009503F8 /* VLCMainVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 534E8E3929A06325009503F8 /* VLCMainVideoViewController.m */; }; + 5352B37329DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 5352B37229DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m */; }; + 5352B37629E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 5352B37529E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m */; }; 5362550D293FD639005D64FA /* VLCLibraryWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5362550C293FD639005D64FA /* VLCLibraryWindowController.m */; }; 536283F0291146BC00640C15 /* VLCLibraryTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 536283DE291146BC00640C15 /* VLCLibraryTableView.m */; }; 536283F1291146BC00640C15 /* VLCLibraryAlbumTracksDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 536283DF291146BC00640C15 /* VLCLibraryAlbumTracksDataSource.m */; }; @@ -98,6 +100,7 @@ 538A7EDA29A63EE40068AD4F /* VLCFullVideoViewWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 538A7ED929A63EE40068AD4F /* VLCFullVideoViewWindow.m */; }; 53903D3A29576ED500D0B308 /* VLCLibraryAudioGroupDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 53903D3929576ED500D0B308 /* VLCLibraryAudioGroupDataSource.m */; }; 539BA79F298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 539BA79E298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.m */; }; + 539F114B29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 539F114A29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m */; }; 53B447CA2939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B447C92939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.m */; }; 53B447F6293BB47B00857588 /* VLCLibraryVideoCollectionViewContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B447EC293BB47A00857588 /* VLCLibraryVideoCollectionViewContainerView.m */; }; 53B447F7293BB47B00857588 /* VLCLibraryVideoCollectionViewContainerViewDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B447ED293BB47A00857588 /* VLCLibraryVideoCollectionViewContainerViewDataSource.m */; }; @@ -258,6 +261,10 @@ 534E8E3729A04F95009503F8 /* VLCMainVideoView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCMainVideoView.xib; sourceTree = "<group>"; }; 534E8E3829A06325009503F8 /* VLCMainVideoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMainVideoViewController.h; sourceTree = "<group>"; }; 534E8E3929A06325009503F8 /* VLCMainVideoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMainVideoViewController.m; sourceTree = "<group>"; }; + 5352B37129DF29BF0011CE03 /* VLCMainVideoViewControlsBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMainVideoViewControlsBar.h; sourceTree = "<group>"; }; + 5352B37229DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMainVideoViewControlsBar.m; sourceTree = "<group>"; }; + 5352B37429E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryWindowPersistentPreferences.h; sourceTree = "<group>"; }; + 5352B37529E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryWindowPersistentPreferences.m; sourceTree = "<group>"; }; 5362550B293FD639005D64FA /* VLCLibraryWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryWindowController.h; sourceTree = "<group>"; }; 5362550C293FD639005D64FA /* VLCLibraryWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryWindowController.m; sourceTree = "<group>"; }; 536283DC291146BC00640C15 /* VLCLibraryAlbumTracksDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryAlbumTracksDataSource.h; sourceTree = "<group>"; }; @@ -301,6 +308,8 @@ 53903D3929576ED500D0B308 /* VLCLibraryAudioGroupDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAudioGroupDataSource.m; sourceTree = "<group>"; }; 539BA79D298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCAspectRatioRetainingVideoWindow.h; sourceTree = "<group>"; }; 539BA79E298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCAspectRatioRetainingVideoWindow.m; sourceTree = "<group>"; }; + 539F114929E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryTwoPaneSplitViewDelegate.h; sourceTree = "<group>"; }; + 539F114A29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryTwoPaneSplitViewDelegate.m; sourceTree = "<group>"; }; 53B447C82939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibrarySongsTableViewSongPlayingTableCellView.h; sourceTree = "<group>"; }; 53B447C92939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibrarySongsTableViewSongPlayingTableCellView.m; sourceTree = "<group>"; }; 53B447EC293BB47A00857588 /* VLCLibraryVideoCollectionViewContainerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryVideoCollectionViewContainerView.m; sourceTree = "<group>"; }; @@ -321,9 +330,9 @@ 53ED472A29C8FF9D00795DB1 /* VLCLibraryAlbumTracksTableViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAlbumTracksTableViewDelegate.m; sourceTree = "<group>"; }; 53ED472C29C907C200795DB1 /* VLCLibraryVideoTableViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryVideoTableViewDelegate.h; sourceTree = "<group>"; }; 53ED472D29C907C200795DB1 /* VLCLibraryVideoTableViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryVideoTableViewDelegate.m; sourceTree = "<group>"; }; - 53ED473729CAF67F00795DB1 /* VLCLibraryTableCellViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryTableCellViewProtocol.h; sourceTree = "<group>"; }; 53ED473429CA4F3400795DB1 /* VLCLibraryTableViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryTableViewDelegate.h; sourceTree = "<group>"; }; 53ED473529CA4F3400795DB1 /* VLCLibraryTableViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryTableViewDelegate.m; sourceTree = "<group>"; }; + 53ED473729CAF67F00795DB1 /* VLCLibraryTableCellViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryTableCellViewProtocol.h; sourceTree = "<group>"; }; 53ED473A29CBC64200795DB1 /* NSPasteboardItem+VLCAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSPasteboardItem+VLCAdditions.h"; sourceTree = "<group>"; }; 53ED473B29CBC64200795DB1 /* NSPasteboardItem+VLCAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSPasteboardItem+VLCAdditions.m"; sourceTree = "<group>"; }; 53F0E92B299B002300491D49 /* VLCInputNodePathControlItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCInputNodePathControlItem.h; sourceTree = "<group>"; }; @@ -1034,6 +1043,8 @@ children = ( 1C1ED51D2205AC6B00811EC0 /* VLCControlsBarCommon.h */, E0382C01160BA09E0031D7FF /* VLCControlsBarCommon.m */, + 5352B37129DF29BF0011CE03 /* VLCMainVideoViewControlsBar.h */, + 5352B37229DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m */, 7D5678EE1D5BA397002698F3 /* VLCMainWindowControlsBar.h */, 7D5678EF1D5BA397002698F3 /* VLCMainWindowControlsBar.m */, ); @@ -1200,10 +1211,14 @@ 536283DE291146BC00640C15 /* VLCLibraryTableView.m */, 53ED473429CA4F3400795DB1 /* VLCLibraryTableViewDelegate.h */, 53ED473529CA4F3400795DB1 /* VLCLibraryTableViewDelegate.m */, + 539F114929E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.h */, + 539F114A29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m */, 7D713D302201AE350042BEB7 /* VLCLibraryWindow.h */, 7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */, 5362550B293FD639005D64FA /* VLCLibraryWindowController.h */, 5362550C293FD639005D64FA /* VLCLibraryWindowController.m */, + 5352B37429E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.h */, + 5352B37529E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m */, 5317FE02294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.h */, 5317FE03294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.m */, 5317FE05294E8D1A001702F0 /* VLCLibraryCollectionViewDataSource.h */, @@ -1897,6 +1912,7 @@ 7D61DCE4236C1937008133CF /* VLCCustomWindowButton.m in Sources */, 7DFFF90123682D4800C8B0C9 /* VLCDetachedAudioWindow.m in Sources */, 7D66D4392200C5B80040D04A /* VLCVideoFilterHelper.m in Sources */, + 5352B37329DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m in Sources */, 7D445D812202524000263D34 /* VLCPlaylistController.m in Sources */, 7DFBDCBE226CED7200B700A5 /* VLCMediaSource.m in Sources */, 536283F2291146BC00640C15 /* VLCLibraryCollectionViewAlbumSupplementaryDetailView.m in Sources */, @@ -1982,6 +1998,7 @@ 7DD2F5C52081B73B007EE187 /* VLCRemoteControlService.m in Sources */, 1C31139F1E508C6900D4DD76 /* VLCMainWindowControlsBar.m in Sources */, 1C3113A11E508C6900D4DD76 /* VLCConvertAndSaveWindowController.m in Sources */, + 5352B37629E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m in Sources */, 7DBB7639227F3FBC002649E1 /* VLCLibraryCollectionViewSupplementaryElementView.m in Sources */, 1C3113A31E508C6900D4DD76 /* VLCCoreDialogProvider.m in Sources */, 6B2EFC631F281A0900F3C0EA /* VLCVolumeSliderCell.m in Sources */, @@ -2019,6 +2036,7 @@ 6BBB05DA1EEFEA29003A1019 /* VLCHUDOutlineView.m in Sources */, 7D445D842202524D00263D34 /* VLCPlaylistItem.m in Sources */, 1C3113CF1E508C6900D4DD76 /* prefs_widgets.m in Sources */, + 539F114B29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m in Sources */, 7D0F63FF2201F63400FDB91F /* VLCPlaylistTableCellView.m in Sources */, 1C3113D11E508C6900D4DD76 /* prefs.m in Sources */, 1C3113D31E508C6900D4DD76 /* VLCResumeDialogController.m in Sources */,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/extras/tools/bootstrap -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/extras/tools/bootstrap
Changed
@@ -150,7 +150,7 @@ check_nasm 2.14 check gettext check help2man -check meson 0.60.0 +check meson 1.0.0 check_ninja DEPS_ONLY="help2man"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/meson.build -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/meson.build
Changed
@@ -85,6 +85,7 @@ 'vlc_playlist.h', 'vlc_playlist_export.h', 'vlc_plugin.h', + 'vlc_preparser.h', 'vlc_probe.h', 'vlc_rand.h', 'vlc_renderer_discovery.h',
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc/libvlc_media.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc/libvlc_media.h
Changed
@@ -147,29 +147,29 @@ /** * Parse media if it's a local file */ - libvlc_media_parse_local = 0x00, + libvlc_media_parse_local = 0x01, /** * Parse media even if it's a network file */ - libvlc_media_parse_network = 0x01, + libvlc_media_parse_network = 0x02, + /** + * Force parsing the media even if it would be skipped. + */ + libvlc_media_parse_forced = 0x04, /** * Fetch meta and cover art using local resources */ - libvlc_media_fetch_local = 0x02, + libvlc_media_fetch_local = 0x08, /** * Fetch meta and cover art using network resources */ - libvlc_media_fetch_network = 0x04, + libvlc_media_fetch_network = 0x10, /** * Interact with the user (via libvlc_dialog_cbs) when preparsing this item * (and not its sub items). Set this flag in order to receive a callback * when the input is asking for credentials. */ - libvlc_media_do_interact = 0x08, - /** - * Force parsing the media even if it would be skipped. - */ - libvlc_media_no_skip = 0x10, + libvlc_media_do_interact = 0x20, } libvlc_media_parse_flag_t; /**
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_block.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_block.h
Changed
@@ -79,6 +79,7 @@ #define vlc_block_callbacks vlc_frame_callbacks #define block_Init vlc_frame_Init +#define block_New vlc_frame_New #define block_Alloc vlc_frame_Alloc #define block_TryRealloc vlc_frame_TryRealloc #define block_Realloc vlc_frame_Realloc
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_fixups.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_fixups.h
Changed
@@ -108,7 +108,7 @@ /* C++11 says there's no need to define __STDC_*_MACROS when including * inttypes.h and stdint.h. */ -#if defined (__cplusplus) && (defined(__MINGW32__) || defined(__UCLIBC__)) +#if defined (__cplusplus) && defined(__UCLIBC__) # ifndef __STDC_FORMAT_MACROS # define __STDC_FORMAT_MACROS 1 # endif @@ -396,9 +396,7 @@ } /* extern "C" */ #endif -#if defined (_WIN32) && defined(__MINGW32__) -#define aligned_free(ptr) __mingw_aligned_free(ptr) -#elif defined (_WIN32) && defined(_MSC_VER) +#if defined (_WIN32) #define aligned_free(ptr) _aligned_free(ptr) #else #define aligned_free(ptr) free(ptr) @@ -456,11 +454,18 @@ /* Socket stuff */ #ifndef HAVE_INET_PTON +# ifdef __cplusplus +} +# endif # ifndef _WIN32 # include <sys/socket.h> #else typedef int socklen_t; # endif +# ifdef __cplusplus +extern "C" { +# endif + int inet_pton(int, const char *, void *); const char *inet_ntop(int, const void *, char *, socklen_t); #endif @@ -493,7 +498,13 @@ #endif #ifndef HAVE_IF_NAMEINDEX +# ifdef __cplusplus +} +# endif #include <errno.h> +# ifdef __cplusplus +extern "C" { +# endif # ifndef HAVE_STRUCT_IF_NAMEINDEX struct if_nameindex { @@ -531,7 +542,13 @@ }; # ifndef HAVE_IF_NAMETOINDEX +# ifdef __cplusplus +} +# endif # include <stdlib.h> /* a define may change from the real atoi declaration */ +# ifdef __cplusplus +extern "C" { +# endif static inline int if_nametoindex(const char *name) { return atoi(name); @@ -748,7 +765,13 @@ #ifdef __APPLE__ # define fdatasync fsync +# ifdef __cplusplus +} +# endif # include <time.h> +# ifdef __cplusplus +extern "C" { +# endif # ifndef TIMER_ABSTIME # define TIMER_ABSTIME 0x01 # endif @@ -768,7 +791,13 @@ #ifndef _WIN32 # ifndef HAVE_CLOCK_NANOSLEEP +# ifdef __cplusplus +} +# endif # include <time.h> +# ifdef __cplusplus +extern "C" { +# endif int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); # endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_fourcc.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_fourcc.h
Changed
@@ -93,6 +93,7 @@ #define VLC_CODEC_TRUEMOTION2 VLC_FOURCC('T','M','2','0') #define VLC_CODEC_QTRLE VLC_FOURCC('r','l','e',' ') #define VLC_CODEC_QDRAW VLC_FOURCC('q','d','r','w') +#define VLC_CODEC_QOI VLC_FOURCC('q','o','i','f') #define VLC_CODEC_QPEG VLC_FOURCC('Q','P','E','G') #define VLC_CODEC_ULTI VLC_FOURCC('U','L','T','I') #define VLC_CODEC_VIXL VLC_FOURCC('V','I','X','L')
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_frame.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_frame.h
Changed
@@ -160,6 +160,24 @@ void *base, size_t length); /** + * Creates a custom frame. + * + * This function initialize a frame of timed data allocated by custom means. + * This allows passing data without copying even if the data has been allocated + * with unusual means or outside of LibVLC. + * + * Normally, frames are allocated and initialized by vlc_frame_Alloc() instead. + * + * @param cbs structure of custom callbacks to handle the frame IN + * @param base start address of the frame data + * @param length byte length of the frame data + * + * @return the created frame, or NULL on memory error. + */ +VLC_API vlc_frame_t *vlc_frame_New(const struct vlc_frame_callbacks *cbs, + void *base, size_t length); + +/** * Allocates a frame. * * Creates a new frame with the requested size.
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_input_item.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_input_item.h
Changed
@@ -38,7 +38,6 @@ typedef struct input_item_opaque input_item_opaque_t; typedef struct input_item_slave input_item_slave_t; -typedef struct input_preparser_callbacks_t input_preparser_callbacks_t; struct info_t { @@ -478,12 +477,14 @@ META_REQUEST_OPTION_NONE = 0x00, META_REQUEST_OPTION_SCOPE_LOCAL = 0x01, META_REQUEST_OPTION_SCOPE_NETWORK = 0x02, - META_REQUEST_OPTION_SCOPE_ANY = 0x03, - META_REQUEST_OPTION_FETCH_LOCAL = 0x04, - META_REQUEST_OPTION_FETCH_NETWORK = 0x08, - META_REQUEST_OPTION_FETCH_ANY = 0x0C, - META_REQUEST_OPTION_DO_INTERACT = 0x10, - META_REQUEST_OPTION_NO_SKIP = 0x20, + META_REQUEST_OPTION_SCOPE_ANY = + META_REQUEST_OPTION_SCOPE_LOCAL|META_REQUEST_OPTION_SCOPE_NETWORK, + META_REQUEST_OPTION_SCOPE_FORCED = 0x04, + META_REQUEST_OPTION_FETCH_LOCAL = 0x08, + META_REQUEST_OPTION_FETCH_NETWORK = 0x10, + META_REQUEST_OPTION_FETCH_ANY = + META_REQUEST_OPTION_FETCH_LOCAL|META_REQUEST_OPTION_FETCH_NETWORK, + META_REQUEST_OPTION_DO_INTERACT = 0x20, } input_item_meta_request_option_t; /* status of the on_preparse_ended() callback */ @@ -495,24 +496,17 @@ ITEM_PREPARSE_DONE }; -typedef struct input_preparser_callbacks_t { +struct vlc_metadata_cbs { void (*on_preparse_ended)(input_item_t *, enum input_item_preparse_status status, void *userdata); - void (*on_subtree_added)(input_item_t *, input_item_node_t *subtree, void *userdata); -} input_preparser_callbacks_t; - -typedef struct input_fetcher_callbacks_t { void (*on_art_fetch_ended)(input_item_t *, bool fetched, void *userdata); -} input_fetcher_callbacks_t; + void (*on_subtree_added)(input_item_t *, input_item_node_t *subtree, void *userdata); +}; VLC_API int libvlc_MetadataRequest( libvlc_int_t *, input_item_t *, input_item_meta_request_option_t, - const input_preparser_callbacks_t *cbs, + const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int, void * ); -VLC_API int libvlc_ArtRequest(libvlc_int_t *, input_item_t *, - input_item_meta_request_option_t, - const input_fetcher_callbacks_t *cbs, - void *cbs_userdata ); VLC_API void libvlc_MetadataCancel( libvlc_int_t *, void * ); /******************
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_picture.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_picture.h
Changed
@@ -27,6 +27,7 @@ #include <assert.h> #include <vlc_atomic.h> +#include <vlc_es.h> #ifdef __cplusplus extern "C" { @@ -43,8 +44,6 @@ * This file defines picture structures and functions in vlc */ -#include <vlc_es.h> - /** Description of a planar graphic field */ typedef struct plane_t {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_plugin.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_plugin.h
Changed
@@ -24,6 +24,8 @@ #ifndef LIBVLC_MODULES_MACROS_H # define LIBVLC_MODULES_MACROS_H 1 +#include <stdint.h> + /** * \file * This file implements plugin (module) macros used to define a vlc module.
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_preparser.h
Added
@@ -0,0 +1,109 @@ +/***************************************************************************** + * preparser.h + ***************************************************************************** + * Copyright (C) 1999-2023 VLC authors and VideoLAN + * + * Authors: Samuel Hocevar <sam@zoy.org> + * Clément Stenac <zorglub@videolan.org> + * + * 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. + *****************************************************************************/ + +#ifndef VLC_PREPARSER_H +#define VLC_PREPARSER_H 1 + +#include <vlc_input_item.h> + +/** + * @defgroup vlc_preparser Preparser + * @ingroup input + * @{ + * @file + * VLC Preparser API + */ + +/** + * Preparser opaque structure. + * + * The preparser object will retrieve the meta data of any given input item in + * an asynchronous way. + * It will also issue art fetching requests. + */ +typedef struct vlc_preparser_t vlc_preparser_t; + +/** + * This function creates the preparser object and thread. + * + * @param obj the parent object + * @return a valid preparser object or NULL in case of error + */ +VLC_API vlc_preparser_t *vlc_preparser_New( vlc_object_t *obj ); + +/** + * This function enqueues the provided item to be preparsed or fetched. + * + * The input item is retained until the preparsing is done or until the + * preparser object is deleted. + * + * @param preparser the preparser object + * @param item a valid item to preparse + * @param option preparse flag, cf @ref input_item_meta_request_option_t + * @param cbs callback to listen to events (can't be NULL) + * @param cbs_userdata opaque pointer used by the callbacks + * @param timeout maximum time allowed to preparse the item. If -1, the default + * "preparse-timeout" option will be used as a timeout. If 0, it will wait + * indefinitely. If > 0, the timeout will be used (in milliseconds). + * @param id unique id provided by the caller. This is can be used to cancel + * the request with vlc_preparser_Cancel() + * @returns VLC_SUCCESS if the item was scheduled for preparsing, an error code + * otherwise + * If this returns an error, the on_preparse_ended will *not* be invoked + */ +VLC_API int vlc_preparser_Push( vlc_preparser_t *preparser, input_item_t *item, + input_item_meta_request_option_t option, + const struct vlc_metadata_cbs *cbs, + void *cbs_userdata, + int timeout, void *id ); + +/** + * This function cancel all preparsing requests for a given id + * + * @param preparser the preparser object + * @param id unique id given to vlc_preparser_Push() + */ +VLC_API void vlc_preparser_Cancel( vlc_preparser_t *preparser, void *id ); + +/** + * This function destroys the preparser object and thread. + * + * @param preparser the preparser object + * All pending input items will be released. + */ +VLC_API void vlc_preparser_Delete( vlc_preparser_t *preparser ); + +/** + * This function deactivates the preparser + * + * All pending requests will be removed, and it will block until the currently + * running entity has finished (if any). + * + * @param preparser the preparser object + */ +VLC_API void vlc_preparser_Deactivate( vlc_preparser_t *preparser ); + +/** @} vlc_preparser */ + +#endif +
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/include/vlc_sout.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/include/vlc_sout.h
Changed
@@ -27,14 +27,14 @@ #ifndef VLC_SOUT_H_ #define VLC_SOUT_H_ -#ifdef __cplusplus -extern "C" { -#endif - #include <sys/types.h> #include <vlc_es.h> #include <vlc_clock.h> +#ifdef __cplusplus +extern "C" { +#endif + /** * \defgroup sout Stream output * \ingroup output
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/lib/media.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/lib/media.c
Changed
@@ -820,7 +820,7 @@ return 1; } -static const input_preparser_callbacks_t input_preparser_callbacks = { +static const struct vlc_metadata_cbs preparser_callbacks = { .on_preparse_ended = input_item_preparse_ended, .on_subtree_added = input_item_subtree_added, }; @@ -839,7 +839,7 @@ libvlc_int_t *libvlc = inst->p_libvlc_int; input_item_t *item = media->p_input_item; - input_item_meta_request_option_t parse_scope = META_REQUEST_OPTION_SCOPE_LOCAL; + input_item_meta_request_option_t parse_scope = 0; int ret; unsigned int ref = atomic_load_explicit(&media->worker_count, memory_order_relaxed); @@ -853,19 +853,21 @@ memory_order_relaxed, memory_order_relaxed)); + if (parse_flag & libvlc_media_parse_local) + parse_scope |= META_REQUEST_OPTION_SCOPE_LOCAL; if (parse_flag & libvlc_media_parse_network) parse_scope |= META_REQUEST_OPTION_SCOPE_NETWORK; + if (parse_flag & libvlc_media_parse_forced) + parse_scope |= META_REQUEST_OPTION_SCOPE_FORCED; if (parse_flag & libvlc_media_fetch_local) parse_scope |= META_REQUEST_OPTION_FETCH_LOCAL; if (parse_flag & libvlc_media_fetch_network) parse_scope |= META_REQUEST_OPTION_FETCH_NETWORK; if (parse_flag & libvlc_media_do_interact) parse_scope |= META_REQUEST_OPTION_DO_INTERACT; - if (parse_flag & libvlc_media_no_skip) - parse_scope |= META_REQUEST_OPTION_NO_SKIP; ret = libvlc_MetadataRequest(libvlc, item, parse_scope, - &input_preparser_callbacks, media, + &preparser_callbacks, media, timeout, media); if (ret != VLC_SUCCESS) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/lib/picture.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/lib/picture.c
Changed
@@ -108,7 +108,8 @@ libvlc_picture_t *pic = malloc( sizeof( *pic ) ); if ( unlikely( pic == NULL ) ) return NULL; - pic->converted = malloc( sizeof( *pic->converted ) ); + pic->converted = block_New(&block_cbs, attachment->p_data, + attachment->i_data); if ( unlikely( pic->converted == NULL ) ) { free(pic); @@ -117,8 +118,6 @@ vlc_atomic_rc_init( &pic->rc ); pic->attachment = vlc_input_attachment_Hold( attachment ); pic->time = VLC_TICK_INVALID; - block_Init( pic->converted, &block_cbs, attachment->p_data, - attachment->i_data); video_format_Init( &pic->fmt, fcc ); switch ( fcc ) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/meson.build -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/meson.build
Changed
@@ -173,6 +173,8 @@ if intl_dep.found() cdata.set('HAVE_GETTEXT', 1) cdata.set('ENABLE_NLS', 1) + + subdir('po') endif # Domain name i18n support via GNU libidn
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/Makefile.am -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/Makefile.am
Changed
@@ -166,7 +166,7 @@ access_LTLIBRARIES += libv4l2_plugin.la endif -libdshow_plugin_la_SOURCES = access/dshow/vlc_dshow.h access/dshow/dshow.cpp access/dshow/access.h \ +libdshow_plugin_la_SOURCES = access/dshow/dshow.cpp access/dshow/access.h \ access/dshow/filter.cpp access/dshow/filter.h access/dshow/crossbar.cpp ../src/win32/mta_holder.h libdshow_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DSTRSAFE_NO_DEPRECATE libdshow_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBCOMCXXFLAGS)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/bluray.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/bluray.c
Changed
@@ -256,7 +256,7 @@ add_submodule() set_description( "BluRay demuxer" ) set_subcategory( SUBCAT_INPUT_DEMUX ) - set_capability( "demux", 5 ) + set_capability( "demux", 7 ) set_callbacks( blurayOpen, blurayClose ) #endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/dshow/crossbar.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/dshow/crossbar.cpp
Changed
@@ -30,10 +30,9 @@ #include <vlc_common.h> -#include <assert.h> +#include <cassert> #include "access.h" -#include "vlc_dshow.h" namespace dshow {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/dshow/dshow.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/dshow/dshow.cpp
Changed
@@ -45,11 +45,12 @@ #include <vlc_charset.h> /* FromWide */ #include <initguid.h> -#include "vlc_dshow.h" #include "access.h" #include "filter.h" +#include <wmcodecdsp.h> + #include "../src/win32/mta_holder.h" namespace dshow {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/dshow/filter.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/dshow/filter.cpp
Changed
@@ -31,17 +31,13 @@ #include <vlc_common.h> #include <vlc_fourcc.h> -#ifndef _MSC_VER - /* Work-around a bug in w32api-2.5 */ -# define QACONTAINERFLAGS QACONTAINERFLAGS_SOMETHINGELSE -#endif - #include "access.h" #include "filter.h" -#include "vlc_dshow.h" #include <initguid.h> +#include <wmcodecdsp.h> + #include <new> namespace dshow {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/dtv/bdagraph.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/dtv/bdagraph.cpp
Changed
@@ -29,7 +29,7 @@ # include <config.h> #endif -#include <assert.h> +#include <cassert> #include <vlc_common.h> #include <vlc_block.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/dvdnav.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/dvdnav.c
Changed
@@ -96,7 +96,7 @@ add_submodule() set_description( N_("DVDnav demuxer") ) set_subcategory( SUBCAT_INPUT_DEMUX ) - set_capability( "demux", 5 ) + set_capability( "demux", 7 ) set_callbacks( DemuxOpen, Close ) add_shortcut( "dvd", "iso" ) vlc_module_end ()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/access/screen/dxgi.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/access/screen/dxgi.cpp
Changed
@@ -245,13 +245,7 @@ DXGI_OUTDUPL_DESC outDesc; p_data->duplication->GetDesc(&outDesc); - for (p_data->output_format = DxgiGetRenderFormatList(); - p_data->output_format->name != nullptr; ++p_data->output_format) - { - if (p_data->output_format->formatTexture == outDesc.ModeDesc.Format && - is_d3d11_opaque(p_data->output_format->fourcc)) - break; - } + p_data->output_format = D3D11_RenderFormat(outDesc.ModeDesc.Format ,true); if (unlikely(!p_data->output_format->name)) { msg_Err(p_demux, "Unknown texture format %d", outDesc.ModeDesc.Format);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/audio_filter/channel_mixer/spatialaudio.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/audio_filter/channel_mixer/spatialaudio.cpp
Changed
@@ -28,7 +28,7 @@ # include "config.h" #endif -#include <assert.h> +#include <cassert> #include <vlc_common.h> #include <vlc_plugin.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/avcodec/d3d11va.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/avcodec/d3d11va.c
Changed
@@ -369,20 +369,6 @@ return VLC_SUCCESS; } -static const d3d_format_t *D3D11_FindDXGIFormat(DXGI_FORMAT dxgi) -{ - for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); - output_format->name != NULL; ++output_format) - { - if (output_format->formatTexture == dxgi && - is_d3d11_opaque(output_format->fourcc)) - { - return output_format; - } - } - return NULL; -} - static int DxSetupOutput(vlc_va_t *va, const directx_va_mode_t *mode, const video_format_t *fmt) { vlc_va_sys_t *sys = va->sys; @@ -427,8 +413,8 @@ } if (decoder_format == NULL || decoder_format->formatTexture != DXGI_FORMAT_NV12) - processorInputidx++ = D3D11_FindDXGIFormat(DXGI_FORMAT_NV12); - processorInputidx++ = D3D11_FindDXGIFormat(DXGI_FORMAT_420_OPAQUE); + processorInputidx++ = D3D11_RenderFormat(DXGI_FORMAT_NV12 ,true); + processorInputidx++ = D3D11_RenderFormat(DXGI_FORMAT_420_OPAQUE ,true); processorInputidx++ = NULL; /* */ @@ -509,6 +495,7 @@ vlc_va_sys_t *sys = va->sys; HRESULT hr; + d3d11_device_lock(sys->d3d_dev); void *pv; hr = ID3D11Device_QueryInterface( sys->d3d_dev->d3ddevice, &IID_ID3D10Multithread, &pv); if (SUCCEEDED(hr)) { @@ -525,6 +512,7 @@ isXboxHardware(sys->d3d_dev)) { msg_Warn(va, "%dx%d resolution not supported by your hardware", fmt->i_width, fmt->i_height); + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } #endif @@ -554,6 +542,7 @@ hr = ID3D11Device_CreateTexture2D( sys->d3d_dev->d3ddevice, &texDesc, NULL, &p_texture ); if (FAILED(hr)) { msg_Err(va, "CreateTexture2D %zu failed. (hr=0x%lX)", surface_count, hr); + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } @@ -568,6 +557,7 @@ if (FAILED(hr)) { msg_Err(va, "CreateVideoDecoderOutputView %d failed. (hr=0x%lX)", surface_idx, hr); ID3D11Texture2D_Release(p_texture); + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } @@ -593,6 +583,7 @@ hr = ID3D11VideoDevice_GetVideoDecoderConfigCount( sys->d3ddec, &decoderDesc, &cfg_count ); if (FAILED(hr)) { msg_Err(va, "GetVideoDecoderConfigCount failed. (hr=0x%lX)", hr); + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } @@ -602,6 +593,7 @@ hr = ID3D11VideoDevice_GetVideoDecoderConfig( sys->d3ddec, &decoderDesc, i, &cfg_listi ); if (FAILED(hr)) { msg_Err(va, "GetVideoDecoderConfig failed. (hr=0x%lX)", hr); + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } } @@ -635,6 +627,7 @@ } if (cfg_score <= 0) { msg_Err(va, "Failed to find a supported decoder configuration"); + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } @@ -644,8 +637,10 @@ if (FAILED(hr)) { msg_Err(va, "ID3D11VideoDevice_CreateVideoDecoder failed. (hr=0x%lX)", hr); sys->hw.decoder = NULL; + d3d11_device_unlock(sys->d3d_dev); return VLC_EGENERIC; } + d3d11_device_unlock(sys->d3d_dev); sys->hw.decoder = decoder; msg_Dbg(va, "DxCreateDecoderSurfaces succeed");
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/avcodec/fourcc.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/avcodec/fourcc.c
Changed
@@ -113,12 +113,16 @@ { VLC_CODEC_LCL_MSZH, AV_CODEC_ID_MSZH }, { VLC_CODEC_LCL_ZLIB, AV_CODEC_ID_ZLIB }, { VLC_CODEC_QTRLE, AV_CODEC_ID_QTRLE }, +#if LIBAVCODEC_VERSION_CHECK(59, 33, 100) + { VLC_CODEC_QOI, AV_CODEC_ID_QOI }, +#endif { VLC_CODEC_TSCC, AV_CODEC_ID_TSCC }, { VLC_CODEC_ULTI, AV_CODEC_ID_ULTI }, { VLC_CODEC_QDRAW, AV_CODEC_ID_QDRAW }, { VLC_CODEC_VIXL, AV_CODEC_ID_VIXL }, { VLC_CODEC_QPEG, AV_CODEC_ID_QPEG }, { VLC_CODEC_PNG, AV_CODEC_ID_PNG }, + { VLC_CODEC_PNM, AV_CODEC_ID_PPM }, { VLC_CODEC_PPM, AV_CODEC_ID_PPM }, /* AV_CODEC_ID_PBM */ { VLC_CODEC_PGM, AV_CODEC_ID_PGM },
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/avcodec/video.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/avcodec/video.c
Changed
@@ -574,12 +574,8 @@ p_sys->framedrop = FRAMEDROP_NONE; /* Set output properties */ - if( GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) != VLC_SUCCESS ) - { - /* we are doomed. but not really, because most codecs set their pix_fmt later on */ - p_dec->fmt_out.i_codec = VLC_CODEC_I420; - } - p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma; + if (GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) == VLC_SUCCESS) + p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma; p_dec->fmt_out.video.orientation = p_dec->fmt_in->video.orientation;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/dav1d.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/dav1d.c
Changed
@@ -160,11 +160,12 @@ static int NewPicture(Dav1dPicture *img, void *cookie) { decoder_t *dec = cookie; + decoder_sys_t *p_sys = dec->p_sys; video_format_t *v = &dec->fmt_out.video; - v->i_visible_width = img->p.w; - v->i_visible_height = img->p.h; + v->i_visible_width = img->seq_hdr->max_width; + v->i_visible_height = img->seq_hdr->max_height; UpdateDecoderOutput(dec, img->seq_hdr); @@ -199,10 +200,15 @@ v->multiview_mode = dec->fmt_in->video.multiview_mode; v->pose = dec->fmt_in->video.pose; dec->fmt_out.i_codec = FindVlcChroma(img); - v->i_width = (img->p.w + 0x7F) & ~0x7F; - v->i_height = (img->p.h + 0x7F) & ~0x7F; + v->i_width = (img->seq_hdr->max_width + 0x7F) & ~0x7F; + v->i_height = (img->seq_hdr->max_height + 0x7F) & ~0x7F; v->i_chroma = dec->fmt_out.i_codec; + dec->i_extra_picture_buffers = p_sys->s.max_frame_delay; + if (img->seq_hdr->super_res) + // dav1d seems to buffer more pictures when using super resolution + dec->i_extra_picture_buffers += p_sys->s.max_frame_delay > 1 ? 2 : 1; + if (decoder_UpdateVideoFormat(dec) == 0) { picture_t *pic; @@ -481,6 +487,7 @@ dec->fmt_out.video.i_frame_rate = dec->fmt_in->video.i_frame_rate; dec->fmt_out.video.i_frame_rate_base = dec->fmt_in->video.i_frame_rate_base; + bool super_res = false; if (!sequence_hdr) { dec->fmt_out.i_codec = VLC_CODEC_I420; @@ -497,6 +504,7 @@ if (dec->fmt_out.video.transfer == TRANSFER_FUNC_UNDEF) AV1_get_colorimetry(sequence_hdr, &dec->fmt_out.video.primaries, &dec->fmt_out.video.transfer, &dec->fmt_out.video.space, &dec->fmt_out.video.color_range); + super_res = AV1_get_super_res(sequence_hdr); } dec->fmt_out.video.i_visible_width = dec->fmt_out.video.i_width; dec->fmt_out.video.i_visible_height = dec->fmt_out.video.i_height; @@ -512,6 +520,9 @@ dav1d_version(), p_sys->s.n_threads); dec->i_extra_picture_buffers = p_sys->s.max_frame_delay; + if (super_res) + // dav1d seems to buffer more pictures when using super resolution + dec->i_extra_picture_buffers += p_sys->s.max_frame_delay > 1 ? 2 : 1; #else msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads", dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/gstreamer/gstdecode.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/gstreamer/gstdecode.c
Changed
@@ -200,10 +200,11 @@ switch( GST_QUERY_TYPE ( p_query ) ){ case GST_QUERY_CAPS: return gst_vlc_video_sink_query_caps( p_query ); - case GST_QUERY_ALLOCATION: + case GST_QUERY_ALLOCATION: { GstBaseSink *p_bsink = GST_BASE_SINK_CAST( p_sys->p_decode_out ); GstBaseSinkClass *p_bclass = GST_BASE_SINK_GET_CLASS( p_bsink ); return p_bclass->propose_allocation( p_bsink, p_query ); + } default: return FALSE; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/gstreamer/gstvlcpictureplaneallocator.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/gstreamer/gstvlcpictureplaneallocator.c
Changed
@@ -34,7 +34,7 @@ #define gst_vlc_picture_plane_allocator_parent_class parent_class G_DEFINE_TYPE (GstVlcPicturePlaneAllocator, gst_vlc_picture_plane_allocator, \ - GST_TYPE_ALLOCATOR); + GST_TYPE_ALLOCATOR) static void gst_vlc_picture_plane_allocator_finalize( GObject *p_object ); static GstMemory* gst_vlc_picture_plane_allocator_dummy_alloc(
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/gstreamer/gstvlcpictureplaneallocator.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/gstreamer/gstvlcpictureplaneallocator.h
Changed
@@ -61,7 +61,7 @@ struct _GstVlcPicturePlaneAllocator { GstAllocator parent; - picture_t pic_info;; + picture_t pic_info; decoder_t *p_dec; };
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/gstreamer/gstvlcvideopool.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/gstreamer/gstvlcvideopool.c
Changed
@@ -32,7 +32,7 @@ #define gst_vlc_video_pool_parent_class parent_class G_DEFINE_TYPE (GstVlcVideoPool, gst_vlc_video_pool, - GST_TYPE_BUFFER_POOL); + GST_TYPE_BUFFER_POOL) static const gchar** gst_vlc_video_pool_get_options (GstBufferPool *p_pool) { @@ -189,7 +189,7 @@ gst_vlc_picture_plane_allocator_release( p_vpool->p_allocator, p_buffer ); - msg_Dbg( p_vpool->p_dec, "freed buffer %p", p_buffer ); + msg_Dbg( p_vpool->p_dec, "freed buffer %p", (void*)p_buffer ); GST_BUFFER_POOL_CLASS( parent_class )->free_buffer( p_pool, p_buffer ); @@ -223,7 +223,7 @@ p_info->offset, p_info->stride ); } - msg_Dbg( p_vpool->p_dec, "allocated buffer %p", *p_buffer ); + msg_Dbg( p_vpool->p_dec, "allocated buffer %p", (void*)*p_buffer ); return GST_FLOW_OK; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/gstreamer/gstvlcvideosink.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/gstreamer/gstvlcvideosink.c
Changed
@@ -71,7 +71,7 @@ static void gst_vlc_video_sink_finalize( GObject *p_obj ); #define gst_vlc_video_sink_parent_class parent_class -G_DEFINE_TYPE( GstVlcVideoSink, gst_vlc_video_sink, GST_TYPE_BASE_SINK ); +G_DEFINE_TYPE( GstVlcVideoSink, gst_vlc_video_sink, GST_TYPE_BASE_SINK ) static void gst_vlc_video_sink_class_init( GstVlcVideoSinkClass *p_klass ) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/libass.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/libass.c
Changed
@@ -38,6 +38,7 @@ #include <vlc_codec.h> #include <vlc_input.h> #include <vlc_dialog.h> +#include <vlc_stream.h> #include <ass/ass.h> @@ -122,6 +123,7 @@ static int BuildRegions( rectangle_t *p_region, int i_max_region, ASS_Image *p_img_list, int i_width, int i_height ); static void RegionDraw( subpicture_region_t *p_region, ASS_Image *p_img ); +static void OldEngineClunkyRollInfoPatch( decoder_t *p_dec, ASS_Track * ); //#define DEBUG_REGION @@ -279,6 +281,7 @@ return VLC_EGENERIC; } ass_process_codec_private( p_track, p_dec->fmt_in->p_extra, p_dec->fmt_in->i_extra ); + OldEngineClunkyRollInfoPatch( p_dec, p_track ); p_dec->fmt_out.i_codec = VLC_CODEC_RGBA; @@ -771,3 +774,61 @@ #endif } +/* Patch Script Info aiming old and custom rendering engine + * See #27771 */ +static void OldEngineClunkyRollInfoPatch( decoder_t *p_dec, ASS_Track *p_track ) +{ + if( !p_dec->fmt_in->i_extra ) + return; + + stream_t *p_memstream = vlc_stream_MemoryNew( p_dec, p_dec->fmt_in->p_extra, + p_dec->fmt_in->i_extra, true ); + char *s = vlc_stream_ReadLine( p_memstream ); + unsigned playres2 = {0, 0}; + bool b_hotfix = false; + if( s && !strncmp( s, "Script Info", 13 ) ) + { + free( s ); + for( ;; ) + { + s = vlc_stream_ReadLine( p_memstream ); + if( !s || *s == '' /* Next section */ ) + { + break; + } + else if( !strncmp( s, "PlayResX: ", 10 ) || + !strncmp( s, "PlayResY: ", 10 ) ) + { + playres'Y' - s7 = atoi( &s9 ); + } + else if( !strncmp( s, "Original Script: ", 17 ) ) + { + b_hotfix = !!strstr( s, "http://www.crunchyroll.com/user/" ); + if( !b_hotfix ) + break; + } + else if( !strncmp( s, "LayoutRes", 9 ) || + !strncmp( s, "ScaledBorderAndShadow:", 22 ) ) + { + /* They can still have fixed their mess in the future. Tell me, Marty. */ + b_hotfix = false; + break; + } + } + } + free( s ); + vlc_stream_Delete( p_memstream ); + if( b_hotfix && playres0 && playres1 ) + { + msg_Dbg( p_dec,"patching script info for custom rendering engine " + "(built against libass 0x%X)", LIBASS_VERSION ); + /* Only modify struct _before_ any ass_process_chunk calls + (see ass_types.h documentation for when modifications are allowed) */ + p_track->ScaledBorderAndShadow = 1; + p_track->YCbCrMatrix = YCBCR_NONE; +#if LIBASS_VERSION >= 0x01600020 + p_track->LayoutResX = playres0; + p_track->LayoutResY = playres1; +#endif + } +}
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/meson.build -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/meson.build
Changed
@@ -645,9 +645,9 @@ install: false ) - mft_link_with = cc.find_library('mfplat'), d3d11_common_lib + mft_deps = cc.find_library('mfplat') if get_option('winstore_app') - mft_link_with += cc.find_library('d3d11') + mft_deps += cc.find_library('d3d11') endif vlc_modules += { 'name' : 'mft', @@ -660,7 +660,8 @@ '../packetizer/h264_nal.c', '../packetizer/hevc_nal.c' ), - 'link_with' : mft_link_with + 'link_with' : d3d11_common_lib , + 'dependencies' : mft_deps } endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/mft.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/mft.cpp
Changed
@@ -28,7 +28,7 @@ #undef WINAPI_FAMILY #define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP -#include <assert.h> +#include <cassert> #include <vlc_common.h> #include <vlc_plugin.h> @@ -925,16 +925,7 @@ p_dec->fmt_out.video.i_width = desc.Width; p_dec->fmt_out.video.i_height = desc.Height; - for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); - output_format->name != NULL; ++output_format) - { - if (output_format->formatTexture == desc.Format && - is_d3d11_opaque(output_format->fourcc)) - { - p_sys->cfg = output_format; - break; - } - } + p_sys->cfg = D3D11_RenderFormat(desc.Format ,true); p_dec->fmt_out.i_codec = p_sys->cfg->fourcc; p_dec->fmt_out.video.i_chroma = p_sys->cfg->fourcc; @@ -1298,6 +1289,12 @@ static int SetD3D11(decoder_t *p_dec, d3d11_device_t *d3d_dev) { + if (!(d3d_dev->d3ddevice->GetCreationFlags() & D3D11_CREATE_DEVICE_VIDEO_SUPPORT)) + { + msg_Warn(p_dec, "the provided D3D11 device doesn't support decoding"); + return VLC_EGENERIC; + } + mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys); HRESULT hr; hr = p_sys->fptr_MFCreateDXGIDeviceManager(&p_sys->dxgi_token, &p_sys->dxgi_manager); @@ -1390,13 +1387,14 @@ hr = attributes->GetUINT32(MF_SA_D3D11_AWARE, &can_d3d11); if (SUCCEEDED(hr) && can_d3d11) { - SetD3D11(p_dec, &devsys11->d3d_dev); - - IMFAttributes *outputAttr = NULL; - hr = p_sys->mft->GetOutputStreamAttributes(p_sys->output_stream_id, &outputAttr); - if (SUCCEEDED(hr)) + if (SetD3D11(p_dec, &devsys11->d3d_dev) == VLC_SUCCESS) { - hr = outputAttr->SetUINT32(MF_SA_D3D11_BINDFLAGS, D3D11_BIND_SHADER_RESOURCE); + IMFAttributes *outputAttr = NULL; + hr = p_sys->mft->GetOutputStreamAttributes(p_sys->output_stream_id, &outputAttr); + if (SUCCEEDED(hr)) + { + hr = outputAttr->SetUINT32(MF_SA_D3D11_BINDFLAGS, D3D11_BIND_SHADER_RESOURCE); + } } } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/omxil/mediacodec.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/omxil/mediacodec.c
Changed
@@ -470,6 +470,7 @@ if (p_sys->b_adaptive) msg_Dbg(p_dec, "mediacodec configured for adaptative playback"); args.video.b_adaptive_playback = p_sys->b_adaptive; + args.video.b_low_latency = var_InheritBool(p_dec, "low-delay"); } else {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/omxil/mediacodec.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/omxil/mediacodec.h
Changed
@@ -99,6 +99,7 @@ int i_angle; bool b_tunneled_playback; bool b_adaptive_playback; + bool b_low_latency; } video; struct {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/omxil/mediacodec_jni.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/omxil/mediacodec_jni.c
Changed
@@ -34,13 +34,12 @@ #include <OMX_Core.h> #include <OMX_Component.h> #include "omxil_utils.h" -#include "../../packetizer/hevc_nal.h" #include "mediacodec.h" #include "../../video_output/android/env.h" -char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime, - int profile, int *p_quirks); +char* MediaCodec_GetName(vlc_object_t *p_obj, vlc_fourcc_t codec, + const char *psz_mime, int profile, int *p_quirks); #define THREAD_NAME "mediacodec_jni" @@ -348,8 +347,8 @@ /***************************************************************************** * MediaCodec_GetName *****************************************************************************/ -char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime, - int profile, int *p_quirks) +char* MediaCodec_GetName(vlc_object_t *p_obj, vlc_fourcc_t codec, + const char *psz_mime, int profile, int *p_quirks) { JNIEnv *env; int num_codecs; @@ -448,22 +447,8 @@ int omx_profile = (*env)->GetIntField(env, profile_level, jfields.profile_field); (*env)->DeleteLocalRef(env, profile_level); - int codec_profile = 0; - if (strcmp(psz_mime, "video/avc") == 0) - codec_profile = convert_omx_to_profile_idc(omx_profile); - else if (strcmp(psz_mime, "video/hevc") == 0) - { - switch (omx_profile) - { - case 0x1: /* OMX_VIDEO_HEVCProfileMain */ - codec_profile = VLC_HEVC_PROFILE_MAIN; - break; - case 0x2: /* OMX_VIDEO_HEVCProfileMain10 */ - case 0x1000: /* OMX_VIDEO_HEVCProfileMain10HDR10 */ - codec_profile = VLC_HEVC_PROFILE_MAIN_10; - break; - } - } + int codec_profile = + convert_omx_to_profile_idc(codec, omx_profile); if (codec_profile != profile) continue; /* Some encoders set the level too high, thus we ignore it for the moment. @@ -589,6 +574,9 @@ if (p_args->video.i_angle != 0) SET_INTEGER(jformat, "rotation-degrees", p_args->video.i_angle); + if (p_args->video.b_low_latency) + SET_INTEGER(jformat, "low-latency", 1); + if (b_direct_rendering) { /* feature-tunneled-playback available since API 21 */ @@ -1068,7 +1056,7 @@ free(api->psz_name); api->i_quirks = 0; - api->psz_name = MediaCodec_GetName(api->p_obj, api->psz_mime, + api->psz_name = MediaCodec_GetName(api->p_obj, api->i_codec, api->psz_mime, i_profile, &api->i_quirks); if (!api->psz_name) return MC_API_ERROR;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/omxil/mediacodec_ndk.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/omxil/mediacodec_ndk.c
Changed
@@ -46,8 +46,8 @@ && MC_API_AUDIO_QUIRKS_NEED_CHANNELS == OMXCODEC_AUDIO_QUIRKS_NEED_CHANNELS, "mediacodec.h/omx_utils.h mismatch"); -char* MediaCodec_GetName(vlc_object_t *p_obj, const char *psz_mime, - int hxxx_profile, int *p_quirks); +char* MediaCodec_GetName(vlc_object_t *p_obj, vlc_fourcc_t codec, + const char *psz_mime, int profile, int *p_quirks); #define THREAD_NAME "mediacodec_ndk" @@ -266,6 +266,8 @@ return MC_API_ERROR; } + if (p_args->video.b_low_latency) + syms.AMediaFormat.setInt32(p_sys->p_format, "low-latency", 1); syms.AMediaFormat.setInt32(p_sys->p_format, "encoder", 0); syms.AMediaFormat.setString(p_sys->p_format, "mime", api->psz_mime); /* No limits for input size */ @@ -580,7 +582,7 @@ free(api->psz_name); api->i_quirks = 0; - api->psz_name = MediaCodec_GetName(api->p_obj, api->psz_mime, + api->psz_name = MediaCodec_GetName(api->p_obj, api->i_codec, api->psz_mime, i_profile, &api->i_quirks); if (!api->psz_name) return MC_API_ERROR;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/omxil/omxil_utils.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/omxil/omxil_utils.h
Changed
@@ -284,6 +284,4 @@ /***************************************************************************** * H264 specific code *****************************************************************************/ -size_t convert_omx_to_profile_idc(OMX_VIDEO_AVCPROFILETYPE profile_type); - -size_t convert_omx_to_level_idc(OMX_VIDEO_AVCLEVELTYPE level_type); +int convert_omx_to_profile_idc(vlc_fourcc_t codec, int profile_type);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/omxil/utils.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/omxil/utils.c
Changed
@@ -37,6 +37,8 @@ #include "qcom.h" #include "../../video_chroma/copy.h" #include "../../packetizer/h264_nal.h" +#include "../../packetizer/hevc_nal.h" +#include "../../packetizer/mpegvideo.h" /***************************************************************************** * Events utility functions @@ -1213,11 +1215,13 @@ } } -static const struct +struct omx_to_profile_idc { - OMX_VIDEO_AVCPROFILETYPE omx_profile; - size_t profile_idc; -} omx_to_profile_idc = + int omx_profile; + int profile_idc; +}; + +static const struct omx_to_profile_idc avc_omx_to_profile_idc = { { OMX_VIDEO_AVCProfileBaseline, PROFILE_H264_BASELINE }, { OMX_VIDEO_AVCProfileMain, PROFILE_H264_MAIN }, @@ -1228,46 +1232,49 @@ { OMX_VIDEO_AVCProfileHigh444, PROFILE_H264_HIGH_444 }, }; -size_t convert_omx_to_profile_idc(OMX_VIDEO_AVCPROFILETYPE profile_type) +static const struct omx_to_profile_idc hevc_omx_to_profile_idc = { - size_t array_length = sizeof(omx_to_profile_idc)/sizeof(omx_to_profile_idc0); - for (size_t i = 0; i < array_length; ++i) { - if (omx_to_profile_idci.omx_profile == profile_type) - return omx_to_profile_idci.profile_idc; - } - return 0; -} + { 0x1 /* OMX_VIDEO_HEVCProfileMain */, VLC_HEVC_PROFILE_MAIN }, + { 0x2 /* OMX_VIDEO_HEVCProfileMain10 */, VLC_HEVC_PROFILE_MAIN_10 }, + { 0x1000 /* OMX_VIDEO_HEVCProfileMain10HDR10 */, VLC_HEVC_PROFILE_MAIN_10 }, +}; -static const struct +static const struct omx_to_profile_idc mpeg2_omx_to_profile_idc = { - OMX_VIDEO_AVCLEVELTYPE omx_level; - size_t level_idc; -} omx_to_level_idc = -{ - { OMX_VIDEO_AVCLevel1, 10 }, - { OMX_VIDEO_AVCLevel1b, 9 }, - { OMX_VIDEO_AVCLevel11, 11 }, - { OMX_VIDEO_AVCLevel12, 12 }, - { OMX_VIDEO_AVCLevel13, 13 }, - { OMX_VIDEO_AVCLevel2, 20 }, - { OMX_VIDEO_AVCLevel21, 21 }, - { OMX_VIDEO_AVCLevel22, 22 }, - { OMX_VIDEO_AVCLevel3, 30 }, - { OMX_VIDEO_AVCLevel31, 31 }, - { OMX_VIDEO_AVCLevel32, 32 }, - { OMX_VIDEO_AVCLevel4, 40 }, - { OMX_VIDEO_AVCLevel41, 41 }, - { OMX_VIDEO_AVCLevel42, 42 }, - { OMX_VIDEO_AVCLevel5, 50 }, - { OMX_VIDEO_AVCLevel51, 51 }, + { OMX_VIDEO_MPEG2ProfileHigh, PROFILE_MPEG2_HIGH }, + { OMX_VIDEO_MPEG2ProfileSpatial, PROFILE_MPEG2_SPATIALLY_SCALABLE }, + { OMX_VIDEO_MPEG2ProfileSNR, PROFILE_MPEG2_SNR_SCALABLE }, + { OMX_VIDEO_MPEG2ProfileMain, PROFILE_MPEG2_MAIN }, + { OMX_VIDEO_MPEG2ProfileSimple, PROFILE_MPEG2_SIMPLE }, + { OMX_VIDEO_MPEG2Profile422, PROFILE_MPEG2_422 }, }; -size_t convert_omx_to_level_idc(OMX_VIDEO_AVCLEVELTYPE level_type) +int convert_omx_to_profile_idc(vlc_fourcc_t codec, int profile_type) { - size_t array_length = sizeof(omx_to_level_idc)/sizeof(omx_to_level_idc0); + const struct omx_to_profile_idc *omx_to_profile_idc = NULL; + size_t array_length; + switch (codec) + { + case VLC_CODEC_H264: + omx_to_profile_idc = avc_omx_to_profile_idc; + array_length = ARRAY_SIZE(avc_omx_to_profile_idc); + break; + case VLC_CODEC_HEVC: + omx_to_profile_idc = hevc_omx_to_profile_idc; + array_length = ARRAY_SIZE(hevc_omx_to_profile_idc); + break; + case VLC_CODEC_MPGV: + case VLC_CODEC_MP2V: + omx_to_profile_idc = mpeg2_omx_to_profile_idc; + array_length = ARRAY_SIZE(mpeg2_omx_to_profile_idc); + break; + default: + return 0; + } + for (size_t i = 0; i < array_length; ++i) { - if (omx_to_level_idci.omx_level == level_type) - return omx_to_level_idci.level_idc; + if (omx_to_profile_idci.omx_profile == profile_type) + return omx_to_profile_idci.profile_idc; } return 0; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/codec/videotoolbox/decoder.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/codec/videotoolbox/decoder.c
Changed
@@ -1236,11 +1236,11 @@ yuvmatrix = kCVImageBufferYCbCrMatrix_ITU_R_601_4; break; case COLOR_SPACE_BT2020: - yuvmatrix = kCVImageBufferColorPrimaries_ITU_R_2020; + yuvmatrix = kCVImageBufferYCbCrMatrix_ITU_R_2020; break; case COLOR_SPACE_BT709: default: - yuvmatrix = kCVImageBufferColorPrimaries_ITU_R_709_2; + yuvmatrix = kCVImageBufferYCbCrMatrix_ITU_R_709_2; break; } CFDictionarySetValue(decoderConfiguration, kCVImageBufferYCbCrMatrixKey,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/avformat/avformat.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/avformat/avformat.c
Changed
@@ -40,7 +40,7 @@ set_subcategory( SUBCAT_INPUT_DEMUX ) set_description( N_("Avformat demuxer" ) ) set_shortname( N_("Avformat") ) - set_capability( "demux", 2 ) + set_capability( "demux", 5 ) set_callbacks( avformat_OpenDemux, avformat_CloseDemux ) set_section( N_("Demuxer"), NULL ) add_string( "avformat-format", NULL, FORMAT_TEXT, FORMAT_LONGTEXT ) @@ -51,7 +51,7 @@ add_submodule () add_shortcut( "ffmpeg", "avformat" ) set_description( N_("Avformat muxer" ) ) - set_capability( "sout mux", 2 ) + set_capability( "sout mux", 5 ) set_section( N_("Muxer"), NULL ) add_string( "sout-avformat-mux", NULL, MUX_TEXT, MUX_LONGTEXT ) add_string( "sout-avformat-options", NULL, AV_OPTIONS_TEXT, AV_OPTIONS_LONGTEXT )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/avi/avi.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/avi/avi.c
Changed
@@ -121,9 +121,8 @@ typedef struct { - vlc_fourcc_t i_id; - uint32_t i_flags; uint64_t i_pos; + uint32_t i_flags; uint32_t i_length; uint64_t i_lengthtotal; @@ -145,8 +144,8 @@ bool b_activated; bool b_eof; - unsigned int i_rate; - unsigned int i_scale; + unsigned int i_rate; /* for audio & video */ + unsigned int i_scale;/* for audio & video */ unsigned int i_samplesize; struct bitmapinfoheader_properties bihprops; @@ -158,6 +157,9 @@ int i_dv_audio_rate; es_out_id_t *p_es_dv_audio; + /* SPU specific */ + vlc_tick_t i_last_embedded_endtime; + vlc_tick_t i_next_embedded_time; /* Avi Index */ avi_index_t idx; @@ -169,6 +171,17 @@ unsigned int i_blockno; unsigned int i_blocksize; + struct + { + bool b_ok; + + int64_t i_toread; + + int64_t i_posf; /* where we will read : + if i_idxposb == 0 : beginning of chunk (+8 to access data) + else : point on data directly */ + } demuxctx; + } avi_track_t; typedef struct @@ -224,6 +237,8 @@ static void AVI_IndexCreate ( demux_t * ); static void AVI_ExtractSubtitle( demux_t *, unsigned int i_stream, avi_chunk_list_t *, avi_chunk_STRING_t * ); +static avi_track_t * AVI_GetVideoTrackForXsub( demux_sys_t * ); +static int AVI_SeekSubtitleTrack( demux_sys_t *, avi_track_t * ); static void AVI_DvHandleAudio( demux_t *, avi_track_t *, block_t * ); @@ -267,6 +282,45 @@ } } +#define XSUB_HEADER_SIZE 0x1B +static int ExtractXsubSampleInfo( const uint8_t *p_buf, + vlc_tick_t *pi_start, vlc_tick_t *pi_end ) +{ + unsigned t8; + char bufferXSUB_HEADER_SIZE + 1; + memcpy( buffer, p_buf, XSUB_HEADER_SIZE ); + bufferXSUB_HEADER_SIZE = '\0'; + if( sscanf( buffer, "%u:%2u:%2u.%3u-%u:%2u:%2u.%3u", + &t0, &t1, &t2, &t3, &t4, &t5, &t6, &t7 ) != 8 ) + return VLC_EGENERIC; + *pi_start = vlc_tick_from_sec( t0 * 3600 + t1 * 60 + t2 ) + + VLC_TICK_FROM_MS(t3); + *pi_end = vlc_tick_from_sec( t4 * 3600 + t5 * 60 + t6 ) + + VLC_TICK_FROM_MS(t7); + return VLC_SUCCESS; +} + +static int AVI_PeekSample( stream_t *s, size_t i_skip, + const uint8_t **pp_peek, size_t i_peek ) +{ + ssize_t i_ret = vlc_stream_Peek( s, pp_peek, i_skip + i_peek ); + *pp_peek += i_skip; + if ( i_ret < 0 || (size_t) i_ret != i_skip + i_peek ) + return VLC_EGENERIC; + return VLC_SUCCESS; +} + +static vlc_tick_t AVI_GetXsubSampleTimeAt( stream_t *s, uint64_t pos ) +{ + const uint8_t *p_peek; + vlc_tick_t i_nzstart, i_nzend; + if( vlc_stream_Seek( s, pos ) != VLC_SUCCESS || + AVI_PeekSample( s, 8, &p_peek, XSUB_HEADER_SIZE ) || + ExtractXsubSampleInfo( p_peek, &i_nzstart, &i_nzend ) ) + return VLC_TICK_INVALID; + return VLC_TICK_0 + i_nzstart; +} + /***************************************************************************** * Close: frees unused data *****************************************************************************/ @@ -484,11 +538,6 @@ tk->i_samplesize = p_strh->i_samplesize; msg_Dbg( p_demux, "stream%u rate:%u scale:%u samplesize:%u", i, tk->i_rate, tk->i_scale, tk->i_samplesize ); - if( !tk->i_scale || !tk->i_rate || !(tk->i_rate * CLOCK_FREQ / tk->i_scale) ) - { - free( tk ); - continue; - } switch( p_strh->i_type ) { @@ -608,10 +657,12 @@ case( AVIFOURCC_vids ): { - if( p_vids->p_bih->biCompression == VLC_FOURCC( 'D', 'X', 'S', 'B' ) ) + if( p_vids->p_bih->biCompression == FOURCC_DXSB ) { msg_Dbg( p_demux, "stream%u subtitles", i ); es_format_Init( &tk->fmt, SPU_ES, p_vids->p_bih->biCompression ); + tk->fmt.subs.spu.i_original_frame_width = p_vids->p_bih->biWidth; + tk->fmt.subs.spu.i_original_frame_height = p_vids->p_bih->biHeight; break; } @@ -629,7 +680,7 @@ !strncasecmp( (char*)&p_strh->i_handler, "XVID", 4 ) ) { tk->fmt.i_codec = - tk->fmt.i_original_fourcc = VLC_FOURCC( 'X', 'V', 'I', 'D' ); + tk->fmt.i_original_fourcc = FOURCC_XVID; } if( IsQNAPCodec( p_vids->p_bih->biCompression ) ) @@ -693,6 +744,16 @@ free( tk ); continue; } + + if( tk->fmt.i_cat != SPU_ES && + (!tk->i_scale || !tk->i_rate || !(tk->i_rate * CLOCK_FREQ / tk->i_scale)) ) + { + msg_Warn( p_demux, "stream%u has invalid timescale", i ); + es_format_Clean(&tk->fmt); + free( tk ); + continue; + } + tk->fmt.i_id = i; if( p_strn && p_strn->p_str ) tk->fmt.psz_description = FromACP( p_strn->p_str ); @@ -850,7 +911,7 @@ *****************************************************************************/ static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk, - uint32_t i_header, uint32_t i_size ) + uint32_t i_header, uint32_t i_osize ) { /* skip header */ if( i_header ) @@ -862,7 +923,7 @@ } /* read size padded on word boundary */ - i_size = __EVEN(i_size); + uint32_t i_size = __EVEN(i_osize); if( i_size == 0 ) return block_Alloc(0); /* vlc_stream_Block can't read/alloc 0 sized */ @@ -871,6 +932,20 @@ if ( !p_frame ) return p_frame; + if( i_osize == i_size - 1 ) + p_frame->i_buffer--; + + if( tk->fmt.i_codec == FOURCC_DXSB && p_frame->i_buffer > XSUB_HEADER_SIZE ) + { + vlc_tick_t i_start, i_end; + if( !ExtractXsubSampleInfo( p_frame->p_buffer, &i_start, &i_end ) ) + { + p_frame->i_dts = p_frame->i_pts = VLC_TICK_0 + i_start; + if( i_end > i_start ) + p_frame->i_length = i_start - i_end; + } + } + if( tk->bihprops.i_stride > INT32_MAX - 3 ) { p_frame->i_buffer = 0; @@ -999,31 +1074,16 @@ ***************************************************************************** * Returns -1 in case of error, 0 in case of EOF, 1 otherwise *****************************************************************************/
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/avi/libavi.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/avi/libavi.h
Changed
@@ -364,6 +364,10 @@ /* *** codex stuff *** */ +/* DivX */ +#define FOURCC_DXSB VLC_FOURCC('D','X','S','B') /* xsub */ +#define FOURCC_XVID VLC_FOURCC('X','V','I','D') + /* DV */ #define FOURCC_dvsd VLC_FOURCC('d','v','s','d') #define FOURCC_dvhd VLC_FOURCC('d','v','h','d')
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/cdg.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/cdg.c
Changed
@@ -40,7 +40,7 @@ vlc_module_begin () set_description( N_("CDG demuxer") ) set_subcategory( SUBCAT_INPUT_DEMUX ) - set_capability( "demux", 3 ) + set_capability( "demux", 6 ) set_callback( Open ) add_shortcut( "cdg", "subtitle" ) vlc_module_end ()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mjpeg.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mjpeg.c
Changed
@@ -49,7 +49,7 @@ vlc_module_begin () set_shortname( "MJPEG") set_description( N_("M-JPEG camera demuxer") ) - set_capability( "demux", 5 ) + set_capability( "demux", 7 ) set_callback( Open ) set_subcategory( SUBCAT_INPUT_DEMUX ) add_float( "mjpeg-fps", 0.0, FPS_TEXT, FPS_LONGTEXT )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mp4/libmp4.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mp4/libmp4.c
Changed
@@ -281,6 +281,7 @@ { *pp_chain = p_box->p_next; p_box->p_next = NULL; + p_box->p_father = NULL; return p_box; } pp_chain = &p_box->p_next; @@ -3418,8 +3419,6 @@ /* now copy compressed data */ memcpy( p_box->data.p_cmvd->p_data, p_peek,i_read); - p_box->data.p_cmvd->b_compressed = 1; - #ifdef MP4_VERBOSE msg_Dbg( p_stream, "read box: \"cmvd\" compressed data size %d", p_box->data.p_cmvd->i_compressed_size ); @@ -3430,26 +3429,17 @@ static int MP4_ReadBox_cmov( stream_t *p_stream, MP4_Box_t *p_box ) { +#ifndef HAVE_ZLIB + msg_Dbg( p_stream, "read box: \"cmov\" zlib unsupported" ); + return 0; +#else + MP4_Box_t *p_dcom; MP4_Box_t *p_cmvd; -#ifdef HAVE_ZLIB stream_t *p_stream_memory; z_stream z_data; uint8_t *p_data; - int i_result; -#endif - - if( !( p_box->data.p_cmov = calloc(1, sizeof( MP4_Box_data_cmov_t ) ) ) ) - return 0; - - if( !p_box->p_father || - ( p_box->p_father->i_type != ATOM_moov && - p_box->p_father->i_type != ATOM_foov ) ) - { - msg_Warn( p_stream, "Read box: \"cmov\" box alone" ); - return 1; - } if( !MP4_ReadBoxContainer( p_stream, p_box ) ) { @@ -3471,11 +3461,6 @@ return 0; } -#ifndef HAVE_ZLIB - msg_Dbg( p_stream, "read box: \"cmov\" zlib unsupported" ); - return 0; - -#else /* decompress data */ /* allocate a new buffer */ if( !( p_data = malloc( p_cmvd->data.p_cmvd->i_uncompressed_size ) ) ) @@ -3498,10 +3483,10 @@ } /* uncompress */ - i_result = inflate( &z_data, Z_NO_FLUSH ); - if( i_result != Z_OK && i_result != Z_STREAM_END ) + if( inflate( &z_data, Z_FINISH ) != Z_STREAM_END ) { msg_Err( p_stream, "read box: \"cmov\" error while uncompressing" ); + inflateEnd( &z_data ); free( p_data ); return 0; } @@ -3511,7 +3496,6 @@ msg_Warn( p_stream, "read box: \"cmov\" uncompressing data size " "mismatch" ); } - p_cmvd->data.p_cmvd->i_uncompressed_size = z_data.total_out; /* close zlib */ if( inflateEnd( &z_data ) != Z_OK ) @@ -3520,28 +3504,30 @@ "data (ignored)" ); } - free( p_cmvd->data.p_cmvd->p_data ); - p_cmvd->data.p_cmvd->p_data = p_data; - p_cmvd->data.p_cmvd->b_compressed = 0; - msg_Dbg( p_stream, "read box: \"cmov\" box successfully uncompressed" ); /* now create a memory stream */ - p_stream_memory = - vlc_stream_MemoryNew( VLC_OBJECT(p_stream), - p_cmvd->data.p_cmvd->p_data, - p_cmvd->data.p_cmvd->i_uncompressed_size, true ); + p_stream_memory = vlc_stream_MemoryNew( VLC_OBJECT(p_stream), + p_data, z_data.total_out, false ); + if( !p_stream_memory ) + { + free( p_data ); + return 0; + } /* and read uncompressd moov */ - p_box->data.p_cmov->p_moov = MP4_ReadBox( p_stream_memory, NULL ); + MP4_Box_t *p_moov = MP4_ReadBox( p_stream_memory, NULL ); vlc_stream_Delete( p_stream_memory ); + if( p_moov ) + MP4_BoxAddChild( p_box, p_moov ); + #ifdef MP4_VERBOSE msg_Dbg( p_stream, "read box: \"cmov\" compressed movie header completed"); #endif - return p_box->data.p_cmov->p_moov ? 1 : 0; + return p_moov ? 1 : 0; #endif /* HAVE_ZLIB */ } @@ -4938,7 +4924,6 @@ { /* Containers */ { ATOM_moov, MP4_ReadBoxContainer, 0 }, - { ATOM_foov, MP4_ReadBoxContainer, 0 }, { ATOM_trak, MP4_ReadBoxContainer, ATOM_moov }, { ATOM_trak, MP4_ReadBoxContainer, ATOM_foov }, { ATOM_mdia, MP4_ReadBoxContainer, ATOM_trak }, @@ -4970,10 +4955,16 @@ { ATOM_mvex, MP4_ReadBoxContainer, ATOM_moov }, { ATOM_mvex, MP4_ReadBoxContainer, ATOM_ftyp }, + /* Quicktime compression */ + { ATOM_foov, MP4_ReadBoxContainer, 0 }, + { ATOM_cmov, MP4_ReadBox_cmov, ATOM_foov }, + { ATOM_cmov, MP4_ReadBox_cmov, ATOM_moov }, + { ATOM_dcom, MP4_ReadBox_dcom, ATOM_cmov }, + { ATOM_cmvd, MP4_ReadBox_cmvd, ATOM_cmov }, + /* specific box */ { ATOM_ftyp, MP4_ReadBox_ftyp, 0 }, { ATOM_styp, MP4_ReadBox_ftyp, 0 }, - { ATOM_cmov, MP4_ReadBox_cmov, 0 }, { ATOM_mvhd, MP4_ReadBox_mvhd, ATOM_moov }, { ATOM_mvhd, MP4_ReadBox_mvhd, ATOM_foov }, { ATOM_tkhd, MP4_ReadBox_tkhd, ATOM_trak }, @@ -5007,9 +4998,7 @@ { ATOM_esds, MP4_ReadBox_esds, ATOM_mp4a }, { ATOM_esds, MP4_ReadBox_esds, ATOM_mp4v }, { ATOM_esds, MP4_ReadBox_esds, ATOM_mp4s }, - { ATOM_dcom, MP4_ReadBox_dcom, 0 }, { ATOM_dfLa, MP4_ReadBox_Binary, ATOM_fLaC }, - { ATOM_cmvd, MP4_ReadBox_cmvd, 0 }, { ATOM_av1C, MP4_ReadBox_av1C, ATOM_av01 }, { ATOM_avcC, MP4_ReadBox_avcC, ATOM_avc1 }, { ATOM_avcC, MP4_ReadBox_avcC, ATOM_avc3 }, @@ -5492,29 +5481,19 @@ goto error; } - MP4_Box_t *p_moov; MP4_Box_t *p_cmov; - /* check if there is a cmov, if so replace compressed moov by uncompressed one */ - if( ( ( p_moov = MP4_BoxGet( p_vroot, "moov" ) ) && - ( p_cmov = MP4_BoxGet( p_vroot, "moov/cmov" ) ) ) || - ( ( p_moov = MP4_BoxGet( p_vroot, "foov" ) ) && - ( p_cmov = MP4_BoxGet( p_vroot, "foov/cmov" ) ) ) ) + if( ( p_cmov = MP4_BoxGet( p_vroot, "moov/cmov" ) ) || + ( p_cmov = MP4_BoxGet( p_vroot, "foov/cmov" ) ) ) { - /* rename the compressed moov as a box to skip */ - p_moov->i_type = ATOM_skip; - + MP4_Box_t *p_moov = MP4_BoxExtract( &p_vroot->p_first, p_cmov->p_father->i_type ); /* get uncompressed p_moov */ - p_moov = p_cmov->data.p_cmov->p_moov; - p_cmov->data.p_cmov->p_moov = NULL; - + MP4_Box_t *p_umoov = MP4_BoxExtract( &p_cmov->p_first, ATOM_moov ); /* make p_root father of this new moov */ - p_moov->p_father = p_vroot; - - /* insert this new moov box as first child of p_root */ - p_moov->p_next = p_vroot->p_first; - p_vroot->p_first = p_moov; + MP4_BoxAddChild( p_vroot, p_umoov ); + /* Release old moov and compressed info */ + MP4_BoxFree( p_moov ); } return p_vroot;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mp4/libmp4.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mp4/libmp4.h
Changed
@@ -1077,18 +1077,10 @@ { uint32_t i_uncompressed_size; uint32_t i_compressed_size; - - int b_compressed; /* Set to 1 if compressed data, 0 if uncompressed */ uint8_t *p_data; } MP4_Box_data_cmvd_t; -typedef struct MP4_Box_data_cmov_s -{ - struct MP4_Box_s *p_moov; /* uncompressed moov */ - -} MP4_Box_data_cmov_t; - typedef struct { uint32_t i_type; @@ -1819,7 +1811,6 @@ MP4_Box_data_dcom_t *p_dcom; MP4_Box_data_cmvd_t *p_cmvd; - MP4_Box_data_cmov_t *p_cmov; MP4_Box_data_moviehintinformation_rtp_t *p_moviehintinformation_rtp;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mp4/mp4.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mp4/mp4.c
Changed
@@ -1854,7 +1854,8 @@ } } - msg_Dbg( p_demux, "seeking with %"PRId64 "ms %s to %ld", MS_FROM_VLC_TICK(i_date - i_start), + msg_Dbg( p_demux, "seeking with %"PRId64 "ms %s to %"PRId64, + MS_FROM_VLC_TICK(i_date - i_start), !b_accurate ? "alignment" : "preroll (use input-fast-seek to avoid)", i_date ); for( i_track = 0; i_track < p_sys->i_tracks; i_track++ )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mpeg/es.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mpeg/es.c
Changed
@@ -71,7 +71,7 @@ add_submodule() set_description( N_("MPEG-4 video" ) ) - set_capability( "demux", 5 ) + set_capability( "demux", 7 ) set_callbacks( OpenVideo, Close ) add_float( "es-fps", 25, FPS_TEXT, FPS_LONGTEXT )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mpeg/h26x.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mpeg/h26x.c
Changed
@@ -50,7 +50,7 @@ set_shortname( "H264") set_subcategory( SUBCAT_INPUT_DEMUX ) set_description( N_("H264 video demuxer" ) ) - set_capability( "demux", 6 ) + set_capability( "demux", 8 ) set_section( N_("H264 video demuxer" ), NULL ) add_float( "h264-fps", 0.0, FPS_TEXT, FPS_LONGTEXT ) set_callbacks( OpenH264, Close ) @@ -61,7 +61,7 @@ set_shortname( "HEVC") set_subcategory( SUBCAT_INPUT_DEMUX ) set_description( N_("HEVC/H.265 video demuxer" ) ) - set_capability( "demux", 6 ) + set_capability( "demux", 8 ) set_section( N_("HEVC/H.265 video demuxer" ), NULL ) add_float( "hevc-fps", 0.0, FPS_TEXT, FPS_LONGTEXT ) set_callbacks( OpenHEVC, Close )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mpeg/mpgv.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mpeg/mpgv.c
Changed
@@ -42,7 +42,7 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_DEMUX ) set_description( N_("MPEG-I/II video demuxer" ) ) - set_capability( "demux", 5 ) + set_capability( "demux", 7 ) set_callbacks( Open, Close ) add_shortcut( "mpgv" ) vlc_module_end ()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/mpeg/ps.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/mpeg/ps.c
Changed
@@ -71,7 +71,7 @@ add_submodule () set_description( N_("MPEG-PS demuxer") ) - set_capability( "demux", 8 ) + set_capability( "demux", 9 ) set_callbacks( Open, Close ) add_shortcut( "ps" ) vlc_module_end ()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/stl.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/stl.c
Changed
@@ -41,7 +41,7 @@ vlc_module_begin() set_description(N_("EBU STL subtitles parser")) set_subcategory(SUBCAT_INPUT_DEMUX) - set_capability("demux", 1) + set_capability("demux", 4) set_callbacks(Open, Close) add_shortcut("stl", "subtitle") vlc_module_end()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/subtitle.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/subtitle.c
Changed
@@ -1028,8 +1028,8 @@ } /* */ - p_subtitle->i_start = i_start * p_props->i_microsecperframe; - p_subtitle->i_stop = i_stop >= 0 ? (i_stop * p_props->i_microsecperframe) : -1; + p_subtitle->i_start = VLC_TICK_0 + i_start * p_props->i_microsecperframe; + p_subtitle->i_stop = i_stop >= 0 ? (VLC_TICK_0 + i_stop * p_props->i_microsecperframe) : -1; p_subtitle->psz_text = psz_text; return VLC_SUCCESS; } @@ -1185,10 +1185,10 @@ &h1, &m1, &s1, &d1, &h2, &m2, &s2, &d2) == 8 ) { p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1) + - VLC_TICK_FROM_MS( d1 ); + VLC_TICK_FROM_MS( d1 ) + VLC_TICK_0; p_subtitle->i_stop = vlc_tick_from_sec( h2 * 3600 + m2 * 60 + s2 ) + - VLC_TICK_FROM_MS( d2 ); + VLC_TICK_FROM_MS( d2 ) + VLC_TICK_0; return VLC_SUCCESS; } return VLC_EGENERIC; @@ -1287,9 +1287,9 @@ } p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ) + - VLC_TICK_FROM_MS( c1 * 10 ); + VLC_TICK_FROM_MS( c1 * 10 ) + VLC_TICK_0; p_subtitle->i_stop = vlc_tick_from_sec( h2 * 3600 + m2 * 60 + s2 ) + - VLC_TICK_FROM_MS( c2 * 10 ); + VLC_TICK_FROM_MS( c2 * 10 ) + VLC_TICK_0; p_subtitle->psz_text = psz_text; return VLC_SUCCESS; } @@ -1338,7 +1338,7 @@ if( sscanf( s, "%d:%d:%d%*c%^\r\n", &h1, &m1, &s1, psz_text ) == 4 ) { - p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); + p_subtitle->i_start = VLC_TICK_0 + vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); p_subtitle->i_stop = -1; break; } @@ -1455,7 +1455,7 @@ } } - p_subtitle->i_start = VLC_TICK_FROM_MS(i_start); + p_subtitle->i_start = VLC_TICK_0 + VLC_TICK_FROM_MS(i_start); p_subtitle->i_stop = -1; p_subtitle->psz_text = strdup( text ); @@ -1500,7 +1500,7 @@ &h1, &m1, &s1, &c1 ) == 4 ) { p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ) + - VLC_TICK_FROM_MS( c1 * 10 ); + VLC_TICK_FROM_MS( c1 * 10 ) + VLC_TICK_0; p_subtitle->i_stop = -1; break; } @@ -1570,8 +1570,8 @@ if( sscanf( s, "%d %^\r\n", &i_start, psz_text ) == 2 || sscanf( s, "%d%d %^\r\n", &i_start, &i_stop, psz_text ) == 3) { - p_subtitle->i_start = VLC_TICK_FROM_MS(i_start * 100); - p_subtitle->i_stop = i_stop >= 0 ? VLC_TICK_FROM_MS(i_stop * 100) : -1; + p_subtitle->i_start = VLC_TICK_0 + VLC_TICK_FROM_MS(i_start * 100); + p_subtitle->i_stop = i_stop >= 0 ? VLC_TICK_0 + VLC_TICK_FROM_MS(i_stop * 100) : -1; break; } free( psz_text ); @@ -1621,13 +1621,13 @@ /* Starting of a subtitle */ if( i_firstline ) { - p_subtitle->i_start = t * p_props->i_microsecperframe; + p_subtitle->i_start = VLC_TICK_0 + t * p_props->i_microsecperframe; i_firstline = 0; } /* We have been too far: end of the subtitle, begin of next */ else { - p_subtitle->i_stop = t * p_props->i_microsecperframe; + p_subtitle->i_stop = VLC_TICK_0 + t * p_props->i_microsecperframe; break; } } @@ -1674,8 +1674,8 @@ if( sscanf (s, "%d,%d,\"%^\n\r", &t1, &t2, psz_text ) == 3 ) { /* 1/10th of second ? Frame based ? FIXME */ - p_subtitle->i_start = 10 * t1; - p_subtitle->i_stop = 10 * t2; + p_subtitle->i_start = VLC_TICK_0 + 10 * t1; + p_subtitle->i_stop = VLC_TICK_0 + 10 * t2; /* Remove latest " */ psz_text strlen(psz_text) - 1 = '\0'; @@ -1758,9 +1758,9 @@ { float f2 = vlc_strtof_c( psz_temp, NULL ); p_props->mpsub.f_total += f1 * p_props->mpsub.i_factor; - p_subtitle->i_start = llroundf(10000.f * p_props->mpsub.f_total); + p_subtitle->i_start = VLC_TICK_0 + llroundf(10000.f * p_props->mpsub.f_total); p_props->mpsub.f_total += f2 * p_props->mpsub.i_factor; - p_subtitle->i_stop = llroundf(10000.f * p_props->mpsub.f_total); + p_subtitle->i_stop = VLC_TICK_0 + llroundf(10000.f * p_props->mpsub.f_total); break; } } @@ -1827,18 +1827,18 @@ if( sscanf( s, "%d:%d:%d.%d %d:%d:%d.%d %^\n\r", &h1, &m1, &s1, &f1, &h2, &m2, &s2, &f2, psz_text ) == 9 ) { - p_subtitle->i_start = vlc_tick_from_sec( ( h1 *3600 + m1 * 60 + s1 ) + + p_subtitle->i_start = VLC_TICK_0 + vlc_tick_from_sec( ( h1 *3600 + m1 * 60 + s1 ) + (int64_t)( ( f1 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution ) ); - p_subtitle->i_stop = vlc_tick_from_sec( ( h2 *3600 + m2 * 60 + s2 ) + + p_subtitle->i_stop = VLC_TICK_0 + vlc_tick_from_sec( ( h2 *3600 + m2 * 60 + s2 ) + (int64_t)( ( f2 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution ) ); break; } /* Short time lines */ else if( sscanf( s, "@%d @%d %^\n\r", &f1, &f2, psz_text ) == 3 ) { - p_subtitle->i_start = + p_subtitle->i_start = VLC_TICK_0 + vlc_tick_from_sec( (f1 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution ); - p_subtitle->i_stop = + p_subtitle->i_stop = VLC_TICK_0 + vlc_tick_from_sec( (f2 + p_props->jss.i_time_shift ) / p_props->jss.i_time_resolution ); break; } @@ -2064,8 +2064,8 @@ if( sscanf( s, "{%d:%d:%d}{%d:%d:%d}%^\r\n", &h1, &m1, &s1, &h2, &m2, &s2, psz_text ) == 7 ) { - p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); - p_subtitle->i_stop = vlc_tick_from_sec( h2 * 3600 + m2 * 60 + s2 ); + p_subtitle->i_start = VLC_TICK_0 + vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); + p_subtitle->i_stop = VLC_TICK_0 + vlc_tick_from_sec( h2 * 3600 + m2 * 60 + s2 ); break; } free( psz_text ); @@ -2139,10 +2139,10 @@ /* Get the times */ int64_t i_time = ParseRealTime( psz_begin, &h1, &m1, &s1, &f1 ); - p_subtitle->i_start = i_time >= 0 ? i_time : 0; + p_subtitle->i_start = VLC_TICK_0 + (i_time >= 0 ? i_time : 0); i_time = ParseRealTime( psz_end, &h2, &m2, &s2, &f2 ); - p_subtitle->i_stop = i_time >= 0 ? i_time : -1; + p_subtitle->i_stop = VLC_TICK_0 + (i_time >= 0 ? i_time : -1); break; } } @@ -2211,7 +2211,7 @@ if( sscanf( s, "%d:%d:%d%^\r\n", &h1, &m1, &s1, psz_text ) == 4 ) { - p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); + p_subtitle->i_start = VLC_TICK_0 + vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); s = TextGetLine( txt ); if( !s ) @@ -2260,7 +2260,7 @@ if( sscanf( s, "%d:%d:%d", &h1, &m1, &s1 ) == 3 ) { - p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); + p_subtitle->i_start = VLC_TICK_0 + vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ); s = TextGetLine( txt ); if( !s ) @@ -2313,10 +2313,10 @@ &h2, &m2, &s2, &d2 ) == 8 ) { p_subtitle->i_start = vlc_tick_from_sec( h1 * 3600 + m1 * 60 + s1 ) + - VLC_TICK_FROM_MS( d1 ); + VLC_TICK_FROM_MS( d1 ) + VLC_TICK_0; p_subtitle->i_stop = vlc_tick_from_sec( h2 * 3600 + m2 * 60 + s2 ) + - VLC_TICK_FROM_MS( d2 ); + VLC_TICK_FROM_MS( d2 ) + VLC_TICK_0; if( p_subtitle->i_start < p_subtitle->i_stop ) break; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/ty.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/ty.c
Changed
@@ -62,7 +62,7 @@ set_shortname( N_("TY") ) set_description(N_("TY Stream audio/video demux")) set_subcategory( SUBCAT_INPUT_DEMUX ) - set_capability("demux", 6) + set_capability("demux", 8) /* FIXME: there seems to be a segfault when using PVR access * and TY demux has a bigger priority than PS * Something must be wrong.
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/vobsub.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/vobsub.c
Changed
@@ -49,7 +49,7 @@ vlc_module_begin () set_description( N_("Vobsub subtitles parser") ) set_subcategory( SUBCAT_INPUT_DEMUX ) - set_capability( "demux", 1 ) + set_capability( "demux", 4 ) set_callbacks( Open, Close )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/demux/ytdl.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/demux/ytdl.c
Changed
@@ -437,7 +437,7 @@ set_shortname("YT-DL") set_description("YT-DL extractor") set_subcategory(SUBCAT_INPUT_STREAM_FILTER) - set_capability("demux", 5) + set_capability("demux", 7) set_callbacks(OpenFilter, Close) add_bool("ytdl", true, N_("Enable YT-DL"), NULL) change_safe()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/Makefile.am -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/Makefile.am
Changed
@@ -129,12 +129,16 @@ gui/macosx/library/VLCLibraryTableCellView.h \ gui/macosx/library/VLCLibraryTableCellView.m \ gui/macosx/library/VLCLibraryTableCellViewProtocol.h \ + gui/macosx/library/VLCLibraryTwoPaneSplitViewDelegate.h \ + gui/macosx/library/VLCLibraryTwoPaneSplitViewDelegate.m \ gui/macosx/library/VLCLibraryUIUnits.h \ gui/macosx/library/VLCLibraryUIUnits.m \ gui/macosx/library/VLCLibraryWindow.h \ gui/macosx/library/VLCLibraryWindow.m \ gui/macosx/library/VLCLibraryWindowController.h \ gui/macosx/library/VLCLibraryWindowController.m \ + gui/macosx/library/VLCLibraryWindowPersistentPreferences.h \ + gui/macosx/library/VLCLibraryWindowPersistentPreferences.m \ gui/macosx/library/video-library/VLCLibraryVideoViewController.h \ gui/macosx/library/video-library/VLCLibraryVideoViewController.m \ gui/macosx/library/video-library/VLCLibraryVideoCollectionViewsStackViewController.h \ @@ -348,6 +352,8 @@ gui/macosx/windows/logging/VLCLogWindowController.m \ gui/macosx/windows/mainwindow/VLCControlsBarCommon.h \ gui/macosx/windows/mainwindow/VLCControlsBarCommon.m \ + gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.h \ + gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.m \ gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h \ gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m \ gui/macosx/windows/video/VLCAspectRatioRetainingVideoWindow.h \
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/UI/VLCLibraryWindow.xib -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/UI/VLCLibraryWindow.xib
Changed
@@ -368,28 +368,10 @@ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="d0e-29-yNq" userLabel="Song Name" customClass="VLCWrappableTextField"> <rect key="frame" x="-2" y="0.0" width="78" height="16"/> <constraints> + <constraint firstAttribute="height" constant="16" id="aQy-pz-H7F"/> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="60" id="uah-Xv-MK9"/> </constraints> - <textFieldCell key="cell" lineBreakMode="truncatingTail" alignment="right" title="Song Name" id="o4l-8l-eNX"> - <font key="font" metaFont="systemBold"/> - <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> - <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="XbZ-eQ-zmA"> - <rect key="frame" x="76" y="0.0" width="14" height="16"/> - <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="·" id="iAI-Pb-eVu"> - <font key="font" metaFont="systemBlack" size="13"/> - <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> - <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="0jI-HH-uWa" userLabel="Artist Name" customClass="VLCWrappableTextField"> - <rect key="frame" x="90" y="0.0" width="76" height="16"/> - <constraints> - <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="60" id="dVn-o0-6hg"/> - </constraints> - <textFieldCell key="cell" lineBreakMode="truncatingTail" alignment="left" title="Artist Name" id="n8Z-ER-5JE"> + <textFieldCell key="cell" lineBreakMode="truncatingTail" alignment="right" title="Song Name · Artist Name" id="o4l-8l-eNX"> <font key="font" metaFont="system"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> @@ -401,13 +383,9 @@ </constraints> <visibilityPriorities> <integer value="1000"/> - <integer value="1000"/> - <integer value="1000"/> </visibilityPriorities> <customSpacing> <real value="3.4028234663852886e+38"/> - <real value="3.4028234663852886e+38"/> - <real value="3.4028234663852886e+38"/> </customSpacing> </stackView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zOB-QJ-TUy" customClass="VLCTimeField"> @@ -468,7 +446,7 @@ <constraint firstItem="5o7-Z0-dqS" firstAttribute="centerY" secondItem="Ktr-qT-1fr" secondAttribute="centerY" id="6rb-4H-ISj"/> <constraint firstItem="zOB-QJ-TUy" firstAttribute="centerY" secondItem="9Hg-t2-K5z" secondAttribute="centerY" id="Egp-c6-x6Y"/> <constraint firstItem="oGd-mG-cFw" firstAttribute="centerY" secondItem="9Hg-t2-K5z" secondAttribute="centerY" id="Gzr-dU-oMG"/> - <constraint firstItem="jlv-jC-dQB" firstAttribute="bottom" secondItem="9Hg-t2-K5z" secondAttribute="top" constant="-8" id="HiH-c5-MZq"/> + <constraint firstItem="9Hg-t2-K5z" firstAttribute="top" secondItem="jlv-jC-dQB" secondAttribute="bottom" constant="8" id="HiH-c5-MZq"/> <constraint firstAttribute="bottom" secondItem="5o7-Z0-dqS" secondAttribute="bottom" id="Hui-Gh-xyv"/> <constraint firstItem="jlv-jC-dQB" firstAttribute="top" secondItem="Ktr-qT-1fr" secondAttribute="top" id="ORY-q8-DFB"/> <constraint firstItem="5o7-Z0-dqS" firstAttribute="top" secondItem="Ktr-qT-1fr" secondAttribute="top" id="Qmp-zE-IXn"/> @@ -670,6 +648,9 @@ <action selector="segmentedControlAction:" target="QvC-M9-y7g" id="seg-Me-t1n"/> </connections> </segmentedControl> + <connections> + <action selector="segmentedTitleControlAction:" target="QvC-M9-y7g" id="YUg-2w-bwP"/> + </connections> </toolbarItem> <toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="89f-AL-zuU"/> <toolbarItem implicitItemIdentifier="85037E27-D263-490C-B4B2-0EFE5B5837AA" label="Library View Type" paletteLabel="Library View Type" sizingBehavior="auto" id="kBa-MC-Mdq"> @@ -685,6 +666,9 @@ </segments> </segmentedCell> </segmentedControl> + <connections> + <action selector="gridVsListSegmentedControlAction:" target="QvC-M9-y7g" id="HMA-eG-oej"/> + </connections> </toolbarItem> <searchToolbarItem implicitItemIdentifier="A132890F-6B3D-4523-A71B-B00F095057C4" label="Search" paletteLabel="Search" visibilityPriority="1001" id="dv4-Il-y8X"> <nil key="toolTip"/> @@ -782,6 +766,8 @@ <outlet property="mediaSourceCollectionViewScrollView" destination="cFG-c9-cI9" id="QQq-Ql-uQ7"/> <outlet property="mediaSourceHomeButton" destination="jfA-Vr-sQc" id="oLM-NF-rqe"/> <outlet property="mediaSourcePathControl" destination="Rjk-Q6-FYy" id="G63-NM-Ekn"/> + <outlet property="mediaSourcePathControlCollectionViewScrollViewBottomConstraint" destination="Lji-yk-wiI" id="BxP-JG-rlP"/> + <outlet property="mediaSourcePathControlTableViewScrollViewBottomConstraint" destination="Xao-NR-Utd" id="GYG-ye-2Rq"/> <outlet property="mediaSourceTableView" destination="vpJ-Oz-Ebz" id="Hbo-Qw-JQd"/> <outlet property="mediaSourceTableViewScrollView" destination="7WD-fy-WtJ" id="8As-1W-Af8"/> <outlet property="mediaSourceView" destination="eHd-Q9-F8D" id="gfU-Jp-eFr"/> @@ -819,8 +805,6 @@ </window> <customObject id="Uzf-Tf-H8x" userLabel="Detached Window Controls Bar" customClass="VLCMainWindowControlsBar"> <connections> - <outlet property="artistNameTextField" destination="0jI-HH-uWa" id="ftC-MD-ymJ"/> - <outlet property="artistNameTextFieldWidthConstraint" destination="dVn-o0-6hg" id="f7h-af-ae8"/> <outlet property="artworkButton" destination="15t-2s-22l" id="aR1-bU-1to"/> <outlet property="artworkImageView" destination="5o7-Z0-dqS" id="Pns-yT-lKx"/> <outlet property="backwardButton" destination="jGc-Xw-GYI" id="0AG-44-SN3"/> @@ -830,10 +814,9 @@ <outlet property="fullscreenButton" destination="dwM-Uz-pAw" id="gXA-WS-Gig"/> <outlet property="muteVolumeButton" destination="IAy-58-UPp" id="dDN-pE-Vmj"/> <outlet property="playButton" destination="WgO-zh-k4s" id="0yC-Yh-H4V"/> + <outlet property="playingItemDisplayField" destination="d0e-29-yNq" id="QUe-1S-TQO"/> <outlet property="repeatButton" destination="t4r-bt-Jxm" id="U7s-Tb-Ado"/> <outlet property="shuffleButton" destination="SYG-jf-oHJ" id="b4m-v0-sC9"/> - <outlet property="songArtistSeparatorTextField" destination="XbZ-eQ-zmA" id="lh8-I7-g90"/> - <outlet property="songNameTextField" destination="d0e-29-yNq" id="JTI-XG-miC"/> <outlet property="timeField" destination="zOB-QJ-TUy" id="mJL-1V-2lQ"/> <outlet property="timeSlider" destination="9Hg-t2-K5z" id="sVe-s8-xW6"/> <outlet property="trailingTimeField" destination="oGd-mG-cFw" id="geo-iq-0th"/>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/UI/VLCMainVideoView.xib -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/UI/VLCMainVideoView.xib
Changed
@@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <dependencies> <deployment version="101000" identifier="macosx"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/> <capability name="Image references" minToolsVersion="12.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -28,19 +28,20 @@ </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> - <customObject id="3" userLabel="Main Video View Controls Bar" customClass="VLCControlsBarCommon"> + <customObject id="3" userLabel="Main Video View Controls Bar" customClass="VLCMainVideoViewControlsBar"> <connections> + <outlet property="audioButton" destination="cja-ZG-8LF" id="96C-CC-iV7"/> <outlet property="backwardButton" destination="V9d-hX-iyg" id="ZFn-jn-7OB"/> + <outlet property="bookmarksButton" destination="4tZ-52-1q9" id="dAN-YB-YZ5"/> <outlet property="forwardButton" destination="sF5-Z0-bef" id="H6w-Le-NAK"/> <outlet property="fullscreenButton" destination="dYZ-ri-Kra" id="Cw2-BS-QG9"/> <outlet property="fullscreenButtonWidthConstraint" destination="quS-fD-Od7" id="6hT-nR-yQI"/> - <outlet property="muteVolumeButton" destination="tVB-Xs-sJJ" id="snj-OU-aTI"/> <outlet property="playButton" destination="PCC-8a-sVF" id="ddT-ZM-Jhz"/> - <outlet property="songNameTextField" destination="lEW-MN-FFU" id="btX-L9-7TO"/> + <outlet property="playingItemDisplayField" destination="lEW-MN-FFU" id="hKa-df-8UB"/> + <outlet property="subtitlesButton" destination="YTl-LZ-WDe" id="893-XB-eDY"/> <outlet property="timeField" destination="3ri-8b-8mw" id="f0i-Gh-R8V"/> <outlet property="timeSlider" destination="qNZ-Fh-W8i" id="Fkk-fj-s5Q"/> <outlet property="trailingTimeField" destination="f4v-2z-dQ1" id="AXX-AU-lF0"/> - <outlet property="volumeSlider" destination="lyY-Zo-4aH" id="HbX-7f-pNR"/> </connections> </customObject> <customView id="WRu-Ic-lQK"> @@ -80,7 +81,7 @@ </textFieldCell> </textField> <textField wantsLayer="YES" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="lEW-MN-FFU" customClass="VLCWrappableTextField"> - <rect key="frame" x="18" y="59" width="495" height="28"/> + <rect key="frame" x="18" y="59" width="394" height="28"/> <textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" placeholderString="Nothing Playing" usesSingleLineMode="YES" id="8l0-zS-fOa"> <font key="font" metaFont="systemBold" size="24"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> @@ -97,34 +98,111 @@ <action selector="timeSliderAction:" target="3" id="W32-wA-rN9"/> </connections> </slider> - <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="20" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sJu-ZK-5QH"> - <rect key="frame" x="531" y="59" width="169" height="32"/> + <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="10" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sJu-ZK-5QH"> + <rect key="frame" x="430" y="59" width="270" height="32"/> <subviews> <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Y8F-hr-iaW"> - <rect key="frame" x="0.0" y="0.0" width="117" height="32"/> + <rect key="frame" x="0.0" y="0.0" width="143" height="32"/> <subviews> - <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tVB-Xs-sJJ" customClass="VLCImageButton"> + <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cja-ZG-8LF" customClass="VLCImageButton"> <rect key="frame" x="0.0" y="-1" width="32" height="33"/> <constraints> - <constraint firstAttribute="width" constant="32" id="PGL-rL-Qcp"/> - <constraint firstAttribute="width" secondItem="tVB-Xs-sJJ" secondAttribute="height" multiplier="1:1" id="qTO-ie-xwE"/> + <constraint firstAttribute="width" secondItem="cja-ZG-8LF" secondAttribute="height" multiplier="1:1" id="Hc7-cx-AiL"/> + <constraint firstAttribute="width" constant="32" id="NiS-Cd-FWu"/> </constraints> - <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="volume.3.fill" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="skE-5H-zgX"> + <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="waveform.circle" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="5em-Cm-yoF"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> - <action selector="volumeAction:" target="3" id="4W0-Ft-7pO"/> + <action selector="openAudioMenu:" target="3" id="hHT-Oc-wgF"/> </connections> </button> - <slider verticalHuggingPriority="750" horizontalCompressionResistancePriority="800" translatesAutoresizingMaskIntoConstraints="NO" id="lyY-Zo-4aH" customClass="VLCVolumeSlider"> + <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YTl-LZ-WDe" customClass="VLCImageButton"> + <rect key="frame" x="37" y="-1" width="32" height="33"/> + <constraints> + <constraint firstAttribute="width" constant="32" id="lX6-ad-1gX"/> + <constraint firstAttribute="width" secondItem="YTl-LZ-WDe" secondAttribute="height" multiplier="1:1" id="vzf-FG-VLf"/> + </constraints> + <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="text.bubble" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="1qF-LY-LkO"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="openSubtitlesMenu:" target="3" id="X6e-aG-mVF"/> + </connections> + </button> + <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4tZ-52-1q9" customClass="VLCImageButton"> + <rect key="frame" x="74" y="-1" width="32" height="33"/> + <constraints> + <constraint firstAttribute="width" constant="32" id="oY2-hp-RHB"/> + <constraint firstAttribute="width" secondItem="4tZ-52-1q9" secondAttribute="height" multiplier="1:1" id="pSW-vN-Ly5"/> + </constraints> + <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="bookmark.circle" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="bGc-fn-jgQ"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="openBookmarks:" target="3" id="o6m-9M-L4U"/> + </connections> + </button> + <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dYZ-ri-Kra" customClass="VLCImageButton"> + <rect key="frame" x="111" y="-1" width="32" height="33"/> + <constraints> + <constraint firstAttribute="width" secondItem="dYZ-ri-Kra" secondAttribute="height" multiplier="1:1" id="cHQ-Fu-L8k"/> + <constraint firstAttribute="width" constant="32" id="quS-fD-Od7"/> + </constraints> + <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="arrow.up.left.and.arrow.down.right" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="Z8g-js-0W6"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="fullscreen:" target="3" id="0Kk-UV-WtF"/> + </connections> + </button> + </subviews> + <constraints> + <constraint firstItem="YTl-LZ-WDe" firstAttribute="width" secondItem="YTl-LZ-WDe" secondAttribute="height" multiplier="1:1" id="2QI-lH-hlk"/> + <constraint firstItem="4tZ-52-1q9" firstAttribute="width" secondItem="4tZ-52-1q9" secondAttribute="height" multiplier="1:1" id="UdU-aK-B0s"/> + </constraints> + <visibilityPriorities> + <integer value="1000"/> + <integer value="1000"/> + <integer value="1000"/> + <integer value="1000"/> + </visibilityPriorities> + <customSpacing> + <real value="3.4028234663852886e+38"/> + <real value="3.4028234663852886e+38"/> + <real value="3.4028234663852886e+38"/> + <real value="3.4028234663852886e+38"/> + </customSpacing> + </stackView> + <stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zyp-45-IgR"> + <rect key="frame" x="153" y="0.0" width="117" height="32"/> + <subviews> + <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="afi-4d-rQk" customClass="VLCImageButton"> + <rect key="frame" x="0.0" y="-1" width="32" height="33"/> + <constraints> + <constraint firstAttribute="width" secondItem="afi-4d-rQk" secondAttribute="height" multiplier="1:1" id="2lo-OW-sv9"/> + <constraint firstAttribute="width" constant="32" id="PWI-LB-n9j"/> + </constraints> + <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="volume.3.fill" catalog="system" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="POe-ne-XtP"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="volumeAction:" target="3" id="GOu-6c-pg9"/> + </connections> + </button> + <slider verticalHuggingPriority="750" horizontalCompressionResistancePriority="800" translatesAutoresizingMaskIntoConstraints="NO" id="fKc-2d-Uu6" customClass="VLCVolumeSlider"> <rect key="frame" x="35" y="8" width="84" height="17"/> <constraints> - <constraint firstAttribute="width" constant="80" id="SeC-cP-5Dr"/> + <constraint firstAttribute="width" constant="80" id="cWg-Fr-x0Z"/> </constraints> - <sliderCell key="cell" controlSize="mini" continuous="YES" state="on" alignment="left" maxValue="512" doubleValue="50" tickMarkPosition="above" sliderType="linear" id="Zws-Wl-Ctp" customClass="VLCVolumeSliderCell"/> + <sliderCell key="cell" controlSize="mini" continuous="YES" state="on" alignment="left" maxValue="512" doubleValue="50" tickMarkPosition="above" sliderType="linear" id="Gp6-7o-lvj" customClass="VLCVolumeSliderCell"/> <connections> - <action selector="volumeAction:" target="3" id="rPg-yg-qAG"/> + <action selector="volumeAction:" target="3" id="soW-Fc-H3Y"/> </connections> </slider> </subviews> @@ -137,20 +215,6 @@ <real value="3.4028234663852886e+38"/> </customSpacing> </stackView> - <button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dYZ-ri-Kra" customClass="VLCImageButton"> - <rect key="frame" x="137" y="-1" width="32" height="33"/> - <constraints> - <constraint firstAttribute="width" secondItem="dYZ-ri-Kra" secondAttribute="height" multiplier="1:1" id="cHQ-Fu-L8k"/> - <constraint firstAttribute="width" constant="32" id="quS-fD-Od7"/> - </constraints> - <buttonCell key="cell" type="recessed" bezelStyle="recessed" image="NSEnterFullScreenTemplate" imagePosition="only" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyUpOrDown" inset="2" id="Z8g-js-0W6"> - <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/> - <font key="font" metaFont="system"/> - </buttonCell> - <connections> - <action selector="fullscreen:" target="3" id="0Kk-UV-WtF"/> - </connections> - </button> </subviews> <visibilityPriorities> <integer value="1000"/> @@ -197,7 +261,7 @@ <rect key="frame" x="260" y="208" width="200" height="64"/> <subviews> <button translatesAutoresizingMaskIntoConstraints="NO" id="V9d-hX-iyg" customClass="VLCImageButton"> - <rect key="frame" x="0.0" y="7" width="48" height="51"/> + <rect key="frame" x="0.0" y="6.5" width="48" height="51"/> <constraints> <constraint firstAttribute="width" constant="48" id="XBm-GM-29d"/> <constraint firstAttribute="width" secondItem="V9d-hX-iyg" secondAttribute="height" multiplier="1:1" id="mjk-wN-72b"/> @@ -215,7 +279,7 @@
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCInputItem.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCInputItem.m
Changed
@@ -81,7 +81,7 @@ }); } -static const struct input_preparser_callbacks_t preparseCallbacks = { +static const struct vlc_metadata_cbs preparseCallbacks = { cb_preparse_ended, cb_subtree_added, };
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCLibraryTableViewDelegate.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryTableViewDelegate.m
Changed
@@ -45,7 +45,12 @@ cellView.identifier = self.cellViewIdentifier; } - cellView setRepresentedItem:vlcDataSource libraryItemAtRow:row forTableView:tableView; + NSObject<VLCMediaLibraryItemProtocol> * const libraryItem = vlcDataSource libraryItemAtRow:row forTableView:tableView; + if (libraryItem == nil) { + return nil; + } + + cellView setRepresentedItem:libraryItem; return cellView; }
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryTwoPaneSplitViewDelegate.h
Added
@@ -0,0 +1,31 @@ +/***************************************************************************** + * VLCLibraryTwoPaneSplitViewDelegate.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * Authors: Claudio Cambra <developer@claudiocambra.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + +#import "Cocoa/Cocoa.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCLibraryTwoPaneSplitViewDelegate : NSObject<NSSplitViewDelegate> + +@end + +NS_ASSUME_NONNULL_END
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryTwoPaneSplitViewDelegate.m
Added
@@ -0,0 +1,49 @@ +/***************************************************************************** + * VLCLibraryTwoPaneSplitViewDelegate.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * Authors: Claudio Cambra <developer@claudiocambra.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + +#import "VLCLibraryTwoPaneSplitViewDelegate.h" + +#import "library/VLCLibraryUIUnits.h" +#import "library/VLCLibraryWindow.h" + +#import "main/VLCMain.h" + +@implementation VLCLibraryTwoPaneSplitViewDelegate + +- (CGFloat)splitView:(NSSplitView *)splitView +constrainMaxCoordinate:(CGFloat)proposedMinimumPosition + ofSubviewAt:(NSInteger)dividerIndex +{ + if (dividerIndex != 0) { + return proposedMinimumPosition; + } + + VLCLibraryWindow * const libraryWindow = VLCMain.sharedInstance.libraryWindow; + const CGFloat libraryWindowWidth = libraryWindow.frame.size.width; + + NSNumber * const leftPaneIndex = NSNumber numberWithLong:0; + NSNumber * const leftPaneMaxWidth = NSNumber numberWithDouble:libraryWindowWidth - VLCLibraryUIUnits librarySplitViewMainViewMinimumWidth; + + return leftPaneMaxWidth.floatValue; +} + +@end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCLibraryUIUnits.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryUIUnits.h
Changed
@@ -63,6 +63,8 @@ + (const CGFloat)controlsFadeAnimationDuration; ++ (const CGFloat)librarySplitViewMainViewMinimumWidth; + @end NS_ASSUME_NONNULL_END
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCLibraryUIUnits.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryUIUnits.m
Changed
@@ -98,6 +98,7 @@ withItemsAspectRatio:(VLCLibraryCollectionViewItemAspectRatio)itemsAspectRatio { static uint numItemsInRow = 5; + static uint minItemsInRow = 2; NSSize itemSize = self itemSizeForCollectionView:collectionView withLayout:collectionViewLayout @@ -111,7 +112,7 @@ withItemsAspectRatio:itemsAspectRatio withNumberOfItemsInRow:numItemsInRow; } - while (itemSize.width < VLCLibraryUIUnits dynamicCollectionViewItemMinimumWidth) { + while (itemSize.width < VLCLibraryUIUnits dynamicCollectionViewItemMinimumWidth && numItemsInRow > minItemsInRow) { --numItemsInRow; itemSize = self itemSizeForCollectionView:collectionView withLayout:collectionViewLayout @@ -170,4 +171,9 @@ return 0.4f; } ++ (const CGFloat)librarySplitViewMainViewMinimumWidth +{ + return 400.; +} + @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCLibraryWindow.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryWindow.h
Changed
@@ -45,9 +45,11 @@ VLCLibraryStreamsSegment }; -typedef NS_ENUM(NSUInteger, VLCViewModeSegment) { - VLCGridViewModeSegment = 0, - VLCListViewModeSegment +typedef NS_ENUM(NSInteger, VLCLibraryViewModeSegment) { + VLCLibrarySmallestSentinelViewModeSegment = -1, + VLCLibraryGridViewModeSegment, + VLCLibraryListViewModeSegment, + VLCLibraryLargestSentinelViewModeSegment }; @interface VLCLibraryWindow : VLCFullVideoViewWindow<NSUserInterfaceItemIdentification> @@ -91,6 +93,8 @@ @property (readwrite, weak) IBOutlet NSView *mediaSourceView; @property (readwrite, weak) IBOutlet NSButton *mediaSourceHomeButton; @property (readwrite, weak) IBOutlet VLCInputNodePathControl *mediaSourcePathControl; +@property (readwrite, weak) IBOutlet NSLayoutConstraint *mediaSourcePathControlTableViewScrollViewBottomConstraint; +@property (readwrite, weak) IBOutlet NSLayoutConstraint *mediaSourcePathControlCollectionViewScrollViewBottomConstraint; @property (readwrite, weak) IBOutlet NSScrollView *mediaSourceTableViewScrollView; @property (readwrite, weak) IBOutlet NSTableView *mediaSourceTableView; @property (readwrite, weak) IBOutlet NSScrollView *mediaSourceCollectionViewScrollView; @@ -145,6 +149,7 @@ - (void)togglePlaylist; - (void)hideControlsBar; - (void)showControlsBar; +- (void)updateGridVsListViewModeSegmentedControl; - (IBAction)playlistDoubleClickAction:(id)sender; - (IBAction)shuffleAction:(id)sender; @@ -157,7 +162,9 @@ - (IBAction)showAndHidePlaylist:(id)sender; - (IBAction)backwardsNavigationAction:(id)sender; - (IBAction)forwardsNavigationAction:(id)sender; -- (IBAction)segmentedControlAction:(id)sender; +- (IBAction)segmentedTitleControlAction:(id)sender; +- (IBAction)gridVsListSegmentedControlAction:(id)sender; + @end NS_ASSUME_NONNULL_END
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCLibraryWindow.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryWindow.m
Changed
@@ -21,7 +21,9 @@ *****************************************************************************/ #import "VLCLibraryWindow.h" -#include "VLCLibraryDataTypes.h" + +#import "VLCLibraryDataTypes.h" + #import "extensions/NSString+Helpers.h" #import "extensions/NSFont+VLCAdditions.h" #import "extensions/NSColor+VLCAdditions.h" @@ -40,6 +42,7 @@ #import "library/VLCLibrarySortingMenuController.h" #import "library/VLCLibraryNavigationStack.h" #import "library/VLCLibraryUIUnits.h" +#import "library/VLCLibraryWindowPersistentPreferences.h" #import "library/video-library/VLCLibraryVideoCollectionViewsStackViewController.h" #import "library/video-library/VLCLibraryVideoTableViewDataSource.h" @@ -47,6 +50,7 @@ #import "library/audio-library/VLCLibraryAlbumTableCellView.h" #import "library/audio-library/VLCLibraryAudioViewController.h" +#import "library/audio-library/VLCLibraryAudioDataSource.h" #import "media-source/VLCMediaSourceBaseDataSource.h" #import "media-source/VLCLibraryMediaSourceViewController.h" @@ -268,7 +272,6 @@ { super encodeRestorableStateWithCoder:coder; coder encodeInteger:_segmentedTitleControl.selectedSegment forKey:@"macosx-library-selected-segment"; - coder encodeInteger:_gridVsListSegmentedControl.selectedSegment forKey:@"macosx-library-view-mode-selected-segment"; coder encodeInteger:_audioSegmentedControl.selectedSegment forKey:@"macosx-library-audio-view-selected-segment"; } @@ -372,14 +375,53 @@ #pragma mark - misc. user interactions -- (void)setViewForSelectedSegment +- (void)updateGridVsListViewModeSegmentedControl { - _currentSelectedSegment = _segmentedTitleControl.selectedSegment; - _currentSelectedViewModeSegment = _gridVsListSegmentedControl.selectedSegment; + const VLCLibrarySegment selectedLibrarySegment = _segmentedTitleControl.selectedSegment; + VLCLibraryWindowPersistentPreferences * const preferences = VLCLibraryWindowPersistentPreferences.sharedInstance; - VLCLibrarySegment selectedLibrarySegment = _segmentedTitleControl.selectedSegment; switch (selectedLibrarySegment) { case VLCLibraryVideoSegment: + _currentSelectedViewModeSegment = preferences.videoLibraryViewMode; + break; + case VLCLibraryMusicSegment: + { + const VLCAudioLibrarySegment selectedAudioSegment = _audioSegmentedControl.selectedSegment; + switch (selectedAudioSegment) { + case VLCAudioLibraryArtistsSegment: + _currentSelectedViewModeSegment = preferences.artistLibraryViewMode; + break; + case VLCAudioLibraryGenresSegment: + _currentSelectedViewModeSegment = preferences.genreLibraryViewMode; + break; + case VLCAudioLibraryAlbumsSegment: + _currentSelectedViewModeSegment = preferences.albumLibraryViewMode; + break; + case VLCAudioLibrarySongsSegment: + _currentSelectedViewModeSegment = preferences.songsLibraryViewMode; + break; + default: + break; + } + break; + } + case VLCLibraryBrowseSegment: + _currentSelectedViewModeSegment = preferences.browseLibraryViewMode; + break; + case VLCLibraryStreamsSegment: + _currentSelectedViewModeSegment = preferences.streamLibraryViewMode; + break; + default: + break; + } + + _gridVsListSegmentedControl.selectedSegment = _currentSelectedViewModeSegment; +} + +- (void)setViewForSelectedSegment +{ + switch (_currentSelectedSegment) { + case VLCLibraryVideoSegment: self showVideoLibrary; break; case VLCLibraryMusicSegment: @@ -387,22 +429,73 @@ break; case VLCLibraryBrowseSegment: case VLCLibraryStreamsSegment: - self showMediaSourceLibraryWithSegment:selectedLibrarySegment; + self showMediaSourceLibraryWithSegment:_currentSelectedSegment; break; default: break; } + + self invalidateRestorableState; } -- (IBAction)segmentedControlAction:(id)sender +- (IBAction)segmentedTitleControlAction:(id)sender { - if (_segmentedTitleControl.selectedSegment == _currentSelectedSegment && - _gridVsListSegmentedControl.selectedSegment == _currentSelectedViewModeSegment) { + if (_segmentedTitleControl.selectedSegment == _currentSelectedSegment) { return; } + _currentSelectedSegment = _segmentedTitleControl.selectedSegment; + self setViewForSelectedSegment; + self updateGridVsListViewModeSegmentedControl; +} + +- (IBAction)gridVsListSegmentedControlAction:(id)sender +{ + if (_gridVsListSegmentedControl.selectedSegment == _currentSelectedViewModeSegment) { + return; + } + + _currentSelectedViewModeSegment = _gridVsListSegmentedControl.selectedSegment; + + const VLCLibrarySegment selectedLibrarySegment = _segmentedTitleControl.selectedSegment; + VLCLibraryWindowPersistentPreferences * const preferences = VLCLibraryWindowPersistentPreferences.sharedInstance; + + switch (selectedLibrarySegment) { + case VLCLibraryVideoSegment: + preferences.videoLibraryViewMode = _currentSelectedViewModeSegment; + break; + case VLCLibraryMusicSegment: + { + const VLCAudioLibrarySegment selectedAudioSegment = _audioSegmentedControl.selectedSegment; + switch (selectedAudioSegment) { + case VLCAudioLibraryArtistsSegment: + preferences.artistLibraryViewMode = _currentSelectedViewModeSegment; + break; + case VLCAudioLibraryGenresSegment: + preferences.genreLibraryViewMode = _currentSelectedViewModeSegment; + break; + case VLCAudioLibraryAlbumsSegment: + preferences.albumLibraryViewMode = _currentSelectedViewModeSegment; + break; + case VLCAudioLibrarySongsSegment: + preferences.songsLibraryViewMode = _currentSelectedViewModeSegment; + break; + default: + break; + } + break; + } + case VLCLibraryBrowseSegment: + preferences.browseLibraryViewMode = _currentSelectedViewModeSegment; + break; + case VLCLibraryStreamsSegment: + preferences.streamLibraryViewMode = _currentSelectedViewModeSegment; + break; + default: + break; + } + self setViewForSelectedSegment; - self invalidateRestorableState; } - (void)hideToolbarItem:(NSToolbarItem *)toolbarItem @@ -500,9 +593,6 @@ self setLibrarySearchToolbarItemVisible:YES; _optionBarView.hidden = YES; - _gridVsListSegmentedControl.target = self; - _gridVsListSegmentedControl.action = @selector(segmentedControlAction:); - _libraryVideoViewController presentVideoView; } @@ -513,9 +603,6 @@ self setLibrarySearchToolbarItemVisible:YES; _optionBarView.hidden = NO; - _gridVsListSegmentedControl.target = self; - _gridVsListSegmentedControl.action = @selector(segmentedControlAction:); - _libraryAudioViewController presentAudioView; } @@ -614,7 +701,7 @@ - (IBAction)goToBrowseSection:(id)sender { _segmentedTitleControl setSelected:YES forSegment:2; - self segmentedControlAction:_segmentedTitleControl; + self segmentedTitleControlAction:_segmentedTitleControl; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/VLCLibraryWindowController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryWindowController.m
Changed
@@ -68,14 +68,12 @@ VLCLibraryWindow *libraryWindow = VLCMain sharedInstance.libraryWindow; NSInteger rememberedSelectedLibrarySegment = state decodeIntegerForKey:@"macosx-library-selected-segment"; - NSInteger rememberedSelectedLibraryViewModeSegment = state decodeIntegerForKey:@"macosx-library-view-mode-selected-segment"; NSInteger rememberedSelectedLibraryViewAudioSegment = state decodeIntegerForKey:@"macosx-library-audio-view-selected-segment"; libraryWindow.segmentedTitleControl setSelectedSegment:rememberedSelectedLibrarySegment; - libraryWindow.gridVsListSegmentedControl setSelectedSegment:rememberedSelectedLibraryViewModeSegment; libraryWindow.audioSegmentedControl setSelectedSegment:rememberedSelectedLibraryViewAudioSegment; - libraryWindow segmentedControlAction:self; + libraryWindow segmentedTitleControlAction:self; if (rememberedSelectedLibrarySegment == VLCLibraryMusicSegment) { libraryWindow.libraryAudioViewController segmentedControlAction:self; }
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryWindowPersistentPreferences.h
Added
@@ -0,0 +1,43 @@ +/***************************************************************************** + * VLCLibraryWindowPersistentPreferences.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * Authors: Claudio Cambra <developer@claudiocambra.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + +#import <Cocoa/Cocoa.h> + +#import "VLCLibraryWindow.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCLibraryWindowPersistentPreferences : NSObject + ++ (VLCLibraryWindowPersistentPreferences *)sharedInstance; + +@property (readwrite, nonatomic) VLCLibraryViewModeSegment videoLibraryViewMode; +@property (readwrite, nonatomic) VLCLibraryViewModeSegment albumLibraryViewMode; +@property (readwrite, nonatomic) VLCLibraryViewModeSegment genreLibraryViewMode; +@property (readwrite, nonatomic) VLCLibraryViewModeSegment songsLibraryViewMode; +@property (readwrite, nonatomic) VLCLibraryViewModeSegment artistLibraryViewMode; +@property (readwrite, nonatomic) VLCLibraryViewModeSegment browseLibraryViewMode; +@property (readwrite, nonatomic) VLCLibraryViewModeSegment streamLibraryViewMode; + +@end + +NS_ASSUME_NONNULL_END
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/VLCLibraryWindowPersistentPreferences.m
Added
@@ -0,0 +1,159 @@ +/***************************************************************************** + * VLCLibraryWindowPersistentPreferences.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * Authors: Claudio Cambra <developer@claudiocambra.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + +#import "VLCLibraryWindowPersistentPreferences.h" + +NSString * const VLCLibraryWindowPreferencePrefix = @"VLCLibraryWindow"; + +NSString * const VLCLibraryVideoLibraryViewModePreferenceKey = @"VideoLibraryViewMode"; +NSString * const VLCLibraryAlbumLibraryViewModePreferenceKey = @"AlbumLibraryViewMode"; +NSString * const VLCLibraryGenreLibraryViewModePreferenceKey = @"GenreLibraryViewMode"; +NSString * const VLCLibrarySongsLibraryViewModePreferenceKey = @"SongsLibraryViewMode"; +NSString * const VLCLibraryArtistLibraryViewModePreferenceKey = @"ArtistLibraryViewMode"; +NSString * const VLCLibraryBrowseLibraryViewModePreferenceKey = @"BrowseLibraryViewMode"; +NSString * const VLCLibraryStreamLibraryViewModePreferenceKey = @"StreamLibraryViewMode"; + +@implementation VLCLibraryWindowPersistentPreferences + +static VLCLibraryWindowPersistentPreferences *sharedInstance = nil; + ++ (VLCLibraryWindowPersistentPreferences *)sharedInstance +{ + static dispatch_once_t pred; + dispatch_once(&pred, ^{ + sharedInstance = VLCLibraryWindowPersistentPreferences alloc init; + }); + + return sharedInstance; +} + +- (NSString * const)fullLibraryWindowKey:(NSString *)partialKey +{ + return NSString stringWithFormat:@"%@.%@", VLCLibraryWindowPreferencePrefix, partialKey; +} + +- (const NSInteger)libraryViewModePreferenceWithKey:(NSString *)key +{ + NSUserDefaults * const standardUserDefaults = NSUserDefaults.standardUserDefaults; + NSString * const fullKey = self fullLibraryWindowKey:key; + NSInteger viewModeValue = standardUserDefaults integerForKey:fullKey; + + if (viewModeValue <= VLCLibrarySmallestSentinelViewModeSegment || + viewModeValue >= VLCLibraryLargestSentinelViewModeSegment) { + + NSLog(@"WARNING: Retrieved invalid values for library view mode. Resorting to default."); + viewModeValue = VLCLibraryGridViewModeSegment; // Set to workable default + } + + return viewModeValue; +} + +- (void)setLibraryWindowViewModePreferenceWithKey:(NSString *)key + value:(VLCLibraryViewModeSegment)viewMode +{ + NSParameterAssert(viewMode > VLCLibrarySmallestSentinelViewModeSegment && + viewMode < VLCLibraryLargestSentinelViewModeSegment); + + NSUserDefaults * const standardUserDefaults = NSUserDefaults.standardUserDefaults; + NSString * const fullKey = self fullLibraryWindowKey:key; + standardUserDefaults setInteger:viewMode forKey:fullKey; +} + +- (VLCLibraryViewModeSegment)videoLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibraryVideoLibraryViewModePreferenceKey; +} + +- (void)setVideoLibraryViewMode:(VLCLibraryViewModeSegment)videoLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibraryVideoLibraryViewModePreferenceKey + value:videoLibraryViewMode; +} + +- (VLCLibraryViewModeSegment)albumLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibraryAlbumLibraryViewModePreferenceKey; +} + +- (void)setAlbumLibraryViewMode:(VLCLibraryViewModeSegment)albumLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibraryAlbumLibraryViewModePreferenceKey + value:albumLibraryViewMode; + +} + +- (VLCLibraryViewModeSegment)genreLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibraryGenreLibraryViewModePreferenceKey; +} + +- (void)setGenreLibraryViewMode:(VLCLibraryViewModeSegment)genreLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibraryGenreLibraryViewModePreferenceKey + value:genreLibraryViewMode; +} + +- (VLCLibraryViewModeSegment)songsLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibrarySongsLibraryViewModePreferenceKey; +} + +- (void)setSongsLibraryViewMode:(VLCLibraryViewModeSegment)songsLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibrarySongsLibraryViewModePreferenceKey + value:songsLibraryViewMode; +} + +- (VLCLibraryViewModeSegment)artistLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibraryArtistLibraryViewModePreferenceKey; +} + +- (void)setArtistLibraryViewMode:(VLCLibraryViewModeSegment)artistLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibraryArtistLibraryViewModePreferenceKey + value:artistLibraryViewMode; +} + +- (VLCLibraryViewModeSegment)browseLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibraryBrowseLibraryViewModePreferenceKey; +} + +- (void)setBrowseLibraryViewMode:(VLCLibraryViewModeSegment)browseLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibraryBrowseLibraryViewModePreferenceKey + value:browseLibraryViewMode; +} + +- (VLCLibraryViewModeSegment)streamLibraryViewMode +{ + return self libraryViewModePreferenceWithKey:VLCLibraryStreamLibraryViewModePreferenceKey; +} + +- (void)setStreamLibraryViewMode:(VLCLibraryViewModeSegment)streamLibraryViewMode +{ + self setLibraryWindowViewModePreferenceWithKey:VLCLibraryStreamLibraryViewModePreferenceKey + value:streamLibraryViewMode; +} + +@end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m
Changed
@@ -240,8 +240,14 @@ self.representedImageView.image = _representedAlbum.smallArtworkImage; - _tracksDataSource.representedAlbum = _representedAlbum; - _tracksTableView reloadData; + __weak typeof(self) weakSelf = self; // Prevent retain cycle + _tracksDataSource setRepresentedAlbum:_representedAlbum withCompletion:^{ + __strong typeof(self) strongSelf = weakSelf; + + if (strongSelf) { + strongSelf->_tracksTableView reloadData; + } + }; } - (void)setRepresentedItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTracksDataSource.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTracksDataSource.h
Changed
@@ -34,6 +34,9 @@ @property (readwrite, retain, nonatomic, nullable) VLCMediaLibraryAlbum *representedAlbum; +- (void)setRepresentedAlbum:(VLCMediaLibraryAlbum*)album + withCompletion:(nullable void(^)(void))completionHandler; + @end NS_ASSUME_NONNULL_END
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTracksDataSource.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTracksDataSource.m
Changed
@@ -29,23 +29,44 @@ const CGFloat VLCLibraryTracksRowHeight = 40.; @interface VLCLibraryAlbumTracksDataSource () -{ - NSArray *_tracks; -} + +@property (readwrite, atomic) NSArray<VLCMediaLibraryMediaItem*> *tracks; +@property (readwrite, atomic) VLCMediaLibraryAlbum *internalAlbum; + @end @implementation VLCLibraryAlbumTracksDataSource +- (VLCMediaLibraryAlbum*)representedAlbum +{ + return self.internalAlbum; +} + - (void)setRepresentedAlbum:(VLCMediaLibraryAlbum *)representedAlbum { - _representedAlbum = representedAlbum; - _tracks = _representedAlbum tracksAsMediaItems; + self setRepresentedAlbum:representedAlbum withCompletion:nil; +} + +- (void)setRepresentedAlbum:(id)album + withCompletion:(nullable void (^)(void))completionHandler +{ + self.internalAlbum = album; + + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{ + self.tracks = self.representedAlbum tracksAsMediaItems; + + dispatch_async(dispatch_get_main_queue(), ^{ + if (completionHandler != nil) { + completionHandler(); + } + }); + }); } - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { - if (_representedAlbum != nil) { - return _representedAlbum.numberOfTracks; + if (self.representedAlbum != nil) { + return self.representedAlbum.numberOfTracks; } return 0; @@ -61,7 +82,7 @@ - (id<VLCMediaLibraryItemProtocol>)libraryItemAtRow:(NSInteger)row forTableView:(NSTableView *)tableView { - return _tracksrow; + return self.tracksrow; } @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m
Changed
@@ -44,6 +44,7 @@ #import "extensions/NSString+Helpers.h" #import "extensions/NSPasteboardItem+VLCAdditions.h" +#import "playlist/VLCPlayerController.h" #import "playlist/VLCPlaylistController.h" #import "playlist/VLCPlaylistItem.h" #import "playlist/VLCPlaylistModel.h" @@ -70,7 +71,6 @@ @interface VLCLibraryAudioDataSource () { - NSArray *_displayedCollection; enum vlc_ml_parent_type _currentParentType; id<VLCMediaLibraryItemProtocol> _selectedCollectionViewItem; @@ -78,6 +78,9 @@ id<VLCMediaLibraryItemProtocol> _selectedGroupSelectionTableViewItem; id<VLCMediaLibraryItemProtocol> _selectedSongTableViewItem; } + +@property (readwrite, atomic) NSArray *displayedCollection; + @end @implementation VLCLibraryAudioDataSource @@ -113,45 +116,27 @@ name:VLCLibraryModelGenreListUpdated object:nil; notificationCenter addObserver:self - selector:@selector(playlistItemChanged:) - name:VLCPlaylistCurrentItemChanged + selector:@selector(currentlyPlayingItemChanged:) + name:VLCPlayerCurrentMediaItemChanged object:nil; } return self; } -- (void)playlistItemChanged:(NSNotification *)aNotification +- (void)currentlyPlayingItemChanged:(NSNotification *)aNotification { - NSParameterAssert(aNotification); - VLCPlaylistController *playlistController = (VLCPlaylistController *)aNotification.object; - NSAssert(playlistController, @"Should receive valid playlist controller from notification"); - VLCPlaylistModel *playlistModel = playlistController.playlistModel; - NSAssert(playlistModel, @"Should receive valid playlist model"); - - // If we use the playlist's currentPlayingItem we will get the same item we had before. - // Let's instead grab the playlist item from the playlist model, as we know this is - // updated before the VLCPlaylistCurrentItemChanged notification is sent out - size_t currentPlaylistIndex = playlistController.currentPlaylistIndex; - if (currentPlaylistIndex < 0) { - return; - } - - VLCPlaylistItem *currentPlayingItem = playlistModel playlistItemAtIndex:currentPlaylistIndex; - if (!currentPlayingItem) { - return; - } - - VLCInputItem *currentInputItem = currentPlayingItem.inputItem; - if (!currentPlayingItem) { + VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController; + VLCInputItem * const currentInputItem = playerController.currentMedia; + if (!currentInputItem) { return; } if (_currentParentType == VLC_ML_PARENT_UNKNOWN) { - NSString *currentItemMrl = currentInputItem.MRL; + NSString * const currentItemMrl = currentInputItem.MRL; - NSUInteger itemIndexInDisplayedCollection = self->_displayedCollection indexOfObjectPassingTest:^BOOL(id element, NSUInteger idx, BOOL *stop) { - VLCMediaLibraryMediaItem *mediaItem = (VLCMediaLibraryMediaItem *)element; + const NSUInteger itemIndexInDisplayedCollection = self.displayedCollection indexOfObjectPassingTest:^BOOL(id element, NSUInteger idx, BOOL *stop) { + VLCMediaLibraryMediaItem * const mediaItem = (VLCMediaLibraryMediaItem *)element; return mediaItem.inputItem.MRL isEqualToString:currentItemMrl; }; @@ -244,7 +229,7 @@ return nil; } - return _displayedCollectionindexPath.item; + return self.displayedCollectionindexPath.item; } - (void)restoreSelectionState @@ -257,7 +242,7 @@ - (NSUInteger)findSelectedItemNewIndex:(id<VLCMediaLibraryItemProtocol>)item { - return _displayedCollection indexOfObjectPassingTest:^BOOL(id element, NSUInteger idx, BOOL *stop) { + return self.displayedCollection indexOfObjectPassingTest:^BOOL(id element, NSUInteger idx, BOOL *stop) { id<VLCMediaLibraryItemProtocol> itemElement = (id<VLCMediaLibraryItemProtocol>)element; return itemElement.libraryID == item.libraryID; }; @@ -458,22 +443,25 @@ - (void)reloadData { - self retainSelectedMediaItem; - self->_displayedCollection = self collectionToDisplay; - self resetLayoutsForOperation:^{ - self.collectionView reloadData; - self.gridModeListTableView reloadData; - self.gridModeListSelectionCollectionView reloadData; - self.collectionSelectionTableView reloadData; - self.groupSelectionTableView reloadData; - self.songsTableView reloadData; - }; - self restoreSelectionState; + dispatch_async(dispatch_get_main_queue(), ^{ + self retainSelectedMediaItem; + self.displayedCollection = self collectionToDisplay; + + self resetLayoutsForOperation:^{ + self.collectionView reloadData; + self.gridModeListTableView reloadData; + self.gridModeListSelectionCollectionView reloadData; + self.collectionSelectionTableView reloadData; + self.groupSelectionTableView reloadData; + self.songsTableView reloadData; + }; + self restoreSelectionState; + }); } - (NSUInteger)indexForMediaLibraryItemWithId:(const int64_t)itemId { - return _displayedCollection indexOfObjectPassingTest:^BOOL(VLCMediaLibraryMediaItem * const mediaItem, const NSUInteger idx, BOOL * const stop) { + return self.displayedCollection indexOfObjectPassingTest:^BOOL(VLCMediaLibraryMediaItem * const mediaItem, const NSUInteger idx, BOOL * const stop) { NSAssert(mediaItem != nil, @"Cache list should not contain nil media items"); return mediaItem.libraryID == itemId; }; @@ -487,9 +475,9 @@ return; } - NSMutableArray * const mutableCollectionCopy = self->_displayedCollection mutableCopy; + NSMutableArray * const mutableCollectionCopy = self.displayedCollection mutableCopy; mutableCollectionCopy replaceObjectAtIndex:index withObject:mediaItem; - self->_displayedCollection = mutableCollectionCopy copy; + self.displayedCollection = mutableCollectionCopy copy; NSIndexPath * const indexPath = NSIndexPath indexPathForItem:index inSection:0; NSIndexSet * const rowIndexSet = NSIndexSet indexSetWithIndex:index; @@ -519,9 +507,9 @@ return; } - NSMutableArray * const mutableCollectionCopy = self->_displayedCollection mutableCopy; + NSMutableArray * const mutableCollectionCopy = self.displayedCollection mutableCopy; mutableCollectionCopy removeObjectAtIndex:index; - self->_displayedCollection = mutableCollectionCopy copy; + self.displayedCollection = mutableCollectionCopy copy; NSIndexPath * const indexPath = NSIndexPath indexPathForItem:index inSection:0; NSIndexSet * const rowIndexSet = NSIndexSet indexSetWithIndex:index; @@ -542,19 +530,19 @@ _audioLibrarySegment = audioLibrarySegment; switch (_audioLibrarySegment) { case VLCAudioLibraryArtistsSegment: - _displayedCollection = self.libraryModel listOfArtists; + self.displayedCollection = self.libraryModel listOfArtists; _currentParentType = VLC_ML_PARENT_ARTIST; break; case VLCAudioLibraryAlbumsSegment: - _displayedCollection = self.libraryModel listOfAlbums; + self.displayedCollection = self.libraryModel listOfAlbums; _currentParentType = VLC_ML_PARENT_ALBUM; break; case VLCAudioLibrarySongsSegment: - _displayedCollection = self.libraryModel listOfAudioMedia; + self.displayedCollection = self.libraryModel listOfAudioMedia; _currentParentType = VLC_ML_PARENT_UNKNOWN; break; case VLCAudioLibraryGenresSegment: - _displayedCollection = self.libraryModel listOfGenres; + self.displayedCollection = self.libraryModel listOfGenres; _currentParentType = VLC_ML_PARENT_GENRE; break; @@ -577,7 +565,7 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { - NSInteger numItems = _displayedCollection.count; + const NSInteger numItems = self.displayedCollection.count; return self displayAllArtistsGenresTableEntry ? numItems + 1 : numItems; } @@ -594,10 +582,10 @@ return VLCMediaLibraryDummyItem alloc initWithDisplayString:_NS("All artists") withDetailString:@""; } else if (viewDisplayingAllItemsEntry) { - return _displayedCollectionrow - 1; + return self.displayedCollectionrow - 1;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.h
Changed
@@ -33,7 +33,7 @@ @interface VLCLibraryAudioGroupDataSource : NSObject <VLCLibraryTableViewDataSource, VLCLibraryCollectionViewDataSource> -@property (readwrite, retain, nullable) NSArray <VLCMediaLibraryAlbum *> *representedListOfAlbums; +@property (readwrite, atomic, retain, nullable) NSArray <VLCMediaLibraryAlbum *> *representedListOfAlbums; @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m
Changed
@@ -40,8 +40,8 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { - if (_representedListOfAlbums != nil) { - return _representedListOfAlbums.count; + if (self.representedListOfAlbums != nil) { + return self.representedListOfAlbums.count; } return 0; @@ -50,13 +50,13 @@ - (id<VLCMediaLibraryItemProtocol>)libraryItemAtRow:(NSInteger)row forTableView:(NSTableView *)tableView { - return _representedListOfAlbumsrow; + return self.representedListOfAlbumsrow; } - (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - return _representedListOfAlbums.count; + return self.representedListOfAlbums.count; } - (NSInteger)numberOfSectionsInCollectionView:(NSCollectionView *)collectionView @@ -68,7 +68,7 @@ itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath { VLCLibraryCollectionViewItem *viewItem = collectionView makeItemWithIdentifier:VLCLibraryCellIdentifier forIndexPath:indexPath; - viewItem.representedItem = _representedListOfAlbumsindexPath.item; + viewItem.representedItem = self.representedListOfAlbumsindexPath.item; return viewItem; } @@ -80,7 +80,7 @@ VLCLibraryCollectionViewAlbumSupplementaryDetailView* albumSupplementaryDetailView = collectionView makeSupplementaryViewOfKind:kind withIdentifier:VLCLibraryCollectionViewAlbumSupplementaryDetailViewKind forIndexPath:indexPath; - VLCMediaLibraryAlbum *album = _representedListOfAlbumsindexPath.item; + VLCMediaLibraryAlbum * const album = self.representedListOfAlbumsindexPath.item; albumSupplementaryDetailView.representedAlbum = album; albumSupplementaryDetailView.selectedItem = collectionView itemAtIndex:indexPath.item; albumSupplementaryDetailView.parentScrollView = VLCMain sharedInstance.libraryWindow.audioCollectionViewScrollView; @@ -103,7 +103,7 @@ - (id<VLCMediaLibraryItemProtocol>)libraryItemAtIndexPath:(NSIndexPath *)indexPath forCollectionView:(NSCollectionView *)collectionView { - return _representedListOfAlbumsindexPath.item; + return self.representedListOfAlbumsindexPath.item; } @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.h
Changed
@@ -48,7 +48,6 @@ @property (readonly) NSScrollView *audioLibraryGridModeSplitViewListSelectionCollectionViewScrollView; @property (readonly) NSCollectionView *audioLibraryGridModeSplitViewListSelectionCollectionView; @property (readonly) NSSegmentedControl *audioSegmentedControl; -@property (readonly) NSSegmentedControl *gridVsListSegmentedControl; @property (readonly) NSSegmentedControl *segmentedTitleControl; @property (readonly) NSImageView *placeholderImageView; @property (readonly) NSTextField *placeholderLabel;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
Changed
@@ -29,7 +29,9 @@ #import "library/VLCLibraryController.h" #import "library/VLCLibraryModel.h" #import "library/VLCLibraryNavigationStack.h" +#import "library/VLCLibraryTwoPaneSplitViewDelegate.h" #import "library/VLCLibraryWindow.h" +#import "library/VLCLibraryWindowPersistentPreferences.h" #import "library/audio-library/VLCLibraryAlbumTableCellView.h" #import "library/audio-library/VLCLibraryAudioDataSource.h" @@ -54,6 +56,7 @@ VLCLibraryCollectionViewDelegate *_audioLibraryCollectionViewDelegate; VLCLibraryAudioTableViewDelegate *_audioLibraryTableViewDelegate; VLCLibraryAudioGroupTableViewDelegate *_audioGroupLibraryTableViewDelegate; + VLCLibraryTwoPaneSplitViewDelegate *_splitViewDelegate; } @end @@ -72,7 +75,9 @@ _audioLibraryCollectionViewDelegate = VLCLibraryCollectionViewDelegate alloc init; _audioLibraryTableViewDelegate = VLCLibraryAudioTableViewDelegate alloc init; _audioGroupLibraryTableViewDelegate = VLCLibraryAudioGroupTableViewDelegate alloc init; + _splitViewDelegate = VLCLibraryTwoPaneSplitViewDelegate alloc init; + self setupAudioPlaceholderView; self setupAudioCollectionView; self setupGridModeSplitView; self setupAudioTableViews; @@ -116,7 +121,6 @@ _audioLibraryGridModeSplitViewListSelectionCollectionView = libraryWindow.audioLibraryGridModeSplitViewListSelectionCollectionView; _audioSegmentedControl = libraryWindow.audioSegmentedControl; - _gridVsListSegmentedControl = libraryWindow.gridVsListSegmentedControl; _segmentedTitleControl = libraryWindow.segmentedTitleControl; _placeholderImageView = libraryWindow.placeholderImageView; _placeholderLabel = libraryWindow.placeholderLabel; @@ -161,6 +165,8 @@ - (void)setupAudioTableViews { + _audioLibrarySplitView.delegate = _splitViewDelegate; + _audioCollectionSelectionTableView.dataSource = _audioDataSource; _audioCollectionSelectionTableView.delegate = _audioLibraryTableViewDelegate; @@ -177,6 +183,8 @@ - (void)setupGridModeSplitView { + _audioLibraryGridModeSplitView.delegate = _splitViewDelegate; + _audioLibraryGridModeSplitViewListTableView.dataSource = _audioDataSource; _audioLibraryGridModeSplitViewListTableView.delegate = _audioLibraryTableViewDelegate; @@ -287,14 +295,14 @@ - (void)presentPlaceholderAudioView { - for (NSLayoutConstraint *constraint in _libraryWindow.libraryVideoViewController.videoPlaceholderImageViewSizeConstraints) { + for (NSLayoutConstraint * const constraint in _libraryWindow.libraryVideoViewController.videoPlaceholderImageViewSizeConstraints) { constraint.active = NO; } - for (NSLayoutConstraint *constraint in _audioPlaceholderImageViewSizeConstraints) { + for (NSLayoutConstraint * const constraint in _audioPlaceholderImageViewSizeConstraints) { constraint.active = YES; } - NSInteger selectedLibrarySegment = _audioSegmentedControl.selectedSegment; + const NSInteger selectedLibrarySegment = _audioSegmentedControl.selectedSegment; if(selectedLibrarySegment < _placeholderImageNames.count && selectedLibrarySegment >= 0) { _placeholderImageView.image = NSImage imageNamed:_placeholderImageNamesselectedLibrarySegment; @@ -306,7 +314,7 @@ _emptyLibraryView.translatesAutoresizingMaskIntoConstraints = NO; _libraryTargetView.subviews = @_emptyLibraryView; - NSDictionary *dict = NSDictionaryOfVariableBindings(_emptyLibraryView); + NSDictionary * const dict = NSDictionaryOfVariableBindings(_emptyLibraryView); _libraryTargetView addConstraints:NSLayoutConstraint constraintsWithVisualFormat:@"H:|_emptyLibraryView(>=572.)|" options:0 metrics:0 views:dict; _libraryTargetView addConstraints:NSLayoutConstraint constraintsWithVisualFormat:@"V:|_emptyLibraryView(>=444.)|" options:0 metrics:0 views:dict; @@ -355,7 +363,8 @@ - (void)updatePresentedView { - _audioDataSource.audioLibrarySegment = _audioSegmentedControl.selectedSegment; + const VLCAudioLibrarySegment audioLibrarySegment = _audioSegmentedControl.selectedSegment; + _audioDataSource.audioLibrarySegment = audioLibrarySegment; if (_audioDataSource.libraryModel.listOfAudioMedia.count == 0) { self presentPlaceholderAudioView; @@ -363,11 +372,35 @@ self prepareAudioLibraryView; self hideAllViews; - if (self.gridVsListSegmentedControl.selectedSegment == VLCListViewModeSegment) { + VLCLibraryViewModeSegment viewModeSegment = VLCLibraryGridViewModeSegment; // default value + VLCLibraryWindowPersistentPreferences * const libraryWindowPrefs = VLCLibraryWindowPersistentPreferences.sharedInstance; + + switch (audioLibrarySegment) { + case VLCAudioLibraryArtistsSegment: + viewModeSegment = libraryWindowPrefs.artistLibraryViewMode; + break; + case VLCAudioLibraryGenresSegment: + viewModeSegment = libraryWindowPrefs.genreLibraryViewMode; + break; + case VLCAudioLibrarySongsSegment: + viewModeSegment = libraryWindowPrefs.songsLibraryViewMode; + break; + case VLCAudioLibraryAlbumsSegment: + viewModeSegment = libraryWindowPrefs.albumLibraryViewMode; + break; + default: + break; + } + + if (viewModeSegment == VLCLibraryListViewModeSegment) { self presentAudioTableView; - } else if (self.gridVsListSegmentedControl.selectedSegment == VLCGridViewModeSegment) { + } else if (viewModeSegment == VLCLibraryGridViewModeSegment) { self presentAudioGridModeView; + } else { + NSAssert(false, @"View mode must be grid or list mode"); } + + VLCMain.sharedInstance.libraryWindow updateGridVsListViewModeSegmentedControl; } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m
Changed
@@ -94,9 +94,15 @@ _albumDetailsTextField.stringValue = _representedAlbum.artistName; _albumYearAndDurationTextField.stringValue = NSString stringWithFormat:@"%u · %@", _representedAlbum.year, _representedAlbum.durationString; _albumArtworkImageView.image = _representedAlbum.smallArtworkImage; - _tracksDataSource.representedAlbum = _representedAlbum; - _albumTracksTableView reloadData; + __weak typeof(self) weakSelf = self; // Prevent retain cycle + _tracksDataSource setRepresentedAlbum:_representedAlbum withCompletion:^{ + __strong typeof(self) strongSelf = weakSelf; + + if (strongSelf) { + strongSelf->_albumTracksTableView reloadData; + } + }; } - (IBAction)playAction:(id)sender
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.m
Changed
@@ -66,9 +66,14 @@ } _audioGroupNameTextField.stringValue = _representedAudioGroup.displayString; - _audioGroupAlbumsDataSource.representedListOfAlbums = _representedAudioGroup.albums; - _audioGroupAlbumsTableView reloadData; + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{ + self->_audioGroupAlbumsDataSource.representedListOfAlbums = self->_representedAudioGroup.albums; + + dispatch_async(dispatch_get_main_queue(), ^{ + self->_audioGroupAlbumsTableView reloadData; + }); + }); } @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m
Changed
@@ -35,7 +35,7 @@ NSNotificationCenter *notificationCenter = NSNotificationCenter defaultCenter; notificationCenter addObserver:self selector:@selector(playStateOrItemChanged:) - name:VLCPlaylistCurrentItemChanged + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(playStateOrItemChanged:)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
Changed
@@ -39,6 +39,8 @@ @property (readonly) NSScrollView *tableViewScrollView; @property (readonly) NSButton *homeButton; @property (readonly) VLCInputNodePathControl *pathControl; +@property (readonly) NSLayoutConstraint *pathControlBottomTableViewScrollViewConstraint; +@property (readonly) NSLayoutConstraint *pathControlBottomCollectionViewScrollViewConstraint; @property (readonly) NSSegmentedControl *gridVsListSegmentedControl; @property (readonly) VLCMediaSourceBaseDataSource *baseDataSource;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
Changed
@@ -58,6 +58,8 @@ _tableViewScrollView = libraryWindow.mediaSourceTableViewScrollView; _homeButton = libraryWindow.mediaSourceHomeButton; _pathControl = libraryWindow.mediaSourcePathControl; + _pathControlBottomTableViewScrollViewConstraint = libraryWindow.mediaSourcePathControlTableViewScrollViewBottomConstraint; + _pathControlBottomCollectionViewScrollViewConstraint = libraryWindow.mediaSourcePathControlCollectionViewScrollViewBottomConstraint; _gridVsListSegmentedControl = libraryWindow.gridVsListSegmentedControl; } @@ -68,7 +70,8 @@ _baseDataSource.collectionViewScrollView = _collectionViewScrollView; _baseDataSource.homeButton = _homeButton; _baseDataSource.pathControl = _pathControl; - _baseDataSource.gridVsListSegmentedControl = _gridVsListSegmentedControl; + _baseDataSource.pathControlBottomTableViewScrollViewConstraint = _pathControlBottomTableViewScrollViewConstraint; + _baseDataSource.pathControlBottomCollectionViewScrollViewConstraint = _pathControlBottomCollectionViewScrollViewConstraint; _baseDataSource.tableView = _tableView; _baseDataSource setupViews; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.h
Changed
@@ -41,9 +41,10 @@ @property (readwrite) NSCollectionView *collectionView; @property (readwrite) NSScrollView *collectionViewScrollView; @property (readwrite) NSTableView *tableView; -@property (readwrite) NSSegmentedControl *gridVsListSegmentedControl; @property (readwrite) NSButton *homeButton; @property (readwrite) VLCInputNodePathControl *pathControl; +@property (readwrite) NSLayoutConstraint *pathControlBottomTableViewScrollViewConstraint; +@property (readwrite) NSLayoutConstraint *pathControlBottomCollectionViewScrollViewConstraint; @property (readwrite, nonatomic) VLCMediaSourceMode mediaSourceMode; @property (readwrite, nonatomic) VLCMediaSourceDataSource *childDataSource; @@ -51,7 +52,6 @@ - (void)reloadViews; - (void)homeButtonAction:(id)sender; - (void)pathControlAction:(id)sender; -- (void)setGridOrListMode:(id)sender; @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
Changed
@@ -38,6 +38,7 @@ #import "library/VLCLibraryCollectionViewSupplementaryElementView.h" #import "library/VLCLibraryTableCellView.h" #import "library/VLCLibraryUIUnits.h" +#import "library/VLCLibraryWindowPersistentPreferences.h" #import "main/VLCMain.h" @@ -105,6 +106,8 @@ self.pathControl.action = @selector(pathControlAction:); self.pathControl.target = self; + self togglePathControlVisibility:NO; + self.tableView.dataSource = self; self.tableView.delegate = self; self.tableView.hidden = YES; @@ -114,11 +117,31 @@ - (void)reloadViews { - self.gridVsListSegmentedControl.action = @selector(setGridOrListMode:); - self.gridVsListSegmentedControl.target = self; - _gridViewMode = self.gridVsListSegmentedControl.selectedSegment == VLCGridViewModeSegment; + VLCLibraryViewModeSegment viewModeSegment = VLCLibraryGridViewModeSegment; + VLCLibraryWindowPersistentPreferences * const libraryWindowPrefs = VLCLibraryWindowPersistentPreferences.sharedInstance; + + switch (_mediaSourceMode) { + case VLCMediaSourceModeLAN: + viewModeSegment = libraryWindowPrefs.browseLibraryViewMode; + break; + case VLCMediaSourceModeInternet: + viewModeSegment = libraryWindowPrefs.streamLibraryViewMode; + break; + default: + break; + } - self setCurrentViewMode; + if (viewModeSegment == VLCLibraryGridViewModeSegment) { + self.collectionViewScrollView.hidden = NO; + self.tableView.hidden = YES; + self.collectionView reloadData; + } else if (viewModeSegment == VLCLibraryListViewModeSegment) { + self.collectionViewScrollView.hidden = YES; + self.tableView.hidden = NO; + self.tableView reloadData; + } else { + NSAssert(false, @"View mode must be grid or list mode"); + } } - (void)loadMediaSources @@ -394,6 +417,8 @@ self setChildDataSource:newChildDataSource; VLCMain sharedInstance.libraryWindow.navigationStack appendCurrentLibraryState; + + self togglePathControlVisibility:YES; } - (void)setChildDataSource:(VLCMediaSourceDataSource *)childDataSource @@ -428,6 +453,14 @@ #pragma mark - user interaction with generic buttons +- (void)togglePathControlVisibility:(BOOL)visible +{ + _homeButton.hidden = !visible; + _pathControl.hidden = !visible; + _pathControlBottomTableViewScrollViewConstraint.constant = visible ? VLCLibraryUIUnits mediumSpacing : 0; + _pathControlBottomCollectionViewScrollViewConstraint.constant = visible ? VLCLibraryUIUnits mediumSpacing : 0; +} + - (void)returnHome { self.collectionView.dataSource = self; @@ -439,6 +472,8 @@ self.pathControl clearInputNodePathControlItems; self reloadData; + + self togglePathControlVisibility:NO; } - (void)homeButtonAction:(id)sender @@ -464,27 +499,6 @@ } } -- (void)setCurrentViewMode -{ - if (_gridViewMode) { - self.collectionViewScrollView.hidden = NO; - self.tableView.hidden = YES; - self.collectionView reloadData; - } else { - self.collectionViewScrollView.hidden = YES; - self.tableView.hidden = NO; - self.tableView reloadData; - } -} - -- (void)setGridOrListMode:(id)sender -{ - _gridViewMode = self.gridVsListSegmentedControl.selectedSegment == VLCGridViewModeSegment; - _childDataSource.gridViewMode = _gridViewMode; - - self setCurrentViewMode; -} - #pragma mark - VLCMediaSource Delegation - (void)mediaSourceChildrenReset:(NSNotification *)aNotification
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.h
Changed
@@ -40,7 +40,6 @@ @property (readwrite, assign) NSCollectionView *collectionView; @property (readwrite, assign) NSTableView *tableView; @property (readwrite) VLCInputNodePathControl *pathControl; -@property (readwrite) BOOL gridViewMode; - (void)setupViews; - (VLCInputItem*)mediaSourceInputItemAtRow:(NSInteger)tableViewRow;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.h
Changed
@@ -42,7 +42,6 @@ @property (readonly) NSTableView *videoLibraryGroupSelectionTableView; @property (readonly) NSScrollView *videoLibraryGroupsTableViewScrollView; @property (readonly) NSTableView *videoLibraryGroupsTableView; -@property (readonly) NSSegmentedControl *gridVsListSegmentedControl; @property (readonly) NSSegmentedControl *segmentedTitleControl; @property (readonly) NSImageView *placeholderImageView; @property (readonly) NSTextField *placeholderLabel;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.m
Changed
@@ -26,8 +26,10 @@ #import "library/VLCLibraryController.h" #import "library/VLCLibraryModel.h" +#import "library/VLCLibraryTwoPaneSplitViewDelegate.h" #import "library/VLCLibraryUIUnits.h" #import "library/VLCLibraryWindow.h" +#import "library/VLCLibraryWindowPersistentPreferences.h" #import "library/audio-library/VLCLibraryAudioViewController.h" @@ -43,6 +45,7 @@ @interface VLCLibraryVideoViewController () { VLCLibraryVideoTableViewDelegate *_videoLibraryTableViewDelegate; + VLCLibraryTwoPaneSplitViewDelegate *_splitViewDelegate; } @end @@ -54,6 +57,7 @@ if(self) { _videoLibraryTableViewDelegate = VLCLibraryVideoTableViewDelegate alloc init; + _splitViewDelegate = VLCLibraryTwoPaneSplitViewDelegate alloc init; self setupPropertiesFromLibraryWindow:libraryWindow; self setupTableViewDataSource; @@ -90,7 +94,6 @@ _videoLibraryGroupsTableViewScrollView = libraryWindow.videoLibraryGroupsTableViewScrollView; _videoLibraryGroupsTableView = libraryWindow.videoLibraryGroupsTableView; - _gridVsListSegmentedControl = libraryWindow.gridVsListSegmentedControl; _segmentedTitleControl = libraryWindow.segmentedTitleControl; _placeholderImageView = libraryWindow.placeholderImageView; _placeholderLabel = libraryWindow.placeholderLabel; @@ -99,6 +102,7 @@ - (void)setupTableViewDataSource { + _videoLibrarySplitView.delegate = _splitViewDelegate; _libraryVideoTableViewDataSource = VLCLibraryVideoTableViewDataSource alloc init; _libraryVideoTableViewDataSource.libraryModel = VLCMain.sharedInstance.libraryController.libraryModel; _libraryVideoTableViewDataSource.groupsTableView = _videoLibraryGroupsTableView; @@ -208,14 +212,18 @@ _libraryTargetView addConstraints:NSLayoutConstraint constraintsWithVisualFormat:@"H:|_videoLibraryView(>=572.)|" options:0 metrics:0 views:dict; _libraryTargetView addConstraints:NSLayoutConstraint constraintsWithVisualFormat:@"V:|_videoLibraryView(>=444.)|" options:0 metrics:0 views:dict; - if (self.gridVsListSegmentedControl.selectedSegment == VLCGridViewModeSegment) { + const VLCLibraryViewModeSegment viewModeSegment = VLCLibraryWindowPersistentPreferences.sharedInstance.videoLibraryViewMode; + + if (viewModeSegment == VLCLibraryGridViewModeSegment) { _videoLibrarySplitView.hidden = YES; _videoLibraryCollectionViewsStackViewScrollView.hidden = NO; _libraryVideoCollectionViewsStackViewController reloadData; - } else { + } else if (viewModeSegment == VLCLibraryListViewModeSegment) { _videoLibrarySplitView.hidden = NO; _videoLibraryCollectionViewsStackViewScrollView.hidden = YES; _libraryVideoTableViewDataSource reloadData; + } else { + NSAssert(false, @"View mode must be grid or list mode"); } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/menus/VLCMainMenu.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/menus/VLCMainMenu.m
Changed
@@ -220,7 +220,7 @@ object:nil; notificationCenter addObserver:self selector:@selector(mediaItemChanged:) - name:VLCPlaylistCurrentItemChanged + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(voutListChanged:)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/os-integration/VLCRemoteControlService.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/os-integration/VLCRemoteControlService.m
Changed
@@ -85,7 +85,7 @@ object:nil; notificationCenter addObserver:self selector:@selector(metaDataChangedForCurrentMedia:) - name:VLCPlaylistCurrentItemChanged + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(playbackStateChanged:) @@ -147,9 +147,9 @@ - (void)metaDataChangedForCurrentMedia:(NSNotification *)aNotification { - VLCInputItem *inputItem = _playerController.currentMedia; + VLCInputItem * const inputItem = _playerController.currentMedia; - NSMutableDictionary *currentlyPlayingTrackInfo = NSMutableDictionary dictionary; + NSMutableDictionary * const currentlyPlayingTrackInfo = NSMutableDictionary dictionary; self setTimeInformationForDictionary:currentlyPlayingTrackInfo; self setRateInformationForDictionary:currentlyPlayingTrackInfo; @@ -158,16 +158,16 @@ currentlyPlayingTrackInfoMPMediaItemPropertyAlbumTitle = inputItem.albumName; currentlyPlayingTrackInfoMPMediaItemPropertyAlbumTrackNumber = @(inputItem.trackNumber intValue); - vlc_tick_t duration = inputItem.duration; + const vlc_tick_t duration = inputItem.duration; currentlyPlayingTrackInfoMPMediaItemPropertyPlaybackDuration = @(SEC_FROM_VLC_TICK(duration)); currentlyPlayingTrackInfoMPNowPlayingInfoPropertyIsLiveStream = @(duration <= 0); - NSURL *artworkURL = inputItem.artworkURL; + NSURL * const artworkURL = inputItem.artworkURL; if (artworkURL) { - NSImage *coverArtImage = NSImage alloc initWithContentsOfURL:artworkURL; + NSImage * const coverArtImage = NSImage alloc initWithContentsOfURL:artworkURL; if (coverArtImage) { - MPMediaItemArtwork *mpartwork = MPMediaItemArtwork alloc initWithBoundsSize:coverArtImage.size - requestHandler:^NSImage* _Nonnull(CGSize size) { + MPMediaItemArtwork * const mpartwork = MPMediaItemArtwork alloc initWithBoundsSize:coverArtImage.size + requestHandler:^NSImage* _Nonnull(CGSize size) { return coverArtImage; }; currentlyPlayingTrackInfoMPMediaItemPropertyArtwork = mpartwork;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/panels/VLCInformationWindowController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/panels/VLCInformationWindowController.m
Changed
@@ -85,8 +85,8 @@ NSNotificationCenter *notificationCenter = NSNotificationCenter defaultCenter; if (_mainMenuInstance) { notificationCenter addObserver:self - selector:@selector(currentPlaylistItemChanged:) - name:VLCPlaylistCurrentItemChanged + selector:@selector(currentPlayingItemChanged:) + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(updateStatistics:) @@ -216,10 +216,10 @@ _lostAudioBuffersTextField setIntValue: 0; } -- (void)currentPlaylistItemChanged:(NSNotification *)aNotification +- (void)currentPlayingItemChanged:(NSNotification *)aNotification { - VLCPlaylistController *playlistController = VLCMain sharedInstance playlistController; - VLCInputItem *currentMediaItem = playlistController.currentlyPlayingInputItem; + VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController; + VLCInputItem * const currentMediaItem = playerController.currentMedia; self setRepresentedInputItem:currentMediaItem; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
Changed
@@ -67,7 +67,7 @@ NSNotificationCenter *notificationCenter = NSNotificationCenter defaultCenter; notificationCenter addObserver:self selector:@selector(inputItemChanged:) - name:VLCPlaylistCurrentItemChanged + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(playbackStatusUpdated:) @@ -91,15 +91,16 @@ - (void)inputItemChanged:(NSNotification *)aNotification { - VLCMain *mainInstance = VLCMain sharedInstance; + VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController; + // Cancel pending resume dialogs _resumeDialogController cancel; // object is hold here and released then it is dead - _currentInput = mainInstance playlistController currentlyPlayingInputItem; + _currentInput = playerController.currentMedia; if (_currentInput) { - VLCPlaylistController *playlistController = aNotification.object; - self continuePlaybackWhereYouLeftOff:_currentInput player:playlistController.playerController; + self continuePlaybackWhereYouLeftOff:_currentInput + player:playerController; } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/playlist/VLCPlaylistController.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/playlist/VLCPlaylistController.h
Changed
@@ -36,7 +36,7 @@ extern NSString *VLCPlaybackRepeatChanged; extern NSString *VLCPlaybackHasPreviousChanged; extern NSString *VLCPlaybackHasNextChanged; -extern NSString *VLCPlaylistCurrentItemChanged; +extern NSString *VLCPlaylistCurrentItemIndexChanged; extern NSString *VLCPlaylistItemsAdded; extern NSString *VLCPlaylistItemsRemoved; @@ -77,7 +77,6 @@ * input of the currently playing item @return returns the input item for the currently playing playlist item @note the receiver is responsible for releasing the input item - @note Subscribe to the VLCPlaylistCurrentItemChanged notification to be notified about changes */ @property (readonly, nullable) VLCInputItem *currentlyPlayingInputItem;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/playlist/VLCPlaylistController.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/playlist/VLCPlaylistController.m
Changed
@@ -38,7 +38,7 @@ NSString *VLCPlaybackRepeatChanged = @"VLCPlaybackRepeatChanged"; NSString *VLCPlaybackHasPreviousChanged = @"VLCPlaybackHasPreviousChanged"; NSString *VLCPlaybackHasNextChanged = @"VLCPlaybackHasNextChanged"; -NSString *VLCPlaylistCurrentItemChanged = @"VLCPlaylistCurrentItemChanged"; +NSString *VLCPlaylistCurrentItemIndexChanged = @"VLCPlaylistCurrentItemIndexChanged"; NSString *VLCPlaylistItemsAdded = @"VLCPlaylistItemsAdded"; NSString *VLCPlaylistItemsRemoved = @"VLCPlaylistItemsRemoved"; @@ -57,7 +57,7 @@ - (void)playlistUpdatedForIndex:(size_t)firstUpdatedIndex items:(vlc_playlist_item_t *const *)items count:(size_t)numberOfItems; - (void)playlistPlaybackRepeatUpdated:(enum vlc_playlist_playback_repeat)currentRepeatMode; - (void)playlistPlaybackOrderUpdated:(enum vlc_playlist_playback_order)currentOrder; -- (void)currentPlaylistItemChanged:(size_t)index; +- (void)currentPlaylistItemIndexChanged:(size_t)index; - (void)playlistHasPreviousItem:(BOOL)hasPrevious; - (void)playlistHasNextItem:(BOOL)hasNext; @@ -162,13 +162,13 @@ } static void -cb_playlist_current_item_changed(vlc_playlist_t *playlist, +cb_playlist_current_item_index_changed(vlc_playlist_t *playlist, ssize_t index, void *p_data) { dispatch_async(dispatch_get_main_queue(), ^{ - VLCPlaylistController *playlistController = (__bridge VLCPlaylistController *)p_data; - playlistController currentPlaylistItemChanged:index; + VLCPlaylistController * const playlistController = (__bridge VLCPlaylistController *)p_data; + playlistController currentPlaylistItemIndexChanged:index; }); } @@ -202,7 +202,7 @@ cb_playlist_items_updated, cb_playlist_playback_repeat_changed, cb_playlist_playback_order_changed, - cb_playlist_current_item_changed, + cb_playlist_current_item_index_changed, cb_playlist_has_prev_changed, cb_playlist_has_next_changed, }; @@ -338,11 +338,11 @@ _defaultNotificationCenter postNotificationName:VLCPlaybackOrderChanged object:self; } -- (void)currentPlaylistItemChanged:(size_t)index +- (void)currentPlaylistItemIndexChanged:(size_t)index { _currentPlaylistIndex = index; _playlistDataSource scrollToCurrentPlaylistItem; - _defaultNotificationCenter postNotificationName:VLCPlaylistCurrentItemChanged object:self; + _defaultNotificationCenter postNotificationName:VLCPlaylistCurrentItemIndexChanged object:self; } - (void)playlistHasPreviousItem:(BOOL)hasPrevious
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.h
Changed
@@ -52,8 +52,7 @@ @property (readwrite, strong) IBOutlet VLCImageView *artworkImageView; @property (readwrite, strong) IBOutlet NSButton *artworkButton; -@property (readwrite, strong) IBOutlet VLCWrappableTextField *songNameTextField; -@property (readwrite, strong) IBOutlet VLCWrappableTextField *artistNameTextField; +@property (readwrite, strong) IBOutlet VLCWrappableTextField *playingItemDisplayField; @property (readwrite, strong) IBOutlet VLCTimeField *timeField; @property (readwrite, strong) IBOutlet VLCTimeField *trailingTimeField; @@ -79,5 +78,6 @@ - (void)updateTimeSlider:(NSNotification *)aNotification; - (void)updateVolumeSlider:(NSNotification *)aNotification; - (void)updateMuteVolumeButton:(NSNotification *)aNotification; +- (void)updateCurrentItemDisplayControls:(NSNotification *)aNotification; @end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
Changed
@@ -26,6 +26,8 @@ #import "extensions/NSString+Helpers.h" #import "main/VLCMain.h" #import "playlist/VLCPlaylistController.h" +#import "playlist/VLCPlaylistItem.h" +#import "playlist/VLCPlaylistModel.h" #import "playlist/VLCPlayerController.h" #import "library/VLCInputItem.h" @@ -92,7 +94,8 @@ name:VLCPlayerStateChanged object:nil; notificationCenter addObserver:self - selector:@selector(updatePlaybackControls:) name:VLCPlaylistCurrentItemChanged + selector:@selector(updateCurrentItemDisplayControls:) + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(fullscreenStateUpdated:) @@ -170,6 +173,7 @@ // remove fullscreen button for lion fullscreen if (_nativeFullscreenMode) { self.fullscreenButtonWidthConstraint.constant = 0; + self.fullscreenButton.hidden = YES; } self.backwardButton.accessibilityTitle = _NS("Previous"); @@ -341,17 +345,6 @@ return; } - _songNameTextField.stringValue = inputItem.name; - _artistNameTextField.stringValue = inputItem.artist; - - NSURL *artworkURL = inputItem.artworkURL; - - if (artworkURL) { - _artworkImageView setImageURL:inputItem.artworkURL placeholderImage:NSImage imageNamed:@"noart"; - } else { - _artworkImageView.image = NSImage imageNamed:@"noart"; - } - self.timeSlider setHidden:NO; self.timeSlider setKnobHidden:NO; self.timeSlider setFloatValue:_playerController.position; @@ -426,6 +419,24 @@ self.backwardButton setEnabled: (b_seekable || _playlistController.hasPreviousPlaylistItem || b_chapters); } +- (void)updateCurrentItemDisplayControls:(NSNotification *)aNotification +{ + VLCInputItem * const inputItem = _playerController.currentMedia; + if (!inputItem) { + return; + } + + _playingItemDisplayField.stringValue = inputItem.name; + + NSURL * const artworkURL = inputItem.artworkURL; + + if (artworkURL) { + _artworkImageView setImageURL:inputItem.artworkURL placeholderImage:NSImage imageNamed:@"noart"; + } else { + _artworkImageView.image = NSImage imageNamed:@"noart"; + } +} + - (void)setPause { self.playButton setImage: _pauseImage;
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.h
Added
@@ -0,0 +1,39 @@ +/***************************************************************************** + * VLCMainVideoViewControlsBar.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * Authors: Claudio Cambra <developer@claudiocambra.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + +#import "VLCControlsBarCommon.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCMainVideoViewControlsBar : VLCControlsBarCommon + +@property (readwrite, strong) IBOutlet NSButton *bookmarksButton; +@property (readwrite, strong) IBOutlet NSButton *subtitlesButton; +@property (readwrite, strong) IBOutlet NSButton *audioButton; + +- (IBAction)openBookmarks:(id)sender; +- (IBAction)openSubtitlesMenu:(id)sender; +- (IBAction)openAudioMenu:(id)sender; + +@end + +NS_ASSUME_NONNULL_END
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.m
Added
@@ -0,0 +1,73 @@ +/***************************************************************************** + * VLCMainVideoViewControlsBar.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * Authors: Claudio Cambra <developer@claudiocambra.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + +#import "VLCMainVideoViewControlsBar.h" + +#import "extensions/NSString+Helpers.h" + +#import "main/VLCMain.h" + +#import "menus/VLCMainMenu.h" + +#import "panels/VLCBookmarksWindowController.h" + +#import "playlist/VLCPlaylistController.h" +#import "playlist/VLCPlayerController.h" + +@implementation VLCMainVideoViewControlsBar + +- (void)awakeFromNib +{ + super awakeFromNib; + + _bookmarksButton.toolTip = _NS("Bookmarks"); + _bookmarksButton.accessibilityLabel = _bookmarksButton.toolTip; + + _subtitlesButton.toolTip = _NS("Subtitle settings"); + _subtitlesButton.accessibilityLabel = _subtitlesButton.toolTip; + + _audioButton.toolTip = _NS("Audio settings"); + _audioButton.accessibilityLabel = _audioButton.toolTip; +} + +- (IBAction)openBookmarks:(id)sender +{ + VLCMain.sharedInstance.bookmarks toggleWindow:sender; +} + +- (IBAction)openSubtitlesMenu:(id)sender +{ + NSMenu * const menu = VLCMain.sharedInstance.mainMenu.subtitlesMenu; + menu popUpMenuPositioningItem:nil + atLocation:_subtitlesButton.frame.origin + inView:((NSView *)sender).superview; +} + +- (IBAction)openAudioMenu:(id)sender +{ + NSMenu * const menu = VLCMain.sharedInstance.mainMenu.audioMenu; + menu popUpMenuPositioningItem:nil + atLocation:_audioButton.frame.origin + inView:((NSView *)sender).superview; +} + +@end
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.h
Changed
@@ -43,9 +43,6 @@ @property (readwrite, strong) IBOutlet NSButton *repeatButton; @property (readwrite, strong) IBOutlet NSButton *shuffleButton; -@property (readwrite, strong) IBOutlet NSLayoutConstraint *artistNameTextFieldWidthConstraint; - -@property (readwrite, strong) IBOutlet NSTextField *songArtistSeparatorTextField; @property (readwrite, strong) IBOutlet NSButton *volumeUpButton; - (IBAction)stop:(id)sender;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
Changed
@@ -33,6 +33,8 @@ #import "main/VLCMain.h" #import "playlist/VLCPlaylistController.h" +#import "playlist/VLCPlaylistItem.h" +#import "playlist/VLCPlaylistModel.h" #import "playlist/VLCPlayerController.h" #import "views/VLCTimeField.h" @@ -69,7 +71,7 @@ NSNotificationCenter *notificationCenter = NSNotificationCenter defaultCenter; notificationCenter addObserver:self selector:@selector(updatePlaybackControls:) - name:VLCPlaylistCurrentItemChanged + name:VLCPlayerCurrentMediaItemChanged object:nil; notificationCenter addObserver:self selector:@selector(playbackStateChanged:) @@ -192,6 +194,31 @@ self.volumeUpButton setEnabled: !b_muted; } +- (void)updateCurrentItemDisplayControls:(NSNotification *)aNotification; +{ + super updateCurrentItemDisplayControls:aNotification; + + VLCInputItem * const inputItem = _playerController.currentMedia; + if (!inputItem) { + return; + } + + NSFont * const boldSystemFont = NSFont boldSystemFontOfSize:12.; + NSDictionary<NSString *, id> * const boldAttribute = @{NSFontAttributeName: boldSystemFont}; + + NSMutableAttributedString * const displayString = NSMutableAttributedString alloc initWithString:inputItem.name attributes:boldAttribute; + + if (inputItem.artist.length != 0) { + NSAttributedString * const separator = NSAttributedString alloc initWithString:@" · " attributes:boldAttribute; + displayString appendAttributedString:separator; + + NSAttributedString * const artistString = NSAttributedString alloc initWithString:inputItem.artist; + displayString appendAttributedString:artistString; + } + + self.playingItemDisplayField.attributedStringValue = displayString; +} + - (void)updateMuteVolumeButtonImage { self.muteVolumeButton.image = imageFromRes(@"VLCVolumeOffTemplate");
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/Makefile.am -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/Makefile.am
Changed
@@ -993,6 +993,8 @@ gui/qt/util/qml/VanillaObject.qml \ gui/qt/util/qml/NativeMenu.qml \ gui/qt/util/qml/MLContextMenu.qml \ + gui/qt/util/qml/ListViewRev15.qml \ + gui/qt/util/qml/ListViewRev11.qml \ gui/qt/widgets/qml/ActionButtonOverlay.qml \ gui/qt/widgets/qml/ActionButtonPrimary.qml \ gui/qt/widgets/qml/BannerTabButton.qml \
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/dialogs_provider.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/dialogs_provider.cpp
Changed
@@ -25,6 +25,8 @@ # include "config.h" #endif +#include <vlc_common.h> +#include <vlc_interface.h> #include <vlc_intf_strings.h> #include "qt.hpp" @@ -56,6 +58,8 @@ #include "dialogs/playlists/playlists.hpp" #include "dialogs/firstrun/firstrunwizard.hpp" +#include <vlc_url.h> + #include <QEvent> #include <QApplication> #include <QSignalMapper>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/dialogs_provider.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/dialogs_provider.hpp
Changed
@@ -28,7 +28,7 @@ # include "config.h" #endif -#include <assert.h> +#include <cassert> #include "qt.hpp" @@ -41,6 +41,8 @@ #include <QObject> #include <QStringList> +#include <vlc_es.h> + #define TITLE_EXTENSIONS_MEDIA qtr( "Media Files" ) #define TITLE_EXTENSIONS_VIDEO qtr( "Video Files" ) #define TITLE_EXTENSIONS_AUDIO qtr( "Audio Files" )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/epg/EPGView.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/epg/EPGView.hpp
Changed
@@ -27,8 +27,6 @@ #include "EPGProgram.hpp" -#include <vlc_epg.h> - #include <QGraphicsView> #include <QGraphicsScene> #include <QHash>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/epg/EPGWidget.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/epg/EPGWidget.hpp
Changed
@@ -25,7 +25,6 @@ #include "qt.hpp" -#include <vlc_epg.h> #include <vlc_input_item.h> #include <QWidget>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/extended/extended.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/extended/extended.cpp
Changed
@@ -24,7 +24,7 @@ # include "config.h" #endif -#include <assert.h> +#include <cassert> #include "extended.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/extended/extended_panels.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/extended/extended_panels.cpp
Changed
@@ -52,11 +52,13 @@ #include "util/qt_dirs.hpp" #include "widgets/native/customwidgets.hpp" #include "dialogs/dialogs_provider.hpp" +#include "util/vlctick.hpp" #include "../../../../audio_filter/equalizer_presets.h" #include <vlc_modules.h> #include <vlc_plugin.h> #include <vlc_player.h> +#include <vlc_interface.h> static bool filterIsPresent( const QString &filters, const QString &filter ) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/extensions/extensions.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/extensions/extensions.cpp
Changed
@@ -24,6 +24,7 @@ #include "extensions_manager.hpp" // for isUnloading() #include <vlc_dialog.h> +#include <vlc_extensions.h> #include <QGridLayout> #include <QPushButton>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/extensions/extensions.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/extensions/extensions.hpp
Changed
@@ -24,10 +24,9 @@ #define EXTENSIONS_HPP #include "qt.hpp" -#include <vlc_extensions.h> #include "util/singleton.hpp" -#include "assert.h" +#include <cassert> #include <QDialog> class QObject; @@ -39,6 +38,13 @@ class ExtensionsDialogProvider; class ExtensionDialog; +extern "C" { + struct extensions_manager_t; + struct extension_widget_t; + typedef struct extension_dialog_t extension_dialog_t; + typedef struct extension_t extension_t; +}; + class ExtensionsDialogProvider : public QObject, public Singleton<ExtensionsDialogProvider> { /** This is the dialog provider for Extensions dialogs
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/extensions/extensions_manager.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/extensions/extensions_manager.cpp
Changed
@@ -27,7 +27,8 @@ #include <vlc_modules.h> #include <vlc_interface.h> #include <vlc_playlist.h> -#include "assert.h" +#include <vlc_extensions.h> +#include <cassert> #include <QMenu> #include <QAction>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/extensions/extensions_manager.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/extensions/extensions_manager.hpp
Changed
@@ -27,8 +27,6 @@ # include "config.h" #endif -#include <vlc_extensions.h> - #include "qt.hpp" #include <player/player_controller.hpp> #include "util/singleton.hpp" @@ -40,6 +38,10 @@ class ExtensionsDialogProvider; +extern "C" { + struct extensions_manager_t; +}; + class ExtensionsManager : public QObject, public Singleton<ExtensionsManager> { friend class Singleton<ExtensionsManager>;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/fingerprint/chromaprint.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/fingerprint/chromaprint.cpp
Changed
@@ -24,6 +24,7 @@ #include "chromaprint.hpp" #include <vlc_modules.h> +#include <vlc_fingerprinter.h> Chromaprint::Chromaprint( qt_intf_t *_p_intf ) : p_intf( _p_intf ) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/fingerprint/chromaprint.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/fingerprint/chromaprint.hpp
Changed
@@ -26,9 +26,13 @@ #include <QObject> #include <QString> -#include <vlc_fingerprinter.h> #include "qt.hpp" +extern "C" { + typedef struct fingerprint_request_t fingerprint_request_t; + typedef struct fingerprinter_thread_t fingerprinter_thread_t; +}; + class Chromaprint : public QObject { Q_OBJECT
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/fingerprint/fingerprintdialog.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/fingerprint/fingerprintdialog.cpp
Changed
@@ -25,6 +25,8 @@ #include "dialogs/fingerprint/chromaprint.hpp" +#include <vlc_fingerprinter.h> + #include <QLabel> #include <QListWidgetItem>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/fingerprint/fingerprintdialog.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/fingerprint/fingerprintdialog.hpp
Changed
@@ -27,7 +27,10 @@ #include "qt.hpp" #include <QDialog> -#include <vlc_fingerprinter.h> + +extern "C" { + typedef struct fingerprint_request_t fingerprint_request_t; +}; namespace Ui { class FingerprintDialog;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/gototime/gototime.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/gototime/gototime.cpp
Changed
@@ -26,6 +26,7 @@ #include "gototime.hpp" #include "player/player_controller.hpp" +#include "util/vlctick.hpp" #include <QLabel> #include <QTimeEdit>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/help/aboutmodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/help/aboutmodel.cpp
Changed
@@ -21,7 +21,7 @@ #include "aboutmodel.hpp" -#include "vlc_about.h" +#include <vlc_about.h> AboutModel::AboutModel(QObject *parent) : QObject(parent)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/help/help.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/help/help.cpp
Changed
@@ -43,7 +43,7 @@ #include <QDate> #include <QPushButton> -#include <assert.h> +#include <cassert> HelpDialog::HelpDialog( qt_intf_t *_p_intf ) : QVLCFrame( _p_intf )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/mediainfo/info_panels.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/mediainfo/info_panels.cpp
Changed
@@ -33,9 +33,10 @@ #include "dialogs/fingerprint/fingerprintdialog.hpp" #include "dialogs/fingerprint/chromaprint.hpp" -#include <assert.h> +#include <cassert> #include <vlc_url.h> #include <vlc_meta.h> +#include <vlc_input_item.h> #include <QTreeWidget> #include <QTableWidget>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/messages/messages.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/messages/messages.cpp
Changed
@@ -35,11 +35,12 @@ #include <QMutex> #include <QMutexLocker> -#include <assert.h> +#include <cassert> #include <vlc_common.h> #include <vlc_playlist.h> #include <vlc_interface.h> +#include <vlc_input_item.h> #include "dialogs/messages/messages.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/open/open.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/open/open.cpp
Changed
@@ -32,6 +32,8 @@ #include <QRegExp> #include <QMenu> +#include <vlc_url.h> + #ifndef NDEBUG # define DEBUG_QT 1 #endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/open/open.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/open/open.hpp
Changed
@@ -28,7 +28,6 @@ #endif #include <vlc_common.h> -#include <vlc_url.h> #include "widgets/native/qvlcframe.hpp" #include "dialogs/open/open_panels.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/open/open_panels.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/open/open_panels.cpp
Changed
@@ -29,7 +29,7 @@ # include "config.h" #endif -#include <assert.h> +#include <cassert> #include "qt.hpp" #include "maininterface/mainctx.hpp" @@ -41,6 +41,7 @@ #include <vlc_intf_strings.h> #include <vlc_modules.h> #include <vlc_plugin.h> +#include <vlc_url.h> #ifdef _WIN32 #include <vlc_charset.h> /* FromWide for Win32 */ #endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/open/openurl.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/open/openurl.cpp
Changed
@@ -36,7 +36,7 @@ #include <QVBoxLayout> #include <QLineEdit> -#include <assert.h> +#include <cassert> OpenUrlDialog::OpenUrlDialog( qt_intf_t *_p_intf, bool _bClipboard ) :
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/plugins/plugins.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/plugins/plugins.cpp
Changed
@@ -33,9 +33,10 @@ #include "widgets/native/animators.hpp" #include "util/imagehelper.hpp" -#include <assert.h> +#include <cassert> #include <vlc_modules.h> +#include <vlc_extensions.h> #include <QTreeWidget> #include <QStringList>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/plugins/plugins.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/plugins/plugins.hpp
Changed
@@ -26,9 +26,6 @@ #include "widgets/native/qvlcframe.hpp" #include "util/singleton.hpp" -#include <vlc_extensions.h> -#include <vlc_addons.h> - #include <QStringList> #include <QTreeWidgetItem> #include <QPushButton> @@ -59,6 +56,10 @@ class DelegateAnimationHelper; class AddonsSortFilterProxyModel; +extern "C" { + typedef struct extension_t extension_t; +}; + class PluginDialog : public QVLCFrame, public Singleton<PluginDialog> { Q_OBJECT
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/preferences/complete_preferences.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
Changed
@@ -37,7 +37,7 @@ #include "dialogs/preferences/preferences_widgets.hpp" #include <vlc_modules.h> -#include <assert.h> +#include <cassert> #define ITEM_HEIGHT 25
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/preferences/expert_model.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/preferences/expert_model.hpp
Changed
@@ -27,7 +27,7 @@ # include "config.h" #endif -#include <assert.h> +#include <cassert> #include <QAbstractListModel>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/preferences/preferences_widgets.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/preferences/preferences_widgets.hpp
Changed
@@ -30,7 +30,7 @@ #endif #include "qt.hpp" -#include <assert.h> +#include <cassert> #include <QTreeWidgetItem> #include <QLabel>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/preferences/simple_preferences.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
Changed
@@ -62,7 +62,7 @@ #include <QTreeWidget> #include <QTreeWidgetItem> -#include <assert.h> +#include <cassert> #include <math.h> #define ICON_HEIGHT 48
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/preferences/simple_preferences.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/preferences/simple_preferences.hpp
Changed
@@ -37,8 +37,6 @@ #include "ui_sprefs_interface.h" #include "ui_sprefs_medialibrary.h" -#include <vlc_media_library.h> - class MLFoldersEditor; #ifdef _WIN32
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/sout/profile_selector.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/sout/profile_selector.cpp
Changed
@@ -38,7 +38,7 @@ #include <QListWidgetItem> #include <QFontMetrics> -#include <assert.h> +#include <cassert> #include <vlc_modules.h> #define CATPROP2NAME( val ) QString("valueholder_%1").arg( val )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/dialogs/sout/sout.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/dialogs/sout/sout.cpp
Changed
@@ -33,7 +33,7 @@ #include <QString> -#include <assert.h> +#include <cassert> #include <QWindow> SoutDialog::SoutDialog( QWindow *parent, qt_intf_t *_p_intf, const QString& inputChain )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/compositor.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/compositor.cpp
Changed
@@ -36,6 +36,8 @@ # include "compositor_x11.hpp" #endif +#include <vlc_window.h> + using namespace vlc; template<typename T>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/compositor.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/compositor.hpp
Changed
@@ -27,11 +27,15 @@ #include <QObject> #include <vlc_common.h> -#include <vlc_window.h> #include "qt.hpp" +extern "C" { + typedef struct vlc_window vlc_window_t; + typedef struct vlc_window_cfg vlc_window_cfg_t; +} + class MainCtx; class VideoWindowHandler; class VideoSurfaceProvider;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/compositor_dcomp.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/compositor_dcomp.cpp
Changed
@@ -26,6 +26,8 @@ #include <comdef.h> +#include <vlc_window.h> + #include <QApplication> #include <QDesktopWidget> #include <QQuickWidget>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp
Changed
@@ -25,7 +25,6 @@ #include <memory> #include <vlc_common.h> -#include <vlc_interface.h> /* intf_thread_t */ #include <windows.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/compositor_win7.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/compositor_win7.cpp
Changed
@@ -19,6 +19,8 @@ #include "mainctx_win32.hpp" #include "mainui.hpp" +#include <vlc_window.h> + #define D3D11_NO_HELPERS // avoid tons of warnings #include <d3d11.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/compositor_x11.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/compositor_x11.cpp
Changed
@@ -18,6 +18,11 @@ #include <QX11Info> #include <QScreen> +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#include <vlc_window.h> + #include "compositor_x11.hpp" #include "compositor_x11_renderwindow.hpp" #include "compositor_x11_uisurface.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/mainctx.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/mainctx.cpp
Changed
@@ -64,6 +64,8 @@ #include <QFileInfo> #endif +#include <vlc_interface.h> + #define VLC_REFERENCE_SCALE_FACTOR 96. using namespace vlc::playlist; @@ -310,6 +312,8 @@ loadFromVLCOption(m_pinVideoControls, "qt-pin-controls", &MainCtx::pinVideoControlsChanged); loadFromVLCOption(m_pinOpacity, "qt-fs-opacity", &MainCtx::pinOpacityChanged); + + loadFromVLCOption(m_safeArea, "qt-safe-area", &MainCtx::safeAreaChanged); } void MainCtx::loadFromSettingsImpl(const bool callSignals)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/mainctx.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/mainctx.hpp
Changed
@@ -178,6 +178,7 @@ Q_PROPERTY(QScreen* screen READ screen NOTIFY screenChanged) Q_PROPERTY(bool useGlobalShortcuts READ getUseGlobalShortcuts WRITE setUseGlobalShortcuts NOTIFY useGlobalShortcutsChanged FINAL) Q_PROPERTY(int maxVolume READ maxVolume NOTIFY maxVolumeChanged FINAL) + Q_PROPERTY(float safeArea READ safeArea NOTIFY safeAreaChanged FINAL) Q_PROPERTY(CSDButtonModel *csdButtonModel READ csdButtonModel CONSTANT FINAL) @@ -266,6 +267,8 @@ void setUseGlobalShortcuts(bool useGlobalShortcuts ); inline int maxVolume() const { return m_maxVolume; }; + inline float safeArea() const { return m_safeArea; }; + bool hasEmbededVideo() const; VideoSurfaceProvider* getVideoSurfaceProvider() const; void setVideoSurfaceProvider(VideoSurfaceProvider* videoSurfaceProvider);; @@ -377,6 +380,8 @@ int m_maxVolume = 125; + float m_safeArea = 0.0; + std::unique_ptr<CSDButtonModel> m_csdButtonModel; public slots: @@ -469,6 +474,8 @@ void maxVolumeChanged(); + void safeAreaChanged(); + private: void loadPrefs(bool callSignals); void loadFromSettingsImpl(bool callSignals);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/mainctx_win32.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/mainctx_win32.cpp
Changed
@@ -37,7 +37,7 @@ #include <QBitmap> #include <QTimer> -#include <assert.h> +#include <cassert> #include <QWindow> #include QPNI_HEADER
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/mainui.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/mainui.cpp
Changed
@@ -46,6 +46,7 @@ #include "util/color_svg_image_provider.hpp" #include "util/effects_image_provider.hpp" #include "util/csdbuttonmodel.hpp" +#include "util/vlctick.hpp" #include "dialogs/help/aboutmodel.hpp" #include "dialogs/dialogs_provider.hpp" @@ -341,6 +342,15 @@ qmlRegisterType(QUrl("qrc:///util/TouchScreenTapHandlerRev11.qml"), uri, versionMajor, versionMinor, "TouchScreenTapHandlerCompat"); #endif + qmlRegisterType(QUrl(QStringLiteral( +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + "qrc:///util/ListViewRev15.qml" +#else + "qrc:///util/ListViewRev11.qml" +#endif + )), + uri, versionMajor, versionMinor, "ListViewCompat"); + qmlProtectModule(uri, versionMajor); }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/video_window_handler.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/video_window_handler.cpp
Changed
@@ -119,6 +119,8 @@ m_videoFullScreen = fs; if( fs ) { + m_lastWinGeometry = m_window->geometry(); + int numscreen = var_InheritInteger( m_intf, "qt-fullscreen-screennumber" ); auto screenList = QApplication::screens(); @@ -135,7 +137,6 @@ /* To be sure window is on proper-screen in xinerama */ if( !screenres.contains( m_window->position() ) ) { - m_lastWinGeometry = m_window->geometry(); m_window->setPosition(screenres.x(), screenres.y() ); } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/videosurface.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/videosurface.cpp
Changed
@@ -20,6 +20,7 @@ #include "widgets/native/customwidgets.hpp" //for qtEventToVLCKey #include <QSGRectangleNode> #include <QThreadPool> +#include <vlc_window.h> WindowResizer::WindowResizer(vlc_window_t* window): m_requestedWidth(0),
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/maininterface/videosurface.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/maininterface/videosurface.hpp
Changed
@@ -22,7 +22,10 @@ #include <QMutex> #include <QRunnable> #include "qt.hpp" -#include "vlc_window.h" + +extern "C" { + typedef struct vlc_window vlc_window_t; +} class MainCtx;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/medialib.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/medialib.cpp
Changed
@@ -298,6 +298,26 @@ return; } + auto it = m_inputItemQuery.find(variantList); + + if (it == m_inputItemQuery.end()) + { + it = m_inputItemQuery.insert(variantList, {callback}); + } + else + { + // be patient + + for (const auto& it2 : it.value()) + { + if (callback.strictlyEquals(it2)) + return; + } + + it.value().push_back(callback); // FIXME: Use an ordered set + return; + } + runOnMLThread<Ctx>(this, //ML thread mlIdList(vlc_medialibrary_t* ml, Ctx& ctx){ @@ -326,7 +346,7 @@ } }, //UI thread - this, callback(quint64, Ctx& ctx) mutable + this, it(quint64, Ctx& ctx) mutable { auto jsEngine = qjsEngine(this); if (!jsEngine) @@ -341,7 +361,12 @@ i++; } - callback.call({jsArray}); + for (auto cb : qAsConst(it.value())) // TODO: Qt 6 use const reference + { + cb.call({jsArray}); + } + + m_inputItemQuery.erase(it); }); }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/medialib.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/medialib.hpp
Changed
@@ -218,6 +218,8 @@ quint64 m_taskId = 1; QMap<quint64, RunOnMLThreadBaseRunner*> m_runningTasks; QMultiMap<const QObject*, quint64> m_objectTasks; + + QMap<QVariantList, QVector<QJSValue>> m_inputItemQuery; }; class RunOnMLThreadBaseRunner : public QObject, public QRunnable
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlalbum.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlalbum.cpp
Changed
@@ -18,6 +18,8 @@ #include <cassert> #include "mlalbum.hpp" +#include "util/vlctick.hpp" + MLAlbum::MLAlbum(const vlc_ml_album_t *_data, QObject *_parent) : QObject( _parent ) , MLItem ( MLItemId( _data->i_id, VLC_ML_PARENT_ALBUM ) )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlalbum.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlalbum.hpp
Changed
@@ -18,19 +18,14 @@ #pragma once -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "vlc_common.h" - #include <QObject> #include <QString> #include <QList> #include <memory> -#include "vlc_media_library.h" #include "mlhelper.hpp" #include "mlqmltypes.hpp" -#include "util/vlctick.hpp" + +class VLCTick; class MLAlbum : public QObject, public MLItem {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlalbummodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlalbummodel.cpp
Changed
@@ -18,6 +18,8 @@ #include "mlalbummodel.hpp" +#include "util/vlctick.hpp" + QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumModel::M_names_to_criteria = { {"id", VLC_ML_SORTING_DEFAULT}, {"title", VLC_ML_SORTING_ALBUM},
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlalbumtrack.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlalbumtrack.cpp
Changed
@@ -19,6 +19,7 @@ #include <cassert> #include "mlalbumtrack.hpp" #include "mlhelper.hpp" +#include "util/vlctick.hpp" MLAlbumTrack::MLAlbumTrack(vlc_medialibrary_t* _ml, const vlc_ml_media_t *_data, QObject *_parent ) : QObject( _parent )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlalbumtrack.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlalbumtrack.hpp
Changed
@@ -18,19 +18,19 @@ #pragma once -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "vlc_common.h" - #include <QObject> #include <QString> #include <memory> -#include <vlc_media_library.h> #include "mlhelper.hpp" #include "mlqmltypes.hpp" -#include "util/vlctick.hpp" + +class VLCTick; + +extern "C" { + struct vlc_medialibrary_t; + typedef struct vlc_ml_media_t vlc_ml_media_t; +}; class MLAlbumTrack : public QObject, public MLItem {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp
Changed
@@ -17,6 +17,7 @@ *****************************************************************************/ #include "mlalbumtrackmodel.hpp" +#include "util/vlctick.hpp" QHash<QByteArray, vlc_ml_sorting_criteria_t> MLAlbumTrackModel::M_names_to_criteria = { {"id", VLC_ML_SORTING_DEFAULT},
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlartist.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlartist.hpp
Changed
@@ -19,20 +19,18 @@ #ifndef MLARTIST_HPP #define MLARTIST_HPP -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "vlc_common.h" - #include <QObject> #include <QString> #include <memory> -#include <vlc_media_library.h> #include "mlalbum.hpp" #include "mlhelper.hpp" #include "mlqmltypes.hpp" +extern "C" { + typedef struct vlc_ml_artist_t vlc_ml_artist_t; +}; + class MLArtist : public QObject, public MLItem { Q_OBJECT
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlbasemodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlbasemodel.hpp
Changed
@@ -22,12 +22,12 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "vlc_common.h" +#include <vlc_common.h> #include <memory> #include <QAbstractListModel> -#include "vlc_media_library.h" +#include <vlc_media_library.h> #include "mlqmltypes.hpp" #include "medialib.hpp" #include <memory>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlbookmarkmodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlbookmarkmodel.hpp
Changed
@@ -27,9 +27,8 @@ #endif #include <vlc_common.h> -#include <vlc_media_library.h> +#include <vlc_input_item.h> #include <vlc_player.h> -#include <vlc_threads.h> #include <vlc_cxx_helpers.hpp> #include "mlhelper.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlfolder.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlfolder.cpp
Changed
@@ -20,6 +20,8 @@ #include "mlfolder.hpp" +#include "util/vlctick.hpp" + // Ctor / dtor MLFolder::MLFolder(const vlc_ml_folder_t * data)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlfolder.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlfolder.hpp
Changed
@@ -23,7 +23,8 @@ // MediaLibrary includes #include "mlqmltypes.hpp" -#include "util/vlctick.hpp" + +class VLCTick; class MLFolder : public MLItem {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlfoldersmodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlfoldersmodel.hpp
Changed
@@ -31,7 +31,12 @@ #include "mlhelper.hpp" #include <maininterface/mainctx.hpp> -#include <vlc_media_library.h> + +extern "C" { + struct vlc_medialibrary_t; + typedef struct vlc_ml_folder_t vlc_ml_folder_t; + typedef struct vlc_ml_event_t vlc_ml_event_t; +}; class MLFoldersBaseModel : public QAbstractListModel {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlgroup.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlgroup.cpp
Changed
@@ -20,6 +20,8 @@ #include "mlgroup.hpp" +#include "util/vlctick.hpp" + // VLC includes #include "qt.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlgroup.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlgroup.hpp
Changed
@@ -27,7 +27,8 @@ // MediaLibrary includes #include "mlqmltypes.hpp" -#include "util/vlctick.hpp" + +class VLCTick; class MLGroup : public MLItem {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlhelper.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlhelper.hpp
Changed
@@ -25,7 +25,7 @@ #include "config.h" #endif -#include "vlc_media_library.h" +#include <vlc_media_library.h> #include <QString> // Forward declarations
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mllistcache.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mllistcache.cpp
Changed
@@ -17,7 +17,7 @@ *****************************************************************************/ #include "mllistcache.hpp" -#include "vlc_diffutil.h" +#include <vlc_diffutil.h> namespace {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mllistcache.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mllistcache.hpp
Changed
@@ -23,7 +23,7 @@ # include "config.h" #endif -#include "vlc_common.h" +#include <vlc_common.h> #include <cassert> #include <memory> #include <vector>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlplaylist.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlplaylist.cpp
Changed
@@ -20,6 +20,7 @@ // VLC includes #include "qt.hpp" +#include "util/vlctick.hpp" //------------------------------------------------------------------------------------------------- // Ctor / dtor
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlplaylist.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlplaylist.hpp
Changed
@@ -25,7 +25,8 @@ // MediaLibrary includes #include "mlqmltypes.hpp" -#include "util/vlctick.hpp" + +class VLCTick; class MLPlaylist : public MLItem {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
Changed
@@ -26,6 +26,8 @@ #include <vlc_media_library.h> #include <qt.hpp> +#include "util/vlctick.hpp" + // MediaLibrary includes #include "mlhelper.hpp" #include "mlcustomcover.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlplaylistmedia.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlplaylistmedia.cpp
Changed
@@ -21,6 +21,7 @@ // VLC includes #include <qt.hpp> +#include "util/vlctick.hpp" //------------------------------------------------------------------------------------------------- // Ctor / dtor
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlplaylistmedia.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlplaylistmedia.hpp
Changed
@@ -26,7 +26,8 @@ // MediaLibrary includes // NOTE: We need that header for VideoDescription and AudioDescription. #include "mlvideo.hpp" -#include "util/vlctick.hpp" + +class VLCTick; // Qt includes #include <QUrl>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlplaylistmodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlplaylistmodel.cpp
Changed
@@ -24,6 +24,7 @@ // Util includes #include "util/qmlinputitem.hpp" +#include "util/vlctick.hpp" // MediaLibrary includes #include "mlhelper.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlqueryparams.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlqueryparams.hpp
Changed
@@ -24,7 +24,7 @@ #endif #include <QByteArray> -#include "vlc_media_library.h" +#include <vlc_media_library.h> /** * C++ owned version of vlc_ml_query_params_t, so that it can be moved or
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlurlmodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlurlmodel.hpp
Changed
@@ -25,7 +25,6 @@ #include "mlbasemodel.hpp" -#include <vlc_media_library.h> #include "mlhelper.hpp" #include "mlqmltypes.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlvideo.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlvideo.cpp
Changed
@@ -22,6 +22,7 @@ #include <vlc_thumbnailer.h> #include "mlhelper.hpp" +#include "util/vlctick.hpp" VideoDescription::VideoDescription(const QString &codec, const QString &language, const unsigned int fps) : m_codec(codec) @@ -135,7 +136,7 @@ else if ( maxWidth >= 1440 && maxHeight >= 1080 ) m_resolution = "HD"; else if ( maxWidth >= 720 && maxHeight >= 1280 ) - m_resolution = "720p"; + m_resolution = "720p"; } bool MLVideo::isNew() const
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlvideo.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlvideo.hpp
Changed
@@ -29,10 +29,11 @@ #include <vlc_media_library.h> #include "mlqmltypes.hpp" -#include "util/vlctick.hpp" #include <functional> +class VLCTick; + class VideoDescription { Q_GADGET
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp
Changed
@@ -29,6 +29,7 @@ // Util includes #include "util/covergenerator.hpp" +#include "util/vlctick.hpp" // MediaLibrary includes #include "mlcustomcover.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlvideogroupsmodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlvideogroupsmodel.cpp
Changed
@@ -29,6 +29,7 @@ // Util includes #include "util/covergenerator.hpp" +#include "util/vlctick.hpp" // MediaLibrary includes #include "mlcustomcover.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/mlvideomodel.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/mlvideomodel.cpp
Changed
@@ -18,6 +18,7 @@ #include "mlvideomodel.hpp" #include "mlhelper.hpp" +#include "util/vlctick.hpp" template<typename T> QVariantList getVariantList(const QList<T> & desc)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml
Changed
@@ -116,7 +116,7 @@ onDoubleClicked: itemDoubleClicked(mouse) Widgets.CurrentIndicator { - height: parent.height - (margin * 2) + length: parent.height - (margin * 2) margin: VLCStyle.dp(4, VLCStyle.scale)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
Changed
@@ -135,8 +135,6 @@ Row { anchors.fill: parent - anchors.leftMargin: root.leftPadding - visible: artistModel.count > 0 Widgets.KeyNavigableListView { @@ -179,7 +177,7 @@ text: I18n.qtr("Artists") font.pixelSize: VLCStyle.fontSize_large color: artistList.colorContext.fg.primary - leftPadding: VLCStyle.margin_normal + leftPadding: root.leftPadding + VLCStyle.margin_normal bottomPadding: VLCStyle.margin_small topPadding: VLCStyle.margin_xlarge } @@ -187,6 +185,8 @@ delegate: MusicArtistDelegate { width: artistList.width + leftPadding: root.leftPadding + isCurrent: ListView.isCurrentItem mlModel: artistModel
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml
Changed
@@ -161,9 +161,13 @@ // NOTE: Dropping medialibrary content into the playlist. } else if (Helpers.isValidInstanceOf(item, Widgets.DragItem)) { - item.getSelectedInputItem(function(inputItems) { - model.insert(inputItems, destinationIndex) - }) + if (item.inputItems) { + model.insert(item.inputItems, destinationIndex) + } else { + item.getSelectedInputItem(function(inputItems) { + model.insert(inputItems, destinationIndex) + }) + } } root.forceActiveFocus()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/qml/VideoAll.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/qml/VideoAll.qml
Changed
@@ -54,6 +54,11 @@ property alias dragItem: dragItem + // function(model) -> strings.... + // used to get grid labels per model item + property var gridLabels: getLabel + property var listLabels: getLabel + list: list grid: grid emptyLabel: emptylabel @@ -179,7 +184,7 @@ && gridView.expandIndex !== gridItem.index) ? 0.7 : 1 - labels: root.onLabelGrid(model) + labels: root.gridLabels(model) // FIXME: Sometimes MLBaseModel::getDataAt returns {} so we use 'isNew === true'. showNewIndicator: (model.isNew === true) @@ -267,6 +272,8 @@ onRightClick: root.contextMenu.popup(selectionModel.selectedIndexes, globalMousePos) + coverLabels: root.listLabels + // Functions function onLabels(model) { return root.onLabelList(model); }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
Changed
@@ -55,6 +55,10 @@ contextMenu: Util.MLContextMenu { model: _meta ? _meta.model : null; showPlayAsAudioAction: true } + gridLabels: !!_meta ? _meta.gridLabels : root.getLabel + + listLabels: !!_meta ? _meta.listLabels : root.getLabel + // Functions function _updateMetaModel(groupping) { @@ -89,9 +93,11 @@ function setCurrentItemFocus(reason) { if (headerItem && headerItem.focus) - headerItem.forceActiveFocus(reason) + headerItem.forceActiveFocus(reason) // continue watching section + else if (currentItem.setCurrentItemFocus) + currentItem.setCurrentItemFocus(reason) // grid or list view else - currentItem.setCurrentItemFocus(reason) + currentItem.forceActiveFocus(reason) // empty label } // VideoAll events reimplementation @@ -100,9 +106,6 @@ function onDoubleClick(object) { _meta.onDoubleClick(object) } - function onLabelGrid(object) { return _meta.onLabelGrid(object) } - function onLabelList(object) { return _meta.onLabelList(object) } - function isInfoExpandPanelAvailable(modelIndexData) { return _meta.isInfoExpandPanelAvailable(modelIndexData) } @@ -124,6 +127,10 @@ property var model: MLVideoModel { ml: MediaLib } + property var gridLabels: root.getLabel + + property var listLabels: root.getLabel + function onAction(indexes) { MediaLib.addAndPlay(model.getIdsForIndexes(indexes)) g_mainDisplay.showPlayer() @@ -131,9 +138,6 @@ function onDoubleClick(object) { g_mainDisplay.play(MediaLib, object.id) } - function onLabelGrid(object) { return root.getLabel(object) } - function onLabelList(object) { return root.getLabel(object) } - function isInfoExpandPanelAvailable(modelIndexData) { return true } } } @@ -146,6 +150,14 @@ property var model: MLVideoGroupsModel { ml: MediaLib } + property var gridLabels: function (model) { + return root.getLabelGroup(model, I18n.qtr("%1 Videos")) + } + + property var listLabels: function (model) { + return root.getLabelGroup(model, I18n.qtr("%1")) + } + function onAction(indexes) { var index = indexes0 @@ -171,14 +183,6 @@ root.showList(object, Qt.MouseFocusReason) } - function onLabelGrid(object) { - return root.getLabelGroup(object, I18n.qtr("%1 Videos")) - } - - function onLabelList(object) { - return root.getLabelGroup(object, I18n.qtr("%1")) - } - function isInfoExpandPanelAvailable(modelIndexData) { return modelIndexData.isVideo } @@ -193,6 +197,14 @@ property var model: MLVideoFoldersModel { ml: MediaLib } + property var gridLabels: function (model) { + return root.getLabelGroup(model, I18n.qtr("%1 Videos")) + } + + property var listLabels: function (model) { + return root.getLabelGroup(model, I18n.qtr("%1")) + } + function onAction(indexes) { var index = indexes0 @@ -203,14 +215,6 @@ root.showList(object, Qt.MouseFocusReason) } - function onLabelGrid(object) { - return root.getLabelGroup(object, I18n.qtr("%1 Videos")) - } - - function onLabelList(object) { - return root.getLabelGroup(object, I18n.qtr("%1")) - } - function isInfoExpandPanelAvailable(modelIndexData) { return false }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
Changed
@@ -37,6 +37,8 @@ // NOTE: This is useful for groups because our main criteria is 'name' instead of 'title'. property string mainCriteria: "title" + property alias coverLabels: tableColumns.titlecoverLabels + //--------------------------------------------------------------------------------------------- // Private @@ -162,8 +164,6 @@ titleCover_width: VLCStyle.listAlbumCover_width titleCover_radius: VLCStyle.listAlbumCover_radius - function titlecoverLabels(model) { - return listView_id.onLabels(model); - } + titlecoverLabels: listView_id.onLabels } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/menus/menus.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/menus/menus.cpp
Changed
@@ -33,7 +33,7 @@ #include <vlc_common.h> #include <vlc_intf_strings.h> #include <vlc_aout.h> /* audio_output_t */ -#include <vlc_player.h> +#include <vlc_interface.h> #include "menus.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/menus/qml_menu_wrapper.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/menus/qml_menu_wrapper.cpp
Changed
@@ -49,8 +49,11 @@ if (arrowsize <= 0) arrowsize = 32; + qreal dpr = widget ? widget->devicePixelRatioF() : 1.0; headerOption.rect = QRect(0, 0, arrowsize, arrowsize); - QPixmap arrow(arrowsize, arrowsize); + + QPixmap arrow(arrowsize * dpr, arrowsize * dpr); + arrow.setDevicePixelRatio(dpr); arrow.fill(Qt::transparent); {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/network/mediatreelistener.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/network/mediatreelistener.hpp
Changed
@@ -23,9 +23,7 @@ #include "config.h" #endif -#include <vlc_media_library.h> #include <vlc_media_source.h> -#include <vlc_threads.h> #include <vlc_cxx_helpers.hpp> #include <memory>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/network/networkdevicemodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/network/networkdevicemodel.hpp
Changed
@@ -26,9 +26,7 @@ #include <QAbstractListModel> #include <QUrl> -#include <vlc_media_library.h> #include <vlc_media_source.h> -#include <vlc_threads.h> #include <vlc_cxx_helpers.hpp> #include "mediatreelistener.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/network/networkmediamodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/network/networkmediamodel.hpp
Changed
@@ -25,9 +25,7 @@ #include <QAbstractListModel> -#include <vlc_media_library.h> #include <vlc_media_source.h> -#include <vlc_threads.h> #include <vlc_cxx_helpers.hpp> #include "mediatreelistener.hpp"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/network/networksourcesmodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/network/networksourcesmodel.hpp
Changed
@@ -25,9 +25,7 @@ #include <QAbstractListModel> -#include <vlc_media_library.h> #include <vlc_media_source.h> -#include <vlc_threads.h> #include <vlc_cxx_helpers.hpp> #include <maininterface/mainctx.hpp>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/network/servicesdiscoverymodel.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/network/servicesdiscoverymodel.hpp
Changed
@@ -25,9 +25,7 @@ #include <QAbstractListModel> -#include <vlc_media_library.h> #include <vlc_media_source.h> -#include <vlc_threads.h> #include <vlc_addons.h> #include <vlc_cxx_helpers.hpp>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/player/player_controller.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/player/player_controller.cpp
Changed
@@ -37,7 +37,7 @@ #include <QSignalMapper> #include <QThreadPool> -#include <assert.h> +#include <cassert> #define POSITION_MIN_UPDATE_INTERVAL VLC_TICK_FROM_MS(15) @@ -1126,7 +1126,7 @@ connect( &d_ptr->m_position_timer, &QTimer::timeout, this, &PlayerController::updatePositionFromTimer ); connect( &d_ptr->m_time_timer, &QTimer::timeout, this, &PlayerController::updateTimeFromTimer ); - input_fetcher_cbs.on_art_fetch_ended = onArtFetchEnded_callback; + input_preparser_cbs.on_art_fetch_ended = onArtFetchEnded_callback; } PlayerController::~PlayerController() @@ -1850,10 +1850,10 @@ if ( status & ( ITEM_ART_NOTFOUND|ITEM_ART_FETCHED ) ) return; } - libvlc_ArtRequest( vlc_object_instance(d->p_intf), p_item, - (b_forced) ? META_REQUEST_OPTION_FETCH_ANY - : META_REQUEST_OPTION_FETCH_LOCAL, - &input_fetcher_cbs, this ); + libvlc_MetadataRequest( vlc_object_instance(d->p_intf), p_item, + (b_forced) ? META_REQUEST_OPTION_FETCH_ANY + : META_REQUEST_OPTION_FETCH_LOCAL, + &input_preparser_cbs, this, 0, NULL ); } }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/player/player_controller.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/player/player_controller.hpp
Changed
@@ -487,7 +487,7 @@ QSignalMapper *menusAudioMapper; //used by VLCMenuBar /* updateArt gui request */ - input_fetcher_callbacks_t input_fetcher_cbs; + struct vlc_metadata_cbs input_preparser_cbs; static void onArtFetchEnded_callback(input_item_t *, bool fetched, void *userdata); void onArtFetchEnded(input_item_t *, bool fetched); };
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/player/qml/ControlLayout.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/player/qml/ControlLayout.qml
Changed
@@ -30,43 +30,69 @@ FocusScope { id: controlLayout - signal requestLockUnlockAutoHide(bool lock) + // Properties + + property int contentWidth: 0 + + property int alignment: 0 + + property var altFocusAction: Navigation.defaultNavigationUp + + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + + // Aliases + + property alias count: repeater.count property alias model: repeater.model - readonly property real minimumWidth: { - var minimumWidth = 0 - var count = repeater.count + // Signals - for (var i = 0; i < count; ++i) { - var item = repeater.itemAt(i) + signal requestLockUnlockAutoHide(bool lock) - if (item.minimumWidth !== undefined) - minimumWidth += item.minimumWidth - else - minimumWidth += item.implicitWidth - } + // Settings + + implicitWidth: { + if (count === 0) + return 0 - minimumWidth += ((count - 1) * playerControlLayout.spacing) + var size = 0 - return minimumWidth + for (var i = 0; i < count; ++i) { + size += repeater.itemAt(i).preferredWidth + } + + if (alignment) + // NOTE: We provision the spacing induced by the alignment item. + return size + count * rowLayout.spacing + else + return size + (count - 1) * rowLayout.spacing } - property bool rightAligned: false + implicitHeight: rowLayout.implicitHeight Navigation.navigable: { for (var i = 0; i < repeater.count; ++i) { - if (repeater.itemAt(i).item.focus) { + var item = repeater.itemAt(i).item + + if (item && item.focus) { return true } } return false } - implicitWidth: minimumWidth - implicitHeight: rowLayout.implicitHeight + // Events - property var altFocusAction: Navigation.defaultNavigationUp + Component.onCompleted: { + visibleChanged.connect(_handleFocus) + activeFocusChanged.connect(_handleFocus) + } + + // Functions function _handleFocus() { if (typeof activeFocus === "undefined") @@ -76,16 +102,30 @@ altFocusAction() } - Component.onCompleted: { - visibleChanged.connect(_handleFocus) - activeFocusChanged.connect(_handleFocus) - } + function _updateContentWidth() { + var size = 0 - readonly property ColorContext colorContext: ColorContext { - id: theme - colorSet: ColorContext.Window + for (var i = 0; i < count; i++) { + + var item = repeater.itemAt(i) + + if (item === null || item.isActive === false) + continue + + var width = item.width + + if (width) + size += width + spacing + } + + if (size) + contentWidth = size - spacing + else + contentWidth = size } + // Children + RowLayout { id: rowLayout @@ -94,68 +134,87 @@ spacing: playerControlLayout.spacing Item { - Layout.fillWidth: rightAligned + Layout.fillWidth: (controlLayout.alignment === Qt.AlignRight) } Repeater { id: repeater // NOTE: We apply the 'navigation chain' after adding the item. - onItemAdded: item.applyNavigation() + onItemAdded: { + item.applyNavigation() + + controlLayout._updateContentWidth() + } onItemRemoved: { // NOTE: We update the 'navigation chain' after removing the item. item.removeNavigation() item.recoverFocus(index) + + controlLayout._updateContentWidth() } delegate: Loader { id: loader + // Properties + + // NOTE: This is required for contentWidth because the visible property is delayed. + property bool isActive: (x + minimumWidth <= rowLayout.width) + + property int minimumWidth: { + if (expandable) + return item.minimumWidth + else if (item) + return item.implicitWidth + else + return 0 + } + + property int preferredWidth: (item && item.preferredWidth) ? item.preferredWidth + : minimumWidth + + readonly property bool expandable: (item && item.minimumWidth !== undefined) + + // Settings + source: PlayerControlbarControls.control(model.id).source focus: (index === 0) - Layout.alignment: Qt.AlignVCenter | (rightAligned ? Qt.AlignRight : Qt.AlignLeft) - Layout.minimumWidth: minimumWidth Layout.fillWidth: expandable - Layout.maximumWidth: item.implicitWidth - readonly property real minimumWidth: (expandable ? item.minimumWidth : item.implicitWidth) - readonly property bool expandable: (item.minimumWidth !== undefined) + Layout.minimumWidth: minimumWidth + + Layout.preferredWidth: preferredWidth + + Layout.maximumWidth: preferredWidth + + Layout.alignment: (Qt.AlignVCenter | controlLayout.alignment) BindingCompat { delayed: true // this is important target: loader
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/player/qml/PlayerControlLayout.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/player/qml/PlayerControlLayout.qml
Changed
@@ -26,48 +26,130 @@ FocusScope { id: playerControlLayout - implicitWidth: layoutLoader_left.implicitWidth + layoutLoader_center.implicitWidth + layoutLoader_right.implicitWidth + 2 * layoutSpacing - implicitHeight: VLCStyle.maxControlbarControlHeight + // Properties property real defaultSize: VLCStyle.icon_normal // default size for IconToolButton based controls property real spacing: VLCStyle.margin_normal // spacing between controls - property real layoutSpacing: VLCStyle.margin_xxlarge // spacing between layouts (left, center, and right) + + property real layoutSpacing: VLCStyle.margin_xlarge // spacing between layouts (left, center, and right) property int identifier: -1 + readonly property PlayerControlbarModel model: { if (!!MainCtx.controlbarProfileModel.currentModel) - MainCtx.controlbarProfileModel.currentModel.getModel(identifier) + return MainCtx.controlbarProfileModel.currentModel.getModel(identifier) else - null + return null } + readonly property ColorContext colorContext: ColorContext { + id: theme + colorSet: ColorContext.Window + } + + // Private + + property int _minimumSpacing: layoutSpacing - spacing + + // Signals + signal requestLockUnlockAutoHide(bool lock) + // Settings + + implicitHeight: VLCStyle.maxControlbarControlHeight + + // Events + Component.onCompleted: { console.assert(identifier >= 0) + + _updateLayout() } - readonly property ColorContext colorContext: ColorContext { - id: theme - colorSet: ColorContext.Window + onWidthChanged: _updateLayout() + + // Functions + + function _updateLayout() { + var item = loaderCenter.item + + // NOTE: Sometimes this gets called before the item is loaded. + if (item === null) + return + + if (item.count) { + + loaderCenter.width = Math.min(loaderCenter.implicitWidth, width) + + loaderLeft.width = loaderCenter.x - _minimumSpacing + + loaderRight.width = width - loaderCenter.x - loaderCenter.width - _minimumSpacing + + } else if (loaderRight.item.count) { + + var implicitLeft = loaderLeft.implicitWidth + var implicitRight = loaderRight.implicitWidth + + var total = implicitLeft + implicitRight + + var size = total + _minimumSpacing + + if (size > width) { + size = width - _minimumSpacing + + // NOTE: When both sizes are equals we expand on the left. + if (implicitLeft >= implicitRight) { + + loaderRight.width = Math.round(size * (implicitRight / total)) + + item = loaderRight.item + + if (item === null) + return + + var contentWidth = item.contentWidth + + // NOTE: We assign the remaining width based on the contentWidth. + if (contentWidth) + loaderLeft.width = width - contentWidth - _minimumSpacing + else + loaderLeft.width = width + } else { + loaderLeft.width = Math.round(size * (implicitLeft / total)) + + item = loaderLeft.item + + if (item === null) + return + + var contentWidth = item.contentWidth + + // NOTE: We assign the remaining width based on the contentWidth. + if (contentWidth) + loaderRight.width = width - contentWidth - _minimumSpacing + else + loaderRight.width = width + } + } else { + loaderLeft.width = implicitLeft + loaderRight.width = implicitRight + } + } else + loaderLeft.width = width } - Loader { - id: layoutLoader_left + // Children - anchors { - right: layoutLoader_center.left - left: parent.left - top: parent.top - bottom: parent.bottom + Loader { + id: loaderLeft - // Spacing for the filler item acts as padding - rightMargin: layoutSpacing - spacing - } + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom - active: !!playerControlLayout.model - && !!playerControlLayout.model.left + active: !!playerControlLayout.model && !!playerControlLayout.model.left focus: true @@ -79,31 +161,32 @@ ctx: MainCtx } - Navigation.parentItem: playerControlLayout - Navigation.rightItem: layoutLoader_center.item + alignment: Qt.AlignLeft focus: true altFocusAction: Navigation.defaultNavigationRight + Navigation.parentItem: playerControlLayout + Navigation.rightItem: loaderCenter.item + + onImplicitWidthChanged: playerControlLayout._updateLayout() + + onCountChanged: playerControlLayout._updateLayout() + onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock) } } Loader { - id: layoutLoader_center + id: loaderCenter - anchors { - horizontalCenter: parent.horizontalCenter - top: parent.top - bottom: parent.bottom - } + anchors.top: parent.top + anchors.bottom: parent.bottom - active: !!playerControlLayout.model - && !!playerControlLayout.model.center + anchors.horizontalCenter: parent.horizontalCenter - width: (parent.width < implicitWidth) ? parent.width - : implicitWidth + active: !!playerControlLayout.model && !!playerControlLayout.model.center sourceComponent: ControlLayout { model: ControlListFilter { @@ -113,33 +196,30 @@ ctx: MainCtx }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
Changed
@@ -33,6 +33,12 @@ readonly property real minimumWidth: coverRect.implicitWidth + + (leftPadding + rightPadding) + readonly property int preferredWidth: minimumWidth + contentItem.spacing * 2 + + + Math.max(titleLabel.implicitWidth, + artistLabel.implicitWidth, + progressIndicator.implicitWidth) + property bool _keyPressed: false text: I18n.qtr("Open player")
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/playlist_common.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/playlist_common.cpp
Changed
@@ -18,6 +18,12 @@ #include "playlist_common.hpp" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#include <vlc_playlist.h> + + PlaylistPtr::PlaylistPtr() : m_playlist(nullptr) @@ -38,3 +44,13 @@ return *this; } +PlaylistLocker::PlaylistLocker(vlc_playlist_t* playlist) + : m_playlist(playlist) +{ + vlc_playlist_Lock(m_playlist); +} + +PlaylistLocker::~PlaylistLocker() +{ + vlc_playlist_Unlock(m_playlist); +}
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/playlist_common.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/playlist_common.hpp
Changed
@@ -18,12 +18,11 @@ #ifndef PLAYLIST_COMMON_HPP #define PLAYLIST_COMMON_HPP -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include <QObject> -#include <vlc_playlist.h> + +extern "C" { + typedef struct vlc_playlist vlc_playlist_t; +} // QObject wrapper to carry playlist ptr through QML class PlaylistPtr @@ -41,17 +40,11 @@ class PlaylistLocker { public: - inline PlaylistLocker(vlc_playlist_t* playlist) - : m_playlist(playlist) - { - vlc_playlist_Lock(m_playlist); - } + PlaylistLocker(vlc_playlist_t* playlist); - inline ~PlaylistLocker() - { - vlc_playlist_Unlock(m_playlist); - } + ~PlaylistLocker(); +private: vlc_playlist_t* m_playlist; };
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/playlist_controller.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/playlist_controller.cpp
Changed
@@ -22,8 +22,8 @@ #include "playlist_controller.hpp" #include "playlist_controller_p.hpp" -#include "vlc_player.h" -#include "vlc_url.h" +#include <vlc_player.h> +#include <vlc_url.h> #include "util/qmlinputitem.hpp" #include <algorithm> #include <QVariant>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/playlist_item.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/playlist_item.cpp
Changed
@@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #include "playlist_item.hpp" +#include <vlc_input_item.h> //namespace vlc { //namespace playlist {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/playlist_item.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/playlist_item.hpp
Changed
@@ -22,9 +22,8 @@ # include "config.h" #endif -#include "vlc_player.h" +#include <vlc_common.h> #include <vlc_cxx_helpers.hpp> -#include <vlc_input_item.h> #include <vlc_playlist.h> #include <QExplicitlySharedDataPointer> #include <QUrl>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/playlist_model.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/playlist_model.cpp
Changed
@@ -23,7 +23,7 @@ #include "playlist_model.hpp" #include "playlist_model_p.hpp" #include <algorithm> -#include <assert.h> +#include <cassert> #include "util/qmlinputitem.hpp" namespace vlc {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/qml/PlaylistDelegate.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
Changed
@@ -44,11 +44,11 @@ // Settings - topPadding: VLCStyle.margin_xxsmall + topPadding: VLCStyle.playlistDelegate_verticalPadding - bottomPadding: VLCStyle.margin_xxsmall + bottomPadding: VLCStyle.playlistDelegate_verticalPadding - leftPadding: VLCStyle.margin_normal + leftPadding: VLCStyle.margin_xxsmall rightPadding: Math.max(listView.scrollBarWidth, VLCStyle.margin_normal) @@ -112,12 +112,34 @@ contentItem: RowLayout { spacing: 0 + Widgets.CurrentIndicator { + id: currentIndicator + + // disable positioning via CurrentIndicator, manually position according to RowLayout + source: null + + implicitWidth: VLCStyle.heightBar_xxxsmall + Layout.fillHeight: true + + color: { + if (model.isCurrent) + return theme.accent + + // based on design, ColorContext can't handle this case + if (!delegate.hovered) + return VLCStyle.setColorAlpha(theme.indicator, 0) + + return theme.indicator + } + } + Item { id: artworkItem - Layout.preferredHeight: VLCStyle.icon_normal - Layout.preferredWidth: VLCStyle.icon_normal + Layout.preferredHeight: VLCStyle.icon_playlistArt + Layout.preferredWidth: VLCStyle.icon_playlistArt Layout.alignment: Qt.AlignVCenter + Layout.leftMargin: VLCStyle.margin_xsmall Accessible.role: Accessible.Graphic Accessible.name: I18n.qtr("Cover") @@ -178,7 +200,7 @@ Layout.fillWidth: true Layout.fillHeight: true Layout.leftMargin: VLCStyle.margin_large - spacing: 0 + spacing: VLCStyle.margin_xsmall Widgets.ListLabel { id: textInfo @@ -198,7 +220,6 @@ Layout.fillHeight: true Layout.fillWidth: true - font.weight: model.isCurrent ? Font.DemiBold : Font.Normal text: (model.artist ? model.artist : I18n.qtr("Unknown Artist")) color: theme.fg.primary verticalAlignment: Text.AlignBottom
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/playlist/qml/PlaylistListView.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/playlist/qml/PlaylistListView.qml
Changed
@@ -102,13 +102,17 @@ // NOTE: Dropping medialibrary content into the queue. } else if (Helpers.isValidInstanceOf(item, Widgets.DragItem)) { - item.getSelectedInputItem(function(inputItems) { - if (!Array.isArray(inputItems) || inputItems.length === 0) { - console.warn("can't convert items to input items"); - return - } - mainPlaylistController.insert(index, inputItems, false) - }) + if (item.inputItems) { + mainPlaylistController.insert(index, item.inputItems, false) + } else { + item.getSelectedInputItem(function(inputItems) { + if (!Array.isArray(inputItems) || inputItems.length === 0) { + console.warn("can't convert items to input items"); + return + } + mainPlaylistController.insert(index, inputItems, false) + }) + } // NOTE: Dropping an external item (i.e. filesystem) into the queue. } else if (drop.hasUrls) { @@ -238,7 +242,8 @@ spacing: VLCStyle.margin_large Widgets.IconLabel { - Layout.preferredWidth: VLCStyle.icon_playlistHeader + // playlist cover column + Layout.preferredWidth: VLCStyle.icon_playlistArt horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/qt.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/qt.cpp
Changed
@@ -73,8 +73,10 @@ #include <QVector> #include "playlist/playlist_item.hpp" +#include <vlc_interface.h> #include <vlc_plugin.h> #include <vlc_window.h> +#include <vlc_player.h> #include <vlc_cxx_helpers.hpp> #include <QQuickWindow> @@ -227,6 +229,11 @@ #define SMOOTH_SCROLLING_TEXT N_( "Use smooth scrolling in Flickable based views" ) #define SMOOTH_SCROLLING_LONGTEXT N_( "Deactivating this option will disable smooth scrolling in Flickable based views (such as the Playqueue)" ) +#define SAFE_AREA_TEXT N_( "Safe area for the user interface" ) +#define SAFE_AREA_LONGTEXT N_( "Sets the safe area percentage between 0.0 and 100 when you want " \ + "to ensure the visibility of the user interface on a constrained " \ + "viewport" ) + static const int initial_prefs_view_list = { 0, 1, 2 }; static const char *const initial_prefs_view_list_texts = { N_("Simple"), N_("Advanced"), N_("Expert") }; @@ -393,6 +400,8 @@ add_bool( "qt-smooth-scrolling", true, SMOOTH_SCROLLING_TEXT, SMOOTH_SCROLLING_LONGTEXT ) + add_float_with_range( "qt-safe-area", 0, 0, 100.0, SAFE_AREA_TEXT, SAFE_AREA_LONGTEXT ) + cannot_unload_broken_library() add_submodule () @@ -1005,3 +1014,14 @@ return ret ? VLC_SUCCESS : VLC_EGENERIC; } } + +vlc_player_locker::vlc_player_locker( vlc_player_t* p_player ) + : p_player( p_player ) +{ + vlc_player_Lock( p_player ); +} + +vlc_player_locker::~vlc_player_locker() +{ + vlc_player_Unlock( p_player ); +}
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/qt.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/qt.hpp
Changed
@@ -29,7 +29,6 @@ #endif #include <vlc_common.h> -#include <vlc_player.h> #include <qconfig.h> @@ -67,6 +66,7 @@ typedef struct intf_dialog_args_t intf_dialog_args_t; typedef struct vlc_playlist vlc_playlist_t; typedef struct intf_thread_t intf_thread_t; +typedef struct vlc_player_t vlc_player_t; } namespace vlc { @@ -122,16 +122,8 @@ * destroyed. */ struct vlc_player_locker { - vlc_player_locker( vlc_player_t* p_player ) - : p_player( p_player ) - { - vlc_player_Lock( p_player ); - } - - ~vlc_player_locker() - { - vlc_player_Unlock( p_player ); - } + vlc_player_locker( vlc_player_t* ); + ~vlc_player_locker(); private: vlc_player_t* p_player;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/VLCStyle.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/VLCStyle.qml
Changed
@@ -114,6 +114,7 @@ readonly property int icon_actionButton: icon_normal readonly property int icon_PIP: icon_normal readonly property int icon_CSD: icon_small + readonly property int icon_playlistArt: dp(32, scale) readonly property int play_cover_small: dp(24, scale) readonly property int play_cover_normal: dp(48, scale) @@ -222,6 +223,8 @@ readonly property int artistBanner_height: dp(200, scale) + readonly property int playlistDelegate_verticalPadding: dp(6, scale) + //global application size, updated by the root widget property int appWidth: 0 property int appHeight: 0 @@ -230,8 +233,8 @@ readonly property bool isScreenSmall: appWidth <= smallWidth //global application margin "safe area" - readonly property int applicationHorizontalMargin: 0 - readonly property int applicationVerticalMargin: 0 + readonly property int applicationHorizontalMargin: MainCtx.safeArea * appWidth / 100 + readonly property int applicationVerticalMargin: applicationHorizontalMargin readonly property int globalToolbar_height: dp(40, scale) readonly property int localToolbar_height: dp(48, scale)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/colorcontext.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/colorcontext.cpp
Changed
@@ -402,6 +402,11 @@ return getColor(Decoration, Separator); } +QColor ColorContext::indicator() const +{ + return getColor(Decoration, Indicator); +} + QColor ColorContext::shadow() const { return getColor(Decoration, Shadow);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/colorcontext.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/colorcontext.hpp
Changed
@@ -117,6 +117,7 @@ Accent = VQTC_NAME_ACCENT, Shadow = VQTC_NAME_SHADOW, Separator = VQTC_NAME_SEPARATOR, + Indicator = VQTC_NAME_INDICATOR }; Q_PROPERTY(SystemPalette* palette READ palette WRITE setPalette NOTIFY paletteChanged FINAL) @@ -139,6 +140,7 @@ Q_PROPERTY(QColor visualFocus READ visualFocus NOTIFY colorsChanged FINAL) Q_PROPERTY(QColor border READ border NOTIFY colorsChanged FINAL) Q_PROPERTY(QColor separator READ separator NOTIFY colorsChanged FINAL) + Q_PROPERTY(QColor indicator READ indicator NOTIFY colorsChanged FINAL) Q_PROPERTY(QColor shadow READ shadow NOTIFY colorsChanged FINAL) Q_PROPERTY(QColor accent READ accent NOTIFY colorsChanged FINAL) @@ -160,6 +162,7 @@ QColor visualFocus() const; QColor border() const; QColor separator() const; + QColor indicator() const; QColor shadow() const; QColor accent() const;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/gtkthemeprovider/gtk_compat.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/gtkthemeprovider/gtk_compat.h
Changed
@@ -24,8 +24,8 @@ # include "config.h" #endif -#include "vlc_common.h" -#include "vlc_picture.h" +#include <vlc_common.h> +#include <vlc_picture.h> #include <algorithm>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/gtkthemeprovider/gtk_util.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/gtkthemeprovider/gtk_util.h
Changed
@@ -35,7 +35,7 @@ #include "gtk_compat.h" #include "scoped_gobject.h" -#include "vlc_picture.h" +#include <vlc_picture.h> namespace gtk {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/gtkthemeprovider/gtkthemeprovider.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/gtkthemeprovider/gtkthemeprovider.cpp
Changed
@@ -359,6 +359,9 @@ setGtkColorSetFg(obj, CS, VQTC_NAME_PRIMARY, ITEM_SELECTOR); setGtkColorSetBorder(obj, CS, ITEM_SELECTOR); setGtkColorSetHighlight(obj, CS, ITEM_SELECTOR); + + const auto separator = GetSeparatorColor(" GtkListBoxRow#separator.horizontal"); + setGtkColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_INDICATOR, VQTC_STATE_NORMAL, separator); } #define COMBOBOX_SELECTOR VIEW_SELECTOR " GtkComboBoxText#combobox #box.linked #entry.combo"
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/qtthemeprovider.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/qtthemeprovider.hpp
Changed
@@ -74,6 +74,7 @@ VQTC_NAME_ACCENT, VQTC_NAME_SHADOW, VQTC_NAME_SEPARATOR, + VQTC_NAME_INDICATOR, VQTC_NAME_COUNT };
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/systempalette.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/systempalette.cpp
Changed
@@ -561,6 +561,9 @@ setColor(CS, C::Fg, C::Primary, C::Normal, Qt::black); setColor(CS, C::Fg, C::Secondary, C::Normal, setColorAlpha(Qt::black, 0.6)); + + setColor(CS, C::Decoration, C::Indicator, C::Normal, QColor("#9e9e9e")); //FIXME not a predef + } //Accent Buttons @@ -755,6 +758,8 @@ setColor(CS, C::Fg, C::Primary, C::Normal, Qt::white); setColor(CS, C::Fg, C::Secondary, C::Normal, setColorAlpha(Qt::white, 0.6)); + + setColor(CS, C::Decoration, C::Indicator, C::Normal, QColor("#666666")); //FIXME not a predef } //Accent Buttons
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/systempalettethemeprovider.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/systempalettethemeprovider.cpp
Changed
@@ -327,6 +327,13 @@ setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_HIGHLIGHT, VQTC_STATE_FOCUSED, hightlightHover); setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_HIGHLIGHT, VQTC_STATE_HOVERED, hightlightHover); setQtColor(obj, CS, VQTC_SECTION_FG, VQTC_NAME_HIGHLIGHT, VQTC_STATE_NORMAL, textOnHightlight); + + + const auto bg = palette.color(QPalette::AlternateBase); + const auto indicator = sys->m_isDark ? bg.lighter() : bg.darker(); + setQtColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_INDICATOR + , VQTC_STATE_NORMAL, indicator); + } //Badge
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/style/windowsthemeprovider.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/style/windowsthemeprovider.cpp
Changed
@@ -171,6 +171,8 @@ setQtColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_BORDER, VQTC_STATE_NORMAL, COLOR_BTNTEXT); setQtColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_BORDER, VQTC_STATE_FOCUSED, COLOR_HIGHLIGHT); setQtColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_BORDER, VQTC_STATE_HOVERED, COLOR_HIGHLIGHT); + + setQtColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_INDICATOR, VQTC_STATE_NORMAL, COLOR_HIGHLIGHT); } //set colors on all buttons
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/util/audio_device_model.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/audio_device_model.cpp
Changed
@@ -17,6 +17,8 @@ *****************************************************************************/ #include "audio_device_model.hpp" +#include <vlc_player.h> +#include <vlc_aout.h> extern "C" {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/util/audio_device_model.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/audio_device_model.hpp
Changed
@@ -21,12 +21,13 @@ #include <QAbstractListModel> -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include "qt.hpp" -#include <vlc_aout.h> + +extern "C" { + typedef struct vlc_player_aout_listener_id vlc_player_aout_listener_id; + typedef struct audio_output audio_output_t; + typedef struct vlc_player_t vlc_player_t; +} class AudioDeviceModel : public QAbstractListModel {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/util/effects_image_provider.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/effects_image_provider.cpp
Changed
@@ -77,12 +77,12 @@ // Copy the mask QPainter painter(&ret); painter.setCompositionMode(QPainter::CompositionMode_Source); - const auto radius = effectiveBlurRadius(); + const auto radius = m_blurRadius; painter.drawImage(radius + m_xOffset, radius + m_yOffset, mask); } // Blur the mask - qt_blurImage(ret, effectiveBlurRadius(), false); + qt_blurImage(ret, m_blurRadius, false); return ret; } @@ -90,8 +90,8 @@ constexpr QSize boundingSize(const QSize& size) const { // Size of bounding rectangle of the effect - const qreal radius = 2 * effectiveBlurRadius(); - return size + QSize(qAbs(m_xOffset) + radius, qAbs(m_yOffset) + radius); + const qreal diameter = m_blurRadius * 2; + return size + QSize(qAbs(m_xOffset) + diameter, qAbs(m_yOffset) + diameter); } protected: @@ -99,13 +99,6 @@ QColor m_color {63, 63, 63, 180}; qreal m_xOffset = 0.0; qreal m_yOffset = 0.0; - -private: - constexpr qreal effectiveBlurRadius() const - { - // Translated blur radius for the Qt blur algorithm - return 2.5 * (m_blurRadius + 1); - } }; class RoundedRectDropShadowEffect : public RectDropShadowEffect
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/qml/ListViewRev11.qml
Added
@@ -0,0 +1,24 @@ +/***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + + +import QtQuick 2.11 + +ListView { + +}
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/qml/ListViewRev15.qml
Added
@@ -0,0 +1,24 @@ +/***************************************************************************** + * Copyright (C) 2023 VLC authors and VideoLAN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + *****************************************************************************/ + + +import QtQuick 2.15 + +ListView { + +}
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/util/renderer_manager.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/renderer_manager.cpp
Changed
@@ -1,12 +1,34 @@ #include "renderer_manager.hpp" +#include <vlc_player.h> + #include <QApplication> +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <vlc_common.h> +#include <vlc_renderer_discovery.h> +#include <vlc_player.h> + const QEvent::Type RendererManagerEvent::AddedEvent = (QEvent::Type)QEvent::registerEventType(); const QEvent::Type RendererManagerEvent::RemovedEvent = (QEvent::Type)QEvent::registerEventType(); +RendererManagerEvent::RendererManagerEvent(Type type, vlc_renderer_item_t* p_item_) + : QEvent( type ), p_item( p_item_ ) +{ + vlc_renderer_item_hold( p_item ); +} + +RendererManagerEvent::~RendererManagerEvent() +{ + vlc_renderer_item_release( p_item ); +} + + RendererManager::RendererManager( qt_intf_t *p_intf_ ) : p_intf( p_intf_ ), p_selected_item( NULL ) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/util/renderer_manager.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/renderer_manager.hpp
Changed
@@ -1,37 +1,27 @@ #ifndef RENDERER_MANAGER_HPP #define RENDERER_MANAGER_HPP -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include "qt.hpp" #include "util/singleton.hpp" -#include <vlc_common.h> -#include <vlc_renderer_discovery.h> - #include <QObject> #include <QEvent> #include <QTimer> #include <QVector> #include <QHash> +extern "C" { + typedef struct vlc_renderer_item_t vlc_renderer_item_t; +} + class RendererManagerEvent : public QEvent { public: static const QEvent::Type AddedEvent; static const QEvent::Type RemovedEvent; - RendererManagerEvent( QEvent::Type type, vlc_renderer_item_t *p_item_ ) - : QEvent( type ), p_item( p_item_ ) - { - vlc_renderer_item_hold( p_item ); - } - virtual ~RendererManagerEvent() - { - vlc_renderer_item_release( p_item ); - } + RendererManagerEvent( QEvent::Type type, vlc_renderer_item_t *p_item_ ); + virtual ~RendererManagerEvent(); vlc_renderer_item_t * getItem() const { return p_item; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/util/varcommon_p.hpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/util/varcommon_p.hpp
Changed
@@ -21,7 +21,6 @@ #include <vlc_cxx_helpers.hpp> #include <vlc_vout.h> #include <vlc_aout.h> -#include <vlc_interface.h> struct VLCObjectHolder {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/vlc.qrc -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/vlc.qrc
Changed
@@ -82,6 +82,8 @@ <file alias="VanillaObject.qml">util/qml/VanillaObject.qml</file> <file alias="NativeMenu.qml">util/qml/NativeMenu.qml</file> <file alias="MLContextMenu.qml">util/qml/MLContextMenu.qml</file> + <file alias="ListViewRev15.qml">util/qml/ListViewRev15.qml</file> + <file alias="ListViewRev11.qml">util/qml/ListViewRev11.qml</file> </qresource> <qresource prefix="/sd"> <file alias="capture-card.svg">pixmaps/sd/capture-card.svg</file>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/native/interface_widgets.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/native/interface_widgets.cpp
Changed
@@ -39,7 +39,7 @@ #include <QUrl> #include <math.h> -#include <assert.h> +#include <cassert> #include <vlc_player.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/BannerTabButton.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/BannerTabButton.qml
Changed
@@ -130,7 +130,7 @@ } Widgets.CurrentIndicator { - width: tabRow.width + length: tabRow.width orientation: Qt.Horizontal
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/CurrentIndicator.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/CurrentIndicator.qml
Changed
@@ -23,6 +23,7 @@ import "qrc:///style/" Rectangle { + id: root property int orientation: Qt.Vertical property int margin: VLCStyle.margin_xxxsmall @@ -31,37 +32,33 @@ id: theme } - color: theme.accent - width: orientation === Qt.Vertical ? VLCStyle.heightBar_xxxsmall : parent.width - height: orientation === Qt.Horizontal ? VLCStyle.heightBar_xxxsmall : parent.height + property Item source: parent + + property int length: 0 - onOrientationChanged: { - if (orientation == Qt.Vertical) { - anchors.horizontalCenter = undefined - anchors.verticalCenter = Qt.binding(function () { - return parent.verticalCenter - }) - anchors.left = Qt.binding(function () { - return parent.left - }) - anchors.right = undefined - anchors.leftMargin = Qt.binding(function () { - return margin - }) - anchors.bottomMargin = 0 - } else { - anchors.top = undefined - anchors.bottom = Qt.binding(function () { - return parent.bottom - }) - anchors.horizontalCenter = Qt.binding(function () { - return parent.horizontalCenter - }) - anchors.verticalCenter = undefined - anchors.leftMargin = 0 - anchors.bottomMargin = Qt.binding(function () { - return margin - }) + property var _position: + { + // for orientation == Qt.Vertical + "width" : VLCStyle.heightBar_xxxsmall, + "height": root.length, + "x": margin, + "y": !!source ? (source.height - root.length) / 2 : 0 + }, + { + // for orientation == Qt.Horizontal + "width": root.length, + "height": VLCStyle.heightBar_xxxsmall, + "x": !!source ? (source.width - root.length) / 2 : 0, + "y": !!source ? source.height - margin : 0, } - } + + + property var _currentPosition: (orientation === Qt.Vertical) ? _position0 : _position1 + + color: theme.accent + + x: _currentPosition.x + y: _currentPosition.y + width: _currentPosition.width + height: _currentPosition.height }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/DragItem.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/DragItem.qml
Changed
@@ -60,6 +60,8 @@ // string => role property string titleRole: "title" + readonly property var inputItems: _inputItems + function coversXPos(index) { return VLCStyle.margin_small + (coverSize / 3) * index; } @@ -82,6 +84,8 @@ if (!dragItem._active) return + Qt.callLater(dragItem.getSelectedInputItem, dragItem.setInputItems) + var covers = var titleList = @@ -107,6 +111,16 @@ _title = titleList.join(",") + (indexes.length > _maxCovers ? "..." : "") } + function setInputItems(inputItems) { + if (!Array.isArray(inputItems) || inputItems.length === 0) { + console.warn("can't convert items to input items"); + dragItem._inputItems = null + return + } + + dragItem._inputItems = inputItems + } + //--------------------------------------------------------------------------------------------- // Private @@ -118,6 +132,8 @@ readonly property int _displayedCoversCount: Math.min(_indexesSize, _maxCovers + 1) + property var _inputItems + property var _data: property var _covers: @@ -131,6 +147,9 @@ // TODO: Rework D&D positioning if (!Drag.active) x = y = -1 + + if (!Drag.active) + dragItem._inputItems = undefined } //---------------------------------------------------------------------------------------------
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/FadingEdgeListView.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/FadingEdgeListView.qml
Changed
@@ -22,7 +22,7 @@ import "qrc:///style/" import "qrc:///util/Helpers.js" as Helpers -ListView { +ListViewCompat { id: root // backgroundColor is only needed for sub-pixel
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/KeyNavigableListView.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/KeyNavigableListView.qml
Changed
@@ -106,6 +106,13 @@ // Events + Component.onCompleted: { + if (typeof root.reuseItems === "boolean") { + // Qt 5.15 feature, on by default here: + root.reuseItems = true + } + } + // NOTE: We always want a valid 'currentIndex' by default. onCountChanged: if (count && currentIndex === -1) currentIndex = 0
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
Changed
@@ -349,7 +349,7 @@ Text { text: (root.model.sortOrder === Qt.AscendingOrder) ? "â–Ľ" : "â–˛" - visible: root.model.sortCriteria === modelData.criteria + visible: root.model.sortCriteria === modelData.model.criteria font.pixelSize: VLCStyle.fontSize_normal color: root.colorContext.accent @@ -362,8 +362,8 @@ } } onClicked: { - if (root.model.sortCriteria !== modelData.criteria) - root.model.sortCriteria = modelData.criteria + if (root.model.sortCriteria !== modelData.model.criteria) + root.model.sortCriteria = modelData.model.criteria else root.model.sortOrder = (root.model.sortOrder === Qt.AscendingOrder) ? Qt.DescendingOrder : Qt.AscendingOrder }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/TableColumns.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/TableColumns.qml
Changed
@@ -41,10 +41,9 @@ property int titleCover_height: VLCStyle.trackListAlbumCover_heigth property int titleCover_radius: VLCStyle.trackListAlbumCover_radius - // Functions - - function titlecoverLabels(model) { - // implement this function to show labels in title Cover + // function (model) -> string... + // implement this function to show labels in title Cover + property var titlecoverLabels: function(model) { return }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/qt/widgets/qml/VideoQualityLabels.qml -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/qt/widgets/qml/VideoQualityLabels.qml
Changed
@@ -22,7 +22,16 @@ import "qrc:///style/" Row { - property alias labels: repeater.model + id: root + + property var labels + + onLabelsChanged: { + // try to reuse items, texts are assigned with Binding + // extra items are hidden, Row should take care of them + if (repeater.count < labels.length) + repeater.model = labels.length + } spacing: VLCStyle.margin_xxsmall @@ -42,7 +51,9 @@ leftPadding: VLCStyle.margin_xxxsmall rightPadding: VLCStyle.margin_xxxsmall - text: modelData + visible: index < root.labels.length + text: index >= root.labels.length ? "" : root.labelsindex + font.pixelSize: VLCStyle.fontSize_normal color: theme.fg.primary
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/skins2/controls/ctrl_generic.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/skins2/controls/ctrl_generic.cpp
Changed
@@ -28,7 +28,7 @@ #include "../utils/position.hpp" #include "../utils/var_bool.hpp" -#include <assert.h> +#include <cassert> CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/skins2/src/vlcproc.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/skins2/src/vlcproc.cpp
Changed
@@ -57,7 +57,7 @@ #include "../utils/var_string.hpp" #include <sstream> -#include <assert.h> +#include <cassert> void on_playlist_items_reset( vlc_playlist_t *playlist, vlc_playlist_item_t *const items,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/gui/skins2/x11/x11_window.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/gui/skins2/x11/x11_window.cpp
Changed
@@ -34,7 +34,7 @@ #include "x11_dragdrop.hpp" #include "x11_factory.hpp" -#include <assert.h> +#include <cassert> #include <limits.h> #include <new> @@ -335,7 +335,7 @@ event.format = 32; event.data.l 0 = 1; event.data.l 1 = NET_WM_STATE_FULLSCREEN; - + XSendEvent( XDISPLAY, DefaultRootWindow( XDISPLAY ), False, SubstructureNotifyMask|SubstructureRedirectMask,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/hw/d3d11/d3d11_decoder.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/hw/d3d11/d3d11_decoder.cpp
Changed
@@ -112,13 +112,7 @@ D3D11_TEXTURE2D_DESC outDesc; src_sys->texture0->GetDesc(&outDesc); - for (p_sys->output_format = DxgiGetRenderFormatList(); - p_sys->output_format->name != nullptr; ++p_sys->output_format) - { - if (p_sys->output_format->formatTexture == outDesc.Format && - is_d3d11_opaque(p_sys->output_format->fourcc)) - break; - } + p_sys->output_format = D3D11_RenderFormat(outDesc.Format ,true); if (unlikely(!p_sys->output_format->name)) { msg_Err(p_dec, "Unknown texture format %d", outDesc.Format);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/hw/d3d11/d3d11_deinterlace.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/hw/d3d11/d3d11_deinterlace.c
Changed
@@ -254,16 +254,7 @@ d3d11_decoder_device_t *dev_sys = GetD3D11OpaqueContext( filter->vctx_in ); sys->d3d_dev = &dev_sys->d3d_dev; - for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); - output_format->name != NULL; ++output_format) - { - if (output_format->formatTexture == vctx_sys->format && - is_d3d11_opaque(output_format->fourcc)) - { - sys->output_format = output_format; - break; - } - } + sys->output_format = D3D11_RenderFormat(vctx_sys->format ,true); if (unlikely(sys->output_format == NULL)) goto error;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/hw/d3d11/d3d11_filters.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/hw/d3d11/d3d11_filters.c
Changed
@@ -42,12 +42,12 @@ #include "d3d11_processor.h" #include "../../video_chroma/d3d11_fmt.h" -#ifdef __MINGW32__ +#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 8 #define D3D11_VIDEO_PROCESSOR_FILTER_CAPS_BRIGHTNESS 0x1 #define D3D11_VIDEO_PROCESSOR_FILTER_CAPS_CONTRAST 0x2 #define D3D11_VIDEO_PROCESSOR_FILTER_CAPS_HUE 0x4 #define D3D11_VIDEO_PROCESSOR_FILTER_CAPS_SATURATION 0x8 -#endif +#endif // __MINGW64_VERSION_MAJOR<8 #define PROCESSOR_SLICES 2 @@ -188,17 +188,7 @@ { d3d11_video_context_t *vctx_sys = GetD3D11ContextPrivate( p_filter->vctx_out ); - const d3d_format_t *cfg = NULL; - for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); - output_format->name != NULL; ++output_format) - { - if (output_format->formatTexture == vctx_sys->format && - is_d3d11_opaque(output_format->fourcc)) - { - cfg = output_format; - break; - } - } + const d3d_format_t *cfg = D3D11_RenderFormat(vctx_sys->format ,true); if (unlikely(cfg == NULL)) return NULL;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/hw/d3d11/d3d11_processor.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/hw/d3d11/d3d11_processor.h
Changed
@@ -27,7 +27,10 @@ #include "../../video_chroma/d3d11_fmt.h" -#ifdef ID3D11VideoContext_VideoProcessorBlt +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { ID3D11VideoDevice *d3dviddev; @@ -46,6 +49,9 @@ HRESULT D3D11_Assert_ProcessorInput(vlc_object_t *, d3d11_processor_t *, picture_sys_d3d11_t *); #define D3D11_Assert_ProcessorInput(a,b,c) D3D11_Assert_ProcessorInput(VLC_OBJECT(a),b,c) + +#ifdef __cplusplus +} #endif #endif /* VLC_D3D11_PROCESSOR_H */
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/hw/d3d11/d3d11_surface.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/hw/d3d11/d3d11_surface.c
Changed
@@ -613,17 +613,7 @@ d3d11_video_context_t *vctx_sys = GetD3D11ContextPrivate( p_filter->vctx_out ); - const d3d_format_t *cfg = NULL; - for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); - output_format->name != NULL; ++output_format) - { - if (output_format->formatTexture == vctx_sys->format && - !is_d3d11_opaque(output_format->fourcc)) - { - cfg = output_format; - break; - } - } + const d3d_format_t *cfg = D3D11_RenderFormat(vctx_sys->format ,false); if (unlikely(cfg == NULL)) return NULL;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/logger/json.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/logger/json.c
Changed
@@ -220,8 +220,6 @@ if (unlikely(sys == NULL)) return NULL; - const struct vlc_tracer_operations *ops = &json_ops; - const char *filename = JSON_FILENAME; char *path = var_InheritString(obj, "json-tracer-file"); @@ -256,7 +254,7 @@ setvbuf(sys->stream, NULL, _IOLBF, 0); *sysp = sys; - return ops; + return &json_ops; } #define LOGFILE_NAME_TEXT N_("Log filename")
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/lua/vlc.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/lua/vlc.c
Changed
@@ -667,7 +667,7 @@ add_shortcut( "luaplaylist" ) set_shortname( N_("Lua Playlist") ) set_description( N_("Lua Playlist Parser Interface") ) - set_capability( "demux", 2 ) + set_capability( "demux", 5 ) set_callbacks( Import_LuaPlaylist, Close_LuaPlaylist ) add_submodule ()
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/meson.build -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/meson.build
Changed
@@ -53,10 +53,10 @@ if have_wayland wayland_scanner = find_program( - wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'), + wayland_scanner_dep.get_variable(pkgconfig: 'wayland_scanner'), native: true ) - wayland_protocols_dir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir') + wayland_protocols_dir = wayland_protocols_dep.get_variable(pkgconfig: 'pkgdatadir') endif else have_wayland = false
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/misc/medialibrary/fs/directory.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/misc/medialibrary/fs/directory.cpp
Changed
@@ -35,7 +35,7 @@ #include <vlc_cxx_helpers.hpp> #include <algorithm> -#include <assert.h> +#include <cassert> #include <medialibrary/filesystem/Errors.h> #include <sys/stat.h> #include <system_error>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/packetizer/av1_obu.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/packetizer/av1_obu.c
Changed
@@ -328,8 +328,8 @@ p_seq->seq_profile = bs_read(&bs, 3); p_seq->still_picture = bs_read1(&bs); - const obu_u1_t reduced_still_picture_header = bs_read1(&bs); - if(reduced_still_picture_header) + p_seq->reduced_still_picture_header = bs_read1(&bs); + if(p_seq->reduced_still_picture_header) { p_seq->operating_points0.seq_level_idx = bs_read(&bs, 5); } @@ -373,7 +373,7 @@ const obu_u4_t frame_height_bits_minus_1 = bs_read(&bs, 4); p_seq->max_frame_width_minus_1 = bs_read(&bs, 1 + frame_width_bits_minus_1); p_seq->max_frame_height_minus_1 = bs_read(&bs, 1 + frame_height_bits_minus_1); - if(!reduced_still_picture_header) + if(!p_seq->reduced_still_picture_header) { p_seq->frame_id_numbers_present_flag = bs_read1(&bs); if(p_seq->frame_id_numbers_present_flag) @@ -385,7 +385,7 @@ p_seq->use_128x128_superblock = bs_read1(&bs); p_seq->enable_filter_intra = bs_read1(&bs); p_seq->enable_intra_edge_filter = bs_read1(&bs); - if(!reduced_still_picture_header) + if(!p_seq->reduced_still_picture_header) { p_seq->enable_interintra_compound = bs_read1(&bs); p_seq->enable_masked_compound = bs_read1(&bs); @@ -554,6 +554,11 @@ return true; } +bool AV1_get_super_res(const av1_OBU_sequence_header_t *p_seq) +{ + return p_seq->enable_superres; +} + bool AV1_get_colorimetry(const av1_OBU_sequence_header_t *p_seq, video_color_primaries_t *p_primaries, video_transfer_func_t *p_transfer,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/packetizer/av1_obu.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/packetizer/av1_obu.h
Changed
@@ -167,6 +167,7 @@ video_color_primaries_t *, video_transfer_func_t *, video_color_space_t *, video_color_range_t *); bool AV1_get_frame_rate(const av1_OBU_sequence_header_t *, unsigned *, unsigned *); +bool AV1_get_super_res(const av1_OBU_sequence_header_t *); vlc_fourcc_t AV1_get_chroma(const av1_OBU_sequence_header_t *); bool AV1_sequence_header_equal(const av1_OBU_sequence_header_t *,const av1_OBU_sequence_header_t *);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/packetizer/h264.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/packetizer/h264.c
Changed
@@ -152,9 +152,8 @@ static block_t *ParseNALBlock( decoder_t *, bool *pb_ts_used, block_t * ); static block_t *OutputPicture( decoder_t *p_dec ); -static void PutSPS( decoder_t *p_dec, block_t *p_frag ); -static void PutPPS( decoder_t *p_dec, block_t *p_frag ); -static void PutSPSEXT( decoder_t *p_dec, block_t *p_frag ); +static void ReleaseXPS( decoder_sys_t *p_sys ); +static bool PutXPS( decoder_t *p_dec, uint8_t i_nal_type, block_t *p_frag ); static bool ParseSliceHeader( decoder_t *p_dec, const block_t *p_frag, h264_slice_t *p_slice ); static bool ParseSeiCallback( const hxxx_sei_data_t *, void * ); @@ -164,38 +163,33 @@ /***************************************************************************** * Helpers *****************************************************************************/ - -static void StoreSPS( decoder_sys_t *p_sys, uint8_t i_id, - block_t *p_block, h264_sequence_parameter_set_t *p_sps ) -{ - if( p_sys->spsi_id.p_block ) - block_Release( p_sys->spsi_id.p_block ); - if( p_sys->spsi_id.p_sps ) - h264_release_sps( p_sys->spsi_id.p_sps ); - if( p_sys->spsi_id.p_sps == p_sys->p_active_sps ) - p_sys->p_active_sps = NULL; - p_sys->spsi_id.p_block = p_block; - p_sys->spsi_id.p_sps = p_sps; -} - -static void StorePPS( decoder_sys_t *p_sys, uint8_t i_id, - block_t *p_block, h264_picture_parameter_set_t *p_pps ) +static void LastAppendXPSCopy( const block_t *p_block, block_t ***ppp_last ) { - if( p_sys->ppsi_id.p_block ) - block_Release( p_sys->ppsi_id.p_block ); - if( p_sys->ppsi_id.p_pps ) - h264_release_pps( p_sys->ppsi_id.p_pps ); - if( p_sys->ppsi_id.p_pps == p_sys->p_active_pps ) - p_sys->p_active_pps = NULL; - p_sys->ppsi_id.p_block = p_block; - p_sys->ppsi_id.p_pps = p_pps; + if( !p_block ) + return; + block_t *p_dup = block_Alloc( 4 + p_block->i_buffer ); + if( p_dup ) + { + memcpy( &p_dup->p_buffer0, annexb_startcode4, 4 ); + memcpy( &p_dup->p_buffer4, p_block->p_buffer, p_block->i_buffer ); + block_ChainLastAppend( ppp_last, p_dup ); + } } -static void StoreSPSEXT( decoder_sys_t *p_sys, uint8_t i_id, block_t *p_block ) +static block_t * GatherSets( decoder_sys_t *p_sys, bool b_need_sps, bool b_need_pps ) { - if( p_sys->spsexti_id.p_block ) - block_Release( p_sys->spsexti_id.p_block ); - p_sys->spsexti_id.p_block = p_block; + block_t *p_xpsnal = NULL; + block_t **pp_xpsnal_tail = &p_xpsnal; + for( int i = 0; i <= H264_SPS_ID_MAX && b_need_sps; i++ ) + { + LastAppendXPSCopy( p_sys->spsi.p_block, &pp_xpsnal_tail ); + /* 7.4.1.2.3, shall be the next NAL unit after a sequence parameter set NAL unit + * having the same value of seq_parameter_set_id */ + LastAppendXPSCopy( p_sys->spsexti.p_block, &pp_xpsnal_tail ); + } + for( int i = 0; i < H264_PPS_ID_MAX && b_need_pps; i++ ) + LastAppendXPSCopy( p_sys->ppsi.p_block, &pp_xpsnal_tail ); + return p_xpsnal; } static void ActivateSets( decoder_t *p_dec, const h264_sequence_parameter_set_t *p_sps, @@ -250,29 +244,18 @@ if( p_dec->fmt_out.i_extra == 0 && p_pps ) { - const block_t *p_spsblock = p_sys->spsp_sps->i_id.p_block; - const block_t *p_ppsblock = p_sys->ppsp_pps->i_id.p_block; - const block_t *p_spsextblock = p_sys->spsextp_sps->i_id.p_block; - - if( p_spsblock && p_ppsblock ) + block_t *p_xpsblocks = GatherSets( p_sys, true, true ); + if( p_xpsblocks ) { - size_t i_alloc = p_ppsblock->i_buffer + p_spsblock->i_buffer; - if( p_spsextblock ) - i_alloc += p_spsextblock->i_buffer; - p_dec->fmt_out.p_extra = malloc( i_alloc ); + size_t i_total; + block_ChainProperties( p_xpsblocks, NULL, &i_total, NULL ); + p_dec->fmt_out.p_extra = malloc( i_total ); if( p_dec->fmt_out.p_extra ) { - uint8_t*p_buf = p_dec->fmt_out.p_extra; - p_dec->fmt_out.i_extra = i_alloc; - memcpy( p_buf, p_spsblock->p_buffer, p_spsblock->i_buffer ); - p_buf += p_spsblock->i_buffer; - if( p_spsextblock ) - { - memcpy( p_buf, p_spsextblock->p_buffer, p_spsextblock->i_buffer ); - p_buf += p_spsextblock->i_buffer; - } - memcpy( p_buf, p_ppsblock->p_buffer, p_ppsblock->i_buffer ); + p_dec->fmt_out.i_extra = i_total; + block_ChainExtract( p_xpsblocks, p_dec->fmt_out.p_extra, i_total ); } + block_ChainRelease( p_xpsblocks ); } } } @@ -485,15 +468,9 @@ { decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys = p_dec->p_sys; - int i; DropStoredNAL( p_sys ); - for( i = 0; i <= H264_SPS_ID_MAX; i++ ) - StoreSPS( p_sys, i, NULL, NULL ); - for( i = 0; i <= H264_PPS_ID_MAX; i++ ) - StorePPS( p_sys, i, NULL, NULL ); - for( i = 0; i <= H264_SPSEXT_ID_MAX; i++ ) - StoreSPSEXT( p_sys, i, NULL ); + ReleaseXPS( p_sys ); packetizer_Clean( &p_sys->packetizer ); @@ -714,15 +691,9 @@ /* Stored for insert on keyframes */ if( i_nal_type == H264_NAL_SPS ) - { - PutSPS( p_dec, p_frag ); - p_sys->b_new_sps = true; - } + p_sys->b_new_sps |= PutXPS( p_dec, i_nal_type, p_frag ); else - { - PutPPS( p_dec, p_frag ); - p_sys->b_new_pps = true; - } + p_sys->b_new_pps |= PutXPS( p_dec, i_nal_type, p_frag ); break; case H264_NAL_SEI: @@ -734,7 +705,7 @@ break; case H264_NAL_SPS_EXT: - PutSPSEXT( p_dec, p_frag ); + PutXPS( p_dec, i_nal_type, p_frag ); if( p_sys->b_slice ) p_pic = OutputPicture( p_dec ); break; @@ -875,25 +846,8 @@ } /* Gather PPS/SPS if required */ - block_t *p_xpsnal = NULL; - block_t **pp_xpsnal_tail = &p_xpsnal; - if( b_need_sps_pps || p_sys->b_new_sps || p_sys->b_new_pps ) - { - for( int i = 0; i <= H264_SPS_ID_MAX && (b_need_sps_pps || p_sys->b_new_sps); i++ ) - { - if( p_sys->spsi.p_block ) - block_ChainLastAppend( &pp_xpsnal_tail, block_Duplicate( p_sys->spsi.p_block ) ); - /* 7.4.1.2.3, shall be the next NAL unit after a sequence parameter set NAL unit - * having the same value of seq_parameter_set_id */ - if( p_sys->spsexti.p_block ) - block_ChainLastAppend( &pp_xpsnal_tail, block_Duplicate( p_sys->spsexti.p_block ) ); - } - for( int i = 0; i < H264_PPS_ID_MAX && (b_need_sps_pps || p_sys->b_new_pps); i++ ) - { - if( p_sys->ppsi.p_block ) - block_ChainLastAppend( &pp_xpsnal_tail, block_Duplicate( p_sys->ppsi.p_block ) ); - } - } + block_t *p_xpsnal = GatherSets( p_sys, b_need_sps_pps|p_sys->b_new_sps, + b_need_sps_pps|p_sys->b_new_pps ); /* Now rebuild NAL Sequence, inserting PPS/SPS if any */ if( p_sys->leading.p_head && @@ -1089,90 +1043,130 @@ return p_pic; } -static void PutSPS( decoder_t *p_dec, block_t *p_frag ) +static int CmpXPS( const block_t *p_ref, const block_t *p_nal ) { - decoder_sys_t *p_sys = p_dec->p_sys; + return p_ref == NULL || + p_ref->i_buffer != p_nal->i_buffer || + memcmp( p_ref->p_buffer, p_nal->p_buffer, p_nal->i_buffer ); +} + +#define wrap_h264_xps_decode(funcname ) \ + static void *funcname ## _wrapper ( const uint8_t *a, size_t b, bool c ) \ + { return funcname(a,b,c); }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/packetizer/h264_nal.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/packetizer/h264_nal.c
Changed
@@ -740,6 +740,41 @@ return bo.b; } +bool h264_get_xps_id( const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id ) +{ + if( i_buf < 2 ) + return false; + + /* No need to lookup convert from emulation for that data */ + uint8_t i_max, i_offset; + switch( h264_getNALType(p_buf) ) + { + case H264_NAL_SPS: + i_offset = 1 + 3 /* profile constraint level */; + i_max = H264_SPS_ID_MAX; + break; + case H264_NAL_PPS: + i_offset = 1; + i_max = H264_PPS_ID_MAX; + break; + case H264_NAL_SPS_EXT: + i_offset = 1; + i_max = H264_SPSEXT_ID_MAX; + break; + default: + return false; + } + + if( i_buf <= i_offset ) + return false; + + bs_t bs; + bs_init( &bs, &p_bufi_offset, i_buf - i_offset ); + *pi_id = bs_read_ue( &bs ); + + return !bs_error( &bs ) && *pi_id <= i_max; +} + static const h264_level_limits_t * h264_get_level_limits( const h264_sequence_parameter_set_t *p_sps ) { uint16_t i_level_number = p_sps->i_level;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/packetizer/h264_nal.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/packetizer/h264_nal.h
Changed
@@ -89,6 +89,8 @@ typedef struct h264_picture_parameter_set_t h264_picture_parameter_set_t; typedef struct h264_sequence_parameter_set_extension_t h264_sequence_parameter_set_extension_t; +bool h264_get_xps_id(const uint8_t *p_nalbuf, size_t i_nalbuf, uint8_t *pi_id); + h264_sequence_parameter_set_t * h264_decode_sps( const uint8_t *, size_t, bool ); h264_picture_parameter_set_t * h264_decode_pps( const uint8_t *, size_t, bool ); h264_sequence_parameter_set_extension_t * h264_decode_sps_extension( const uint8_t *, size_t, bool );
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/services_discovery/upnp.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/services_discovery/upnp.cpp
Changed
@@ -40,7 +40,7 @@ #include <vlc_services_discovery.h> #include <vlc_renderer_discovery.h> -#include <assert.h> +#include <cassert> #include <limits.h> #include <algorithm> #include <set>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/stream_out/chromecast/chromecast_demux.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/stream_out/chromecast/chromecast_demux.cpp
Changed
@@ -34,7 +34,7 @@ #include "chromecast_common.h" -#include <assert.h> +#include <cassert> #include <new> static void on_paused_changed_cb(void *data, bool paused);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/stream_out/renderer_common.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/stream_out/renderer_common.cpp
Changed
@@ -27,7 +27,7 @@ # include "config.h" #endif -#include <assert.h> +#include <cassert> #include <map> #include <sstream>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_chroma/d3d11_fmt.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_chroma/d3d11_fmt.c
Changed
@@ -983,32 +983,24 @@ return &pic_ctx->s; } -picture_t *D3D11_AllocPicture(vlc_object_t *obj, - const video_format_t *fmt, vlc_video_context *vctx_out, - bool shared, const d3d_format_t *cfg) +int D3D11_PictureFill(vlc_object_t *obj, picture_t *pic, + vlc_video_context *vctx_out, + bool shared, const d3d_format_t *cfg) { if (unlikely(cfg == NULL)) - return NULL; + return VLC_EINVAL; struct d3d11_pic_context *pic_ctx = calloc(1, sizeof(*pic_ctx)); if (unlikely(pic_ctx == NULL)) - return NULL; + return VLC_ENOMEM; pic_ctx->picsys.sharedHandle = INVALID_HANDLE_VALUE; - picture_t *pic = picture_NewFromFormat( fmt ); - if (unlikely(pic == NULL)) - { - free(pic_ctx); - return NULL; - } - d3d11_decoder_device_t *dev_sys = GetD3D11OpaqueContext(vctx_out); if (AllocateTextures(obj, &dev_sys->d3d_dev, cfg, - fmt, shared, pic_ctx->picsys.texture, NULL) != VLC_SUCCESS) + &pic->format, shared, pic_ctx->picsys.texture, NULL) != VLC_SUCCESS) { - picture_Release(pic); free(pic_ctx); - return NULL; + return VLC_EGENERIC; } D3D11_AllocateResourceView(vlc_object_logger(obj), dev_sys->d3d_dev.d3ddevice, cfg, pic_ctx->picsys.texture, 0, pic_ctx->picsys.renderSrc); @@ -1035,5 +1027,22 @@ vlc_video_context_Hold(vctx_out), }; pic->context = &pic_ctx->s; + return VLC_SUCCESS; +} + +picture_t *D3D11_AllocPicture(vlc_object_t *obj, + const video_format_t *fmt, vlc_video_context *vctx_out, + bool shared, const d3d_format_t *cfg) +{ + picture_t *pic = picture_NewFromFormat( fmt ); + if (unlikely(pic == NULL)) + return NULL; + + if (D3D11_PictureFill(obj, pic, vctx_out, shared, cfg) != VLC_SUCCESS) + { + picture_Release(pic); + return NULL; + } + return pic; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_chroma/d3d11_fmt.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_chroma/d3d11_fmt.h
Changed
@@ -151,6 +151,21 @@ void ReleaseD3D11PictureSys(picture_sys_d3d11_t *p_sys); +static inline const d3d_format_t *D3D11_RenderFormat(DXGI_FORMAT opaque, bool gpu_based) +{ + for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); + output_format->name != NULL; ++output_format) + { + if (output_format->formatTexture == opaque && + is_d3d11_opaque(output_format->fourcc) == gpu_based) + { + return output_format; + } + } + return NULL; +} + + /* map texture planes to resource views */ int D3D11_AllocateResourceView(struct vlc_logger *obj, ID3D11Device *d3ddevice, const d3d_format_t *format, @@ -206,7 +221,10 @@ picture_t *D3D11_AllocPicture(vlc_object_t *, const video_format_t *, vlc_video_context *, - bool, const d3d_format_t *); + bool shared, const d3d_format_t *); +int D3D11_PictureFill(vlc_object_t *, + picture_t *, vlc_video_context *, + bool shared, const d3d_format_t *); void D3D11_PictureAttach(picture_t *, ID3D11Texture2D *textures, const d3d_format_t *cfg);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_filter/egl_pbuffer.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_filter/egl_pbuffer.c
Changed
@@ -84,6 +84,11 @@ return VLC_EGENERIC; sys->current = true; + + const opengl_vtable_t *vt = &sys->api.vt; + vt->BindBuffer(GL_PIXEL_PACK_BUFFER, sys->pixelbufferssys->current_flip); + vt->BindFramebuffer(GL_FRAMEBUFFER, sys->framebufferssys->current_flip); + return VLC_SUCCESS; } @@ -434,12 +439,16 @@ gl->ops = &gl_ops; gl->offscreen_vflip = true; - vlc_gl_MakeCurrent(gl); + eglMakeCurrent(sys->display, sys->surface, sys->surface, + sys->context); + + int ret = vlc_gl_api_Init(&sys->api, gl); if (ret != VLC_SUCCESS) { msg_Err(gl, "Failed to initialize gl_api"); - vlc_gl_ReleaseCurrent(gl); + eglMakeCurrent(sys->display, sys->surface, sys->surface, + EGL_NO_CONTEXT); goto error2; } @@ -471,8 +480,8 @@ sys->current_flip = BUFFER_COUNT - 1; BindDrawFramebuffer(sys); - - vlc_gl_ReleaseCurrent(gl); + eglMakeCurrent(sys->display, sys->surface, sys->surface, + EGL_NO_CONTEXT); return VLC_SUCCESS;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_filter/opengl.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_filter/opengl.c
Changed
@@ -191,7 +191,7 @@ if (sys->gl == NULL) { - msg_Err(obj, "Failed to create opengl context\n"); + msg_Err(obj, "Failed to create opengl context"); goto gl_create_failure; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/Makefile.am -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/Makefile.am
Changed
@@ -168,7 +168,7 @@ video_output/win32/events.c video_output/win32/events.h \ video_output/win32/builtin_shaders.h \ video_output/win32/win32touch.c video_output/win32/win32touch.h -libdirect3d9_plugin_la_LIBADD = libchroma_copy.la libd3d9_common.la -lgdi32 $(LIBCOM) -luuid +libdirect3d9_plugin_la_LIBADD = libchroma_copy.la libd3d9_common.la -lgdi32 -luser32 $(LIBCOM) -luuid libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libglinterop_dxva2_plugin_la_SOURCES = video_output/opengl/interop_dxva2.c \ @@ -186,20 +186,23 @@ libdirect3d11_plugin_la_SOURCES = video_output/win32/direct3d11.cpp \ video_output/win32/d3d11_quad.cpp video_output/win32/d3d11_quad.h \ + video_output/win32/d3d11_scaler.cpp video_output/win32/d3d11_scaler.h \ video_output/win32/d3d11_shaders.cpp video_output/win32/d3d11_shaders.h \ video_output/win32/d3d_shaders.c video_output/win32/d3d_shaders.h \ video_output/win32/d3d_dynamic_shader.c video_output/win32/d3d_dynamic_shader.h \ - video_output/win32/d3d11_swapchain.cpp video_output/win32/d3d11_swapchain.h \ - video_output/win32/dxgi_swapchain.cpp video_output/win32/dxgi_swapchain.h \ video_output/win32/common.c video_output/win32/common.h libdirect3d11_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBCOMCXXFLAGS) libdirect3d11_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la $(LIBCOM) -luuid +libdirect3d11_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) if !HAVE_WINSTORE +libdirect3d11_plugin_la_CPPFLAGS += -DHAVE_WIN32_SENSORS libdirect3d11_plugin_la_SOURCES += video_output/win32/events.c \ video_output/win32/events.h \ + video_output/win32/d3d11_swapchain.cpp video_output/win32/d3d11_swapchain.h \ + video_output/win32/dxgi_swapchain.cpp video_output/win32/dxgi_swapchain.h \ video_output/win32/sensors.cpp \ video_output/win32/win32touch.c video_output/win32/win32touch.h -libdirect3d11_plugin_la_LIBADD += -lgdi32 +libdirect3d11_plugin_la_LIBADD += -lgdi32 -luser32 else libdirect3d11_plugin_la_LIBADD += -ld3d11 libdirect3d11_plugin_la_LIBADD += -ld3dcompiler_47 @@ -214,10 +217,11 @@ video_output/win32/events.c video_output/win32/events.h \ video_output/win32/sensors.cpp \ video_output/win32/win32touch.c video_output/win32/win32touch.h +libglwin32_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_WIN32_SENSORS libglwin32_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBCOMCXXFLAGS) libwgl_plugin_la_SOURCES = video_output/win32/wgl.c -libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid libvlc_opengl.la +libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 -luser32 $(LIBCOM) -luuid libvlc_opengl.la libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 libvlc_opengl.la libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCFLAGS) @@ -235,7 +239,7 @@ video_output/win32/common.c video_output/win32/common.h \ video_output/win32/events.c video_output/win32/events.h \ video_output/win32/win32touch.c video_output/win32/win32touch.h -libwingdi_plugin_la_LIBADD = libchroma_copy.la -lgdi32 $(LIBCOM) -luuid +libwingdi_plugin_la_LIBADD = libchroma_copy.la -lgdi32 -luser32 $(LIBCOM) -luuid if HAVE_WIN32_DESKTOP vout_LTLIBRARIES += libwingdi_plugin.la endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/opengl/filter_draw.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/opengl/filter_draw.c
Changed
@@ -109,6 +109,7 @@ vt->Clear(GL_COLOR_BUFFER_BIT); vt->DrawArrays(GL_TRIANGLE_STRIP, 0, 4); + GL_ASSERT_NOERROR(vt); return VLC_SUCCESS; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/opengl/filter_mock.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/opengl/filter_mock.c
Changed
@@ -168,6 +168,7 @@ vt->DrawArrays(GL_TRIANGLES, 0, 3); vt->Disable(GL_BLEND); + GL_ASSERT_NOERROR(vt); return VLC_SUCCESS; } @@ -206,6 +207,7 @@ vt->Clear(GL_COLOR_BUFFER_BIT); vt->DrawArrays(GL_TRIANGLES, 0, 3); + GL_ASSERT_NOERROR(vt); return VLC_SUCCESS; } @@ -265,6 +267,7 @@ vt->Clear(GL_COLOR_BUFFER_BIT); vt->DrawArrays(GL_TRIANGLE_STRIP, 0, 4); + GL_ASSERT_NOERROR(vt); return VLC_SUCCESS; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/opengl/filters.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/opengl/filters.c
Changed
@@ -31,6 +31,7 @@ #include "filter_priv.h" #include "importer_priv.h" +#include "gl_util.h" /* The filter chain contains the sequential list of filters. * @@ -139,6 +140,11 @@ vlc_video_dovi_metadata_t dovi_rpu; int has_dovi; } pic; + + struct vlc_gl_extension_vt extension_vt; + + bool can_blit; + GLenum draw_framebuffer_target; }; struct vlc_gl_filters * @@ -165,6 +171,21 @@ filters->pic.pts = VLC_TICK_INVALID; filters->pic.has_dovi = 0; + vlc_gl_LoadExtensionFunctions(filters->gl, &filters->extension_vt); + + /* MSAA requires glBlitFramebuffer to resolve the samples, which is + * available starting with OpenGL ES 3 or OpenGL 3, and only available as an + * extension otherwise (ANGLE, NV). */ + filters->can_blit = vlc_gl_GetVersionMajor(&filters->extension_vt) >= 3; + + /* GL_DRAW_FRAMEBUFFER doesn't exist when OpenGL or OpenGL ES is < 3, and + * some needed extensions are not found, resulting in GL_INVALID_ENUM */ + filters->draw_framebuffer_target = GL_DRAW_FRAMEBUFFER; + if (!filters->can_blit) + filters->draw_framebuffer_target = GL_FRAMEBUFFER; + + + return filters; } @@ -306,7 +327,7 @@ { /* Compute the highest msaa_level among the filter and its subfilters */ unsigned msaa_level = 0; - if (filters->api->supports_multisample) + if (filters->can_blit && filters->api->supports_multisample) { msaa_level = priv->filter.config.msaa_level; vlc_list_foreach(subfilter_priv, &priv->blend_subfilters, node) @@ -350,12 +371,13 @@ * one */ bool has_out = !is_last; int ret = vlc_gl_filter_InitFramebuffers(filter, has_out); + GL_ASSERT_NOERROR(vt); if (ret != VLC_SUCCESS) return ret; } /* Restore bindings */ - vt->BindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_framebuffer); + vt->BindFramebuffer(filters->draw_framebuffer_target, draw_framebuffer); vt->BindRenderbuffer(GL_RENDERBUFFER, renderbuffer); return VLC_SUCCESS; @@ -446,7 +468,7 @@ /* Select the output texture associated to this plane */ GLuint draw_fb = priv->framebuffers_outi; - vt->BindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_fb); + vt->BindFramebuffer(filters->draw_framebuffer_target, draw_fb); assert(!vlc_list_is_last(&priv->node, &filters->list)); vt->Viewport(0, 0, priv->tex_widthsi, priv->tex_heightsi); @@ -467,7 +489,7 @@ draw_fb = priv->tex_count > 0 ? priv->framebuffers_out0 : draw_framebuffer; - vt->BindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_fb); + vt->BindFramebuffer(filters->draw_framebuffer_target, draw_fb); if (vlc_list_is_last(&priv->node, &filters->list)) { @@ -489,7 +511,7 @@ { /* Reset the draw buffer, in case it has been changed from a * filter draw() callback */ - vt->BindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_fb); + vt->BindFramebuffer(filters->draw_framebuffer_target, draw_fb); struct vlc_gl_filter *subfilter = &subfilter_priv->filter; ret = subfilter->ops->draw(subfilter, NULL, &meta); @@ -497,7 +519,7 @@ return ret; } - if (filter->config.msaa_level) + if (filters->can_blit && filter->config.msaa_level) { /* Never resolve multisampling to the default framebuffer */ assert(priv->tex_count == 1);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/opengl/interop.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/opengl/interop.c
Changed
@@ -64,9 +64,12 @@ priv->gl.BindTexture(interop->tex_target, texturesi); #if !defined(USE_OPENGL_ES2) - /* Set the texture parameters */ - priv->gl.TexParameterf(interop->tex_target, GL_TEXTURE_PRIORITY, 1.0); - priv->gl.TexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + if (interop->gl->api_type == VLC_OPENGL) + { + /* Set the texture parameters */ + priv->gl.TexParameterf(interop->tex_target, GL_TEXTURE_PRIORITY, 1.0); + priv->gl.TexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + } #endif priv->gl.TexParameteri(interop->tex_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -74,6 +77,7 @@ priv->gl.TexParameteri(interop->tex_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); priv->gl.TexParameteri(interop->tex_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } + GL_ASSERT_NOERROR(&priv->gl); if (interop->ops->allocate_textures != NULL) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/opengl/renderer.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/opengl/renderer.c
Changed
@@ -712,6 +712,7 @@ const opengl_vtable_t *vt = renderer->vt; vt->Clear(GL_COLOR_BUFFER_BIT); + GL_ASSERT_NOERROR(vt); vt->UseProgram(renderer->program_id); @@ -751,6 +752,7 @@ renderer->var.ZoomMatrix); vt->DrawElements(GL_TRIANGLES, renderer->nb_indices, GL_UNSIGNED_SHORT, 0); + GL_ASSERT_NOERROR(vt); return VLC_SUCCESS; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/common.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/common.c
Changed
@@ -41,49 +41,35 @@ #include "common.h" #include "../../video_chroma/copy.h" -void CommonInit(display_win32_area_t *area) +void CommonInit(display_win32_area_t *area, const video_format_t *src_fmt) { + ZeroMemory(&area->place, sizeof(area->place)); area->place_changed = false; + area->src_fmt = src_fmt; } #ifndef VLC_WINSTORE_APP /* */ int CommonWindowInit(vout_display_t *vd, display_win32_area_t *area, - vout_display_sys_win32_t *sys, bool projection_gestures) + bool projection_gestures) { if (unlikely(vd->cfg->window == NULL)) return VLC_EGENERIC; /* */ -#if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H) - sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL")); -#endif - sys->hvideownd = NULL; - sys->hparent = NULL; - - /* */ - sys->event = EventThreadCreate(VLC_OBJECT(vd), vd->cfg->window); - if (!sys->event) + area->event = EventThreadCreate(VLC_OBJECT(vd), vd->cfg->window, + &vd->cfg->display, + projection_gestures ? &vd->owner : NULL); + if (!area->event) return VLC_EGENERIC; - /* */ - event_cfg_t cfg; - memset(&cfg, 0, sizeof(cfg)); - cfg.width = vd->cfg->display.width; - cfg.height = vd->cfg->display.height; - cfg.is_projected = projection_gestures; - - event_hwnd_t hwnd; - if (EventThreadStart(sys->event, &hwnd, &cfg)) - return VLC_EGENERIC; - - sys->hparent = hwnd.hparent; - sys->hvideownd = hwnd.hvideownd; - - CommonPlacePicture(vd, area); - return VLC_SUCCESS; } + +HWND CommonVideoHWND(const display_win32_area_t *area) +{ + return EventThreadVideoHWND(area->event); +} #endif /* !VLC_WINSTORE_APP */ /***************************************************************************** @@ -97,7 +83,7 @@ { /* Update the window position and size */ vout_display_place_t before_place = area->place; - vout_display_PlacePicture(&area->place, vd->source, &vd->cfg->display); + vout_display_PlacePicture(&area->place, area->src_fmt, &vd->cfg->display); /* Signal the change in size/position */ if (!vout_display_PlaceEquals(&before_place, &area->place)) @@ -106,9 +92,9 @@ #ifndef NDEBUG msg_Dbg(vd, "UpdateRects source offset: %i,%i visible: %ix%i decoded: %ix%i", - vd->source->i_x_offset, vd->source->i_y_offset, - vd->source->i_visible_width, vd->source->i_visible_height, - vd->source->i_width, vd->source->i_height); + area->src_fmt->i_x_offset, area->src_fmt->i_y_offset, + area->src_fmt->i_visible_width, area->src_fmt->i_visible_height, + area->src_fmt->i_width, area->src_fmt->i_height); msg_Dbg(vd, "UpdateRects image_dst coords: %i,%i %ix%i", area->place.x, area->place.y, area->place.width, area->place.height); #endif @@ -117,29 +103,21 @@ #ifndef VLC_WINSTORE_APP /* */ -void CommonWindowClean(vout_display_sys_win32_t *sys) +void CommonWindowClean(display_win32_area_t *sys) { - if (sys->event) { - EventThreadStop(sys->event); - EventThreadDestroy(sys->event); - } + EventThreadDestroy(sys->event); } #endif /* !VLC_WINSTORE_APP */ -void CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys, int query) +void CommonControl(vout_display_t *vd, display_win32_area_t *area, int query) { switch (query) { case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: #ifndef VLC_WINSTORE_APP // Update dimensions - if (sys->event != NULL) + if (area->event != NULL) { - RECT clientRect; - GetClientRect(sys->hparent, &clientRect); - - SetWindowPos(sys->hvideownd, 0, 0, 0, - RECTWidth(clientRect), - RECTHeight(clientRect), SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE); + EventThreadUpdateSize(area->event); } #endif /* !VLC_WINSTORE_APP */ // fallthrough
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/common.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/common.h
Changed
@@ -32,55 +32,33 @@ * event_thread_t: event thread *****************************************************************************/ -typedef struct event_thread_t event_thread_t; - typedef struct display_win32_area_t { /* Coordinates of dest images (used when blitting to display) */ vout_display_place_t place; bool place_changed; + struct event_thread_t *event; // only use if sys.event is not NULL + + const video_format_t *src_fmt; } display_win32_area_t; #define RECTWidth(r) (LONG)((r).right - (r).left) #define RECTHeight(r) (LONG)((r).bottom - (r).top) /***************************************************************************** - * vout_sys_t: video output method descriptor - ***************************************************************************** - * This structure is part of the video output thread descriptor. - * It describes the module specific properties of an output thread. - *****************************************************************************/ -typedef struct vout_display_sys_win32_t -{ - /* */ - event_thread_t *event; - - /* */ - HWND hvideownd; /* Handle of the video sub-window */ - HWND hparent; /* Handle of the parent window */ - -# if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H) - HINSTANCE dxgidebug_dll; -# endif -} vout_display_sys_win32_t; - - -/***************************************************************************** * Prototypes from common.c *****************************************************************************/ #ifndef VLC_WINSTORE_APP -int CommonWindowInit(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, +int CommonWindowInit(vout_display_t *, display_win32_area_t *, bool projection_gestures); -void CommonWindowClean(vout_display_sys_win32_t *); +void CommonWindowClean(display_win32_area_t *); +HWND CommonVideoHWND(const display_win32_area_t *); #endif /* !VLC_WINSTORE_APP */ -void CommonControl(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, int ); +void CommonControl(vout_display_t *, display_win32_area_t *, int ); void CommonPlacePicture (vout_display_t *, display_win32_area_t *); -void CommonInit(display_win32_area_t *); - -void* HookWindowsSensors(vout_display_t*, HWND); -void UnhookWindowsSensors(void*); +void CommonInit(display_win32_area_t *, const video_format_t *); # ifdef __cplusplus } # endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/d3d11_quad.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_quad.cpp
Changed
@@ -370,3 +370,59 @@ vlc_assert_unreachable(); } } + +#ifdef HAVE_D3D11_4_H +HRESULT D3D11_InitFence(d3d11_device_t & d3d_dev, d3d11_gpu_fence & fence) +{ + HRESULT hr; + ComPtr<ID3D11Device5> d3ddev5; + hr = d3d_dev.d3ddevice->QueryInterface(IID_GRAPHICS_PPV_ARGS(&d3ddev5)); + if (FAILED(hr)) + goto error; + hr = d3ddev5->CreateFence(fence.renderFence, D3D11_FENCE_FLAG_NONE, IID_GRAPHICS_PPV_ARGS(&fence.d3dRenderFence)); + if (FAILED(hr)) + goto error; + hr = d3d_dev.d3dcontext->QueryInterface(IID_GRAPHICS_PPV_ARGS(&fence.d3dcontext4)); + if (FAILED(hr)) + goto error; + fence.renderFinished = CreateEvent(nullptr, TRUE, FALSE, nullptr); + if (unlikely(fence.renderFinished == nullptr)) + goto error; + return S_OK; +error: + fence.d3dRenderFence.Reset(); + fence.d3dcontext4.Reset(); + CloseHandle(fence.renderFinished); + return hr; +} + +void D3D11_ReleaseFence(d3d11_gpu_fence & fence) +{ + if (fence.d3dcontext4.Get()) + { + fence.d3dRenderFence.Reset(); + fence.d3dcontext4.Reset(); + CloseHandle(fence.renderFinished); + fence.renderFinished = nullptr; + } +} + +int D3D11_WaitFence(d3d11_gpu_fence & fence) +{ + if (fence.d3dcontext4.Get()) + { + if (fence.renderFence == UINT64_MAX) + fence.renderFence = 0; + else + fence.renderFence++; + + ResetEvent(fence.renderFinished); + fence.d3dRenderFence->SetEventOnCompletion(fence.renderFence, fence.renderFinished); + fence.d3dcontext4->Signal(fence.d3dRenderFence.Get(), fence.renderFence); + + WaitForSingleObject(fence.renderFinished, INFINITE); + return VLC_SUCCESS; + } + return VLC_ENOTSUP; +} +#endif // HAVE_D3D11_4_H
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/d3d11_quad.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_quad.h
Changed
@@ -25,12 +25,30 @@ #include "../../video_chroma/d3d11_fmt.h" #include "d3d11_shaders.h" +#ifdef HAVE_D3D11_4_H +# include <d3d11_4.h> +#endif #define PS_CONST_LUMI_BOUNDS 0 #define VS_CONST_VIEWPOINT 1 typedef bool (*d3d11_select_plane_t)(void *opaque, size_t plane_index, ID3D11RenderTargetView **); +#ifdef HAVE_D3D11_4_H +struct d3d11_gpu_fence +{ + Microsoft::WRL::ComPtr<ID3D11Fence> d3dRenderFence; + Microsoft::WRL::ComPtr<ID3D11DeviceContext4> d3dcontext4; + UINT64 renderFence = 0; + HANDLE renderFinished = nullptr; +}; + +HRESULT D3D11_InitFence(d3d11_device_t &, d3d11_gpu_fence &); +int D3D11_WaitFence(d3d11_gpu_fence &); +void D3D11_ReleaseFence(d3d11_gpu_fence &); +#endif + + void D3D11_RenderQuad(d3d11_device_t *, d3d11_quad_t *, d3d11_vertex_shader_t *, ID3D11ShaderResourceView *resourceViewsDXGI_MAX_SHADER_VIEW, d3d11_select_plane_t selectPlane, void *selectOpaque);
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_scaler.cpp
Added
@@ -0,0 +1,444 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/***************************************************************************** + * d3d11_scaler: Direct3D11 VideoProcessor based output scaling + ***************************************************************************** + * Copyright © 2023 Videolabs, VLC authors and VideoLAN + * + * Authors: Chilledheart <hukeyue@hotmail.com> + * Steve Lhomme <robux4@videolabs.io> + *****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <vlc_common.h> + +#include "d3d11_scaler.h" + +#include <new> +#include <wrl/client.h> +using Microsoft::WRL::ComPtr; + +struct d3d11_scaler +{ + bool usable = false; + const d3d_format_t *d3d_fmt = nullptr; + vout_display_place_t place = {}; + bool super_res = false; + bool upscaling = false; + UINT Width = 0; + UINT Height = 0; + ComPtr<ID3D11VideoDevice> d3dviddev; + ComPtr<ID3D11VideoContext> d3dvidctx; + ComPtr<ID3D11VideoProcessorEnumerator> enumerator; + ComPtr<ID3D11VideoProcessor> processor; + ComPtr<ID3D11VideoProcessorOutputView> outputView; + ID3D11ShaderResourceView *SRVsDXGI_MAX_SHADER_VIEW = {}; +}; + +static const d3d_format_t *GetDirectRenderingFormat(vlc_object_t *vd, d3d11_device_t *d3d_dev, vlc_fourcc_t i_src_chroma) +{ + UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD | D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT; + return FindD3D11Format( vd, d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0, DXGI_CHROMA_GPU, supportFlags ); +} + +d3d11_scaler *D3D11_UpscalerCreate(vlc_object_t *vd, d3d11_device_t *d3d_dev, vlc_fourcc_t i_chroma, + bool super_res) +{ + bool canProcess = !super_res; + // NVIDIA 530+ driver + if (d3d_dev->adapterDesc.VendorId == GPU_MANUFACTURER_NVIDIA && + (d3d_dev->WDDM.revision * 10000 + d3d_dev->WDDM.build) > 153000) + { + // TODO refine which GPU can do it + canProcess = true; + } + else if (d3d_dev->adapterDesc.VendorId == GPU_MANUFACTURER_INTEL) + { + // TODO refine which GPU and drivers can do it + canProcess = true; + } + + if (!canProcess) + { + msg_Err(vd, "Super Resolution filter not supported"); + return nullptr; + } + + const d3d_format_t *fmt = GetDirectRenderingFormat(vd, d3d_dev, i_chroma); + if (fmt == nullptr || fmt->formatTexture == DXGI_FORMAT_UNKNOWN) + { + msg_Warn(vd, "chroma upscale of %4.4s not supported", (char*)&i_chroma); + return nullptr; + } + + d3d11_scaler *scaleProc = new (std::nothrow) d3d11_scaler; + if (unlikely(scaleProc == nullptr)) + return nullptr; + + HRESULT hr; + hr = d3d_dev->d3ddevice->QueryInterface(IID_GRAPHICS_PPV_ARGS(&scaleProc->d3dviddev)); + if (unlikely(FAILED(hr))) + { + msg_Err(vd, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr); + goto error; + } + + hr = d3d_dev->d3dcontext->QueryInterface(IID_GRAPHICS_PPV_ARGS(&scaleProc->d3dvidctx)); + if (unlikely(FAILED(hr))) + { + msg_Err(vd, "Could not Query ID3D11VideoContext Interface. (hr=0x%lX)", hr); + goto error; + } + + scaleProc->d3d_fmt = fmt; + scaleProc->super_res = super_res; + return scaleProc; +error: + delete scaleProc; + return nullptr; +} + +static void ReleaseSRVs(d3d11_scaler *scaleProc) +{ + for (size_t i=0; i<ARRAY_SIZE(scaleProc->SRVs); i++) + { + if (scaleProc->SRVsi) + { + scaleProc->SRVsi->Release(); + scaleProc->SRVsi = nullptr; + } + } +} + +int D3D11_UpscalerUpdate(vlc_object_t *vd, d3d11_scaler *scaleProc, d3d11_device_t*d3d_dev, + const video_format_t *fmt, video_format_t *quad_fmt, + const vout_display_placement *cfg) +{ + HRESULT hr; + ID3D11Texture2D *_upscaledDXGI_MAX_SHADER_VIEW; + ComPtr<ID3D11Texture2D> upscaled; + D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC outDesc{ }; + D3D11_VIDEO_COLOR black{}; + black.RGBA.A = 1.f; + bool upscale = false; + + vout_display_place_t place{}; + auto display = *cfg; + display.fitting = VLC_VIDEO_FIT_SMALLER; + vout_display_PlacePicture(&place, fmt, &display); + + unsigned out_width, out_height; + out_width = (display.width + (scaleProc->d3d_fmt->widthDenominator-1)) & ~(scaleProc->d3d_fmt->widthDenominator-1); + out_height = (display.height + (scaleProc->d3d_fmt->heightDenominator-1)) & ~(scaleProc->d3d_fmt->heightDenominator-1); + + quad_fmt->i_x_offset = 0; + quad_fmt->i_width = quad_fmt->i_visible_width = out_width; + quad_fmt->i_y_offset = 0; + quad_fmt->i_height = quad_fmt->i_visible_height = out_height; + + if (scaleProc->Width == out_width && scaleProc->Height == out_height && + vout_display_PlaceEquals(&scaleProc->place, &place)) + // do nothing + return VLC_SUCCESS; + scaleProc->place = place; + + scaleProc->usable = false; + + if (scaleProc->enumerator.Get() == nullptr) + { + d3d11_device_lock(d3d_dev); + D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc{}; + processorDesc.InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE; + processorDesc.InputFrameRate = { + .Numerator = fmt->i_frame_rate, + .Denominator = fmt->i_frame_rate_base, + }; + processorDesc.InputWidth = fmt->i_width; + processorDesc.InputHeight = fmt->i_height; + processorDesc.OutputWidth = out_width; + processorDesc.OutputHeight = out_height; + processorDesc.OutputFrameRate = { + .Numerator = fmt->i_frame_rate, + .Denominator = fmt->i_frame_rate_base, + }; + processorDesc.Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL; + hr = scaleProc->d3dviddev->CreateVideoProcessorEnumerator(&processorDesc, &scaleProc->enumerator); + if (FAILED(hr)) + { + msg_Dbg(vd, "Can't get a video processor for the video (error 0x%lx).", hr); + d3d11_device_unlock(d3d_dev); + goto done_super; + } + + hr = scaleProc->d3dviddev->CreateVideoProcessor(scaleProc->enumerator.Get(), 0, + &scaleProc->processor); + d3d11_device_unlock(d3d_dev); + if (FAILED(hr)) + { + msg_Dbg(vd, "failed to create the processor (error 0x%lx).", hr); + goto done_super; + } + } + + if (scaleProc->Width != out_width || scaleProc->Height != out_height ) + { + scaleProc->Width = out_width; + scaleProc->Height = out_height; + + // we need a texture that will receive the upscale version + D3D11_TEXTURE2D_DESC texDesc; + ZeroMemory(&texDesc, sizeof(texDesc)); + texDesc.MipLevels = 1; + texDesc.SampleDesc.Count = 1; + texDesc.MiscFlags = 0; + texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; + texDesc.Usage = D3D11_USAGE_DEFAULT; + texDesc.CPUAccessFlags = 0; + texDesc.ArraySize = 1;
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_scaler.h
Added
@@ -0,0 +1,37 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/***************************************************************************** + * d3d11_scaler: Direct3D11 VideoProcessor based output scaling + ***************************************************************************** + * Copyright © 2023 Videolabs, VLC authors and VideoLAN + * + * Authors: Chilledheart <hukeyue@hotmail.com> + * Steve Lhomme <robux4@videolabs.io> + *****************************************************************************/ + +#ifndef VLC_D3D11_SCALER_H +#define VLC_D3D11_SCALER_H + +#include "../../video_chroma/d3d11_fmt.h" +#include <vlc_vout_display.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct d3d11_scaler; + +struct d3d11_scaler *D3D11_UpscalerCreate(vlc_object_t *, d3d11_device_t*, vlc_fourcc_t i_chroma, bool super_res); +void D3D11_UpscalerDestroy(struct d3d11_scaler *); +int D3D11_UpscalerUpdate(vlc_object_t *, struct d3d11_scaler *, d3d11_device_t*, + const video_format_t *, video_format_t *, + const vout_display_placement *); +int D3D11_UpscalerScale(vlc_object_t *, struct d3d11_scaler *, picture_sys_d3d11_t *); +bool D3D11_UpscalerUsed(const struct d3d11_scaler *); +void D3D11_UpscalerGetSRV(const struct d3d11_scaler *, ID3D11ShaderResourceView *SRVDXGI_MAX_SHADER_VIEW); +void D3D11_UpscalerGetSize(const struct d3d11_scaler *, unsigned *i_width, unsigned *i_height); + +#ifdef __cplusplus +} +#endif + +#endif // VLC_D3D11_SCALER_H
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/d3d11_shaders.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_shaders.h
Changed
@@ -39,9 +39,15 @@ /* A Quad is texture that can be displayed in a rectangle */ struct d3d11_quad_t { + d3d11_quad_t() + { + video_format_Init(&quad_fmt, 0); + } + ~d3d11_quad_t() { ReleaseD3D11PictureSys(&picSys); + video_format_Clean(&quad_fmt); } void Reset(); @@ -49,6 +55,7 @@ picture_sys_d3d11_t picSys = {}; d3d_quad_t generic = {}; + video_format_t quad_fmt = {}; UINT resourceCount = 0; Microsoft::WRL::ComPtr<ID3D11Buffer> vertexBuffer; Microsoft::WRL::ComPtr<ID3D11Buffer> indexBuffer;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/d3d11_swapchain.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_swapchain.cpp
Changed
@@ -53,9 +53,6 @@ ComPtr<ID3D11RenderTargetView> swapchainTargetViewDXGI_MAX_RENDER_TARGET; }; -DEFINE_GUID(GUID_SWAPCHAIN_WIDTH, 0xf1b59347, 0x1643, 0x411a, 0xad, 0x6b, 0xc7, 0x80, 0x17, 0x7a, 0x06, 0xb6); -DEFINE_GUID(GUID_SWAPCHAIN_HEIGHT, 0x6ea976a0, 0x9d60, 0x4bb7, 0xa5, 0xa9, 0x7d, 0xd1, 0x18, 0x7f, 0xc9, 0xbd); - static bool UpdateSwapchain( d3d11_local_swapchain *display, const libvlc_video_render_cfg_t *cfg ) { HRESULT hr; @@ -196,7 +193,7 @@ return display; } -#if defined(HAVE_DCOMP_H) && !defined(VLC_WINSTORE_APP) +#if defined(HAVE_DCOMP_H) void *D3D11_CreateLocalSwapchainHandleDComp(vlc_object_t *o, void* dcompDevice, void* dcompVisual, d3d11_device_t *d3d_dev) { d3d11_local_swapchain *display = new (std::nothrow) d3d11_local_swapchain(); @@ -212,4 +209,4 @@ return display; } -#endif +#endif // HAVE_DCOMP_H
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/d3d11_swapchain.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/d3d11_swapchain.h
Changed
@@ -28,10 +28,11 @@ #include "dxgi_swapchain.h" #include "../../video_chroma/d3d11_fmt.h" +#ifndef VLC_WINSTORE_APP void *D3D11_CreateLocalSwapchainHandleHwnd(vlc_object_t *, HWND, d3d11_device_t *d3d_dev); -#if defined(HAVE_DCOMP_H) && !defined(VLC_WINSTORE_APP) +#if defined(HAVE_DCOMP_H) void *D3D11_CreateLocalSwapchainHandleDComp(vlc_object_t *, void* dcompDevice, void* dcompVisual, d3d11_device_t *d3d_dev); -#endif +#endif // HAVE_DCOMP_H void D3D11_LocalSwapchainCleanupDevice( void *opaque ); bool D3D11_LocalSwapchainUpdateOutput( void *opaque, const libvlc_video_render_cfg_t *cfg, libvlc_video_output_cfg_t *out ); @@ -39,5 +40,6 @@ bool D3D11_LocalSwapchainSelectPlane( void *opaque, size_t plane, void *output ); void D3D11_LocalSwapchainSwap( void *opaque ); void D3D11_LocalSwapchainSetMetadata( void *opaque, libvlc_video_metadata_type_t, const void * ); +#endif // !VLC_WINSTORE_APP #endif /* VLC_D3D11_SWAPCHAIN_H */
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/direct3d11.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/direct3d11.cpp
Changed
@@ -40,13 +40,13 @@ #include <new> #include "../../video_chroma/d3d11_fmt.h" -#ifdef HAVE_D3D11_4_H -#include <d3d11_4.h> -#endif #include "d3d11_quad.h" #include "d3d11_shaders.h" +#include "d3d11_scaler.h" +#ifndef VLC_WINSTORE_APP #include "d3d11_swapchain.h" +#endif #include "common.h" #include "../../video_chroma/copy.h" @@ -62,6 +62,14 @@ #define HW_BLENDING_LONGTEXT N_(\ "Try to use hardware acceleration for subtitle/OSD blending.") +#define UPSCALE_MODE_TEXT N_("Video Upscaling Mode") +#define UPSCALE_MODE_LONGTEXT N_("Select the upscaling mode for video.") + +static const char *const ppsz_upscale_mode = { + "linear", "point", "processor", "super" }; +static const char *const ppsz_upscale_mode_text = { + N_("Linear Sampler"), N_("Point Sampler"), N_("Video Processor"), N_("Super Resolution") }; + vlc_module_begin () set_shortname("Direct3D11") set_description(N_("Direct3D11 video output")) @@ -70,20 +78,27 @@ add_bool("direct3d11-hw-blending", true, HW_BLENDING_TEXT, HW_BLENDING_LONGTEXT) + add_string("d3d11-upscale-mode", "linear", UPSCALE_MODE_TEXT, UPSCALE_MODE_LONGTEXT) + change_string_list(ppsz_upscale_mode, ppsz_upscale_mode_text) + add_shortcut("direct3d11") set_callback_display(Open, 300) vlc_module_end () +enum d3d11_upscale +{ + upscale_LinearSampler, + upscale_PointSampler, + upscale_VideoProcessor, + upscale_SuperResolution, +}; + typedef struct vout_display_sys_t { - vout_display_sys_win32_t sys; /* only use if sys.event is not NULL */ display_win32_area_t area; int log_level; - /* Sensors */ - void *p_sensors = NULL; - display_info_t display = {}; d3d11_device_t *d3d_dev = NULL; @@ -92,10 +107,7 @@ d3d11_quad_t picQuad; #ifdef HAVE_D3D11_4_H - ComPtr<ID3D11Fence> d3dRenderFence; - ComPtr<ID3D11DeviceContext4> d3dcontext4; - UINT64 renderFence = 0; - HANDLE renderFinished = NULL; + d3d11_gpu_fence fence; #endif picture_sys_d3d11_t stagingSys; @@ -121,6 +133,10 @@ libvlc_video_makeCurrent_cb startEndRenderingCb; libvlc_video_frameMetadata_cb sendMetadataCb; libvlc_video_output_select_plane_cb selectPlaneCb; + + // upscaling + enum d3d11_upscale upscaleMode; + d3d11_scaler *scaleProc; } vout_display_sys_t; static void Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, vlc_tick_t); @@ -190,18 +206,15 @@ return VLC_EGENERIC; } - display_info_t new_display = { }; - - for (const d3d_format_t *output_format = DxgiGetRenderFormatList(); - output_format->name != NULL; ++output_format) + if (sys->upscaleMode == upscale_VideoProcessor || sys->upscaleMode == upscale_SuperResolution) { - if (output_format->formatTexture == (DXGI_FORMAT)out.dxgi_format && - !is_d3d11_opaque(output_format->fourcc)) - { - new_display.pixelFormat = output_format; - break; - } + D3D11_UpscalerUpdate(VLC_OBJECT(vd), sys->scaleProc, sys->d3d_dev, + vd->source, &sys->picQuad.quad_fmt, &vd->cfg->display); } + + display_info_t new_display = { }; + + new_display.pixelFormat = D3D11_RenderFormat((DXGI_FORMAT)out.dxgi_format, false); if (unlikely(new_display.pixelFormat == NULL)) { msg_Err(vd, "Could not find the output format."); @@ -266,10 +279,10 @@ sys->picQuad.UpdateViewport( &rect_dst, sys->display.pixelFormat ); RECT source_rect; - source_rect.left = vd->source->i_x_offset; - source_rect.right = vd->source->i_x_offset + vd->source->i_visible_width; - source_rect.top = vd->source->i_y_offset; - source_rect.bottom = vd->source->i_y_offset + vd->source->i_visible_height; + source_rect.left = sys->picQuad.quad_fmt.i_x_offset; + source_rect.right = sys->picQuad.quad_fmt.i_x_offset + sys->picQuad.quad_fmt.i_visible_width; + source_rect.top = sys->picQuad.quad_fmt.i_y_offset; + source_rect.bottom = sys->picQuad.quad_fmt.i_y_offset + sys->picQuad.quad_fmt.i_visible_height; d3d11_device_lock( sys->d3d_dev ); D3D11_UpdateQuadPosition(vd, sys->d3d_dev, &sys->picQuad, &source_rect, @@ -359,7 +372,7 @@ if (ret != VLC_SUCCESS) goto error; - CommonInit(&sys->area); + CommonInit(&sys->area, &sys->picQuad.quad_fmt); sys->outside_opaque = var_InheritAddress( vd, "vout-cb-opaque" ); sys->updateOutputCb = (libvlc_video_update_output_cb)var_InheritAddress( vd, "vout-cb-update-output" ); @@ -383,26 +396,27 @@ if ( sys->swapCb == NULL || sys->startEndRenderingCb == NULL || sys->updateOutputCb == NULL ) { -#ifndef VLC_WINSTORE_APP +#ifdef VLC_WINSTORE_APP + msg_Err(vd, "UWP apps needs to set an external rendering target"); + goto error; +#else // !VLC_WINSTORE_APP if (vd->cfg->window->type == VLC_WINDOW_TYPE_HWND) { - if (CommonWindowInit(vd, &sys->area, &sys->sys, + if (CommonWindowInit(vd, &sys->area, vd->source->projection_mode != PROJECTION_MODE_RECTANGULAR)) goto error; } -#endif /* !VLC_WINSTORE_APP */ - /* use our internal swapchain callbacks */ -#if defined(HAVE_DCOMP_H) && !defined(VLC_WINSTORE_APP) +#if defined(HAVE_DCOMP_H) if (vd->cfg->window->type == VLC_WINDOW_TYPE_DCOMP) sys->outside_opaque = D3D11_CreateLocalSwapchainHandleDComp(VLC_OBJECT(vd), vd->cfg->window->display.dcomp_device, vd->cfg->window->handle.dcomp_visual, sys->d3d_dev); else -#endif - sys->outside_opaque = D3D11_CreateLocalSwapchainHandleHwnd(VLC_OBJECT(vd), sys->sys.hvideownd, sys->d3d_dev); +#endif //HAVE_DCOMP_H + sys->outside_opaque = D3D11_CreateLocalSwapchainHandleHwnd(VLC_OBJECT(vd), CommonVideoHWND(&sys->area), sys->d3d_dev); if (unlikely(sys->outside_opaque == NULL)) goto error; sys->updateOutputCb = D3D11_LocalSwapchainUpdateOutput; @@ -410,12 +424,8 @@ sys->startEndRenderingCb = D3D11_LocalSwapchainStartEndRendering; sys->sendMetadataCb = D3D11_LocalSwapchainSetMetadata; sys->selectPlaneCb = D3D11_LocalSwapchainSelectPlane; - } - -#ifndef VLC_WINSTORE_APP - if (vd->source->projection_mode != PROJECTION_MODE_RECTANGULAR && sys->sys.hvideownd) - sys->p_sensors = HookWindowsSensors(vd, sys->sys.hvideownd); #endif // !VLC_WINSTORE_APP + } if (Direct3D11Open(vd, fmtp, context)) { msg_Err(vd, "Direct3D11 could not be opened"); @@ -453,8 +463,7 @@ vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys); D3D_ReleaseShaderCompiler(sys->shaders); #ifndef VLC_WINSTORE_APP - UnhookWindowsSensors(sys->p_sensors); - CommonWindowClean(&sys->sys); + CommonWindowClean(&sys->area); #endif Direct3D11Close(vd); delete sys; @@ -462,7 +471,27 @@ static int Control(vout_display_t *vd, int query) { vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/direct3d9.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/direct3d9.c
Changed
@@ -131,7 +131,6 @@ typedef struct vout_display_sys_t { - vout_display_sys_win32_t sys; /* only use if sys.event is not NULL */ display_win32_area_t area; bool allow_hw_yuv; /* Should we use hardware YUV->RGB conversions */ @@ -1139,7 +1138,7 @@ RECT rect; UINT width, height; - GetClientRect(p_sys->sys.hvideownd, &rect); + GetClientRect(CommonVideoHWND(&sys->area), &rect); width = RECTWidth(rect); height = RECTHeight(rect); @@ -1263,9 +1262,9 @@ HRESULT hr; if (sys->d3d9_device->hd3d.use_ex) { - hr = IDirect3DDevice9Ex_PresentEx(p_d3d9_dev->devex, &src, &src, sys->sys.hvideownd, NULL, 0); + hr = IDirect3DDevice9Ex_PresentEx(p_d3d9_dev->devex, &src, &src, CommonVideoHWND(&sys->area), NULL, 0); } else { - hr = IDirect3DDevice9_Present(p_d3d9_dev->dev, &src, &src, sys->sys.hvideownd, NULL); + hr = IDirect3DDevice9_Present(p_d3d9_dev->dev, &src, &src, CommonVideoHWND(&sys->area), NULL); } if (FAILED(hr)) { msg_Dbg(vd, "Failed Present: 0x%lX", hr); @@ -1688,7 +1687,7 @@ static int Control(vout_display_t *vd, int query) { vout_display_sys_t *sys = vd->sys; - CommonControl(vd, &sys->area, &sys->sys, query); + CommonControl(vd, &sys->area, query); return VLC_SUCCESS; } @@ -1784,7 +1783,7 @@ if (!sys) return VLC_ENOMEM; - CommonInit(&sys->area); + CommonInit(&sys->area, vd->source); sys->outside_opaque = var_InheritAddress( vd, "vout-cb-opaque" ); sys->updateOutputCb = var_InheritAddress( vd, "vout-cb-update-output" ); @@ -1794,7 +1793,7 @@ if ( sys->swapCb == NULL || sys->startEndRenderingCb == NULL || sys->updateOutputCb == NULL ) { /* use our own callbacks, since there isn't any external ones */ - if (CommonWindowInit(vd, &sys->area, &sys->sys, false)) + if (CommonWindowInit(vd, &sys->area, false)) goto error; sys->outside_opaque = vd; @@ -1803,6 +1802,8 @@ sys->startEndRenderingCb = NULL; } + CommonPlacePicture(vd, &sys->area); + sys->dec_device = context ? vlc_video_context_HoldDevice(context) : NULL; sys->d3d9_device = GetD3D9OpaqueDevice(sys->dec_device); if ( sys->d3d9_device == NULL ) @@ -1831,9 +1832,6 @@ goto error; } - if (sys->swapCb == LocalSwapchainSwap) - CommonPlacePicture(vd, &sys->area); - sys->hxdll = Direct3D9LoadShaderLibrary(); if (!sys->hxdll) msg_Warn(vd, "cannot load Direct3D9 Shader Library; HLSL pixel shading will be disabled."); @@ -1872,7 +1870,7 @@ return VLC_SUCCESS; error: Direct3D9Close(vd); - CommonWindowClean(&sys->sys); + CommonWindowClean(&sys->area); Direct3D9Destroy(sys); free(vd->sys); return VLC_EGENERIC; @@ -1887,7 +1885,7 @@ Direct3D9Close(vd); - CommonWindowClean(&sys->sys); + CommonWindowClean(&sys->area); Direct3D9Destroy(sys);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/dxgi_swapchain.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/dxgi_swapchain.cpp
Changed
@@ -29,7 +29,7 @@ #include <vlc_es.h> -#if defined(HAVE_DCOMP_H) && !defined(VLC_WINSTORE_APP) +#if defined(HAVE_DCOMP_H) # include <dcomp.h> #endif @@ -76,7 +76,6 @@ const dxgi_color_space *colorspace = nullptr; swapchain_surface_type swapchainSurfaceType; -#ifndef VLC_WINSTORE_APP union { HWND hwnd; #if defined(HAVE_DCOMP_H) @@ -86,7 +85,6 @@ } dcomp; #endif // HAVE_DCOMP_H } swapchainSurface; -#endif /* !VLC_WINSTORE_APP */ ComPtr<IDXGISwapChain1> dxgiswapChain; /* DXGI 1.2 swap chain */ ComPtr<IDXGISwapChain4> dxgiswapChain4; /* DXGI 1.5 for HDR metadata */ @@ -243,7 +241,6 @@ color_spacesbest.color == (video_color_space_t) cfg->colorspace; } -#ifndef VLC_WINSTORE_APP static void FillSwapChainDesc(dxgi_swapchain *display, UINT width, UINT height, DXGI_SWAP_CHAIN_DESC1 *out) { ZeroMemory(out, sizeof(*out)); @@ -358,8 +355,6 @@ } #endif /* HAVE_DCOMP_H */ -#endif /* !VLC_WINSTORE_APP */ - void DXGI_LocalSwapchainSwap( dxgi_swapchain *display ) { DXGI_PRESENT_PARAMETERS presentParams = { }; @@ -408,17 +403,13 @@ return NULL; display->obj = o; -#ifndef VLC_WINSTORE_APP display->swapchainSurfaceType = SWAPCHAIN_SURFACE_HWND; display->swapchainSurface.hwnd = hwnd; -#else // VLC_WINSTORE_APP - VLC_UNUSED(hwnd); -#endif // VLC_WINSTORE_APP return display; } -#if defined(HAVE_DCOMP_H) && !defined(VLC_WINSTORE_APP) +#if defined(HAVE_DCOMP_H) dxgi_swapchain *DXGI_CreateLocalSwapchainHandleDComp(vlc_object_t *o, void* dcompDevice, void* dcompVisual) { dxgi_swapchain *display = new (std::nothrow) dxgi_swapchain(); @@ -457,7 +448,6 @@ UINT width = cfg->width ? cfg->width : 8; UINT height = cfg->height ? cfg->height : 8; -#ifndef VLC_WINSTORE_APP if (display->dxgiswapChain.Get() && display->pixelFormat != newPixelFormat) { // the pixel format changed, we need a new swapchain @@ -479,7 +469,6 @@ width, height); } -#endif /* !VLC_WINSTORE_APP */ if ( !display->dxgiswapChain.Get() ) return false;
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/dxgi_swapchain.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/dxgi_swapchain.h
Changed
@@ -48,11 +48,11 @@ struct dxgi_swapchain *DXGI_CreateLocalSwapchainHandleHwnd(vlc_object_t *, HWND); -#if defined(HAVE_DCOMP_H) && !defined(VLC_WINSTORE_APP) +#if defined(HAVE_DCOMP_H) struct dxgi_swapchain *DXGI_CreateLocalSwapchainHandleDComp(vlc_object_t *, void /*IDCompositionDevice*/ * dcompDevice, void /*IDCompositionVisual*/ * dcompVisual); -#endif +#endif // HAVE_DCOMP_H Microsoft::WRL::ComPtr<IDXGISwapChain1> & DXGI_GetSwapChain1( struct dxgi_swapchain * ); Microsoft::WRL::ComPtr<IDXGISwapChain4> & DXGI_GetSwapChain4( struct dxgi_swapchain * );
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/events.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/events.c
Changed
@@ -41,6 +41,9 @@ #include "events.h" #include "common.h" +#ifdef HAVE_WIN32_SENSORS +#include "sensors.h" +#endif /***************************************************************************** * Local prototypes. @@ -53,17 +56,20 @@ vlc_thread_t thread; vlc_mutex_t lock; vlc_cond_t wait; - bool b_ready; - atomic_bool b_done; + bool b_ready; // the thread was started bool b_error; + atomic_bool b_done; - /* */ - bool is_projected; +#ifdef HAVE_WIN32_SENSORS + /* Sensors */ + const vout_display_owner_t *init_move; + void *p_sensors; +#endif /* Gestures */ - win32_gesture_sys_t *p_gesture; + struct win32_gesture_sys_t *p_gesture; - RECT window_area; + unsigned init_width, init_height; /* */ vlc_window_t *parent_window; @@ -72,147 +78,14 @@ HWND hvideownd; }; -/*************************** - * Local Prototypes * - ***************************/ -/* Window Creation */ -static int Win32VoutCreateWindow( event_thread_t * ); -static void Win32VoutCloseWindow ( event_thread_t * ); - -/***************************************************************************** - * EventThread: Create video window & handle its messages - ***************************************************************************** - * This function creates a video window and then enters an infinite loop - * that handles the messages sent to that window. - * The main goal of this thread is to isolate the Win32 PeekMessage function - * because this one can block for a long time. - *****************************************************************************/ -static void *EventThread( void *p_this ) +HWND EventThreadVideoHWND( const struct event_thread_t *p_event ) { - vlc_thread_set_name("vlc-vout-hwnd"); - - event_thread_t *p_event = (event_thread_t *)p_this; - MSG msg; - int canc = vlc_savecancel (); - - - vlc_mutex_lock( &p_event->lock ); - /* Create a window for the video */ - /* Creating a window under Windows also initializes the thread's event - * message queue */ - if( Win32VoutCreateWindow( p_event ) ) - p_event->b_error = true; - - p_event->b_ready = true; - vlc_cond_signal( &p_event->wait ); - - const bool b_error = p_event->b_error; - vlc_mutex_unlock( &p_event->lock ); - - if( b_error ) - { - vlc_restorecancel( canc ); - return NULL; - } - - /* Main loop */ - /* GetMessage will sleep if there's no message in the queue */ - for( ;; ) - { - if( !GetMessage( &msg, 0, 0, 0 ) || atomic_load( &p_event->b_done ) ) - { - break; - } - - /* Messages we don't handle directly are dispatched to the - * window procedure */ - TranslateMessage(&msg); - DispatchMessage(&msg); - - } /* End Main loop */ - - msg_Dbg( p_event->obj, "Win32 Vout EventThread terminating" ); - - Win32VoutCloseWindow( p_event ); - vlc_restorecancel(canc); - return NULL; -} - -event_thread_t *EventThreadCreate( vlc_object_t *obj, vlc_window_t *parent_window) -{ - if (parent_window->type != VLC_WINDOW_TYPE_HWND) - return NULL; - /* Create the Vout EventThread, this thread is created by us to isolate - * the Win32 PeekMessage function calls. We want to do this because - * Windows can stay blocked inside this call for a long time, and when - * this happens it thus blocks vlc's video_output thread. - * Vout EventThread will take care of the creation of the video - * window (because PeekMessage has to be called from the same thread which - * created the window). */ - msg_Dbg( obj, "creating Vout EventThread" ); - event_thread_t *p_event = malloc( sizeof(*p_event) ); - if( !p_event ) - return NULL; - - p_event->obj = obj; - vlc_mutex_init( &p_event->lock ); - vlc_cond_init( &p_event->wait ); - atomic_init( &p_event->b_done, false ); - - p_event->parent_window = parent_window; - - _snwprintf( p_event->class_video, ARRAY_SIZE(p_event->class_video), - TEXT("VLC video output %p"), (void *)p_event ); - return p_event; + return p_event->hvideownd; } -void EventThreadDestroy( event_thread_t *p_event ) +void EventThreadDestroy( struct event_thread_t *p_event ) { - free( p_event ); -} - -int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event_cfg_t *p_cfg ) -{ - p_event->is_projected = p_cfg->is_projected; - p_event->window_area.left = 0; - p_event->window_area.top = 0; - p_event->window_area.right = p_cfg->width; - p_event->window_area.bottom = p_cfg->height; - - p_event->b_ready = false; - atomic_store( &p_event->b_done, false); - p_event->b_error = false; - - if( vlc_clone( &p_event->thread, EventThread, p_event ) ) - { - msg_Err( p_event->obj, "cannot create Vout EventThread" ); - return VLC_EGENERIC; - } - - vlc_mutex_lock( &p_event->lock ); - while( !p_event->b_ready ) - vlc_cond_wait( &p_event->wait, &p_event->lock ); - const bool b_error = p_event->b_error; - vlc_mutex_unlock( &p_event->lock ); - - if( b_error ) - { - vlc_join( p_event->thread, NULL ); - p_event->b_ready = false; - return VLC_EGENERIC; - } - msg_Dbg( p_event->obj, "Vout EventThread running" ); - - /* */ - p_hwnd->parent_window = p_event->parent_window; - p_hwnd->hparent = p_event->hparent; - p_hwnd->hvideownd = p_event->hvideownd; - return VLC_SUCCESS; -} - -void EventThreadStop( event_thread_t *p_event ) -{ - if( !p_event->b_ready ) + if ( p_event == NULL ) return; atomic_store( &p_event->b_done, true ); @@ -223,9 +96,14 @@ PostMessage( p_event->hvideownd, WM_NULL, 0, 0); vlc_join( p_event->thread, NULL ); - p_event->b_ready = false; -} +#ifdef HAVE_WIN32_SENSORS + if (p_event->p_sensors) + UnhookWindowsSensors(p_event->p_sensors); +#endif
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/events.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/events.h
Changed
@@ -27,21 +27,9 @@ /** * HWNDs manager. */ -typedef struct event_thread_t event_thread_t; - -typedef struct { - bool is_projected; - unsigned width; - unsigned height; -} event_cfg_t; - -typedef struct { - vlc_window_t *parent_window; - HWND hparent; - HWND hvideownd; -} event_hwnd_t; - -event_thread_t *EventThreadCreate( vlc_object_t *, vlc_window_t *); -void EventThreadDestroy( event_thread_t * ); -int EventThreadStart( event_thread_t *, event_hwnd_t *, const event_cfg_t * ); -void EventThreadStop( event_thread_t * ); +struct event_thread_t *EventThreadCreate( vlc_object_t *, vlc_window_t *, + const struct vout_display_placement *, + const vout_display_owner_t * ); +void EventThreadDestroy( struct event_thread_t * ); +HWND EventThreadVideoHWND( const struct event_thread_t * ); +void EventThreadUpdateSize( struct event_thread_t * );
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/glwin32.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/glwin32.c
Changed
@@ -62,14 +62,10 @@ *****************************************************************************/ typedef struct vout_display_sys_t { - vout_display_sys_win32_t sys; display_win32_area_t area; vlc_gl_t *gl; vout_display_opengl_t *vgl; - - /* Sensors */ - void *p_sensors; } vout_display_sys_t; static void Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t); @@ -84,7 +80,7 @@ static int Control(vout_display_t *vd, int query) { vout_display_sys_t *sys = vd->sys; - CommonControl(vd, &sys->area, &sys->sys, query); + CommonControl(vd, &sys->area, query); return VLC_SUCCESS; } @@ -101,7 +97,7 @@ return NULL; wnd->type = VLC_WINDOW_TYPE_HWND; - wnd->handle.hwnd = sys->sys.hvideownd; + wnd->handle.hwnd = CommonVideoHWND(&sys->area); wnd->ops = &embedVideoWindow_Ops; return wnd; } @@ -132,13 +128,11 @@ return VLC_ENOMEM; /* */ - CommonInit(&sys->area); - if (CommonWindowInit(vd, &sys->area, &sys->sys, + CommonInit(&sys->area, vd->source); + if (CommonWindowInit(vd, &sys->area, vd->source->projection_mode != PROJECTION_MODE_RECTANGULAR)) goto error; - - if (vd->source->projection_mode != PROJECTION_MODE_RECTANGULAR) - sys->p_sensors = HookWindowsSensors(vd, sys->sys.hvideownd); + CommonPlacePicture(vd, &sys->area); vlc_window_SetTitle(vd->cfg->window, VOUT_TITLE " (OpenGL output)"); @@ -200,8 +194,7 @@ vlc_object_delete(surface); } - UnhookWindowsSensors(sys->p_sensors); - CommonWindowClean(&sys->sys); + CommonWindowClean(&sys->area); free(sys); }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/meson.build -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/meson.build
Changed
@@ -3,22 +3,30 @@ # # Direct3D11 video output -d3d11_sources = files('direct3d11.cpp', 'd3d11_quad.cpp', 'd3d11_shaders.cpp', 'd3d_shaders.c', 'd3d_dynamic_shader.c', 'd3d11_swapchain.cpp', 'dxgi_swapchain.cpp', 'common.c') +d3d11_sources = files('direct3d11.cpp', 'd3d11_quad.cpp', 'd3d11_scaler.cpp', 'd3d11_shaders.cpp', 'd3d_shaders.c', 'd3d_dynamic_shader.c', 'common.c') d3d11_link_with = d3d11_common_lib +d3d11_cargs = +d3d11_deps = if get_option('winstore_app') - d3d11_link_with += + d3d11_deps += cc.find_library('d3d11'), cc.find_library('d3dcompiler_47') else - d3d11_sources += files('events.c', 'sensors.cpp', 'win32touch.c') + d3d11_sources += files('d3d11_swapchain.cpp', 'dxgi_swapchain.cpp', 'events.c', 'sensors.cpp', 'win32touch.c') d3d11_link_with += chroma_copy_lib + d3d11_cargs += '-DHAVE_WIN32_SENSORS' + d3d11_deps += + cc.find_library('user32') + endif vlc_modules += { 'name' : 'direct3d11', 'sources' : d3d11_sources, - 'link_with' : d3d11_link_with + 'link_with' : d3d11_link_with, + 'c_args' : d3d11_cargs, + 'dependencies' : d3d11_deps } if have_win_desktop @@ -26,7 +34,10 @@ vlc_modules += { 'name' : 'direct3d9', 'sources' : files('direct3d9.c', 'common.c', 'events.c', 'sensors.cpp', 'win32touch.c'), - 'link_with' : d3d9_common_lib, chroma_copy_lib + 'link_with' : d3d9_common_lib, chroma_copy_lib , + 'dependencies' : + cc.find_library('user32') + } # GDI video output @@ -34,6 +45,9 @@ 'name' : 'wingdi', 'sources' : files('wingdi.c', 'common.c', 'events.c', 'win32touch.c'), 'link_with' : chroma_copy_lib + 'dependencies' : + cc.find_library('user32') + } opengl32_lib = cc.find_library('opengl32', required: false) @@ -45,8 +59,10 @@ files('glwin32.c', 'common.c', 'events.c', 'sensors.cpp', 'win32touch.c'), opengl_vout_commonsources , - 'c_args' : contrib_inc_args , - 'dependencies' : gl_common_dep, opengl32_lib + 'c_args' : contrib_inc_args, '-DHAVE_WIN32_SENSORS' , + 'dependencies' : gl_common_dep, opengl32_lib, + cc.find_library('user32') + } # WGL
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/sensors.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/sensors.cpp
Changed
@@ -26,7 +26,7 @@ #endif #include "events.h" -#include "common.h" +#include "sensors.h" #include <initguid.h> #include <wrl/client.h> @@ -41,8 +41,8 @@ class SensorReceiver : public ISensorEvents { public: - SensorReceiver(vout_display_t *vd, const vlc_viewpoint_t & init_viewpoint) - :vd(vd) + SensorReceiver(const vout_display_owner_t *o, const vlc_viewpoint_t & init_viewpoint) + :owner(*o) ,current_pos(init_viewpoint) {} @@ -128,7 +128,8 @@ old_pos.roll - current_pos.roll, 0.0f }; - vout_display_SendEventViewpointMoved(vd, &vp); + if (owner.viewpoint_moved) + owner.viewpoint_moved(owner.sys, &vp); return S_OK; } @@ -147,12 +148,12 @@ } private: - vout_display_t *const vd; + vout_display_owner_t owner; vlc_viewpoint_t current_pos; long m_cRef; }; -void *HookWindowsSensors(vout_display_t *vd, HWND hwnd) +void *HookWindowsSensors(vlc_logger *vd, const vout_display_owner_t *move, HWND hwnd) { ComPtr<ISensorManager> pSensorManager; HRESULT hr = CoCreateInstance( __uuidof(SensorManager), @@ -165,13 +166,13 @@ hr = pSensorManager->GetSensorsByType(SENSOR_TYPE_INCLINOMETER_3D, &pInclinometers); if (FAILED(hr)) { - msg_Dbg(vd, "inclinometer not found. (hr=0x%lX)", hr); + vlc_debug(vd, "inclinometer not found. (hr=0x%lX)", hr); return NULL; } ULONG count; pInclinometers->GetCount(&count); - msg_Dbg(vd, "Found %lu inclinometer", count); + vlc_debug(vd, "Found %lu inclinometer", count); for (ULONG i=0; i<count; ++i) { ComPtr<ISensor> pSensor; @@ -213,7 +214,7 @@ PropVariantClear(&pvRot); } - SensorReceiver *received = new(std::nothrow) SensorReceiver(vd, start_viewpoint); + SensorReceiver *received = new(std::nothrow) SensorReceiver(move, start_viewpoint); if (received) { pSensor->SetEventSink(received);
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/sensors.h
Added
@@ -0,0 +1,39 @@ +/***************************************************************************** + * sensors.h: Windows sensor handling + ***************************************************************************** + * Copyright © 2017 Steve Lhomme + * Copyright © 2017 VideoLabs + * + * Authors: Steve Lhomme <robux4@gmail.com> + * + * 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. + *****************************************************************************/ + + +#ifndef VLC_WIN32_COMMON_SENSOR_H +#define VLC_WIN32_COMMON_SENSOR_H + +#ifdef __cplusplus +extern "C" { +#endif + +void* HookWindowsSensors(struct vlc_logger *, const vout_display_owner_t *, HWND); +void UnhookWindowsSensors(void*); + +# ifdef __cplusplus +} +# endif + +#endif // VLC_WIN32_COMMON_SENSOR_H
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/win32touch.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/win32touch.c
Changed
@@ -31,45 +31,34 @@ #include <assert.h> -static BOOL DecodeGestureAction( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ); -static BOOL DecodeGestureProjection( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ); +enum { + GESTURE_ACTION_UNDEFINED = 0, + GESTURE_ACTION_VOLUME, + GESTURE_ACTION_JUMP, + GESTURE_ACTION_BRIGHTNESS +}; -LRESULT DecodeGesture( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture, - HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) + +struct win32_gesture_sys_t { - if( !p_gesture ) - return DefWindowProc( hWnd, message, wParam, lParam ); + DWORD i_type; /* Gesture ID */ + int i_action; /* GESTURE_ACTION */ - GESTUREINFO gi; - ZeroMemory( &gi, sizeof( GESTUREINFO ) ); - gi.cbSize = sizeof( GESTUREINFO ); + int i_beginx; /* Start X position */ + int i_beginy; /* Start Y position */ + int i_lasty; /* Last known Y position for PAN */ + double f_lastzoom; /* Last zoom factor */ - BOOL bResult = p_gesture->OurGetGestureInfo((HGESTUREINFO)lParam, &gi); - BOOL bHandled = FALSE; /* Needed to release the handle */ + ULONGLONG i_ullArguments; /* Base values to compare between 2 zoom gestures */ + bool b_2fingers; /* Did we detect 2 fingers? */ - if( bResult ) - bHandled = p_gesture->DecodeGestureImpl(p_this, p_gesture, &gi); - else - { - DWORD dwErr = GetLastError(); - if( dwErr > 0 ) - msg_Err( p_this, "Could not retrieve a valid GESTUREINFO structure" ); - } + bool (*DecodeGestureImpl)( vlc_object_t *, struct win32_gesture_sys_t *, const GESTUREINFO* ); +}; - if( bHandled ) - { - /* Close the Handle, if we handled the gesture, a contrario - * from the doc example */ - p_gesture->OurCloseGestureInfoHandle((HGESTUREINFO)lParam); - return 0; - } - else - return DefWindowProc( hWnd, message, wParam, lParam ); -} -static BOOL DecodeGestureAction( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ) +static bool DecodeGestureAction( vlc_object_t *p_this, struct win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ) { - BOOL bHandled = FALSE; /* Needed to release the handle */ + bool bHandled = false; /* Needed to release the handle */ switch ( p_gi->dwID ) { case GID_BEGIN: @@ -107,7 +96,7 @@ break; case GID_PAN: p_gesture->i_type = GID_PAN; - bHandled = TRUE; + bHandled = true; if (p_gi->dwFlags & GF_BEGIN) { p_gesture->i_beginx = p_gi->ptsLocation.x; @@ -166,7 +155,7 @@ case GID_TWOFINGERTAP: p_gesture->i_type = GID_TWOFINGERTAP; var_SetInteger( vlc_object_instance(p_this), "key-action", ACTIONID_PLAY_PAUSE ); - bHandled = TRUE; + bHandled = true; break; case GID_ZOOM: p_gesture->i_type = GID_ZOOM; @@ -190,10 +179,10 @@ default: msg_Err( p_this, "Unmanaged dwFlag: %lx", p_gi->dwFlags ); } - bHandled = TRUE; + bHandled = true; break; case WM_VSCROLL: - bHandled = TRUE; + bHandled = true; break; default: break; @@ -202,11 +191,11 @@ } -static BOOL DecodeGestureProjection( vlc_object_t *p_this, win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ) +static bool DecodeGestureProjection( vlc_object_t *p_this, struct win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ) { //vout_display_t *vd = (vout_display_t *)p_this; - BOOL bHandled = FALSE; /* Needed to release the handle */ + bool bHandled = false; /* Needed to release the handle */ switch ( p_gi->dwID ) { case GID_BEGIN: @@ -238,7 +227,7 @@ case GID_PAN: //vd->cfg->display.width; p_gesture->i_type = GID_PAN; - bHandled = TRUE; + bHandled = true; if (p_gi->dwFlags & GF_BEGIN) { p_gesture->i_beginx = p_gi->ptsLocation.x; p_gesture->i_beginy = p_gi->ptsLocation.y; @@ -277,11 +266,11 @@ case GID_TWOFINGERTAP: p_gesture->i_type = GID_TWOFINGERTAP; var_SetInteger( vlc_object_instance(p_this), "key-action", ACTIONID_PLAY_PAUSE ); - bHandled = TRUE; + bHandled = true; break; case GID_ZOOM: p_gesture->i_type = GID_ZOOM; - bHandled = TRUE; + bHandled = true; switch( p_gi->dwFlags ) { case GF_BEGIN: @@ -308,7 +297,7 @@ } break; case WM_VSCROLL: - bHandled = TRUE; + bHandled = true; break; default: break; @@ -316,7 +305,37 @@ return bHandled; } -BOOL InitGestures( HWND hwnd, win32_gesture_sys_t **pp_gesture, bool b_isProjected ) +bool DecodeGesture( vlc_object_t *p_this, struct win32_gesture_sys_t *p_gesture, + HGESTUREINFO hGestureInfo ) +{ + if( !p_gesture ) + return false; + + GESTUREINFO gi; + ZeroMemory( &gi, sizeof( GESTUREINFO ) ); + gi.cbSize = sizeof( GESTUREINFO ); + + if( GetGestureInfo(hGestureInfo, &gi) ) + { + if( p_gesture->DecodeGestureImpl(p_this, p_gesture, &gi) ) + { + /* Close the Handle, if we handled the gesture, a contrario + * from the doc example */ + CloseGestureInfoHandle(hGestureInfo); + return true; + } + } + else + { + DWORD dwErr = GetLastError(); + if( dwErr > 0 ) + msg_Err( p_this, "Could not retrieve a valid GESTUREINFO structure" ); + } + + return false; +} + +struct win32_gesture_sys_t *InitGestures( HWND hwnd, bool b_isProjected ) { BOOL result = FALSE; GESTURECONFIG config = { 0, 0, 0 }; @@ -337,37 +356,21 @@ config.dwBlock = GC_PAN_WITH_INERTIA; } - win32_gesture_sys_t *p_gesture = malloc( sizeof(win32_gesture_sys_t) ); - if( !p_gesture ) - { - *pp_gesture = NULL; - return FALSE; - } - - HINSTANCE h_user32_dll = LoadLibrary(TEXT("user32.dll")); - if( !h_user32_dll ) - { - *pp_gesture = NULL; - free( p_gesture ); - return FALSE; - }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/win32touch.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/win32touch.h
Changed
@@ -41,40 +41,13 @@ extern "C" { #endif -enum { - GESTURE_ACTION_UNDEFINED = 0, - GESTURE_ACTION_VOLUME, - GESTURE_ACTION_JUMP, - GESTURE_ACTION_BRIGHTNESS -}; +struct win32_gesture_sys_t; +struct win32_gesture_sys_t *InitGestures( HWND hwnd, bool b_isProjected ); -typedef struct win32_gesture_sys_t { - DWORD i_type; /* Gesture ID */ - int i_action; /* GESTURE_ACTION */ +bool DecodeGesture( vlc_object_t *, struct win32_gesture_sys_t *, HGESTUREINFO ); - int i_beginx; /* Start X position */ - int i_beginy; /* Start Y position */ - int i_lasty; /* Last known Y position for PAN */ - double f_lastzoom; /* Last zoom factor */ - - ULONGLONG i_ullArguments; /* Base values to compare between 2 zoom gestures */ - bool b_2fingers; /* Did we detect 2 fingers? */ - - BOOL (*DecodeGestureImpl)( vlc_object_t *p_this, struct win32_gesture_sys_t *p_gesture, const GESTUREINFO* p_gi ); - - HINSTANCE huser_dll; /* user32.dll */ - BOOL (WINAPI * OurCloseGestureInfoHandle)(HGESTUREINFO hGestureInfo); - BOOL (WINAPI * OurGetGestureInfo)(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestureInfo); -} win32_gesture_sys_t; - - -BOOL InitGestures( HWND hwnd, win32_gesture_sys_t **p_gesture, bool b_isProjected ); - -LRESULT DecodeGesture( vlc_object_t *p_intf, win32_gesture_sys_t *p_gesture, - HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ); - -void CloseGestures( win32_gesture_sys_t *p_gesture ); +void CloseGestures( struct win32_gesture_sys_t * ); #ifdef __cplusplus }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/modules/video_output/win32/wingdi.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/modules/video_output/win32/wingdi.c
Changed
@@ -59,7 +59,6 @@ *****************************************************************************/ typedef struct vout_display_sys_t { - vout_display_sys_win32_t sys; display_win32_area_t area; int i_depth; @@ -99,7 +98,7 @@ static int Control(vout_display_t *vd, int query) { vout_display_sys_t *sys = vd->sys; - CommonControl(vd, &sys->area, &sys->sys, query); + CommonControl(vd, &sys->area, query); return VLC_SUCCESS; } @@ -124,9 +123,10 @@ if (!sys) return VLC_ENOMEM; - CommonInit(&sys->area); - if (CommonWindowInit(vd, &sys->area, &sys->sys, false)) + CommonInit(&sys->area, vd->source); + if (CommonWindowInit(vd, &sys->area, false)) goto error; + CommonPlacePicture(vd, &sys->area); /* */ if (Init(vd, fmtp)) @@ -150,9 +150,9 @@ Clean(vd); - CommonWindowClean(&sys->sys); + CommonWindowClean(&sys->area); - free(vd->sys); + free(sys); } static void Display(vout_display_t *vd, picture_t *picture) @@ -160,7 +160,7 @@ vout_display_sys_t *sys = vd->sys; VLC_UNUSED(picture); - HDC hdc = GetDC(sys->sys.hvideownd); + HDC hdc = GetDC(CommonVideoHWND(&sys->area)); if (sys->area.place_changed) { @@ -196,7 +196,7 @@ SRCCOPY); } - ReleaseDC(sys->sys.hvideownd, hdc); + ReleaseDC(CommonVideoHWND(&sys->area), hdc); } static int Init(vout_display_t *vd, video_format_t *fmt) @@ -206,7 +206,7 @@ /* Initialize an offscreen bitmap for direct buffer operations. */ /* */ - HDC window_dc = GetDC(sys->sys.hvideownd); + HDC window_dc = GetDC(CommonVideoHWND(&sys->area)); /* */ sys->i_depth = GetDeviceCaps(window_dc, PLANES) * @@ -279,7 +279,7 @@ sys->off_dc = CreateCompatibleDC(window_dc); SelectObject(sys->off_dc, sys->off_bitmap); - ReleaseDC(sys->sys.hvideownd, window_dc); + ReleaseDC(CommonVideoHWND(&sys->area), window_dc); return VLC_SUCCESS; }
View file
_service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/po/meson.build
Added
@@ -0,0 +1,18 @@ +i18n = import('i18n') + +add_project_arguments(f'-DGETTEXT_PACKAGE="@vlc_package_name@"', + language: 'c', 'cpp', 'objc') +i18n.gettext(vlc_package_name, + args: + '--keyword=_', + '--keyword=N_', + '--keyword=_NS', + '--keyword=qtr', + '--keyword=Q_', + '--language=C++', + '--keyword=vlc_ngettext:1,2', + '--keyword=vlc_pgettext:1c,2', + '--keyword=_PNS:1c,2', + '--add-comments=xgettext:', + '--from-code=UTF-8', + )
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/Makefile.am -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/Makefile.am
Changed
@@ -92,6 +92,7 @@ ../include/vlc_playlist_export.h \ ../include/vlc_plugin.h \ ../include/vlc_probe.h \ + ../include/vlc_preparser.h \ ../include/vlc_queue.h \ ../include/vlc_rand.h \ ../include/vlc_renderer_discovery.h \ @@ -260,7 +261,6 @@ preparser/fetcher.c \ preparser/fetcher.h \ preparser/preparser.c \ - preparser/preparser.h \ input/item.c \ input/access.c \ clock/clock_internal.c \
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/input/decoder.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/input/decoder.c
Changed
@@ -1716,7 +1716,7 @@ /* The decoder's main loop */ vlc_fifo_Lock( p_owner->p_fifo ); - while( !p_owner->aborting ) + while( !p_owner->aborting || p_owner->flushing ) { if( p_owner->flushing ) { /* Flush before/regardless of pause. We do not want to resume just
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/input/es_out.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/input/es_out.c
Changed
@@ -1929,7 +1929,7 @@ } free( psz_alloc ); - input_item_SetPreparsed( p_item, true ); + input_item_SetPreparsed( p_item ); input_SendEventMeta( p_input ); /* TODO handle sout meta ? */
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/input/input.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/input/input.c
Changed
@@ -1862,6 +1862,31 @@ } } +int input_SetEsCatDelay(input_thread_t *input, enum es_format_category_e cat, + vlc_tick_t delay) +{ + input_thread_private_t *sys = input_priv(input); + /* A failure can only happen in the input_ControlPush section. */ + int ret = VLC_SUCCESS; + + if (!sys->is_running && !sys->is_stopped) + { + /* Not running, send the control synchronously since we are sure that + * it won't block */ + es_out_SetDelay(sys->p_es_out_display, cat, delay); + } + else + { + const input_control_param_t param = { + .cat_delay = { cat, delay } + }; + ret = input_ControlPush(input, INPUT_CONTROL_SET_CATEGORY_DELAY, + ¶m); + } + + return ret; +} + void input_SetEsCatIds(input_thread_t *input, enum es_format_category_e cat, const char *str_ids) {
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/input/input_interface.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/input/input_interface.h
Changed
@@ -29,7 +29,7 @@ /********************************************************************** * Item metadata **********************************************************************/ -void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed ); +void input_item_SetPreparsed( input_item_t *p_i ); void input_item_SetArtNotFound( input_item_t *p_i, bool b_not_found ); void input_item_SetArtFetched( input_item_t *p_i, bool b_art_fetched ); void input_item_SetEpg( input_item_t *p_item, const vlc_epg_t *p_epg, bool );
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/input/input_internal.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/input/input_internal.h
Changed
@@ -626,6 +626,26 @@ void input_SetProgramId(input_thread_t *input, int group_id); /** + * Set the default delay applied to the given category. + * + * Set the default delay for the given \p es_format_category_e synchronously + * if the input is not running yet, otherwise push a control to signal to the + * input which delay should be updated. + * + * @param input Any input to change the delay for. + * @param cat The ES category to apply the delay to. + * @param delay The delay to apply to the category, a positive delay shifting + * the track to the future. + * @return VLC_SUCCESS when the delay has been applied, or signal an error + * otherwise. + * + * @note This function can be called before start or while running. + * @note This function is not thread-safe, the caller should handle the locking. + */ +int input_SetEsCatDelay(input_thread_t *input, enum es_format_category_e cat, + vlc_tick_t delay); + +/** * Set the list of string ids to enable for a category * * cf. ES_OUT_SET_ES_CAT_IDS
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/input/item.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/input/item.c
Changed
@@ -65,18 +65,14 @@ .u.input_item_error_when_reading_changed.new_value = b_error } ); } } -void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed ) +void input_item_SetPreparsed( input_item_t *p_i ) { bool b_send_event = false; vlc_mutex_lock( &p_i->lock ); int status = vlc_meta_GetStatus(p_i->p_meta); - int new_status; - if( b_preparsed ) - new_status = status | ITEM_PREPARSED; - else - new_status = status & ~ITEM_PREPARSED; + int new_status = status | ITEM_PREPARSED; if( status != new_status ) { vlc_meta_SetStatus(p_i->p_meta, new_status);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/libvlc.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/libvlc.c
Changed
@@ -36,11 +36,11 @@ #endif #include <vlc_common.h> +#include <vlc_preparser.h> #include "../lib/libvlc_internal.h" #include "modules/modules.h" #include "config/configuration.h" -#include "preparser/preparser.h" #include "media_source/media_source.h" #include <stdio.h> /* sprintf() */ @@ -230,7 +230,7 @@ /* * Meta data handling */ - priv->parser = input_preparser_New(VLC_OBJECT(p_libvlc)); + priv->parser = vlc_preparser_New(VLC_OBJECT(p_libvlc)); if( !priv->parser ) goto error; @@ -343,7 +343,7 @@ libvlc_priv_t *priv = libvlc_priv (p_libvlc); if (priv->parser != NULL) - input_preparser_Deactivate(priv->parser); + vlc_preparser_Deactivate(priv->parser); /* Ask the interfaces to stop and destroy them */ msg_Dbg( p_libvlc, "removing all interfaces" ); @@ -376,7 +376,7 @@ #endif if (priv->parser != NULL) - input_preparser_Delete(priv->parser); + vlc_preparser_Delete(priv->parser); if (priv->main_playlist) vlc_playlist_Delete(priv->main_playlist); @@ -452,7 +452,7 @@ int vlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item, input_item_meta_request_option_t i_options, - const input_preparser_callbacks_t *cbs, + const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int timeout, void *id) { @@ -461,7 +461,7 @@ if (unlikely(priv->parser == NULL)) return VLC_ENOMEM; - return input_preparser_Push( priv->parser, item, i_options, cbs, + return vlc_preparser_Push( priv->parser, item, i_options, cbs, cbs_userdata, timeout, id ); } @@ -472,7 +472,7 @@ */ int libvlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item, input_item_meta_request_option_t i_options, - const input_preparser_callbacks_t *cbs, + const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int timeout, void *id) { @@ -491,26 +491,6 @@ } /** - * Requests retrieving/downloading art for an input item. - * The retrieval is performed asynchronously. - */ -int libvlc_ArtRequest(libvlc_int_t *libvlc, input_item_t *item, - input_item_meta_request_option_t i_options, - const input_fetcher_callbacks_t *cbs, - void *cbs_userdata) -{ - libvlc_priv_t *priv = libvlc_priv(libvlc); - assert(i_options & META_REQUEST_OPTION_FETCH_ANY); - - if (unlikely(priv->parser == NULL)) - return VLC_ENOMEM; - - input_preparser_fetcher_Push(priv->parser, item, i_options, - cbs, cbs_userdata); - return VLC_SUCCESS; -} - -/** * Cancels extraction of the meta data for an input item. * * This does nothing if the input item is already processed or if it was not @@ -523,5 +503,5 @@ if (unlikely(priv->parser == NULL)) return; - input_preparser_Cancel(priv->parser, id); + vlc_preparser_Cancel(priv->parser, id); }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/libvlc.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/libvlc.h
Changed
@@ -186,7 +186,7 @@ vlc_keystore *p_memory_keystore; ///< memory keystore intf_thread_t *interfaces; ///< Linked-list of interfaces vlc_playlist_t *main_playlist; - struct input_preparser_t *parser; ///< Input item meta data handler + struct vlc_preparser_t *parser; ///< Input item meta data handler vlc_media_source_provider_t *media_source_provider; vlc_actions_t *actions; ///< Hotkeys handler struct vlc_medialibrary_t *p_media_library; ///< Media library instance @@ -208,7 +208,7 @@ int vlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item, input_item_meta_request_option_t i_options, - const input_preparser_callbacks_t *cbs, + const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int timeout, void *id);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/libvlccore.sym -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/libvlccore.sym
Changed
@@ -53,6 +53,7 @@ vlc_frame_heap_Alloc vlc_frame_Init vlc_frame_mmap_Alloc +vlc_frame_New vlc_frame_shm_Alloc vlc_frame_Realloc vlc_frame_Release @@ -243,7 +244,6 @@ libvlc_SetExitHandler libvlc_MetadataRequest libvlc_MetadataCancel -libvlc_ArtRequest vlc_UrlParse vlc_UrlParseFixup vlc_UrlClean @@ -1027,3 +1027,8 @@ vlc_input_attachment_Release vlc_input_attachment_New vlc_input_attachment_Hold +vlc_preparser_New +vlc_preparser_Push +vlc_preparser_Cancel +vlc_preparser_Delete +vlc_preparser_Deactivate
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/media_source/media_tree.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/media_source/media_tree.c
Changed
@@ -334,7 +334,7 @@ return true; } -static const input_preparser_callbacks_t input_preparser_callbacks = { +static const struct vlc_metadata_cbs preparser_callbacks = { .on_subtree_added = media_subtree_changed, .on_preparse_ended = media_subtree_preparse_ended }; @@ -348,12 +348,12 @@ VLC_UNUSED(libvlc); VLC_UNUSED(media); VLC_UNUSED(id); - VLC_UNUSED(input_preparser_callbacks); + VLC_UNUSED(preparser_callbacks); #else media->i_preparse_depth = 1; vlc_MetadataRequest(libvlc, media, META_REQUEST_OPTION_SCOPE_ANY | META_REQUEST_OPTION_DO_INTERACT, - &input_preparser_callbacks, tree, 0, id); + &preparser_callbacks, tree, 0, id); #endif }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/meson.build -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/meson.build
Changed
@@ -121,7 +121,6 @@ 'preparser/fetcher.c', 'preparser/fetcher.h', 'preparser/preparser.c', - 'preparser/preparser.h', 'input/item.c', 'input/access.c', 'clock/clock_internal.c',
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/misc/fourcc.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/misc/fourcc.c
Changed
@@ -562,6 +562,8 @@ VLC_CODEC_NVDEC_OPAQUE_16B, VLC_CODEC_NVDEC_OPAQUE_444, VLC_CODEC_NVDEC_OPAQUE_444_16B, + VLC_CODEC_YUV420A, + VLC_CODEC_YUV422A, 0, };
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/misc/fourcc_list.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/misc/fourcc_list.h
Changed
@@ -302,6 +302,7 @@ E("X263", "Xirlink H263"), /* Zygo (partial) */ E("ZyGo", "ITU H263+"), + A("HAVI"), /* H263i */ B(VLC_CODEC_H263I, "I263.I"), @@ -625,6 +626,9 @@ B(VLC_CODEC_QDRAW, "Apple QuickDraw Video"), A("qdrw"), + B(VLC_CODEC_QOI, "Quite OK Image Format"), + A("qoif"), + B(VLC_CODEC_QPEG, "QPEG Video"), A("QPEG"), A("Q1.0"),
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/misc/frame.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/misc/frame.c
Changed
@@ -72,6 +72,16 @@ dst->i_length = src->i_length; } +vlc_frame_t *vlc_frame_New(const struct vlc_frame_callbacks *cbs, + void *buf, size_t size) +{ + vlc_frame_t *f = malloc(sizeof (*f)); + if (unlikely(f == NULL)) + return NULL; + + return vlc_frame_Init(f, cbs, buf, size); +} + vlc_frame_t *vlc_frame_Init(vlc_frame_t *restrict f, const struct vlc_frame_callbacks *cbs, void *buf, size_t size) { @@ -91,18 +101,6 @@ return f; } -static void vlc_frame_generic_Release (vlc_frame_t *frame) -{ - /* That is always true for frames allocated with vlc_frame_Alloc(). */ - assert (frame->p_start == (unsigned char *)(frame + 1)); - free (frame); -} - -static const struct vlc_frame_callbacks vlc_frame_generic_cbs = -{ - vlc_frame_generic_Release, -}; - /** Initial memory alignment of data frame. * @note This must be a multiple of sizeof(void*) and a power of two. * libavcodec AVX optimizations require at least 32-bytes. */ @@ -119,22 +117,34 @@ return NULL; } + static_assert ((VLC_FRAME_PADDING % VLC_FRAME_ALIGN) == 0, + "VLC_FRAME_PADDING must be a multiple of VLC_FRAME_ALIGN"); + /* 2 * VLC_FRAME_PADDING: pre + post padding */ - const size_t alloc = sizeof (vlc_frame_t) + VLC_FRAME_ALIGN + (2 * VLC_FRAME_PADDING) - + size; - if (unlikely(alloc <= size)) + size_t capacity = (2 * VLC_FRAME_PADDING) + size; + unsigned char *buf; +#ifdef HAVE_ALIGNED_ALLOC + capacity += (-size) % VLC_FRAME_ALIGN; + buf = aligned_alloc(VLC_FRAME_ALIGN, capacity); +#else + capacity += VLC_FRAME_ALIGN; + buf = malloc(capacity); +#endif + if (unlikely(buf == NULL)) return NULL; - vlc_frame_t *f = malloc (alloc); - if (unlikely(f == NULL)) - return NULL; + vlc_frame_t *f = vlc_frame_heap_Alloc(buf, capacity); + if (likely(f != NULL)) { +#ifndef HAVE_ALIGNED_ALLOC + /* Alignment */ + buf += (-(uintptr_t)(void *)buf) % (uintptr_t)VLC_FRAME_ALIGN; +#endif + /* Header reserve */ + buf += VLC_FRAME_PADDING; + f->p_buffer = buf; + f->i_buffer = size; + } - vlc_frame_Init(f, &vlc_frame_generic_cbs, f + 1, alloc - sizeof (*f)); - static_assert ((VLC_FRAME_PADDING % VLC_FRAME_ALIGN) == 0, - "VLC_FRAME_PADDING must be a multiple of VLC_FRAME_ALIGN"); - f->p_buffer += VLC_FRAME_PADDING + VLC_FRAME_ALIGN - 1; - f->p_buffer = (void *)(((uintptr_t)f->p_buffer) & ~(VLC_FRAME_ALIGN - 1)); - f->i_buffer = size; return f; } @@ -261,14 +271,10 @@ vlc_frame_t *vlc_frame_heap_Alloc (void *addr, size_t length) { - vlc_frame_t *frame = malloc (sizeof (*frame)); - if (frame == NULL) - { - free (addr); - return NULL; - } - - return vlc_frame_Init(frame, &vlc_frame_heap_cbs, addr, length); + vlc_frame_t *frame = vlc_frame_New(&vlc_frame_heap_cbs, addr, length); + if (unlikely(frame == NULL)) + free(addr); + return frame; } #ifdef HAVE_MMAP @@ -293,18 +299,14 @@ long page_mask = sysconf(_SC_PAGESIZE) - 1; size_t left = ((uintptr_t)addr) & page_mask; size_t right = (-length) & page_mask; - - vlc_frame_t *frame = malloc (sizeof (*frame)); - if (frame == NULL) - { - munmap (addr, length); - return NULL; - } - - vlc_frame_Init(frame, &vlc_frame_mmap_cbs, - ((char *)addr) - left, left + length + right); - frame->p_buffer = addr; - frame->i_buffer = length; + vlc_frame_t *frame = vlc_frame_New(&vlc_frame_mmap_cbs, + ((char *)addr) - left, + left + length + right); + if (likely(frame != NULL)) { + frame->p_buffer = addr; + frame->i_buffer = length; + } else + munmap(addr, length); return frame; } #else @@ -367,14 +369,11 @@ vlc_frame_t *vlc_frame_shm_Alloc (void *addr, size_t length) { - vlc_frame_t *frame = malloc (sizeof (*frame)); + vlc_frame_t *frame = vlc_frame_New(&vlc_frame_shm_cbs, (uint8_t *)addr, + length); if (unlikely(frame == NULL)) - { - shmdt (addr); - return NULL; - } - - return vlc_frame_Init(frame, &vlc_frame_shm_cbs, (uint8_t *)addr, length); + shmdt(addr); + return frame; } #else vlc_frame_t *vlc_frame_shm_Alloc (void *addr, size_t length) @@ -521,8 +520,8 @@ vlc_frame_Release (frame); frame = NULL; errno = EIO; - goto done; } +done: #else // !_WIN32 for (size_t i = 0; i < length;) { @@ -536,7 +535,6 @@ i += len; } #endif // !_WIN32 -done: vlc_cleanup_pop (); return frame; }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/misc/image.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/misc/image.c
Changed
@@ -607,6 +607,7 @@ { VLC_FOURCC('x','c','f',' '), "xcf" }, { VLC_CODEC_PCX, "pcx" }, { VLC_CODEC_GIF, "gif" }, + { VLC_CODEC_QOI, "qoi" }, { VLC_CODEC_SVG, "svg" }, { VLC_CODEC_TIFF, "tif" }, { VLC_CODEC_TIFF, "tiff" }, @@ -652,6 +653,7 @@ { VLC_CODEC_BPG, "image/bpg" }, { VLC_CODEC_PCX, "image/pcx" }, { VLC_CODEC_PNG, "image/png" }, + { VLC_CODEC_QOI, "image/qoi" }, { VLC_CODEC_SVG, "image/svg+xml" }, { VLC_CODEC_TIFF, "image/tiff" }, { VLC_CODEC_TARGA, "image/x-tga" },
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/misc/mime.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/misc/mime.c
Changed
@@ -51,6 +51,7 @@ { ".jpg", "image/jpeg" }, { ".jpeg", "image/jpeg" }, { ".png", "image/png" }, + { ".qoi", "image/qoi" }, { ".pct", "image/x-pict" }, /* same as modules/mux/mpjpeg.c here: */ { ".mpjpeg","multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a" },
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/player/input.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/player/input.c
Changed
@@ -1023,12 +1023,7 @@ input->cat_delaysi = cat_delaysi; if (cat_delaysi != 0) { - const input_control_param_t param = { - .cat_delay = { i, cat_delaysi } - }; - int ret = input_ControlPush(input->thread, - INPUT_CONTROL_SET_CATEGORY_DELAY, - ¶m); + int ret = input_SetEsCatDelay(input->thread, i, cat_delaysi); if (ret == VLC_SUCCESS) vlc_player_SendEvent(player, on_category_delay_changed, i, cat_delaysi);
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/player/player.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/player/player.c
Changed
@@ -1663,9 +1663,7 @@ delay = *cat_delay; } - const input_control_param_t param = { .cat_delay = { cat, delay } }; - int ret = input_ControlPush(input->thread, INPUT_CONTROL_SET_CATEGORY_DELAY, - ¶m); + int ret = input_SetEsCatDelay(input->thread, cat, delay); if (ret == VLC_SUCCESS) { vlc_player_osd_Message(player, _("%s delay: %i ms"),
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/playlist/preparse.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/playlist/preparse.c
Changed
@@ -106,7 +106,7 @@ vlc_playlist_Unlock(playlist); } -static const input_preparser_callbacks_t input_preparser_callbacks = { +static const struct vlc_metadata_cbs preparser_callbacks = { .on_preparse_ended = on_preparse_ended, .on_subtree_added = on_subtree_added, }; @@ -117,13 +117,13 @@ #ifdef TEST_PLAYLIST VLC_UNUSED(playlist); VLC_UNUSED(input); - VLC_UNUSED(input_preparser_callbacks); + VLC_UNUSED(preparser_callbacks); #else /* vlc_MetadataRequest is not exported */ vlc_MetadataRequest(playlist->libvlc, input, META_REQUEST_OPTION_SCOPE_LOCAL | META_REQUEST_OPTION_FETCH_LOCAL, - &input_preparser_callbacks, playlist, -1, NULL); + &preparser_callbacks, playlist, -1, NULL); #endif }
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/preparser/fetcher.h -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/preparser/fetcher.h
Changed
@@ -34,6 +34,10 @@ */ typedef struct input_fetcher_t input_fetcher_t; +typedef struct input_fetcher_callbacks_t { + void (*on_art_fetch_ended)(input_item_t *, bool fetched, void *userdata); +} input_fetcher_callbacks_t; + /** * This function creates the fetcher object and thread. */
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/preparser/preparser.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/preparser/preparser.c
Changed
@@ -25,13 +25,13 @@ #include <vlc_common.h> #include <vlc_atomic.h> #include <vlc_executor.h> +#include <vlc_preparser.h> #include "input/input_interface.h" #include "input/input_internal.h" -#include "preparser.h" #include "fetcher.h" -struct input_preparser_t +struct vlc_preparser_t { vlc_object_t* owner; input_fetcher_t* fetcher; @@ -45,10 +45,10 @@ struct task { - input_preparser_t *preparser; + vlc_preparser_t *preparser; input_item_t *item; input_item_meta_request_option_t options; - const input_preparser_callbacks_t *cbs; + const struct vlc_metadata_cbs *cbs; void *userdata; void *id; vlc_tick_t timeout; @@ -56,21 +56,20 @@ input_item_parser_id_t *parser; vlc_sem_t preparse_ended; - vlc_sem_t fetch_ended; atomic_int preparse_status; atomic_bool interrupted; struct vlc_runnable runnable; /**< to be passed to the executor */ - struct vlc_list node; /**< node of input_preparser_t.submitted_tasks */ + struct vlc_list node; /**< node of vlc_preparser_t.submitted_tasks */ }; static void RunnableRun(void *); static struct task * -TaskNew(input_preparser_t *preparser, input_item_t *item, +TaskNew(vlc_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t options, - const input_preparser_callbacks_t *cbs, void *userdata, + const struct vlc_metadata_cbs *cbs, void *userdata, void *id, vlc_tick_t timeout) { assert(timeout >= 0); @@ -91,7 +90,6 @@ task->parser = NULL; vlc_sem_init(&task->preparse_ended, 0); - vlc_sem_init(&task->fetch_ended, 0); atomic_init(&task->preparse_status, ITEM_PREPARSE_SKIPPED); atomic_init(&task->interrupted, false); @@ -109,7 +107,7 @@ } static void -PreparserAddTask(input_preparser_t *preparser, struct task *task) +PreparserAddTask(vlc_preparser_t *preparser, struct task *task) { vlc_mutex_lock(&preparser->lock); vlc_list_append(&task->node, &preparser->submitted_tasks); @@ -117,7 +115,7 @@ } static void -PreparserRemoveTask(input_preparser_t *preparser, struct task *task) +PreparserRemoveTask(vlc_preparser_t *preparser, struct task *task) { vlc_mutex_lock(&preparser->lock); vlc_list_remove(&task->node); @@ -125,9 +123,17 @@ } static void -NotifyPreparseEnded(struct task *task) +NotifyPreparseEnded(struct task *task, bool art_fetched) { - if (task->cbs && task->cbs->on_preparse_ended) { + if (task->cbs == NULL) + return; + + if (task->options & META_REQUEST_OPTION_FETCH_ANY + && task->cbs->on_art_fetch_ended) + task->cbs->on_art_fetch_ended(task->item, art_fetched, + task->userdata); + + if (task->cbs->on_preparse_ended) { int status = atomic_load_explicit(&task->preparse_status, memory_order_relaxed); task->cbs->on_preparse_ended(task->item, status, task->userdata); @@ -173,7 +179,11 @@ struct task *task = userdata; - vlc_sem_post(&task->fetch_ended); + if (!atomic_load(&task->interrupted)) + input_item_SetPreparsed(task->item); + + NotifyPreparseEnded(task, fetched); + TaskDelete(task); } static const input_fetcher_callbacks_t input_fetcher_callbacks = { @@ -212,22 +222,16 @@ input_item_parser_id_Release(task->parser); } -static void +static int Fetch(struct task *task) { input_fetcher_t *fetcher = task->preparser->fetcher; if (!fetcher || !(task->options & META_REQUEST_OPTION_FETCH_ANY)) - return; - - int ret = - input_fetcher_Push(fetcher, task->item, - task->options & META_REQUEST_OPTION_FETCH_ANY, - &input_fetcher_callbacks, task); - if (ret != VLC_SUCCESS) - return; + return VLC_ENOENT; - /* Wait until the end of fetching (fetching is not interruptible) */ - vlc_sem_wait(&task->fetch_ended); + return input_fetcher_Push(fetcher, task->item, + task->options & META_REQUEST_OPTION_FETCH_ANY, + &input_fetcher_callbacks, task); } static void @@ -236,29 +240,38 @@ vlc_thread_set_name("vlc-run-prepars"); struct task *task = userdata; + vlc_preparser_t *preparser = task->preparser; vlc_tick_t deadline = task->timeout ? vlc_tick_now() + task->timeout : VLC_TICK_INVALID; - if (atomic_load(&task->interrupted)) - goto end; + if (task->options & (META_REQUEST_OPTION_SCOPE_ANY| + META_REQUEST_OPTION_SCOPE_FORCED)) + { + if (atomic_load(&task->interrupted)) + { + PreparserRemoveTask(preparser, task); + goto end; + } + + Parse(task, deadline); + } - Parse(task, deadline); + PreparserRemoveTask(preparser, task); if (atomic_load(&task->interrupted)) goto end; - Fetch(task); + int ret = Fetch(task); - if (atomic_load(&task->interrupted)) - goto end; + if (ret == VLC_SUCCESS) + return; /* Remove the task and notify from the fetcher callback */ - input_item_SetPreparsed(task->item, true); + if (!atomic_load(&task->interrupted)) + input_item_SetPreparsed(task->item); end: - NotifyPreparseEnded(task); - input_preparser_t *preparser = task->preparser; - PreparserRemoveTask(preparser, task); + NotifyPreparseEnded(task, false); TaskDelete(task); } @@ -273,9 +286,9 @@ vlc_sem_post(&task->preparse_ended); } -input_preparser_t* input_preparser_New( vlc_object_t *parent ) +vlc_preparser_t* vlc_preparser_New( vlc_object_t *parent ) { - input_preparser_t* preparser = malloc( sizeof *preparser ); + vlc_preparser_t* preparser = malloc( sizeof *preparser ); if (!preparser)
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/test/shared_data_ptr.cpp -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/test/shared_data_ptr.cpp
Changed
@@ -1,4 +1,4 @@ -#include <assert.h> +#include <cassert> #include <algorithm> #include <random> #include <vector>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/src/win32/dirs.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/src/win32/dirs.c
Changed
@@ -30,9 +30,6 @@ #endif #include <vlc_common.h> -#ifdef __MINGW32__ -# include <w32api.h> -#endif #include <direct.h> #include <shlobj.h>
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/test/libvlc/media.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/test/libvlc/media.c
Changed
@@ -169,7 +169,7 @@ vlc_sem_t sem; vlc_sem_init (&sem, 0); - const struct input_preparser_callbacks_t cbs = { + const struct vlc_metadata_cbs cbs = { .on_preparse_ended = input_item_preparse_timeout, }; i_ret = libvlc_MetadataRequest(vlc->p_libvlc_int, p_item,
View file
_service:obs_scm:vlc-beta-20230331.181e91d001.obscpio/test/src/input/decoder/input_decoder.c -> _service:obs_scm:vlc-beta-20230421.8d930c5670.obscpio/test/src/input/decoder/input_decoder.c
Changed
@@ -96,8 +96,8 @@ static void DecoderFlush(decoder_t *dec) { struct input_decoder_scenario *scenario = &input_decoder_scenarioscurrent_scenario; - assert(scenario->decoder_flush != NULL); - return scenario->decoder_flush(dec); + if (scenario->decoder_flush != NULL) + scenario->decoder_flush(dec); } static void CloseDecoder(vlc_object_t *obj)
View file
_service:obs_scm:vlc-beta.obsinfo
Changed
@@ -1,4 +1,4 @@ name: vlc-beta -version: 20230331.181e91d001 -mtime: 1680257182 -commit: 181e91d00132d57205936d1cd6844b08756b0b4c +version: 20230421.8d930c5670 +mtime: 1682043073 +commit: 8d930c56700387bddc399872c69ec88b4c0c6387
View file
vlc-beta.rebase-changes.sh
Added
@@ -0,0 +1,69 @@ +#!/bin/bash +set -e +unset LANG +unset ${!LC_*} +read td < <(mktemp --directory --tmpdir=/dev/shm .XXX) +trap "rm -rf '${td}'" EXIT +# +d_extract="${td}/e" +d_old="${td}/o" +d_new="${td}/n" +# +read vlc_beta_pkg < <(readlink -f "$1") +read vlc_git < <(readlink -f "$2") +# +test -f "${vlc_git}/.git/config" +test -f "${vlc_beta_pkg}/.osc/_package" +read pkg < "$_" +test "${pkg}" = 'vlc-beta' +mkdir "${d_extract}" "${d_old}" "${d_new}" +pushd "${vlc_beta_pkg}" > /dev/null +for patch in *.patch +do + sed ' + /^---:blank:/d + /^+++:blank:/d + /^@@:blank:/d + ' < "${patch}" > "${d_old}/${patch}" +done +pushd "${vlc_git}" > /dev/null +git --no-pager checkout master +git --no-pager pull +git --no-pager checkout vlc-beta +git --no-pager rebase master +git --no-pager format-patch --quiet --output-directory "${d_extract}" master..HEAD +# +sed -i -n ' +: sep +n +/^---$/b stat +b sep +: stat +n +/^$/b body +b stat +: body +n +/^diff:blank:\+--git:blank:\+/b body +/^index:blank:\+0-9a-f\+/b body +p +b body +' "${d_extract}"/*.patch +pushd "${d_extract}" > /dev/null +for patch in *.patch +do + o="${patch}" + n="${patch#*-}" + mv "${o}" "${n}" + sed ' + /^---:blank:/d + /^+++:blank:/d + /^@@:blank:/d + ' < "${n}" > "${d_new}/${n}" + if diff -u "${d_old}/${n}" "${d_new}/${n}" + then + rm "${n}" + else + mv -vit "${vlc_beta_pkg}" "${n}" + fi +done
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.