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.
Changes of Revision 64
vlc-beta.changes
Changed
x
1
2
-------------------------------------------------------------------
3
-Mon Apr 5 13:13:13 UTC 2021 - olaf@aepfle.de
4
+Fri Apr 30 20:10:00 UTC 2021 - olaf@aepfle.de
5
6
-- Update to 20210405.f3c7ba5bb3
7
+- Update to 20210430.0b6b242324
8
9
-------------------------------------------------------------------
10
Sun Jan 21 21:10:34 UTC 2018 - enzokiel@kabelmail.de
11
vlc-beta.spec
Changed
201
1
2
%bcond_with opengles
3
%endif
4
Name: vlc-beta
5
-Version: 20210405.f3c7ba5bb3
6
+Version: 20210430.0b6b242324
7
Release: 0
8
Summary: Video Lan Client multimedia player
9
License: GPL-2.0+ and LGPL-2.1+
10
11
Patch6: fix_freerdp2_detection.patch
12
Patch7: fix_lua53_luaL_checkint.patch
13
14
+Conflicts: vlc
15
+Conflicts: vlc-devel
16
+Obsoletes: vlc-codec-gstreamer < %{version}-%{release}
17
+Obsoletes: vlc-codec-gstreamer-debuginfo < %{version}-%{release}
18
+Obsoletes: vlc-debuginfo < %{version}-%{release}
19
+Obsoletes: vlc-debugsource < %{version}-%{release}
20
+Obsoletes: vlc-devel < %{version}-%{release}
21
+Obsoletes: vlc-jack < %{version}-%{release}
22
+Obsoletes: vlc-jack-debuginfo < %{version}-%{release}
23
+Obsoletes: vlc-lang < %{version}-%{release}
24
+Obsoletes: vlc-noX < %{version}-%{release}
25
+Obsoletes: vlc-noX-debuginfo < %{version}-%{release}
26
+Obsoletes: vlc-opencv < %{version}-%{release}
27
+Obsoletes: vlc-opencv-debuginfo < %{version}-%{release}
28
+Obsoletes: vlc-qt < %{version}-%{release}
29
+Obsoletes: vlc-qt-debuginfo < %{version}-%{release}
30
+Obsoletes: vlc-vdpau < %{version}-%{release}
31
+Obsoletes: vlc-vdpau-debuginfo < %{version}-%{release}
32
+Provides: vlc-codec-gstreamer = %{version}-%{release}
33
+Provides: vlc-codec-gstreamer-debuginfo = %{version}-%{release}
34
+Provides: vlc-debuginfo = %{version}-%{release}
35
+Provides: vlc-debugsource = %{version}-%{release}
36
+Provides: vlc-devel = %{version}-%{release}
37
+Provides: vlc-jack = %{version}-%{release}
38
+Provides: vlc-jack-debuginfo = %{version}-%{release}
39
+Provides: vlc-lang = %{version}-%{release}
40
+Provides: vlc-noX = %{version}-%{release}
41
+Provides: vlc-noX-debuginfo = %{version}-%{release}
42
+Provides: vlc-opencv = %{version}-%{release}
43
+Provides: vlc-opencv-debuginfo = %{version}-%{release}
44
+Provides: vlc-qt = %{version}-%{release}
45
+Provides: vlc-qt-debuginfo = %{version}-%{release}
46
+Provides: vlc-vdpau = %{version}-%{release}
47
+Provides: vlc-vdpau-debuginfo = %{version}-%{release}
48
+
49
+Obsoletes: libvlc123 < %{version}-%{release}
50
+Obsoletes: libvlc123-debuginfo < %{version}-%{release}
51
+Obsoletes: libvlccore123 < %{version}-%{release}
52
+Obsoletes: libvlccore123-debuginfo < %{version}-%{release}
53
+Obsoletes: vlc-beta-debuginfo < %{version}-%{release}
54
+Obsoletes: vlc-beta-debugsource < %{version}-%{release}
55
+Obsoletes: vlc-beta-devel < %{version}-%{release}
56
+Obsoletes: vlc-beta-noX < %{version}-%{release}
57
+Obsoletes: vlc-beta-noX-debuginfo < %{version}-%{release}
58
+Obsoletes: vlc-beta-noX-lang < %{version}-%{release}
59
+Obsoletes: vlc-beta-qt < %{version}-%{release}
60
+Obsoletes: vlc-beta-qt-debuginfo < %{version}-%{release}
61
+Provides: libvlc123 = %{version}-%{release}
62
+Provides: libvlc123-debuginfo = %{version}-%{release}
63
+Provides: libvlccore123 = %{version}-%{release}
64
+Provides: libvlccore123-debuginfo = %{version}-%{release}
65
+Provides: vlc-beta-debuginfo = %{version}-%{release}
66
+Provides: vlc-beta-debugsource = %{version}-%{release}
67
+Provides: vlc-beta-devel = %{version}-%{release}
68
+Provides: vlc-beta-noX = %{version}-%{release}
69
+Provides: vlc-beta-noX-debuginfo = %{version}-%{release}
70
+Provides: vlc-beta-noX-lang = %{version}-%{release}
71
+Provides: vlc-beta-qt = %{version}-%{release}
72
+Provides: vlc-beta-qt-debuginfo = %{version}-%{release}
73
+
74
BuildRequires: gcc
75
BuildRequires: gcc-c++
76
BuildRequires: flex
77
78
BuildRequires: pkgconfig(libswscale) >= 0.5.0
79
BuildRequires: pkgconfig(libpostproc)
80
BuildRequires: pkgconfig(faad2)
81
+%if 0%{?suse_version} > 1500
82
BuildRequires: pkgconfig(rav1e)
83
+%endif
84
BuildRequires: pkgconfig(dav1d) >= 0.5.0
85
BuildRequires: pkgconfig(vpx) >= 1.5.0
86
BuildRequires: pkgconfig(twolame)
87
88
BuildRequires: fdupes
89
BuildRequires: update-desktop-files
90
91
-Requires: %{name}-noX = %{version}-%{release}
92
-Requires: %{name}-qt = %{version}-%{release}
93
-Conflicts: vlc
94
-
95
%description
96
VLC media player is a highly portable multimedia player for various
97
audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...)
98
99
It can also be used as a server to stream in unicast or multicast
100
in IPv4 or IPv6 on a high-bandwidth network.
101
102
-%package devel
103
-Summary: Video Lan Client Development system
104
-Group: Development/Libraries/C and C++
105
-Requires: %{name} = %{version}-%{release}
106
-Conflicts: vlc-devel
107
-
108
-%description devel
109
-Those development headers are required if you plan on coding against VLC
110
-
111
-%package -n libvlc%{libvlc}
112
-Summary: Shared library libvlc
113
-Group: System/Libraries
114
-Requires: %{name} = %{version}-%{release}
115
-
116
-%description -n libvlc%{libvlc}
117
-Shared library libvlc. To be installed by system dependencies
118
-
119
-%package -n libvlccore%{libvlccore}
120
-Summary: Shared library libvlc
121
-Group: System/Libraries
122
-Requires: %{name} = %{version}-%{release}
123
-
124
-%description -n libvlccore%{libvlccore}
125
-Shared library libvlc. To be installed by system dependencies
126
-
127
-%package noX
128
-Summary: VLC: VideoLAN Client - without X dependencies
129
-Group: Productivity/Multimedia/Video/Players
130
-Requires: libvlc%{libvlc} = %{version}-%{release}
131
-Requires: libvlccore%{libvlccore} = %{version}-%{release}
132
-Provides: %{name}-codecs = %{version}-%{release}
133
-Obsoletes: %{name}-codecs < %{version}-%{release}
134
-Obsoletes: %{name}-codecs-debuginfo
135
-Recommends: %{name}-noX-lang
136
-Recommends: libdvdcss
137
-Conflicts: vlc-codec-gstreamer
138
-Conflicts: vlc-codec-gstreamer-debuginfo
139
-Conflicts: vlc-codecs
140
-Conflicts: vlc-codecs-debuginfo
141
-Conflicts: vlc-jack
142
-Conflicts: vlc-jack-debuginfo
143
-Conflicts: vlc-noX
144
-Conflicts: vlc-noX-debuginfo
145
-Conflicts: vlc-opencv
146
-Conflicts: vlc-opencv-debuginfo
147
-Conflicts: vlc-vdpau
148
-Conflicts: vlc-vdpau-debuginfo
149
-
150
-%description noX
151
-This Package of VLC contains the bare requirements you need to install.
152
-Here is no graphical User Interface included, thus it's also perfectly
153
-suitable for server installations (Streaming Server for example)
154
-
155
-Should you decide to install the GUI modules, %{name}-noX will stay
156
-installed as a dependency.
157
-
158
-%lang_package -n %{name}-noX
159
-
160
-
161
-%package qt
162
-Summary: VLC: VideoLAN Client - Qt interface
163
-Group: Productivity/Multimedia/Video/Players
164
-Requires: %{name}-noX = %{version}-%{release}
165
-Supplements: packageand(%{name}-noX:libqt5)
166
-Conflicts: vlc-qt
167
-
168
-%description qt
169
-The all new Qt interface for the VLC VideoLAN Client.
170
-
171
%prep
172
%autosetup -p1
173
174
175
--enable-postproc \
176
--enable-faad \
177
--disable-aom \
178
+%if 0%{?suse_version} > 1500
179
--enable-rav1e \
180
+%endif
181
--enable-dav1d \
182
--disable-vpx \
183
--enable-vpx \
184
185
--disable-osx-notifications \
186
--enable-gbm \
187
--enable-notify \
188
- --disable-libplacebo \
189
--disable-vulkan \
190
--enable-libplacebo \
191
--enable-vulkan \
192
193
done
194
%find_lang vlc
195
196
-%files
197
-%{_bindir}/vlc
198
-%{_bindir}/vlc-wrapper
199
+%post -p /sbin/ldconfig
200
+
201
vlc-beta.patch
Changed
37
1
2
control/cli/cli.c: In function 'Run':
3
control/cli/cli.c:541:1: error: no return statement in function returning non-void [-Werror=return-type]
4
5
-diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c
6
-index 2fa1e7b90d..5de888d3af 100644
7
--- a/modules/control/cli/cli.c
8
+++ b/modules/control/cli/cli.c
9
-@@ -503,9 +503,8 @@ static void cli_client_delete(struct cli_client *cl)
10
+@@ -524,9 +524,8 @@ static void cli_client_delete(struct cli
11
free(cl);
12
}
13
14
15
intf_sys_t *sys = intf->p_sys;
16
17
assert(sys->pi_socket_listen != NULL);
18
-@@ -540,6 +539,13 @@ static void *Run(void *data)
19
+@@ -561,6 +560,13 @@ static void *Run(void *data)
20
}
21
}
22
23
24
#else
25
static void msg_vprint(intf_thread_t *p_intf, const char *psz_fmt, va_list args)
26
{
27
+--- a/modules/video_output/placebo_utils.h
28
++++ b/modules/video_output/placebo_utils.h
29
+@@ -319,7 +319,6 @@ static const struct pl_filter_config *co
30
+ [SCALE_EWA_LANCZOS] = &pl_filter_ewa_lanczos,
31
+ [SCALE_EWA_GINSENG] = &pl_filter_ewa_ginseng,
32
+ [SCALE_EWA_HANN] = &pl_filter_ewa_hann,
33
+- [SCALE_HAASNSOFT] = &pl_filter_haasnsoft,
34
+ [SCALE_BICUBIC] = &pl_filter_bicubic,
35
+ [SCALE_CATMULL_ROM] = &pl_filter_catmull_rom,
36
+ [SCALE_MITCHELL] = &pl_filter_mitchell,
37
vlc-beta-20210405.f3c7ba5bb3.tar.xz/README
Deleted
59
1
2
-README for the VLC media player
3
-===============================
4
-
5
-VLC is a popular libre and open source media player and multimedia engine,
6
-used by a large number of individuals, professionals, companies and
7
-institutions. Using open source technologies and libraries, VLC has been
8
-ported to most computing platforms, including GNU/Linux, Windows, Mac OS X,
9
-BSD, iOS and Android.
10
-VLC can play most multimedia files, discs, streams, allows playback from
11
-devices, and is able to convert to or stream in various formats.
12
-The VideoLAN project was started at the university École Centrale Paris who
13
-relicensed VLC under the GPLv2 license in February 2001. Since then, VLC has
14
-been downloaded close to one billion times.
15
-
16
-Links:
17
-======
18
-
19
-The VLC web site . . . . . http://www.videolan.org/
20
-Support . . . . . . . . . . http://www.videolan.org/support/
21
-Forums . . . . . . . . . . https://forum.videolan.org/
22
-Wiki . . . . . . . . . . . https://wiki.videolan.org/
23
-The Developers site . . . . https://wiki.videolan.org/Developers_Corner
24
-VLC hacking guide . . . . . https://wiki.videolan.org/Hacker_Guide
25
-Bugtracker . . . . . . . . https://trac.videolan.org/vlc/
26
-The VideoLAN web site . . . http://www.videolan.org/
27
-
28
-Source Code Content:
29
-===================
30
-ABOUT-NLS - Notes on the Free Translation Project.
31
-AUTHORS - VLC authors.
32
-COPYING - The GPL license.
33
-COPYING.LIB - The LGPL license.
34
-INSTALL - Installation and building instructions.
35
-NEWS - Important modifications between the releases.
36
-README - This file.
37
-THANKS - VLC contributors.
38
-
39
-bin/ - VLC binaries.
40
-bindings/ - libVLC bindings to other languages.
41
-compat/ - compatibility library for operating systems missing
42
- essential functionalities.
43
-contrib/ - Facilities for retrieving external libraries and building
44
- them for systems that don't have the right versions.
45
-doc/ - Miscellaneous documentation.
46
-extras/analyser - Code analyser and editor specific files.
47
-extras/buildsystem - different buildsystems specific files.
48
-extras/misc - Files that don't fit in the other extras/ categories.
49
-extras/package - VLC packaging specific files such as spec files.
50
-extras/tools/ - Facilities for retrieving external building tools needed
51
- for systems that don't have the right versions.
52
-include/ - Header files.
53
-lib/ - libVLC source code.
54
-modules/ - VLC plugins and modules. Most of the code is here.
55
-po/ - VLC translations.
56
-share/ - Common Resources files.
57
-src/ - libvlccore source code.
58
-test/ - testing system.
59
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dav1d/0001-SSE2-PIC-464ca6c2.patch
Deleted
201
1
2
-From 464ca6c2f37b93180cc27ea41889ffaf1eab388e Mon Sep 17 00:00:00 2001
3
-From: Henrik Gramner <gramner@twoorioles.com>
4
-Date: Thu, 25 Jun 2020 01:27:28 +0200
5
-Subject: [PATCH] x86: Fix 32-bit build with PIC enabled
6
-
7
----
8
- src/x86/mc_sse.asm | 147 +++++++++++++++++----------------------------
9
- 1 file changed, 56 insertions(+), 91 deletions(-)
10
-
11
-diff --git a/src/x86/mc_sse.asm b/src/x86/mc_sse.asm
12
-index d98ac621..5d5c5e3f 100644
13
---- a/src/x86/mc_sse.asm
14
-+++ b/src/x86/mc_sse.asm
15
-@@ -1263,7 +1263,7 @@ cglobal prep_bilin, 3, 7, 0, tmp, src, stride, w, h, mxy, stride3
16
- %if ARCH_X86_64
17
- mova m8, [pw_8]
18
- %else
19
-- %define m8 [pw_8]
20
-+ %define m8 [t1-prep_sse2+pw_8]
21
- %endif
22
- pxor m7, m7
23
- %endif
24
-@@ -1272,13 +1272,11 @@ cglobal prep_bilin, 3, 7, 0, tmp, src, stride, w, h, mxy, stride3
25
- pshuflw m6, m6, q0000
26
- %if cpuflag(ssse3)
27
- punpcklqdq m6, m6
28
--%else
29
-- %if ARCH_X86_64
30
-+%elif ARCH_X86_64
31
- psrlw m0, m8, 3
32
- punpcklwd m6, m0
33
-- %else
34
-+%else
35
- punpcklwd m6, [base+pw_1]
36
-- %endif
37
- %endif
38
- %if ARCH_X86_32
39
- mov t1, t2 ; save base reg for w4
40
-@@ -1396,8 +1394,8 @@ cglobal prep_bilin, 3, 7, 0, tmp, src, stride, w, h, mxy, stride3
41
- PUSH r7
42
- %endif
43
- mov r7, tmpq
44
-+ mov r5, srcq
45
- %endif
46
-- mov t1, srcq
47
- .hv_w16_hloop:
48
- movu m0, [srcq+strideq*0+8*0]
49
- movu m1, [srcq+strideq*0+8*1]
50
-@@ -1440,14 +1438,17 @@ cglobal prep_bilin, 3, 7, 0, tmp, src, stride, w, h, mxy, stride3
51
- sub hd, 2
52
- jg .hv_w16_vloop
53
- movzx hd, t2w
54
-- add t1, 16
55
-- mov srcq, t1
56
- %if ARCH_X86_64
57
-+ add r5, 16
58
- add r7, 2*16
59
-+ mov srcq, r5
60
- mov tmpq, r7
61
- %else
62
-+ mov srcq, srcmp
63
- mov tmpq, tmpmp
64
-+ add srcq, 16
65
- add tmpq, 2*16
66
-+ mov srcmp, srcq
67
- mov tmpmp, tmpq
68
- %endif
69
- sub t2d, 1<<16
70
-@@ -2624,22 +2625,20 @@ cglobal put_8tap, 1, 9, 0, dst, ds, src, ss, w, h, mx, my, ss3
71
- %macro PHADDW 4 ; dst, src, pw_1/tmp, load_pw_1
72
- %if cpuflag(ssse3)
73
- phaddw %1, %2
74
-- %else
75
-- %ifnidn %1, %2
76
-+ %elifnidn %1, %2
77
- %if %4 == 1
78
-- mova %3, [pw_1]
79
-+ mova %3, [base+pw_1]
80
- %endif
81
- pmaddwd %1, %3
82
- pmaddwd %2, %3
83
- packssdw %1, %2
84
-- %else
85
-+ %else
86
- %if %4 == 1
87
-- pmaddwd %1, [pw_1]
88
-+ pmaddwd %1, [base+pw_1]
89
- %else
90
- pmaddwd %1, %3
91
- %endif
92
- packssdw %1, %1
93
-- %endif
94
- %endif
95
- %endmacro
96
-
97
-@@ -2795,11 +2794,9 @@ PREP_8TAP_FN sharp_smooth, SHARP, SMOOTH
98
- %if ARCH_X86_32
99
- %define base_reg r2
100
- %define base base_reg-prep%+SUFFIX
101
-- %define W32_RESTORE_SSQ mov strideq, stridem
102
- %else
103
- %define base_reg r7
104
- %define base 0
105
-- %define W32_RESTORE_SSQ
106
- %endif
107
- cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
108
- %assign org_stack_offset stack_offset
109
-@@ -2834,6 +2831,10 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
110
- WIN64_SPILL_XMM 12
111
- %else
112
- WIN64_SPILL_XMM 16
113
-+%endif
114
-+%if ARCH_X86_32
115
-+ %define strideq r6
116
-+ mov strideq, stridem
117
- %endif
118
- cmp wd, 4
119
- je .h_w4
120
-@@ -2894,7 +2895,6 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
121
- punpcklbw m4, m4
122
- psraw m4, 8
123
- %endif
124
-- W32_RESTORE_SSQ
125
- %if ARCH_X86_64
126
- lea stride3q, [strideq*3]
127
- %endif
128
-@@ -2916,8 +2916,7 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
129
- pshufb m1, m5
130
- pshufb m2, m5
131
- pshufb m3, m5
132
--%else
133
-- %if ARCH_X86_64
134
-+%elif ARCH_X86_64
135
- movd m0, [srcq+strideq*0+0]
136
- movd m12, [srcq+strideq*0+1]
137
- movd m1, [srcq+strideq*1+0]
138
-@@ -2947,7 +2946,7 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
139
- punpcklqdq m1, m5 ; 1
140
- punpcklqdq m2, m13 ; 2
141
- punpcklqdq m3, m7 ; 3
142
-- %else
143
-+%else
144
- movd m0, [srcq+strideq*0+0]
145
- movd m1, [srcq+strideq*0+1]
146
- movd m2, [srcq+strideq*0+2]
147
-@@ -2978,7 +2977,6 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
148
- lea srcq, [srcq+strideq*2]
149
- punpckldq m7, m5
150
- punpcklqdq m3, m7 ; 3
151
-- %endif
152
- %endif
153
- PMADDUBSW m0, m4, m5, m7, 1 ; subpel_filters + 2
154
- PMADDUBSW m1, m4, m5, m7, 0
155
-@@ -2994,14 +2992,7 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
156
- sub hd, 4
157
- jg .h_w4_loop
158
- RET
159
-- ;
160
- .h_w8:
161
--%if ARCH_X86_32
162
-- mov r3, r2
163
-- %define base_reg r3
164
-- W32_RESTORE_SSQ
165
--%endif
166
--.h_w8_loop:
167
- %if cpuflag(ssse3)
168
- PREP_8TAP_H 0, srcq+strideq*0
169
- PREP_8TAP_H 1, srcq+strideq*1
170
-@@ -3017,51 +3008,42 @@ cglobal prep_8tap, 1, 9, 0, tmp, src, stride, w, h, mx, my, stride3
171
- add tmpq, 16
172
- dec hd
173
- %endif
174
-- jg .h_w8_loop
175
-+ jg .h_w8
176
- RET
177
- .h_w16:
178
-- mov r6, -16*1
179
-+ mov r3, -16*1
180
- jmp .h_start
181
- .h_w32:
182
-- mov r6, -16*2
183
-+ mov r3, -16*2
184
- jmp .h_start
185
- .h_w64:
186
-- mov r6, -16*4
187
-+ mov r3, -16*4
188
- jmp .h_start
189
- .h_w128:
190
-- mov r6, -16*8
191
-+ mov r3, -16*8
192
- .h_start:
193
--%if ARCH_X86_32
194
-- mov r3, r2
195
-- %define base_reg r3
196
--%endif
197
-- sub srcq, r6
198
-- mov r5, r6
199
-- W32_RESTORE_SSQ
200
-+ sub srcq, r3
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvbpsi/0001-really-set-last-section-number.patch
Deleted
30
1
2
-From 03a51fe87f8d9b3af092455ba43204187e2cd25a Mon Sep 17 00:00:00 2001
3
-From: Francois Cartegnie <fcvlcdev@free.fr>
4
-Date: Thu, 18 Jul 2019 18:39:36 +0200
5
-Subject: [PATCH] really set last section number
6
-
7
-fixes regressions by commit
8
-7e9f4ed39444c84679b1135684ec2aa4f39e476c
9
-(early multi sections table end, segmented EIT failure)
10
----
11
- src/dvbpsi.c | 2 +-
12
- 1 file changed, 1 insertion(+), 1 deletion(-)
13
-
14
-diff --git a/src/dvbpsi.c b/src/dvbpsi.c
15
-index c5f0ddc..cbb7511 100644
16
---- a/src/dvbpsi.c
17
-+++ b/src/dvbpsi.c
18
-@@ -211,7 +211,7 @@ bool dvbpsi_decoder_psi_section_add(dvbpsi_decoder_t *p_decoder, dvbpsi_psi_sect
19
- /* Add to end of list */
20
- if (p_prev->i_number < p_section->i_number)
21
- {
22
-- p_decoder->i_last_section_number = p_section->i_number;
23
-+ p_decoder->i_last_section_number = p_section->i_last_number;
24
- p_prev->p_next = p_section;
25
- p_section->p_next = NULL;
26
- }
27
---
28
-2.20.1
29
-
30
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/fluid/fluid-no-bin.patch
Deleted
13
1
2
---- fluidsynth/src/Makefile.am 2007-11-11 21:06:28.000000000 +0100
3
-+++ fluidsynth.old/src/Makefile.am 2009-07-08 17:48:53.000000000 +0200
4
-@@ -39,7 +39,7 @@
5
- config_win32.h fluid_jack.c
6
-
7
- lib_LTLIBRARIES = libfluidsynth.la
8
--bin_PROGRAMS = fluidsynth
9
-+bin_PROGRAMS =
10
-
11
- libfluidsynth_la_SOURCES = \
12
- $(fluid_alsa) \
13
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/libarchive/0001-Fix-retrieving-incorrect-member-from-struct-statfs.patch
Deleted
28
1
2
-From 9b9e4ff23fa528d831f22d62d072db990b862a62 Mon Sep 17 00:00:00 2001
3
-From: Martin Matuska <martin@matuska.org>
4
-Date: Thu, 30 Apr 2020 03:46:05 +0200
5
-Subject: [PATCH] Fix retrieving incorrect member from struct statfs
6
-
7
-Fixes #1355
8
----
9
- libarchive/archive_read_disk_posix.c | 2 +-
10
- 1 file changed, 1 insertion(+), 1 deletion(-)
11
-
12
-diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
13
-index 52fec7bb..95a8087a 100644
14
---- a/libarchive/archive_read_disk_posix.c
15
-+++ b/libarchive/archive_read_disk_posix.c
16
-@@ -1840,7 +1840,7 @@ setup_current_filesystem(struct archive_read_disk *a)
17
- #if defined(HAVE_STATVFS)
18
- if (svfs.f_flag & ST_NOATIME)
19
- #else
20
-- if (sfs.f_flag & ST_NOATIME)
21
-+ if (sfs.f_flags & ST_NOATIME)
22
- #endif
23
- t->current_filesystem->noatime = 1;
24
- else
25
---
26
-2.26.0.windows.1
27
-
28
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch
Deleted
46
1
2
-From a4fa6bef8bdb141d629d79d8d1f3e67448bd67e1 Mon Sep 17 00:00:00 2001
3
-From: Steve Lhomme <robux4@ycbcr.xyz>
4
-Date: Thu, 2 Apr 2020 15:33:40 +0200
5
-Subject: [PATCH 5/5] don't force windows versions if they are set in the
6
- environment
7
-
8
----
9
- configure.ac | 20 +++++++++++++++++---
10
- 1 file changed, 17 insertions(+), 3 deletions(-)
11
-
12
-diff --git a/configure.ac b/configure.ac
13
-index 7312c4d5..05ca4955 100644
14
---- a/configure.ac
15
-+++ b/configure.ac
16
-@@ -244,9 +244,23 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
17
- # Set up defines needed before including any headers
18
- case $host in
19
- *mingw* | *cygwin* | *msys* )
20
-- AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
21
-- AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
22
-- AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
23
-+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
24
-+ [[#ifdef _WIN32_WINNT
25
-+ # error _WIN32_WINNT already defined
26
-+ #endif
27
-+ ]],[[;]])
28
-+ ],[
29
-+ AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
30
-+ AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
31
-+ ])
32
-+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
33
-+ [[#ifdef WINVER
34
-+ # error WINVER already defined
35
-+ #endif
36
-+ ]],[[;]])
37
-+ ],[
38
-+ AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
39
-+ ])
40
- ;;
41
- esac
42
-
43
---
44
-2.26.0.windows.1
45
-
46
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/libarchive/fix-types.patch
Deleted
45
1
2
-From 93a8b303904e40261ac58fbd95eb338d6b9cb1df Mon Sep 17 00:00:00 2001
3
-From: Steve Lhomme <robux4@ycbcr.xyz>
4
-Date: Fri, 27 Mar 2020 16:26:07 +0100
5
-Subject: [PATCH 2/4] archive_entry: use the proper define for mode_t
6
-
7
----
8
- libarchive/archive_entry.c | 6 +++---
9
- 1 file changed, 3 insertions(+), 3 deletions(-)
10
-
11
-diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c
12
-index 72c644e6..7afec1b1 100644
13
---- a/libarchive/archive_entry.c
14
-+++ b/libarchive/archive_entry.c
15
-@@ -353,7 +353,7 @@ archive_entry_devminor(struct archive_entry *entry)
16
- return minor(entry->ae_stat.aest_dev);
17
- }
18
-
19
--mode_t
20
-+__LA_MODE_T
21
- archive_entry_filetype(struct archive_entry *entry)
22
- {
23
- return (AE_IFMT & entry->acl.mode);
24
-@@ -525,7 +525,7 @@ archive_entry_ino64(struct archive_entry *entry)
25
- return (entry->ae_stat.aest_ino);
26
- }
27
-
28
--mode_t
29
-+__LA_MODE_T
30
- archive_entry_mode(struct archive_entry *entry)
31
- {
32
- return (entry->acl.mode);
33
-@@ -598,7 +598,7 @@ _archive_entry_pathname_l(struct archive_entry *entry,
34
- return (archive_mstring_get_mbs_l(&entry->ae_pathname, p, len, sc));
35
- }
36
-
37
--mode_t
38
-+__LA_MODE_T
39
- archive_entry_perm(struct archive_entry *entry)
40
- {
41
- return (~AE_IFMT & entry->acl.mode);
42
---
43
-2.26.0.windows.1
44
-
45
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/toolbareditor.cpp
Deleted
201
1
2
-/*****************************************************************************
3
- * Copyright (C) 2019 VLC authors and VideoLAN
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * ( at your option ) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
- *****************************************************************************/
19
-
20
-#ifdef HAVE_CONFIG_H
21
-# include "config.h"
22
-#endif
23
-
24
-#include "toolbareditor.hpp"
25
-#include "util/i18n.hpp"
26
-#include "util/systempalette.hpp"
27
-#include "util/qml_main_context.hpp"
28
-#include "player/playercontrolbarmodel.hpp"
29
-#include "maininterface/main_interface.hpp"
30
-
31
-#include <QInputDialog>
32
-#include <QQuickItem>
33
-#include <QtQml/QQmlContext>
34
-#include <QQmlEngine>
35
-
36
-#define PROFILE_NAME_1 "Minimalist Style"
37
-#define VALUE_1 "0;64;3;1;4;64;11;64;34;64;9;64;33 | 3;0;1;4"
38
-#define PROFILE_NAME_2 "One-Liner Style"
39
-#define VALUE_2 "0;64;3;1;4;64;7;9;8;64;64;11;10;12;13;#33 | 17;3;0;1;4;18"
40
-#define PROFILE_NAME_3 "Simplest Style"
41
-#define VALUE_3 "33;#0;4;1;#7 | 3;0;4"
42
-
43
-ToolbarEditorDialog::ToolbarEditorDialog( QWidget *_w, intf_thread_t *_p_intf)
44
- : QVLCDialog( _w, _p_intf )
45
-{
46
- setWindowTitle( qtr( "Toolbars Editor" ) );
47
- setWindowRole( "vlc-toolbars-editor" );
48
- setMinimumWidth( 800 );
49
- setMinimumHeight( 600 );
50
-
51
- /* Profile */
52
- QGridLayout *mainLayout = new QGridLayout( this );
53
- QHBoxLayout *profileBoxLayout = new QHBoxLayout();
54
-
55
- profileCombo = new QComboBox;
56
-
57
- QToolButton *newButton = new QToolButton;
58
- newButton->setIcon( QIcon( ":/new.svg" ) );
59
- newButton->setToolTip( qtr("New profile") );
60
- QToolButton *deleteButton = new QToolButton;
61
- deleteButton->setIcon( QIcon( ":/toolbar/clear.svg" ) );
62
- deleteButton->setToolTip( qtr( "Delete the current profile" ) );
63
-
64
- profileBoxLayout->addWidget( new QLabel( qtr( "Select profile:" ) ) );
65
- profileBoxLayout->addWidget( profileCombo );
66
- profileBoxLayout->addWidget( newButton );
67
- profileBoxLayout->addWidget( deleteButton );
68
-
69
- mainLayout->addLayout( profileBoxLayout, 0, 0, 1, 9 );
70
-
71
- /* Fill combos */
72
- int i_size = getSettings()->beginReadArray( "ToolbarProfiles" );
73
- for( int i = 0; i < i_size; i++ )
74
- {
75
- getSettings()->setArrayIndex(i);
76
- profileCombo->addItem( getSettings()->value( "ProfileName" ).toString(),
77
- getSettings()->value( "Value" ).toString() );
78
- }
79
- getSettings()->endArray();
80
-
81
- /* Load defaults ones if we have no combos */
82
- if( i_size == 0 )
83
- {
84
- profileCombo->addItem( qtr("Default Style"), PlayerControlBarModel::getSerializedDefaultStyle() );
85
- profileCombo->addItem( PROFILE_NAME_1, QString( VALUE_1 ) );
86
- profileCombo->addItem( PROFILE_NAME_2, QString( VALUE_2 ) );
87
- profileCombo->addItem( PROFILE_NAME_3, QString( VALUE_3 ) );
88
- profileCombo->setCurrentIndex(0);
89
- }
90
- else
91
- {
92
- profileCombo->setCurrentIndex( -1 );
93
- }
94
-
95
- /* Drag and Drop */
96
- editorView = new QQuickWidget(this);
97
- editorView->setClearColor(Qt::transparent);
98
- QQmlContext* rootCtx = editorView->rootContext();
99
- QQmlEngine* engine = editorView->engine();
100
-
101
- intf_sys_t* p_sys = p_intf->p_sys;
102
- MainInterface* mainInterface = p_sys->p_mi;
103
-
104
- rootCtx->setContextProperty( "player", p_sys->p_mainPlayerController );
105
- rootCtx->setContextProperty( "i18n", new I18n(engine) );
106
- rootCtx->setContextProperty( "mainctx", new QmlMainContext(p_intf, mainInterface, engine));
107
- rootCtx->setContextProperty( "mainInterface", mainInterface);
108
- rootCtx->setContextProperty( "topWindow", mainInterface->windowHandle());
109
- rootCtx->setContextProperty( "systemPalette", new SystemPalette(engine));
110
- rootCtx->setContextProperty( "medialib", nullptr );
111
- rootCtx->setContextProperty( "toolbareditor", this);
112
- rootCtx->setContextProperty( "rootPlayer", nullptr );
113
-
114
- editorView->setSource( QUrl ( QStringLiteral("qrc:/dialogs/ToolbarEditor.qml") ) );
115
-
116
- mainLayout->addWidget(editorView, 0, 0);
117
-
118
- editorView->setResizeMode( QQuickWidget::SizeRootObjectToView );
119
-
120
- mainLayout->addWidget( editorView, 1, 0, 1, 9 );
121
- editorView->show();
122
-
123
- /* Buttons */
124
- QDialogButtonBox *okCancel = new QDialogButtonBox;
125
- QPushButton *okButton = new QPushButton( qtr( "Cl&ose" ), this );
126
- okButton->setDefault( true );
127
- QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ), this );
128
- okCancel->addButton( okButton, QDialogButtonBox::AcceptRole );
129
- okCancel->addButton( cancelButton, QDialogButtonBox::RejectRole );
130
-
131
- BUTTONACT( deleteButton, deleteProfile() );
132
- BUTTONACT( newButton, newProfile() );
133
- CONNECT( profileCombo, currentIndexChanged( int ), this, changeProfile( int ) );
134
- BUTTONACT( okButton, close() );
135
- BUTTONACT( cancelButton, cancel() );
136
- mainLayout->addWidget( okCancel, 2, 0, 1, 9 );
137
-}
138
-ToolbarEditorDialog::~ToolbarEditorDialog()
139
-{
140
- getSettings()->beginWriteArray( "ToolbarProfiles" );
141
- for( int i = 0; i < profileCombo->count(); i++ )
142
- {
143
- getSettings()->setArrayIndex(i);
144
- getSettings()->setValue( "ProfileName", profileCombo->itemText( i ) );
145
- getSettings()->setValue( "Value", profileCombo->itemData( i ) );
146
- }
147
- getSettings()->endArray();
148
-}
149
-
150
-void ToolbarEditorDialog::close()
151
-{
152
- emit saveConfig();
153
- accept();
154
-}
155
-
156
-void ToolbarEditorDialog::cancel()
157
-{
158
- reject();
159
-}
160
-
161
-void ToolbarEditorDialog::newProfile()
162
-{
163
- bool ok;
164
- QString name = QInputDialog::getText( this, qtr( "Profile Name" ),
165
- qtr( "Please enter the new profile name." ), QLineEdit::Normal, 0, &ok );
166
- if( !ok ) return;
167
-
168
- QVariant config;
169
- QMetaObject::invokeMethod(editorView->rootObject(),"getProfileConfig",
170
- Q_RETURN_ARG(QVariant, config));
171
-
172
- profileCombo->addItem( name, config.toString() );
173
- profileCombo->setCurrentIndex( profileCombo->count() - 1 );
174
-}
175
-
176
-void ToolbarEditorDialog::deleteProfile()
177
-{
178
- profileCombo->removeItem( profileCombo->currentIndex() );
179
-}
180
-
181
-void ToolbarEditorDialog::changeProfile( int i )
182
-{
183
- QStringList qs_list = profileCombo->itemData( i ).toString().split( "|" );
184
- if( qs_list.count() < 2 )
185
- return;
186
-
187
- QStringList align_list_main = qs_list[0].split("#");
188
- QStringList align_list_mini = qs_list[1].split("#");
189
-
190
- emit updatePlayerModel("MainPlayerToolbar-left", align_list_main[0]);
191
- if(align_list_main.size() >= 2)
192
- emit updatePlayerModel("MainPlayerToolbar-center", align_list_main[1]);
193
- else
194
- emit updatePlayerModel("MainPlayerToolbar-center", "");
195
- if(align_list_main.size() >= 3)
196
- emit updatePlayerModel("MainPlayerToolbar-right", align_list_main[2]);
197
- else
198
- emit updatePlayerModel("MainPlayerToolbar-right", "");
199
-
200
- emit updatePlayerModel("MiniPlayerToolbar-left", align_list_mini[0]);
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/toolbareditor.hpp
Deleted
57
1
2
-/*****************************************************************************
3
- * Copyright (C) 2019 VLC authors and VideoLAN
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * ( at your option ) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
- *****************************************************************************/
19
-
20
-#ifndef QVLC_TOOLBAREDITOR_DIALOG_H_
21
-#define QVLC_TOOLBAREDITOR_DIALOG_H_ 1
22
-
23
-#include "widgets/native/qvlcframe.hpp" /* QVLCDialog */
24
-#include "util/qml_main_context.hpp"
25
-#include "dialogs/sout/profile_selector.hpp"
26
-
27
-#include <QAbstractListModel>
28
-#include <QVector>
29
-#include <QQuickWidget>
30
-
31
-class ToolbarEditorDialog : public QVLCDialog
32
-{
33
- Q_OBJECT
34
-public:
35
- ToolbarEditorDialog( QWidget *, intf_thread_t *);
36
- virtual ~ToolbarEditorDialog();
37
-
38
-public slots:
39
- Q_INVOKABLE void close();
40
- Q_INVOKABLE void cancel();
41
-
42
-private slots:
43
- void newProfile();
44
- void deleteProfile();
45
- void changeProfile( int );
46
-
47
-private:
48
- QComboBox *profileCombo;
49
- QQuickWidget *editorView;
50
-
51
-signals:
52
- void updatePlayerModel(QString toolbarName,QString config);
53
- void saveConfig();
54
-};
55
-
56
-#endif
57
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/playercontrolbarmodel.cpp
Deleted
201
1
2
-/*****************************************************************************
3
- * Copyright (C) 2019 VLC authors and VideoLAN
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * ( at your option ) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
- *****************************************************************************/
19
-#include <QSettings>
20
-
21
-#include "qt.hpp"
22
-#include "playercontrolbarmodel.hpp"
23
-
24
-enum default_align {
25
- ALIGN_LEFT = 0,
26
- ALIGN_CENTER,
27
- ALIGN_RIGHT,
28
- ALIGN_SIZE
29
-};
30
-
31
-static const QVector<PlayerControlBarModel::IconToolButton> MAIN_TB_DEFAULT[default_align::ALIGN_SIZE] = {
32
- {
33
- // left
34
- {PlayerControlBarModel::LANG_BUTTON},
35
- {PlayerControlBarModel::MENU_BUTTON}
36
- },
37
- {
38
- // center
39
- {PlayerControlBarModel::RANDOM_BUTTON},
40
- {PlayerControlBarModel::PREVIOUS_BUTTON},
41
- {PlayerControlBarModel::PLAY_BUTTON},
42
- {PlayerControlBarModel::NEXT_BUTTON},
43
- {PlayerControlBarModel::LOOP_BUTTON}
44
- },
45
- {
46
- // right
47
- {PlayerControlBarModel::VOLUME},
48
- {PlayerControlBarModel::FULLSCREEN_BUTTON}
49
- }
50
-};
51
-
52
-static const QVector<PlayerControlBarModel::IconToolButton> MINI_TB_DEFAULT[default_align::ALIGN_SIZE] = {
53
- {
54
- // left
55
- {PlayerControlBarModel::ARTWORK_INFO}
56
- },
57
- {
58
- // center
59
- {PlayerControlBarModel::RANDOM_BUTTON},
60
- {PlayerControlBarModel::PREVIOUS_BUTTON},
61
- {PlayerControlBarModel::PLAY_BUTTON},
62
- {PlayerControlBarModel::NEXT_BUTTON},
63
- {PlayerControlBarModel::LOOP_BUTTON}
64
- },
65
- {
66
- // right
67
- {PlayerControlBarModel::VOLUME},
68
- {PlayerControlBarModel::PLAYER_SWITCH_BUTTON}
69
- }
70
-};
71
-
72
-
73
-PlayerControlBarModel::PlayerControlBarModel(QObject *_parent) : QAbstractListModel(_parent)
74
-{
75
- configName = "MainPlayerToolbar";
76
-
77
- connect(this, &QAbstractListModel::rowsInserted, this, &PlayerControlBarModel::countChanged);
78
- connect(this, &QAbstractListModel::rowsRemoved, this, &PlayerControlBarModel::countChanged);
79
- connect(this, &QAbstractListModel::modelReset, this, &PlayerControlBarModel::countChanged);
80
-}
81
-
82
-void PlayerControlBarModel::saveConfig()
83
-{
84
- getSettings()->setValue(configName,getConfig());
85
-}
86
-
87
-QString PlayerControlBarModel::getConfig()
88
-{
89
- QString config="";
90
- for (IconToolButton it: mButtons) {
91
- config += QString::number(it.id);
92
- config += ";";
93
- }
94
- return config;
95
-}
96
-
97
-void PlayerControlBarModel::reloadConfig(QString config)
98
-{
99
- beginResetModel();
100
- mButtons.clear();
101
- if (!config.isEmpty())
102
- parseAndAdd(config);
103
- endResetModel();
104
-}
105
-
106
-void PlayerControlBarModel::reloadModel()
107
-{
108
- beginResetModel();
109
- mButtons.clear();
110
-
111
- QVariant config = getSettings() ->value(configName);
112
-
113
- if (!config.isNull() && config.canConvert<QString>())
114
- parseAndAdd(config.toString());
115
- else
116
- {
117
- const auto configAndAlignment = configName.split("-");
118
- if (configAndAlignment.size() == 2)
119
- {
120
- const auto alignment = configAndAlignment[1];
121
- if (configAndAlignment[0] == QLatin1String("MainPlayerToolbar"))
122
- {
123
- if (alignment == "left")
124
- parseDefault(MAIN_TB_DEFAULT[default_align::ALIGN_LEFT]);
125
- else if (alignment == "center")
126
- parseDefault(MAIN_TB_DEFAULT[default_align::ALIGN_CENTER]);
127
- else if (alignment == "right")
128
- parseDefault(MAIN_TB_DEFAULT[default_align::ALIGN_RIGHT]);
129
- }
130
- else
131
- {
132
- if (alignment == "left")
133
- parseDefault(MINI_TB_DEFAULT[default_align::ALIGN_LEFT]);
134
- else if (alignment == "center")
135
- parseDefault(MINI_TB_DEFAULT[default_align::ALIGN_CENTER]);
136
- else if (alignment == "right")
137
- parseDefault(MINI_TB_DEFAULT[default_align::ALIGN_RIGHT]);
138
-
139
- }
140
- }
141
- }
142
- endResetModel();
143
-}
144
-
145
-void PlayerControlBarModel::parseDefault(const QVector<PlayerControlBarModel::IconToolButton>& config)
146
-{
147
- beginInsertRows(QModelIndex(),rowCount(),rowCount() + config.size());
148
- for (const auto& i : config)
149
- mButtons.append(i);
150
- endInsertRows();
151
-}
152
-
153
-void PlayerControlBarModel::parseAndAdd(const QString &config)
154
-{
155
- beginInsertRows(QModelIndex(),rowCount(),rowCount()+config.split(";",
156
- #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
157
- Qt::SkipEmptyParts
158
- #else
159
- QString::SkipEmptyParts
160
- #endif
161
- ).length() - 1);
162
-
163
- for (const QString& iconPropertyTxt : config.split( ";",
164
- #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
165
- Qt::SkipEmptyParts
166
- #else
167
- QString::SkipEmptyParts
168
- #endif
169
- ) )
170
- {
171
- QStringList list2 = iconPropertyTxt.trimmed().split( "-" );
172
-
173
- if( list2.count() < 1 )
174
- {
175
- msg_Warn( p_intf, "Parsing error 1. Please, report this." );
176
- continue;
177
- }
178
- bool ok;
179
- ButtonType_e i_type = static_cast<ButtonType_e>(list2.at( 0 ).toInt( &ok ));
180
- if( !ok )
181
- {
182
- msg_Warn( p_intf, "Parsing error 2. Please, report this." );
183
- continue;
184
- }
185
-
186
- IconToolButton itButton = {i_type};
187
- mButtons.append(itButton);
188
- }
189
-
190
- endInsertRows();
191
-}
192
-
193
-int PlayerControlBarModel::rowCount(const QModelIndex &parent) const
194
-{
195
- if (parent.isValid() )
196
- return 0;
197
-
198
- return mButtons.size();
199
-}
200
-
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/playercontrolbarmodel.hpp
Deleted
141
1
2
-/*****************************************************************************
3
- * Copyright (C) 2019 VLC authors and VideoLAN
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * ( at your option ) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
- *****************************************************************************/
19
-
20
-#ifndef CONTROLLERMODEL_H
21
-#define CONTROLLERMODEL_H
22
-
23
-#include <QAbstractListModel>
24
-#include <QVector>
25
-
26
-#include "util/qml_main_context.hpp"
27
-
28
-class PlayerControlBarModel : public QAbstractListModel
29
-{
30
- Q_OBJECT
31
- Q_PROPERTY(QmlMainContext* mainCtx READ getMainCtx WRITE setMainCtx NOTIFY ctxChanged)
32
- Q_PROPERTY(QString configName READ getConfigName WRITE setConfigName NOTIFY configNameChanged)
33
- Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
34
-
35
-
36
-public:
37
- explicit PlayerControlBarModel(QObject *_parent = nullptr);
38
- struct IconToolButton
39
- {
40
- int id;
41
- };
42
- enum{
43
- ID_ROLE
44
- };
45
- enum ButtonType_e
46
- {
47
- PLAY_BUTTON,
48
- STOP_BUTTON,
49
- OPEN_BUTTON,
50
- PREVIOUS_BUTTON,
51
- NEXT_BUTTON,
52
- SLOWER_BUTTON,
53
- FASTER_BUTTON,
54
- FULLSCREEN_BUTTON,
55
- EXTENDED_BUTTON,
56
- PLAYLIST_BUTTON,
57
- SNAPSHOT_BUTTON,
58
- RECORD_BUTTON,
59
- ATOB_BUTTON,
60
- FRAME_BUTTON,
61
- SKIP_BACK_BUTTON,
62
- SKIP_FW_BUTTON,
63
- QUIT_BUTTON,
64
- RANDOM_BUTTON,
65
- LOOP_BUTTON,
66
- INFO_BUTTON,
67
- LANG_BUTTON,
68
- MENU_BUTTON,
69
- BACK_BUTTON,
70
- CHAPTER_PREVIOUS_BUTTON,
71
- CHAPTER_NEXT_BUTTON,
72
- BUTTON_MAX,
73
- PLAYER_SWITCH_BUTTON,
74
- ARTWORK_INFO,
75
-
76
- SPLITTER = 0x20,
77
- VOLUME,
78
- TELETEXT_BUTTONS,
79
- ASPECT_RATIO_COMBOBOX,
80
- SPECIAL_MAX,
81
-
82
- WIDGET_SPACER = 0x40,
83
- WIDGET_SPACER_EXTEND,
84
- WIDGET_MAX
85
- };
86
- Q_ENUM(ButtonType_e)
87
-
88
- // Basic functionality:
89
- int rowCount(const QModelIndex &parent = QModelIndex()) const override;
90
-
91
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
92
-
93
- // Editable:
94
- bool setData(const QModelIndex &index, const QVariant &value,
95
- int role = Qt::EditRole) override;
96
-
97
- Qt::ItemFlags flags(const QModelIndex& index) const override;
98
-
99
- virtual QHash<int, QByteArray> roleNames() const override;
100
-
101
- inline QmlMainContext* getMainCtx() const { return m_mainCtx; }
102
- void setMainCtx(QmlMainContext*);
103
-
104
- inline QString getConfigName() { return configName; }
105
- void setConfigName(QString name);
106
-
107
- static QString getSerializedDefaultStyle();
108
-
109
-signals:
110
- void ctxChanged(QmlMainContext*);
111
- void configNameChanged(QString);
112
- void countChanged();
113
-
114
-protected:
115
- intf_thread_t *p_intf = nullptr;
116
-
117
-private:
118
- QVector<IconToolButton> mButtons;
119
- QString configName;
120
-
121
- void parseAndAdd(const QString& config);
122
- void parseDefault(const QVector<IconToolButton>& config);
123
-
124
- bool setButtonAt(int index, const IconToolButton &button);
125
- void addProfiles();
126
- void loadConfig();
127
-
128
- QmlMainContext* m_mainCtx = nullptr;
129
-
130
-public slots:
131
- Q_INVOKABLE void insert(int index, QVariantMap bdata);
132
- Q_INVOKABLE void move(int src,int dest);
133
- Q_INVOKABLE void remove(int index);
134
- Q_INVOKABLE void reloadConfig(QString config);
135
- Q_INVOKABLE void saveConfig();
136
- Q_INVOKABLE QString getConfig();
137
- Q_INVOKABLE void reloadModel();
138
-};
139
-
140
-#endif // CONTROLLERMODEL_H
141
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/RoundImage.qml
Deleted
58
1
2
-/*****************************************************************************
3
- * Copyright (C) 2019 VLC authors and VideoLAN
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * ( at your option ) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
- *****************************************************************************/
19
-import QtQuick 2.11
20
-import QtQuick.Controls 2.4
21
-import QtGraphicalEffects 1.0
22
-
23
-import "qrc:///style/"
24
-
25
-Item {
26
- id: root
27
-
28
- property real radius: 3
29
- property alias asynchronous: cover.asynchronous
30
- property alias fillMode: cover.fillMode
31
- property alias mipmap: cover.mipmap
32
- property alias paintedHeight: cover.paintedHeight
33
- property alias paintedWidth: cover.paintedWidth
34
- property alias source: cover.source
35
- property alias sourceSize: cover.sourceSize
36
- property alias status: cover.status
37
- property alias horizontalAlignment: cover.horizontalAlignment
38
- property alias verticalAlignment: cover.verticalAlignment
39
-
40
- Image {
41
- id: cover
42
-
43
- anchors.fill: parent
44
- asynchronous: true
45
- fillMode: Image.PreserveAspectCrop
46
- sourceSize: Qt.size(width, height)
47
- layer.enabled: true
48
- layer.effect: OpacityMask {
49
- maskSource: Rectangle {
50
- radius: root.radius
51
- width: root.width
52
- height: root.height
53
- visible: false
54
- }
55
- }
56
- }
57
-}
58
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/VideoQualityLabel.qml
Deleted
40
1
2
-/*****************************************************************************
3
- * Copyright (C) 2019 VLC authors and VideoLAN
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * ( at your option ) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
- *****************************************************************************/
19
-import QtQuick 2.11
20
-import QtQuick.Controls 2.4
21
-
22
-import "qrc:///style/"
23
-
24
-Label {
25
- id: label
26
- color: "white"
27
- bottomPadding: VLCStyle.margin_xxxsmall
28
- topPadding: VLCStyle.margin_xxxsmall
29
- leftPadding: VLCStyle.margin_xxxsmall
30
- rightPadding: VLCStyle.margin_xxxsmall
31
- font.pixelSize: VLCStyle.fontSize_normal
32
- background: Rectangle {
33
- anchors.fill: label
34
- color: "black"
35
- opacity: 0.5
36
- radius: 3
37
- }
38
- Accessible.ignored: true
39
-}
40
vlc-beta-20210430.0b6b242324.tar.xz/.gitignore
Added
58
1
2
+*~
3
+*.app
4
+*.cache
5
+*.dylib
6
+*.lo
7
+*.lo?
8
+*.la
9
+*.moc.cpp
10
+*.o
11
+*.so
12
+*.trs
13
+*.pc
14
+*.vlt
15
+*.class
16
+*.dmg
17
+*.qmlc
18
+.DS_Store
19
+.deps
20
+.libs
21
+.dirstamp
22
+ABOUT-NLS
23
+aclocal.m4
24
+ChangeLog
25
+compile
26
+config.status
27
+config.h*
28
+config.log
29
+configure
30
+doltcompile
31
+doltlibtool
32
+INSTALL.git
33
+libtool
34
+Makefile
35
+Makefile.in
36
+stamp-*
37
+vlc
38
+vlc.exe
39
+qvlc
40
+rvlc
41
+svlc
42
+cvlc
43
+qvlc
44
+mvlc
45
+nvlc
46
+wxvlc
47
+vlc_install_dir/*
48
+plugins.dat
49
+patches/*
50
+
51
+include/vlc/libvlc_version.h
52
+
53
+# Ignore build dirs
54
+build*/
55
+contrib-*
56
+install-*
57
+!extras/package/apple/build.sh
58
vlc-beta-20210405.f3c7ba5bb3.tar.xz/NEWS -> vlc-beta-20210430.0b6b242324.tar.xz/NEWS
Changed
64
1
2
3
appleOS:
4
* Improved proxy configuration handling
5
+Changes between 3.0.12.1 and 3.0.13:
6
+----------------------------------
7
+
8
+Demux:
9
+ * Adaptive: fix artefacts in HLS streams with wrong profiles/levels
10
+ * Fix regression on some MP4 files for the audio track
11
+ * Fix MPGA and ADTS probing in TS files
12
+ * Fix Flac inside AVI files
13
+ * Fix VP9/Webm artefacts when seeking
14
+
15
+Codec:
16
+ * Support SSA text scaling
17
+ * Fix rotation on Android rotation
18
+ * Fix WebVTT subtitles that start at 00:00
19
+
20
+Access:
21
+ * Update libnfs to support NFSv4
22
+ * Improve SMB2 integration
23
+ * Fix Blu-ray files using Unicode names on Windows
24
+ * Disable mcast lookups on Android for RTSP playback
25
+
26
+Video Output:
27
+ * Rework the D3D11 rendering wait, to fix choppiness on display
28
+
29
+Interfaces:
30
+ * Fix VLC getting stuck on close on X11 (#21875)
31
+ * Improve RTL on preferences on macOS
32
+ * Add mousewheel horizontal axis control
33
+ * Fix crash on exit on macOS
34
+ * Fix sizing of the fullscreen controls on macOS
35
+
36
+Windows:
37
+ * Fix subtitles/OSD under Windows XP
38
+
39
+Misc:
40
+ * Update translations
41
+ * Improve MIDI fonts search on Linux
42
+ * Update Soundcloud, Youtube, liveleak
43
+ * Fix compilation with GCC11
44
+ * Fix input-slave option for subtitles
45
46
47
Changes between 3.0.12 and 3.0.12.1:
48
49
* 3.0.12.1 is the first release for Apple Silicon macs
50
* Version bump to allow an automatic upgrade path
51
52
+
53
Changes between 3.0.11.1 and 3.0.12:
54
----------------------------------
55
56
57
* Updated libmatroska to 1.6.0
58
* Updated mpg123 to 1.26.2
59
60
+
61
Changes between 3.0.10 and 3.0.11:
62
----------------------------------
63
64
vlc-beta-20210430.0b6b242324.tar.xz/README.md
Added
132
1
2
+# VLC media player
3
+
4
+**VLC** is a libre and open source **media player** and **multimedia engine**,
5
+focused on **playing everything**, and **running everywhere**.
6
+
7
+**VLC** can play most multimedia files, discs, streams, devices and is able to
8
+convert, encode, **stream** and manipulate streams into numerous formats.
9
+
10
+VLC is used by many over the world, on numerous platforms, for very different use cases.
11
+
12
+The **engine of VLC** can be embedded by 3rd party applications, and is called *libVLC*.
13
+
14
+**VLC** is part of the [VideoLAN project](https://videolan.org) and
15
+is developed and supported by a community of volunteers.
16
+
17
+The VideoLAN project was started at the university [École Centrale Paris](https://www.centralesupelec.fr/) who
18
+relicensed VLC under the GPLv2 license in February 2001. Since then, VLC has
19
+been downloaded multi-billion times.
20
+
21
+## License
22
+
23
+**VLC** is released under the GPLv2 *(or later)* license.
24
+*On some platforms, it is de facto GPLv3, because of dependencies licenses*.
25
+
26
+**libVLC**, the engine is released under the LGPLv2 *(or later)* license. \
27
+This allows embedding the engine in 3rd party applications, while letting them to be licensed under other licenses.
28
+
29
+# Platforms
30
+
31
+VLC is available on the following platforms:
32
+- Windows *(from 7 to all versions of 10)*, including UWP platforms
33
+- macOS *(10.10 and more recent)*
34
+- GNU/Linux and affiliated
35
+- \*BSD and affiliated
36
+- Android *(4.2 and more recent)*, including Android TV and Android Auto
37
+- iOS *(9 and more recent)*, including AppleTV and iPadOS
38
+- Haiku, OS/2 and a few others.
39
+
40
+Not all platforms receive the same amount of care, due to our limited resources.
41
+
42
+**Nota Bene**: [Android repository](https://code.videolan.org/videolan/vlc-android/) and
43
+[iOS repository](https://code.videolan.org/videolan/vlc-ios/) are on different repository
44
+than the main one.
45
+
46
+# Contributing & Community
47
+
48
+**VLC** is maintained by a community of people, and VideoLAN is not paying any of them.\
49
+The community is composed of developers, helpers, maintainers, designers and writers that want
50
+the open source project to thrive.
51
+
52
+The main development of VLC is done in the C language, but this repository has also plenty of C++, Obj-C, asm, Rust.
53
+
54
+Other repositories linked to vlc are done in Kotlin/Java [(Android)](https://code.videolan.org/videolan/vlc-android/),
55
+in Swift [(iOS)](https://code.videolan.org/videolan/vlc-ios/), C# [(libVLCSharp)](https://code.videolan.org/videolan/libvlcsharp/)
56
+
57
+We need help for the following tasks:
58
+- coding
59
+- packaging for Windows, macOS and Linux distributions
60
+- technical writing for the documentation
61
+- design
62
+- support
63
+- community management and communication.
64
+
65
+Please reach us :)
66
+
67
+We are on IRC, on the **#videolan** channel on *Freenode*.
68
+
69
+## Contributions
70
+
71
+Contributions are now done through Merge Requests on our [gitlab repository](https://code.videolan.org/videolan/vlc/).
72
+
73
+CI, Discussions should be resolved before merging a Merge Request.
74
+
75
+# libVLC
76
+
77
+**libVLC** is an embeddable engine for 3rd party applications and frameworks.
78
+
79
+It runs on the same platforms of VLC *(and sometimes on more platforms)* and can provide playback,
80
+streaming and converting of multimedia files and stream.
81
+
82
+**libVLC** has numerous bindings for other languagues, like C++, Python or C#.
83
+
84
+# Support
85
+
86
+## Links
87
+
88
+You can found here several links that might help you:
89
+
90
+- [The VLC web site](http://www.videolan.org/vlc/)
91
+- [Support](https://www.videolan.org/support/)
92
+- [Forums](https://forum.videolan.org/)
93
+- [Wiki](https://wiki.videolan.org/)
94
+- [The Developers site](https://wiki.videolan.org/Developers_Corner)
95
+- [VLC hacking guide](https://wiki.videolan.org/Hacker_Guide)
96
+- [Bugtracker](https://code.videolan.org/videolan/vlc/-/issues)
97
+- [The VideoLAN web site](https://www.videolan.org/)
98
+
99
+## Source Code sitemap
100
+```
101
+ABOUT-NLS - Notes on the Free Translation Project.
102
+AUTHORS - VLC authors.
103
+COPYING - The GPL license.
104
+COPYING.LIB - The LGPL license.
105
+INSTALL - Installation and building instructions.
106
+NEWS - Important modifications between the releases.
107
+README - This file.
108
+THANKS - VLC contributors.
109
+
110
+bin/ - VLC binaries.
111
+bindings/ - libVLC bindings to other languages.
112
+compat/ - compatibility library for operating systems missing
113
+ essential functionalities.
114
+contrib/ - Facilities for retrieving external libraries and building
115
+ them for systems that don't have the right versions.
116
+doc/ - Miscellaneous documentation.
117
+extras/analyser - Code analyser and editor specific files.
118
+extras/buildsystem - different buildsystems specific files.
119
+extras/misc - Files that don't fit in the other extras/ categories.
120
+extras/package - VLC packaging specific files such as spec files.
121
+extras/tools/ - Facilities for retrieving external building tools needed
122
+ for systems that don't have the right versions.
123
+include/ - Header files.
124
+lib/ - libVLC source code.
125
+modules/ - VLC plugins and modules. Most of the code is here.
126
+po/ - VLC translations.
127
+share/ - Common Resources files.
128
+src/ - libvlccore source code.
129
+test/ - testing system.
130
+```
131
+
132
vlc-beta-20210430.0b6b242324.tar.xz/autotools/.gitignore
Added
12
1
2
+compile
3
+config.guess
4
+config.sub
5
+depcomp
6
+install-sh
7
+ltmain.sh
8
+missing
9
+mkinstalldirs
10
+test-driver
11
+ylwrap
12
vlc-beta-20210430.0b6b242324.tar.xz/bin/.gitignore
Added
8
1
2
+vlc_win32_rc.rc
3
+vlc-cache-gen
4
+vlc-static
5
+vlc-wrapper
6
+vlc
7
+*.exe
8
vlc-beta-20210430.0b6b242324.tar.xz/compat/.gitignore
Added
4
1
2
+test_heap
3
+test_strnstr
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/configure.ac -> vlc-beta-20210430.0b6b242324.tar.xz/configure.ac
Changed
51
1
2
AC_CACHE_CHECK([if $CC groks AVX inline assembly], [ac_cv_avx_inline], [
3
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
4
void *p;
5
-asm volatile("xorps256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
6
+asm volatile("vxorps %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
7
]])
8
], [
9
ac_cv_avx_inline=yes
10
11
AC_CACHE_CHECK([if $CC groks AVX2 inline assembly], [ac_cv_avx2_inline], [
12
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
13
void *p;
14
-asm volatile("punpckhqdq256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
15
+asm volatile("vpunpckhqdq %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
16
]])
17
], [
18
ac_cv_avx2_inline=yes
19
20
dnl
21
dnl Bitstream
22
dnl
23
-PKG_CHECK_MODULES([BITSTREAM], [bitstream > 1.4],[have_bitstream="yes"], [have_bitstream="no"])
24
-AM_CONDITIONAL([HAVE_BITSTREAM], [test "${have_bitstream}" = "yes"])
25
+PKG_HAVE_WITH_MODULES([BITSTREAM], [bitstream > 1.4])
26
27
dnl
28
dnl SRT plugin
29
30
dnl
31
dnl Check for GBM
32
dnl
33
-AC_ARG_ENABLE([gbm],
34
- AS_HELP_STRING([--enable-gbm],
35
- [Use GBM for egl_pbuffer (default enabled)]))
36
-have_gbm="no"
37
-AS_IF([test "${enable_gbm}" != "no"], [
38
- PKG_CHECK_MODULES([GBM], [gbm], [have_gbm="yes"], [
39
- AS_IF([test -n "${enable_gbm}"], [
40
- AC_MSG_ERROR([${GBM_PKG_ERRORS}.])
41
- ], [
42
- AC_MSG_WARN([${GBM_PKG_ERRORS}.])
43
- ])
44
- ])
45
-])
46
-AM_CONDITIONAL([HAVE_GBM], [test "${have_gbm}" = "yes"])
47
+PKG_HAVE_WITH_MODULES([GBM], [gbm])
48
49
dnl
50
dnl Libnotify notification plugin
51
vlc-beta-20210430.0b6b242324.tar.xz/contrib/.gitignore
Added
6
1
2
+bin
3
+vlc-contrib-*.tar.xz
4
+vlc-contrib-*.tar.bz2
5
+/*-*-*/
6
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/bluray/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/bluray/SHA512SUMS
Changed
4
1
2
-e9eeee433034266e88c05ae3469c0bd2bf700d7f16e17ad706f48426c143c823e83c16ab79a637f1e85e4eb858aa0577630671f87ba35d179db2a1d8bc8545c4 libbluray-1.2.1.tar.bz2
3
+3d5145e6fd7de099c07f937282112c7abb12a5590b7c0b965b00bddee3837ddfd1a30076aaa6d6278d07a5beee3856f602125983ae075ab30eceb6ac1bd9bcdc libbluray-1.3.0.tar.bz2
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/bluray/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/bluray/rules.mak
Changed
9
1
2
# LIBBLURAY
3
4
-BLURAY_VERSION := 1.2.1
5
+BLURAY_VERSION := 1.3.0
6
BLURAY_URL := $(VIDEOLAN)/libbluray/$(BLURAY_VERSION)/libbluray-$(BLURAY_VERSION).tar.bz2
7
8
ifdef BUILD_DISCS
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dav1d/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dav1d/SHA512SUMS
Changed
4
1
2
-fe7f4a4a547d1239e62025bb40d2f7f97e9fbdfde1d32f9930497801b703a68050ee2fa79793c1cd0c4723678a0736f32431e1b711f63f5de782fe675e5c82de dav1d-0.7.1.tar.xz
3
+c2d69adcc1f26c8700592e08306828aeaa3bf035e90a09bce4f2a494678645f37d4d0c5fc201eb4c369099f8f27e1325ca3421264aa1c2ffdad94868cc0504af dav1d-0.8.2.tar.xz
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dav1d/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dav1d/rules.mak
Changed
17
1
2
# libdav1d
3
4
-DAV1D_VERSION := 0.7.1
5
+DAV1D_VERSION := 0.8.2
6
DAV1D_URL := $(VIDEOLAN)/dav1d/$(DAV1D_VERSION)/dav1d-$(DAV1D_VERSION).tar.xz
7
8
PKGS += dav1d
9
10
11
dav1d: dav1d-$(DAV1D_VERSION).tar.xz .sum-dav1d
12
$(UNPACK)
13
- $(APPLY) $(SRC)/dav1d/0001-SSE2-PIC-464ca6c2.patch
14
$(MOVE)
15
16
.dav1d: dav1d crossfile.meson
17
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvbpsi/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvbpsi/SHA512SUMS
Changed
4
1
2
-cb59c2e66a214cad7bb96aa1f80a178399fcd80da9fc05b22c72763f2cd818bfab3724d36eee4c6467fb8bc8bae18b1d8afec64c02e8e47cd7a6e887f0230309 libdvbpsi-1.3.2.tar.bz2
3
+70f9e783a947e026ea50afe98ad2b3bfce075bd8d76932f73a6253b077a3a180aa632e9a1fff20308e2f0f3f881d727b4e4aad9b8da2b384edf9a3a0f9eacc69 libdvbpsi-1.3.3.tar.bz2
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvbpsi/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvbpsi/rules.mak
Changed
17
1
2
# dvbpsi
3
4
-DVBPSI_VERSION := 1.3.2
5
+DVBPSI_VERSION := 1.3.3
6
DVBPSI_URL := $(VIDEOLAN)/libdvbpsi/$(DVBPSI_VERSION)/libdvbpsi-$(DVBPSI_VERSION).tar.bz2
7
8
PKGS += dvbpsi
9
10
$(APPLY) $(SRC)/dvbpsi/dvbpsi-sys-types.patch
11
$(APPLY) $(SRC)/dvbpsi/0001-really-identify-duplicates.patch
12
$(APPLY) $(SRC)/dvbpsi/0002-really-reset-packet-counter.patch
13
- $(APPLY) $(SRC)/dvbpsi/0001-really-set-last-section-number.patch
14
$(MOVE)
15
16
.dvbpsi: libdvbpsi
17
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvdcss/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvdcss/SHA512SUMS
Changed
4
1
2
-e46ccded1951046ec481604c5b533c435be14cd0e734cd5315b61868836a20edf4cdc7c1466c2f4ed374de4382c5e758ace700e84aadcb29513001d696f1049c libdvdcss-1.4.2.tar.bz2
3
+0f9c0244feff5ca62459823810a39ede745b63fedb682707fcbaf0dff11fff42998cef31a281bb6380930123d079780d37a79871f6e628cdca9cfa06c64befb6 libdvdcss-1.4.3.tar.bz2
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvdcss/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvdcss/rules.mak
Changed
8
1
2
# DVDCSS
3
-DVDCSS_VERSION := 1.4.2
4
+DVDCSS_VERSION := 1.4.3
5
DVDCSS_URL := $(VIDEOLAN)/libdvdcss/$(DVDCSS_VERSION)/libdvdcss-$(DVDCSS_VERSION).tar.bz2
6
7
ifeq ($(call need_pkg,"libdvdcss"),)
8
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvdnav/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvdnav/SHA512SUMS
Changed
4
1
2
-40ea50d818067a3178b4b09e4b95b0cc67d5ff88dbff2cbeee943d086c5f59a71a7aecc425ba35d7dbe5285d8b1ea099a439c0c80c5dca280687ac0cbdc57c71 libdvdnav-6.1.0.tar.bz2
3
+889bc987113189bfdfc1ebf603b256e5b228be37196455dcfdc7f66debe18e7298b82b807e86ff18a8925e491395ed4007c87cf18ba1ff1ccc213d86f5342a10 libdvdnav-6.1.1.tar.bz2
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvdnav/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvdnav/rules.mak
Changed
9
1
2
# DVDNAV
3
4
-LIBDVDNAV_VERSION := 6.1.0
5
+LIBDVDNAV_VERSION := 6.1.1
6
LIBDVDNAV_URL := $(VIDEOLAN)/libdvdnav/$(LIBDVDNAV_VERSION)/libdvdnav-$(LIBDVDNAV_VERSION).tar.bz2
7
8
ifdef BUILD_DISCS
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvdread/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvdread/SHA512SUMS
Changed
4
1
2
-f34d039d1fbe74076cb3073a3dc6a9f3377e3bd05231a04869ca5faeb96e737750c8e019b908da89e83c14a2df38950a2d61a7c7a6c44c988b710fa875b236b5 libdvdread-6.1.0.tar.bz2
3
+5cbee11ec701b7625d71184fd712de48a129f235b08797b499d0f5b06a1c73bfec1d0e52e897585017ab63b1d81b042257eab5ab1f19fb340b05b3e8d794f86c libdvdread-6.1.2.tar.bz2
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/dvdread/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/dvdread/rules.mak
Changed
8
1
2
# DVDREAD
3
-LIBDVDREAD_VERSION := 6.1.0
4
+LIBDVDREAD_VERSION := 6.1.2
5
LIBDVDREAD_URL := $(VIDEOLAN)/libdvdread/$(LIBDVDREAD_VERSION)/libdvdread-$(LIBDVDREAD_VERSION).tar.bz2
6
7
ifdef BUILD_DISCS
8
vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
Added
38
1
2
+From ef1c4233ee7b694916c5b6059ea3fb57faf7f8ba Mon Sep 17 00:00:00 2001
3
+From: Steve Lhomme <robux4@ycbcr.xyz>
4
+Date: Fri, 12 Feb 2021 08:20:56 +0100
5
+Subject: [PATCH 1/2] avcodec/mpeg12dec: don't call hw->end_frame when starting
6
+ second field decoding
7
+
8
+This call is unbalanced with a hwaccel->start_frame. It fixes some crashes
9
+because this call ends up using uninitialized memory. Decoding works as
10
+expected after this patch.
11
+---
12
+ libavcodec/mpeg12dec.c | 9 ---------
13
+ 1 file changed, 9 deletions(-)
14
+
15
+diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
16
+index 775579f9f0..5dfea63b71 100644
17
+--- a/libavcodec/mpeg12dec.c
18
++++ b/libavcodec/mpeg12dec.c
19
+@@ -1669,15 +1669,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
20
+ return AVERROR_INVALIDDATA;
21
+ }
22
+
23
+- if (s->avctx->hwaccel &&
24
+- (s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
25
+- if ((ret = s->avctx->hwaccel->end_frame(s->avctx)) < 0) {
26
+- av_log(avctx, AV_LOG_ERROR,
27
+- "hardware accelerator failed to decode first field\n");
28
+- return ret;
29
+- }
30
+- }
31
+-
32
+ for (i = 0; i < 4; i++) {
33
+ s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i];
34
+ if (s->picture_structure == PICT_BOTTOM_FIELD)
35
+--
36
+2.27.0.windows.1
37
+
38
vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
Added
51
1
2
+From e2cfacf5501fbe5d6a56de56f4f5e4f47f6ad484 Mon Sep 17 00:00:00 2001
3
+From: Steve Lhomme <robux4@ycbcr.xyz>
4
+Date: Fri, 12 Feb 2021 11:10:03 +0100
5
+Subject: [PATCH 2/2] avcodec/mpeg12dec: don't end a slice without first_slice
6
+
7
+If first_slice is set that means the first slice/field is not started yet. We
8
+should not end the slice. In particular calling hwaccel->end_frame may crash as
9
+we're ending a frame that was not started.
10
+
11
+We also need to reset first_slice once the slice_end is finished handling
12
+for this check to work.
13
+---
14
+ libavcodec/mpeg12dec.c | 20 +++++++++++++-------
15
+ 1 file changed, 13 insertions(+), 7 deletions(-)
16
+
17
+diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
18
+index 5dfea63b71..2689446cfd 100644
19
+--- a/libavcodec/mpeg12dec.c
20
++++ b/libavcodec/mpeg12dec.c
21
+@@ -2476,13 +2476,19 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
22
+ s2->er.error_count += s2->thread_context[i]->er.error_count;
23
+ }
24
+
25
+- ret = slice_end(avctx, picture);
26
+- if (ret < 0)
27
+- return ret;
28
+- else if (ret) {
29
+- // FIXME: merge with the stuff in mpeg_decode_slice
30
+- if (s2->last_picture_ptr || s2->low_delay)
31
+- *got_output = 1;
32
++ if (s->first_slice) // not started yet. don't end it
33
++ ret = 0;
34
++ else {
35
++ ret = slice_end(avctx, picture);
36
++ if (ret < 0)
37
++ return ret;
38
++ else if (ret) {
39
++ // FIXME: merge with the stuff in mpeg_decode_slice
40
++ if (s2->last_picture_ptr || s2->low_delay)
41
++ *got_output = 1;
42
++ }
43
++ // slice ended, don't end it again later
44
++ s->first_slice = 1;
45
+ }
46
+ }
47
+ s2->pict_type = 0;
48
+--
49
+2.27.0.windows.1
50
+
51
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/ffmpeg/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/ffmpeg/rules.mak
Changed
10
1
2
$(APPLY) $(SRC)/ffmpeg/0001-avcodec-dxva2_hevc-add-support-for-parsing-HEVC-Rang.patch
3
$(APPLY) $(SRC)/ffmpeg/0002-avcodec-hevcdec-allow-HEVC-444-8-10-12-bits-decoding.patch
4
$(APPLY) $(SRC)/ffmpeg/0003-avcodec-hevcdec-allow-HEVC-422-10-12-bits-decoding-w.patch
5
+ $(APPLY) $(SRC)/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
6
+ $(APPLY) $(SRC)/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
7
endif
8
ifdef USE_LIBAV
9
$(APPLY) $(SRC)/ffmpeg/libav_gsm.patch
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/fluid/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/fluid/SHA512SUMS
Changed
4
1
2
-0ead8bf86c0edf6d98044eb16b52b85fac8bc3bdeb9c1478d0bceb4f5b38ca28218fcf2cd18cdd5608190dc70b7c39bde681765d01787bc84bc97c6ab3bbf946 fluidsynth-1.1.6.tar.bz2
3
+34f87ea1577b1e89146a1589c67771262961bb18d0c8b21aaa9a1315e18dffc984f18f21cc8a96cc52dca9e94fcad1bdec2b62678c5f2f3434a4faba713854a6 fluidsynth-2.1.8.tar.gz
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/fluid/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/fluid/rules.mak
Changed
75
1
2
# fluid
3
4
-FLUID_VERSION := 1.1.6
5
-FLUID_URL := $(SF)/fluidsynth/fluidsynth-$(FLUID_VERSION)/fluidsynth-$(FLUID_VERSION).tar.bz2
6
+FLUID_VERSION := 2.1.8
7
+FLUID_URL := $(GITHUB)/FluidSynth/fluidsynth/archive/refs/tags/v$(FLUID_VERSION).tar.gz
8
9
ifeq ($(call need_pkg,"glib-2.0 gthread-2.0"),)
10
PKGS += fluid
11
12
13
DEPS_fluid = glib $(DEPS_glib)
14
15
-$(TARBALLS)/fluidsynth-$(FLUID_VERSION).tar.bz2:
16
+$(TARBALLS)/fluidsynth-$(FLUID_VERSION).tar.gz:
17
$(call download_pkg,$(FLUID_URL),fluid)
18
19
-.sum-fluid: fluidsynth-$(FLUID_VERSION).tar.bz2
20
+.sum-fluid: fluidsynth-$(FLUID_VERSION).tar.gz
21
22
-fluidsynth: fluidsynth-$(FLUID_VERSION).tar.bz2 .sum-fluid
23
+fluidsynth: fluidsynth-$(FLUID_VERSION).tar.gz .sum-fluid
24
$(UNPACK)
25
- $(APPLY) $(SRC)/fluid/fluid-no-bin.patch
26
$(APPLY) $(SRC)/fluid/fluid-pkg-static.patch
27
ifdef HAVE_WIN32
28
$(APPLY) $(SRC)/fluid/fluid-static-win32.patch
29
endif
30
- # Remove symbolic links to /usr/share/aclocal
31
- cd $(UNPACK_DIR)/m4/ && rm -f libtool.m4 lt*m4
32
$(MOVE)
33
34
-FLUIDCONF := $(HOSTCONF) \
35
- --disable-alsa-support \
36
- --disable-aufile-support \
37
- --disable-coreaudio \
38
- --disable-coremidi \
39
- --disable-dart \
40
- --disable-dbus-support \
41
- --disable-jack-support \
42
- --disable-ladcca \
43
- --disable-lash \
44
- --disable-libsndfile-support \
45
- --disable-midishare \
46
- --disable-oss-support \
47
- --disable-portaudio-support \
48
- --disable-pulse-support \
49
- --without-readline
50
-
51
-.fluid: fluidsynth
52
- $(RECONF)
53
- cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DFLUIDSYNTH_NOT_A_DLL" ./configure $(FLUIDCONF)
54
- cd $< && $(MAKE) install
55
+FLUIDCONF := \
56
+ -Denable-alsa=0 \
57
+ -Denable-aufile=0 \
58
+ -Denable-coreaudio=0 \
59
+ -Denable-coremidi=0 \
60
+ -Denable-dart=0 \
61
+ -Denable-dbus=0 \
62
+ -Denable-jack=0 \
63
+ -Denable-lash=0 \
64
+ -Denable-libsndfile=0 \
65
+ -Denable-midishare=0 \
66
+ -Denable-oss=0 \
67
+ -Denable-portaudio=0 \
68
+ -Denable-pulseaudio=0 \
69
+ -Denable-readline=0
70
+
71
+.fluid: fluidsynth toolchain.cmake
72
+ cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DFLUIDSYNTH_NOT_A_DLL" $(CMAKE) $(FLUIDCONF)
73
+ cd $< && $(CMAKEBUILD) . --target install
74
touch $@
75
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/harfbuzz/0003-Fix-winstore-app-detection-with-mingw64.patch -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/harfbuzz/0003-Fix-winstore-app-detection-with-mingw64.patch
Changed
10
1
2
typedef CRITICAL_SECTION hb_mutex_impl_t;
3
#define HB_MUTEX_IMPL_INIT {0}
4
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
5
-+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
6
++#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
7
#define hb_mutex_impl_init(M) InitializeCriticalSectionEx (M, 0, 0)
8
#else
9
#define hb_mutex_impl_init(M) InitializeCriticalSection (M)
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/libarchive/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/libarchive/SHA512SUMS
Changed
4
1
2
-a8922e54f2e985889d205ee8a0594c1d30dad950438b602a5be6bb1b274a735ad20a48ed484efd458013a0810d26ee4ae76e3a6c820823243d24ea0593ed7021 libarchive-3.4.2.tar.gz
3
+08ddd74bef4cef0981739da202879f36cf7ca33a8f6d438724588efe3ab8477f2f1d0cccf7b8ed0bedfc0c8d0cab16ee3ae5c0c6e83b6811bc650d7d7471a996 libarchive-3.5.1.tar.gz
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/libarchive/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/libarchive/rules.mak
Changed
18
1
2
# LIBARCHIVE
3
-LIBARCHIVE_VERSION := 3.4.2
4
+LIBARCHIVE_VERSION := 3.5.1
5
LIBARCHIVE_URL := http://www.libarchive.org/downloads/libarchive-$(LIBARCHIVE_VERSION).tar.gz
6
7
PKGS += libarchive
8
9
10
libarchive: libarchive-$(LIBARCHIVE_VERSION).tar.gz .sum-libarchive
11
$(UNPACK)
12
- $(APPLY) $(SRC)/libarchive/0001-Fix-retrieving-incorrect-member-from-struct-statfs.patch
13
- $(APPLY) $(SRC)/libarchive/fix-types.patch
14
- $(APPLY) $(SRC)/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch
15
ifdef HAVE_ANDROID
16
$(APPLY) $(SRC)/libarchive/android.patch
17
endif
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/libarchive/winrt.patch -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/libarchive/winrt.patch
Changed
58
1
2
/* Avoid infinity wait.
3
* Note: If there is no data in the pipe, ReadFile()
4
* called in read() never returns and so we won't
5
-@@ -437,7 +439,7 @@ __archive_read_program(struct archive_read_filter *self, const char *cmd)
6
- cmd);
7
- return (ARCHIVE_FATAL);
8
- }
9
--#if defined(_WIN32) && !defined(__CYGWIN__)
10
-+#if defined(_WIN32) && !defined(__CYGWIN__) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
11
- state->child = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, child);
12
- if (state->child == NULL) {
13
- child_stop(self, state);
14
@@ -516,3 +518,5 @@ program_filter_close(struct archive_read_filter *self)
15
16
return (e);
17
18
#define WEXITSTATUS(sts) (sts & 0x0FF)
19
diff --git a/libarchive/filter_fork_windows.c b/libarchive/filter_fork_windows.c
20
index ad271fe6..0414d6f4 100644
21
---- a/libarchive/filter_fork_windows.c
22
-+++ b/libarchive/filter_fork_windows.c
23
+--- a/libarchive/filter_fork_windows.c.orig 2020-12-26 02:29:38.000000000 +0100
24
++++ b/libarchive/filter_fork_windows.c 2021-04-21 17:17:42.651099766 +0200
25
@@ -31,6 +31,13 @@
26
27
#include "filter_fork.h"
28
29
+#if !WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
30
-+pid_t
31
-+__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout)
32
++int
33
++__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout, HANDLE *out_child)
34
+{
35
-+ return (-1);
36
++ return ARCHIVE_FAILED;
37
+}
38
+#else /* WINAPI_PARTITION_DESKTOP */
39
- pid_t
40
- __archive_create_child(const char *cmd, int *child_stdin, int *child_stdout)
41
- {
42
-@@ -178,6 +185,7 @@ fail:
43
+ int
44
+ __archive_create_child(const char *cmd, int *child_stdin, int *child_stdout,
45
+ HANDLE *out_child)
46
+@@ -187,6 +194,7 @@
47
__archive_cmdline_free(acmd);
48
- return (-1);
49
+ return ARCHIVE_FAILED;
50
}
51
+#endif /* WINAPI_PARTITION_DESKTOP */
52
53
void
54
__archive_check_child(int in, int out)
55
---
56
-2.26.0.windows.1
57
-
58
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/rav1e/SHA512SUMS -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/rav1e/SHA512SUMS
Changed
4
1
2
-79eaf580e60bc3dafc518813392d34339a6f3ca39567d0658c48fea3e2eafd4bfa89630aa0ada8200eaeaa1b1f0d4701d87636edf9c14bbe602c53e2b36367e9 rav1e-0.4.0.tar.gz
3
+d8466c7392cdcd6c6693174cc7148d57a82a8b2328f27b0665a3311e24c9fba136e7f5a35a222004e0554d64005e8b676601e437dcba5365cf69e3b8c61691d8 rav1e-0.4.1.tar.gz
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/contrib/src/rav1e/rules.mak -> vlc-beta-20210430.0b6b242324.tar.xz/contrib/src/rav1e/rules.mak
Changed
9
1
2
# rav1e
3
4
-RAV1E_VERSION := 0.4.0
5
+RAV1E_VERSION := 0.4.1
6
RAV1E_URL := https://github.com/xiph/rav1e/archive/v$(RAV1E_VERSION).tar.gz
7
8
ifdef BUILD_RUST
9
vlc-beta-20210430.0b6b242324.tar.xz/contrib/tarballs/.gitignore
Added
8
1
2
+*.tar.*
3
+*.zip
4
+*.h
5
+*.tgz
6
+*.idl
7
+*.githash
8
vlc-beta-20210430.0b6b242324.tar.xz/doc/.gitignore
Added
6
1
2
+ChangeLog-*
3
+vlc.tags
4
+Doxyfile
5
+doxygen
6
vlc-beta-20210430.0b6b242324.tar.xz/extras/analyser/.gitignore
Added
4
1
2
+zsh_gen
3
+_vlc
4
vlc-beta-20210430.0b6b242324.tar.xz/extras/package/macosx/.gitignore
Added
11
1
2
+!Delete_Preferences.app
3
+*.mode*
4
+*.pbxuser
5
+build
6
+Info.plist
7
+*.xcworkspace
8
+xcuserdata
9
+XCBuildData
10
+xcshareddata
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/extras/package/macosx/package.mak -> vlc-beta-20210430.0b6b242324.tar.xz/extras/package/macosx/package.mak
Changed
10
1
2
rm -f "$(top_builddir)/vlc-$(VERSION).zip"
3
mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies/
4
cp -Rp $(top_builddir)/VLC.app $(top_builddir)/vlc-$(VERSION)/VLC.app
5
- cd $(srcdir); cp -R AUTHORS COPYING README THANKS NEWS $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
6
+ cd $(srcdir); cp -R AUTHORS COPYING README.md THANKS NEWS $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
7
zip -r -y -9 $(top_builddir)/vlc-$(VERSION).zip $(top_builddir)/vlc-$(VERSION)
8
rm -rf "$(top_builddir)/vlc-$(VERSION)"
9
10
vlc-beta-20210430.0b6b242324.tar.xz/extras/package/win32/.gitignore
Added
4
1
2
+vlc.win32.nsi
3
+spad.nsi
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/extras/package/win32/msi/product.wxs -> vlc-beta-20210430.0b6b242324.tar.xz/extras/package/win32/msi/product.wxs
Changed
10
1
2
<File Id='AUTHORS.txt' Name='AUTHORS.txt' DiskId='1' />
3
<File Id='COPYING.txt' Name='COPYING.txt' DiskId='1' />
4
<File Id='NEWS.txt' Name='NEWS.txt' DiskId='1' />
5
- <File Id='README.txt' Name='README.txt' DiskId='1' />
6
+ <File Id='README.md' Name='README.md' DiskId='1' />
7
<File Id='THANKS.txt' Name='THANKS.txt' DiskId='1' />
8
</Component>
9
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/extras/package/win32/package.mak -> vlc-beta-20210430.0b6b242324.tar.xz/extras/package/win32/package.mak
Changed
10
1
2
for file in AUTHORS THANKS ; \
3
do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(win32_destdir)/$${file}.txt"; \
4
done
5
- for file in NEWS COPYING README; \
6
+ for file in NEWS COPYING README.md; \
7
do cp "$(srcdir)/$$file" "$(win32_destdir)/$${file}.txt"; \
8
done
9
10
vlc-beta-20210430.0b6b242324.tar.xz/extras/tools/.gitignore
Added
10
1
2
+Makefile
3
+build/
4
+.*
5
+*/
6
+*.tar.gz
7
+*.tar.bz2
8
+*.tar.xz
9
+*.zip
10
vlc-beta-20210430.0b6b242324.tar.xz/include/.gitignore
Added
4
1
2
+vlc_about.h
3
+!vlc
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/include/vlc_config_cat.h -> vlc-beta-20210430.0b6b242324.tar.xz/include/vlc_config_cat.h
Changed
9
1
2
#define ANETWORK_TITLE N_( "Network" )
3
#define ANETWORK_HELP N_( "Advanced network settings." )
4
5
-/* This function is deprecated and is kept only for compatibility */
6
static const struct config_category_t categories_array[] =
7
{
8
/* Interface */
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/include/vlc_configuration.h -> vlc-beta-20210430.0b6b242324.tar.xz/include/vlc_configuration.h
Changed
55
1
2
VLC_API int config_GetType(const char *name) VLC_USED;
3
4
/**
5
- * Gets an integer configuration item.
6
+ * Gets an integer configuration item's value.
7
*
8
* This function retrieves the current value of a configuration item of
9
* integral type (\ref CONFIG_ITEM_INTEGER and \ref CONFIG_ITEM_BOOL).
10
11
VLC_API int64_t config_GetInt(const char *name) VLC_USED;
12
13
/**
14
- * Sets an integer configuration item.
15
+ * Sets an integer configuration item's value.
16
*
17
* This function changes the current value of a configuration item of
18
* integral type (\ref CONFIG_ITEM_INTEGER and \ref CONFIG_ITEM_BOOL).
19
20
VLC_API void config_PutInt(const char *name, int64_t val);
21
22
/**
23
- * Gets an floating point configuration item.
24
+ * Gets a floating point configuration item's value.
25
*
26
* This function retrieves the current value of a configuration item of
27
* floating point type (\ref CONFIG_ITEM_FLOAT).
28
29
VLC_API float config_GetFloat(const char *name) VLC_USED;
30
31
/**
32
- * Sets an floating point configuration item.
33
+ * Sets a floating point configuration item's value.
34
*
35
* This function changes the current value of a configuration item of
36
* floating point type (\ref CONFIG_ITEM_FLOAT).
37
38
VLC_API void config_PutFloat(const char *name, float val);
39
40
/**
41
- * Gets an string configuration item.
42
+ * Gets a string configuration item's value.
43
*
44
* This function retrieves the current value of a configuration item of
45
* string type (\ref CONFIG_ITEM_STRING).
46
47
VLC_API char *config_GetPsz(const char *name) VLC_USED VLC_MALLOC;
48
49
/**
50
- * Sets an string configuration item.
51
+ * Sets a string configuration item's value.
52
*
53
* This function changes the current value of a configuration item of
54
* string type (e.g. \ref CONFIG_ITEM_STRING).
55
vlc-beta-20210405.f3c7ba5bb3.tar.xz/include/vlc_cpu.h -> vlc-beta-20210430.0b6b242324.tar.xz/include/vlc_cpu.h
Changed
12
1
2
3
# ifdef __AVX__
4
# define vlc_CPU_AVX() (1)
5
+# define VLC_AVX
6
# else
7
# define vlc_CPU_AVX() ((vlc_CPU() & VLC_CPU_AVX) != 0)
8
+# define VLC_AVX __attribute__ ((__target__ ("avx")))
9
# endif
10
11
# ifdef __AVX2__
12
vlc-beta-20210405.f3c7ba5bb3.tar.xz/include/vlc_media_library.h -> vlc-beta-20210430.0b6b242324.tar.xz/include/vlc_media_library.h
Changed
201
1
2
};
3
} vlc_ml_media_t;
4
5
-typedef struct vlc_ml_playlist_t
6
+typedef struct vlc_ml_group_t
7
{
8
int64_t i_id;
9
+
10
char* psz_name;
11
+
12
+ unsigned int i_nb_total_media;
13
+
14
+ unsigned int i_duration;
15
+
16
uint32_t i_creation_date;
17
+} vlc_ml_group_t;
18
+
19
+typedef struct vlc_ml_playlist_t
20
+{
21
+ int64_t i_id;
22
+
23
+ char* psz_name;
24
+
25
+ char* psz_mrl;
26
+
27
char* psz_artwork_mrl;
28
+
29
+ uint32_t i_creation_date;
30
+
31
+ bool b_is_read_only;
32
} vlc_ml_playlist_t;
33
34
typedef struct vlc_ml_artist_t
35
36
vlc_ml_genre_t p_items[];
37
} vlc_ml_genre_list_t;
38
39
+typedef struct vlc_ml_group_list_t
40
+{
41
+ size_t i_nb_items;
42
+ vlc_ml_group_t p_items[];
43
+} vlc_ml_group_list_t;
44
+
45
typedef struct vlc_ml_playlist_list_t
46
{
47
size_t i_nb_items;
48
49
VLC_ML_GET_ARTIST, /**< arg1: Artist ID; ret: vlc_ml_artist_t* */
50
VLC_ML_GET_GENRE, /**< arg1: Genre ID; ret: vlc_ml_genre_t* */
51
VLC_ML_GET_SHOW, /**< arg1: Show ID; ret: vlc_ml_show_t* */
52
+ VLC_ML_GET_GROUP, /**< arg1: Group ID; ret: vlc_ml_group_t* */
53
VLC_ML_GET_PLAYLIST, /**< arg1: Playlist ID; ret: vlc_ml_playlist_t* */
54
};
55
56
57
VLC_ML_COUNT_ARTISTS, /**< arg1 bool: includeAll; arg2 (out): size_t* */
58
VLC_ML_LIST_SHOWS, /**< arg1 (out): vlc_ml_show_list_t** */
59
VLC_ML_COUNT_SHOWS, /**< arg1 (out): size_t* */
60
+ VLC_ML_LIST_GROUPS, /**< arg1 (out): vlc_ml_group_list_t** */
61
+ VLC_ML_COUNT_GROUPS, /**< arg1 (out): size_t* */
62
VLC_ML_LIST_PLAYLISTS, /**< arg1 (out): vlc_ml_playlist_list_t** */
63
VLC_ML_COUNT_PLAYLISTS, /**< arg1 (out): size_t* */
64
VLC_ML_LIST_HISTORY, /**< arg1 (out): vlc_ml_media_list_t** */
65
66
VLC_ML_COUNT_MEDIA_LABELS, /**< arg1: media id; arg2 (out): size_t* */
67
VLC_ML_LIST_MEDIA_BOOKMARKS, /**< arg1: media id; arg2 (out): vlc_ml_bookmark_list_t** */
68
69
+ /* Groups specific listings */
70
+ VLC_ML_LIST_GROUP_MEDIA, /**< arg1: playlist id; arg2 (out): vlc_ml_media_list_t** */
71
+ VLC_ML_COUNT_GROUP_MEDIA, /**< arg1: playlist id; arg2 (out): size_t* */
72
+
73
/* Playlist specific listings */
74
VLC_ML_LIST_PLAYLIST_MEDIA, /**< arg1: playlist id; arg2 (out): vlc_ml_media_list_t** */
75
VLC_ML_COUNT_PLAYLIST_MEDIA, /**< arg1: playlist id; arg2 (out): size_t* */
76
77
VLC_ML_PARENT_ARTIST,
78
VLC_ML_PARENT_SHOW,
79
VLC_ML_PARENT_GENRE,
80
+ VLC_ML_PARENT_GROUP,
81
VLC_ML_PARENT_PLAYLIST,
82
};
83
84
85
VLC_ML_EVENT_ALBUM_ADDED,
86
VLC_ML_EVENT_ALBUM_UPDATED,
87
VLC_ML_EVENT_ALBUM_DELETED,
88
+ VLC_ML_EVENT_GROUP_ADDED,
89
+ VLC_ML_EVENT_GROUP_UPDATED,
90
+ VLC_ML_EVENT_GROUP_DELETED,
91
VLC_ML_EVENT_PLAYLIST_ADDED,
92
VLC_ML_EVENT_PLAYLIST_UPDATED,
93
VLC_ML_EVENT_PLAYLIST_DELETED,
94
95
const vlc_ml_media_t* p_media;
96
const vlc_ml_artist_t* p_artist;
97
const vlc_ml_album_t* p_album;
98
+ const vlc_ml_group_t* p_group;
99
const vlc_ml_playlist_t* p_playlist;
100
const vlc_ml_genre_t* p_genre;
101
const vlc_ml_bookmark_t* p_bookmark;
102
103
VLC_API void vlc_ml_genre_release( vlc_ml_genre_t* p_genre );
104
VLC_API void vlc_ml_media_release( vlc_ml_media_t* p_media );
105
VLC_API void vlc_ml_album_release( vlc_ml_album_t* p_album );
106
+VLC_API void vlc_ml_group_release( vlc_ml_group_t* p_group );
107
VLC_API void vlc_ml_playlist_release( vlc_ml_playlist_t* p_playlist );
108
109
VLC_API void vlc_ml_label_list_release( vlc_ml_label_list_t* p_list );
110
111
VLC_API void vlc_ml_album_list_release( vlc_ml_album_list_t* p_list );
112
VLC_API void vlc_ml_show_list_release( vlc_ml_show_list_t* p_list );
113
VLC_API void vlc_ml_genre_list_release( vlc_ml_genre_list_t* p_list );
114
+VLC_API void vlc_ml_group_list_release( vlc_ml_group_list_t* p_list );
115
VLC_API void vlc_ml_playlist_list_release( vlc_ml_playlist_list_t* p_list );
116
VLC_API void vlc_ml_entry_point_list_release( vlc_ml_entry_point_list_t* p_list );
117
VLC_API void vlc_ml_playback_states_all_release( vlc_ml_playback_states_all* prefs );
118
119
return (vlc_ml_show_t*)vlc_ml_get( p_ml, VLC_ML_GET_SHOW, i_show_id );
120
}
121
122
+static inline vlc_ml_group_t* vlc_ml_get_group( vlc_medialibrary_t* p_ml, int64_t i_group_id )
123
+{
124
+ return (vlc_ml_group_t*)vlc_ml_get( p_ml, VLC_ML_GET_GROUP, i_group_id );
125
+}
126
+
127
static inline vlc_ml_playlist_t* vlc_ml_get_playlist( vlc_medialibrary_t* p_ml, int64_t i_playlist_id )
128
{
129
return (vlc_ml_playlist_t*)vlc_ml_get( p_ml, VLC_ML_GET_PLAYLIST, i_playlist_id );
130
131
return count;
132
}
133
134
+//-------------------------------------------------------------------------------------------------
135
+// Groups
136
+
137
+static inline vlc_ml_group_list_t* vlc_ml_list_groups( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
138
+{
139
+ vlc_assert( p_ml != NULL );
140
+ vlc_ml_group_list_t* res;
141
+ if ( vlc_ml_list( p_ml, VLC_ML_LIST_GROUPS, params, &res ) != VLC_SUCCESS )
142
+ return NULL;
143
+ return res;
144
+}
145
+
146
+static inline size_t vlc_ml_count_groups( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
147
+{
148
+ vlc_assert( p_ml != NULL );
149
+ size_t count;
150
+ if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GROUPS, params, &count ) != VLC_SUCCESS )
151
+ return 0;
152
+ return count;
153
+}
154
+
155
+static inline vlc_ml_media_list_t* vlc_ml_list_group_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_group_id )
156
+{
157
+ vlc_assert( p_ml != NULL );
158
+ vlc_ml_media_list_t* res;
159
+ if ( vlc_ml_list( p_ml, VLC_ML_LIST_GROUP_MEDIA, params, i_group_id, &res ) != VLC_SUCCESS )
160
+ return NULL;
161
+ return res;
162
+}
163
+
164
+static inline size_t vlc_ml_count_group_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_group_id )
165
+{
166
+ vlc_assert( p_ml != NULL );
167
+ size_t count;
168
+ if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GROUP_MEDIA, params, i_group_id, &count ) != VLC_SUCCESS )
169
+ return 0;
170
+ return count;
171
+}
172
+
173
+//-------------------------------------------------------------------------------------------------
174
+
175
static inline vlc_ml_playlist_list_t* vlc_ml_list_playlists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
176
{
177
vlc_assert( p_ml != NULL );
178
179
vlc_ml_album_t*: vlc_ml_album_release, \
180
vlc_ml_genre_t*: vlc_ml_genre_release, \
181
vlc_ml_media_t*: vlc_ml_media_release, \
182
+ vlc_ml_group_t*: vlc_ml_group_release, \
183
vlc_ml_playlist_t*: vlc_ml_playlist_release, \
184
vlc_ml_label_list_t*: vlc_ml_label_list_release, \
185
vlc_ml_file_list_t*: vlc_ml_file_list_release, \
186
187
vlc_ml_album_list_t*: vlc_ml_album_list_release, \
188
vlc_ml_show_list_t*: vlc_ml_show_list_release, \
189
vlc_ml_genre_list_t*: vlc_ml_genre_list_release, \
190
+ vlc_ml_group_list_t*: vlc_ml_group_list_release, \
191
vlc_ml_playlist_list_t*: vlc_ml_playlist_list_release, \
192
vlc_ml_entry_point_list_t*: vlc_ml_entry_point_list_release, \
193
vlc_ml_playback_states_all*: vlc_ml_playback_states_all_release, \
194
195
static inline void vlc_ml_release( vlc_ml_album_t* album ) { vlc_ml_album_release( album ); }
196
static inline void vlc_ml_release( vlc_ml_genre_t* genre ) { vlc_ml_genre_release( genre ); }
197
static inline void vlc_ml_release( vlc_ml_media_t* media ) { vlc_ml_media_release( media ); }
198
+static inline void vlc_ml_release( vlc_ml_group_t* group ) { vlc_ml_group_release( group ); }
199
static inline void vlc_ml_release( vlc_ml_playlist_t* playlist ) { vlc_ml_playlist_release( playlist ); }
200
static inline void vlc_ml_release( vlc_ml_label_list_t* list ) { vlc_ml_label_list_release( list ); }
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/lib/media_player.c -> vlc-beta-20210430.0b6b242324.tar.xz/lib/media_player.c
Changed
19
1
2
goto end;
3
4
size_t titles_count = vlc_player_title_list_GetCount(titles);
5
- if (idx < titles_count)
6
+ if (idx >= titles_count)
7
goto end;
8
9
const struct vlc_player_title *title =
10
11
goto end;
12
13
size_t titles_count = vlc_player_title_list_GetCount(titles);
14
- if (i_chapters_of_title < (int) titles_count)
15
+ if (i_chapters_of_title >= (int) titles_count)
16
goto end;
17
18
const struct vlc_player_title *title =
19
vlc-beta-20210430.0b6b242324.tar.xz/m4/.gitignore
Added
7
1
2
+libtool.m4
3
+ltoptions.m4
4
+ltsugar.m4
5
+ltversion.m4
6
+lt~obsolete.m4
7
vlc-beta-20210430.0b6b242324.tar.xz/modules/.gitignore
Added
10
1
2
+*-client-protocol.h
3
+*-protocol.c
4
+dummy.cpp
5
+plugins.dat
6
+srtp-test-aes
7
+srtp-test-recv
8
+vlc-qt-check
9
+*_test
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/access/cdda.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/access/cdda.c
Changed
13
1
2
{
3
char yearbuf[5];
4
5
- snprintf(yearbuf, sizeof (yearbuf), "%u", year);
6
- vlc_meta_SetDate(meta, yearbuf);
7
+ int ret = snprintf(yearbuf, sizeof (yearbuf), "%u", year);
8
+ if (ret >= 0 && (size_t) ret < sizeof (yearbuf))
9
+ vlc_meta_SetDate(meta, yearbuf);
10
}
11
12
/* Set artist only if identical across tracks */
13
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/access/rist.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/access/rist.c
Changed
18
1
2
add_integer( "nack-type", NACK_FMT_RANGE,
3
N_("RIST nack type, 0 = range, 1 = bitmask. Default is range"), NULL, true )
4
change_integer_list( nack_type, nack_type_names )
5
- add_bool( "disable-nacks", false, "Disable NACK output packets",
6
- "Use this to disable packet recovery", true )
7
- add_bool( "mcast-blind-nacks", false, "Do not check for a valid rtcp message from the encoder",
8
- "Send nack messages even when we have not confirmed that the encoder is on our local " \
9
- "network.", true )
10
+ add_bool( "disable-nacks", false, N_("Disable NACK output packets"),
11
+ N_("Use this to disable packet recovery"), true )
12
+ add_bool( "mcast-blind-nacks", false, N_("Do not check for a valid rtcp message from the encoder"),
13
+ N_("Send nack messages even when we have not confirmed that the encoder is on our local " \
14
+ "network."), true )
15
16
set_capability( "access", 0 )
17
add_shortcut( "rist", "tr06" )
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/audio_output/auhal.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/audio_output/auhal.c
Changed
100
1
2
3
#pragma mark includes
4
5
-#import "coreaudio_common.h"
6
+#include "coreaudio_common.h"
7
8
-#import <vlc_plugin.h>
9
-#import <vlc_dialog.h> // vlc_dialog_display_error
10
-#import <vlc_charset.h> // FromCFString
11
+#include <vlc_plugin.h>
12
+#include <vlc_dialog.h> // vlc_dialog_display_error
13
+#include <vlc_charset.h> // FromCFString
14
15
-#import <CoreAudio/CoreAudio.h> // AudioDeviceID
16
-#import <CoreServices/CoreServices.h>
17
+#include <CoreAudio/CoreAudio.h> // AudioDeviceID
18
+#include <CoreServices/CoreServices.h>
19
+
20
+#include <IOKit/audio/IOAudioTypes.h>
21
22
#pragma mark -
23
#pragma mark local prototypes & module descriptor
24
25
AudioObjectGetPropertyData(i_dev_id, &property, 0, NULL, &size, &data);
26
27
/*
28
- 'hdpn' == headphone
29
- 'ispk' == internal speaker
30
+ 'hdpn' == headphone (kIOAudioOutputPortSubTypeHeadphones)
31
+ 'ispk' == internal speaker (kIOAudioOutputPortSubTypeInternalSpeaker)
32
'61pd' == HDMI
33
' ' == Bluetooth accessory or AirPlay
34
*/
35
36
- return data == 'hdpn';
37
+ return data == kIOAudioOutputPortSubTypeHeadphones;
38
}
39
40
/*
41
42
{
43
aout_sys_t *p_sys = p_aout->sys;
44
45
- if (name)
46
- p_sys->i_new_selected_dev = atoi(name);
47
- else
48
- p_sys->i_new_selected_dev = 0;
49
-
50
- p_sys->i_new_selected_dev = p_sys->i_new_selected_dev;
51
+ p_sys->i_new_selected_dev = (name) ? atoi(name) : 0;
52
53
aout_DeviceReport(p_aout, name);
54
aout_RestartRequest(p_aout, AOUT_RESTART_OUTPUT);
55
56
VolumeSet(audio_output_t * p_aout, float volume)
57
{
58
aout_sys_t *p_sys = p_aout->sys;
59
- OSStatus ostatus = 0;
60
+ OSStatus err = noErr;
61
62
if (p_sys->b_digital)
63
return VLC_EGENERIC;
64
65
/* Set volume for output unit */
66
if (!p_sys->b_mute)
67
{
68
- ostatus = AudioUnitSetParameter(p_sys->au_unit,
69
+ err = AudioUnitSetParameter(p_sys->au_unit,
70
kHALOutputParam_Volume,
71
kAudioUnitScope_Global,
72
0,
73
74
if (var_InheritBool(p_aout, "volume-save"))
75
config_PutInt("auhal-volume", lroundf(volume * AOUT_VOLUME_DEFAULT));
76
77
- return ostatus;
78
+ return (err == noErr) ? VLC_SUCCESS : VLC_EGENERIC;
79
}
80
81
static int
82
83
{
84
aout_sys_t *p_sys = p_aout->sys;
85
86
- if(p_sys->b_digital)
87
+ if (p_sys->b_digital)
88
return VLC_EGENERIC;
89
90
p_sys->b_mute = mute;
91
92
kAudioUnitScope_Global, 0,
93
volume * volume * volume, 0);
94
95
- return err == noErr ? VLC_SUCCESS : VLC_EGENERIC;
96
+ return (err == noErr) ? VLC_SUCCESS : VLC_EGENERIC;
97
}
98
99
#pragma mark -
100
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/audio_output/coreaudio_common.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/audio_output/coreaudio_common.c
Changed
171
1
2
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
3
*****************************************************************************/
4
5
-#import "coreaudio_common.h"
6
-#import <CoreAudio/CoreAudioTypes.h>
7
+#include "coreaudio_common.h"
8
+#include <CoreAudio/CoreAudioTypes.h>
9
10
static inline uint64_t
11
BytesToFrames(struct aout_sys_common *p_sys, size_t i_bytes)
12
13
}
14
15
static inline vlc_tick_t
16
-FramesToUs(struct aout_sys_common *p_sys, uint64_t i_nb_frames)
17
+FramesToTicks(struct aout_sys_common *p_sys, int64_t i_nb_frames)
18
{
19
return vlc_tick_from_samples(i_nb_frames, p_sys->i_rate);
20
}
21
22
return i_frames * p_sys->i_bytes_per_frame / p_sys->i_frame_length;
23
}
24
25
-static inline uint64_t
26
-UsToFrames(struct aout_sys_common *p_sys, vlc_tick_t i_us)
27
+static inline int64_t
28
+TicksToFrames(struct aout_sys_common *p_sys, vlc_tick_t i_ticks)
29
{
30
- assert(i_us > 0);
31
- return samples_from_vlc_tick(i_us, p_sys->i_rate);
32
+ assert(i_ticks != VLC_TICK_INVALID);
33
+ return samples_from_vlc_tick(i_ticks, p_sys->i_rate);
34
}
35
36
+/**
37
+ * Convert a relative audio host time to vlc_ticks
38
+ *
39
+ * \warning This function may only be used to convert relative
40
+ * host times to ticks, as vlc_ticks do not have the
41
+ * same clock origin as the audio host clock!
42
+ */
43
static inline vlc_tick_t
44
HostTimeToTick(struct aout_sys_common *p_sys, int64_t i_host_time)
45
{
46
return VLC_TICK_FROM_NS(i_host_time * p_sys->tinfo.numer / p_sys->tinfo.denom);
47
}
48
49
+/**
50
+ * Convert relative vlc_ticks to an audio host time
51
+ *
52
+ * \warning This function may only be used to convert relative
53
+ * vlc_ticks, as vlc_ticks do not have the same origin
54
+ * as the audio host clock!
55
+ */
56
static inline int64_t
57
-TickToHostTime(struct aout_sys_common *p_sys, vlc_tick_t i_us)
58
+TickToHostTime(struct aout_sys_common *p_sys, vlc_tick_t i_ticks)
59
{
60
- return NS_FROM_VLC_TICK(i_us * p_sys->tinfo.denom / p_sys->tinfo.numer);
61
+ return NS_FROM_VLC_TICK(i_ticks * p_sys->tinfo.denom / p_sys->tinfo.numer);
62
}
63
64
static void
65
66
/* Convert the requested bytes into host time and check that it does
67
* not overlap between the first_render host time and the current one.
68
* */
69
- const size_t i_requested_us =
70
- FramesToUs(p_sys, BytesToFrames(p_sys, i_requested));
71
+ const vlc_tick_t i_requested_ticks =
72
+ FramesToTicks(p_sys, BytesToFrames(p_sys, i_requested));
73
const int64_t i_requested_host_time =
74
- TickToHostTime(p_sys, i_requested_us);
75
+ TickToHostTime(p_sys, i_requested_ticks);
76
if (p_sys->i_first_render_host_time >= i_host_time + i_requested_host_time)
77
{
78
/* Fill the buffer with silence */
79
80
}
81
82
/* Write silence to reach the first_render host time */
83
- const vlc_tick_t i_silence_us =
84
+ const vlc_tick_t i_silence_ticks =
85
HostTimeToTick(p_sys, p_sys->i_first_render_host_time - i_host_time);
86
87
const size_t i_silence_bytes =
88
- FramesToBytes(p_sys, UsToFrames(p_sys, i_silence_us));
89
+ FramesToBytes(p_sys, TicksToFrames(p_sys, i_silence_ticks));
90
assert(i_silence_bytes <= i_requested);
91
memset(p_output, 0, i_silence_bytes);
92
93
94
struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
95
96
const int64_t i_out_frames = BytesToFrames(p_sys, p_sys->i_out_size);
97
- return FramesToUs(p_sys, i_out_frames + p_sys->i_render_frames)
98
- + p_sys->i_dev_latency_us;
99
+ return FramesToTicks(p_sys, i_out_frames + p_sys->i_render_frames)
100
+ + p_sys->i_dev_latency_ticks;
101
}
102
103
int
104
105
return;
106
}
107
108
- const vlc_tick_t i_frame_us =
109
- FramesToUs(p_sys, BytesToFrames(p_sys, p_block->i_buffer));
110
+ const vlc_tick_t i_frame_ticks =
111
+ FramesToTicks(p_sys, BytesToFrames(p_sys, p_block->i_buffer));
112
113
/* Wait for the render buffer to play the remaining data */
114
lock_unlock(p_sys);
115
- vlc_tick_sleep(i_frame_us);
116
+ vlc_tick_sleep(i_frame_ticks);
117
lock_lock(p_sys);
118
}
119
else
120
121
122
int
123
ca_Initialize(audio_output_t *p_aout, const audio_sample_format_t *fmt,
124
- vlc_tick_t i_dev_latency_us)
125
+ vlc_tick_t i_dev_latency_ticks)
126
{
127
struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
128
129
130
p_sys->i_frame_length = fmt->i_frame_length;
131
p_sys->chans_to_reorder = 0;
132
133
- p_sys->i_dev_latency_us = i_dev_latency_us;
134
+ p_sys->i_dev_latency_ticks = i_dev_latency_ticks;
135
136
/* setup circular buffer */
137
size_t i_audiobuffer_size = fmt->i_rate * fmt->i_bytes_per_frame
138
139
vlc_sem_post(&p_sys->flush_sem);
140
}
141
142
-void ca_SetDeviceLatency(audio_output_t *p_aout, vlc_tick_t i_dev_latency_us)
143
+void ca_SetDeviceLatency(audio_output_t *p_aout, vlc_tick_t i_dev_latency_ticks)
144
{
145
struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
146
147
lock_lock(p_sys);
148
- p_sys->i_dev_latency_us = i_dev_latency_us;
149
+ p_sys->i_dev_latency_ticks = i_dev_latency_ticks;
150
lock_unlock(p_sys);
151
}
152
153
154
155
int
156
au_Initialize(audio_output_t *p_aout, AudioUnit au, audio_sample_format_t *fmt,
157
- const AudioChannelLayout *outlayout, vlc_tick_t i_dev_latency_us,
158
+ const AudioChannelLayout *outlayout, vlc_tick_t i_dev_latency_ticks,
159
bool *warn_configuration)
160
{
161
int ret;
162
163
return VLC_EGENERIC;
164
}
165
166
- ret = ca_Initialize(p_aout, fmt, i_dev_latency_us);
167
+ ret = ca_Initialize(p_aout, fmt, i_dev_latency_ticks);
168
if (ret != VLC_SUCCESS)
169
{
170
AudioUnitUninitialize(au);
171
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/audio_output/coreaudio_common.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/audio_output/coreaudio_common.h
Changed
61
1
2
*****************************************************************************/
3
4
#ifdef HAVE_CONFIG_H
5
-# import "config.h"
6
+# include "config.h"
7
#endif
8
9
-#import <vlc_common.h>
10
-#import <vlc_aout.h>
11
-#import <vlc_threads.h>
12
+#include <vlc_common.h>
13
+#include <vlc_aout.h>
14
+#include <vlc_threads.h>
15
16
-#import <AudioUnit/AudioUnit.h>
17
-#import <AudioToolbox/AudioToolbox.h>
18
-#import <os/lock.h>
19
-#import <mach/mach_time.h>
20
+#include <AudioUnit/AudioUnit.h>
21
+#include <AudioToolbox/AudioToolbox.h>
22
+#include <os/lock.h>
23
+#include <mach/mach_time.h>
24
25
#define STREAM_FORMAT_MSG(pre, sfm) \
26
pre "[%f][%4.4s][%u][%u][%u][%u][%u][%u]", \
27
28
unsigned int i_frame_length;
29
uint8_t chans_to_reorder;
30
uint8_t chan_table[AOUT_CHAN_MAX];
31
- /* ca_TimeGet extra latency, in micro-seconds */
32
- vlc_tick_t i_dev_latency_us;
33
+ /* ca_TimeGet extra latency, in vlc ticks */
34
+ vlc_tick_t i_dev_latency_ticks;
35
};
36
37
int ca_Open(audio_output_t *p_aout);
38
39
void ca_Play(audio_output_t * p_aout, block_t * p_block, vlc_tick_t date);
40
41
int ca_Initialize(audio_output_t *p_aout, const audio_sample_format_t *fmt,
42
- vlc_tick_t i_dev_latency_us);
43
+ vlc_tick_t i_dev_latency_ticks);
44
45
void ca_Uninitialize(audio_output_t *p_aout);
46
47
void ca_SetAliveState(audio_output_t *p_aout, bool alive);
48
49
-void ca_SetDeviceLatency(audio_output_t *p_aout, vlc_tick_t i_dev_latency_us);
50
+void ca_SetDeviceLatency(audio_output_t *p_aout, vlc_tick_t i_dev_latency_ticks);
51
52
AudioUnit au_NewOutputInstance(audio_output_t *p_aout, OSType comp_sub_type);
53
54
int au_Initialize(audio_output_t *p_aout, AudioUnit au,
55
audio_sample_format_t *fmt,
56
- const AudioChannelLayout *outlayout, vlc_tick_t i_dev_latency_us,
57
+ const AudioChannelLayout *outlayout, vlc_tick_t i_dev_latency_ticks,
58
bool *warn_configuration);
59
60
void au_Uninitialize(audio_output_t *p_aout, AudioUnit au);
61
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/codec/avcodec/encoder.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/codec/avcodec/encoder.c
Changed
22
1
2
3
static const int DEFAULT_ALIGN = 0;
4
5
-
6
-/*****************************************************************************
7
- * InitVideoEnc: probe the encoder
8
- *****************************************************************************/
9
static void probe_video_frame_rate( encoder_t *p_enc, AVCodecContext *p_context, AVCodec *p_codec )
10
{
11
/* if we don't have i_frame_rate_base, we are probing and just checking if we can find codec
12
13
msg_Warn( p_enc, "Failed to set encoder option %s", psz_name );
14
}
15
16
+/*****************************************************************************
17
+ * InitVideoEnc: probe the encoder
18
+ *****************************************************************************/
19
int InitVideoEnc( vlc_object_t *p_this )
20
{
21
encoder_t *p_enc = (encoder_t *)p_this;
22
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/codec/fluidsynth.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/codec/fluidsynth.c
Changed
18
1
2
return VLC_ENOMEM;
3
4
p_sys->settings = new_fluid_settings ();
5
+ fluid_settings_setnum(p_sys->settings, "synth.sample-rate",
6
+ p_dec->fmt_out.audio.i_rate);
7
p_sys->synth = new_fluid_synth (p_sys->settings);
8
p_sys->soundfont = -1;
9
10
11
12
p_dec->fmt_out.audio.i_rate =
13
var_InheritInteger (p_this, "synth-sample-rate");;
14
- fluid_synth_set_sample_rate (p_sys->synth, p_dec->fmt_out.audio.i_rate);
15
p_dec->fmt_out.audio.i_channels = 2;
16
p_dec->fmt_out.audio.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
17
p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/codec/kate.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/codec/kate.c
Changed
9
1
2
CreateKatePalette( fmt.p_palette, ev->palette );
3
4
p_bitmap_region = subpicture_region_New( &fmt );
5
- video_format_Clean( &fmt );
6
if( !p_bitmap_region )
7
{
8
msg_Err( p_dec, "cannot allocate SPU region" );
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/codec/videotoolbox.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/codec/videotoolbox.c
Changed
9
1
2
VTERRCASE_LEGACY(-8960, "codecErr")
3
VTERRCASE_LEGACY(-8961, "noCodecErr")
4
VTERRCASE_LEGACY(-8969, "codecBadDataErr")
5
+ VTERRCASE_LEGACY(-8971, "codecExtensionNotFoundErr")
6
VTERRCASE_LEGACY(-8973, "codecOpenErr")
7
default:
8
msg_Warn(p_dec, "unknown vt session error (%i)", (int)status);
9
vlc-beta-20210430.0b6b242324.tar.xz/modules/codec/webvtt/.gitignore
Added
5
1
2
+CSSGrammar.c
3
+CSSGrammar.h
4
+CSSLexer.c
5
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/SegmentTracker.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/SegmentTracker.cpp
Changed
51
1
2
this->format = f;
3
}
4
5
-SegmentChangedEvent::SegmentChangedEvent(const ID &id, vlc_tick_t duration)
6
+SegmentChangedEvent::SegmentChangedEvent(const ID &id, vlc_tick_t starttime,
7
+ vlc_tick_t duration, vlc_tick_t displaytime)
8
: TrackerEvent(Type::SegmentChange)
9
{
10
this->id = &id;
11
this->duration = duration;
12
+ this->starttime = starttime;
13
+ this->displaytime = displaytime;
14
}
15
16
BufferingStateUpdatedEvent::BufferingStateUpdatedEvent(const ID &id, bool enabled)
17
18
chunk = nullptr;
19
}
20
21
-SegmentTracker::ChunkEntry::ChunkEntry(SegmentChunk *c, Position p, vlc_tick_t d)
22
+SegmentTracker::ChunkEntry::ChunkEntry(SegmentChunk *c, Position p, vlc_tick_t s, vlc_tick_t d, vlc_tick_t dt)
23
{
24
chunk = c;
25
pos = p;
26
duration = d;
27
+ starttime = s;
28
+ displaytime = dt;
29
}
30
31
bool SegmentTracker::ChunkEntry::isValid() const
32
33
return ChunkEntry();
34
35
const Timescale timescale = pos.rep->inheritTimescale();
36
- return ChunkEntry(segmentChunk, pos, timescale.ToTime(segment->duration.Get()));
37
+ return ChunkEntry(segmentChunk, pos, timescale.ToTime(segment->startTime.Get()),
38
+ timescale.ToTime(segment->duration.Get()), segment->getDisplayTime());
39
}
40
41
void SegmentTracker::resetChunksSequence()
42
43
44
/* Notify new segment length for stats / logic */
45
if(chunk.pos.init_sent && chunk.pos.index_sent)
46
- notify(SegmentChangedEvent(adaptationSet->getID(), chunk.duration));
47
+ notify(SegmentChangedEvent(adaptationSet->getID(), chunk.starttime, chunk.duration, chunk.displaytime));
48
49
/* Handle both implicit and explicit discontinuities */
50
if(b_gap || b_discontinuity)
51
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/SegmentTracker.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/SegmentTracker.hpp
Changed
29
1
2
{
3
public:
4
SegmentChangedEvent() = delete;
5
- SegmentChangedEvent(const ID &, vlc_tick_t);
6
+ SegmentChangedEvent(const ID &, vlc_tick_t, vlc_tick_t, vlc_tick_t = VLC_TICK_INVALID);
7
virtual ~SegmentChangedEvent() = default;
8
9
const ID *id;
10
+ vlc_tick_t displaytime;
11
+ vlc_tick_t starttime;
12
vlc_tick_t duration;
13
};
14
15
16
{
17
public:
18
ChunkEntry();
19
- ChunkEntry(SegmentChunk *c, Position p, vlc_tick_t d);
20
+ ChunkEntry(SegmentChunk *c, Position p, vlc_tick_t s, vlc_tick_t d, vlc_tick_t dt);
21
bool isValid() const;
22
SegmentChunk *chunk;
23
Position pos;
24
+ vlc_tick_t displaytime;
25
+ vlc_tick_t starttime;
26
vlc_tick_t duration;
27
};
28
std::list<ChunkEntry> chunkssequence;
29
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/StreamFormat.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/StreamFormat.cpp
Changed
14
1
2
else /* Check Packet Audio formats */
3
{
4
/* It MUST have ID3 header, but HLS spec is an oxymoron */
5
- if(sz > 10 && ID3TAG_IsTag(data, false))
6
+ while(sz > 10 && ID3TAG_IsTag(data, false))
7
{
8
size_t tagsize = ID3TAG_Parse(data, sz, ID3Callback, this);
9
- if(tagsize >= sz)
10
+ if(tagsize >= sz || tagsize == 0)
11
return; /* not enough peek */
12
data += tagsize;
13
sz -= tagsize;
14
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/Streams.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/Streams.cpp
Changed
112
1
2
if(demuxersource)
3
{
4
CommandsFactory *factory = new (std::nothrow) CommandsFactory();
5
- if(factory)
6
+ AbstractCommandsQueue *commandsqueue = new (std::nothrow) CommandsQueue();
7
+ if(factory && commandsqueue)
8
{
9
- CommandsQueue *commandsqueue = new (std::nothrow) CommandsQueue(factory);
10
- if(commandsqueue)
11
+ fakeesout = new (std::nothrow) FakeESOut(p_realdemux->out,
12
+ commandsqueue, factory);
13
+ if(fakeesout)
14
{
15
- fakeesout = new (std::nothrow) FakeESOut(p_realdemux->out, commandsqueue);
16
- if(fakeesout)
17
- {
18
- /* All successfull */
19
- fakeesout->setExtraInfoProvider( this );
20
- const Role & streamRole = tracker->getStreamRole();
21
- if(streamRole.isDefault() && streamRole.autoSelectable())
22
- fakeesout->setPriority(ES_PRIORITY_MIN + 10);
23
- else if(!streamRole.autoSelectable())
24
- fakeesout->setPriority(ES_PRIORITY_NOT_DEFAULTABLE);
25
- format = format_;
26
- segmentTracker = tracker;
27
- segmentTracker->registerListener(this);
28
- segmentTracker->notifyBufferingState(true);
29
- connManager = conn;
30
- fakeesout->setExpectedTimestamp(segmentTracker->getPlaybackTime());
31
- declaredCodecs();
32
- return true;
33
- }
34
- delete commandsqueue;
35
- commandsqueue = nullptr;
36
- }
37
- else
38
- {
39
- delete factory;
40
+ /* All successfull */
41
+ fakeesout->setExtraInfoProvider( this );
42
+ const Role & streamRole = tracker->getStreamRole();
43
+ if(streamRole.isDefault() && streamRole.autoSelectable())
44
+ fakeesout->setPriority(ES_PRIORITY_MIN + 10);
45
+ else if(!streamRole.autoSelectable())
46
+ fakeesout->setPriority(ES_PRIORITY_NOT_DEFAULTABLE);
47
+ format = format_;
48
+ segmentTracker = tracker;
49
+ segmentTracker->registerListener(this);
50
+ segmentTracker->notifyBufferingState(true);
51
+ connManager = conn;
52
+ fakeesout->setExpectedTimestamp(segmentTracker->getPlaybackTime());
53
+ declaredCodecs();
54
+ return true;
55
}
56
}
57
+ delete factory;
58
+ delete commandsqueue;
59
delete demuxersource;
60
}
61
62
63
description = desc;
64
}
65
66
-vlc_tick_t AbstractStream::getPCR() const
67
-{
68
- vlc_mutex_locker locker(&lock);
69
- if(!valid || disabled)
70
- return VLC_TICK_INVALID;
71
- return fakeEsOut()->commandsQueue()->getPCR();
72
-}
73
-
74
vlc_tick_t AbstractStream::getMinAheadTime() const
75
{
76
if(!segmentTracker)
77
78
{
79
if(!startDemux())
80
{
81
- /* If demux fails because of probing failure / wrong format*/
82
- if(discontinuity)
83
- {
84
- msg_Dbg( p_realdemux, "Draining on format change" );
85
- prepareRestart();
86
- discontinuity = false;
87
- fakeEsOut()->commandsQueue()->setDraining();
88
- vlc_mutex_unlock(&lock);
89
- return BufferingStatus::Ongoing;
90
- }
91
valid = false; /* Prevent further retries */
92
fakeEsOut()->commandsQueue()->setEOF(true);
93
vlc_mutex_unlock(&lock);
94
95
{
96
vlc_tick_t nz_extdeadline = fakeEsOut()->commandsQueue()->getBufferingLevel() +
97
(i_max_buffering - i_demuxed) / 4;
98
- nz_deadline = std::max(nz_deadline, nz_extdeadline);
99
+ nz_deadline = std::min(nz_extdeadline, nz_deadline + VLC_TICK_FROM_SEC(1));
100
101
/* need to read, demuxer still buffering, ... */
102
vlc_mutex_unlock(&lock);
103
104
{
105
if(discontinuity || needrestart)
106
{
107
- msg_Dbg(p_realdemux, "Restarting demuxer");
108
+ msg_Dbg(p_realdemux, "Restarting demuxer %d %d", needrestart, discontinuity);
109
prepareRestart(discontinuity);
110
if(discontinuity)
111
{
112
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/Streams.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/Streams.hpp
Changed
9
1
2
3
void setLanguage(const std::string &);
4
void setDescription(const std::string &);
5
- vlc_tick_t getPCR() const;
6
vlc_tick_t getMinAheadTime() const;
7
vlc_tick_t getFirstDTS() const;
8
int esCount() const;
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/Time.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/Time.hpp
Changed
19
1
2
3
#include <vlc_common.h>
4
5
+namespace adaptive
6
+{
7
+
8
/* Scaled time */
9
using stime_t = int64_t;
10
11
12
uint64_t scale;
13
};
14
15
+}
16
+
17
#endif // TIME_HPP
18
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/http/Chunk.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/http/Chunk.cpp
Changed
88
1
2
using namespace adaptive::http;
3
using vlc::threads::mutex_locker;
4
5
-AbstractChunkSource::AbstractChunkSource()
6
+AbstractChunkSource::AbstractChunkSource(ChunkType t, const BytesRange &range)
7
{
8
+ type = t;
9
contentLength = 0;
10
requeststatus = RequestStatus::Success;
11
+ bytesRange = range;
12
+ if(bytesRange.isValid() && bytesRange.getEndByte())
13
+ contentLength = bytesRange.getEndByte() - bytesRange.getStartByte();
14
}
15
16
AbstractChunkSource::~AbstractChunkSource()
17
18
19
}
20
21
-void AbstractChunkSource::setBytesRange(const BytesRange &range)
22
-{
23
- bytesRange = range;
24
- if(bytesRange.isValid() && bytesRange.getEndByte())
25
- contentLength = bytesRange.getEndByte() - bytesRange.getStartByte();
26
-}
27
-
28
const BytesRange & AbstractChunkSource::getBytesRange() const
29
{
30
return bytesRange;
31
32
return requeststatus;
33
}
34
35
+ChunkType AbstractChunkSource::getChunkType() const
36
+{
37
+ return type;
38
+}
39
+
40
AbstractChunk::AbstractChunk(AbstractChunkSource *source_)
41
{
42
bytesRead = 0;
43
44
}
45
46
HTTPChunkSource::HTTPChunkSource(const std::string& url, AbstractConnectionManager *manager,
47
- const adaptive::ID &id, ChunkType t, bool access) :
48
- AbstractChunkSource(),
49
+ const adaptive::ID &id, ChunkType t, const BytesRange &range,
50
+ bool access) :
51
+ AbstractChunkSource(t, range),
52
connection (nullptr),
53
connManager (manager),
54
consumed (0)
55
56
prepared = false;
57
eof = false;
58
sourceid = id;
59
- type = t;
60
setUseAccess(access);
61
if(!init(url))
62
eof = true;
63
64
65
HTTPChunkBufferedSource::HTTPChunkBufferedSource(const std::string& url, AbstractConnectionManager *manager,
66
const adaptive::ID &sourceid,
67
- ChunkType type, bool access) :
68
- HTTPChunkSource(url, manager, sourceid, type, access),
69
+ ChunkType type, const BytesRange &range,
70
+ bool access) :
71
+ HTTPChunkSource(url, manager, sourceid, type, range, access),
72
p_head (nullptr),
73
pp_tail (&p_head),
74
buffered (0)
75
76
}
77
78
HTTPChunk::HTTPChunk(const std::string &url, AbstractConnectionManager *manager,
79
- const adaptive::ID &id, ChunkType type, bool access):
80
- AbstractChunk(new HTTPChunkSource(url, manager, id, type, access))
81
+ const adaptive::ID &id, ChunkType type, const BytesRange &range):
82
+ AbstractChunk(manager->makeSource(url, id, type, range))
83
{
84
-
85
}
86
87
HTTPChunk::~HTTPChunk()
88
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/http/Chunk.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/http/Chunk.h
Changed
88
1
2
class AbstractChunkSource : public ChunkInterface
3
{
4
public:
5
- AbstractChunkSource();
6
+ AbstractChunkSource(ChunkType, const BytesRange & = BytesRange());
7
virtual ~AbstractChunkSource();
8
- void setBytesRange (const BytesRange &);
9
const BytesRange & getBytesRange () const;
10
+ ChunkType getChunkType () const;
11
virtual std::string getContentType () const override;
12
virtual RequestStatus getRequestStatus() const override;
13
14
protected:
15
+ ChunkType type;
16
RequestStatus requeststatus;
17
size_t contentLength;
18
BytesRange bytesRange;
19
20
class HTTPChunkSource : public AbstractChunkSource,
21
public BackendPrefInterface
22
{
23
+ friend class HTTPConnectionManager;
24
+
25
public:
26
- HTTPChunkSource(const std::string &url, AbstractConnectionManager *,
27
- const ID &, ChunkType, bool = false);
28
virtual ~HTTPChunkSource();
29
30
virtual block_t * readBlock () override;
31
32
static const size_t CHUNK_SIZE = 32768;
33
34
protected:
35
+ HTTPChunkSource(const std::string &url, AbstractConnectionManager *,
36
+ const ID &, ChunkType, const BytesRange &,
37
+ bool = false);
38
+
39
virtual bool prepare();
40
AbstractConnection *connection;
41
AbstractConnectionManager *connManager;
42
43
bool prepared;
44
bool eof;
45
ID sourceid;
46
- ChunkType type;
47
vlc_tick_t requestStartTime;
48
vlc_tick_t responseTime;
49
vlc_tick_t downloadEndTime;
50
51
52
class HTTPChunkBufferedSource : public HTTPChunkSource
53
{
54
+ friend class HTTPConnectionManager;
55
friend class Downloader;
56
57
public:
58
- HTTPChunkBufferedSource(const std::string &url, AbstractConnectionManager *,
59
- const ID &, ChunkType, bool = false);
60
virtual ~HTTPChunkBufferedSource();
61
virtual block_t * readBlock () override;
62
virtual block_t * read (size_t) override;
63
virtual bool hasMoreData () const override;
64
- void hold();
65
- void release();
66
67
protected:
68
+ HTTPChunkBufferedSource(const std::string &url, AbstractConnectionManager *,
69
+ const ID &, ChunkType, const BytesRange &,
70
+ bool = false);
71
virtual bool prepare() override;
72
void bufferize(size_t);
73
bool isDone() const;
74
+ void hold();
75
+ void release();
76
77
private:
78
block_t *p_head; /* read cache buffer */
79
80
{
81
public:
82
HTTPChunk(const std::string &url, AbstractConnectionManager *,
83
- const ID &, ChunkType, bool = false);
84
+ const ID &, ChunkType, const BytesRange &);
85
virtual ~HTTPChunk();
86
87
protected:
88
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/http/HTTPConnectionManager.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/http/HTTPConnectionManager.cpp
Changed
25
1
2
return conn;
3
}
4
5
+AbstractChunkSource *HTTPConnectionManager::makeSource(const std::string &url,
6
+ const ID &id, ChunkType type,
7
+ const BytesRange &range)
8
+{
9
+ switch(type)
10
+ {
11
+ case ChunkType::Init:
12
+ case ChunkType::Index:
13
+ case ChunkType::Segment:
14
+ return new HTTPChunkBufferedSource(url, this, id, type, range);
15
+ case ChunkType::Key:
16
+ case ChunkType::Playlist:
17
+ default:
18
+ return new HTTPChunkSource(url, this, id, type, range, true);
19
+ }
20
+}
21
+
22
void HTTPConnectionManager::start(AbstractChunkSource *source)
23
{
24
HTTPChunkBufferedSource *src = dynamic_cast<HTTPChunkBufferedSource *>(source);
25
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/http/HTTPConnectionManager.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/http/HTTPConnectionManager.h
Changed
38
1
2
#define HTTPCONNECTIONMANAGER_H_
3
4
#include "../logic/IDownloadRateObserver.h"
5
+#include "BytesRange.hpp"
6
7
#include <vlc_common.h>
8
9
10
class AbstractConnection;
11
class Downloader;
12
class AbstractChunkSource;
13
+ enum class ChunkType;
14
15
class AbstractConnectionManager : public IDownloadRateObserver
16
{
17
18
~AbstractConnectionManager();
19
virtual void closeAllConnections () = 0;
20
virtual AbstractConnection * getConnection(ConnectionParams &) = 0;
21
+ virtual AbstractChunkSource *makeSource(const std::string &,
22
+ const ID &, ChunkType,
23
+ const BytesRange &) = 0;
24
+
25
virtual void start(AbstractChunkSource *) = 0;
26
virtual void cancel(AbstractChunkSource *) = 0;
27
28
29
30
virtual void closeAllConnections () override;
31
virtual AbstractConnection * getConnection(ConnectionParams &) override;
32
+ virtual AbstractChunkSource *makeSource(const std::string &,
33
+ const ID &, ChunkType,
34
+ const BytesRange &) override;
35
36
virtual void start(AbstractChunkSource *) override;
37
virtual void cancel(AbstractChunkSource *) override;
38
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
Changed
11
1
2
if(lowest == nullptr || highest == nullptr)
3
return nullptr;
4
5
+ if(lowest == highest)
6
+ return lowest;
7
+
8
const float umin = getUtility(lowest);
9
const float umax = getUtility(highest);
10
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/playlist/Inheritables.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/playlist/Inheritables.hpp
Changed
17
1
2
{
3
public:
4
AttrWrapper(T v) : AbstractAttr(e) { value = v; }
5
- virtual ~AttrWrapper() {}
6
+ virtual ~AttrWrapper() { condDeleteValue(value); }
7
AttrWrapper(const AttrWrapper &) = delete;
8
AttrWrapper<e, T> & operator=(const AttrWrapper<e, T> &) = delete;
9
operator const T&() const { return value; }
10
11
protected:
12
+ void condDeleteValue(const T &) {}
13
+ void condDeleteValue(T* &v) { delete v; }
14
T value;
15
};
16
17
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/playlist/Segment.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/playlist/Segment.cpp
Changed
49
1
2
sequence = 0;
3
templated = false;
4
discontinuity = false;
5
+ displayTime = VLC_TICK_INVALID;
6
}
7
8
ISegment::~ISegment()
9
10
size_t index, BaseRepresentation *rep)
11
{
12
const std::string url = getUrlSegment().toString(index, rep);
13
- HTTPChunkBufferedSource *source = new (std::nothrow) HTTPChunkBufferedSource(url, connManager,
14
- rep->getAdaptationSet()->getID(),
15
- ChunkType::Segment);
16
- if( source )
17
+ BytesRange range;
18
+ if(startByte != endByte)
19
+ range = BytesRange(startByte, endByte);
20
+ AbstractChunkSource *source = connManager->makeSource(url,
21
+ rep->getAdaptationSet()->getID(),
22
+ ChunkType::Segment,
23
+ range);
24
+ if(source)
25
{
26
- if(startByte != endByte)
27
- source->setBytesRange(BytesRange(startByte, endByte));
28
-
29
SegmentChunk *chunk = createChunk(source, rep);
30
if(chunk)
31
{
32
33
encryption = e;
34
}
35
36
+void ISegment::setDisplayTime(vlc_tick_t t)
37
+{
38
+ displayTime = t;
39
+}
40
+
41
+vlc_tick_t ISegment::getDisplayTime() const
42
+{
43
+ return displayTime;
44
+}
45
+
46
Segment::Segment(ICanonicalUrl *parent) :
47
ISegment(parent)
48
{
49
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/playlist/Segment.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/playlist/Segment.h
Changed
18
1
2
virtual bool contains (size_t byte) const;
3
virtual int compare (ISegment *) const;
4
void setEncryption (CommonEncryption &);
5
+ void setDisplayTime (vlc_tick_t);
6
+ vlc_tick_t getDisplayTime () const;
7
Property<stime_t> startTime;
8
Property<stime_t> duration;
9
bool discontinuity;
10
11
std::string debugName;
12
bool templated;
13
uint64_t sequence;
14
+ vlc_tick_t displayTime;
15
};
16
17
class Segment : public ISegment
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/playlist/SegmentInformation.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/playlist/SegmentInformation.cpp
Changed
9
1
2
#include <cassert>
3
#include <limits>
4
5
+using namespace adaptive;
6
using namespace adaptive::playlist;
7
8
SegmentInformation::SegmentInformation(SegmentInformation *parent_) :
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/playlist/SegmentList.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/playlist/SegmentList.cpp
Changed
9
1
2
3
#include <limits>
4
5
+using namespace adaptive;
6
using namespace adaptive::playlist;
7
8
SegmentList::SegmentList( SegmentInformation *parent_ ):
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/playlist/SegmentTimeline.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/playlist/SegmentTimeline.cpp
Changed
9
1
2
#include <sstream>
3
#include <limits>
4
5
+using namespace adaptive;
6
using namespace adaptive::playlist;
7
8
SegmentTimeline::SegmentTimeline(AbstractMultipleSegmentBaseType *parent_)
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/plumbing/CommandsQueue.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/plumbing/CommandsQueue.cpp
Changed
178
1
2
p_fakeid = p_es;
3
}
4
5
+const void * AbstractFakeEsCommand::esIdentifier() const
6
+{
7
+ return static_cast<const void *>(p_fakeid);
8
+}
9
+
10
EsOutSendCommand::EsOutSendCommand( AbstractFakeESOutID *p_es, block_t *p_block_ ) :
11
AbstractFakeEsCommand( ES_OUT_PRIVATE_COMMAND_SEND, p_es )
12
{
13
14
return AbstractCommand::getTime();
15
}
16
17
-const void * EsOutSendCommand::esIdentifier() const
18
-{
19
- return static_cast<const void *>(p_fakeid);
20
-}
21
-
22
EsOutDelCommand::EsOutDelCommand( AbstractFakeESOutID *p_es ) :
23
AbstractFakeEsCommand( ES_OUT_PRIVATE_COMMAND_DEL, p_es )
24
{
25
26
}
27
#endif
28
29
-CommandsQueue::CommandsQueue( CommandsFactory *f )
30
+AbstractCommandsQueue::AbstractCommandsQueue()
31
{
32
- bufferinglevel = VLC_TICK_INVALID;
33
- pcr = VLC_TICK_INVALID;
34
b_drop = false;
35
b_draining = false;
36
b_eof = false;
37
- commandsFactory = f;
38
+}
39
+
40
+void AbstractCommandsQueue::setDrop( bool b )
41
+{
42
+ b_drop = b;
43
+}
44
+
45
+void AbstractCommandsQueue::setDraining()
46
+{
47
+ b_draining = true;
48
+}
49
+
50
+bool AbstractCommandsQueue::isDraining() const
51
+{
52
+ return b_draining;
53
+}
54
+
55
+void AbstractCommandsQueue::setEOF( bool b )
56
+{
57
+ b_eof = b;
58
+ if( b_eof )
59
+ setDraining();
60
+ else
61
+ b_draining = false;
62
+}
63
+
64
+bool AbstractCommandsQueue::isEOF() const
65
+{
66
+ return b_eof;
67
+}
68
+
69
+CommandsQueue::CommandsQueue()
70
+ : AbstractCommandsQueue()
71
+{
72
+ bufferinglevel = VLC_TICK_INVALID;
73
+ pcr = VLC_TICK_INVALID;
74
nextsequence = 0;
75
}
76
77
CommandsQueue::~CommandsQueue()
78
{
79
Abort( false );
80
- delete commandsFactory;
81
}
82
83
static bool compareCommands( const Queueentry &a, const Queueentry &b )
84
85
}
86
}
87
88
-void CommandsQueue::Schedule( AbstractCommand *command )
89
+void CommandsQueue::Schedule( AbstractCommand *command, EsType )
90
{
91
if( b_drop )
92
{
93
94
}
95
}
96
97
-const CommandsFactory * CommandsQueue::factory() const
98
-{
99
- return commandsFactory;
100
-}
101
-
102
vlc_tick_t CommandsQueue::Process( vlc_tick_t barrier )
103
{
104
vlc_tick_t lastdts = barrier;
105
106
107
bool CommandsQueue::isEmpty() const
108
{
109
- bool b_empty = commands.empty() && incoming.empty();
110
- return b_empty;
111
-}
112
-
113
-void CommandsQueue::setDrop( bool b )
114
-{
115
- b_drop = b;
116
+ return commands.empty() && incoming.empty();
117
}
118
119
void CommandsQueue::setDraining()
120
121
LockedSetDraining();
122
}
123
124
-bool CommandsQueue::isDraining() const
125
-{
126
- bool b = b_draining;
127
- return b;
128
-}
129
-
130
-void CommandsQueue::setEOF( bool b )
131
-{
132
- b_eof = b;
133
- if( b_eof )
134
- LockedSetDraining();
135
- else
136
- b_draining = false;
137
-}
138
-
139
-bool CommandsQueue::isEOF() const
140
-{
141
- bool b = b_eof;
142
- return b;
143
-}
144
-
145
vlc_tick_t CommandsQueue::getDemuxedAmount(vlc_tick_t from) const
146
{
147
- if( bufferinglevel == VLC_TICK_INVALID || from > bufferinglevel )
148
+ vlc_tick_t bufferingstart = getFirstDTS();
149
+ if( bufferinglevel == VLC_TICK_INVALID ||
150
+ bufferingstart == VLC_TICK_INVALID ||
151
+ from > bufferinglevel )
152
return 0;
153
- if( from > getFirstDTS() )
154
+ if( from > bufferingstart )
155
return bufferinglevel - from;
156
else
157
- return bufferinglevel - getFirstDTS();
158
+ return bufferinglevel - bufferingstart;
159
}
160
161
vlc_tick_t CommandsQueue::getBufferingLevel() const
162
{
163
- vlc_tick_t i_buffer;
164
- i_buffer = bufferinglevel;
165
- return i_buffer;
166
+ return bufferinglevel;
167
}
168
169
vlc_tick_t CommandsQueue::getFirstDTS() const
170
171
172
vlc_tick_t CommandsQueue::getPCR() const
173
{
174
- vlc_tick_t i_pcr = pcr;
175
- return i_pcr;
176
+ return pcr;
177
}
178
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/plumbing/CommandsQueue.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/plumbing/CommandsQueue.hpp
Changed
112
1
2
#ifndef COMMANDSQUEUE_HPP_
3
#define COMMANDSQUEUE_HPP_
4
5
+#include "FakeESOutID.hpp"
6
+
7
#include <vlc_common.h>
8
#include <vlc_es.h>
9
10
11
namespace adaptive
12
{
13
class AbstractFakeEsOut;
14
- class AbstractFakeESOutID;
15
16
class AbstractCommand
17
{
18
19
20
class AbstractFakeEsCommand : public AbstractCommand
21
{
22
+ public:
23
+ const void * esIdentifier() const;
24
+
25
protected:
26
AbstractFakeEsCommand( int, AbstractFakeESOutID * );
27
AbstractFakeESOutID *p_fakeid;
28
29
virtual ~EsOutSendCommand();
30
virtual void Execute( ) override;
31
virtual vlc_tick_t getTime() const override;
32
- const void * esIdentifier() const;
33
34
protected:
35
EsOutSendCommand( AbstractFakeESOutID *, block_t * );
36
37
38
using Queueentry = std::pair<uint64_t, AbstractCommand *>;
39
40
- /* Queuing for doing all the stuff in order */
41
- class CommandsQueue
42
+ class AbstractCommandsQueue
43
{
44
public:
45
- CommandsQueue( CommandsFactory * );
46
- ~CommandsQueue();
47
- const CommandsFactory * factory() const;
48
- void Schedule( AbstractCommand * );
49
- vlc_tick_t Process( vlc_tick_t );
50
- void Abort( bool b_reset );
51
- void Commit();
52
- bool isEmpty() const;
53
+ AbstractCommandsQueue();
54
+ virtual ~AbstractCommandsQueue() = default;
55
+ virtual void Schedule( AbstractCommand *, EsType = EsType::Other ) = 0;
56
+ virtual vlc_tick_t Process( vlc_tick_t ) = 0;
57
+ virtual void Abort( bool b_reset ) = 0;
58
+ virtual void Commit() = 0;
59
+ virtual bool isEmpty() const = 0;
60
void setDrop( bool );
61
- void setDraining();
62
+ virtual void setDraining();
63
void setEOF( bool );
64
bool isDraining() const;
65
bool isEOF() const;
66
- vlc_tick_t getDemuxedAmount(vlc_tick_t) const;
67
- vlc_tick_t getBufferingLevel() const;
68
- vlc_tick_t getFirstDTS() const;
69
- vlc_tick_t getPCR() const;
70
+ virtual vlc_tick_t getDemuxedAmount(vlc_tick_t) const = 0;
71
+ virtual vlc_tick_t getBufferingLevel() const = 0;
72
+ virtual vlc_tick_t getFirstDTS() const = 0;
73
+ virtual vlc_tick_t getPCR() const = 0;
74
+
75
+ protected:
76
+ bool b_draining;
77
+ bool b_drop;
78
+ bool b_eof;
79
+ };
80
+
81
+ /* Queuing for doing all the stuff in order */
82
+ class CommandsQueue : public AbstractCommandsQueue
83
+ {
84
+ public:
85
+ CommandsQueue();
86
+ virtual ~CommandsQueue();
87
+ virtual void Schedule( AbstractCommand *, EsType = EsType::Other ) override;
88
+ virtual vlc_tick_t Process( vlc_tick_t ) override;
89
+ virtual void Abort( bool b_reset ) override;
90
+ virtual void Commit() override;
91
+ virtual bool isEmpty() const override;
92
+ virtual void setDraining() override;
93
+ virtual vlc_tick_t getDemuxedAmount(vlc_tick_t) const override;
94
+ virtual vlc_tick_t getBufferingLevel() const override;
95
+ virtual vlc_tick_t getFirstDTS() const override;
96
+ virtual vlc_tick_t getPCR() const override;
97
98
private:
99
- CommandsFactory *commandsFactory;
100
void LockedCommit();
101
void LockedSetDraining();
102
std::list<Queueentry> incoming;
103
std::list<Queueentry> commands;
104
vlc_tick_t bufferinglevel;
105
vlc_tick_t pcr;
106
- bool b_draining;
107
- bool b_drop;
108
- bool b_eof;
109
uint64_t nextsequence;
110
};
111
}
112
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/plumbing/FakeESOut.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/plumbing/FakeESOut.cpp
Changed
113
1
2
return p;
3
}
4
5
-FakeESOut::FakeESOut( es_out_t *es, CommandsQueue *queue )
6
+FakeESOut::FakeESOut( es_out_t *es, AbstractCommandsQueue *queue,
7
+ CommandsFactory *cf )
8
: AbstractFakeEsOut()
9
, real_es_out( es )
10
, extrainfo( nullptr )
11
, commandsqueue( queue )
12
+ , commandsfactory( cf )
13
, timestamps_offset( 0 )
14
{
15
associated.b_timestamp_set = false;
16
17
return LockedFakeEsOut(*this);
18
}
19
20
-CommandsQueue * FakeESOut::commandsQueue()
21
+AbstractCommandsQueue * FakeESOut::commandsQueue()
22
{
23
return commandsqueue;
24
}
25
26
+CommandsFactory * FakeESOut::commandsFactory() const
27
+{
28
+ return commandsfactory;
29
+}
30
+
31
FakeESOut::~FakeESOut()
32
{
33
recycleAll();
34
gc();
35
36
delete commandsqueue;
37
+ delete commandsfactory;
38
}
39
40
void FakeESOut::resetTimestamps()
41
42
43
void FakeESOut::schedulePCRReset()
44
{
45
- AbstractCommand *command = commandsqueue->factory()->creatEsOutControlResetPCRCommand();
46
+ AbstractCommand *command = commandsfactory->creatEsOutControlResetPCRCommand();
47
if( likely(command) )
48
commandsqueue->Schedule( command );
49
}
50
51
FakeESOutID *es_id = *it;
52
if(!es_id->scheduledForDeletion())
53
{
54
- AbstractCommand *command = commandsqueue->factory()->createEsOutDelCommand( es_id );
55
+ AbstractCommand *command = commandsfactory->createEsOutDelCommand( es_id );
56
if( likely(command) )
57
{
58
commandsqueue->Schedule( command );
59
60
if( likely(es_id) )
61
{
62
assert(!es_id->scheduledForDeletion());
63
- AbstractCommand *command = commandsqueue->factory()->createEsOutAddCommand( es_id );
64
+ AbstractCommand *command = commandsfactory->createEsOutAddCommand( es_id );
65
if( likely(command) )
66
{
67
fakeesidlist.push_back(es_id);
68
69
p_block->i_dts = fixTimestamp( p_block->i_dts );
70
p_block->i_pts = fixTimestamp( p_block->i_pts );
71
72
- AbstractCommand *command = commandsqueue->factory()->createEsOutSendCommand( es_id, p_block );
73
+ AbstractCommand *command = commandsfactory->createEsOutSendCommand( es_id, p_block );
74
if( likely(command) )
75
{
76
commandsqueue->Schedule( command );
77
78
vlc_mutex_locker locker(&lock);
79
80
FakeESOutID *es_id = reinterpret_cast<FakeESOutID *>( p_es );
81
- AbstractCommand *command = commandsqueue->factory()->createEsOutDelCommand( es_id );
82
+ AbstractCommand *command = commandsfactory->createEsOutDelCommand( es_id );
83
if( likely(command) )
84
{
85
es_id->setScheduledForDeletion();
86
87
i_group = 0;
88
vlc_tick_t pcr = va_arg( args, vlc_tick_t );
89
pcr = fixTimestamp( pcr );
90
- AbstractCommand *command = commandsqueue->factory()->createEsOutControlPCRCommand( i_group, pcr );
91
+ AbstractCommand *command = commandsfactory->createEsOutControlPCRCommand( i_group, pcr );
92
if( likely(command) )
93
{
94
commandsqueue->Schedule( command );
95
96
{
97
static_cast<void>(va_arg( args, int )); /* ignore group */
98
const vlc_meta_t *p_meta = va_arg( args, const vlc_meta_t * );
99
- AbstractCommand *command = commandsqueue->factory()->createEsOutMetaCommand( this,-1, p_meta );
100
+ AbstractCommand *command = commandsfactory->createEsOutMetaCommand( this,-1, p_meta );
101
if( likely(command) )
102
{
103
commandsqueue->Schedule( command );
104
105
{
106
vlc_mutex_locker locker(&lock);
107
108
- AbstractCommand *command = commandsqueue->factory()->createEsOutDestroyCommand();
109
+ AbstractCommand *command = commandsfactory->createEsOutDestroyCommand();
110
if( likely(command) )
111
commandsqueue->Schedule( command );
112
}
113
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/plumbing/FakeESOut.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/plumbing/FakeESOut.hpp
Changed
35
1
2
virtual ~ExtraFMTInfoInterface() = default;
3
};
4
5
- class CommandsQueue;
6
+ class AbstractCommandsQueue;
7
+ class CommandsFactory;
8
class AbstractFakeESOutID;
9
class FakeESOutID;
10
11
12
FakeESOut *p;
13
LockedFakeEsOut(FakeESOut &q);
14
};
15
- FakeESOut( es_out_t *, CommandsQueue * );
16
+ FakeESOut( es_out_t *, AbstractCommandsQueue *, CommandsFactory * );
17
virtual ~FakeESOut();
18
LockedFakeEsOut WithLock();
19
- CommandsQueue * commandsQueue();
20
+ AbstractCommandsQueue * commandsQueue();
21
+ CommandsFactory *commandsFactory() const;
22
void setAssociatedTimestamp( vlc_tick_t );
23
void setExpectedTimestamp( vlc_tick_t );
24
void resetTimestamps();
25
26
es_out_t *real_es_out;
27
FakeESOutID * createNewID( const es_format_t * );
28
ExtraFMTInfoInterface *extrainfo;
29
- CommandsQueue *commandsqueue;
30
+ AbstractCommandsQueue *commandsqueue;
31
+ CommandsFactory *commandsfactory;
32
struct
33
{
34
vlc_tick_t timestamp;
35
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/plumbing/FakeESOutID.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/plumbing/FakeESOutID.cpp
Changed
18
1
2
fakeesout->sendData( this, p_block );
3
}
4
5
+EsType FakeESOutID::esType() const
6
+{
7
+ if(fmt.i_cat == VIDEO_ES)
8
+ return EsType::Video;
9
+ else if(fmt.i_cat == AUDIO_ES)
10
+ return EsType::Audio;
11
+ else
12
+ return EsType::Other;
13
+}
14
+
15
void FakeESOutID::create()
16
{
17
fakeesout->createOrRecycleRealEsID( this );
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/plumbing/FakeESOutID.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/plumbing/FakeESOutID.hpp
Changed
31
1
2
{
3
class FakeESOut;
4
5
+ enum class EsType
6
+ {
7
+ Video,
8
+ Audio,
9
+ Other,
10
+ };
11
+
12
class AbstractFakeESOutID
13
{
14
public:
15
16
virtual void create() = 0;
17
virtual void release() = 0;
18
virtual void sendData(block_t *) = 0;
19
+ virtual EsType esType() const = 0;
20
};
21
22
class FakeESOutID : public AbstractFakeESOutID
23
24
virtual void create() override;
25
virtual void release() override;
26
virtual void sendData(block_t *) override;
27
+ virtual EsType esType() const override;
28
bool isCompatible( const FakeESOutID * ) const;
29
/* Ensure we won't issue delete command twice */
30
void setScheduledForDeletion();
31
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/test/playlist/M3U8.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/test/playlist/M3U8.cpp
Changed
20
1
2
/* date set and incremented */
3
seg = rep->getMediaSegment(10);
4
Expect(seg);
5
- Expect(static_cast<HLSSegment *>(seg)->getUTCTime() == VLC_TICK_0 + vlc_tick_from_sec(10));
6
+ Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TICK_0 + vlc_tick_from_sec(10));
7
seg = rep->getMediaSegment(11);
8
Expect(seg);
9
- Expect(static_cast<HLSSegment *>(seg)->getUTCTime() == VLC_TICK_0 + vlc_tick_from_sec(10 + 8));
10
+ Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TICK_0 + vlc_tick_from_sec(10 + 8));
11
12
/* date change after discontinuity */
13
seg = rep->getMediaSegment(20);
14
Expect(seg);
15
- Expect(static_cast<HLSSegment *>(seg)->getUTCTime() == VLC_TICK_0 + vlc_tick_from_sec(7200));
16
+ Expect(static_cast<HLSSegment *>(seg)->getDisplayTime() == VLC_TICK_0 + vlc_tick_from_sec(7200));
17
18
vlc_tick_t begin, end, duration;
19
Expect(rep->getMediaPlaybackRange(&begin, &end, &duration));
20
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/test/plumbing/CommandsQueue.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/test/plumbing/CommandsQueue.cpp
Changed
130
1
2
{
3
out->sendData(this, b);
4
}
5
+ virtual EsType esType() const override { return EsType::Other; }
6
7
private:
8
TestEsOut *out;
9
10
TestEsOutID *id1 = nullptr;
11
try
12
{
13
- CommandsFactory *factory = new CommandsFactory();
14
- CommandsQueue queue(factory);
15
+ CommandsFactory factory;
16
+ CommandsQueue queue;
17
18
id0 = new TestEsOutID(&esout);
19
AbstractCommand *cmd = nullptr;
20
21
Expect(queue.getBufferingLevel() == VLC_TICK_INVALID);
22
Expect(queue.getFirstDTS() == VLC_TICK_INVALID);
23
Expect(queue.getPCR() == VLC_TICK_INVALID);
24
- cmd = queue.factory()->createEsOutAddCommand(id0);
25
+ cmd = factory.createEsOutAddCommand(id0);
26
queue.Schedule(cmd);
27
- cmd = queue.factory()->createEsOutDelCommand(id0);
28
+ cmd = factory.createEsOutDelCommand(id0);
29
queue.Schedule(cmd);
30
for(size_t i=0; i<3; i++) /* Add / Del will return in between */
31
queue.Process(std::numeric_limits<vlc_tick_t>::max());
32
33
block_t *data = block_Alloc(0);
34
Expect(data);
35
data->i_dts = VLC_TICK_0 + vlc_tick_from_sec(i);
36
- cmd = queue.factory()->createEsOutSendCommand(id0, data);
37
+ cmd = factory.createEsOutSendCommand(id0, data);
38
queue.Schedule(cmd);
39
}
40
Expect(queue.getPCR() == VLC_TICK_INVALID);
41
42
Expect(queue.getDemuxedAmount(VLC_TICK_0) == 0);
43
Expect(queue.getBufferingLevel() == VLC_TICK_INVALID);
44
/* commit some */
45
- cmd = queue.factory()->createEsOutControlPCRCommand(0, VLC_TICK_0 + vlc_tick_from_sec(8));
46
+ cmd = factory.createEsOutControlPCRCommand(0, VLC_TICK_0 + vlc_tick_from_sec(8));
47
queue.Schedule(cmd);
48
Expect(queue.getDemuxedAmount(VLC_TICK_0) == vlc_tick_from_sec(8)); /* PCR committed data up to 8s */
49
Expect(queue.getBufferingLevel() == VLC_TICK_0 + vlc_tick_from_sec(8));
50
51
Expect(queue.getDemuxedAmount(VLC_TICK_0 + vlc_tick_from_sec(7)) == vlc_tick_from_sec(1));
52
Expect(queue.getPCR() == VLC_TICK_INVALID);
53
/* extend through PCR */
54
- cmd = queue.factory()->createEsOutControlPCRCommand(0, VLC_TICK_0 + vlc_tick_from_sec(10));
55
+ cmd = factory.createEsOutControlPCRCommand(0, VLC_TICK_0 + vlc_tick_from_sec(10));
56
queue.Schedule(cmd);
57
Expect(queue.getBufferingLevel() == VLC_TICK_0 + vlc_tick_from_sec(10));
58
Expect(queue.getDemuxedAmount(VLC_TICK_0) == vlc_tick_from_sec(10));
59
60
block_t *data = block_Alloc(0);
61
Expect(data);
62
data->i_dts = VLC_TICK_0 + vlc_tick_from_sec(11);
63
- cmd = queue.factory()->createEsOutSendCommand(id0, data);
64
+ cmd = factory.createEsOutSendCommand(id0, data);
65
queue.Schedule(cmd);
66
} while(0);
67
- cmd = queue.factory()->createEsOutControlPCRCommand(0, VLC_TICK_0 + vlc_tick_from_sec(11));
68
+ cmd = factory.createEsOutControlPCRCommand(0, VLC_TICK_0 + vlc_tick_from_sec(11));
69
queue.Schedule(cmd);
70
Expect(queue.getPCR() == VLC_TICK_0 + vlc_tick_from_sec(3)); /* should be unchanged */
71
Expect(queue.getDemuxedAmount(VLC_TICK_0 + vlc_tick_from_sec(3)) == vlc_tick_from_sec(7));
72
73
block_t *data = block_Alloc(0);
74
Expect(data);
75
data->i_dts = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i);
76
- cmd = queue.factory()->createEsOutSendCommand(id, data);
77
+ cmd = factory.createEsOutSendCommand(id, data);
78
queue.Schedule(cmd);
79
}
80
}
81
82
- cmd = queue.factory()->createEsOutControlPCRCommand(0, VLC_TICK_0 + OFFSET + vlc_tick_from_sec(10));
83
+ cmd = factory.createEsOutControlPCRCommand(0, VLC_TICK_0 + OFFSET + vlc_tick_from_sec(10));
84
queue.Schedule(cmd);
85
Expect(esout.output.empty());
86
queue.Process(VLC_TICK_0 + OFFSET - 1);
87
88
block_t *data = block_Alloc(0);
89
Expect(data);
90
data->i_dts = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(k * 2 + i);
91
- cmd = queue.factory()->createEsOutSendCommand(id, data);
92
+ cmd = factory.createEsOutSendCommand(id, data);
93
queue.Schedule(cmd);
94
}
95
}
96
- cmd = queue.factory()->createEsOutControlPCRCommand(0,
97
+ cmd = factory.createEsOutControlPCRCommand(0,
98
VLC_TICK_0 + OFFSET + vlc_tick_from_sec( (k*2)+1 ));
99
queue.Schedule(cmd);
100
}
101
102
Expect(data);
103
if(i==0)
104
data->i_dts = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(k);
105
- cmd = queue.factory()->createEsOutSendCommand(id, data);
106
+ cmd = factory.createEsOutSendCommand(id, data);
107
queue.Schedule(cmd);
108
}
109
}
110
- cmd = queue.factory()->createEsOutControlPCRCommand(0,
111
+ cmd = factory.createEsOutControlPCRCommand(0,
112
VLC_TICK_0 + OFFSET + vlc_tick_from_sec(k));
113
queue.Schedule(cmd);
114
}
115
116
for(size_t i=0; i<2; i++)
117
{
118
const vlc_tick_t now = VLC_TICK_0 + OFFSET + vlc_tick_from_sec(i);
119
- cmd = queue.factory()->createEsOutControlPCRCommand(0, now);
120
+ cmd = factory.createEsOutControlPCRCommand(0, now);
121
queue.Schedule(cmd);
122
block_t *data = block_Alloc(0);
123
Expect(data);
124
data->i_dts = now;
125
- cmd = queue.factory()->createEsOutSendCommand(id0, data);
126
+ cmd = factory.createEsOutSendCommand(id0, data);
127
queue.Schedule(cmd);
128
}
129
queue.Process(VLC_TICK_0 + OFFSET + vlc_tick_from_sec(0));
130
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/adaptive/tools/Retrieve.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/adaptive/tools/Retrieve.cpp
Changed
11
1
2
HTTPChunk *datachunk;
3
try
4
{
5
- datachunk = new HTTPChunk(uri, resources->getConnManager(), ID(), type, true);
6
+ datachunk = new HTTPChunk(uri, resources->getConnManager(),
7
+ ID(), type, BytesRange());
8
} catch (...) {
9
return nullptr;
10
}
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/av1_unpack.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/av1_unpack.h
Changed
10
1
2
if(AV1_OBUHasSizeField(p_obu))
3
continue;
4
const uint8_t i_header = 1 + AV1_OBUHasExtensionField(p_obu);
5
+ if(i_header > i_obu)
6
+ break;
7
const uint8_t i_sizelen = leb128_expected(i_obu - i_header);
8
const size_t i_obu_offset = p_obu - p_block->p_buffer;
9
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/hls/HLSStreams.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/hls/HLSStreams.cpp
Changed
32
1
2
3
block_t * HLSStream::checkBlock(block_t *p_block, bool b_first)
4
{
5
- if(b_first && p_block &&
6
- p_block->i_buffer >= 10 && ID3TAG_IsTag(p_block->p_buffer, false))
7
+ if(b_first && p_block)
8
{
9
- while( p_block->i_buffer )
10
+ while(p_block->i_buffer >= 10 && ID3TAG_IsTag(p_block->p_buffer, false))
11
{
12
size_t i_size = ID3TAG_Parse( p_block->p_buffer, p_block->i_buffer,
13
ID3TAG_Parse_Handler, static_cast<void *>(this) );
14
+ if(i_size >= p_block->i_buffer || i_size == 0)
15
+ break;
16
/* Skip ID3 for demuxer */
17
p_block->p_buffer += i_size;
18
p_block->i_buffer -= i_size;
19
- if( i_size == 0 )
20
- break;
21
}
22
}
23
24
if( b_meta_updated )
25
{
26
b_meta_updated = false;
27
- AbstractCommand *command = fakeEsOut()->commandsQueue()->factory()->createEsOutMetaCommand( fakeesout, -1, p_meta );
28
+ AbstractCommand *command = fakeEsOut()->commandsFactory()->createEsOutMetaCommand( fakeesout, -1, p_meta );
29
if( command )
30
fakeEsOut()->commandsQueue()->Schedule( command );
31
}
32
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/hls/playlist/HLSRepresentation.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/hls/playlist/HLSRepresentation.cpp
Changed
19
1
2
return 1;
3
4
const Timescale timescale = inheritTimescale();
5
- const vlc_tick_t utcTime = fromHlsSeg->getUTCTime() +
6
+ const vlc_tick_t utcTime = fromHlsSeg->getDisplayTime() +
7
timescale.ToTime(fromHlsSeg->duration.Get()) / 2;
8
9
const std::vector<Segment *> &list = inheritSegmentList()->getSegments();
10
11
const HLSSegment *hlsSeg = dynamic_cast<HLSSegment *>(*it);
12
if(hlsSeg)
13
{
14
- if (hlsSeg->getUTCTime() <= utcTime || it == list.begin())
15
+ if (hlsSeg->getDisplayTime() <= utcTime || it == list.begin())
16
num = hlsSeg->getSequenceNumber();
17
else
18
return num;
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/hls/playlist/Parser.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/hls/playlist/Parser.cpp
Changed
56
1
2
CommonEncryption encryption;
3
const ValuesListTag *ctx_extinf = nullptr;
4
5
+ std::list<HLSSegment *> segmentstoappend;
6
+
7
std::list<Tag *>::const_iterator it;
8
for(it = tagslist.begin(); it != tagslist.end(); ++it)
9
{
10
11
totalduration += nzDuration;
12
if(absReferenceTime != VLC_TICK_INVALID)
13
{
14
- segment->utcTime = absReferenceTime;
15
+ segment->setDisplayTime(absReferenceTime);
16
absReferenceTime += nzDuration;
17
}
18
19
- segmentList->addSegment(segment);
20
+ segmentstoappend.push_back(segment);
21
22
if(ctx_byterange)
23
{
24
25
rep->b_consistent = false;
26
absReferenceTime = VLC_TICK_0 +
27
UTCTime(static_cast<const SingleValueTag *>(tag)->getValue().value).mtime();
28
+ /* Reverse apply UTC timespec from first discont */
29
+ if(segmentstoappend.size() && segmentstoappend.back()->getDisplayTime() == VLC_TICK_INVALID)
30
+ {
31
+ vlc_tick_t tempTime = absReferenceTime;
32
+ for(auto it = segmentstoappend.crbegin(); it != segmentstoappend.crend(); ++it)
33
+ {
34
+ vlc_tick_t duration = timescale.ToTime((*it)->duration.Get());
35
+ if( duration < tempTime - VLC_TICK_0 )
36
+ tempTime -= duration;
37
+ else
38
+ tempTime = VLC_TICK_0;
39
+ (*it)->setDisplayTime(tempTime);
40
+ }
41
+ }
42
break;
43
44
case AttributesTag::EXTXKEY:
45
46
}
47
}
48
49
+ for(HLSSegment *seg : segmentstoappend)
50
+ segmentList->addSegment(seg);
51
+ segmentstoappend.clear();
52
+
53
if(rep->isLive())
54
{
55
rep->getPlaylist()->duration.Set(0);
56
vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/json/.gitignore
Added
5
1
2
+grammar.c
3
+grammar.h
4
+lexicon.c
5
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/ogg.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/ogg.c
Changed
10
1
2
if( p_old_stream &&
3
p_old_stream->fmt.i_cat == p_stream->fmt.i_cat &&
4
p_old_stream->fmt.i_codec == p_stream->fmt.i_codec &&
5
- p_old_stream->p_es != NULL && p_stream->p_es != NULL )
6
+ p_old_stream->p_es != NULL )
7
{
8
msg_Dbg( p_demux, "will reuse old stream to avoid glitch" );
9
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/smooth/playlist/ForgedInitSegment.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/smooth/playlist/ForgedInitSegment.cpp
Changed
10
1
2
block_t *moov = buildMoovBox(lvl->getCodecParameters());
3
if(moov)
4
{
5
- MemoryChunkSource *source = new (std::nothrow) MemoryChunkSource(moov);
6
+ MemoryChunkSource *source = new (std::nothrow) MemoryChunkSource(ChunkType::Init, moov);
7
if( source )
8
{
9
SegmentChunk *chunk = new (std::nothrow) SegmentChunk(source, rep);
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/smooth/playlist/Manifest.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/smooth/playlist/Manifest.cpp
Changed
9
1
2
3
#include <vlc_common.h>
4
5
+using namespace adaptive;
6
using namespace smooth::playlist;
7
8
Manifest::Manifest (vlc_object_t *p_object) :
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/smooth/playlist/MemoryChunk.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/smooth/playlist/MemoryChunk.cpp
Changed
11
1
2
3
using namespace smooth::http;
4
5
-MemoryChunkSource::MemoryChunkSource(block_t *block)
6
+MemoryChunkSource::MemoryChunkSource(ChunkType t, block_t *block)
7
+ : AbstractChunkSource(t)
8
{
9
data = block;
10
i_read = 0;
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/demux/smooth/playlist/MemoryChunk.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/demux/smooth/playlist/MemoryChunk.hpp
Changed
10
1
2
class MemoryChunkSource : public AbstractChunkSource
3
{
4
public:
5
- MemoryChunkSource(block_t *);
6
+ MemoryChunkSource(ChunkType, block_t *);
7
virtual ~MemoryChunkSource();
8
9
virtual block_t * readBlock() override;
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/UI/MainMenu.xib -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/UI/MainMenu.xib
Changed
10
1
2
<action selector="showAbout:" target="-2" id="nAj-Kc-NFC"/>
3
</connections>
4
</menuItem>
5
- <menuItem title="Check For Update..." id="2457"/>
6
+ <menuItem title="Check for Updates..." id="2457"/>
7
<menuItem isSeparatorItem="YES" id="2402">
8
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
9
</menuItem>
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/extensions/NSString+Helpers.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/extensions/NSString+Helpers.h
Changed
21
1
2
3
#define _NS(s) ((s) ? toNSStr(vlc_gettext(s)) : @"")
4
5
-/* Get an alternate version of the string.
6
- * This string is stored as '1:string' but when displayed it only displays
7
- * the translated string. the translation should be '1:translatedstring' though */
8
-#define _ANS(s) [((s) ? toNSStr(vlc_gettext(s)) : @"") substringFromIndex:2]
9
+/**
10
+ * Get a contextualized translation string
11
+ *
12
+ * Sometimes a translations needs to be unique to a specific context
13
+ * even though it has the same ID (text) as a different translation.
14
+ * In this case, this macro should be used with a unique translation
15
+ * context as the first argument.
16
+ */
17
+#define _PNS(c, s) (toNSStr(vlc_pgettext(c, s)))
18
19
extern NSString *const kVLCMediaAudioCD;
20
extern NSString *const kVLCMediaDVD;
21
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/menus/VLCMainMenu.m -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/menus/VLCMainMenu.m
Changed
22
1
2
- (void)initStrings
3
{
4
/* main menu */
5
- [_about setTitle: [_NS("About VLC media player") stringByAppendingString: @"..."]];
6
- [_checkForUpdate setTitle: _NS("Check for Update...")];
7
+ [_about setTitle: _NS("About VLC media player...")];
8
+ [_checkForUpdate setTitle: _NS("Check for Updates...")];
9
[_prefs setTitle: _NS("Preferences...")];
10
[_extensions setTitle: _NS("Extensions")];
11
[_extensionsMenu setTitle: _NS("Extensions")];
12
13
/* this special case is needed to due to archiac legacy translations of the File menu
14
* on the Mac to the German translation which resulted in 'Ablage' instead of 'Datei'.
15
* This remains until the present day and does not affect the Windows world. */
16
- [_fileMenu setTitle: _ANS("1:File")];
17
+ /* xgettext: Label for the macOS main "File" menu */
18
+ [_fileMenu setTitle: _PNS("macOS MainMenu", "File")];
19
[_open_generic setTitle: _NS("Advanced Open File...")];
20
[_open_file setTitle: _NS("Open File...")];
21
[_open_disc setTitle: _NS("Open Disc...")];
22
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/views/VLCTimeField.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/views/VLCTimeField.h
Changed
20
1
2
* VLCTimeField.h: NSTextField subclass for playback time fields
3
*****************************************************************************
4
* Copyright (C) 2003-2017 VLC authors and VideoLAN
5
+ * $Id$
6
*
7
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8
* Felix Paul Kühne <fkuehne at videolan dot org>
9
10
11
@interface VLCTimeField : NSTextField
12
13
-@property (readonly) BOOL timeRemaining;
14
-
15
-- (void)setRemainingIdentifier:(NSString *)o_string;
16
+- (void)setRemainingIdentifier:(NSString *)identifier;
17
+- (void)setTime:(NSString *)time withRemainingTime:(NSString *)remainingTime;
18
19
@end
20
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/views/VLCTimeField.m -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/views/VLCTimeField.m
Changed
100
1
2
* VLCTimeField.m: NSTextField subclass for playback time fields
3
*****************************************************************************
4
* Copyright (C) 2003-2017 VLC authors and VideoLAN
5
+ * $Id$
6
*
7
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8
* Felix Paul Kühne <fkuehne at videolan dot org>
9
10
11
@interface VLCTimeField ()
12
{
13
- NSString *o_remaining_identifier;
14
- BOOL b_time_remaining;
15
+ NSString *_identifier;
16
+ BOOL _isTimeRemaining;
17
+
18
+ NSString *_cachedTime;
19
+ NSString *_remainingTime;
20
}
21
@end
22
23
24
}
25
26
27
-- (void)setRemainingIdentifier:(NSString *)o_string
28
+- (void)setRemainingIdentifier:(NSString *)identifier
29
{
30
- o_remaining_identifier = o_string;
31
- b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
32
+ _identifier = identifier;
33
+ _isTimeRemaining = [[NSUserDefaults standardUserDefaults] boolForKey:_identifier];
34
}
35
36
- (void)mouseDown: (NSEvent *)ourEvent
37
38
[[[VLCMain sharedInstance] mainMenu] goToSpecificTime: nil];
39
else
40
{
41
- if (o_remaining_identifier) {
42
- b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
43
- b_time_remaining = !b_time_remaining;
44
- [[NSUserDefaults standardUserDefaults] setObject:(b_time_remaining ? @"YES" : @"NO") forKey:o_remaining_identifier];
45
+ if (_identifier) {
46
+ _isTimeRemaining = [[NSUserDefaults standardUserDefaults] boolForKey:_identifier];
47
+ _isTimeRemaining = !_isTimeRemaining;
48
+ [[NSUserDefaults standardUserDefaults] setObject:(_isTimeRemaining ? @"YES" : @"NO") forKey:_identifier];
49
} else {
50
- b_time_remaining = !b_time_remaining;
51
+ _isTimeRemaining = !_isTimeRemaining;
52
}
53
+
54
+ [self updateTimeValue];
55
}
56
57
[[self nextResponder] mouseDown:ourEvent];
58
}
59
60
+- (void)setTime:(NSString *)time withRemainingTime:(NSString *)remainingTime
61
+{
62
+ _cachedTime = time;
63
+ _remainingTime = remainingTime;
64
+
65
+ [self updateTimeValue];
66
+}
67
+
68
+- (void)updateTimeValue
69
+{
70
+ if (!_cachedTime || !_remainingTime)
71
+ return;
72
+
73
+ if ([self timeRemaining]) {
74
+ [super setStringValue:_remainingTime];
75
+ } else {
76
+ [super setStringValue:_cachedTime];
77
+ }
78
+}
79
+
80
+- (void)setStringValue:(NSString *)stringValue
81
+{
82
+ [super setStringValue:stringValue];
83
+
84
+ _cachedTime = nil;
85
+ _remainingTime = nil;
86
+}
87
+
88
- (BOOL)timeRemaining
89
{
90
- if (o_remaining_identifier)
91
- return [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
92
+ if (_identifier)
93
+ return [[NSUserDefaults standardUserDefaults] boolForKey:_identifier];
94
else
95
- return b_time_remaining;
96
+ return _isTimeRemaining;
97
}
98
99
@end
100
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
Changed
19
1
2
[self.timeSlider setEnabled:_playerController.seekable];
3
}
4
5
- NSString *time = [NSString stringWithDuration:duration
6
- currentTime:_playerController.time
7
- negative:self.timeField.timeRemaining];
8
- [self.timeField setStringValue:time];
9
+ NSString *timeString = [NSString stringWithDuration:duration
10
+ currentTime:_playerController.time
11
+ negative:NO];
12
+ NSString *remainingTime = [NSString stringWithDuration:duration
13
+ currentTime:_playerController.time
14
+ negative:YES];
15
+ [self.timeField setTime:timeString withRemainingTime:remainingTime];
16
[self.timeField setNeedsDisplay:YES];
17
}
18
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/macosx/windows/video/VLCFSPanelController.m -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/macosx/windows/video/VLCFSPanelController.m
Changed
15
1
2
/* Update total duration (right field) */
3
NSString *timeString = [NSString stringWithDuration:duration
4
currentTime:time
5
- negative:_remainingOrTotalTime.timeRemaining];
6
- [_remainingOrTotalTime setStringValue:timeString];
7
+ negative:NO];
8
+ NSString *remainingTime = [NSString stringWithDuration:duration
9
+ currentTime:time
10
+ negative:YES];
11
+ [_remainingOrTotalTime setTime:timeString withRemainingTime:remainingTime];
12
[_remainingOrTotalTime setNeedsDisplay:YES];
13
[_remainingOrTotalTime setHidden:duration <= 0];
14
15
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/.gitignore
Added
4
1
2
+resources.cpp
3
+ui/*.h
4
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/Makefile.am -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/Makefile.am
Changed
156
1
2
gui/qt/dialogs/sout/sout.cpp gui/qt/dialogs/sout/sout.hpp \
3
gui/qt/dialogs/sout/sout_widgets.cpp \
4
gui/qt/dialogs/sout/sout_widgets.hpp \
5
- gui/qt/dialogs/toolbar/toolbareditor.cpp gui/qt/dialogs/toolbar/toolbareditor.hpp \
6
+ gui/qt/dialogs/toolbar/controlbar_profile.hpp \
7
+ gui/qt/dialogs/toolbar/controlbar_profile.cpp \
8
+ gui/qt/dialogs/toolbar/controlbar_profile_model.cpp \
9
+ gui/qt/dialogs/toolbar/controlbar_profile_model.hpp \
10
gui/qt/dialogs/vlm/vlm.cpp gui/qt/dialogs/vlm/vlm.hpp \
11
gui/qt/dialogs/playlists/playlists.cpp gui/qt/dialogs/playlists/playlists.hpp \
12
gui/qt/maininterface/compositor.hpp \
13
14
gui/qt/medialibrary/mlgenre.hpp \
15
gui/qt/medialibrary/mlgenremodel.cpp \
16
gui/qt/medialibrary/mlgenremodel.hpp \
17
+ gui/qt/medialibrary/mlgroup.cpp \
18
+ gui/qt/medialibrary/mlgroup.hpp \
19
+ gui/qt/medialibrary/mlgrouplistmodel.cpp \
20
+ gui/qt/medialibrary/mlgrouplistmodel.hpp \
21
gui/qt/medialibrary/mlhelper.cpp \
22
gui/qt/medialibrary/mlhelper.hpp \
23
gui/qt/medialibrary/mlqmltypes.hpp \
24
25
gui/qt/network/servicesdiscoverymodel.hpp \
26
gui/qt/player/input_models.cpp gui/qt/player/input_models.hpp \
27
gui/qt/player/player_controller.cpp gui/qt/player/player_controller.hpp gui/qt/player/player_controller_p.hpp \
28
- gui/qt/player/playercontrolbarmodel.cpp gui/qt/player/playercontrolbarmodel.hpp \
29
+ gui/qt/player/player_controlbar_model.cpp gui/qt/player/player_controlbar_model.hpp \
30
+ gui/qt/player/control_list_model.cpp gui/qt/player/control_list_model.hpp \
31
gui/qt/playlist/media.hpp \
32
gui/qt/playlist/playlist_common.cpp \
33
gui/qt/playlist/playlist_common.hpp \
34
35
gui/qt/widgets/native/interface_widgets.hpp \
36
gui/qt/widgets/native/qvlcframe.cpp \
37
gui/qt/widgets/native/qvlcframe.hpp \
38
+ gui/qt/widgets/native/roundimage.cpp gui/qt/widgets/native/roundimage.hpp \
39
gui/qt/widgets/native/searchlineedit.cpp gui/qt/widgets/native/searchlineedit.hpp
40
if HAVE_WIN32
41
libqt_plugin_la_SOURCES += \
42
43
gui/qt/dialogs/sout/profile_selector.moc.cpp \
44
gui/qt/dialogs/sout/sout.moc.cpp \
45
gui/qt/dialogs/sout/sout_widgets.moc.cpp \
46
- gui/qt/dialogs/toolbar/toolbareditor.moc.cpp \
47
+ gui/qt/dialogs/toolbar/controlbar_profile.moc.cpp \
48
+ gui/qt/dialogs/toolbar/controlbar_profile_model.moc.cpp \
49
gui/qt/dialogs/playlists/playlists.moc.cpp \
50
gui/qt/maininterface/compositor_dummy.moc.cpp \
51
gui/qt/maininterface/interface_window_handler.moc.cpp \
52
53
gui/qt/medialibrary/mlfoldersmodel.moc.cpp \
54
gui/qt/medialibrary/mlgenre.moc.cpp \
55
gui/qt/medialibrary/mlgenremodel.moc.cpp \
56
+ gui/qt/medialibrary/mlgroup.moc.cpp \
57
+ gui/qt/medialibrary/mlgrouplistmodel.moc.cpp \
58
gui/qt/medialibrary/mlqmltypes.moc.cpp \
59
gui/qt/medialibrary/mlrecentsmodel.moc.cpp \
60
gui/qt/medialibrary/mlrecentsvideomodel.moc.cpp \
61
62
gui/qt/network/servicesdiscoverymodel.moc.cpp \
63
gui/qt/player/input_models.moc.cpp \
64
gui/qt/player/player_controller.moc.cpp \
65
- gui/qt/player/playercontrolbarmodel.moc.cpp \
66
+ gui/qt/player/player_controlbar_model.moc.cpp \
67
+ gui/qt/player/control_list_model.moc.cpp \
68
gui/qt/playlist/playlist_common.moc.cpp \
69
gui/qt/playlist/playlist_controller.moc.cpp \
70
gui/qt/playlist/playlist_item.moc.cpp \
71
72
gui/qt/widgets/native/animators.moc.cpp \
73
gui/qt/widgets/native/customwidgets.moc.cpp \
74
gui/qt/widgets/native/interface_widgets.moc.cpp \
75
+ gui/qt/widgets/native/roundimage.moc.cpp \
76
gui/qt/widgets/native/searchlineedit.moc.cpp
77
78
if HAVE_WIN32
79
80
gui/qt/dialogs/dialogs/qml/CustomDialog.qml \
81
gui/qt/dialogs/dialogs/qml/Dialogs.qml \
82
gui/qt/dialogs/dialogs/qml/ModalDialog.qml \
83
+ gui/qt/dialogs/dialogs/qml/WindowDialog.qml \
84
gui/qt/dialogs/help/qml/About.qml \
85
gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml \
86
gui/qt/dialogs/toolbar/qml/EditorDNDView.qml\
87
gui/qt/dialogs/toolbar/qml/EditorDummyButton.qml \
88
gui/qt/dialogs/toolbar/qml/EditorTabButton.qml \
89
gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml \
90
+ gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml \
91
gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml \
92
gui/qt/maininterface/qml/BannerSources.qml \
93
gui/qt/maininterface/qml/MainInterface.qml \
94
95
gui/qt/medialibrary/qml/ArtistTopBanner.qml \
96
gui/qt/medialibrary/qml/AudioGridItem.qml \
97
gui/qt/medialibrary/qml/EmptyLabel.qml \
98
+ gui/qt/medialibrary/qml/MediaGroupDisplay.qml \
99
+ gui/qt/medialibrary/qml/MediaGroupList.qml \
100
gui/qt/medialibrary/qml/MusicAlbums.qml \
101
gui/qt/medialibrary/qml/MusicAlbumsDisplay.qml \
102
gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml \
103
104
gui/qt/medialibrary/qml/VideoDisplay.qml \
105
gui/qt/medialibrary/qml/VideoAll.qml \
106
gui/qt/medialibrary/qml/VideoAllDisplay.qml \
107
+ gui/qt/medialibrary/qml/VideoGroupsDisplay.qml \
108
gui/qt/medialibrary/qml/PlaylistMediaList.qml \
109
gui/qt/medialibrary/qml/PlaylistMedia.qml \
110
gui/qt/medialibrary/qml/PlaylistMediaDelegate.qml \
111
112
gui/qt/player/qml/ControlBar.qml \
113
gui/qt/player/qml/ControlButtons.qml \
114
gui/qt/player/qml/LanguageMenu.qml \
115
+ gui/qt/player/qml/PlaybackSpeed.qml \
116
gui/qt/player/qml/MiniPlayer.qml \
117
gui/qt/player/qml/PIPPlayer.qml \
118
gui/qt/player/qml/Player.qml \
119
120
gui/qt/style/VLCIcons.qml \
121
gui/qt/style/VLCStyle.qml \
122
gui/qt/style/qmldir \
123
+ gui/qt/util/qml/Helpers.js \
124
gui/qt/util/qml/KeyHelper.js \
125
gui/qt/util/qml/SelectableDelegateModel.qml \
126
gui/qt/widgets/qml/BannerTabButton.qml \
127
128
gui/qt/widgets/qml/ExpandGridView.qml \
129
gui/qt/widgets/qml/FocusBackground.qml \
130
gui/qt/widgets/qml/GridItem.qml \
131
+ gui/qt/widgets/qml/GridShadows.qml \
132
gui/qt/widgets/qml/HorizontalResizeHandle.qml \
133
gui/qt/widgets/qml/IconLabel.qml \
134
gui/qt/widgets/qml/IconButton.qml \
135
136
gui/qt/widgets/qml/NavigableRow.qml \
137
gui/qt/widgets/qml/PlayCover.qml \
138
gui/qt/widgets/qml/RoundButton.qml \
139
- gui/qt/widgets/qml/RoundImage.qml \
140
gui/qt/widgets/qml/ScanProgressBar.qml \
141
gui/qt/widgets/qml/ScrollingText.qml \
142
gui/qt/widgets/qml/SearchBox.qml \
143
+ gui/qt/widgets/qml/ShadowCoverGenerator.qml \
144
gui/qt/widgets/qml/SortControl.qml \
145
gui/qt/widgets/qml/SpinBoxExt.qml \
146
gui/qt/widgets/qml/StackViewExt.qml \
147
148
gui/qt/widgets/qml/TextToolButton.qml \
149
gui/qt/widgets/qml/ToolTipArea.qml \
150
gui/qt/widgets/qml/VideoProgressBar.qml \
151
- gui/qt/widgets/qml/VideoQualityLabel.qml \
152
+ gui/qt/widgets/qml/VideoQualityLabels.qml \
153
gui/qt/widgets/qml/ListSubtitleLabel.qml \
154
gui/qt/widgets/qml/PointingTooltip.qml \
155
gui/qt/widgets/qml/FrostedGlassEffect.qml \
156
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/.gitignore
Added
23
1
2
+extended/ui_equalizer.h
3
+extended/ui_video_effects.h
4
+fingerprint/ui_fingerprintdialog.h
5
+help/ui_about.h
6
+help/ui_update.h
7
+open/ui_open.h
8
+open/ui_open_capture.h
9
+open/ui_open_disk.h
10
+open/ui_open_file.h
11
+open/ui_open_net.h
12
+podcast/ui_podcast_configuration.h
13
+messages/ui_messages_panel.h
14
+preferences/ui_sprefs_audio.h
15
+preferences/ui_sprefs_input.h
16
+preferences/ui_sprefs_interface.h
17
+preferences/ui_sprefs_medialibrary.h
18
+preferences/ui_sprefs_subtitles.h
19
+preferences/ui_sprefs_video.h
20
+sout/ui_profiles.h
21
+sout/ui_sout.h
22
+vlm/ui_vlm.h
23
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml
Changed
29
1
2
rootWindow: root.bgContent
3
onAboutToHide: restoreFocus()
4
}
5
+
6
+ Loader {
7
+ id: toolbarEditorDialogLoader
8
+ active: false
9
+ source: "qrc:///dialogs/ToolbarEditorDialog.qml"
10
+
11
+ Connections {
12
+ target: toolbarEditorDialogLoader.item
13
+
14
+ onUnload: {
15
+ toolbarEditorDialogLoader.active = false
16
+ }
17
+ }
18
+
19
+ Connections {
20
+ target: dialogProvider
21
+
22
+ onShowToolbarEditorDialog: {
23
+ toolbarEditorDialogLoader.active = true
24
+ toolbarEditorDialogLoader.item.open()
25
+ }
26
+ }
27
+ }
28
}
29
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml
Added
103
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+import QtQuick 2.11
21
+import QtQuick.Window 2.11
22
+import QtQuick.Layouts 1.11
23
+import QtQuick.Controls 2.4
24
+
25
+import "qrc:///widgets/" as Widgets
26
+import "qrc:///style/"
27
+
28
+Window {
29
+ id: root
30
+
31
+ flags: Qt.Dialog
32
+
33
+ property bool modal: false
34
+ modality: modal ? Qt.ApplicationModal : Qt.NonModal
35
+
36
+ width: VLCStyle.appWidth * 0.75
37
+ height: VLCStyle.appHeight * 0.85
38
+
39
+ title: i18n.qtr("Dialog")
40
+ color: VLCStyle.colors.bg
41
+
42
+ property alias contentComponent: loader.sourceComponent
43
+ property alias standardButtons: buttonBox.standardButtons
44
+
45
+ signal accepted()
46
+ signal rejected(bool byButton)
47
+ signal applied()
48
+ signal discarded()
49
+ signal reset()
50
+
51
+ onAccepted: hide()
52
+ onRejected: if (byButton) hide()
53
+ onApplied: hide()
54
+ onDiscarded: hide()
55
+ onReset: hide()
56
+
57
+ onClosing: {
58
+ rejected(false)
59
+ }
60
+
61
+ function open() {
62
+ show()
63
+ }
64
+
65
+ ColumnLayout {
66
+ anchors.fill: parent
67
+ anchors.margins: VLCStyle.margin_small
68
+
69
+ Loader {
70
+ id: loader
71
+ Layout.fillHeight: true
72
+ Layout.fillWidth: true
73
+
74
+ clip: true
75
+ sourceComponent: contentComponent
76
+ }
77
+
78
+ DialogButtonBox {
79
+ id: buttonBox
80
+
81
+ bottomPadding: 0
82
+ topPadding: 0
83
+ padding: VLCStyle.margin_small
84
+ spacing: VLCStyle.margin_small
85
+
86
+ Layout.fillWidth: true
87
+ Layout.minimumHeight: VLCStyle.icon_normal
88
+
89
+ standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel
90
+
91
+ onAccepted: root.accepted()
92
+ onRejected: root.rejected(true)
93
+ onApplied: root.applied()
94
+ onDiscarded: root.discarded()
95
+ onReset: root.reset()
96
+
97
+ // Customize DialogButtonBox so that it matches with the app theme
98
+ background: Item { }
99
+ delegate: Widgets.TextToolButton { }
100
+ }
101
+ }
102
+}
103
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/dialogs_provider.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/dialogs_provider.cpp
Changed
105
1
2
#include "dialogs/help/help.hpp"
3
#include "dialogs/gototime/gototime.hpp"
4
#include "dialogs/podcast/podcast_configuration.hpp"
5
-#include "dialogs/toolbar/toolbareditor.hpp"
6
#include "dialogs/plugins/plugins.hpp"
7
#include "dialogs/epg/epg.hpp"
8
#include "dialogs/errors/errors.hpp"
9
10
#include <QSignalMapper>
11
#include <QFileDialog>
12
#include <QUrl>
13
+#include <QInputDialog>
14
15
#define I_OP_DIR_WINTITLE I_DIR_OR_FOLDER( N_("Open Directory"), \
16
N_("Open Folder") )
17
18
return QFileDialog::getSaveFileUrl( parent, caption, dir, filter, selectedFilter, QFileDialog::Options(), schemes).toLocalFile();
19
}
20
21
+QVariant DialogsProvider::getTextDialog(QWidget *parent,
22
+ const QString &title,
23
+ const QString &label,
24
+ const QString &placeholder,
25
+ bool *ok)
26
+{
27
+ bool _ok = false;
28
+ QString ret = QInputDialog::getText(parent,
29
+ title,
30
+ label,
31
+ QLineEdit::Normal,
32
+ placeholder,
33
+ ok ? ok : &_ok);
34
+
35
+ if (!ok)
36
+ {
37
+ // When this function is called from the QML side, instead of setting `ok` parameter
38
+ // a QVariantMap with key `ok` and `text` is returned instead
39
+
40
+ QVariantMap map;
41
+ map["text"] = ret;
42
+ map["ok"] = _ok;
43
+ return map;
44
+ }
45
+ else
46
+ {
47
+ return ret;
48
+ }
49
+}
50
+
51
void DialogsProvider::quit()
52
{
53
b_isDying = true;
54
55
PodcastConfigDialog::getInstance( p_intf )->toggleVisible();
56
}
57
58
-void DialogsProvider::toolbarDialog()
59
-{
60
- ToolbarEditorDialog *toolbarEditor = new ToolbarEditorDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf);
61
- if( toolbarEditor->exec() == QDialog::Accepted )
62
- emit toolBarConfUpdated();
63
- delete toolbarEditor;
64
-}
65
-
66
void DialogsProvider::pluginDialog()
67
{
68
PluginDialog::getInstance( p_intf )->toggleVisible();
69
70
fileTypes.chop(2); //remove trailling ";;"
71
72
QList<QUrl> urls = QFileDialog::getOpenFileUrls( NULL,
73
- help.isEmpty() ? qtr(I_OP_SEL_FILES ) : help,
74
+ help.isEmpty() ? qfut(I_OP_SEL_FILES ) : help,
75
path.isEmpty() ? p_intf->p_sys->filepath : path,
76
fileTypes );
77
78
79
{
80
const QStringList schemes = QStringList(QStringLiteral("file"));
81
QUrl dirurl = QFileDialog::getExistingDirectoryUrl( NULL,
82
- qtr( I_OP_DIR_WINTITLE ), p_intf->p_sys->filepath,
83
+ qfut( I_OP_DIR_WINTITLE ), p_intf->p_sys->filepath,
84
QFileDialog::ShowDirsOnly, schemes );
85
86
if( dirurl.isEmpty() ) return QString();
87
88
89
for( size_t i = 0; i < sizeof (types) / sizeof (types[0]); i++ )
90
{
91
- QString tmp = qfu( vlc_gettext( types[i].filter_name ) ) + " (*." + types[i].filter_patterns + ")";
92
+ QString tmp = qfut( types[i].filter_name ) + " (*." + types[i].filter_patterns + ")";
93
if( ext == qfu( types[i].filter_patterns ) )
94
filters.insert( 0, tmp );
95
else
96
97
{
98
for( size_t i = 0; i < sizeof (types) / sizeof (types[0]); i++)
99
{
100
- if ( selected.startsWith( qfu( vlc_gettext( types[i].filter_name ) ) ) )
101
+ if ( selected.startsWith( qfut( types[i].filter_name ) ) )
102
{
103
psz_selected_module = types[i].module;
104
psz_last_playlist_ext = types[i].filter_patterns;
105
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/dialogs_provider.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/dialogs_provider.hpp
Changed
39
1
2
#define TITLE_EXTENSIONS_MEDIA qtr( "Media Files" )
3
#define TITLE_EXTENSIONS_VIDEO qtr( "Video Files" )
4
#define TITLE_EXTENSIONS_AUDIO qtr( "Audio Files" )
5
+#define TITLE_EXTENSIONS_IMAGE qtr( "Image Files" )
6
#define TITLE_EXTENSIONS_PLAYLIST qtr( "Playlist Files" )
7
#define TITLE_EXTENSIONS_SUBTITLE qtr( "Subtitle Files" )
8
#define TITLE_EXTENSIONS_ALL qtr( "All Files" )
9
10
const QString &filter = QString(),
11
QString *selectedFilter = NULL );
12
13
+ Q_INVOKABLE static QVariant getTextDialog(QWidget *parent, const QString& title,
14
+ const QString& label,
15
+ const QString& placeholder,
16
+ bool* ok = nullptr);
17
+
18
protected:
19
void customEvent( QEvent *);
20
21
22
void aboutDialog();
23
void gotoTimeDialog();
24
void podcastConfigureDialog();
25
- void toolbarDialog();
26
void pluginDialog();
27
void epgDialog();
28
void setPopupMenu();
29
30
void quit();
31
32
signals:
33
- void toolBarConfUpdated();
34
void releaseMouseEvents();
35
+ void showToolbarEditorDialog();
36
};
37
38
class DialogEvent : public QEvent
39
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/extended/extended_panels.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/extended/extended_panels.cpp
Changed
55
1
2
{
3
const QStringList schemes = QStringList(QStringLiteral("file"));
4
QString filter = QString( "%1 (*.png *.jpg);;%2 (*)" )
5
- .arg( qtr("Image Files") )
6
+ .arg( TITLE_EXTENSIONS_IMAGE )
7
.arg( TITLE_EXTENSIONS_ALL );
8
QString file = QFileDialog::getOpenFileUrl( NULL, qtr( "Logo filenames" ),
9
p_intf->p_sys->filepath, filter,
10
11
{
12
const QStringList schemes = QStringList(QStringLiteral("file"));
13
QString filter = QString( "%1 (*.png *.jpg);;%2 (*)" )
14
- .arg( qtr("Image Files") )
15
+ .arg( TITLE_EXTENSIONS_IMAGE )
16
.arg( TITLE_EXTENSIONS_ALL );
17
QString file = QFileDialog::getOpenFileUrl( NULL, qtr( "Image mask" ),
18
p_intf->p_sys->filepath, filter,
19
20
ssize_t count = config_GetIntChoices( qtu( option ), &values, &texts );
21
for( ssize_t i = 0; i < count; i++ )
22
{
23
- combobox->addItem( qtr( texts[i] ), qlonglong(values[i]) );
24
+ combobox->addItem( qfut( texts[i] ), qlonglong(values[i]) );
25
free( texts[i] );
26
}
27
free( texts );
28
29
ssize_t count = config_GetPszChoices( qtu( option ), &values, &texts );
30
for( ssize_t i = 0; i < count; i++ )
31
{
32
- combobox->addItem( qtr( texts[i] ), qfu(values[i]) );
33
+ combobox->addItem( qfut( texts[i] ), qfu(values[i]) );
34
free( texts[i] );
35
free( values[i] );
36
}
37
38
39
if( !var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &vartext ) )
40
{
41
- name = qtr(vartext);
42
+ name = qfut(vartext);
43
free(vartext);
44
}
45
else
46
47
palette().color( QPalette::WindowText ) );
48
scene.setSceneRect( 0.0, 0.0, eqz_preset_10b[i].i_band , 40.0 );
49
scene.render( &painter, icon.rect(), scene.sceneRect(), Qt::IgnoreAspectRatio );
50
- ui.presetsCombo->addItem( icon, qtr( preset_list_text[i] ),
51
+ ui.presetsCombo->addItem( icon, qfut( preset_list_text[i] ),
52
QVariant( preset_list[i] ) );
53
}
54
CONNECT( ui.presetsCombo, activated(int), this, setCorePreset(int) );
55
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/help/help.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/help/help.cpp
Changed
10
1
2
3
QTextBrowser *helpBrowser = new QTextBrowser( this );
4
helpBrowser->setOpenExternalLinks( true );
5
- helpBrowser->setHtml( qtr(I_LONGHELP) );
6
+ helpBrowser->setHtml( qfut(I_LONGHELP) );
7
8
QDialogButtonBox *closeButtonBox = new QDialogButtonBox( this );
9
closeButtonBox->addButton(
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/mediainfo/info_panels.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/mediainfo/info_panels.cpp
Changed
10
1
2
3
ADD_META( VLC_META_ENCODED_BY, encodedby_text, 0, 7 ); line++;
4
5
- label = new QLabel( qtr( N_("Comments") ) ); label->setFont( smallFont );
6
+ label = new QLabel( qtr( "Comments" ) ); label->setFont( smallFont );
7
label->setContentsMargins( 3, 2, 0, 0 );
8
metaLayout->addWidget( label, line++, 0, 1, 7 );
9
description_text = new QTextEdit;
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/open/open_panels.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/open/open_panels.cpp
Changed
57
1
2
/* State to avoid overwritting the users changes with the configuration */
3
m_discType = None;
4
5
- ui.browseDiscButton->setToolTip( qtr( I_DEVICE_TOOLTIP ));
6
- ui.deviceCombo->setToolTip( qtr(I_DEVICE_TOOLTIP) );
7
+ ui.browseDiscButton->setToolTip( qfut( I_DEVICE_TOOLTIP ));
8
+ ui.deviceCombo->setToolTip( qfut( I_DEVICE_TOOLTIP ) );
9
ui.deviceCombo->setInsertPolicy( QComboBox::InsertAtTop );
10
11
#if !defined( _WIN32 ) && !defined( __OS2__ )
12
13
{
14
const QStringList schemes = QStringList(QStringLiteral("file"));
15
QString dir = QFileDialog::getExistingDirectoryUrl( this,
16
- qtr( I_DEVICE_TOOLTIP ), p_intf->p_sys->filepath,
17
+ qfut( I_DEVICE_TOOLTIP ), p_intf->p_sys->filepath,
18
QFileDialog::ShowDirsOnly, schemes ).toLocalFile();
19
if( !dir.isEmpty() )
20
{
21
22
layout * name ## PropLayout = new layout; \
23
name ## DevPage->setLayout( name ## DevLayout ); \
24
name ## PropPage->setLayout( name ## PropLayout ); \
25
- ui.deviceCombo->addItem( qtr( label ), QVariant( number ) );
26
+ ui.deviceCombo->addItem( qfut( label ), QVariant( number ) );
27
28
#define CuMRL( widget, slot ) CONNECT( widget , slot , this, updateMRL() );
29
30
31
"video*"
32
};
33
if( module_exists( "v4l2" ) ){
34
- addModuleAndLayouts( V4L2_DEVICE, v4l2, "Video camera", QGridLayout );
35
+ addModuleAndLayouts( V4L2_DEVICE, v4l2, N_("Video camera"), QGridLayout );
36
37
/* V4L2 main panel */
38
QLabel *v4l2VideoDeviceLabel = new QLabel( qtr( "Video device name" ) );
39
40
* JACK *
41
*******/
42
if( module_exists( "jack" ) ){
43
- addModuleAndLayouts( JACK_DEVICE, jack, "JACK Audio Connection Kit",
44
+ addModuleAndLayouts( JACK_DEVICE, jack, N_("JACK Audio Connection Kit"),
45
QGridLayout);
46
47
/* Jack Main panel */
48
49
/**********
50
* Screen *
51
**********/
52
- addModuleAndLayouts( SCREEN_DEVICE, screen, "Desktop", QGridLayout );
53
+ addModuleAndLayouts( SCREEN_DEVICE, screen, N_("Desktop"), QGridLayout );
54
QLabel *screenLabel = new QLabel( qtr( "Your display will be "
55
"opened and played in order to stream or save it." ) );
56
screenLabel->setWordWrap( true );
57
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/preferences/complete_preferences.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/preferences/complete_preferences.cpp
Changed
52
1
2
PrefsItemData *module_data = new PrefsItemData( this );
3
module_data->i_type = PrefsItemData::TYPE_MODULE;
4
module_data->psz_shortcut = strdup( module_get_object( p_module ) );
5
- module_data->name = qtr( module_get_name( p_module, false ) );
6
+ module_data->name = qfut( module_get_name( p_module, false ) );
7
module_data->help.clear();
8
module_data->p_module = p_module;
9
const char *psz_help = module_get_help( p_module );
10
if ( psz_help )
11
- module_data->help = qtr( psz_help );
12
+ module_data->help = qfut( psz_help );
13
14
QTreeWidgetItem *module_item = new QTreeWidgetItem();
15
module_item->setText( 0, module_data->name );
16
17
}
18
else
19
{
20
- head = QString( qtr( module_GetLongName( p_module ) ) );
21
+ head = QString( qfut( module_GetLongName( p_module ) ) );
22
}
23
24
if (name.contains( text, cs ) || head.contains( text, cs ) || help.contains( text, cs ))
25
26
27
if( p_item->b_internal ) continue;
28
29
- if ( p_item->psz_text && qtr( p_item->psz_text ).contains( text, cs ) )
30
+ if ( p_item->psz_text && qfut( p_item->psz_text ).contains( text, cs ) )
31
{
32
module_config_free( p_config );
33
return true;
34
35
}
36
else
37
{
38
- head = QString( qtr( module_GetLongName( p_module ) ) );
39
+ head = QString( qfut( module_GetLongName( p_module ) ) );
40
}
41
42
QLabel *titleLabel = new QLabel( head );
43
44
i_line++;
45
}
46
i_boxline = 0;
47
- box = new QGroupBox( qtr( p_item->psz_text ), this );
48
+ box = new QGroupBox( qfut( p_item->psz_text ), this );
49
box->hide();
50
boxlayout = new QGridLayout();
51
}
52
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/preferences/preferences_widgets.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/preferences/preferences_widgets.cpp
Changed
201
1
2
bool pwd ) :
3
VStringConfigControl( _p_this, _p_item )
4
{
5
- label = new QLabel( p_item->psz_text ? qtr(p_item->psz_text) : "", _parent );
6
+ label = new QLabel( p_item->psz_text ? qfut(p_item->psz_text) : "", _parent );
7
text = new QLineEdit( p_item->value.psz ? qfu(p_item->value.psz) : "", _parent );
8
if( pwd ) text->setEchoMode( QLineEdit::Password );
9
finish();
10
11
text->setText( qfu(p_item->value.psz) );
12
if( p_item->psz_longtext )
13
{
14
- QString tipText = qtr(p_item->psz_longtext);
15
+ QString tipText = qfut(p_item->psz_longtext);
16
text->setToolTip( formatTooltip(tipText) );
17
if( label )
18
label->setToolTip( formatTooltip(tipText) );
19
20
module_config_t *_p_item, QWidget *p ) :
21
VStringConfigControl( _p_this, _p_item )
22
{
23
- label = new QLabel( qtr(p_item->psz_text), p );
24
+ label = new QLabel( qfut(p_item->psz_text), p );
25
text = new QLineEdit( qfu(p_item->value.psz), p );
26
browse = new QPushButton( qtr( "Browse..." ), p );
27
28
29
text->setText( qfu(p_item->value.psz) );
30
if( p_item->psz_longtext )
31
{
32
- QString tipText = qtr(p_item->psz_longtext);
33
+ QString tipText = qfut(p_item->psz_longtext);
34
text->setToolTip( formatTooltip(tipText) );
35
if( label )
36
label->setToolTip( formatTooltip(tipText) );
37
38
void DirectoryConfigControl::updateField()
39
{
40
QString dir = QFileDialog::getExistingDirectory( NULL,
41
- qtr( I_OP_SEL_DIR ),
42
+ qfut( I_OP_SEL_DIR ),
43
text->text().isEmpty() ?
44
QVLCUserDir( VLC_HOME_DIR ) : text->text(),
45
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks );
46
47
module_config_t *_p_item, QWidget *p ) :
48
VStringConfigControl( _p_this, _p_item )
49
{
50
- label = new QLabel( qtr(p_item->psz_text), p );
51
+ label = new QLabel( qfut(p_item->psz_text), p );
52
font = new QFontComboBox( p );
53
font->setCurrentFont( QFont( qfu( p_item->value.psz) ) );
54
55
if( p_item->psz_longtext )
56
{
57
- label->setToolTip( formatTooltip( qtr(p_item->psz_longtext) ) );
58
+ label->setToolTip( formatTooltip( qfut(p_item->psz_longtext) ) );
59
}
60
}
61
62
63
64
if( p_item->psz_longtext )
65
{
66
- label->setToolTip( formatTooltip( qtr(p_item->psz_longtext) ) );
67
+ label->setToolTip( formatTooltip( qfut(p_item->psz_longtext) ) );
68
}
69
}
70
71
72
module_config_t *_p_item, QWidget *p ) :
73
VStringConfigControl( _p_this, _p_item )
74
{
75
- label = new QLabel( qtr(p_item->psz_text), p );
76
+ label = new QLabel( qfut(p_item->psz_text), p );
77
combo = new QComboBox( p );
78
combo->setMinimumWidth( MINWIDTH_BOX );
79
combo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
80
81
82
if( p_module_config->psz_longtext )
83
{
84
- QString tipText = qtr(p_module_config->psz_longtext);
85
+ QString tipText = qfut(p_module_config->psz_longtext);
86
combo->setToolTip( formatTooltip(tipText) );
87
if( label )
88
label->setToolTip( formatTooltip(tipText) );
89
90
ssize_t count = config_GetPszChoices(configname, &values, &texts);
91
for( ssize_t i = 0; i < count; i++ )
92
{
93
- combo->addItem( qtr(texts[i]), QVariant(qfu(values[i])) );
94
+ combo->addItem( qfut(texts[i]), QVariant(qfu(values[i])) );
95
if( p_config->value.psz && !strcmp(p_config->value.psz, values[i]) )
96
combo->setCurrentIndex( i );
97
free( texts[i] );
98
99
ssize_t count = config_GetIntChoices(configname, &values, &texts);
100
for( ssize_t i = 0; i < count; i++ )
101
{
102
- combo->addItem( qtr(texts[i]), QVariant(qlonglong(values[i])) );
103
+ combo->addItem( qfut(texts[i]), QVariant(qlonglong(values[i])) );
104
if( p_config->value.i == values[i] )
105
combo->setCurrentIndex( i );
106
free( texts[i] );
107
108
module_config_t *_p_item, QWidget *p ) :
109
VStringConfigControl( _p_this, _p_item )
110
{
111
- label = new QLabel( qtr(p_item->psz_text), p );
112
+ label = new QLabel( qfut(p_item->psz_text), p );
113
combo = new QComboBox( p );
114
combo->setMinimumWidth( MINWIDTH_BOX );
115
finish( );
116
117
const module_config_t *p_cfg = p_config + i;
118
if( p_cfg->i_type == CONFIG_SUBCATEGORY &&
119
p_cfg->value.i == p_item->min.i )
120
- combo->addItem( qtr( module_GetLongName( p_parser )),
121
+ combo->addItem( qfut( module_GetLongName( p_parser )),
122
QVariant( module_get_object( p_parser ) ) );
123
if( p_item->value.psz && !strcmp( p_item->value.psz,
124
module_get_object( p_parser ) ) )
125
126
127
if( p_item->psz_longtext )
128
{
129
- QString tipText = qtr(p_item->psz_longtext);
130
+ QString tipText = qfut(p_item->psz_longtext);
131
combo->setToolTip( formatTooltip(tipText) );
132
if( label )
133
label->setToolTip( formatTooltip(tipText) );
134
135
/* Special Hack */
136
if( !p_item->psz_text ) return;
137
138
- groupBox = new QGroupBox ( qtr(p_item->psz_text), p );
139
+ groupBox = new QGroupBox ( qfut(p_item->psz_text), p );
140
text = new QLineEdit( p );
141
QGridLayout *layoutGroupBox = new QGridLayout( groupBox );
142
143
144
layoutGroupBox->addWidget( text, boxline, 0, 1, 2 );
145
146
if( p_item->psz_longtext )
147
- text->setToolTip( formatTooltip( qtr( p_item->psz_longtext) ) );
148
+ text->setToolTip( formatTooltip( qfut( p_item->psz_longtext) ) );
149
}
150
151
void ModuleListConfigControl::fillGrid( QGridLayout *l, int line )
152
153
void ModuleListConfigControl::checkbox_lists( module_t *p_parser )
154
{
155
const char *help = module_get_help( p_parser );
156
- checkbox_lists( qtr( module_GetLongName( p_parser ) ),
157
- help != NULL ? qtr( help ): "",
158
+ checkbox_lists( qfut( module_GetLongName( p_parser ) ),
159
+ help != NULL ? qfut( help ): "",
160
module_get_object( p_parser ) );
161
}
162
163
164
module_config_t *_p_item, QWidget *p ) :
165
VIntConfigControl( _p_this, _p_item )
166
{
167
- label = new QLabel( qtr(p_item->psz_text), p );
168
+ label = new QLabel( qfut(p_item->psz_text), p );
169
spin = new QSpinBox( p ); spin->setMinimumWidth( MINWIDTH_BOX );
170
spin->setAlignment( Qt::AlignRight );
171
spin->setMaximumWidth( MINWIDTH_BOX );
172
173
174
if( p_item->psz_longtext )
175
{
176
- QString tipText = qtr(p_item->psz_longtext);
177
+ QString tipText = qfut(p_item->psz_longtext);
178
spin->setToolTip( formatTooltip(tipText) );
179
if( label )
180
label->setToolTip( formatTooltip(tipText) );
181
182
slider->setValue( p_item->value.i );
183
if( p_item->psz_longtext )
184
{
185
- QString tipText = qtr(p_item->psz_longtext);
186
+ QString tipText = qfut(p_item->psz_longtext);
187
slider->setToolTip( formatTooltip(tipText) );
188
if( label )
189
label->setToolTip( formatTooltip(tipText) );
190
191
module_config_t *_p_item, QWidget *p, bool ) :
192
VIntConfigControl( _p_this, _p_item )
193
{
194
- label = new QLabel( qtr(p_item->psz_text), p );
195
+ label = new QLabel( qfut(p_item->psz_text), p );
196
combo = new QComboBox( p );
197
combo->setMinimumWidth( MINWIDTH_BOX );
198
199
200
&values, &texts );
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/preferences/simple_preferences.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
Changed
31
1
2
cone_audio_64, 1 );
3
ADD_CATEGORY( SPrefsVideo, qtr("Video"), qtr("Video Settings"),
4
cone_video_64, 2 );
5
- ADD_CATEGORY( SPrefsSubtitles, qtr(SUBPIC_TITLE), qtr("Subtitle & On Screen Display Settings"),
6
+ ADD_CATEGORY( SPrefsSubtitles, qfut(SUBPIC_TITLE), qtr("Subtitle & On Screen Display Settings"),
7
cone_subtitles_64, 3 );
8
- ADD_CATEGORY( SPrefsInputAndCodecs, qtr(INPUT_TITLE), qtr("Input & Codecs Settings"),
9
+ ADD_CATEGORY( SPrefsInputAndCodecs, qfut(INPUT_TITLE), qtr("Input & Codecs Settings"),
10
cone_input_64, 4 );
11
ADD_CATEGORY( SPrefsHotkeys, qtr("Hotkeys"), qtr("Configure Hotkeys"),
12
cone_hotkeys_64, 5 );
13
14
/* Caching */
15
/* Add the things to the ComboBox */
16
#define addToCachingBox( str, cachingNumber ) \
17
- ui.cachingCombo->addItem( qtr(str), QVariant( cachingNumber ) );
18
+ ui.cachingCombo->addItem( qfut(str), QVariant( cachingNumber ) );
19
addToCachingBox( N_("Custom"), CachingCustom );
20
addToCachingBox( N_("Lowest latency"), CachingLowest );
21
addToCachingBox( N_("Low latency"), CachingLow );
22
23
ui.skinsLabel->setText(
24
qtr( "This is VLC's skinnable interface. You can download other skins at" )
25
+ QString( " <a href=\"http://www.videolan.org/vlc/skins.php\">" )
26
- + qtr( "VLC skins website" )+ QString( "</a>." ) );
27
+ + qtr( "VLC skins website" ) + QString( "</a>." ) );
28
ui.skinsLabel->setFont( italicFont );
29
30
#ifdef _WIN32
31
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/sout/sout_widgets.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/sout/sout_widgets.cpp
Changed
10
1
2
toNativeSeparators(uri.toDisplayString(
3
QUrl::RemovePassword | QUrl::PreferLocalFile | QUrl::NormalizePathSegments
4
)));
5
- if ( type.isEmpty() ) type = qtr( I_FILE_SLASH_DIR );
6
+ if ( type.isEmpty() ) type = qfut( I_FILE_SLASH_DIR );
7
sourceValueLabel->setText( type );
8
}
9
}
10
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/controlbar_profile.cpp
Added
201
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+#include "controlbar_profile.hpp"
20
+
21
+#include "player/control_list_model.hpp"
22
+#include "player/player_controlbar_model.hpp"
23
+
24
+
25
+decltype(ControlbarProfile::m_defaults)
26
+ ControlbarProfile::m_defaults =
27
+ {
28
+ {
29
+ PlayerControlbarModel::Mainplayer,
30
+ {
31
+ {
32
+ {
33
+ ControlListModel::LANG_BUTTON,
34
+ ControlListModel::MENU_BUTTON
35
+ },
36
+ {
37
+ ControlListModel::RANDOM_BUTTON,
38
+ ControlListModel::PREVIOUS_BUTTON,
39
+ ControlListModel::PLAY_BUTTON,
40
+ ControlListModel::NEXT_BUTTON,
41
+ ControlListModel::LOOP_BUTTON
42
+ },
43
+ {
44
+ ControlListModel::VOLUME,
45
+ ControlListModel::FULLSCREEN_BUTTON
46
+ }
47
+ }
48
+ }
49
+ },
50
+ {
51
+ PlayerControlbarModel::Miniplayer,
52
+ {
53
+ {
54
+ {
55
+ ControlListModel::ARTWORK_INFO
56
+ },
57
+ {
58
+ ControlListModel::RANDOM_BUTTON,
59
+ ControlListModel::PREVIOUS_BUTTON,
60
+ ControlListModel::PLAY_BUTTON,
61
+ ControlListModel::NEXT_BUTTON,
62
+ ControlListModel::LOOP_BUTTON
63
+ },
64
+ {
65
+ ControlListModel::VOLUME,
66
+ ControlListModel::PLAYER_SWITCH_BUTTON
67
+ }
68
+ }
69
+ }
70
+ }
71
+ };
72
+
73
+
74
+ControlbarProfile::ControlbarProfile(QObject *parent) : QObject(parent)
75
+{
76
+ injectDefaults();
77
+}
78
+
79
+PlayerControlbarModel *ControlbarProfile::newModel(int identifier)
80
+{
81
+ if (m_models.contains(identifier))
82
+ return nullptr; // can not allow the same identifier
83
+
84
+ const auto model = new PlayerControlbarModel(this);
85
+
86
+ connect(model, &PlayerControlbarModel::controlListChanged, this, &ControlbarProfile::generateLinearControlList);
87
+
88
+ connect(model, &PlayerControlbarModel::dirtyChanged, this, [this](bool dirty) {
89
+ if (dirty)
90
+ ++m_dirty;
91
+ else
92
+ --m_dirty;
93
+
94
+ emit dirtyChanged( this->dirty() );
95
+ });
96
+
97
+ m_models.insert(identifier, model);
98
+
99
+ return model;
100
+}
101
+
102
+PlayerControlbarModel *ControlbarProfile::getModel(int identifier) const
103
+{
104
+ if (m_models.contains(identifier))
105
+ {
106
+ return m_models[identifier];
107
+ }
108
+ else
109
+ {
110
+ return nullptr;
111
+ }
112
+}
113
+
114
+void ControlbarProfile::setModelData(int identifier, const std::array<QVector<int>, 3> &data)
115
+{
116
+ auto ptrModel = getModel(identifier);
117
+
118
+ if (ptrModel)
119
+ {
120
+ ptrModel->loadModels(data);
121
+ }
122
+ else
123
+ {
124
+ ptrModel = newModel(identifier);
125
+
126
+ if (!ptrModel)
127
+ return;
128
+
129
+ ptrModel->loadModels(data);
130
+ }
131
+
132
+ ptrModel->setDirty(true);
133
+}
134
+
135
+std::array<QVector<int>, 3> ControlbarProfile::getModelData(int identifier) const
136
+{
137
+ const auto ptrModel = getModel(identifier);
138
+
139
+ if (!ptrModel)
140
+ return {};
141
+
142
+ return ptrModel->serializeModels();
143
+}
144
+
145
+void ControlbarProfile::deleteModel(int identifier)
146
+{
147
+ if (m_models.contains(identifier))
148
+ {
149
+ m_models[identifier]->deleteLater();
150
+ m_models.remove(identifier);
151
+ }
152
+}
153
+
154
+void ControlbarProfile::setName(const QString &name)
155
+{
156
+ if (name == m_name)
157
+ return;
158
+
159
+ m_name = name;
160
+
161
+ emit nameChanged(m_name);
162
+}
163
+
164
+bool ControlbarProfile::dirty() const
165
+{
166
+ return (m_dirty > 0);
167
+}
168
+
169
+QString ControlbarProfile::name() const
170
+{
171
+ return m_name;
172
+}
173
+
174
+void ControlbarProfile::injectDefaults(bool resetDirty)
175
+{
176
+ injectModel(m_defaults);
177
+
178
+ if (resetDirty)
179
+ this->resetDirty(); // defaults normally should not make the profile dirty
180
+}
181
+
182
+void ControlbarProfile::injectModel(const QVector<ControlbarProfile::Configuration> &modelData)
183
+{
184
+ m_pauseControlListGeneration = true;
185
+
186
+ for (const auto& i : modelData)
187
+ {
188
+ setModelData(i.identifier, i.data);
189
+ }
190
+
191
+ m_pauseControlListGeneration = false;
192
+
193
+ generateLinearControlList();
194
+}
195
+
196
+void ControlbarProfile::generateLinearControlList()
197
+{
198
+ if (m_pauseControlListGeneration)
199
+ return;
200
+
201
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/controlbar_profile.hpp
Added
93
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+#ifndef ControlbarProfile_HPP
20
+#define ControlbarProfile_HPP
21
+
22
+#include <QObject>
23
+#include <QMap>
24
+#include <QVector>
25
+#include <array>
26
+
27
+class PlayerControlbarModel;
28
+
29
+class ControlbarProfile : public QObject
30
+{
31
+ Q_OBJECT
32
+
33
+ Q_PROPERTY(bool dirty READ dirty RESET resetDirty NOTIFY dirtyChanged)
34
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
35
+
36
+ friend class ControlbarProfileModel;
37
+
38
+public:
39
+ explicit ControlbarProfile(QObject *parent = nullptr);
40
+
41
+ PlayerControlbarModel* newModel(int identifier);
42
+ Q_INVOKABLE PlayerControlbarModel* getModel(int identifier) const;
43
+
44
+ void setModelData(int identifier, const std::array<QVector<int>, 3>& data);
45
+ std::array<QVector<int>, 3> getModelData(int identifier) const;
46
+
47
+ void deleteModel(int identifier);
48
+
49
+ Q_INVOKABLE void injectDefaults(bool resetDirty = true);
50
+
51
+ bool dirty() const;
52
+ QString name() const;
53
+
54
+public slots:
55
+ void resetDirty();
56
+ void setName(const QString& name);
57
+
58
+private:
59
+ // m_dirty indicates the count of PlayerControlbarModel
60
+ // residing in m_models which has the dirty property
61
+ // set true.
62
+ int m_dirty = 0;
63
+
64
+ QString m_name {"N/A"};
65
+ bool m_pauseControlListGeneration = false;
66
+
67
+ // According to benchmarks, QMap performs better than
68
+ // QHash when item count is less than 32.
69
+ // Assuming model (player) count to stay below that,
70
+ // QMap is used here.
71
+ QMap<int, PlayerControlbarModel *> m_models;
72
+
73
+ struct Configuration {
74
+ int identifier;
75
+ std::array<QVector<int>, 3> data;
76
+ };
77
+ static const QVector<Configuration> m_defaults;
78
+
79
+private:
80
+ void injectModel(const QVector<Configuration>& modelData);
81
+
82
+private slots:
83
+ void generateLinearControlList();
84
+
85
+signals:
86
+ void dirtyChanged(bool dirty);
87
+ void nameChanged(QString name);
88
+
89
+ void controlListChanged(const QVector<int>& linearControlList);
90
+};
91
+
92
+#endif // ControlbarProfile_HPP
93
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
Added
201
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+#include "controlbar_profile_model.hpp"
20
+
21
+#include <QSettings>
22
+
23
+#include "qt.hpp"
24
+#include "controlbar_profile.hpp"
25
+#include "player/control_list_model.hpp"
26
+#include "player/player_controlbar_model.hpp"
27
+
28
+#define SETTINGS_KEY_SELECTEDPROFILE "SelectedProfile"
29
+#define SETTINGS_ARRAYNAME_PROFILES "Profiles"
30
+#define SETTINGS_KEY_NAME "Name"
31
+#define SETTINGS_KEY_MODEL "Model"
32
+
33
+#define SETTINGS_CONTROL_SEPARATOR ","
34
+#define SETTINGS_CONFIGURATION_SEPARATOR "|"
35
+#define SETTINGS_PROFILE_SEPARATOR "$"
36
+
37
+decltype (ControlbarProfileModel::m_defaults)
38
+ ControlbarProfileModel::m_defaults =
39
+ {
40
+ {
41
+ N_("Minimalist Style"),
42
+ {
43
+ {
44
+ PlayerControlbarModel::Mainplayer,
45
+ {
46
+ {
47
+ {
48
+ ControlListModel::PLAY_BUTTON,
49
+ ControlListModel::WIDGET_SPACER,
50
+ ControlListModel::PREVIOUS_BUTTON,
51
+ ControlListModel::STOP_BUTTON,
52
+ ControlListModel::NEXT_BUTTON,
53
+ ControlListModel::WIDGET_SPACER,
54
+ ControlListModel::RECORD_BUTTON,
55
+ ControlListModel::WIDGET_SPACER,
56
+ ControlListModel::TELETEXT_BUTTONS,
57
+ ControlListModel::WIDGET_SPACER,
58
+ ControlListModel::PLAYLIST_BUTTON,
59
+ ControlListModel::WIDGET_SPACER,
60
+ ControlListModel::VOLUME
61
+ },
62
+ {
63
+
64
+ },
65
+ {
66
+
67
+ }
68
+ }
69
+ }
70
+ },
71
+ {
72
+ PlayerControlbarModel::Miniplayer,
73
+ {
74
+ {
75
+ {
76
+ ControlListModel::PREVIOUS_BUTTON,
77
+ ControlListModel::PLAY_BUTTON,
78
+ ControlListModel::STOP_BUTTON,
79
+ ControlListModel::NEXT_BUTTON
80
+ },
81
+ {
82
+
83
+ },
84
+ {
85
+
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ },
92
+ {
93
+ N_("One-liner Style"),
94
+ {
95
+ {
96
+ PlayerControlbarModel::Mainplayer,
97
+ {
98
+ {
99
+ {
100
+ ControlListModel::PLAY_BUTTON,
101
+ ControlListModel::WIDGET_SPACER,
102
+ ControlListModel::PREVIOUS_BUTTON,
103
+ ControlListModel::STOP_BUTTON,
104
+ ControlListModel::NEXT_BUTTON,
105
+ ControlListModel::WIDGET_SPACER,
106
+ ControlListModel::FULLSCREEN_BUTTON,
107
+ ControlListModel::PLAYLIST_BUTTON,
108
+ ControlListModel::EXTENDED_BUTTON,
109
+ ControlListModel::WIDGET_SPACER,
110
+ ControlListModel::WIDGET_SPACER,
111
+ ControlListModel::RECORD_BUTTON,
112
+ ControlListModel::SNAPSHOT_BUTTON,
113
+ ControlListModel::ATOB_BUTTON,
114
+ ControlListModel::FRAME_BUTTON
115
+ },
116
+ {
117
+ ControlListModel::VOLUME
118
+ },
119
+ {
120
+
121
+ }
122
+ }
123
+ }
124
+ },
125
+ {
126
+ PlayerControlbarModel::Miniplayer,
127
+ {
128
+ {
129
+ {
130
+ ControlListModel::RANDOM_BUTTON,
131
+ ControlListModel::PREVIOUS_BUTTON,
132
+ ControlListModel::PLAY_BUTTON,
133
+ ControlListModel::STOP_BUTTON,
134
+ ControlListModel::NEXT_BUTTON,
135
+ ControlListModel::LOOP_BUTTON
136
+ },
137
+ {
138
+
139
+ },
140
+ {
141
+
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ },
148
+ {
149
+ N_("Simplest Style"),
150
+ {
151
+ {
152
+ PlayerControlbarModel::Mainplayer,
153
+ {
154
+ {
155
+ {
156
+ ControlListModel::VOLUME
157
+ },
158
+ {
159
+ ControlListModel::PLAY_BUTTON,
160
+ ControlListModel::NEXT_BUTTON,
161
+ ControlListModel::STOP_BUTTON
162
+ },
163
+ {
164
+ ControlListModel::FULLSCREEN_BUTTON
165
+ }
166
+ }
167
+ }
168
+ },
169
+ {
170
+ PlayerControlbarModel::Miniplayer,
171
+ {
172
+ {
173
+ {
174
+ ControlListModel::PREVIOUS_BUTTON,
175
+ ControlListModel::PLAY_BUTTON,
176
+ ControlListModel::NEXT_BUTTON
177
+ },
178
+ {
179
+
180
+ },
181
+ {
182
+
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ };
190
+
191
+
192
+ControlbarProfileModel::ControlbarProfileModel(intf_thread_t *p_intf, QObject *parent)
193
+ : QAbstractListModel(parent),
194
+ m_intf(p_intf)
195
+{
196
+ assert(m_intf);
197
+
198
+ connect(this, &QAbstractListModel::rowsInserted, this, &ControlbarProfileModel::countChanged);
199
+ connect(this, &QAbstractListModel::rowsRemoved, this, &ControlbarProfileModel::countChanged);
200
+ connect(this, &QAbstractListModel::modelReset, this, &ControlbarProfileModel::countChanged);
201
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp
Added
112
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+#ifndef CONTROLBARPROFILEMODEL_H
20
+#define CONTROLBARPROFILEMODEL_H
21
+
22
+#include <QAbstractListModel>
23
+#include <array>
24
+
25
+#include "controlbar_profile.hpp"
26
+
27
+struct intf_thread_t;
28
+
29
+class ControlbarProfileModel : public QAbstractListModel
30
+{
31
+ Q_OBJECT
32
+
33
+ Q_PROPERTY(int selectedProfile READ selectedProfile WRITE setSelectedProfile NOTIFY selectedProfileChanged)
34
+ Q_PROPERTY(ControlbarProfile* currentModel READ currentModel NOTIFY selectedProfileChanged)
35
+
36
+ Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
37
+
38
+public:
39
+ explicit ControlbarProfileModel(intf_thread_t *p_intf, QObject *parent = nullptr);
40
+
41
+ // Basic functionality:
42
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
43
+
44
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
45
+
46
+ QHash<int, QByteArray> roleNames() const override;
47
+
48
+ // Editable:
49
+ Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value,
50
+ int role = Qt::DisplayRole) override;
51
+
52
+ Qt::ItemFlags flags(const QModelIndex& index) const override;
53
+
54
+ // Add data:
55
+ Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
56
+
57
+ // Remove data:
58
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
59
+
60
+public:
61
+ enum Roles {
62
+ MODEL_ROLE = Qt::UserRole,
63
+ };
64
+
65
+ int selectedProfile() const;
66
+ ControlbarProfile* currentModel() const;
67
+
68
+ ControlbarProfile* cloneProfile(const ControlbarProfile* profile);
69
+ Q_INVOKABLE void cloneSelectedProfile(const QString& newProfileName);
70
+
71
+ Q_INVOKABLE ControlbarProfile* getProfile(int index) const;
72
+
73
+ Q_INVOKABLE ControlbarProfile* newProfile(const QString& name);
74
+ ControlbarProfile* newProfile();
75
+
76
+ Q_INVOKABLE void deleteSelectedProfile();
77
+
78
+public slots:
79
+ void save(bool clearDirty = true) const;
80
+ bool reload();
81
+
82
+ bool setSelectedProfile(int selectedProfile);
83
+
84
+signals:
85
+ void countChanged();
86
+ void selectedProfileChanged();
87
+
88
+ void selectedProfileControlListChanged(const QVector<int>& linearControlList);
89
+
90
+private:
91
+ QVector<ControlbarProfile *> m_profiles;
92
+
93
+ int m_selectedProfile = -1;
94
+
95
+ struct Profile {
96
+ const char* name;
97
+ QVector<ControlbarProfile::Configuration> modelData;
98
+ };
99
+
100
+ static const QVector<Profile> m_defaults;
101
+
102
+private:
103
+ void insertDefaults();
104
+
105
+ QString generateUniqueName(const QString& name);
106
+
107
+protected:
108
+ intf_thread_t *m_intf = nullptr;
109
+};
110
+
111
+#endif // CONTROLBARPROFILEMODEL_H
112
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
Changed
11
1
2
}
3
4
onXChanged: {
5
- root.handleScroll(this)
6
+ if (content.Drag.active)
7
+ root.handleScroll(this)
8
}
9
}
10
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/qml/EditorDNDView.qml
Changed
10
1
2
orientation: Qt.Horizontal
3
clip: true
4
5
+ highlightFollowsCurrentItem: false
6
+
7
property bool containsDrag: footerItem.dropVisible
8
9
property alias scrollBar: scrollBar
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
Changed
34
1
2
import QtQuick.Controls 2.4
3
4
import "qrc:///style/"
5
+import "qrc:///widgets/" as Widgets
6
7
TabButton {
8
id: mainPlayerControl
9
10
- property int index: 0
11
property bool active: index == bar.currentIndex
12
13
implicitWidth: VLCStyle.button_width_large
14
15
- contentItem: Text {
16
- text: mainPlayerControl.text
17
- color: VLCStyle.colors.buttonText
18
+ contentItem: Widgets.ListLabel {
19
+ text: {
20
+ var text = mainPlayerControl.text
21
+
22
+ if (!!mainInterface.controlbarProfileModel.currentModel &&
23
+ mainInterface.controlbarProfileModel.currentModel.getModel(mainPlayerControl.identifier).dirty)
24
+ return _markDirty(text)
25
+ else
26
+ return text
27
+ }
28
+
29
horizontalAlignment: Text.AlignHCenter
30
- verticalAlignment: Text.AlignVCenter
31
}
32
33
background: Rectangle {
34
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
Changed
201
1
2
*****************************************************************************/
3
import QtQuick 2.11
4
import QtQuick.Controls 2.4
5
-import QtQuick.Layouts 1.3
6
+import QtQuick.Layouts 1.11
7
import QtQml.Models 2.11
8
9
import org.videolan.vlc 0.1
10
11
import "qrc:///player/" as Player
12
import "qrc:///style/"
13
+import "qrc:///widgets/" as Widgets
14
15
Rectangle{
16
id: root
17
18
19
property alias removeInfoRectVisible: buttonList.removeInfoRectVisible
20
21
+ property var _viewThatContainsDrag: undefined
22
+
23
MouseArea {
24
anchors.fill: parent
25
z: -1
26
27
28
TabBar {
29
id: bar
30
- Layout.preferredHeight: VLCStyle.heightBar_normal
31
-
32
z: 1
33
34
- spacing: VLCStyle.dp(1) // this causes binding loop warning in Qt 5.11.3 probably due to a bug
35
-
36
- EditorTabButton {
37
- id: mainPlayerTab
38
-
39
- anchors.top: parent.top
40
- anchors.bottom: parent.bottom
41
+ background: Item { }
42
43
- index: 0
44
- text: i18n.qtr("Mainplayer")
45
- }
46
-
47
- EditorTabButton {
48
- id: miniPlayerTab
49
+ Repeater {
50
+ model: PlayerListModel.model
51
52
- anchors.top: parent.top
53
- anchors.bottom: parent.bottom
54
+ delegate: EditorTabButton {
55
+ anchors.top: parent.top
56
+ anchors.bottom: parent.bottom
57
58
- index: 1
59
- text: i18n.qtr("Miniplayer")
60
+ text: modelData.name
61
+ readonly property int identifier: modelData.identifier
62
+ }
63
}
64
}
65
66
Rectangle{
67
+ id: parentRectangle
68
+
69
Layout.preferredHeight: VLCStyle.heightBar_large * 1.25
70
Layout.fillWidth: true
71
72
- color: VLCStyle.colors.bgAlt
73
+ color: "transparent"
74
75
border.color: VLCStyle.colors.accent
76
border.width: VLCStyle.dp(1, VLCStyle.scale)
77
78
- StackLayout{
79
- anchors.fill: parent
80
- currentIndex: bar.currentIndex
81
-
82
- RowLayout {
83
- Layout.preferredHeight: VLCStyle.heightBar_large * 1.25
84
- Layout.fillWidth: true
85
-
86
- TextMetrics {
87
- id: leftMetric
88
- text: i18n.qtr("L E F T")
89
- font.pixelSize: VLCStyle.fontSize_xxlarge
90
- }
91
-
92
- TextMetrics {
93
- id: centerMetric
94
- text: i18n.qtr("C E N T E R")
95
- font.pixelSize: VLCStyle.fontSize_xxlarge
96
- }
97
-
98
- TextMetrics {
99
- id: rightMetric
100
- text: i18n.qtr("R I G H T")
101
- font.pixelSize: VLCStyle.fontSize_xxlarge
102
- }
103
-
104
- EditorDNDView {
105
- id : playerBtnDND_left
106
- Layout.fillHeight: true
107
-
108
- Layout.fillWidth: count > 0 || (playerBtnDND_left.count === 0 && playerBtnDND_center.count === 0 && playerBtnDND_right.count === 0)
109
- Layout.minimumWidth: centerMetric.width
110
- Layout.leftMargin: VLCStyle.margin_xsmall
111
- Layout.rightMargin: VLCStyle.margin_xsmall
112
-
113
- model: playerControlBarModel_left
114
-
115
- Text {
116
- anchors.fill: parent
117
-
118
- text: leftMetric.text
119
- verticalAlignment: Text.AlignVCenter
120
- font.pixelSize: VLCStyle.fontSize_xxlarge
121
- color: VLCStyle.colors.menuCaption
122
- horizontalAlignment: Text.AlignHCenter
123
- visible: (parent.count === 0)
124
- }
125
- }
126
-
127
- Rectangle {
128
- Layout.preferredWidth: VLCStyle.margin_small
129
-
130
- Layout.fillHeight: true
131
- Layout.topMargin: VLCStyle.dp(1, VLCStyle.scale)
132
- Layout.bottomMargin: VLCStyle.dp(1, VLCStyle.scale)
133
- Layout.alignment: Qt.AlignVCenter
134
-
135
- color: VLCStyle.colors.bg
136
- }
137
-
138
- EditorDNDView {
139
- id : playerBtnDND_center
140
- Layout.fillHeight: true
141
-
142
- Layout.fillWidth: count > 0 || (playerBtnDND_left.count === 0 && playerBtnDND_center.count === 0 && playerBtnDND_right.count === 0)
143
- Layout.minimumWidth: centerMetric.width
144
- Layout.leftMargin: VLCStyle.margin_xsmall
145
- Layout.rightMargin: VLCStyle.margin_xsmall
146
-
147
- model: playerControlBarModel_center
148
-
149
- Text {
150
- anchors.fill: parent
151
-
152
- text: centerMetric.text
153
- verticalAlignment: Text.AlignVCenter
154
- font.pixelSize: VLCStyle.fontSize_xxlarge
155
- color: VLCStyle.colors.menuCaption
156
- horizontalAlignment: Text.AlignHCenter
157
- visible: (parent.count === 0)
158
- }
159
- }
160
-
161
- Rectangle {
162
- Layout.preferredWidth: VLCStyle.margin_small
163
-
164
- Layout.fillHeight: true
165
- Layout.topMargin: VLCStyle.dp(1, VLCStyle.scale)
166
- Layout.bottomMargin: VLCStyle.dp(1, VLCStyle.scale)
167
- Layout.alignment: Qt.AlignVCenter
168
-
169
- color: VLCStyle.colors.bg
170
- }
171
-
172
- EditorDNDView {
173
- id : playerBtnDND_right
174
- Layout.fillHeight: true
175
-
176
- Layout.fillWidth: count > 0 || (playerBtnDND_left.count === 0 && playerBtnDND_center.count === 0 && playerBtnDND_right.count === 0)
177
- Layout.minimumWidth: centerMetric.width
178
- Layout.leftMargin: VLCStyle.margin_xsmall
179
- Layout.rightMargin: VLCStyle.margin_xsmall
180
-
181
- model: playerControlBarModel_right
182
-
183
- Text {
184
- anchors.fill: parent
185
-
186
- text: rightMetric.text
187
- verticalAlignment: Text.AlignVCenter
188
- font.pixelSize: VLCStyle.fontSize_xxlarge
189
- color: VLCStyle.colors.menuCaption
190
- horizontalAlignment: Text.AlignHCenter
191
- visible: (parent.count === 0)
192
- }
193
- }
194
- }
195
-
196
- RowLayout {
197
- Layout.preferredHeight: VLCStyle.heightBar_large * 1.25
198
- Layout.fillWidth: true
199
-
200
- EditorDNDView {
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
Changed
73
1
2
import org.videolan.vlc 0.1
3
4
import "qrc:///style/"
5
+import "qrc:///widgets/" as Widgets
6
7
GridView{
8
id: allButtonsView
9
clip: true
10
11
- highlight: Rectangle{
12
- color: VLCStyle.colors.bgHover
13
- }
14
- ScrollBar.vertical: ScrollBar {}
15
+ ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn }
16
model: controlButtons.buttonL.length
17
18
- highlightMoveDuration: 0 //ms
19
+ highlightFollowsCurrentItem: false
20
+
21
+ cellWidth: VLCStyle.cover_small
22
+ cellHeight: cellWidth
23
24
property alias removeInfoRectVisible: removeInfoRect.visible
25
26
27
id:dragArea
28
objectName: "buttonsList"
29
hoverEnabled: true
30
- width: VLCStyle.cover_small
31
- height: width
32
+ width: cellWidth
33
+ height: cellHeight
34
35
property bool held: false
36
property int mIndex: controlButtons.buttonL[model.index].id
37
38
39
onEntered: allButtonsView.currentIndex = index
40
41
+ Loader {
42
+ active: allButtonsView.currentIndex === index
43
+ anchors.fill: parent
44
+
45
+ sourceComponent: Rectangle {
46
+ color: VLCStyle.colors.bgHover
47
+ }
48
+ }
49
+
50
ColumnLayout{
51
id: listelemlayout
52
anchors.fill: parent
53
54
Layout.alignment: Qt.AlignHCenter
55
text: controlButtons.buttonL[model.index].label
56
}
57
- Text {
58
+
59
+ Widgets.ListSubtitleLabel {
60
id: buttonName
61
Layout.fillWidth: true
62
Layout.fillHeight: true
63
+
64
+ elide: Text.ElideNone
65
text: controlButtons.buttonL[model.index].text
66
- font.pointSize: VLCStyle.fontHeight_xsmall
67
- color: VLCStyle.colors.buttonText
68
wrapMode: Text.WordWrap
69
- verticalAlignment: Text.AlignVCenter
70
horizontalAlignment: Text.AlignHCenter
71
}
72
}
73
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml
Added
173
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+import QtQuick 2.11
20
+import QtQuick.Controls 2.4
21
+import QtQuick.Layouts 1.11
22
+
23
+import "qrc:///widgets/" as Widgets
24
+import "qrc:///style/"
25
+
26
+import org.videolan.vlc 0.1
27
+
28
+WindowDialog {
29
+ id: root
30
+
31
+ width: 800
32
+ height: 600
33
+
34
+ modal: true
35
+ title: i18n.qtr("Toolbar Editor")
36
+
37
+ signal unload()
38
+
39
+ Component.onCompleted: {
40
+ // Save first, in case the dialog is rejected.
41
+ mainInterface.controlbarProfileModel.save(false)
42
+ }
43
+
44
+ onAccepted: {
45
+ mainInterface.controlbarProfileModel.save()
46
+ unload()
47
+ }
48
+
49
+ onRejected: {
50
+ // Load saved to discard the changes
51
+ mainInterface.controlbarProfileModel.reload()
52
+ unload()
53
+ }
54
+
55
+ function _markDirty(text) {
56
+ return (text += " *")
57
+ }
58
+
59
+ contentComponent: Item {
60
+ ColumnLayout {
61
+ anchors.fill: parent
62
+
63
+ RowLayout {
64
+ Widgets.MenuLabel {
65
+ Layout.fillWidth: true
66
+
67
+ text: i18n.qtr("Select profile:")
68
+ }
69
+
70
+ Widgets.ComboBoxExt {
71
+ id: comboBox
72
+ font.pixelSize: VLCStyle.fontSize_normal
73
+
74
+ width: VLCStyle.combobox_width_large
75
+ height: VLCStyle.combobox_height_normal
76
+
77
+ delegate: ItemDelegate {
78
+ width: comboBox.width
79
+ leftPadding: comboBox.leftPadding
80
+ background: Item {}
81
+ contentItem: Text {
82
+ text: model.dirty ? _markDirty(model.name)
83
+ : model.name
84
+ color: comboBox.color
85
+ font: comboBox.font
86
+ elide: Text.ElideRight
87
+ verticalAlignment: Text.AlignVCenter
88
+ }
89
+ highlighted: (comboBox.highlightedIndex === index)
90
+ }
91
+
92
+ displayText: {
93
+ var text
94
+
95
+ if (!!mainInterface.controlbarProfileModel.currentModel)
96
+ text = mainInterface.controlbarProfileModel.currentModel.name
97
+ else {
98
+ text = "N/A"
99
+ return text
100
+ }
101
+
102
+ if (mainInterface.controlbarProfileModel.currentModel.dirty)
103
+ return _markDirty(text)
104
+ else
105
+ return text
106
+ }
107
+
108
+ model: mainInterface.controlbarProfileModel
109
+
110
+ currentIndex: mainInterface.controlbarProfileModel.selectedProfile
111
+
112
+ onCurrentIndexChanged: {
113
+ mainInterface.controlbarProfileModel.selectedProfile = currentIndex
114
+ }
115
+
116
+ Accessible.name: i18n.qtr("Profiles")
117
+ }
118
+
119
+ Widgets.IconToolButton {
120
+ text: i18n.qtr("New Profile")
121
+ iconText: VLCIcons.profile_new
122
+
123
+ onClicked: {
124
+ var npDialog = dialogProvider.getTextDialog(null,
125
+ i18n.qtr("Profile Name"),
126
+ i18n.qtr("Please enter the new profile name:"),
127
+ i18n.qtr("Profile %1").arg(comboBox.count + 1))
128
+ if (!npDialog.ok)
129
+ return
130
+
131
+ mainInterface.controlbarProfileModel.cloneSelectedProfile(npDialog.text)
132
+ mainInterface.controlbarProfileModel.selectedProfile = (mainInterface.controlbarProfileModel.rowCount() - 1)
133
+ }
134
+
135
+ ToolTip.visible: hovered
136
+ }
137
+
138
+ Widgets.IconToolButton {
139
+ id: useDefaultButton
140
+
141
+ text: i18n.qtr("Use Default")
142
+ iconText: VLCIcons.history
143
+
144
+ onClicked: {
145
+ mainInterface.controlbarProfileModel.currentModel.injectDefaults(false)
146
+ }
147
+
148
+ ToolTip.visible: hovered
149
+ }
150
+
151
+ Widgets.IconToolButton {
152
+ text: i18n.qtr("Delete the current profile")
153
+ iconText: VLCIcons.del
154
+
155
+ onClicked: {
156
+ mainInterface.controlbarProfileModel.deleteSelectedProfile()
157
+ }
158
+
159
+ ToolTip.visible: hovered
160
+ }
161
+ }
162
+
163
+ // The main context of the toolbareditor dialog:
164
+ ToolbarEditor {
165
+ id: toolbarEditor
166
+
167
+ Layout.fillWidth: true
168
+ Layout.fillHeight: true
169
+ }
170
+ }
171
+ }
172
+}
173
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/dialogs/vlm/vlm.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/dialogs/vlm/vlm.cpp
Changed
10
1
2
ui.setupUi( this );
3
ui.saveButton->hide();
4
5
-#define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qtr( str ), QVariant( type ) );
6
+#define ADDMEDIATYPES( str, type ) ui.mediaType->addItem( qfut( str ), QVariant( type ) );
7
ADDMEDIATYPES( N_("Broadcast"), QVLM_Broadcast );
8
ADDMEDIATYPES( N_("Schedule"), QVLM_Schedule );
9
#undef ADDMEDIATYPES
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/maininterface/main_interface.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/maininterface/main_interface.cpp
Changed
29
1
2
3
#include "vlc_media_library.h"
4
5
+#include "dialogs/toolbar/controlbar_profile_model.hpp"
6
+
7
#include <QCloseEvent>
8
#include <QKeyEvent>
9
10
11
m_colorScheme = new ColorSchemeModel(this);
12
m_colorScheme->setCurrent(currentColorScheme);
13
14
+ /* Controlbar Profile Model Creation */
15
+ m_controlbarProfileModel = new ControlbarProfileModel(p_intf, this);
16
+
17
/* Should the UI stays on top of other windows */
18
b_interfaceOnTop = var_InheritBool( p_intf, "video-on-top" );
19
20
21
22
connect(this, &MainInterface::interfaceFullScreenChanged, this, &MainInterface::useClientSideDecorationChanged);
23
24
- connect( THEDP, &DialogsProvider::toolBarConfUpdated, this, &MainInterface::toolBarConfUpdated );
25
-
26
/** END of CONNECTS**/
27
28
29
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/maininterface/main_interface.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/maininterface/main_interface.hpp
Changed
43
1
2
class StandardPLPanel;
3
struct vout_window_t;
4
class VideoSurfaceProvider;
5
+class ControlbarProfileModel;
6
7
class WindowStateHolder : public QObject
8
{
9
10
Q_PROPERTY(bool hasToolbarMenu READ hasToolbarMenu NOTIFY hasToolbarMenuChanged)
11
Q_PROPERTY(bool canShowVideoPIP READ canShowVideoPIP CONSTANT)
12
Q_PROPERTY(bool pinVideoControls READ pinVideoControls WRITE setPinVideoControls NOTIFY pinVideoControlsChanged)
13
+ Q_PROPERTY(ControlbarProfileModel* controlbarProfileModel READ controlbarProfileModel CONSTANT)
14
+
15
16
public:
17
/* tors */
18
19
inline bool canShowVideoPIP() const { return m_canShowVideoPIP; }
20
inline void setCanShowVideoPIP(bool canShowVideoPIP) { m_canShowVideoPIP = canShowVideoPIP; }
21
inline bool pinVideoControls() const { return m_pinVideoControls; }
22
+ inline ControlbarProfileModel* controlbarProfileModel() const { return m_controlbarProfileModel; }
23
24
bool hasEmbededVideo() const;
25
VideoSurfaceProvider* getVideoSurfaceProvider() const;
26
27
28
VLCVarChoiceModel* m_extraInterfaces;
29
30
+ ControlbarProfileModel* m_controlbarProfileModel;
31
+
32
public slots:
33
void toggleUpdateSystrayMenu();
34
void showUpdateSystrayMenu();
35
36
void interfaceAlwaysOnTopChanged(bool);
37
void interfaceFullScreenChanged(bool);
38
void hasEmbededVideoChanged(bool);
39
- void toolBarConfUpdated();
40
void showRemainingTimeChanged(bool);
41
void gridViewChanged( bool );
42
void colorSchemeChanged( QString );
43
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/maininterface/mainui.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/maininterface/mainui.cpp
Changed
69
1
2
#include "medialibrary/mlrecentsmodel.hpp"
3
#include "medialibrary/mlrecentsvideomodel.hpp"
4
#include "medialibrary/mlfoldersmodel.hpp"
5
+#include "medialibrary/mlgrouplistmodel.hpp"
6
#include "medialibrary/mlplaylistlistmodel.hpp"
7
#include "medialibrary/mlplaylistmodel.hpp"
8
#include "medialibrary/mlplaylist.hpp"
9
10
#include "player/player_controller.hpp"
11
-#include "player/playercontrolbarmodel.hpp"
12
+#include "player/player_controlbar_model.hpp"
13
+#include "player/control_list_model.hpp"
14
+
15
+#include "dialogs/toolbar/controlbar_profile_model.hpp"
16
+#include "dialogs/toolbar/controlbar_profile.hpp"
17
18
#include "playlist/playlist_model.hpp"
19
#include "playlist/playlist_controller.hpp"
20
21
22
#include "menus/qml_menu_wrapper.hpp"
23
24
+#include "widgets/native/roundimage.hpp"
25
+
26
#include "videosurface.hpp"
27
28
#include <QQuickWindow>
29
30
qmlRegisterType<MLUrlModel>( "org.videolan.medialib", 0, 1, "MLUrlModel" );
31
qmlRegisterType<MLVideoModel>( "org.videolan.medialib", 0, 1, "MLVideoModel" );
32
qmlRegisterType<MLRecentsVideoModel>( "org.videolan.medialib", 0, 1, "MLRecentsVideoModel" );
33
+ qmlRegisterType<MLGroupListModel>( "org.videolan.medialib", 0, 1, "MLGroupListModel" );
34
qmlRegisterType<MLPlaylistListModel>( "org.videolan.medialib", 0, 1, "MLPlaylistListModel" );
35
qmlRegisterType<MLPlaylistModel>( "org.videolan.medialib", 0, 1, "MLPlaylistModel" );
36
37
38
qmlRegisterType<AlbumTrackContextMenu>( "org.videolan.medialib", 0, 1, "AlbumTrackContextMenu" );
39
qmlRegisterType<URLContextMenu>( "org.videolan.medialib", 0, 1, "URLContextMenu" );
40
qmlRegisterType<VideoContextMenu>( "org.videolan.medialib", 0, 1, "VideoContextMenu" );
41
+ qmlRegisterType<GroupListContextMenu>( "org.videolan.medialib", 0, 1, "GroupListContextMenu" );
42
qmlRegisterType<PlaylistListContextMenu>( "org.videolan.medialib", 0, 1, "PlaylistListContextMenu" );
43
qmlRegisterType<PlaylistMediaContextMenu>( "org.videolan.medialib", 0, 1, "PlaylistMediaContextMenu" );
44
}
45
46
47
qmlRegisterType<QmlEventFilter>( "org.videolan.vlc", 0, 1, "EventFilter" );
48
49
- qmlRegisterType<PlayerControlBarModel>( "org.videolan.vlc", 0, 1, "PlayerControlBarModel");
50
+ qRegisterMetaType<ControlbarProfile*>();
51
+ qRegisterMetaType<ControlbarProfileModel*>();
52
+ qmlRegisterUncreatableType<ControlbarProfile>("org.videolan.vlc", 0, 1, "ControlbarProfile", "");
53
+ qmlRegisterUncreatableType<PlayerControlbarModel>("org.videolan.vlc", 0, 1, "PlayerControlbarModel", "");
54
+ qmlRegisterUncreatableType<ControlListModel>( "org.videolan.vlc", 0, 1, "ControlListModel", "" );
55
+ qmlRegisterSingletonType("org.videolan.vlc", 0, 1, "PlayerListModel", PlayerControlbarModel::getPlaylistIdentifierListModel);
56
57
qRegisterMetaType<QmlMainContext*>();
58
qmlRegisterType<QmlGlobalMenu>( "org.videolan.vlc", 0, 1, "QmlGlobalMenu" );
59
60
qmlRegisterType<PlaylistContextMenu>( "org.videolan.vlc", 0, 1, "PlaylistContextMenu" );
61
qmlRegisterType<SortFilterProxyModel>( "org.videolan.vlc", 0, 1, "SortFilterProxyModel" );
62
63
+ // Custom controls
64
+ qmlRegisterType<RoundImage>( "org.videolan.controls", 0, 1, "RoundImage" );
65
+
66
qRegisterMetaType<QList<QQmlError>>("QList<QQmlError>");
67
}
68
69
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/maininterface/qml/BannerSources.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/maininterface/qml/BannerSources.qml
Changed
58
1
2
import "qrc:///widgets/" as Widgets
3
import "qrc:///menus/" as Menus
4
import "qrc:///util/KeyHelper.js" as KeyHelper
5
+import "qrc:///util/Helpers.js" as Helpers
6
7
Widgets.NavigableFocusScope {
8
id: root
9
10
}
11
}
12
13
- Item {
14
+ Widgets.NavigableFocusScope {
15
id: localToolbar
16
17
width: parent.width
18
height: VLCStyle.localToolbar_height
19
20
+ onActiveFocusChanged: {
21
+ if (activeFocus) {
22
+ // sometimes when view changes, one of the "focusable" object will become disabled
23
+ // but because of focus chainning, FocusScope still tries to force active focus on the object
24
+ // but that will fail, manually assign focus in such cases
25
+ var focusable = [localContextGroup, localMenuGroup, playlistGroup]
26
+ if (!focusable.some(function (obj) { return obj.activeFocus; })) {
27
+ // no object has focus
28
+ localToolbar.nextItemInFocusChain(true).forceActiveFocus()
29
+ }
30
+ }
31
+ }
32
+
33
Rectangle {
34
id: localToolbarBg
35
color: VLCStyle.colors.bg
36
37
38
focus: !!item && item.focus && item.visible
39
visible: !!item
40
+ enabled: status === Loader.Ready
41
y: (VLCStyle.localToolbar_height - item.height) / 2
42
width: !!item
43
- ? clamp(localMenuView.availableWidth
44
- , localMenuGroup.item.minimumWidth || localMenuGroup.item.implicitWidth
45
- , localMenuGroup.item.maximumWidth || localMenuGroup.item.implicitWidth)
46
+ ? Helpers.clamp(localMenuView.availableWidth,
47
+ localMenuGroup.item.minimumWidth || localMenuGroup.item.implicitWidth,
48
+ localMenuGroup.item.maximumWidth || localMenuGroup.item.implicitWidth)
49
: 0
50
51
- function clamp(num, min, max) {
52
- return num <= min ? min : num >= max ? max : num;
53
- }
54
-
55
onVisibleChanged: {
56
//reset the focus on the global group when the local group is hidden,
57
//this avoids losing the focus if the subview changes
58
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/maininterface/qml/MainDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/maininterface/qml/MainDisplay.qml
Changed
22
1
2
import "qrc:///main/" as Main
3
import "qrc:///widgets/" as Widgets
4
import "qrc:///util/KeyHelper.js" as KeyHelper
5
+import "qrc:///util/Helpers.js" as Helpers
6
import "qrc:///playlist/" as PL
7
import "qrc:///player/" as Player
8
9
10
name: "expanded"
11
PropertyChanges {
12
target: playlistColumn
13
- width: resizeHandle.clamp(root.width / resizeHandle.widthFactor,
14
- playlist.minimumWidth,
15
- root.width / 2)
16
+ width: Helpers.clamp(root.width / resizeHandle.widthFactor,
17
+ playlist.minimumWidth,
18
+ root.width / 2)
19
visible: true
20
}
21
},
22
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbum.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbum.cpp
Changed
52
1
2
, m_cover ( QString::fromUtf8( _data->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl ) )
3
, m_mainArtist ( QString::fromUtf8( _data->psz_artist ) )
4
, m_nbTracks ( _data->i_nb_tracks )
5
+ , m_duration ( _data->i_duration )
6
{
7
assert( _data );
8
assert( _ml );
9
-
10
- int t_sec = _data->i_duration / 1000;
11
- int sec = t_sec % 60;
12
- int min = (t_sec / 60) % 60;
13
- int hour = t_sec / 3600;
14
- if (hour == 0)
15
- {
16
- m_duration = QString("%1:%2")
17
- .arg(min, 2, 10, QChar('0'))
18
- .arg(sec, 2, 10, QChar('0'));
19
- m_durationShort = m_duration;
20
- }
21
- else
22
- {
23
- m_duration = QString("%1:%2:%3")
24
- .arg(hour, 2, 10, QChar('0'))
25
- .arg(min, 2, 10, QChar('0'))
26
- .arg(sec, 2, 10, QChar('0'));
27
- m_durationShort = QString("%1h%2")
28
- .arg(hour)
29
- .arg(min, 2, 10, QChar('0'));
30
- }
31
}
32
33
QString MLAlbum::getTitle() const
34
35
return m_nbTracks;
36
}
37
38
-QString MLAlbum::getDuration() const
39
+int64_t MLAlbum::getDuration() const
40
{
41
return m_duration;
42
}
43
44
-QString MLAlbum::getDurationShort() const
45
-{
46
- return m_durationShort;
47
-}
48
-
49
QString MLAlbum::getPresName() const
50
{
51
return m_title;
52
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbum.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbum.hpp
Changed
19
1
2
QString getCover() const;
3
QString getArtist() const;
4
unsigned int getNbTracks() const;
5
- QString getDuration() const;
6
- QString getDurationShort() const;
7
+ int64_t getDuration() const;
8
9
Q_INVOKABLE QString getPresName() const;
10
Q_INVOKABLE QString getPresImage() const;
11
12
QString m_mainArtist;
13
QList<QString> m_otherArtists;
14
unsigned int m_nbTracks;
15
- QString m_duration;
16
- QString m_durationShort;
17
+ int64_t m_duration;
18
};
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbummodel.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbummodel.cpp
Changed
36
1
2
{"release_year", VLC_ML_SORTING_RELEASEDATE},
3
{"main_artist", VLC_ML_SORTING_ARTIST},
4
//{"nb_tracks"},
5
- {"duration", VLC_ML_SORTING_DURATION},
6
- {"duration_short", VLC_ML_SORTING_DURATION}
7
+ {"duration", VLC_ML_SORTING_DURATION}
8
};
9
10
MLAlbumModel::MLAlbumModel(QObject *parent)
11
12
return QVariant::fromValue( ml_item->getNbTracks() );
13
case ALBUM_DURATION:
14
return QVariant::fromValue( ml_item->getDuration() );
15
- case ALBUM_DURATION_SHORT:
16
- return QVariant::fromValue( ml_item->getDurationShort() );
17
case ALBUM_TITLE_FIRST_SYMBOL:
18
return QVariant::fromValue( getFirstSymbol( ml_item->getTitle() ) );
19
case ALBUM_MAIN_ARTIST_FIRST_SYMBOL:
20
21
{ALBUM_MAIN_ARTIST, "main_artist"},
22
{ALBUM_NB_TRACKS, "nb_tracks"},
23
{ALBUM_DURATION, "duration"},
24
- {ALBUM_DURATION_SHORT, "duration_short"},
25
{ALBUM_TITLE_FIRST_SYMBOL, "title_first_symbol"},
26
{ALBUM_MAIN_ARTIST_FIRST_SYMBOL, "main_artist_first_symbol"}
27
};
28
29
case ALBUM_MAIN_ARTIST :
30
return VLC_ML_SORTING_ARTIST;
31
case ALBUM_DURATION:
32
- case ALBUM_DURATION_SHORT:
33
return VLC_ML_SORTING_DURATION;
34
default:
35
return VLC_ML_SORTING_DEFAULT;
36
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbummodel.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbummodel.hpp
Changed
9
1
2
ALBUM_MAIN_ARTIST,
3
ALBUM_NB_TRACKS,
4
ALBUM_DURATION,
5
- ALBUM_DURATION_SHORT,
6
7
ALBUM_TITLE_FIRST_SYMBOL,
8
ALBUM_MAIN_ARTIST_FIRST_SYMBOL
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbumtrack.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbumtrack.cpp
Changed
55
1
2
, MLItem ( MLItemId( _data->i_id, VLC_ML_PARENT_UNKNOWN ) )
3
, m_title ( QString::fromUtf8( _data->psz_title ) )
4
, m_trackNumber( _data->album_track.i_track_nb )
5
- , m_discNumber( _data->album_track.i_disc_nb )
6
+ , m_discNumber ( _data->album_track.i_disc_nb )
7
+ , m_duration ( _data->i_duration )
8
{
9
assert( _data );
10
assert( _data->i_type == VLC_ML_MEDIA_TYPE_AUDIO );
11
12
- int t_sec = _data->i_duration / 1000;
13
- int sec = t_sec % 60;
14
- int min = (t_sec / 60) % 60;
15
- int hour = t_sec / 3600;
16
- if (hour == 0)
17
- {
18
- m_duration = QString("%1:%2")
19
- .arg(min, 2, 10, QChar('0'))
20
- .arg(sec, 2, 10, QChar('0'));
21
- m_durationShort = m_duration;
22
- }
23
- else
24
- {
25
- m_duration = QString("%1:%2:%3")
26
- .arg(hour, 2, 10, QChar('0'))
27
- .arg(min, 2, 10, QChar('0'))
28
- .arg(sec, 2, 10, QChar('0'));
29
- m_durationShort = QString("%1h%2")
30
- .arg(hour)
31
- .arg(min, 2, 10, QChar('0'));
32
- }
33
-
34
for( const vlc_ml_file_t& file: ml_range_iterate<vlc_ml_file_t>( _data->p_files ) )
35
if( file.i_type == VLC_ML_FILE_TYPE_MAIN )
36
{
37
38
return m_discNumber;
39
}
40
41
-QString MLAlbumTrack::getDuration() const
42
+int64_t MLAlbumTrack::getDuration() const
43
{
44
return m_duration;
45
}
46
47
-QString MLAlbumTrack::getDurationShort() const
48
-{
49
- return m_durationShort;
50
-}
51
-
52
QString MLAlbumTrack::getMRL() const
53
{
54
return m_mrl;
55
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbumtrack.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbumtrack.hpp
Changed
21
1
2
QString getCover() const;
3
unsigned int getTrackNumber() const;
4
unsigned int getDiscNumber() const;
5
- QString getDuration() const;
6
- QString getDurationShort() const;
7
+ int64_t getDuration() const;
8
QString getMRL() const;
9
10
private:
11
12
QString m_cover;
13
unsigned int m_trackNumber;
14
unsigned int m_discNumber;
15
- QString m_duration;
16
- QString m_durationShort;
17
+ int64_t m_duration;
18
QString m_mrl;
19
20
ml_unique_ptr<vlc_ml_media_t> m_data;
21
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp
Changed
36
1
2
{"track_number", VLC_ML_SORTING_TRACKNUMBER},
3
{"release_year", VLC_ML_SORTING_RELEASEDATE},
4
{"main_artist", VLC_ML_SORTING_ARTIST},
5
- {"duration", VLC_ML_SORTING_DURATION},
6
- {"duration_short", VLC_ML_SORTING_DURATION}
7
+ {"duration", VLC_ML_SORTING_DURATION}
8
};
9
10
MLAlbumTrackModel::MLAlbumTrackModel(QObject *parent)
11
12
return QVariant::fromValue( ml_track->getDiscNumber() );
13
case TRACK_DURATION :
14
return QVariant::fromValue( ml_track->getDuration() );
15
- case TRACK_DURATION_SHORT :
16
- return QVariant::fromValue( ml_track->getDurationShort() );
17
case TRACK_ALBUM:
18
return QVariant::fromValue( ml_track->getAlbumTitle() );
19
case TRACK_ARTIST:
20
21
{ TRACK_NUMBER, "track_number" },
22
{ TRACK_DISC_NUMBER, "disc_number" },
23
{ TRACK_DURATION, "duration" },
24
- { TRACK_DURATION_SHORT, "duration_short" },
25
{ TRACK_ALBUM, "album_title"},
26
{ TRACK_ARTIST, "main_artist"},
27
{ TRACK_TITLE_FIRST_SYMBOL, "title_first_symbol"},
28
29
case TRACK_NUMBER :
30
return VLC_ML_SORTING_TRACKNUMBER;
31
case TRACK_DURATION :
32
- case TRACK_DURATION_SHORT :
33
return VLC_ML_SORTING_DURATION;
34
default:
35
return VLC_ML_SORTING_DEFAULT;
36
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlalbumtrackmodel.hpp
Changed
9
1
2
TRACK_NUMBER,
3
TRACK_DISC_NUMBER,
4
TRACK_DURATION,
5
- TRACK_DURATION_SHORT,
6
TRACK_ALBUM,
7
TRACK_ARTIST,
8
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlbasemodel.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlbasemodel.cpp
Changed
48
1
2
endResetModel();
3
}
4
5
-QMap<QString, QVariant> MLBaseModel::getDataAt(int idx)
6
+//-------------------------------------------------------------------------------------------------
7
+
8
+/* Q_INVOKABLE */ QMap<QString, QVariant> MLBaseModel::getDataAt(const QModelIndex & index)
9
{
10
QMap<QString, QVariant> dataDict;
11
- QHash<int,QByteArray> roles = roleNames();
12
- for (auto role: roles.keys()) {
13
- dataDict[roles[role]] = data(index(idx), role);
14
+
15
+ QHash<int, QByteArray> roles = roleNames();
16
+
17
+ for (int role: roles.keys())
18
+ {
19
+ dataDict[roles[role]] = data(index, role);
20
}
21
+
22
return dataDict;
23
}
24
25
+/* Q_INVOKABLE */ QMap<QString, QVariant> MLBaseModel::getDataAt(int idx)
26
+{
27
+ return getDataAt(index(idx));
28
+}
29
+
30
+//-------------------------------------------------------------------------------------------------
31
+
32
void MLBaseModel::onResetRequested()
33
{
34
beginResetModel();
35
36
break;
37
}
38
}
39
+
40
+ if (m_mediaLib && m_mediaLib->idle() && m_need_reset)
41
+ {
42
+ emit resetRequested();
43
+ m_need_reset = false;
44
+ }
45
}
46
47
QString MLBaseModel::getFirstSymbol(QString str)
48
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlbasemodel.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlbasemodel.hpp
Changed
11
1
2
3
Q_INVOKABLE virtual QVariantList getItemsForIndexes(const QModelIndexList & indexes) const;
4
5
- Q_INVOKABLE QMap<QString, QVariant> getDataAt(int index);
6
+ Q_INVOKABLE QMap<QString, QVariant> getDataAt(const QModelIndex & index);
7
+ Q_INVOKABLE QMap<QString, QVariant> getDataAt(int idx);
8
9
signals:
10
void parentIdChanged();
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlevent.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlevent.hpp
Changed
27
1
2
case VLC_ML_EVENT_ALBUM_ADDED:
3
creation.i_entity_id = event->creation.p_album->i_id;
4
break;
5
+ case VLC_ML_EVENT_GROUP_ADDED:
6
+ creation.i_entity_id = event->creation.p_group->i_id;
7
+ break;
8
case VLC_ML_EVENT_PLAYLIST_ADDED:
9
creation.i_entity_id = event->creation.p_playlist->i_id;
10
break;
11
12
case VLC_ML_EVENT_MEDIA_UPDATED:
13
case VLC_ML_EVENT_ARTIST_UPDATED:
14
case VLC_ML_EVENT_ALBUM_UPDATED:
15
+ case VLC_ML_EVENT_GROUP_UPDATED:
16
case VLC_ML_EVENT_PLAYLIST_UPDATED:
17
case VLC_ML_EVENT_GENRE_UPDATED:
18
case VLC_ML_EVENT_BOOKMARKS_UPDATED:
19
20
case VLC_ML_EVENT_MEDIA_DELETED:
21
case VLC_ML_EVENT_ARTIST_DELETED:
22
case VLC_ML_EVENT_ALBUM_DELETED:
23
+ case VLC_ML_EVENT_GROUP_DELETED:
24
case VLC_ML_EVENT_PLAYLIST_DELETED:
25
case VLC_ML_EVENT_GENRE_DELETED:
26
case VLC_ML_EVENT_BOOKMARKS_DELETED:
27
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlgroup.cpp
Added
72
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+#include "mlgroup.hpp"
23
+
24
+// VLC includes
25
+#include <vlc_media_library.h>
26
+#include "qt.hpp"
27
+
28
+//-------------------------------------------------------------------------------------------------
29
+// Ctor / dtor
30
+//-------------------------------------------------------------------------------------------------
31
+
32
+MLGroup::MLGroup(vlc_medialibrary_t * ml, const vlc_ml_group_t * data, QObject * parent)
33
+ : QObject(parent)
34
+ , MLItem(MLItemId(data->i_id, VLC_ML_PARENT_GROUP))
35
+ , m_ml(ml)
36
+ , m_name(qfu(data->psz_name))
37
+ , m_duration(data->i_duration)
38
+ , m_date(data->i_creation_date)
39
+ , m_count(data->i_nb_total_media)
40
+{
41
+ assert(data);
42
+}
43
+
44
+//-------------------------------------------------------------------------------------------------
45
+// Interface
46
+//-------------------------------------------------------------------------------------------------
47
+
48
+QString MLGroup::getName() const
49
+{
50
+ return m_name;
51
+}
52
+
53
+QString MLGroup::getThumbnail()
54
+{
55
+ return QString();
56
+}
57
+
58
+int64_t MLGroup::getDuration() const
59
+{
60
+ return m_duration;
61
+}
62
+
63
+unsigned int MLGroup::getDate() const
64
+{
65
+ return m_date;
66
+}
67
+
68
+unsigned int MLGroup::getCount() const
69
+{
70
+ return m_count;
71
+}
72
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlgroup.hpp
Added
66
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+#ifndef MLGROUP_HPP
23
+#define MLGROUP_HPP
24
+
25
+#ifdef HAVE_CONFIG_H
26
+#include "config.h"
27
+#endif
28
+
29
+// MediaLibrary includes
30
+#include "mlqmltypes.hpp"
31
+
32
+// Qt includes
33
+#include <QObject>
34
+
35
+class MLGroup : public QObject, public MLItem
36
+{
37
+ Q_OBJECT
38
+
39
+public:
40
+ MLGroup(vlc_medialibrary_t * ml, const vlc_ml_group_t * data, QObject * parent = nullptr);
41
+
42
+public: // Interface
43
+ QString getName() const;
44
+
45
+ QString getThumbnail();
46
+
47
+ int64_t getDuration() const;
48
+
49
+ unsigned int getDate() const;
50
+
51
+ unsigned int getCount() const;
52
+
53
+private:
54
+ vlc_medialibrary_t * m_ml;
55
+
56
+ QString m_name;
57
+
58
+ int64_t m_duration;
59
+
60
+ unsigned int m_date;
61
+
62
+ unsigned int m_count;
63
+};
64
+
65
+#endif
66
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlgrouplistmodel.cpp
Added
201
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+#if HAVE_CONFIG_H
23
+# include "config.h"
24
+#endif
25
+
26
+#include "mlgrouplistmodel.hpp"
27
+
28
+// VLC includes
29
+#include <vlc_media_library.h>
30
+
31
+// MediaLibrary includes
32
+#include "mlhelper.hpp"
33
+#include "mlgroup.hpp"
34
+#include "mlvideo.hpp"
35
+
36
+//-------------------------------------------------------------------------------------------------
37
+// Static variables
38
+
39
+static const QHash<QByteArray, vlc_ml_sorting_criteria_t> criterias =
40
+{
41
+ {"id", VLC_ML_SORTING_DEFAULT},
42
+ {"name", VLC_ML_SORTING_ALPHA},
43
+ {"date", VLC_ML_SORTING_INSERTIONDATE}
44
+};
45
+
46
+//=================================================================================================
47
+// MLGroupListModel
48
+//=================================================================================================
49
+
50
+/* explicit */ MLGroupListModel::MLGroupListModel(vlc_medialibrary_t * ml, QObject * parent)
51
+ : MLBaseModel(parent)
52
+{
53
+ m_ml = ml;
54
+}
55
+
56
+/* explicit */ MLGroupListModel::MLGroupListModel(QObject * parent)
57
+ : MLBaseModel(parent) {}
58
+
59
+//-------------------------------------------------------------------------------------------------
60
+// QAbstractItemModel implementation
61
+//-------------------------------------------------------------------------------------------------
62
+
63
+QHash<int, QByteArray> MLGroupListModel::roleNames() const /* override */
64
+{
65
+ return
66
+ {
67
+ { GROUP_ID, "id" },
68
+ { GROUP_NAME, "name" },
69
+ { GROUP_THUMBNAIL, "thumbnail" },
70
+ { GROUP_DURATION, "duration" },
71
+ { GROUP_DATE, "date" },
72
+ { GROUP_COUNT, "count" },
73
+ // NOTE: Media specific.
74
+ { GROUP_TITLE, "title" },
75
+ { GROUP_RESOLUTION, "resolution_name" },
76
+ { GROUP_CHANNEL, "channel" },
77
+ { GROUP_MRL, "mrl" },
78
+ { GROUP_MRL_DISPLAY, "display_mrl" },
79
+ { GROUP_PROGRESS, "progress" },
80
+ { GROUP_PLAYCOUNT, "playcount" },
81
+ { GROUP_VIDEO_TRACK, "videoDesc" },
82
+ { GROUP_AUDIO_TRACK, "audioDesc" },
83
+ { GROUP_TITLE_FIRST_SYMBOL, "title_first_symbol" }
84
+ };
85
+}
86
+
87
+QVariant MLGroupListModel::data(const QModelIndex & index, int role) const /* override */
88
+{
89
+
90
+ MLItem * item = this->item(index.row());
91
+
92
+ if (item == nullptr)
93
+ return QVariant();
94
+
95
+ if (item->getId().type == VLC_ML_PARENT_GROUP)
96
+ {
97
+ MLGroup * group = static_cast<MLGroup *> (item);
98
+
99
+ switch (role)
100
+ {
101
+ // NOTE: This is the condition for QWidget view(s).
102
+ case Qt::DisplayRole:
103
+ if (index.column() == 0)
104
+ return QVariant::fromValue(group->getName());
105
+ else
106
+ return QVariant();
107
+ // NOTE: These are the conditions for QML view(s).
108
+ case GROUP_ID:
109
+ return QVariant::fromValue(group->getId());
110
+ case GROUP_NAME:
111
+ return QVariant::fromValue(group->getName());
112
+ case GROUP_THUMBNAIL:
113
+ return QVariant::fromValue(group->getThumbnail());
114
+ case GROUP_DURATION:
115
+ return QVariant::fromValue(group->getDuration());
116
+ case GROUP_DATE:
117
+ return QVariant::fromValue(group->getDate());
118
+ case GROUP_COUNT:
119
+ return QVariant::fromValue(group->getCount());
120
+ default:
121
+ return QVariant();
122
+ }
123
+ }
124
+ else
125
+ {
126
+ MLVideo * video = static_cast<MLVideo *> (item);
127
+
128
+ switch (role)
129
+ {
130
+ // NOTE: This is the condition for QWidget view(s).
131
+ case Qt::DisplayRole:
132
+ if (index.column() == 0)
133
+ return QVariant::fromValue(video->getTitle());
134
+ else
135
+ return QVariant();
136
+ // NOTE: These are the conditions for QML view(s).
137
+ case GROUP_ID:
138
+ return QVariant::fromValue(video->getId());
139
+ case GROUP_NAME:
140
+ return QVariant::fromValue(video->getTitle());
141
+ case GROUP_THUMBNAIL:
142
+ return QVariant::fromValue(video->getThumbnail());
143
+ case GROUP_DURATION:
144
+ return QVariant::fromValue(video->getDuration());
145
+ case GROUP_DATE:
146
+ return QVariant();
147
+ case GROUP_COUNT:
148
+ return 1;
149
+ // NOTE: Media specific.
150
+ case GROUP_TITLE:
151
+ return QVariant::fromValue(video->getTitle());
152
+ case GROUP_RESOLUTION:
153
+ return QVariant::fromValue(video->getResolutionName());
154
+ case GROUP_CHANNEL:
155
+ return QVariant::fromValue(video->getChannel());
156
+ case GROUP_MRL:
157
+ return QVariant::fromValue(video->getMRL());
158
+ case GROUP_MRL_DISPLAY:
159
+ return QVariant::fromValue(video->getDisplayMRL());
160
+ case GROUP_PROGRESS:
161
+ return QVariant::fromValue(video->getProgress());
162
+ case GROUP_PLAYCOUNT:
163
+ return QVariant::fromValue(video->getPlayCount());
164
+ case GROUP_VIDEO_TRACK:
165
+ return QVariant::fromValue(video->getVideoDesc());
166
+ case GROUP_AUDIO_TRACK:
167
+ return QVariant::fromValue(video->getAudioDesc());
168
+ case GROUP_TITLE_FIRST_SYMBOL:
169
+ return QVariant::fromValue(getFirstSymbol(video->getTitle()));
170
+ default:
171
+ return QVariant();
172
+ }
173
+ }
174
+}
175
+
176
+//-------------------------------------------------------------------------------------------------
177
+// Protected MLBaseModel implementation
178
+//-------------------------------------------------------------------------------------------------
179
+
180
+vlc_ml_sorting_criteria_t MLGroupListModel::roleToCriteria(int role) const /* override */
181
+{
182
+ switch (role)
183
+ {
184
+ case GROUP_NAME:
185
+ return VLC_ML_SORTING_ALPHA;
186
+ case GROUP_DATE:
187
+ return VLC_ML_SORTING_INSERTIONDATE;
188
+ default:
189
+ return VLC_ML_SORTING_DEFAULT;
190
+ }
191
+}
192
+
193
+vlc_ml_sorting_criteria_t MLGroupListModel::nameToCriteria(QByteArray name) const /* override */
194
+{
195
+ return criterias.value(name, VLC_ML_SORTING_DEFAULT);
196
+}
197
+
198
+QByteArray MLGroupListModel::criteriaToName(vlc_ml_sorting_criteria_t criteria) const
199
+/* override */
200
+{
201
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlgrouplistmodel.hpp
Added
93
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+#ifndef MLGROUPLISTMODEL_HPP
23
+#define MLGROUPLISTMODEL_HPP
24
+
25
+// MediaLibrary includes
26
+#include "mlbasemodel.hpp"
27
+
28
+// Forward declarations
29
+class vlc_medialibrary_t;
30
+
31
+class MLGroupListModel : public MLBaseModel
32
+{
33
+ Q_OBJECT
34
+
35
+public:
36
+ enum Roles
37
+ {
38
+ GROUP_ID = Qt::UserRole + 1,
39
+ GROUP_NAME,
40
+ GROUP_THUMBNAIL,
41
+ GROUP_DURATION,
42
+ GROUP_DATE,
43
+ GROUP_COUNT,
44
+ // NOTE: Media specific.
45
+ GROUP_TITLE,
46
+ GROUP_RESOLUTION,
47
+ GROUP_CHANNEL,
48
+ GROUP_MRL,
49
+ GROUP_MRL_DISPLAY,
50
+ GROUP_PROGRESS,
51
+ GROUP_PLAYCOUNT,
52
+ GROUP_VIDEO_TRACK,
53
+ GROUP_AUDIO_TRACK,
54
+ GROUP_TITLE_FIRST_SYMBOL
55
+ };
56
+
57
+public:
58
+ explicit MLGroupListModel(vlc_medialibrary_t * ml, QObject * parent = nullptr);
59
+
60
+ explicit MLGroupListModel(QObject * parent = nullptr);
61
+
62
+public: // QAbstractItemModel implementation
63
+ QHash<int, QByteArray> roleNames() const override;
64
+
65
+ QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
66
+
67
+protected: // MLBaseModel implementation
68
+ vlc_ml_sorting_criteria_t roleToCriteria(int role) const override;
69
+
70
+ vlc_ml_sorting_criteria_t nameToCriteria(QByteArray name) const override;
71
+
72
+ QByteArray criteriaToName(vlc_ml_sorting_criteria_t criteria) const override;
73
+
74
+ ListCacheLoader<std::unique_ptr<MLItem>> * createLoader() const override;
75
+
76
+private: // MLBaseModel implementation
77
+ void onVlcMlEvent(const MLEvent & event) override;
78
+
79
+ void thumbnailUpdated(int idx) override;
80
+
81
+private:
82
+ struct Loader : public MLBaseModel::BaseLoader
83
+ {
84
+ Loader(const MLGroupListModel & model);
85
+
86
+ size_t count() const override;
87
+
88
+ std::vector<std::unique_ptr<MLItem>> load(size_t index, size_t count) const override;
89
+ };
90
+};
91
+
92
+#endif // MLGROUPLISTMODEL_HPP
93
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlplaylistmedia.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlplaylistmedia.cpp
Changed
26
1
2
, m_type(data->i_type)
3
, m_title(qfu(data->psz_title))
4
, m_thumbnail(qfu(data->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl))
5
+ , m_thumbnailStatus(data->thumbnails[VLC_ML_THUMBNAIL_SMALL].i_status)
6
, m_duration(data->i_duration)
7
, m_progress(data->f_progress)
8
, m_playCount(data->i_playcount)
9
10
11
//-------------------------------------------------------------------------------------------------
12
13
-QString MLPlaylistMedia::getDuration() const
14
+int64_t MLPlaylistMedia::getDuration() const
15
{
16
- return MsToString(m_duration);
17
-}
18
-
19
-QString MLPlaylistMedia::getDurationShort() const
20
-{
21
- return MsToString(m_duration, true);
22
+ return m_duration;
23
}
24
25
//-------------------------------------------------------------------------------------------------
26
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlplaylistmedia.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlplaylistmedia.hpp
Changed
11
1
2
3
QString getThumbnail();
4
5
- QString getDuration () const;
6
- QString getDurationShort() const;
7
+ int64_t getDuration() const;
8
9
QString getResolutionName() const;
10
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlplaylistmodel.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlplaylistmodel.cpp
Changed
91
1
2
{"id", VLC_ML_SORTING_DEFAULT},
3
{"title", VLC_ML_SORTING_ALPHA},
4
{"duration", VLC_ML_SORTING_DURATION},
5
- {"duration_short", VLC_ML_SORTING_DURATION},
6
{"playcount", VLC_ML_SORTING_PLAYCOUNT},
7
};
8
9
10
{ MEDIA_TITLE, "title" },
11
{ MEDIA_THUMBNAIL, "thumbnail" },
12
{ MEDIA_DURATION, "duration" },
13
- { MEDIA_DURATION_SHORT, "duration_short" },
14
{ MEDIA_PROGRESS, "progress" },
15
{ MEDIA_PLAYCOUNT, "playcount" },
16
{ MEDIA_RESOLUTION, "resolution_name" },
17
18
return QVariant::fromValue(media->getThumbnail());
19
case MEDIA_DURATION:
20
return QVariant::fromValue(media->getDuration());
21
- case MEDIA_DURATION_SHORT:
22
- return QVariant::fromValue(media->getDurationShort());
23
case MEDIA_PROGRESS:
24
return QVariant::fromValue(media->getProgress());
25
case MEDIA_PLAYCOUNT:
26
27
case MEDIA_TITLE:
28
return VLC_ML_SORTING_ALPHA;
29
case MEDIA_DURATION:
30
- case MEDIA_DURATION_SHORT:
31
return VLC_ML_SORTING_DURATION;
32
case MEDIA_PLAYCOUNT:
33
return VLC_ML_SORTING_PLAYCOUNT;
34
35
}
36
37
//-------------------------------------------------------------------------------------------------
38
-// Private functions
39
+// Protected MLBaseModel reimplementation
40
+//-------------------------------------------------------------------------------------------------
41
42
-QList<int> MLPlaylistModel::getRows(const QModelIndexList & indexes) const
43
+void MLPlaylistModel::onVlcMlEvent(const MLEvent & event) /* override */
44
{
45
- QList<int> rows;
46
-
47
- for (const QModelIndex & index : indexes)
48
+ if (event.i_type == VLC_ML_EVENT_PLAYLIST_UPDATED)
49
{
50
- rows.append(index.row());
51
+ m_need_reset = true;
52
+
53
+ // NOTE: Maybe we should call this from MLBaseModel ?
54
+ emit resetRequested();
55
}
56
57
- return rows;
58
+ MLBaseModel::onVlcMlEvent(event);
59
+}
60
+
61
+void MLPlaylistModel::thumbnailUpdated(int idx) /* override */
62
+{
63
+ emit dataChanged(index(idx), index(idx), { MEDIA_THUMBNAIL });
64
}
65
66
//-------------------------------------------------------------------------------------------------
67
-// Private MLBaseModel reimplementation
68
+// Private functions
69
//-------------------------------------------------------------------------------------------------
70
71
-void MLPlaylistModel::onVlcMlEvent(const MLEvent & event) /* override */
72
+QList<int> MLPlaylistModel::getRows(const QModelIndexList & indexes) const
73
{
74
- if (event.i_type == VLC_ML_EVENT_PLAYLIST_UPDATED)
75
- {
76
- m_need_reset = true;
77
+ QList<int> rows;
78
79
- // NOTE: Maybe we should call this from MLBaseModel ?
80
- emit resetRequested();
81
+ for (const QModelIndex & index : indexes)
82
+ {
83
+ rows.append(index.row());
84
}
85
86
- MLBaseModel::onVlcMlEvent(event);
87
+ return rows;
88
}
89
90
//=================================================================================================
91
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlplaylistmodel.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlplaylistmodel.hpp
Changed
27
1
2
MEDIA_TITLE,
3
MEDIA_THUMBNAIL,
4
MEDIA_DURATION,
5
- MEDIA_DURATION_SHORT,
6
MEDIA_PROGRESS,
7
MEDIA_PLAYCOUNT,
8
MEDIA_RESOLUTION,
9
10
11
ListCacheLoader<std::unique_ptr<MLItem>> * createLoader() const override;
12
13
+protected: // MLBaseModel reimplementation
14
+ void onVlcMlEvent(const MLEvent & event) override;
15
+
16
+ void thumbnailUpdated(int idx) override;
17
+
18
private: // Functions
19
QList<int> getRows(const QModelIndexList & indexes) const;
20
21
-private: // MLBaseModel implementation
22
- void onVlcMlEvent(const MLEvent & event) override;
23
-
24
private:
25
struct Loader : public MLBaseModel::BaseLoader
26
{
27
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlqmltypes.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlqmltypes.hpp
Changed
9
1
2
ML_PARENT_TYPE_CASE(VLC_ML_PARENT_ARTIST);
3
ML_PARENT_TYPE_CASE(VLC_ML_PARENT_SHOW);
4
ML_PARENT_TYPE_CASE(VLC_ML_PARENT_GENRE);
5
+ ML_PARENT_TYPE_CASE(VLC_ML_PARENT_GROUP);
6
ML_PARENT_TYPE_CASE(VLC_ML_PARENT_PLAYLIST);
7
default:
8
return QString("UNKNONW - %2").arg(id);
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlurlmodel.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlurlmodel.cpp
Changed
28
1
2
3
void MLUrlModel::addAndPlay( const QString &url )
4
{
5
- QMetaObject::invokeMethod( this
6
- , [this, url]() {
7
- ml_unique_ptr<vlc_ml_media_t> s{vlc_ml_get_media_by_mrl( m_ml, qtu( url ))};
8
- if (!s) {
9
- s.reset(vlc_ml_new_stream( m_ml, qtu( url ) ));
10
- }
11
- if (!s)
12
- return;
13
- MLItemId itemId( s->i_id, VLC_ML_PARENT_UNKNOWN );
14
- m_mediaLib->addAndPlay(itemId);
15
- emit resetRequested();
16
- });
17
+ ml_unique_ptr<vlc_ml_media_t> s{vlc_ml_get_media_by_mrl( m_ml, qtu( url ))};
18
+ if (!s)
19
+ s.reset(vlc_ml_new_stream( m_ml, qtu( url ) ));
20
+ if (!s)
21
+ return;
22
+ MLItemId itemId( s->i_id, VLC_ML_PARENT_UNKNOWN );
23
+ m_mediaLib->addAndPlay(itemId);
24
+ emit resetRequested();
25
}
26
27
vlc_ml_sorting_criteria_t MLUrlModel::roleToCriteria(int role) const
28
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlvideo.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlvideo.cpp
Changed
35
1
2
, m_ml( ml )
3
, m_title( QString::fromUtf8( data->psz_title ) )
4
, m_thumbnail( QString::fromUtf8( data->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl ) )
5
+ , m_duration( data->i_duration )
6
, m_progress( data->f_progress )
7
, m_playCount( data->i_playcount )
8
, m_thumbnailStatus( data->thumbnails[VLC_ML_THUMBNAIL_SMALL].i_status )
9
10
{
11
assert( data->i_type == VLC_ML_MEDIA_TYPE_VIDEO || data->i_type == VLC_ML_MEDIA_TYPE_UNKNOWN );
12
13
- m_duration = data->i_duration;
14
-
15
for( const vlc_ml_file_t& file: ml_range_iterate<vlc_ml_file_t>( data->p_files ) )
16
if( file.i_type == VLC_ML_FILE_TYPE_MAIN )
17
{
18
19
return m_thumbnail;
20
}
21
22
-QString MLVideo::getDuration() const
23
-{
24
- return MsToString( m_duration );
25
-}
26
-
27
-QString MLVideo::getDurationShort() const
28
+int64_t MLVideo::getDuration() const
29
{
30
- return MsToString( m_duration, true );
31
+ return m_duration;
32
}
33
34
QString MLVideo::getMRL() const
35
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlvideo.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlvideo.hpp
Changed
11
1
2
3
QString getTitle() const;
4
QString getThumbnail();
5
- QString getDuration() const;
6
- QString getDurationShort() const;
7
+ int64_t getDuration() const;
8
QString getResolutionName() const;
9
QString getChannel() const;
10
QString getMRL() const;
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlvideomodel.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlvideomodel.cpp
Changed
90
1
2
{"id", VLC_ML_SORTING_DEFAULT},
3
{"title", VLC_ML_SORTING_ALPHA},
4
{"duration", VLC_ML_SORTING_DURATION},
5
- {"duration_short", VLC_ML_SORTING_DURATION},
6
{"playcount", VLC_ML_SORTING_PLAYCOUNT},
7
};
8
9
10
return QVariant::fromValue( video->getThumbnail() );
11
case VIDEO_DURATION:
12
return QVariant::fromValue( video->getDuration() );
13
- case VIDEO_DURATION_SHORT:
14
- return QVariant::fromValue( video->getDurationShort() );
15
case VIDEO_PROGRESS:
16
return QVariant::fromValue( video->getProgress() );
17
case VIDEO_PLAYCOUNT:
18
19
{ VIDEO_TITLE, "title" },
20
{ VIDEO_THUMBNAIL, "thumbnail" },
21
{ VIDEO_DURATION, "duration" },
22
- { VIDEO_DURATION_SHORT, "duration_short" },
23
{ VIDEO_PROGRESS, "progress" },
24
{ VIDEO_PLAYCOUNT, "playcount" },
25
{ VIDEO_RESOLUTION, "resolution_name" },
26
27
case VIDEO_TITLE:
28
return VLC_ML_SORTING_ALPHA;
29
case VIDEO_DURATION:
30
- case VIDEO_DURATION_SHORT:
31
return VLC_ML_SORTING_DURATION;
32
case VIDEO_PLAYCOUNT:
33
return VLC_ML_SORTING_PLAYCOUNT;
34
35
return new Loader(*this);
36
}
37
38
-size_t MLVideoModel::Loader::count() const
39
+size_t MLVideoModel::Loader::count() const /* override */
40
{
41
- MLQueryParams params = getParams();
42
- auto queryParams = params.toCQueryParams();
43
+ vlc_ml_query_params_t params = getParams().toCQueryParams();
44
45
- return vlc_ml_count_video_media(m_ml, &queryParams);
46
+ int64_t id = m_parent.id;
47
+
48
+ if (id <= 0)
49
+ return vlc_ml_count_video_media(m_ml, ¶ms);
50
+ else
51
+ return vlc_ml_count_media_of(m_ml, ¶ms, m_parent.type, id);
52
}
53
54
std::vector<std::unique_ptr<MLItem>>
55
-MLVideoModel::Loader::load(size_t index, size_t count) const
56
+MLVideoModel::Loader::load(size_t index, size_t count) const /* override */
57
{
58
- MLQueryParams params = getParams(index, count);
59
- auto queryParams = params.toCQueryParams();
60
+ vlc_ml_query_params_t params = getParams(index, count).toCQueryParams();
61
+
62
+ ml_unique_ptr<vlc_ml_media_list_t> list;
63
+
64
+ int64_t id = m_parent.id;
65
66
- ml_unique_ptr<vlc_ml_media_list_t> media_list{ vlc_ml_list_video_media(
67
- m_ml, &queryParams ) };
68
- if ( media_list == nullptr )
69
+ if (id <= 0)
70
+ list.reset(vlc_ml_list_video_media(m_ml, ¶ms));
71
+ else
72
+ list.reset(vlc_ml_list_media_of(m_ml, ¶ms, m_parent.type, id));
73
+
74
+ if (list == nullptr)
75
return {};
76
- std::vector<std::unique_ptr<MLItem>> res;
77
- for( vlc_ml_media_t &media: ml_range_iterate<vlc_ml_media_t>( media_list ) )
78
- res.emplace_back( std::make_unique<MLVideo>(m_ml, &media) );
79
- return res;
80
+
81
+ std::vector<std::unique_ptr<MLItem>> result;
82
+
83
+ for (const vlc_ml_media_t & media : ml_range_iterate<vlc_ml_media_t>(list))
84
+ {
85
+ result.emplace_back(std::make_unique<MLVideo>(m_ml, &media));
86
+ }
87
+
88
+ return result;
89
}
90
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/mlvideomodel.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/mlvideomodel.hpp
Changed
9
1
2
VIDEO_TITLE,
3
VIDEO_THUMBNAIL,
4
VIDEO_DURATION,
5
- VIDEO_DURATION_SHORT,
6
VIDEO_PROGRESS,
7
VIDEO_PLAYCOUNT,
8
VIDEO_RESOLUTION,
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
Changed
23
1
2
import QtGraphicalEffects 1.0
3
4
import org.videolan.medialib 0.1
5
+import org.videolan.controls 0.1
6
7
import "qrc:///widgets/" as Widgets
8
import "qrc:///style/"
9
10
Layout.preferredHeight: VLCStyle.cover_normal
11
Layout.preferredWidth: VLCStyle.cover_normal
12
13
- Widgets.RoundImage {
14
+ RoundImage {
15
source: artist.cover || VLCStyle.noArtArtist
16
height: VLCStyle.cover_normal
17
width: VLCStyle.cover_normal
18
radius: VLCStyle.cover_normal
19
-
20
}
21
22
Rectangle {
23
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/AudioGridItem.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/AudioGridItem.qml
Changed
10
1
2
subtitle: model.main_artist || i18n.qtr("Unknown artist")
3
pictureWidth: VLCStyle.gridCover_music_width
4
pictureHeight: VLCStyle.gridCover_music_height
5
- playCoverBorder.width: VLCStyle.gridCover_music_border
6
+ playCoverBorderWidth: VLCStyle.gridCover_music_border
7
onPlayClicked: {
8
if ( model.id !== undefined ) {
9
medialib.addAndPlay( model.id )
10
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
Added
75
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+import QtQuick 2.11
23
+
24
+import org.videolan.medialib 0.1
25
+
26
+import "qrc:///widgets/" as Widgets
27
+import "qrc:///style/"
28
+
29
+VideoAll {
30
+ id: root
31
+
32
+ //---------------------------------------------------------------------------------------------
33
+ // Properties
34
+ //---------------------------------------------------------------------------------------------
35
+
36
+ property int initialIndex: 0
37
+ property var initialId
38
+ property string initialName
39
+
40
+ //---------------------------------------------------------------------------------------------
41
+ // Aliases
42
+ //---------------------------------------------------------------------------------------------
43
+
44
+ // NOTE: This is used to determine which media(s) shall be displayed.
45
+ property alias parentId: modelGroup.parentId
46
+
47
+ // NOTE: The name of the group.
48
+ property string name
49
+
50
+ //---------------------------------------------------------------------------------------------
51
+ // Childs
52
+ //---------------------------------------------------------------------------------------------
53
+
54
+ model: MLVideoModel {
55
+ id: modelGroup
56
+
57
+ ml: medialib
58
+
59
+ parentId: initialId
60
+ }
61
+
62
+ header: Column {
63
+ topPadding: VLCStyle.margin_normal
64
+
65
+ Widgets.SubtitleLabel {
66
+ width: root.width
67
+
68
+ leftPadding : VLCStyle.margin_xlarge
69
+ bottomPadding: VLCStyle.margin_xsmall
70
+
71
+ text: root.name
72
+ }
73
+ }
74
+}
75
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MediaGroupList.qml
Added
201
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+import QtQuick 2.11
23
+
24
+import org.videolan.medialib 0.1
25
+
26
+import "qrc:///widgets/" as Widgets
27
+import "qrc:///main/" as MainInterface
28
+import "qrc:///util/" as Util
29
+import "qrc:///style/"
30
+
31
+Widgets.NavigableFocusScope {
32
+ id: root
33
+
34
+ //---------------------------------------------------------------------------------------------
35
+ // Properties
36
+ //---------------------------------------------------------------------------------------------
37
+
38
+ readonly property int currentIndex: currentItem.currentIndex
39
+
40
+ property int initialIndex: 0
41
+
42
+ property var sortModel: [
43
+ { text: i18n.qtr("Alphabetic"), criteria: "name" },
44
+ { text: i18n.qtr("Date"), criteria: "date" }
45
+ ]
46
+
47
+ //---------------------------------------------------------------------------------------------
48
+ // Alias
49
+ //---------------------------------------------------------------------------------------------
50
+
51
+ property alias model: model
52
+
53
+ property alias currentItem: view.currentItem
54
+
55
+ //---------------------------------------------------------------------------------------------
56
+ // Signals
57
+ //---------------------------------------------------------------------------------------------
58
+
59
+ signal showList(variant model)
60
+
61
+ //---------------------------------------------------------------------------------------------
62
+ // Settings
63
+ //---------------------------------------------------------------------------------------------
64
+
65
+ navigationCancel: function() {
66
+ if (currentItem.currentIndex > 0) {
67
+ currentItem.currentIndex = 0;
68
+
69
+ currentItem.positionViewAtIndex(0, ItemView.Contain);
70
+ } else {
71
+ defaultNavigationCancel();
72
+ }
73
+ }
74
+
75
+ //---------------------------------------------------------------------------------------------
76
+ // Events
77
+ //---------------------------------------------------------------------------------------------
78
+
79
+ onModelChanged: resetFocus()
80
+
81
+ onInitialIndexChanged: resetFocus()
82
+
83
+ //---------------------------------------------------------------------------------------------
84
+ // Connections
85
+ //---------------------------------------------------------------------------------------------
86
+
87
+ Connections {
88
+ target: mainInterface
89
+
90
+ onGridViewChanged: {
91
+ if (mainInterface.gridView) view.replace(grid);
92
+ else view.replace(list);
93
+ }
94
+ }
95
+
96
+ //---------------------------------------------------------------------------------------------
97
+ // Functions
98
+ //---------------------------------------------------------------------------------------------
99
+
100
+ function setCurrentItemFocus() { listView.currentItem.forceActiveFocus() }
101
+
102
+ function resetFocus() {
103
+ if (model.count === 0) return;
104
+
105
+ var initialIndex = root.initialIndex;
106
+
107
+ if (initialIndex >= model.count)
108
+ initialIndex = 0;
109
+
110
+ modelSelect.select(model.index(initialIndex, 0), ItemSelectionModel.ClearAndSelect);
111
+
112
+ if (currentItem)
113
+ currentItem.positionViewAtIndex(initialIndex, ItemView.Contain);
114
+ }
115
+
116
+ //---------------------------------------------------------------------------------------------
117
+ // Private
118
+
119
+ function _actionAtIndex() {
120
+ if (modelSelect.selectedIndexes.length > 1) {
121
+ _play(model.getIdsForIndexes(modelSelect.selectedIndexes));
122
+ } else if (modelSelect.selectedIndexes.length === 1) {
123
+ var index = modelSelect.selectedIndexes[0];
124
+ _showList(model.getDataAt(index));
125
+ }
126
+ }
127
+
128
+ function _play(ids) {
129
+ g_mainDisplay.showPlayer();
130
+
131
+ medialib.addAndPlay(ids);
132
+ }
133
+
134
+ function _showList(model)
135
+ {
136
+ // NOTE: If the count is 1 we consider the group is a media.
137
+ if (model.count == 1)
138
+ _play(model.id);
139
+ else
140
+ showList(model);
141
+ }
142
+
143
+ //---------------------------------------------------------------------------------------------
144
+
145
+ function _getLabels(model, string)
146
+ {
147
+ var count = model.count;
148
+
149
+ if (count === 1) {
150
+ return [
151
+ model.resolution_name || "",
152
+ model.channel || ""
153
+ ].filter(function(a) { return a !== "" });
154
+ } else return [
155
+ string.arg(count)
156
+ ];
157
+ }
158
+
159
+ //---------------------------------------------------------------------------------------------
160
+ // Childs
161
+ //---------------------------------------------------------------------------------------------
162
+
163
+ MLGroupListModel {
164
+ id: model
165
+
166
+ ml: medialib
167
+
168
+ onCountChanged: {
169
+ if (count === 0 || modelSelect.hasSelection) return;
170
+
171
+ resetFocus();
172
+ }
173
+ }
174
+
175
+ Util.SelectableDelegateModel {
176
+ id: modelSelect
177
+
178
+ model: root.model
179
+ }
180
+
181
+ Widgets.StackViewExt {
182
+ id: view
183
+
184
+ anchors.fill: parent
185
+
186
+ initialItem: (mainInterface.gridView) ? grid : list
187
+
188
+ focus: (model.count !== 0)
189
+ }
190
+
191
+ GroupListContextMenu {
192
+ id: contextMenu
193
+
194
+ model: root.model
195
+ }
196
+
197
+ Widgets.DragItem {
198
+ id: dragItem
199
+
200
+ function updateComponents(maxCovers) {
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicAlbums.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
Changed
39
1
2
delegateModel: selectionModel
3
model: albumModelId
4
5
+ Widgets.GridShadows {
6
+ id: shadows
7
+
8
+ coverWidth: VLCStyle.gridCover_music_width
9
+ coverHeight: VLCStyle.gridCover_music_height
10
+ }
11
+
12
delegate: AudioGridItem {
13
id: audioGridItem
14
15
opacity: gridView_id.expandIndex !== -1 && gridView_id.expandIndex !== audioGridItem.index ? .7 : 1
16
dragItem: albumDragItem
17
+ unselectedUnderlay: shadows.unselected
18
+ selectedUnderlay: shadows.selected
19
20
onItemClicked : gridView_id.leftClickOnItem(modifier, index)
21
22
23
sortModel: [
24
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: i18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
25
{ criteria: "main_artist", width: VLCStyle.colWidth(Math.max(tableView_id._nbCols - 3, 1)), text: i18n.qtr("Artist") },
26
- { criteria: "duration_short", width:VLCStyle.colWidth(1), showSection: "", headerDelegate: tableColumns.timeHeaderDelegate, colDelegate: tableColumns.timeColDelegate },
27
+ { criteria: "duration", width:VLCStyle.colWidth(1), showSection: "", headerDelegate: tableColumns.timeHeaderDelegate, colDelegate: tableColumns.timeColDelegate },
28
]
29
30
navigationCancel: function() {
31
32
33
onContextMenuButtonClicked: contextMenu.popup(selectionModel.selectedIndexes, menuParent.mapToGlobal(0,0))
34
onRightClick: contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
35
+ onItemDoubleClicked: medialib.addAndPlay( model.id )
36
37
Widgets.TableColumns {
38
id: tableColumns
39
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
Changed
42
1
2
import QtQml.Models 2.11
3
4
import org.videolan.medialib 0.1
5
+import org.videolan.controls 0.1
6
7
import "qrc:///widgets/" as Widgets
8
+import "qrc:///util/Helpers.js" as Helpers
9
import "qrc:///style/"
10
11
Widgets.NavigableFocusScope {
12
13
height: VLCStyle.expandCover_music_height
14
width: VLCStyle.expandCover_music_width
15
16
- Widgets.RoundImage {
17
+ RoundImage {
18
id: expand_cover_id
19
- asynchronous: true
20
+
21
height: VLCStyle.expandCover_music_height
22
width: VLCStyle.expandCover_music_width
23
radius: VLCStyle.expandCover_music_radius
24
25
text: i18n.qtr("%1 - %2 - %3")
26
.arg(model.main_artist || i18n.qtr("Unknown artist"))
27
.arg(model.release_year || "")
28
- .arg(model.duration || "")
29
+ .arg(Helpers.msToString(model.duration) || "")
30
31
Layout.fillWidth: true
32
Layout.preferredHeight: implicitHeight
33
34
35
sortModel: [
36
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(Math.max(expand_track_id._nbCols - 1, 1)), visible: true, text: i18n.qtr("Title"), showSection: "", colDelegate: titleDelegate, headerDelegate: titleHeaderDelegate },
37
- { criteria: "duration_short", width: VLCStyle.colWidth(1), visible: true, showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
38
+ { criteria: "duration", width: VLCStyle.colWidth(1), visible: true, showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
39
]
40
41
navigationParent: root
42
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicArtist.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicArtist.qml
Changed
134
1
2
id: root
3
4
property var artist: ({})
5
- readonly property var currentIndex: headerItem.albumsListView.currentIndex || view.currentItem.currentIndex
6
- property Item headerItem: view.currentItem.headerItem
7
+
8
//the index to "go to" when the view is loaded
9
property var initialIndex: 0
10
11
+ property Item headerItem: view.currentItem ? view.currentItem.headerItem : null
12
+
13
+ // current index of album model
14
+ readonly property int currentIndex: {
15
+ if (!view.currentItem)
16
+ return -1
17
+ else if (mainInterface.gridView)
18
+ return view.currentItem.currentIndex
19
+ else
20
+ return headerItem.albumsListView.currentIndex
21
+ }
22
+
23
property Component header: FocusScope {
24
- property Item albumsListView: albumsLoader.item.albumsListView
25
+ property Item albumsListView: albumsLoader.status === Loader.Ready ? albumsLoader.item.albumsListView: null
26
property Item focusItem: albumsLoader.active ? albumsLoader.item.albumsListView : artistBanner
27
28
focus: true
29
30
Column {
31
id: col
32
33
- height: childrenRect.height + VLCStyle.margin_normal
34
+ height: implicitHeight
35
width: root.width
36
+ bottomPadding: VLCStyle.margin_normal
37
38
ArtistTopBanner {
39
id: artistBanner
40
41
property alias albumsListView: albumsList
42
43
width: root.width
44
- height: childrenRect.height
45
+ height: implicitHeight
46
47
Widgets.SubtitleLabel {
48
id: albumsText
49
50
image: model.cover || VLCStyle.noArtAlbum
51
title: model.title || i18n.qtr("Unknown title")
52
subtitle: model.release_year || ""
53
- textHorizontalAlignment: Text.AlignHCenter
54
+ textAlignHCenter: true
55
x: selectedBorderWidth
56
y: selectedBorderWidth
57
pictureWidth: VLCStyle.gridCover_music_width
58
pictureHeight: VLCStyle.gridCover_music_height
59
- playCoverBorder.width: VLCStyle.gridCover_music_border
60
+ playCoverBorderWidth: VLCStyle.gridCover_music_border
61
dragItem: albumDragItem
62
+ unselectedUnderlay: shadows.unselected
63
+ selectedUnderlay: shadows.selected
64
65
onPlayClicked: play()
66
onItemDoubleClicked: play()
67
68
onSelectAll: albumSelectionModel.selectAll()
69
onSelectionUpdated: albumSelectionModel.updateSelection( keyModifiers, oldIndex, newIndex )
70
onActionAtIndex: medialib.addAndPlay( albumModel.getIdForIndex( index ) )
71
+
72
+ Widgets.GridShadows {
73
+ id: shadows
74
+
75
+ coverWidth: VLCStyle.gridCover_music_width
76
+ coverHeight: VLCStyle.gridCover_music_height
77
+ }
78
}
79
80
Widgets.SubtitleLabel {
81
82
83
ml: medialib
84
parentId: albumModel.parentId
85
-
86
- onCountChanged: {
87
- if (trackModel.count > 0) {
88
- root.resetFocus()
89
- }
90
- }
91
}
92
93
AlbumContextMenu {
94
95
96
opacity: gridView_id.expandIndex !== -1 && gridView_id.expandIndex !== audioGridItem.index ? .7 : 1
97
dragItem: albumDragItem
98
+ unselectedUnderlay: shadows.unselected
99
+ selectedUnderlay: shadows.selected
100
101
onItemClicked : gridView_id.leftClickOnItem(modifier, index)
102
103
104
target: contextMenu
105
onShowMediaInformation: gridView_id.switchExpandItem( index )
106
}
107
+
108
+ Widgets.GridShadows {
109
+ id: shadows
110
+
111
+ coverWidth: VLCStyle.gridCover_music_width
112
+ coverHeight: VLCStyle.gridCover_music_height
113
+ }
114
}
115
116
}
117
118
sortModel: [
119
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: i18n.qtr("Title"), headerDelegate: tableColumns.titleHeaderDelegate, colDelegate: tableColumns.titleDelegate },
120
{ criteria: "album_title", width: VLCStyle.colWidth(Math.max(tableView_id._nbCols - 3, 1)), text: i18n.qtr("Album") },
121
- { criteria: "duration_short", width:VLCStyle.colWidth(1), showSection: "", headerDelegate: tableColumns.timeHeaderDelegate, colDelegate: tableColumns.timeColDelegate },
122
+ { criteria: "duration", width:VLCStyle.colWidth(1), showSection: "", headerDelegate: tableColumns.timeHeaderDelegate, colDelegate: tableColumns.timeColDelegate },
123
]
124
125
navigationCancel: function() {
126
127
tableView_id.currentIndex = 0;
128
}
129
130
+ onItemDoubleClicked: medialib.addAndPlay(model.id)
131
onContextMenuButtonClicked: trackContextMenu.popup(trackSelectionModel.selectedIndexes, menuParent.mapToGlobal(0,0))
132
onRightClick: trackContextMenu.popup(trackSelectionModel.selectedIndexes, globalMousePos)
133
dragItem: Widgets.DragItem {
134
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicArtistsAlbums.qml
Changed
46
1
2
import QtQuick.Layouts 1.3
3
4
import org.videolan.medialib 0.1
5
+import org.videolan.controls 0.1
6
7
import "qrc:///util/" as Util
8
+import "qrc:///util/Helpers.js" as Helpers
9
import "qrc:///widgets/" as Widgets
10
import "qrc:///main/" as MainInterface
11
import "qrc:///style/"
12
13
Widgets.KeyNavigableListView {
14
id: artistList
15
16
- z: 1
17
- width: resizeHandle.clamp(root.width / resizeHandle.widthFactor,
18
- VLCStyle.colWidth(1) + VLCStyle.column_margin_width,
19
- root.width * .5)
20
- height: parent.height
21
spacing: 4
22
model: artistModel
23
currentIndex: -1
24
+ z: 1
25
+ height: parent.height
26
+ width: Helpers.clamp(root.width / resizeHandle.widthFactor,
27
+ VLCStyle.colWidth(1) + VLCStyle.column_margin_width,
28
+ root.width * .5)
29
30
focus: true
31
footer: MainInterface.MiniPlayerBottomMargin {
32
33
bottomMargin: VLCStyle.margin_xsmall
34
}
35
36
- Widgets.RoundImage {
37
+ RoundImage {
38
source: model.cover || VLCStyle.noArtArtistSmall
39
height: VLCStyle.play_cover_small
40
width: VLCStyle.play_cover_small
41
radius: VLCStyle.play_cover_small
42
- mipmap: true
43
44
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
45
46
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
Changed
35
1
2
}
3
}
4
5
+ Widgets.GridShadows {
6
+ id: shadows
7
+
8
+ leftPadding: (VLCStyle.colWidth(1) - shadows.coverWidth) / 2 // GridItem's rect is horizontally centered
9
+ coverWidth: VLCStyle.artistGridCover_radius
10
+ coverHeight: VLCStyle.artistGridCover_radius
11
+ coverRadius: VLCStyle.artistGridCover_radius
12
+ }
13
+
14
delegate: AudioGridItem {
15
id: gridItem
16
17
18
pictureRadius: VLCStyle.artistGridCover_radius
19
pictureHeight: VLCStyle.artistGridCover_radius
20
pictureWidth: VLCStyle.artistGridCover_radius
21
- playCoverBorder.width: VLCStyle.dp(3, VLCStyle.scale)
22
+ playCoverBorderWidth: VLCStyle.dp(3, VLCStyle.scale)
23
titleMargin: VLCStyle.margin_xlarge
24
playIconSize: VLCStyle.play_cover_small
25
- textHorizontalAlignment: Text.AlignHCenter
26
+ textAlignHCenter: true
27
width: VLCStyle.colWidth(1)
28
dragItem: artistsDragItem
29
+ unselectedUnderlay: shadows.unselected
30
+ selectedUnderlay: shadows.selected
31
+
32
33
onItemClicked: artistGrid.leftClickOnItem(modifier, index)
34
35
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicGenres.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicGenres.qml
Changed
30
1
2
model: genreModel
3
topMargin: VLCStyle.margin_large
4
5
- delegate: Widgets.GridItem {
6
+ Widgets.GridShadows {
7
+ id: shadows
8
+
9
+ leftPadding: 0
10
+ coverWidth: VLCStyle.colWidth(2)
11
+ coverHeight: shadows.coverWidth / 2
12
+ }
13
+
14
+ delegate: Widgets.GridItem {
15
id: item
16
17
property var model: ({})
18
19
pictureWidth: width
20
pictureHeight: height
21
image: model.cover || VLCStyle.noArtAlbum
22
- playCoverBorder.width: VLCStyle.dp(3, VLCStyle.scale)
23
+ playCoverBorderWidth: VLCStyle.dp(3, VLCStyle.scale)
24
dragItem: genreDragItem
25
+ unselectedUnderlay: shadows.unselected
26
+ selectedUnderlay: shadows.selected
27
28
onItemDoubleClicked: root.showAlbumView(model)
29
onItemClicked: gridView_id.leftClickOnItem(modifier, item.index)
30
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
Changed
36
1
2
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(1), text: i18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate },
3
{ criteria: "album_title", width: VLCStyle.colWidth(1), text: i18n.qtr("Album"), showSection: "album_title" },
4
{ criteria: "main_artist", width: VLCStyle.colWidth(1), text: i18n.qtr("Artist"), showSection: "main_artist" },
5
- { criteria: "duration_short", width: VLCStyle.colWidth(1), text: i18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
6
+ { criteria: "duration", width: VLCStyle.colWidth(1), text: i18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
7
]
8
9
property var sortModelMedium: [
10
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(2), text: i18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate },
11
{ criteria: "album_title", width: VLCStyle.colWidth(2), text: i18n.qtr("Album"), showSection: "album_title" },
12
{ criteria: "main_artist", width: VLCStyle.colWidth(1), text: i18n.qtr("Artist"), showSection: "main_artist" },
13
- { criteria: "duration_short", width: VLCStyle.colWidth(1), text: i18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
14
+ { criteria: "duration", width: VLCStyle.colWidth(1), text: i18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
15
]
16
17
readonly property int _expandingColsSpan: Math.floor((VLCStyle.gridColumnsForWidth(root.availableRowWidth) - 3 /* static cols (track_number, etc)*/) / 3)
18
19
{ isPrimary: true, criteria: "title", width: VLCStyle.colWidth(root._expandingColsSpan), text: i18n.qtr("Title"), showSection: "title", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate },
20
{ criteria: "album_title", width: VLCStyle.colWidth(root._expandingColsSpan), text: i18n.qtr("Album"), showSection: "album_title" },
21
{ criteria: "main_artist", width: VLCStyle.colWidth(root._expandingColsSpan), text: i18n.qtr("Artist"), showSection: "main_artist" },
22
- { criteria: "duration_short", width: VLCStyle.colWidth(1), text: i18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
23
+ { criteria: "duration", width: VLCStyle.colWidth(1), text: i18n.qtr("Duration"), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate },
24
{ criteria: "track_number",width: VLCStyle.colWidth(1), text: i18n.qtr("Track"), showSection: "" },
25
{ criteria: "disc_number", width: VLCStyle.colWidth(1), text: i18n.qtr("Disc"), showSection: "" },
26
]
27
28
property alias parentId: rootmodel.parentId
29
30
onActionForSelection: medialib.addAndPlay(model.getIdsForIndexes( selection ))
31
-
32
+ onItemDoubleClicked: medialib.addAndPlay(model.id)
33
onContextMenuButtonClicked: contextMenu.popup(selectionModel.selectedIndexes, menuParent.mapToGlobal(0,0))
34
onRightClick: contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
35
36
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/PlaylistMedia.qml
Changed
51
1
2
3
import "qrc:///widgets/" as Widgets
4
import "qrc:///main/" as MainInterface
5
+import "qrc:///util/Helpers.js" as Helpers
6
import "qrc:///style/"
7
8
MainInterface.MainTableView {
9
10
11
text: i18n.qtr("Title")
12
}, {
13
- criteria: "duration_short",
14
+ criteria: "duration",
15
16
width: VLCStyle.colWidth(1),
17
18
19
//---------------------------------------------------------------------------------------------
20
21
onActionForSelection: medialib.addAndPlay(model.getIdsForIndexes(selection))
22
+ onItemDoubleClicked: medialib.addAndPlay(model.id)
23
24
//---------------------------------------------------------------------------------------------
25
// Connections
26
27
//---------------------------------------------------------------------------------------------
28
// Drop interface
29
30
- // FIXME: Maybe this could be a global function ?
31
- function isValidInstanceOf(object, type) {
32
- return (!!object && (object instanceof type));
33
- }
34
-
35
function isDroppable(drop, index) {
36
// NOTE: Internal drop (intra-playlist).
37
- return isValidInstanceOf(drop.source, Widgets.DragItem);
38
+ return Helpers.isValidInstanceOf(drop.source, Widgets.DragItem);
39
}
40
41
function applyDrop(drop, index) {
42
43
model.move(modelSelect.selectedIndexes, index);
44
45
// NOTE: Dropping medialibrary content into the playlist.
46
- } else if (isValidInstanceOf(item, Widgets.DragItem)) {
47
+ } else if (Helpers.isValidInstanceOf(item, Widgets.DragItem)) {
48
model.insert(item.getSelectedInputItem(), index);
49
}
50
51
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
Changed
17
1
2
}
3
4
//---------------------------------------------------------------------------------------------
5
- // Private
6
-
7
- function _actionAtIndex(index) {
8
- g_mainDisplay.showPlayer();
9
-
10
- medialib.addAndPlay(model.getIdsForIndexes(modelSelect.selectedIndexes));
11
- }
12
-
13
- //---------------------------------------------------------------------------------------------
14
// Childs
15
//---------------------------------------------------------------------------------------------
16
17
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
Changed
70
1
2
//---------------------------------------------------------------------------------------------
3
// Private
4
5
- function _actionAtIndex(index) {
6
+ function _actionAtIndex() {
7
if (modelSelect.selectedIndexes.length > 1) {
8
medialib.addAndPlay(model.getIdsForIndexes(modelSelect.selectedIndexes));
9
} else if (modelSelect.selectedIndexes.length === 1) {
10
- var indexes = modelSelect.selectedIndexes[0];
11
- showList(model.getDataAt(indexes));
12
+ var index = modelSelect.selectedIndexes[0];
13
+ showList(model.getDataAt(index));
14
}
15
}
16
17
18
19
onSelectionUpdated: modelSelect.updateSelection(keyModifiers, oldIndex, newIndex)
20
21
- onActionAtIndex: _actionAtIndex(index)
22
+ onActionAtIndex: _actionAtIndex()
23
24
//-------------------------------------------------------------------------------------
25
// Childs
26
27
28
dragItem: dragItemPlaylist
29
30
+ unselectedUnderlay: shadows.unselected
31
+ selectedUnderlay: shadows.selected
32
+
33
pictureOverlay: Item {
34
Column {
35
anchors.centerIn: parent
36
37
}
38
}
39
40
- playCoverBorder.width: VLCStyle.dp(3, VLCStyle.scale)
41
+ playCoverBorderWidth: VLCStyle.dp(3, VLCStyle.scale)
42
43
//---------------------------------------------------------------------------------
44
// Events
45
46
contextMenu.popup(modelSelect.selectedIndexes, globalMousePos);
47
}
48
}
49
+
50
+ Widgets.GridShadows {
51
+ id: shadows
52
+
53
+ coverWidth: root._width
54
+ coverHeight: root._height
55
+ }
56
}
57
}
58
59
60
//-------------------------------------------------------------------------------------
61
// Events
62
63
- onActionForSelection: _actionAtIndex(selection)
64
-
65
- onItemDoubleClicked: showList(model)
66
+ onActionForSelection: _actionAtIndex()
67
68
onContextMenuButtonClicked: contextMenu.popup(modelSelect.selectedIndexes,
69
menuParent.mapToGlobal(0,0))
70
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/UrlListDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/UrlListDisplay.qml
Changed
10
1
2
3
onActionForSelection: medialib.addAndPlay(model.getIdsForIndexes(
4
selection))
5
-
6
+ onItemDoubleClicked: medialib.addAndPlay(model.id)
7
onContextMenuButtonClicked: contextMenu.popup(selectionModel.selectedIndexes, menuParent.mapToGlobal(0,0))
8
onRightClick: contextMenu.popup(selectionModel.selectedIndexes, globalMousePos)
9
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/VideoAll.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoAll.qml
Changed
136
1
2
3
property int initialIndex: 0
4
5
+ property var model: MLVideoModel { ml: medialib }
6
+
7
property var sortModel: [
8
{ text: i18n.qtr("Alphabetic"), criteria: "title" },
9
- { text: i18n.qtr("Duration"), criteria: "duration_short" }
10
+ { text: i18n.qtr("Duration"), criteria: "duration" }
11
]
12
13
//---------------------------------------------------------------------------------------------
14
// Aliases
15
//---------------------------------------------------------------------------------------------
16
17
- // NOTE: This is used to determine which media(s) shall be displayed.
18
- property alias parentId: model.parentId
19
-
20
- property alias model: model
21
-
22
property alias currentItem: view.currentItem
23
24
//---------------------------------------------------------------------------------------------
25
26
}
27
}
28
29
+ Connections {
30
+ target: model
31
+
32
+ onCountChanged: {
33
+ if (count === 0 || modelSelect.hasSelection) return;
34
+
35
+ resetFocus();
36
+ }
37
+ }
38
+
39
//---------------------------------------------------------------------------------------------
40
// Functions
41
//---------------------------------------------------------------------------------------------
42
43
//---------------------------------------------------------------------------------------------
44
// Private
45
46
- function _actionAtIndex(index) {
47
+ function _actionAtIndex() {
48
g_mainDisplay.showPlayer();
49
50
medialib.addAndPlay(model.getIdsForIndexes(modelSelect.selectedIndexes));
51
52
// Childs
53
//---------------------------------------------------------------------------------------------
54
55
- MLVideoModel {
56
- id: model
57
-
58
- ml: medialib
59
-
60
- onCountChanged: {
61
- if (count === 0 || modelSelect.hasSelection) return;
62
-
63
- resetFocus();
64
- }
65
- }
66
-
67
Widgets.StackViewExt {
68
id: view
69
70
71
onRetract: gridView.retract()
72
}
73
74
+ //---------------------------------------------------------------------------------
75
+ // Shadows
76
+
77
+ Widgets.GridShadows {
78
+ id: shadows
79
+
80
+ coverWidth: VLCStyle.gridCover_video_width
81
+ coverHeight: VLCStyle.gridCover_video_height
82
+ }
83
+
84
delegate: VideoGridItem {
85
id: gridItem
86
87
//---------------------------------------------------------------------------------
88
+ // properties required by ExpandGridView
89
+
90
+ property var model: ({})
91
+ property int index: -1
92
+
93
+ //---------------------------------------------------------------------------------
94
// Settings
95
96
opacity: (gridView.expandIndex !== -1
97
98
gridView.expandIndex !== gridItem.index) ? 0.7 : 1
99
100
dragItem: root.dragItem
101
+ unselectedUnderlay: shadows.unselected
102
+ selectedUnderlay: shadows.selected
103
104
//---------------------------------------------------------------------------------
105
// Events
106
107
onItemClicked: gridView.leftClickOnItem(modifier, index)
108
109
+ onItemDoubleClicked: {
110
+ g_mainDisplay.showPlayer();
111
+
112
+ medialib.addAndPlay(model.id);
113
+ }
114
+
115
onContextMenuButtonClicked: {
116
gridView.rightClickOnItem(index);
117
118
119
120
onSelectionUpdated: modelSelect.updateSelection(keyModifiers, oldIndex, newIndex)
121
122
- onActionAtIndex: _actionAtIndex(index)
123
+ onActionAtIndex: _actionAtIndex()
124
125
//-------------------------------------------------------------------------------------
126
// Connections
127
128
//-------------------------------------------------------------------------------------
129
// Events
130
131
+ onActionForSelection: medialib.addAndPlay(model.getIdsForIndexes(selection))
132
+
133
onContextMenuButtonClicked: contextMenu.popup(modelSelect.selectedIndexes,
134
menuParent.mapToGlobal(0,0))
135
136
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/VideoDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoDisplay.qml
Changed
14
1
2
name: "all",
3
displayText: i18n.qtr("All"),
4
url: "qrc:///medialibrary/VideoAllDisplay.qml"
5
- }, {
6
+ },{
7
+ name: "groups",
8
+ displayText: i18n.qtr("Groups"),
9
+ url: "qrc:///medialibrary/VideoGroupsDisplay.qml"
10
+ },{
11
name: "playlists",
12
displayText: i18n.qtr("Playlists"),
13
url: "qrc:///medialibrary/VideoPlaylistsDisplay.qml"
14
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
Changed
62
1
2
3
import "qrc:///widgets/" as Widgets
4
import "qrc:///util/" as Util
5
+import "qrc:///util/Helpers.js" as Helpers
6
import "qrc:///style/"
7
8
Widgets.NavigableFocusScope {
9
10
width: VLCStyle.margin_xlarge
11
}
12
13
- delegate: Widgets.GridItem {
14
+ delegate: VideoGridItem {
15
id: recentVideoGridItem
16
17
focus: true
18
x: selectedBorderWidth
19
y: selectedBorderWidth
20
-
21
- image: model.thumbnail || VLCStyle.noArtCover
22
- title: model.title || i18n.qtr("Unknown title")
23
- subtitle: model.duration || ""
24
- labels: [
25
- model.resolution_name || "",
26
- model.channel || ""
27
- ].filter(function(a) { return a !== "" } )
28
- progress: model.progress > 0 ? model.progress : 0
29
pictureWidth: VLCStyle.gridCover_video_width_large
30
pictureHeight: VLCStyle.gridCover_video_height_large
31
- playCoverBorder.width: VLCStyle.gridCover_video_border
32
- titleMargin: VLCStyle.margin_xxsmall
33
- showNewIndicator: true
34
- onItemDoubleClicked: {
35
- if ( model.id !== undefined ) {
36
- g_mainDisplay.showPlayer()
37
- medialib.addAndPlay( model.id )
38
- }
39
- }
40
+ unselectedUnderlay: shadows.unselected
41
+ selectedUnderlay: shadows.selected
42
43
- onPlayClicked: {
44
+ onItemDoubleClicked: {
45
if ( model.id !== undefined ) {
46
g_mainDisplay.showPlayer()
47
medialib.addAndPlay( model.id )
48
49
g_mainDisplay.showPlayer()
50
medialib.addAndPlay( model.getIdsForIndexes( recentVideoSelection.selectedIndexes ) )
51
}
52
+
53
+ Widgets.GridShadows {
54
+ id: shadows
55
+
56
+ coverWidth: VLCStyle.gridCover_video_width_large
57
+ coverHeight: VLCStyle.gridCover_video_height_large
58
+ }
59
}
60
}
61
}
62
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/VideoGridItem.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
Changed
103
1
2
import org.videolan.medialib 0.1
3
4
import "qrc:///widgets/" as Widgets
5
+import "qrc:///util/Helpers.js" as Helpers
6
import "qrc:///style/"
7
8
Widgets.GridItem {
9
- property var model: ({})
10
- property int index: -1
11
+ id: root
12
13
- image: model.thumbnail || VLCStyle.noArtCover
14
- title: model.title || i18n.qtr("Unknown title")
15
- subtitle: model.duration || ""
16
- labels: [
17
+ property bool showNewIndicator: true
18
+ property int newIndicatorMedian: root.highlighted ? VLCStyle.icon_small : VLCStyle.icon_xsmall
19
+
20
+ property var labels: [
21
model.resolution_name || "",
22
model.channel || ""
23
- ].filter(function(a) { return a !== "" } )
24
- progress: model.progress > 0 ? model.progress : 0
25
+ ].filter(function(a) { return a !== "" })
26
+
27
+ image: model.thumbnail || VLCStyle.noArtCover
28
+ title: model.title || i18n.qtr("Unknown title")
29
+ subtitle: Helpers.msToString(model.duration) || ""
30
pictureWidth: VLCStyle.gridCover_video_width
31
pictureHeight: VLCStyle.gridCover_video_height
32
- playCoverBorder.width: VLCStyle.gridCover_video_border
33
+ playCoverBorderWidth: VLCStyle.gridCover_video_border
34
titleMargin: VLCStyle.margin_xxsmall
35
- showNewIndicator: true
36
- onItemDoubleClicked: {
37
- if ( model.id !== undefined ) {
38
- g_mainDisplay.showPlayer()
39
- medialib.addAndPlay( model.id )
40
+
41
+ pictureOverlay: Item {
42
+ width: root.pictureWidth
43
+ height: root.pictureHeight
44
+
45
+ Widgets.VideoQualityLabels {
46
+ anchors {
47
+ top: parent.top
48
+ right: parent.right
49
+ topMargin: VLCStyle.margin_xxsmall
50
+ leftMargin: VLCStyle.margin_xxsmall
51
+ rightMargin: VLCStyle.margin_xxsmall
52
+ }
53
+
54
+ labels: root.labels
55
+ }
56
+
57
+ Widgets.VideoProgressBar {
58
+ id: progressBar
59
+
60
+ visible: !root.highlighted && value > 0
61
+ value: model.progress > 0 ? model.progress : 0
62
+ anchors {
63
+ bottom: parent.bottom
64
+ left: parent.left
65
+ right: parent.right
66
+ rightMargin: root.pictureRadius
67
+ }
68
}
69
}
70
+
71
onPlayClicked: {
72
if ( model.id !== undefined ) {
73
g_mainDisplay.showPlayer()
74
medialib.addAndPlay( model.id )
75
}
76
}
77
+
78
+ Behavior on newIndicatorMedian {
79
+ NumberAnimation {
80
+ duration: 200
81
+ easing.type: Easing.InOutSine
82
+ }
83
+ }
84
+
85
+ Item {
86
+ clip: true
87
+ x: parent.width - width
88
+ y: 0
89
+ width: 2 * root.newIndicatorMedian
90
+ height: 2 * root.newIndicatorMedian
91
+ visible: root.showNewIndicator && model.progress <= 0
92
+
93
+ Rectangle {
94
+ x: parent.width - root.newIndicatorMedian
95
+ y: - root.newIndicatorMedian
96
+ width: 2 * root.newIndicatorMedian
97
+ height: 2 * root.newIndicatorMedian
98
+ color: VLCStyle.colors.accent
99
+ rotation: 45
100
+ }
101
+ }
102
}
103
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoGroupsDisplay.qml
Added
119
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * Authors: Benjamin Arnaud <bunjee@omega.gg>
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 2 of the License, or
10
+ * ( at your option ) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+
22
+import QtQuick 2.11
23
+import QtQuick.Controls 2.4
24
+import QtQuick.Layouts 1.3
25
+import QtQml.Models 2.2
26
+
27
+import org.videolan.medialib 0.1
28
+
29
+import "qrc:///widgets/" as Widgets
30
+import "qrc:///style/"
31
+
32
+Widgets.PageLoader {
33
+ id: root
34
+
35
+ //---------------------------------------------------------------------------------------------
36
+ // Aliases
37
+ //---------------------------------------------------------------------------------------------
38
+
39
+ property bool isViewMultiView: true
40
+
41
+ property variant model
42
+ property variant sortModel
43
+
44
+ //---------------------------------------------------------------------------------------------
45
+ // Settings
46
+ //---------------------------------------------------------------------------------------------
47
+
48
+ defaultPage: "all"
49
+
50
+ pageModel: [{
51
+ name: "all",
52
+ component: componentAll
53
+ }, {
54
+ name: "list",
55
+ component: componentList
56
+ }]
57
+
58
+ //---------------------------------------------------------------------------------------------
59
+ // Events
60
+ //---------------------------------------------------------------------------------------------
61
+
62
+ onCurrentItemChanged: {
63
+ model = currentItem.model;
64
+ sortModel = currentItem.sortModel;
65
+
66
+ isViewMultiView = (currentItem.isViewMultiView === undefined
67
+ ||
68
+ currentItem.isViewMultiView);
69
+ }
70
+
71
+ //---------------------------------------------------------------------------------------------
72
+ // Functions
73
+ //---------------------------------------------------------------------------------------------
74
+ // Private
75
+
76
+ function _updateHistoryAll(index) {
77
+ history.update(["mc", "video", "groups", "all", { "initialIndex": index }]);
78
+ }
79
+
80
+ function _updateHistoryList(list) {
81
+ history.update(["mc", "video", "groups", "list", {
82
+ "initialIndex": list.currentIndex,
83
+ "initialId" : list.parentId,
84
+ "initialName" : list.name
85
+ }]);
86
+ }
87
+
88
+ //---------------------------------------------------------------------------------------------
89
+ // Childs
90
+ //---------------------------------------------------------------------------------------------
91
+
92
+ Component {
93
+ id: componentAll
94
+
95
+ MediaGroupList {
96
+ anchors.fill: parent
97
+
98
+ onCurrentIndexChanged: _updateHistoryAll(currentIndex)
99
+
100
+ onShowList: history.push(["mc", "video", "groups", "list",
101
+ { parentId: model.id, name: model.name }])
102
+ }
103
+ }
104
+
105
+ Component {
106
+ id: componentList
107
+
108
+ MediaGroupDisplay {
109
+ id: list
110
+
111
+ anchors.fill: parent
112
+
113
+ onCurrentIndexChanged: _updateHistoryList(list)
114
+ onParentIdChanged : _updateHistoryList(list)
115
+ onNameChanged : _updateHistoryList(list)
116
+ }
117
+ }
118
+}
119
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
Changed
38
1
2
import QtQuick.Layouts 1.3
3
4
import org.videolan.medialib 0.1
5
+import org.videolan.controls 0.1
6
7
import "qrc:///widgets/" as Widgets
8
import "qrc:///util/KeyHelper.js" as KeyHelper
9
+import "qrc:///util/Helpers.js" as Helpers
10
import "qrc:///style/"
11
12
Widgets.NavigableFocusScope {
13
14
width: VLCStyle.gridCover_video_width
15
16
/* A bigger cover for the album */
17
- Widgets.RoundImage {
18
+ RoundImage {
19
id: expand_cover_id
20
21
anchors.fill: parent
22
- asynchronous: true
23
source: model.thumbnail || VLCStyle.noArtCover
24
sourceSize: Qt.size(width, height)
25
- fillMode: Image.PreserveAspectFit
26
radius: VLCStyle.gridCover_radius
27
}
28
29
30
}
31
32
Widgets.CaptionLabel {
33
- text: model.duration
34
+ text: Helpers.msToString(model.duration)
35
color: VLCStyle.colors.text
36
width: parent.width
37
}
38
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
Changed
123
1
2
MainInterface.MainTableView {
3
id: listView_id
4
5
+ //---------------------------------------------------------------------------------------------
6
+ // Properties
7
+ //---------------------------------------------------------------------------------------------
8
+
9
+ // NOTE: This is useful for groups because our main criteria is 'name' instead of 'title'.
10
+ property string mainCriteria: "title"
11
+
12
+ //---------------------------------------------------------------------------------------------
13
+ // Private
14
+
15
readonly property int _nbCols: VLCStyle.gridColumnsForWidth(listView_id.availableRowWidth)
16
17
- sortModel: [
18
- { type: "image", criteria: "thumbnail", width: VLCStyle.colWidth(1), showSection: "", colDelegate: tableColumns.titleDelegate, headerDelegate: tableColumns.titleHeaderDelegate },
19
- { isPrimary: true, criteria: "title", width: VLCStyle.colWidth(Math.max(listView_id._nbCols - 2, 1)), text: i18n.qtr("Title"), showSection: "title" },
20
- { criteria: "duration_short", width: VLCStyle.colWidth(1), showSection: "", colDelegate: tableColumns.timeColDelegate, headerDelegate: tableColumns.timeHeaderDelegate, showContextButton: true },
21
- ]
22
+ //---------------------------------------------------------------------------------------------
23
+ // Settings
24
+ //---------------------------------------------------------------------------------------------
25
26
- section.property: "title_first_symbol"
27
+ sortModel: [{
28
+ type: "image",
29
30
- rowHeight: VLCStyle.tableCoverRow_height
31
+ criteria: "thumbnail",
32
33
- headerColor: VLCStyle.colors.bg
34
+ width: VLCStyle.colWidth(1),
35
36
- onActionForSelection: medialib.addAndPlay(model.getIdsForIndexes( selection ))
37
+ showSection: "",
38
39
- Widgets.TableColumns {
40
- id: tableColumns
41
+ headerDelegate: tableColumns.titleHeaderDelegate,
42
+ colDelegate : tableColumns.titleDelegate,
43
+ }, {
44
+ isPrimary: true,
45
+ criteria: mainCriteria,
46
47
- showTitleText: false
48
- titleCover_height: VLCStyle.listAlbumCover_height
49
- titleCover_width: VLCStyle.listAlbumCover_width
50
- titleCover_radius: VLCStyle.listAlbumCover_radius
51
+ width: VLCStyle.colWidth(Math.max(listView_id._nbCols - 2, 1)),
52
53
- function titlecoverLabels(model) {
54
- return [!model ? "" : model.resolution_name
55
- , model ? "" : model.channel
56
- ].filter(function(a) { return a !== "" })
57
- }
58
- }
59
+ showSection: "title",
60
+
61
+ text: i18n.qtr("Title")
62
+ }, {
63
+ criteria: "duration_short",
64
+
65
+ width: VLCStyle.colWidth(1),
66
+
67
+ showSection: "",
68
+
69
+ headerDelegate: tableColumns.timeHeaderDelegate, showContextButton: true,
70
+ colDelegate : tableColumns.timeColDelegate
71
+ }]
72
+
73
+ section.property: "title_first_symbol"
74
+
75
+ rowHeight: VLCStyle.tableCoverRow_height
76
+
77
+ headerColor: VLCStyle.colors.bg
78
+
79
+ //---------------------------------------------------------------------------------------------
80
+ // Connections
81
+ //---------------------------------------------------------------------------------------------
82
83
Connections {
84
target: model
85
86
}
87
}
88
}
89
+
90
+ //---------------------------------------------------------------------------------------------
91
+ // Functions
92
+ //---------------------------------------------------------------------------------------------
93
+ // Events
94
+
95
+ function onLabels(model)
96
+ {
97
+ if (model === null)
98
+ return [];
99
+
100
+ return [
101
+ model.resolution_name || "",
102
+ model.channel || ""
103
+ ].filter(function(a) { return a !== "" });
104
+ }
105
+
106
+ //---------------------------------------------------------------------------------------------
107
+ // Childs
108
+ //---------------------------------------------------------------------------------------------
109
+
110
+ Widgets.TableColumns {
111
+ id: tableColumns
112
+
113
+ showTitleText: false
114
+ titleCover_height: VLCStyle.listAlbumCover_height
115
+ titleCover_width: VLCStyle.listAlbumCover_width
116
+ titleCover_radius: VLCStyle.listAlbumCover_radius
117
+
118
+ function titlecoverLabels(model) {
119
+ return listView_id.onLabels(model);
120
+ }
121
+ }
122
}
123
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/menus/menus.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/menus/menus.cpp
Changed
111
1
2
{
3
if( !EMPTY_STR( shortcut ) )
4
action = menu->addAction( QIcon( icon ), text, THEDP,
5
- member, qtr( shortcut ) );
6
+ member, qfut( shortcut ) );
7
else
8
action = menu->addAction( QIcon( icon ), text, THEDP, member );
9
}
10
11
#endif
12
{
13
if( !EMPTY_STR( shortcut ) )
14
- action = menu->addAction( text, THEDP, member, qtr( shortcut ) );
15
+ action = menu->addAction( text, THEDP, member, qfut( shortcut ) );
16
else
17
action = menu->addAction( text, THEDP, member );
18
}
19
20
":/type/file-asym.svg", []() { THEDP->simpleOpenDialog(); } , "Ctrl+O" );
21
addDPStaticEntry( menu, qtr( "&Open Multiple Files..." ),
22
":/type/file-asym.svg", &DialogsProvider::openFileDialog, "Ctrl+Shift+O" );
23
- addDPStaticEntry( menu, qtr( I_OP_OPDIR ),
24
+ addDPStaticEntry( menu, qfut( I_OP_OPDIR ),
25
":/type/folder-grey.svg", &DialogsProvider::PLOpenDir, "Ctrl+F" );
26
addDPStaticEntry( menu, qtr( "Open &Disc..." ),
27
":/type/disc.svg", &DialogsProvider::openDiscDialog, "Ctrl+D" );
28
29
30
menu->addSeparator();
31
32
- addDPStaticEntry( menu, qtr( I_PL_SAVE ), "", &DialogsProvider::savePlayingToPlaylist,
33
+ addDPStaticEntry( menu, qfut( I_PL_SAVE ), "", &DialogsProvider::savePlayingToPlaylist,
34
"Ctrl+Y" );
35
36
#ifdef ENABLE_SOUT
37
38
addDPStaticEntry( menu, qtr( "&Track Synchronization"), ":/menu/setting.svgs",
39
&DialogsProvider::synchroDialog, "" );
40
41
- addDPStaticEntry( menu, qtr( I_MENU_INFO ) , ":/menu/info.svg",
42
+ addDPStaticEntry( menu, qfut( I_MENU_INFO ) , ":/menu/info.svg",
43
QOverload<>::of(&DialogsProvider::mediaInfoDialog), "Ctrl+I" );
44
45
- addDPStaticEntry( menu, qtr( I_MENU_CODECINFO ) ,
46
+ addDPStaticEntry( menu, qfut( I_MENU_CODECINFO ) ,
47
":/menu/info.svg", &DialogsProvider::mediaCodecDialog, "Ctrl+J" );
48
49
#ifdef ENABLE_VLM
50
- addDPStaticEntry( menu, qtr( I_MENU_VLM ), "", &DialogsProvider::vlmDialog,
51
+ addDPStaticEntry( menu, qfut( I_MENU_VLM ), "", &DialogsProvider::vlmDialog,
52
"Ctrl+Shift+W" );
53
#endif
54
55
addDPStaticEntry( menu, qtr( "Program Guide" ), "", &DialogsProvider::epgDialog,
56
"" );
57
58
- addDPStaticEntry( menu, qtr( I_MENU_MSG ),
59
+ addDPStaticEntry( menu, qfut( I_MENU_MSG ),
60
":/menu/messages.svg", &DialogsProvider::messagesDialog, "Ctrl+M" );
61
62
addDPStaticEntry( menu, qtr( "Plu&gins and extensions" ),
63
64
65
if( !p_intf->p_sys->b_isDialogProvider )
66
addDPStaticEntry( menu, qtr( "Customi&ze Interface..." ),
67
- ":/menu/preferences.svg", &DialogsProvider::toolbarDialog);
68
+ ":/menu/preferences.svg", &DialogsProvider::showToolbarEditorDialog);
69
70
addDPStaticEntry( menu, qtr( "&Preferences" ),
71
":/menu/preferences.svg", &DialogsProvider::prefsDialog, "Ctrl+P", QAction::PreferencesRole );
72
73
74
if (p_intf->p_sys->p_mi && p_intf->p_sys->p_mi->hasMediaLibrary() )
75
{
76
- submenu = new QMenu( qtr( I_MENU_BOOKMARK ), menu );
77
+ submenu = new QMenu( qfut( I_MENU_BOOKMARK ), menu );
78
submenu->setTearOffEnabled( true );
79
addDPStaticEntry( submenu, qtr( "&Manage" ), "",
80
&DialogsProvider::bookmarksDialog, "Ctrl+B" );
81
82
&DialogsProvider::updateDialog);
83
#endif
84
menu->addSeparator();
85
- addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), ":/menu/info.svg",
86
+ addDPStaticEntry( menu, qfut( I_MENU_ABOUT ), ":/menu/info.svg",
87
&DialogsProvider::aboutDialog, "Shift+F1", QAction::AboutRole );
88
return menu;
89
}
90
91
action->setIcon( QIcon( ":/toolbar/skip_back.svg") );
92
#endif
93
94
- action = menu->addAction( qtr( I_MENU_GOTOTIME ), THEDP, &DialogsProvider::gotoTimeDialog, qtr( "Ctrl+T" ) );
95
+ action = menu->addAction( qfut( I_MENU_GOTOTIME ), THEDP, &DialogsProvider::gotoTimeDialog, qtr( "Ctrl+T" ) );
96
97
menu->addSeparator();
98
}
99
100
void VLCMenuBar::PopupMenuStaticEntries( QMenu *menu )
101
{
102
QMenu *openmenu = new QMenu( qtr( "Open Media" ), menu );
103
- addDPStaticEntry( openmenu, qtr( I_OP_OPF ),
104
+ addDPStaticEntry( openmenu, qfut( I_OP_OPF ),
105
":/type/file-asym.svg", &DialogsProvider::openFileDialog);
106
- addDPStaticEntry( openmenu, qtr( I_OP_OPDIR ),
107
+ addDPStaticEntry( openmenu, qfut( I_OP_OPDIR ),
108
":/type/folder-grey.svg", &DialogsProvider::PLOpenDir);
109
addDPStaticEntry( openmenu, qtr( "Open &Disc..." ),
110
":/type/disc.svg", &DialogsProvider::openDiscDialog);
111
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/menus/qml_menu_wrapper.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/menus/qml_menu_wrapper.cpp
Changed
60
1
2
#include "util/qml_main_context.hpp"
3
#include "medialibrary/medialib.hpp"
4
#include "medialibrary/mlvideomodel.hpp"
5
+#include "medialibrary/mlgrouplistmodel.hpp"
6
#include "medialibrary/mlplaylistlistmodel.hpp"
7
#include "medialibrary/mlplaylistmodel.hpp"
8
#include "medialibrary/mlalbummodel.hpp"
9
10
}
11
12
//=================================================================================================
13
+// GroupListContextMenu
14
+//=================================================================================================
15
+
16
+GroupListContextMenu::GroupListContextMenu(QObject * parent) : QObject(parent) {}
17
+
18
+GroupListContextMenu::~GroupListContextMenu() /* override */
19
+{
20
+ if (m_menu)
21
+ delete m_menu;
22
+}
23
+
24
+void GroupListContextMenu::popup(const QModelIndexList & selected, QPoint pos, QVariantMap)
25
+{
26
+ if (m_model == nullptr)
27
+ return;
28
+
29
+ if (m_menu)
30
+ delete m_menu;
31
+
32
+ QVariantList ids;
33
+
34
+ for (const QModelIndex & modelIndex : selected)
35
+ ids.push_back(m_model->data(modelIndex, MLGroupListModel::GROUP_ID));
36
+
37
+ m_menu = new QMenu();
38
+
39
+ MediaLib * ml = m_model->ml();
40
+
41
+ QAction * action = m_menu->addAction(qtr("Add and play"));
42
+
43
+ connect(action, &QAction::triggered, [ml, ids]() {
44
+ ml->addAndPlay(ids);
45
+ });
46
+
47
+ action = m_menu->addAction(qtr("Enqueue"));
48
+
49
+ connect(action, &QAction::triggered, [ml, ids]() {
50
+ ml->addToPlaylist(ids);
51
+ });
52
+
53
+ m_menu->popup(pos);
54
+}
55
+
56
+//=================================================================================================
57
// PlaylistListContextMenu
58
//=================================================================================================
59
60
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/menus/qml_menu_wrapper.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/menus/qml_menu_wrapper.hpp
Changed
36
1
2
class MLAlbumTrackModel;
3
class MLUrlModel;
4
class MLVideoModel;
5
+class MLGroupListModel;
6
+class MLGroupModel;
7
class MLPlaylistListModel;
8
class MLPlaylistModel;
9
class NetworkDeviceModel;
10
11
QMenu* m_menu = nullptr;
12
};
13
14
+//-------------------------------------------------------------------------------------------------
15
+// Groups
16
+//-------------------------------------------------------------------------------------------------
17
+
18
+class GroupListContextMenu : public QObject {
19
+ Q_OBJECT
20
+ SIMPLE_MENU_PROPERTY(MLGroupListModel *, model, nullptr)
21
+public:
22
+ GroupListContextMenu(QObject * parent = nullptr);
23
+ ~GroupListContextMenu() /* override */;
24
+
25
+public slots:
26
+ void popup(const QModelIndexList & selected, QPoint pos, QVariantMap options = {});
27
+private:
28
+ QMenu* m_menu = nullptr;
29
+};
30
+
31
+//-------------------------------------------------------------------------------------------------
32
+
33
class PlaylistListContextMenu : public QObject {
34
Q_OBJECT
35
SIMPLE_MENU_PROPERTY(MLPlaylistListModel *, model, nullptr)
36
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/network/qml/DiscoverUrlDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/network/qml/DiscoverUrlDisplay.qml
Changed
27
1
2
height: VLCStyle.dp(32, VLCStyle.scale)
3
width: VLCStyle.colWidth(Math.max(VLCStyle.gridColumnsForWidth(root.width * .6), 2))
4
placeholderText: i18n.qtr("Paste or write the URL here")
5
- color: VLCStyle.colors.text
6
+ palette.text: VLCStyle.colors.text
7
+ palette.highlight: VLCStyle.colors.bgHover
8
+ palette.highlightedText: VLCStyle.colors.bgHoverText
9
font.pixelSize: VLCStyle.fontSize_large
10
+ selectByMouse: true
11
+
12
background: Rectangle {
13
color: VLCStyle.colors.bg
14
border.width: VLCStyle.dp(2, VLCStyle.scale)
15
16
}
17
18
onAccepted: {
19
- mainPlaylistController.append([text], true)
20
+ if (urlListDisplay.status == Loader.Ready)
21
+ urlListDisplay.item.model.addAndPlay(text)
22
+ else
23
+ mainPlaylistController.append([text], true)
24
}
25
26
Keys.priority: Keys.AfterItem
27
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/network/qml/NetworkBrowseDisplay.qml
Changed
32
1
2
subtitle: ""
3
height: VLCStyle.gridCover_network_height + VLCStyle.margin_xsmall + VLCStyle.fontHeight_normal
4
dragItem: networkDragItem
5
+ unselectedUnderlay: shadows.unselected
6
+ selectedUnderlay: shadows.selected
7
8
onPlayClicked: playAt(index)
9
onItemClicked : gridView.leftClickOnItem(modifier, index)
10
11
navigationCancel: function() {
12
history.previous()
13
}
14
+
15
+ Widgets.GridShadows {
16
+ id: shadows
17
+
18
+ coverWidth: VLCStyle.gridCover_network_width
19
+ coverHeight: VLCStyle.gridCover_network_height
20
+ }
21
}
22
}
23
24
25
]
26
27
onActionForSelection: _actionAtIndex(selection[0].row)
28
+ onItemDoubleClicked: _actionAtIndex(index)
29
onContextMenuButtonClicked: contextMenu.popup(filterModel.mapIndexesToSource(selectionModel.selectedIndexes), menuParent.mapToGlobal(0,0))
30
onRightClick: contextMenu.popup(filterModel.mapIndexesToSource(selectionModel.selectedIndexes), globalMousePos)
31
}
32
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/network/qml/NetworkGridItem.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/network/qml/NetworkGridItem.qml
Changed
10
1
2
3
pictureWidth: VLCStyle.gridCover_network_width
4
pictureHeight: VLCStyle.gridCover_network_height
5
- playCoverBorder.width: VLCStyle.gridCover_network_border
6
+ playCoverBorderWidth: VLCStyle.gridCover_network_border
7
playCoverOnlyBorders: model.type === NetworkMediaModel.TYPE_NODE || model.type === NetworkMediaModel.TYPE_DIRECTORY
8
image: model.artwork && model.artwork.toString() !== "" ? model.artwork : ""
9
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/network/qml/NetworkHomeDeviceListView.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/network/qml/NetworkHomeDeviceListView.qml
Changed
24
1
2
model: deviceModel
3
}
4
5
+ Widgets.GridShadows {
6
+ id: shadows
7
+
8
+ coverWidth: VLCStyle.gridCover_network_width
9
+ coverHeight: VLCStyle.gridCover_network_height
10
+ }
11
+
12
Widgets.KeyNavigableListView {
13
id: deviceListView
14
15
16
focus: true
17
x: selectedBorderWidth
18
y: selectedBorderWidth
19
+ unselectedUnderlay: shadows.unselected
20
+ selectedUnderlay: shadows.selected
21
22
onItemClicked : {
23
deviceSelection.updateSelection( modifier , deviceSelection.currentIndex, index)
24
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/network/qml/ServicesHomeDisplay.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/network/qml/ServicesHomeDisplay.qml
Changed
28
1
2
pictureWidth: VLCStyle.colWidth(1)
3
pictureHeight: VLCStyle.gridCover_network_height
4
height: VLCStyle.gridCover_network_height + VLCStyle.margin_xsmall + VLCStyle.fontHeight_normal
5
- playCoverBorder.width: VLCStyle.gridCover_network_border
6
+ playCoverBorderWidth: VLCStyle.gridCover_network_border
7
playCoverOnlyBorders: true
8
pictureOverlay: overlay
9
+ unselectedUnderlay: shadows.unselected
10
+ selectedUnderlay: shadows.selected
11
12
onItemDoubleClicked: {
13
if (is_dummy)
14
15
sourceModel: sourcesModel
16
searchRole: "name"
17
}
18
+
19
+ Widgets.GridShadows {
20
+ id: shadows
21
+
22
+ coverWidth: VLCStyle.gridCover_network_width
23
+ coverHeight: VLCStyle.gridCover_network_height
24
+ }
25
}
26
}
27
}
28
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/pixmaps/VLCIcons.ttf -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/pixmaps/VLCIcons.ttf
Changed
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/pixmaps/faster.svg -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/pixmaps/faster.svg
Changed
84
1
2
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
4
-
5
-<svg
6
- xmlns:dc="http://purl.org/dc/elements/1.1/"
7
- xmlns:cc="http://creativecommons.org/ns#"
8
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
9
- xmlns:svg="http://www.w3.org/2000/svg"
10
- xmlns="http://www.w3.org/2000/svg"
11
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
- width="48"
14
- height="48"
15
- viewBox="0 0 48 48"
16
- id="svg2"
17
- version="1.1"
18
- inkscape:version="0.92.1 r15371"
19
- sodipodi:docname="faster.svg">
20
- <defs
21
- id="defs8" />
22
- <sodipodi:namedview
23
- pagecolor="#ffffff"
24
- bordercolor="#666666"
25
- borderopacity="1"
26
- objecttolerance="10"
27
- gridtolerance="10"
28
- guidetolerance="10"
29
- inkscape:pageopacity="0"
30
- inkscape:pageshadow="2"
31
- inkscape:window-width="956"
32
- inkscape:window-height="1021"
33
- id="namedview6"
34
- showgrid="false"
35
- inkscape:zoom="4.9166667"
36
- inkscape:cx="14.307204"
37
- inkscape:cy="0.84031181"
38
- inkscape:window-x="2560"
39
- inkscape:window-y="30"
40
- inkscape:window-maximized="0"
41
- inkscape:current-layer="layer1"
42
- showguides="true"
43
- inkscape:guide-bbox="true">
44
- <sodipodi:guide
45
- position="0,24.017661"
46
- orientation="1,0"
47
- id="guide2390"
48
- inkscape:locked="false" />
49
- <sodipodi:guide
50
- position="23.59322,0"
51
- orientation="0,1"
52
- id="guide2392"
53
- inkscape:locked="false" />
54
- </sodipodi:namedview>
55
- <metadata
56
- id="metadata7">
57
- <rdf:RDF>
58
- <cc:Work
59
- rdf:about="">
60
- <dc:format>image/svg+xml</dc:format>
61
- <dc:type
62
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
63
- <dc:title />
64
- </cc:Work>
65
- </rdf:RDF>
66
- </metadata>
67
- <g
68
- inkscape:label="Master"
69
- inkscape:groupmode="layer"
70
- id="layer1"
71
- transform="translate(-384,-1004.3622)"
72
- style="display:inline">
73
- <path
74
- style="display:inline;opacity:1;fill:#747474;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
75
- d="M 11 12 L 11 36 L 25 24.800781 L 25 36 L 40 24 L 25 12 L 25 23.199219 L 11 12 z "
76
- transform="translate(384,1004.3622)"
77
- id="path7185-5" />
78
- </g>
79
-</svg>
80
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
81
+<path d="M12.7105 4.1584L21.7105 11.1584C22.0965 11.4587 22.0965 12.0422 21.7104 12.3425L12.7089 19.3425C12.2162 19.7256 11.4985 19.3745 11.4985 18.7503V13.673L4.20888 19.3425C3.7162 19.7256 2.99847 19.3745 2.99847 18.7503L3 4.75033C3.00007 4.12626 3.71784 3.77525 4.21046 4.1584L11.4985 9.82702L11.5 4.75033C11.5001 4.12626 12.2178 3.77525 12.7105 4.1584Z" fill="#212121"/>
82
+</svg>
83
\ No newline at end of file
84
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/pixmaps/slower.svg -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/pixmaps/slower.svg
Changed
82
1
2
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
4
-
5
-<svg
6
- xmlns:dc="http://purl.org/dc/elements/1.1/"
7
- xmlns:cc="http://creativecommons.org/ns#"
8
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
9
- xmlns:svg="http://www.w3.org/2000/svg"
10
- xmlns="http://www.w3.org/2000/svg"
11
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
- width="48"
14
- height="48"
15
- viewBox="0 0 48 48"
16
- id="svg2"
17
- version="1.1"
18
- inkscape:version="0.92.1 r15371"
19
- sodipodi:docname="slower.svg">
20
- <defs
21
- id="defs8" />
22
- <sodipodi:namedview
23
- pagecolor="#ffffff"
24
- bordercolor="#666666"
25
- borderopacity="1"
26
- objecttolerance="10"
27
- gridtolerance="10"
28
- guidetolerance="10"
29
- inkscape:pageopacity="0"
30
- inkscape:pageshadow="2"
31
- inkscape:window-width="956"
32
- inkscape:window-height="1021"
33
- id="namedview6"
34
- showgrid="false"
35
- inkscape:zoom="3.4766083"
36
- inkscape:cx="-5.7712991"
37
- inkscape:cy="36.518407"
38
- inkscape:window-x="2560"
39
- inkscape:window-y="30"
40
- inkscape:window-maximized="0"
41
- inkscape:current-layer="layer1"
42
- showguides="true"
43
- inkscape:guide-bbox="true">
44
- <sodipodi:guide
45
- position="0,24.017661"
46
- orientation="1,0"
47
- id="guide2390"
48
- inkscape:locked="false" />
49
- <sodipodi:guide
50
- position="23.59322,0"
51
- orientation="0,1"
52
- id="guide2392"
53
- inkscape:locked="false" />
54
- </sodipodi:namedview>
55
- <metadata
56
- id="metadata7">
57
- <rdf:RDF>
58
- <cc:Work
59
- rdf:about="">
60
- <dc:format>image/svg+xml</dc:format>
61
- <dc:type
62
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
63
- <dc:title />
64
- </cc:Work>
65
- </rdf:RDF>
66
- </metadata>
67
- <g
68
- inkscape:label="Master"
69
- inkscape:groupmode="layer"
70
- id="layer1"
71
- transform="translate(-384,-1004.3622)"
72
- style="display:inline">
73
- <path
74
- style="display:inline;opacity:1;fill:#747474;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
75
- d="M 23 12 L 8 24 L 23 36 L 23 24.800781 L 37 36 L 37 12 L 23 23.199219 L 23 12 z "
76
- transform="translate(384,1004.3622)"
77
- id="path6873" />
78
- </g>
79
-</svg>
80
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path d="M12.288 19.342l-9-7a.75.75 0 0 1 0-1.184l9.002-7a.75.75 0 0 1 1.21.593v5.077l7.29-5.67a.75.75 0 0 1 1.21.593l-.002 14a.75.75 0 0 1-1.21.591L13.5 13.674l-.002 5.077a.75.75 0 0 1-1.21.591z" fill="#212121"/></svg>
81
\ No newline at end of file
82
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/control_list_model.cpp
Added
157
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+#include "control_list_model.hpp"
21
+
22
+ControlListModel::ControlListModel(QObject *parent) : QAbstractListModel(parent)
23
+{
24
+ connect(this, &QAbstractListModel::rowsInserted, this, &ControlListModel::countChanged);
25
+ connect(this, &QAbstractListModel::rowsRemoved, this, &ControlListModel::countChanged);
26
+ connect(this, &QAbstractListModel::modelReset, this, &ControlListModel::countChanged);
27
+}
28
+
29
+int ControlListModel::rowCount(const QModelIndex &parent) const
30
+{
31
+ if (parent.isValid())
32
+ return 0;
33
+
34
+ return m_controls.size();
35
+}
36
+
37
+QVariant ControlListModel::data(const QModelIndex &index, int role) const
38
+{
39
+ if (!index.isValid())
40
+ return QVariant();
41
+
42
+ const ControlType control = m_controls.at(index.row());
43
+
44
+ switch (role) {
45
+ case ID_ROLE:
46
+ return QVariant(control);
47
+ }
48
+ return QVariant();
49
+}
50
+
51
+bool ControlListModel::setData(const QModelIndex &index, const QVariant &value, int role)
52
+{
53
+ ControlType control = m_controls.at(index.row());
54
+
55
+ switch (role) {
56
+ case ID_ROLE:
57
+ if (value.canConvert(QVariant::Int))
58
+ control = static_cast<ControlType>(value.toInt());
59
+ else
60
+ return false;
61
+ break;
62
+ }
63
+
64
+ if (setButtonAt(index.row(), control)) {
65
+ emit dataChanged(index, index, { role });
66
+ return true;
67
+ }
68
+ return false;
69
+}
70
+
71
+Qt::ItemFlags ControlListModel::flags(const QModelIndex &index) const
72
+{
73
+ if (!index.isValid())
74
+ return Qt::NoItemFlags;
75
+
76
+ return (Qt::ItemIsEditable | Qt::ItemNeverHasChildren);
77
+}
78
+
79
+QHash<int, QByteArray> ControlListModel::roleNames() const
80
+{
81
+ return {
82
+ {
83
+ ID_ROLE, "id"
84
+ }
85
+ };
86
+}
87
+
88
+QVector<int> ControlListModel::getControls() const
89
+{
90
+ QVector<int> list;
91
+
92
+ for (auto i : m_controls)
93
+ {
94
+ list.append(static_cast<int>(i));
95
+ }
96
+
97
+ return list;
98
+}
99
+
100
+void ControlListModel::setControls(const QVector<int> &list)
101
+{
102
+ beginResetModel();
103
+
104
+ m_controls.resize(list.size());
105
+
106
+ for (int i = 0; i < list.size(); ++i)
107
+ {
108
+ m_controls[i] = static_cast<ControlType>(list.at(i));
109
+ }
110
+
111
+ endResetModel();
112
+}
113
+
114
+bool ControlListModel::setButtonAt(int index, const ControlType &button)
115
+{
116
+ if(index < 0 || index >= m_controls.size())
117
+ return false;
118
+
119
+ const ControlType oldControl = m_controls.at(index);
120
+
121
+ if (button == oldControl)
122
+ return false;
123
+
124
+ m_controls[index] = button;
125
+ return true;
126
+}
127
+
128
+void ControlListModel::insert(int index, QVariantMap bdata)
129
+{
130
+ beginInsertRows(QModelIndex(), index, index);
131
+ m_controls.insert(index, static_cast<ControlType>(bdata.value("id").toInt()));
132
+ endInsertRows();
133
+}
134
+void ControlListModel::move(int src, int dest)
135
+{
136
+ if(src == dest)
137
+ return;
138
+
139
+ beginMoveRows(QModelIndex(), src, src, QModelIndex(), dest + (src < dest ? 1 : 0));
140
+ m_controls.move(src, dest);
141
+ endMoveRows();
142
+}
143
+
144
+void ControlListModel::remove(int index)
145
+{
146
+ beginRemoveRows(QModelIndex(), index, index);
147
+ m_controls.remove(index);
148
+ endRemoveRows();
149
+}
150
+
151
+void ControlListModel::clear()
152
+{
153
+ beginResetModel();
154
+ m_controls.clear();
155
+ endResetModel();
156
+}
157
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/control_list_model.hpp
Added
113
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+#ifndef CONTROLLISTMODEL_HPP
21
+#define CONTROLLISTMODEL_HPP
22
+
23
+#include <QAbstractListModel>
24
+#include <QVector>
25
+
26
+class ControlListModel : public QAbstractListModel
27
+{
28
+ Q_OBJECT
29
+ Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
30
+
31
+public:
32
+ explicit ControlListModel(QObject *parent = nullptr);
33
+
34
+ enum Roles {
35
+ ID_ROLE = Qt::UserRole
36
+ };
37
+
38
+ enum ControlType
39
+ {
40
+ PLAY_BUTTON,
41
+ STOP_BUTTON,
42
+ OPEN_BUTTON,
43
+ PREVIOUS_BUTTON,
44
+ NEXT_BUTTON,
45
+ SLOWER_BUTTON,
46
+ FASTER_BUTTON,
47
+ FULLSCREEN_BUTTON,
48
+ EXTENDED_BUTTON,
49
+ PLAYLIST_BUTTON,
50
+ SNAPSHOT_BUTTON,
51
+ RECORD_BUTTON,
52
+ ATOB_BUTTON,
53
+ FRAME_BUTTON,
54
+ SKIP_BACK_BUTTON,
55
+ SKIP_FW_BUTTON,
56
+ QUIT_BUTTON,
57
+ RANDOM_BUTTON,
58
+ LOOP_BUTTON,
59
+ INFO_BUTTON,
60
+ LANG_BUTTON,
61
+ MENU_BUTTON,
62
+ BACK_BUTTON,
63
+ CHAPTER_PREVIOUS_BUTTON,
64
+ CHAPTER_NEXT_BUTTON,
65
+ BUTTON_MAX,
66
+ PLAYER_SWITCH_BUTTON,
67
+ ARTWORK_INFO,
68
+ PLAYBACK_SPEED_BUTTON,
69
+
70
+ SPLITTER = 0x20,
71
+ VOLUME,
72
+ TELETEXT_BUTTONS,
73
+ ASPECT_RATIO_COMBOBOX,
74
+ SPECIAL_MAX,
75
+
76
+ WIDGET_SPACER = 0x40,
77
+ WIDGET_SPACER_EXTEND,
78
+ WIDGET_MAX
79
+ };
80
+ Q_ENUM(ControlType)
81
+
82
+ // Basic functionality:
83
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
84
+
85
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
86
+
87
+ // Editable:
88
+ bool setData(const QModelIndex &index, const QVariant &value,
89
+ int role = Qt::EditRole) override;
90
+
91
+ Qt::ItemFlags flags(const QModelIndex& index) const override;
92
+
93
+ virtual QHash<int, QByteArray> roleNames() const override;
94
+
95
+ QVector<int> getControls() const;
96
+ void setControls(const QVector<int>& list);
97
+
98
+signals:
99
+ void countChanged();
100
+
101
+private:
102
+ QVector<ControlType> m_controls;
103
+ bool setButtonAt(int index, const ControlType &button);
104
+
105
+public slots:
106
+ Q_INVOKABLE void insert(int index, QVariantMap bdata);
107
+ Q_INVOKABLE void move(int src,int dest);
108
+ Q_INVOKABLE void remove(int index);
109
+ Q_INVOKABLE void clear();
110
+};
111
+
112
+#endif // CONTROLLISTMODEL_HPP
113
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/player_controlbar_model.cpp
Added
139
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+#include "player_controlbar_model.hpp"
21
+
22
+#include <QMetaEnum>
23
+#include <QJSEngine>
24
+
25
+#include "qt.hpp"
26
+#include "control_list_model.hpp"
27
+
28
+decltype (PlayerControlbarModel::playerIdentifierDictionary)
29
+ PlayerControlbarModel::playerIdentifierDictionary {
30
+ {Mainplayer, N_("Mainplayer")},
31
+ {Miniplayer, N_("Miniplayer")}
32
+ };
33
+
34
+QJSValue PlayerControlbarModel::getPlaylistIdentifierListModel(QQmlEngine *engine, QJSEngine *scriptEngine)
35
+{
36
+ Q_UNUSED(engine)
37
+
38
+ static const QMetaEnum metaEnum = QMetaEnum::fromType<PlayerIdentifier>();
39
+
40
+ QJSValue array = scriptEngine->newArray();
41
+
42
+ for (int i = 0; i < metaEnum.keyCount(); ++i)
43
+ {
44
+ QJSValue obj = scriptEngine->newObject();
45
+
46
+ const int val = metaEnum.value(i);
47
+ obj.setProperty("identifier", val);
48
+
49
+ QString key;
50
+ if ( playerIdentifierDictionary.contains(static_cast<PlayerControlbarModel::PlayerIdentifier>(i)) )
51
+ {
52
+ key = qfut( playerIdentifierDictionary[static_cast<PlayerControlbarModel::PlayerIdentifier>(i)] );
53
+ }
54
+ else
55
+ {
56
+ key = metaEnum.key(i);
57
+ }
58
+
59
+ obj.setProperty("name", key);
60
+
61
+ array.setProperty(i, obj);
62
+ }
63
+
64
+ QJSValue value = scriptEngine->newObject();
65
+ value.setProperty("model", array);
66
+
67
+ return value;
68
+}
69
+
70
+PlayerControlbarModel::PlayerControlbarModel(QObject *parent) : QObject(parent)
71
+{
72
+ m_left = new ControlListModel(this);
73
+ m_center = new ControlListModel(this);
74
+ m_right = new ControlListModel(this);
75
+
76
+ connect(m_left, &ControlListModel::countChanged, this, &PlayerControlbarModel::contentChanged);
77
+ connect(m_center, &ControlListModel::countChanged, this, &PlayerControlbarModel::contentChanged);
78
+ connect(m_right, &ControlListModel::countChanged, this, &PlayerControlbarModel::contentChanged);
79
+
80
+ connect(m_left, &QAbstractListModel::dataChanged, this, &PlayerControlbarModel::contentChanged);
81
+ connect(m_center, &QAbstractListModel::dataChanged, this, &PlayerControlbarModel::contentChanged);
82
+ connect(m_right, &QAbstractListModel::dataChanged, this, &PlayerControlbarModel::contentChanged);
83
+}
84
+
85
+PlayerControlbarModel::~PlayerControlbarModel()
86
+{
87
+ setDirty(false);
88
+}
89
+
90
+bool PlayerControlbarModel::dirty() const
91
+{
92
+ return m_dirty;
93
+}
94
+
95
+std::array<QVector<int>, 3> PlayerControlbarModel::serializeModels() const
96
+{
97
+ return { left()->getControls(),
98
+ center()->getControls(),
99
+ right()->getControls() };
100
+}
101
+
102
+void PlayerControlbarModel::loadModels(const std::array<QVector<int>, 3> &array)
103
+{
104
+ left()->setControls(array.at(0));
105
+ center()->setControls(array.at(1));
106
+ right()->setControls(array.at(2));
107
+}
108
+
109
+ControlListModel *PlayerControlbarModel::left() const
110
+{
111
+ return m_left;
112
+}
113
+
114
+ControlListModel *PlayerControlbarModel::center() const
115
+{
116
+ return m_center;
117
+}
118
+
119
+ControlListModel *PlayerControlbarModel::right() const
120
+{
121
+ return m_right;
122
+}
123
+
124
+void PlayerControlbarModel::setDirty(bool dirty)
125
+{
126
+ if (m_dirty == dirty)
127
+ return;
128
+
129
+ m_dirty = dirty;
130
+ emit dirtyChanged(m_dirty);
131
+}
132
+
133
+void PlayerControlbarModel::contentChanged()
134
+{
135
+ setDirty(true);
136
+
137
+ emit controlListChanged();
138
+}
139
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/player_controlbar_model.hpp
Added
98
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+#ifndef PLAYERCONTROLBARMODEL_HPP
21
+#define PLAYERCONTROLBARMODEL_HPP
22
+
23
+#include <QObject>
24
+#include <QJSValue>
25
+#include <QMap>
26
+
27
+#include <array>
28
+
29
+class ControlListModel;
30
+
31
+class PlayerControlbarModel : public QObject
32
+{
33
+ Q_OBJECT
34
+
35
+ Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged)
36
+
37
+ Q_PROPERTY(ControlListModel* left READ left CONSTANT)
38
+ Q_PROPERTY(ControlListModel* center READ center CONSTANT)
39
+ Q_PROPERTY(ControlListModel* right READ right CONSTANT)
40
+
41
+public:
42
+ // When there is a need to add a new Player, just
43
+ // add its identifier in this enum and set QML buttons layout
44
+ // identifier to it. Such as `property int identifier =
45
+ // PlayerControlbarModel.Mainplayer`.
46
+ // To make it translatable, add a corresponding entry to
47
+ // the static member playerIdentifierDictionary which is
48
+ // initalized in the source file.
49
+ enum PlayerIdentifier {
50
+ Mainplayer = 0,
51
+ Miniplayer
52
+ };
53
+ Q_ENUM(PlayerIdentifier)
54
+ // This enum is iterated through QMetaEnum, and
55
+ // a model out of this enum is generated
56
+ // and used in the configuration editor.
57
+ // Thanks to MOC, adding an entry to this enum
58
+ // is enough for the editor to consider the
59
+ // added entry without any other modification.
60
+ // (except for the translation)
61
+
62
+ static const QMap<PlayerIdentifier, const char*> playerIdentifierDictionary;
63
+
64
+ static QJSValue getPlaylistIdentifierListModel(class QQmlEngine *engine,
65
+ class QJSEngine *scriptEngine);
66
+
67
+ explicit PlayerControlbarModel(QObject *parent = nullptr);
68
+ ~PlayerControlbarModel();
69
+
70
+ bool dirty() const;
71
+
72
+ std::array<QVector<int>, 3> serializeModels() const;
73
+ void loadModels(const std::array<QVector<int>, 3>& array);
74
+
75
+ ControlListModel* left() const;
76
+ ControlListModel* center() const;
77
+ ControlListModel* right() const;
78
+
79
+public slots:
80
+ void setDirty(bool dirty);
81
+
82
+signals:
83
+ void dirtyChanged(bool dirty);
84
+ void controlListChanged();
85
+
86
+private:
87
+ bool m_dirty = false;
88
+
89
+ ControlListModel* m_left = nullptr;
90
+ ControlListModel* m_center = nullptr;
91
+ ControlListModel* m_right = nullptr;
92
+
93
+private slots:
94
+ void contentChanged();
95
+};
96
+
97
+#endif
98
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/ButtonsLayout.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/ButtonsLayout.qml
Changed
10
1
2
3
return minimumWidth
4
}
5
- property real extraWidth: undefined
6
+ property real extraWidth: 0
7
property int expandableCount: 0 // widget count that can expand when extra width is available
8
9
implicitWidth: buttonrow.implicitWidth
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/ControlBar.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/ControlBar.qml
Changed
43
1
2
readonly property alias sliderY: row2.y
3
property int textPosition: ControlBar.TimeTextPosition.AboveSlider
4
property VLCColors colors: VLCStyle.nightColors
5
- property var configs: ["MainPlayerToolbar-left", "MainPlayerToolbar-center", "MainPlayerToolbar-right"]
6
+ property alias identifier: playerButtonsLayout.identifier
7
property alias sliderHeight: trackPositionSlider.barHeight
8
property alias sliderBackgroundColor: trackPositionSlider.backgroundColor
9
property alias sliderProgressColor: trackPositionSlider.progressBarColor
10
11
bottomMargin: VLCStyle.applicationVerticalMargin
12
}
13
14
- models: [playerControlBarModel_left, playerControlBarModel_center, playerControlBarModel_right]
15
-
16
navigationUpItem: trackPositionSlider.enabled ? trackPositionSlider : root.navigationUpItem
17
18
colors: root.colors
19
20
21
Keys.onDownPressed: playerButtonsLayout.focus = true
22
}
23
-
24
-
25
- PlayerControlBarModel{
26
- id:playerControlBarModel_left
27
- mainCtx: mainctx
28
- configName: root.configs[0]
29
- }
30
-
31
- PlayerControlBarModel{
32
- id:playerControlBarModel_center
33
- mainCtx: mainctx
34
- configName: root.configs[1]
35
- }
36
-
37
- PlayerControlBarModel{
38
- id:playerControlBarModel_right
39
- mainCtx: mainctx
40
- configName: root.configs[2]
41
- }
42
}
43
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/ControlButtons.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/ControlButtons.qml
Changed
201
1
2
import "qrc:///widgets/" as Widgets
3
import "qrc:///style/"
4
import "qrc:///util/KeyHelper.js" as KeyHelper
5
+import "qrc:///util/Helpers.js" as Helpers
6
7
Item{
8
id: controlButtons
9
10
signal requestLockUnlockAutoHide(bool lock, var source)
11
12
property var buttonL: [
13
- { id: PlayerControlBarModel.PLAY_BUTTON, label: VLCIcons.play, text: i18n.qtr("Play")},
14
- { id: PlayerControlBarModel.STOP_BUTTON, label: VLCIcons.stop, text: i18n.qtr("Stop")},
15
- { id: PlayerControlBarModel.OPEN_BUTTON, label: VLCIcons.eject, text: i18n.qtr("Open")},
16
- { id: PlayerControlBarModel.PREVIOUS_BUTTON, label: VLCIcons.previous, text: i18n.qtr("Previous")},
17
- { id: PlayerControlBarModel.NEXT_BUTTON, label: VLCIcons.next, text: i18n.qtr("Next")},
18
- { id: PlayerControlBarModel.SLOWER_BUTTON, label: VLCIcons.slower, text: i18n.qtr("Slower")},
19
- { id: PlayerControlBarModel.FASTER_BUTTON, label: VLCIcons.faster, text: i18n.qtr("Faster")},
20
- { id: PlayerControlBarModel.FULLSCREEN_BUTTON, label: VLCIcons.fullscreen, text: i18n.qtr("Fullscreen")},
21
- { id: PlayerControlBarModel.EXTENDED_BUTTON, label: VLCIcons.extended, text: i18n.qtr("Extended panel")},
22
- { id: PlayerControlBarModel.PLAYLIST_BUTTON, label: VLCIcons.playlist, text: i18n.qtr("Playlist")},
23
- { id: PlayerControlBarModel.SNAPSHOT_BUTTON, label: VLCIcons.snapshot, text: i18n.qtr("Snapshot")},
24
- { id: PlayerControlBarModel.RECORD_BUTTON, label: VLCIcons.record, text: i18n.qtr("Record")},
25
- { id: PlayerControlBarModel.ATOB_BUTTON, label: VLCIcons.atob, text: i18n.qtr("A-B Loop")},
26
- { id: PlayerControlBarModel.FRAME_BUTTON, label: VLCIcons.frame_by_frame, text: i18n.qtr("Frame By Frame")},
27
- { id: PlayerControlBarModel.SKIP_BACK_BUTTON, label: VLCIcons.skip_back, text: i18n.qtr("Step backward")},
28
- { id: PlayerControlBarModel.SKIP_FW_BUTTON, label: VLCIcons.skip_for, text: i18n.qtr("Step forward")},
29
- { id: PlayerControlBarModel.QUIT_BUTTON, label: VLCIcons.clear, text: i18n.qtr("Quit")},
30
- { id: PlayerControlBarModel.RANDOM_BUTTON, label: VLCIcons.shuffle_on, text: i18n.qtr("Random")},
31
- { id: PlayerControlBarModel.LOOP_BUTTON, label: VLCIcons.repeat_all, text: i18n.qtr("Loop")},
32
- { id: PlayerControlBarModel.INFO_BUTTON, label: VLCIcons.info, text: i18n.qtr("Information")},
33
- { id: PlayerControlBarModel.LANG_BUTTON, label: VLCIcons.audiosub, text: i18n.qtr("Open subtitles")},
34
- { id: PlayerControlBarModel.MENU_BUTTON, label: VLCIcons.menu, text: i18n.qtr("Menu Button")},
35
- { id: PlayerControlBarModel.BACK_BUTTON, label: VLCIcons.exit, text: i18n.qtr("Back Button")},
36
- { id: PlayerControlBarModel.CHAPTER_PREVIOUS_BUTTON, label: VLCIcons.dvd_prev, text: i18n.qtr("Previous chapter")},
37
- { id: PlayerControlBarModel.CHAPTER_NEXT_BUTTON, label: VLCIcons.dvd_next, text: i18n.qtr("Next chapter")},
38
- { id: PlayerControlBarModel.VOLUME, label: VLCIcons.volume_high, text: i18n.qtr("Volume Widget")},
39
- { id: PlayerControlBarModel.TELETEXT_BUTTONS, label: VLCIcons.tvtelx, text: i18n.qtr("Teletext")},
40
- { id: PlayerControlBarModel.ASPECT_RATIO_COMBOBOX, label: VLCIcons.aspect_ratio, text: i18n.qtr("Aspect Ratio")},
41
- { id: PlayerControlBarModel.WIDGET_SPACER, label: VLCIcons.space, text: i18n.qtr("Spacer")},
42
- { id: PlayerControlBarModel.WIDGET_SPACER_EXTEND, label: VLCIcons.space, text: i18n.qtr("Expanding Spacer")},
43
- { id: PlayerControlBarModel.PLAYER_SWITCH_BUTTON, label: VLCIcons.fullscreen, text: i18n.qtr("Switch Player")},
44
- { id: PlayerControlBarModel.ARTWORK_INFO, label: VLCIcons.info, text: i18n.qtr("Artwork Info")}
45
+ { id: ControlListModel.PLAY_BUTTON, label: VLCIcons.play, text: i18n.qtr("Play")},
46
+ { id: ControlListModel.STOP_BUTTON, label: VLCIcons.stop, text: i18n.qtr("Stop")},
47
+ { id: ControlListModel.OPEN_BUTTON, label: VLCIcons.eject, text: i18n.qtr("Open")},
48
+ { id: ControlListModel.PREVIOUS_BUTTON, label: VLCIcons.previous, text: i18n.qtr("Previous")},
49
+ { id: ControlListModel.NEXT_BUTTON, label: VLCIcons.next, text: i18n.qtr("Next")},
50
+ { id: ControlListModel.SLOWER_BUTTON, label: VLCIcons.slower, text: i18n.qtr("Slower")},
51
+ { id: ControlListModel.FASTER_BUTTON, label: VLCIcons.faster, text: i18n.qtr("Faster")},
52
+ { id: ControlListModel.FULLSCREEN_BUTTON, label: VLCIcons.fullscreen, text: i18n.qtr("Fullscreen")},
53
+ { id: ControlListModel.EXTENDED_BUTTON, label: VLCIcons.extended, text: i18n.qtr("Extended panel")},
54
+ { id: ControlListModel.PLAYLIST_BUTTON, label: VLCIcons.playlist, text: i18n.qtr("Playlist")},
55
+ { id: ControlListModel.SNAPSHOT_BUTTON, label: VLCIcons.snapshot, text: i18n.qtr("Snapshot")},
56
+ { id: ControlListModel.RECORD_BUTTON, label: VLCIcons.record, text: i18n.qtr("Record")},
57
+ { id: ControlListModel.ATOB_BUTTON, label: VLCIcons.atob, text: i18n.qtr("A-B Loop")},
58
+ { id: ControlListModel.FRAME_BUTTON, label: VLCIcons.frame_by_frame, text: i18n.qtr("Frame By Frame")},
59
+ { id: ControlListModel.SKIP_BACK_BUTTON, label: VLCIcons.skip_back, text: i18n.qtr("Step backward")},
60
+ { id: ControlListModel.SKIP_FW_BUTTON, label: VLCIcons.skip_for, text: i18n.qtr("Step forward")},
61
+ { id: ControlListModel.QUIT_BUTTON, label: VLCIcons.clear, text: i18n.qtr("Quit")},
62
+ { id: ControlListModel.RANDOM_BUTTON, label: VLCIcons.shuffle_on, text: i18n.qtr("Random")},
63
+ { id: ControlListModel.LOOP_BUTTON, label: VLCIcons.repeat_all, text: i18n.qtr("Loop")},
64
+ { id: ControlListModel.INFO_BUTTON, label: VLCIcons.info, text: i18n.qtr("Information")},
65
+ { id: ControlListModel.LANG_BUTTON, label: VLCIcons.audiosub, text: i18n.qtr("Open subtitles")},
66
+ { id: ControlListModel.MENU_BUTTON, label: VLCIcons.menu, text: i18n.qtr("Menu Button")},
67
+ { id: ControlListModel.BACK_BUTTON, label: VLCIcons.exit, text: i18n.qtr("Back Button")},
68
+ { id: ControlListModel.CHAPTER_PREVIOUS_BUTTON, label: VLCIcons.dvd_prev, text: i18n.qtr("Previous chapter")},
69
+ { id: ControlListModel.CHAPTER_NEXT_BUTTON, label: VLCIcons.dvd_next, text: i18n.qtr("Next chapter")},
70
+ { id: ControlListModel.VOLUME, label: VLCIcons.volume_high, text: i18n.qtr("Volume Widget")},
71
+ { id: ControlListModel.TELETEXT_BUTTONS, label: VLCIcons.tvtelx, text: i18n.qtr("Teletext")},
72
+ { id: ControlListModel.ASPECT_RATIO_COMBOBOX, label: VLCIcons.aspect_ratio, text: i18n.qtr("Aspect Ratio")},
73
+ { id: ControlListModel.WIDGET_SPACER, label: VLCIcons.space, text: i18n.qtr("Spacer")},
74
+ { id: ControlListModel.WIDGET_SPACER_EXTEND, label: VLCIcons.space, text: i18n.qtr("Expanding Spacer")},
75
+ { id: ControlListModel.PLAYER_SWITCH_BUTTON, label: VLCIcons.fullscreen, text: i18n.qtr("Switch Player")},
76
+ { id: ControlListModel.ARTWORK_INFO, label: VLCIcons.info, text: i18n.qtr("Artwork Info")},
77
+ { id: ControlListModel.PLAYBACK_SPEED_BUTTON, label: "1x", text: i18n.qtr("Playback Speed")}
78
]
79
80
function returnbuttondelegate(inpID){
81
switch (inpID){
82
- case PlayerControlBarModel.RANDOM_BUTTON: return randomBtnDelegate
83
- case PlayerControlBarModel.PREVIOUS_BUTTON: return prevBtnDelegate
84
- case PlayerControlBarModel.PLAY_BUTTON: return playBtnDelegate
85
- case PlayerControlBarModel.NEXT_BUTTON: return nextBtnDelegate
86
- case PlayerControlBarModel.LOOP_BUTTON: return repeatBtnDelegate
87
- case PlayerControlBarModel.LANG_BUTTON: return langBtnDelegate
88
- case PlayerControlBarModel.PLAYLIST_BUTTON:return playlistBtnDelegate
89
- case PlayerControlBarModel.MENU_BUTTON:return menuBtnDelegate
90
- case PlayerControlBarModel.CHAPTER_PREVIOUS_BUTTON:return chapterPreviousBtnDelegate
91
- case PlayerControlBarModel.CHAPTER_NEXT_BUTTON:return chapterNextBtnDelegate
92
- case PlayerControlBarModel.BACK_BUTTON:return backBtnDelegate
93
- case PlayerControlBarModel.WIDGET_SPACER:return spacerDelegate
94
- case PlayerControlBarModel.WIDGET_SPACER_EXTEND:return extendiblespacerDelegate
95
- case PlayerControlBarModel.RECORD_BUTTON: return recordBtnDelegate
96
- case PlayerControlBarModel.FULLSCREEN_BUTTON: return fullScreenBtnDelegate
97
- case PlayerControlBarModel.ATOB_BUTTON: return toggleABloopstateDelegate
98
- case PlayerControlBarModel.SNAPSHOT_BUTTON: return snapshotBtnDelegate
99
- case PlayerControlBarModel.STOP_BUTTON: return stopBtndelgate
100
- case PlayerControlBarModel.INFO_BUTTON: return mediainfoBtnDelegate
101
- case PlayerControlBarModel.FRAME_BUTTON: return framebyframeDelegate
102
- case PlayerControlBarModel.FASTER_BUTTON: return fasterBtnDelegate
103
- case PlayerControlBarModel.SLOWER_BUTTON: return slowerBtnDelegate
104
- case PlayerControlBarModel.OPEN_BUTTON: return openmediaBtnDelegate
105
- case PlayerControlBarModel.EXTENDED_BUTTON: return extdSettingsBtnDelegate
106
- case PlayerControlBarModel.SKIP_FW_BUTTON: return stepFwdBtnDelegate
107
- case PlayerControlBarModel.SKIP_BACK_BUTTON: return stepBackBtnDelegate
108
- case PlayerControlBarModel.QUIT_BUTTON: return quitBtnDelegate
109
- case PlayerControlBarModel.VOLUME: return volumeBtnDelegate
110
- case PlayerControlBarModel.ASPECT_RATIO_COMBOBOX: return aspectRatioDelegate
111
- case PlayerControlBarModel.TELETEXT_BUTTONS: return teletextdelegate
112
- case PlayerControlBarModel.PLAYER_SWITCH_BUTTON: return playerSwitchBtnDelegate
113
- case PlayerControlBarModel.ARTWORK_INFO: return artworkInfoDelegate
114
+ case ControlListModel.RANDOM_BUTTON: return randomBtnDelegate
115
+ case ControlListModel.PREVIOUS_BUTTON: return prevBtnDelegate
116
+ case ControlListModel.PLAY_BUTTON: return playBtnDelegate
117
+ case ControlListModel.NEXT_BUTTON: return nextBtnDelegate
118
+ case ControlListModel.LOOP_BUTTON: return repeatBtnDelegate
119
+ case ControlListModel.LANG_BUTTON: return langBtnDelegate
120
+ case ControlListModel.PLAYLIST_BUTTON:return playlistBtnDelegate
121
+ case ControlListModel.MENU_BUTTON:return menuBtnDelegate
122
+ case ControlListModel.CHAPTER_PREVIOUS_BUTTON:return chapterPreviousBtnDelegate
123
+ case ControlListModel.CHAPTER_NEXT_BUTTON:return chapterNextBtnDelegate
124
+ case ControlListModel.BACK_BUTTON:return backBtnDelegate
125
+ case ControlListModel.WIDGET_SPACER:return spacerDelegate
126
+ case ControlListModel.WIDGET_SPACER_EXTEND:return extendiblespacerDelegate
127
+ case ControlListModel.RECORD_BUTTON: return recordBtnDelegate
128
+ case ControlListModel.FULLSCREEN_BUTTON: return fullScreenBtnDelegate
129
+ case ControlListModel.ATOB_BUTTON: return toggleABloopstateDelegate
130
+ case ControlListModel.SNAPSHOT_BUTTON: return snapshotBtnDelegate
131
+ case ControlListModel.STOP_BUTTON: return stopBtndelgate
132
+ case ControlListModel.INFO_BUTTON: return mediainfoBtnDelegate
133
+ case ControlListModel.FRAME_BUTTON: return framebyframeDelegate
134
+ case ControlListModel.FASTER_BUTTON: return fasterBtnDelegate
135
+ case ControlListModel.SLOWER_BUTTON: return slowerBtnDelegate
136
+ case ControlListModel.OPEN_BUTTON: return openmediaBtnDelegate
137
+ case ControlListModel.EXTENDED_BUTTON: return extdSettingsBtnDelegate
138
+ case ControlListModel.SKIP_FW_BUTTON: return stepFwdBtnDelegate
139
+ case ControlListModel.SKIP_BACK_BUTTON: return stepBackBtnDelegate
140
+ case ControlListModel.QUIT_BUTTON: return quitBtnDelegate
141
+ case ControlListModel.VOLUME: return volumeBtnDelegate
142
+ case ControlListModel.ASPECT_RATIO_COMBOBOX: return aspectRatioDelegate
143
+ case ControlListModel.TELETEXT_BUTTONS: return teletextdelegate
144
+ case ControlListModel.PLAYER_SWITCH_BUTTON: return playerSwitchBtnDelegate
145
+ case ControlListModel.ARTWORK_INFO: return artworkInfoDelegate
146
+ case ControlListModel.PLAYBACK_SPEED_BUTTON: return playbackSpeedButtonDelegate
147
}
148
console.log("button delegate id " + inpID + " doesn't exists")
149
return spacerDelegate
150
151
size: VLCStyle.icon_medium
152
iconText: VLCIcons.audiosub
153
154
- onClicked: langMenu.open()
155
+ enabled: langMenuLoader.status === Loader.Ready
156
+ onClicked: langMenuLoader.item.open()
157
158
text: i18n.qtr("Languages and tracks")
159
160
- LanguageMenu {
161
- id: langMenu
162
+ Loader {
163
+ id: langMenuLoader
164
165
- parent: rootPlayer
166
- focus: true
167
- x: 0
168
- y: (!!rootPlayer) ? (rootPlayer.positionSliderY - height) : 0
169
- z: 1
170
+ active: (typeof rootPlayer !== 'undefined') && (rootPlayer !== null)
171
172
- onOpened: {
173
- controlButtons.requestLockUnlockAutoHide(true, controlButtons)
174
- rootPlayer._menu = langMenu
175
- }
176
+ sourceComponent: LanguageMenu {
177
+ id: langMenu
178
179
- onMenuClosed: {
180
- controlButtons.requestLockUnlockAutoHide(false, controlButtons)
181
- langBtn.forceActiveFocus()
182
- rootPlayer._menu = undefined
183
+ parent: rootPlayer
184
+ focus: true
185
+ x: 0
186
+ y: (rootPlayer.positionSliderY - height)
187
+ z: 1
188
+
189
+ onOpened: {
190
+ controlButtons.requestLockUnlockAutoHide(true, controlButtons)
191
+ if (!!rootPlayer)
192
+ rootPlayer.menu = langMenu
193
+ }
194
+
195
+ onClosed: {
196
+ controlButtons.requestLockUnlockAutoHide(false, controlButtons)
197
+ langBtn.forceActiveFocus()
198
+ if (!!rootPlayer)
199
+ rootPlayer.menu = undefined
200
+ }
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/LanguageMenu.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/LanguageMenu.qml
Changed
54
1
2
import "qrc:///util/" as Util
3
import "qrc:///util/KeyHelper.js" as KeyHelper
4
5
-T.Menu {
6
+T.Popup {
7
id: control
8
9
- property var parentMenu: undefined
10
- property bool _emitMenuClose: true
11
- signal menuClosed
12
-
13
- modal: true
14
- cascade: false
15
- closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
16
height: VLCStyle.dp(296, VLCStyle.scale)
17
- width: (!!rootPlayer) ? rootPlayer.width : 0
18
+ width: rootPlayer.width
19
20
- onOpened: {
21
- control._emitMenuClose = true
22
-
23
- for (var i = 0; i < control.count; i++) {
24
- if (control.itemAt(i).enabled) {
25
- control.currentIndex = i
26
- break
27
- }
28
- }
29
- }
30
-
31
- onClosed: {
32
- if (control._emitMenuClose) {
33
- menuClosed()
34
- }
35
+ // Popup.CloseOnPressOutside doesn't work with non-model Popup on Qt < 5.15
36
+ closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
37
+ modal: true
38
+ T.Overlay.modal: Rectangle {
39
+ color: "transparent"
40
}
41
42
contentItem: StackView {
43
44
opacity: .8
45
}
46
47
- T.Overlay.modal: Rectangle {
48
- color: "transparent"
49
- }
50
-
51
function _updateWidth(isFirstPage) {
52
if (isFirstPage)
53
control.width = Qt.binding(function () {
54
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/MiniPlayer.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/MiniPlayer.qml
Changed
10
1
2
sliderHeight: VLCStyle.dp(3, VLCStyle.scale)
3
sliderBackgroundColor: colors.sliderBarMiniplayerBgColor
4
sliderProgressColor: colors.accent
5
- configs: ["MiniPlayerToolbar-left", "MiniPlayerToolbar-center", "MiniPlayerToolbar-right"]
6
+ identifier: PlayerControlbarModel.Miniplayer
7
navigationParent: root
8
9
Keys.onPressed: {
10
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/PlaybackSpeed.qml
Added
175
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+import QtQuick 2.11
21
+import QtQuick.Controls 2.4
22
+import QtQuick.Layouts 1.3
23
+
24
+import org.videolan.vlc 0.1
25
+
26
+import "qrc:///style/"
27
+import "qrc:///widgets/" as Widgets
28
+
29
+Popup {
30
+ id: root
31
+
32
+ property VLCColors colors: VLCStyle.nightColors
33
+
34
+ height: implicitHeight
35
+ width: implicitWidth
36
+ padding: VLCStyle.margin_small
37
+
38
+ // Popup.CloseOnPressOutside doesn't work with non-model Popup on Qt < 5.15
39
+ closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
40
+ modal: true
41
+ Overlay.modal: Rectangle {
42
+ color: "transparent"
43
+ }
44
+
45
+ background: Rectangle {
46
+ color: colors.bg
47
+ opacity: .85
48
+ }
49
+
50
+ contentItem: ColumnLayout {
51
+ spacing: VLCStyle.margin_xsmall
52
+
53
+ Widgets.ListLabel {
54
+ text: i18n.qtr("Playback Speed")
55
+ color: root.colors.text
56
+ font.pixelSize: VLCStyle.fontSize_large
57
+
58
+ Layout.fillWidth: true
59
+ Layout.bottomMargin: VLCStyle.margin_xsmall
60
+ }
61
+
62
+ Slider {
63
+ id: speedSlider
64
+
65
+ property bool _inhibitUpdate: false
66
+
67
+ from: 0.25
68
+ to: 4
69
+ clip: true
70
+ implicitHeight: VLCStyle.heightBar_small
71
+ KeyNavigation.down: slowerButton
72
+
73
+ background: Rectangle {
74
+ x: speedSlider.leftPadding
75
+ y: speedSlider.topPadding + speedSlider.availableHeight / 2 - height / 2
76
+ implicitWidth: 200
77
+ implicitHeight: 4
78
+ width: speedSlider.availableWidth
79
+ height: implicitHeight
80
+ radius: 2
81
+ color: root.colors.bgAlt
82
+
83
+ Rectangle {
84
+ width: speedSlider.visualPosition * parent.width
85
+ height: parent.height
86
+ radius: 2
87
+ color: (speedSlider.activeFocus || speedSlider.pressed)
88
+ ? root.colors.accent
89
+ : root.colors.text
90
+ }
91
+ }
92
+
93
+ handle: Rectangle {
94
+ x: speedSlider.leftPadding + speedSlider.visualPosition * (speedSlider.availableWidth - width)
95
+ y: speedSlider.topPadding + speedSlider.availableHeight / 2 - height / 2
96
+ width: speedSlider.implicitHeight
97
+ height: speedSlider.implicitHeight
98
+ radius: speedSlider.implicitHeight
99
+ color: (speedSlider.activeFocus || speedSlider.pressed) ? root.colors.accent : root.colors.text
100
+ }
101
+
102
+ onValueChanged: {
103
+ if (_inhibitUpdate)
104
+ return
105
+ player.rate = value
106
+ }
107
+
108
+ function _updateFromPlayer() {
109
+ _inhibitUpdate = true
110
+ value = player.rate
111
+ _inhibitUpdate = false
112
+ }
113
+
114
+ Connections {
115
+ target: player
116
+ onRateChanged: speedSlider._updateFromPlayer()
117
+ }
118
+
119
+ Layout.fillWidth: true
120
+
121
+ Component.onCompleted: speedSlider._updateFromPlayer()
122
+ }
123
+
124
+ RowLayout {
125
+ spacing: 0
126
+ KeyNavigation.up: speedSlider
127
+
128
+ Widgets.IconControlButton {
129
+ id: slowerButton
130
+
131
+ iconText: VLCIcons.slower
132
+ colors: root.colors
133
+ KeyNavigation.right: resetButton
134
+
135
+ onClicked: speedSlider.decrease()
136
+ }
137
+
138
+ Item {
139
+ Layout.fillWidth: true
140
+ }
141
+
142
+ Widgets.IconControlButton {
143
+ id: resetButton
144
+
145
+ colors: root.colors
146
+ KeyNavigation.left: slowerButton
147
+ KeyNavigation.right: fasterButton
148
+
149
+ onClicked: speedSlider.value = 1.0
150
+
151
+ Label {
152
+ anchors.centerIn: parent
153
+ font.pixelSize: VLCStyle.fontSize_normal
154
+ text: i18n.qtr("1x")
155
+ color: resetButton.background.foregroundColor // IconToolButton.background is a FocusBackground
156
+ }
157
+ }
158
+
159
+ Item {
160
+ Layout.fillWidth: true
161
+ }
162
+
163
+ Widgets.IconControlButton {
164
+ id: fasterButton
165
+
166
+ iconText: VLCIcons.faster
167
+ colors: root.colors
168
+ KeyNavigation.left: resetButton
169
+
170
+ onClicked: speedSlider.increase()
171
+ }
172
+ }
173
+ }
174
+}
175
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/Player.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/Player.qml
Changed
82
1
2
id: rootPlayer
3
4
//menu/overlay to dismiss
5
- property var _menu: undefined
6
+ property var menu: undefined
7
property int _lockAutoHide: 0
8
readonly property bool _autoHide: _lockAutoHide == 0
9
&& rootPlayer.hasEmbededVideo
10
11
}
12
13
function dismiss() {
14
- if (_menu)
15
- _menu.dismiss()
16
+ if ((typeof menu === undefined) || !menu)
17
+ return
18
+ if (menu.hasOwnProperty("dismiss"))
19
+ menu.dismiss()
20
+ else if (menu.hasOwnProperty("close"))
21
+ menu.close()
22
}
23
24
function lockUnlockAutoHide(lock, source /*unused*/) {
25
26
edge: Widgets.DrawerExt.Edges.Top
27
state: topcontrolView.state
28
width: parent.width
29
- visible: rootPlayer.hasEmbededVideo || rootPlayer.pinVideoControls
30
+ visible: rootPlayer.hasEmbededVideo || rootPlayer.pinVideoControls || topcontrolView.contentItem.isResumeDialogVisible
31
height: contentItem.height
32
- component: rootPlayer.pinVideoControls ? backgroundForPinnedControls : topcontrolViewBackground
33
+
34
+ component: {
35
+ if (rootPlayer.pinVideoControls)
36
+ return backgroundForPinnedControls
37
+ else if (topcontrolView.contentItem.isResumeDialogVisible)
38
+ return topcontrolViewResumeBg
39
+ else
40
+ return topcontrolViewBackground
41
+ }
42
+
43
onContentItemChanged: {
44
if (rootPlayer.pinVideoControls)
45
contentItem.height = Qt.binding(function () { return topcontrolView.height + topcontrolView.anchors.topMargin; })
46
47
}
48
}
49
}
50
+
51
+ Component {
52
+ id: topcontrolViewResumeBg
53
+
54
+ Rectangle {
55
+ width: rootPlayer.width
56
+ height: topcontrolView.height + topcontrolView.anchors.topMargin * 2
57
+ color: rootPlayer.colors.playerBg
58
+ opacity: .8
59
+ }
60
+ }
61
}
62
63
/* bottom control bar background */
64
65
state: "visible"
66
67
component: FocusScope {
68
+ readonly property bool isResumeDialogVisible: resumeDialog.visible
69
+
70
width: topcontrolView.width
71
height: topbar.implicitHeight
72
focus: true
73
74
navigationUpItem: playlistpopup.showPlaylist ? playlistpopup : (audioControls.visible ? audioControls : topcontrolView)
75
76
onRequestLockUnlockAutoHide: rootPlayer.lockUnlockAutoHide(lock, source)
77
+
78
+ identifier: PlayerControlbarModel.Mainplayer
79
}
80
}
81
}
82
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/PlayerButtonsLayout.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/PlayerButtonsLayout.qml
Changed
136
1
2
property real spacing: VLCStyle.margin_normal // spacing between controls
3
property real layoutSpacing: VLCStyle.margin_xlarge // spacing between layouts (left, center, and right)
4
5
- signal requestLockUnlockAutoHide(bool lock, var source)
6
-
7
- enum Alignment {
8
- Left = 0,
9
- Center = 1,
10
- Right = 2
11
+ property int identifier: -1
12
+ readonly property var model: {
13
+ if (!!mainInterface.controlbarProfileModel.currentModel)
14
+ mainInterface.controlbarProfileModel.currentModel.getModel(identifier)
15
+ else
16
+ undefined
17
}
18
19
- property var models: []
20
-
21
- Connections {
22
- target: mainInterface
23
+ signal requestLockUnlockAutoHide(bool lock, var source)
24
25
- onToolBarConfUpdated: {
26
- models[PlayerButtonsLayout.Alignment.Left].reloadModel()
27
- models[PlayerButtonsLayout.Alignment.Center].reloadModel()
28
- models[PlayerButtonsLayout.Alignment.Right].reloadModel()
29
- }
30
+ Component.onCompleted: {
31
+ console.assert(identifier >= 0)
32
}
33
34
ControlButtons {
35
36
onRequestLockUnlockAutoHide: playerButtonsLayout.requestLockUnlockAutoHide(lock, source)
37
}
38
39
- ButtonsLayout {
40
+ Loader {
41
id: buttonrow_left
42
43
- model: models[PlayerButtonsLayout.Alignment.Left]
44
-
45
- extraWidth: (buttonrow_center.x - buttonrow_left.x - minimumWidth - layoutSpacing)
46
-
47
anchors {
48
left: parent.left
49
verticalCenter: parent.verticalCenter
50
51
bottomMargin: marginBottom
52
rightMargin: layoutSpacing
53
}
54
-
55
- visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
56
57
- navigationParent: playerButtonsLayout
58
- navigationRightItem: buttonrow_center
59
+ active: !!playerButtonsLayout.model && !!playerButtonsLayout.model.left
60
+
61
+ sourceComponent: ButtonsLayout {
62
+ model: playerButtonsLayout.model.left
63
+
64
+ extraWidth: (buttonrow_center.x - buttonrow_left.x - minimumWidth - layoutSpacing)
65
66
- focus: true
67
+ visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
68
+
69
+ navigationParent: playerButtonsLayout
70
+ navigationRightItem: buttonrow_center
71
+
72
+ focus: true
73
+ }
74
}
75
76
- ButtonsLayout {
77
+ Loader {
78
id: buttonrow_center
79
80
- model: models[PlayerButtonsLayout.Alignment.Center]
81
-
82
anchors {
83
centerIn: parent
84
85
86
bottomMargin: playerButtonsLayout.marginBottom
87
}
88
89
- navigationParent: playerButtonsLayout
90
- navigationLeftItem: buttonrow_left
91
- navigationRightItem: buttonrow_right
92
- }
93
+ active: !!playerButtonsLayout.model && !!playerButtonsLayout.model.center
94
95
- ButtonsLayout {
96
- id: buttonrow_right
97
+ sourceComponent: ButtonsLayout {
98
+ model: playerButtonsLayout.model.center
99
100
- model: models[PlayerButtonsLayout.Alignment.Right]
101
+ navigationParent: playerButtonsLayout
102
+ navigationLeftItem: buttonrow_left
103
+ navigationRightItem: buttonrow_right
104
+ }
105
+ }
106
107
- extraWidth: (playerButtonsLayout.width - (buttonrow_center.x + buttonrow_center.width) - minimumWidth - (2 * layoutSpacing))
108
+ Loader {
109
+ id: buttonrow_right
110
111
anchors {
112
right: parent.right
113
114
leftMargin: layoutSpacing
115
}
116
117
- visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
118
+ active: !!playerButtonsLayout.model && !!playerButtonsLayout.model.right
119
120
- navigationParent: playerButtonsLayout
121
- navigationLeftItem: buttonrow_center
122
+ sourceComponent: ButtonsLayout {
123
+
124
+
125
+ model: playerButtonsLayout.model.right
126
+
127
+ extraWidth: (playerButtonsLayout.width - (buttonrow_center.x + buttonrow_center.width) - minimumWidth - (2 * layoutSpacing))
128
+
129
+ visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
130
+
131
+ navigationParent: playerButtonsLayout
132
+ navigationLeftItem: buttonrow_center
133
+ }
134
}
135
}
136
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/ResumeDialog.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/ResumeDialog.qml
Changed
140
1
2
hideResumePanel()
3
}
4
5
- Rectangle {
6
+ //drag and dbl click the titlebar in CSD mode
7
+ Loader {
8
anchors.fill: parent
9
- color: resumePanel.colors.setColorAlpha(resumePanel.colors.playerBg, 0.8)
10
+ active: mainInterface.clientSideDecoration
11
+ source: "qrc:///widgets/CSDTitlebarTapNDrapHandler.qml"
12
+ }
13
14
- //drag and dbl click the titlebar in CSD mode
15
- Loader {
16
- anchors.fill: parent
17
- active: mainInterface.clientSideDecoration
18
- source: "qrc:///widgets/CSDTitlebarTapNDrapHandler.qml"
19
- }
20
+ RowLayout {
21
+ id: layout
22
23
- RowLayout {
24
- id: layout
25
+ anchors.fill: parent
26
+ anchors.leftMargin: VLCStyle.margin_small
27
+ spacing: VLCStyle.margin_small
28
29
- anchors.fill: parent
30
- anchors.leftMargin: VLCStyle.margin_small
31
- spacing: VLCStyle.margin_small
32
+ Label {
33
+ Layout.preferredHeight: implicitHeight
34
+ Layout.preferredWidth: implicitWidth
35
36
- Label {
37
- Layout.preferredHeight: implicitHeight
38
- Layout.preferredWidth: implicitWidth
39
+ color: resumePanel.colors.playerFg
40
+ font.pixelSize: VLCStyle.fontSize_normal
41
+ font.bold: true
42
43
- color: resumePanel.colors.playerFg
44
- font.pixelSize: VLCStyle.fontSize_normal
45
- font.bold: true
46
+ text: i18n.qtr("Do you want to restart the playback where you left off?")
47
+ }
48
49
- text: i18n.qtr("Do you want to restart the playback where you left off?")
50
+ Widgets.TabButtonExt {
51
+ id: continueBtn
52
+ Layout.preferredHeight: implicitHeight
53
+ Layout.preferredWidth: implicitWidth
54
+ text: i18n.qtr("Continue")
55
+ font.bold: true
56
+ color: resumePanel.colors.playerFg
57
+ focus: true
58
+ onClicked: {
59
+ player.restorePlaybackPos()
60
+ hideResumePanel()
61
}
62
63
- Widgets.TabButtonExt {
64
- id: continueBtn
65
- Layout.preferredHeight: implicitHeight
66
- Layout.preferredWidth: implicitWidth
67
- text: i18n.qtr("Continue")
68
- font.bold: true
69
- color: resumePanel.colors.playerFg
70
- focus: true
71
- onClicked: {
72
- player.restorePlaybackPos()
73
- hideResumePanel()
74
- }
75
-
76
- KeyNavigation.right: closeBtn
77
- }
78
+ KeyNavigation.right: closeBtn
79
+ }
80
81
- Widgets.TabButtonExt {
82
- id: closeBtn
83
- Layout.preferredHeight: implicitHeight
84
- Layout.preferredWidth: implicitWidth
85
- text: i18n.qtr("Dismiss")
86
- font.bold: true
87
- color: resumePanel.colors.playerFg
88
- onClicked: hideResumePanel()
89
+ Widgets.TabButtonExt {
90
+ id: closeBtn
91
+ Layout.preferredHeight: implicitHeight
92
+ Layout.preferredWidth: implicitWidth
93
+ text: i18n.qtr("Dismiss")
94
+ font.bold: true
95
+ color: resumePanel.colors.playerFg
96
+ onClicked: hideResumePanel()
97
98
- KeyNavigation.left: continueBtn
99
- }
100
+ KeyNavigation.left: continueBtn
101
+ }
102
103
- Item {
104
- Layout.fillWidth: true
105
- }
106
+ Item {
107
+ Layout.fillWidth: true
108
+ }
109
110
- Loader {
111
- id: csdDecorations
112
-
113
- focus: false
114
- height: VLCStyle.icon_normal
115
- active: mainInterface.clientSideDecoration
116
- enabled: mainInterface.clientSideDecoration
117
- visible: mainInterface.clientSideDecoration
118
- source: "qrc:///widgets/CSDWindowButtonSet.qml"
119
- onLoaded: {
120
- item.color = Qt.binding(function() { return resumePanel.colors.playerFg })
121
- item.hoverColor = Qt.binding(function() { return resumePanel.colors.windowCSDButtonDarkBg })
122
- }
123
+ Loader {
124
+ id: csdDecorations
125
+
126
+ Layout.alignment: Qt.AlignTop | Qt.AlignRight
127
+
128
+ focus: false
129
+ height: VLCStyle.icon_normal
130
+ active: mainInterface.clientSideDecoration
131
+ enabled: mainInterface.clientSideDecoration
132
+ visible: mainInterface.clientSideDecoration
133
+ source: "qrc:///widgets/CSDWindowButtonSet.qml"
134
+ onLoaded: {
135
+ item.color = Qt.binding(function() { return resumePanel.colors.playerFg })
136
+ item.hoverColor = Qt.binding(function() { return resumePanel.colors.windowCSDButtonDarkBg })
137
}
138
}
139
}
140
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/TopBar.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/TopBar.qml
Changed
10
1
2
Widgets.IconToolButton {
3
id: playlistButton
4
5
- objectName: PlayerControlBarModel.PLAYLIST_BUTTON
6
+ objectName: ControlListModel.PLAYLIST_BUTTON
7
size: VLCStyle.banner_icon_size
8
iconText: VLCIcons.playlist
9
text: i18n.qtr("Playlist")
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/player/qml/VolumeWidget.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/player/qml/VolumeWidget.qml
Changed
28
1
2
3
onPositionChanged: function (event) {
4
if (sliderMouseArea.pressedButtons === Qt.RightButton) {
5
- if (sliderMouseArea.mouseX < sliderMouseArea.width * volControl.fullvolpos / 4)
6
+ var pos = sliderMouseArea.mouseX * volControl.maxvolpos / sliderMouseArea.width
7
+ if (pos < 0.25)
8
volControl.value = 0
9
- else if (sliderMouseArea.mouseX < sliderMouseArea.width * volControl.fullvolpos * 3 / 4)
10
+ else if (pos < 0.75)
11
volControl.value = 0.5
12
- else if (sliderMouseArea.mouseX >= sliderMouseArea.width)
13
- volControl.value = 1.25
14
- else
15
+ else if (pos < 1.125)
16
volControl.value = 1
17
+ else
18
+ volControl.value = 1.25
19
return
20
}
21
22
if(pressed)
23
- volControl.value = volControl.maxvolpos * event.x / (volControl.width)
24
+ volControl.value = volControl.maxvolpos * (event.x - handle.width / 2) / (sliderMouseArea.width - handle.width)
25
}
26
27
onWheel: {
28
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/playlist/playlist_controller.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/playlist/playlist_controller.cpp
Changed
14
1
2
if( !path )
3
return;
4
5
- QUrl file = QUrl::fromLocalFile( QFileInfo(path).absolutePath() );
6
+ QString containingDir = QFileInfo( path ).absolutePath();
7
+ if( !QFileInfo( containingDir ).isDir() )
8
+ return;
9
+
10
+ QUrl file = QUrl::fromLocalFile( containingDir );
11
free( path );
12
13
if( !file.isLocalFile() )
14
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/playlist/playlist_item.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/playlist/playlist_item.cpp
Changed
23
1
2
void PlaylistItem::sync() {
3
input_item_t *media = vlc_playlist_item_GetMedia(d->item.get());
4
vlc_mutex_lock(&media->lock);
5
- d->title = media->psz_name;
6
d->duration = media->i_duration;
7
d->url = media->psz_uri;
8
9
if (media->p_meta) {
10
+ d->title = vlc_meta_Get(media->p_meta, vlc_meta_Title);
11
d->artist = vlc_meta_Get(media->p_meta, vlc_meta_Artist);
12
d->album = vlc_meta_Get(media->p_meta, vlc_meta_Album);
13
d->artwork = vlc_meta_Get(media->p_meta, vlc_meta_ArtworkURL);
14
}
15
+
16
+ if (d->title.isNull())
17
+ /* If there is no title, use the item name */
18
+ d->title = media->psz_name;
19
+
20
vlc_mutex_unlock(&media->lock);
21
}
22
23
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/playlist/qml/PlaylistDelegate.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
Changed
10
1
2
3
hoverEnabled: true
4
5
- acceptedButtons: acceptedButtons | Qt.RightButton
6
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
7
8
onContainsMouseChanged: {
9
if (containsMouse) {
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/playlist/qml/PlaylistListView.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/playlist/qml/PlaylistListView.qml
Changed
42
1
2
3
import "qrc:///widgets/" as Widgets
4
import "qrc:///util/KeyHelper.js" as KeyHelper
5
+import "qrc:///util/Helpers.js" as Helpers
6
import "qrc:///style/"
7
8
Widgets.NavigableFocusScope {
9
10
Move // Keyboard item move mode, activated through PlaylistOverlayMenu
11
}
12
13
- function isValidInstanceOf(object, type) {
14
- return (!!object && (object instanceof type))
15
- }
16
-
17
function isDropAcceptable(drop, index) {
18
return drop.hasUrls || // external drop (i.e. from filesystem)
19
- (isValidInstanceOf(drop.source, Widgets.DragItem)) // internal drop (inter-view or intra-playlist)
20
+ (Helpers.isValidInstanceOf(drop.source, Widgets.DragItem)) // internal drop (inter-view or intra-playlist)
21
}
22
23
function acceptDrop(index, drop) {
24
25
model.moveItemsPre(model.getSelection(), index);
26
27
// NOTE: Dropping medialibrary content into the queue.
28
- } else if (isValidInstanceOf(item, Widgets.DragItem)) {
29
+ } else if (Helpers.isValidInstanceOf(item, Widgets.DragItem)) {
30
mainPlaylistController.insert(index, item.getSelectedInputItem());
31
32
// NOTE: Dropping an external item (i.e. filesystem) into the queue.
33
34
return model.getItemsForIndexes(model.getSelection())
35
}
36
37
- property point _pos: null
38
+ property point _pos
39
property int _scrollingDirection: 0
40
41
function updatePos(pos) {
42
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/playlist/qml/PlaylistToolbar.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/playlist/qml/PlaylistToolbar.qml
Changed
37
1
2
3
Item {
4
Layout.fillWidth: true
5
- implicitHeight: childrenRect.height
6
+ implicitHeight: loop.height
7
8
Widgets.IconToolButton {
9
id: loop
10
11
12
Item {
13
Layout.fillWidth: true
14
- implicitHeight: childrenRect.height
15
+ implicitHeight: shuffle.height
16
17
Widgets.IconToolButton {
18
id: shuffle
19
20
21
Item {
22
Layout.fillWidth: true
23
- implicitHeight: childrenRect.height
24
+ implicitHeight: sort.height
25
26
Widgets.SortControl {
27
id: sort
28
29
30
Item {
31
Layout.fillWidth: true
32
- implicitHeight: childrenRect.height
33
+ implicitHeight: clear.height
34
35
Widgets.IconToolButton {
36
id: clear
37
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/qt.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/qt.cpp
Changed
45
1
2
/* Wait for the interface to be ready. This prevents the main
3
* LibVLC thread from starting video playback before we can create
4
* an embedded video window. */
5
+#ifndef Q_OS_MAC
6
while (open_state == OPEN_STATE_INIT)
7
wait_ready.wait(lock);
8
+#endif
9
10
if (open_state == OPEN_STATE_ERROR)
11
{
12
13
/* Explain how to show a dialog :D */
14
p_intf->pf_show_dialog = ShowDialog;
15
16
+#ifndef Q_OS_MAC
17
/* Tell the main LibVLC thread we are ready */
18
{
19
vlc::threads::mutex_locker locker (lock);
20
open_state = OPEN_STATE_OPENED;
21
wait_ready.signal();
22
}
23
-
24
-#ifdef Q_OS_MAC
25
+#else
26
/* We took over main thread, register and start here */
27
if( !p_sys->b_isDialogProvider )
28
{
29
30
intf_sys_t *p_sys = p_intf->p_sys;
31
32
{
33
+#ifndef Q_OS_MAC
34
vlc::threads::mutex_locker locker (lock);
35
+#endif
36
if( error )
37
{
38
open_state = OPEN_STATE_ERROR;
39
+#ifndef Q_OS_MAC
40
wait_ready.signal();
41
+#endif
42
}
43
else
44
open_state = OPEN_STATE_INIT;
45
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/qt.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/qt.hpp
Changed
15
1
2
3
#define qfu( i ) QString::fromUtf8( i )
4
#define qfue( i ) QString::fromUtf8( i ).replace( "&", "&&" ) /* for actions/buttons */
5
-#define qtr( i ) QString::fromUtf8( vlc_gettext(i) )
6
+#define qfut( i ) QString::fromUtf8( vlc_gettext(i) )
7
#define qtu( i ) ((i).toUtf8().constData())
8
9
+/* For marking translatable static strings (like `_()`) */
10
+#define qtr( i ) qfut( i )
11
+
12
#define CONNECT( a, b, c, d ) \
13
connect( a, SIGNAL(b), c, SLOT(d) )
14
#define DCONNECT( a, b, c, d ) \
15
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/style/VLCStyle.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/style/VLCStyle.qml
Changed
9
1
2
property int icon_checkedDelegate: dp(40, scale)
3
4
property int play_cover_small: dp(24, scale)
5
+ property int play_cover_normal: dp(48, scale)
6
7
property int cover_xxsmall: dp(32, scale);
8
property int cover_xsmall: dp(64, scale);
9
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/util/qml/Helpers.js
Added
48
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+.pragma library
21
+
22
+function msToString(time, short) {
23
+ if (time < 0) return "--:--"
24
+
25
+ var t_sec = Math.floor(time / 1000)
26
+ var sec = t_sec % 60
27
+ var min = Math.floor(t_sec / 60) % 60
28
+ var hour = Math.floor(t_sec / 3600)
29
+
30
+ function prefixZero(number) {
31
+ return number < 10 ? "0" + number : number;
32
+ }
33
+
34
+ if (hour === 0)
35
+ return "%1:%2".arg(prefixZero(min)).arg(prefixZero(sec))
36
+ if (!!short)
37
+ return "%1h%2".arg(hour.toFixed()).arg(prefixZero(min))
38
+ return "%1:%2:%3".arg(prefixZero(hour)).arg(prefixZero(min)).arg(prefixZero(sec))
39
+}
40
+
41
+function clamp(num, min, max) {
42
+ return num <= min ? min : num >= max ? max : num;
43
+}
44
+
45
+function isValidInstanceOf(object, type) {
46
+ return (!!object && (object instanceof type))
47
+}
48
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/vlc.qrc -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/vlc.qrc
Changed
65
1
2
<file alias="wait4.svg">pixmaps/util/wait4.svg</file>
3
<file alias="SelectableDelegateModel.qml">util/qml/SelectableDelegateModel.qml</file>
4
<file alias="KeyHelper.js">util/qml/KeyHelper.js</file>
5
+ <file alias="Helpers.js">util/qml/Helpers.js</file>
6
</qresource>
7
<qresource prefix="/toolbar">
8
<file alias="faster.svg">pixmaps/faster.svg</file>
9
10
<file alias="RoundButton.qml">widgets/qml/RoundButton.qml</file>
11
<file alias="LabelSeparator.qml">widgets/qml/LabelSeparator.qml</file>
12
<file alias="ContextButton.qml">widgets/qml/ContextButton.qml</file>
13
- <file alias="RoundImage.qml">widgets/qml/RoundImage.qml</file>
14
- <file alias="VideoQualityLabel.qml">widgets/qml/VideoQualityLabel.qml</file>
15
+ <file alias="VideoQualityLabels.qml">widgets/qml/VideoQualityLabels.qml</file>
16
<file alias="VideoProgressBar.qml">widgets/qml/VideoProgressBar.qml</file>
17
<file alias="NavigableCol.qml">widgets/qml/NavigableCol.qml</file>
18
<file alias="NavigableRow.qml">widgets/qml/NavigableRow.qml</file>
19
20
<file alias="ListCoverShadow.qml">widgets/qml/ListCoverShadow.qml</file>
21
<file alias="OverlayMenu.qml">widgets/qml/OverlayMenu.qml</file>
22
<file alias="IconControlButton.qml">widgets/qml/IconControlButton.qml</file>
23
+ <file alias="ShadowCoverGenerator.qml">widgets/qml/ShadowCoverGenerator.qml</file>
24
+ <file alias="GridShadows.qml">widgets/qml/GridShadows.qml</file>
25
</qresource>
26
<qresource prefix="/network">
27
<file alias="AddressbarButton.qml">network/qml/AddressbarButton.qml</file>
28
29
</qresource>
30
<qresource prefix="/medialibrary">
31
<file alias="EmptyLabel.qml">medialibrary/qml/EmptyLabel.qml</file>
32
+ <file alias="MediaGroupDisplay.qml">medialibrary/qml/MediaGroupDisplay.qml</file>
33
+ <file alias="MediaGroupList.qml">medialibrary/qml/MediaGroupList.qml</file>
34
<file alias="MusicAlbums.qml">medialibrary/qml/MusicAlbums.qml</file>
35
<file alias="MusicDisplay.qml">medialibrary/qml/MusicDisplay.qml</file>
36
<file alias="MusicGenres.qml">medialibrary/qml/MusicGenres.qml</file>
37
<file alias="VideoDisplay.qml">medialibrary/qml/VideoDisplay.qml</file>
38
<file alias="VideoAll.qml">medialibrary/qml/VideoAll.qml</file>
39
<file alias="VideoAllDisplay.qml">medialibrary/qml/VideoAllDisplay.qml</file>
40
+ <file alias="VideoGroupsDisplay.qml">medialibrary/qml/VideoGroupsDisplay.qml</file>
41
<file alias="PlaylistMediaList.qml">medialibrary/qml/PlaylistMediaList.qml</file>
42
<file alias="PlaylistMedia.qml">medialibrary/qml/PlaylistMedia.qml</file>
43
<file alias="PlaylistMediaDelegate.qml">medialibrary/qml/PlaylistMediaDelegate.qml</file>
44
45
<file alias="PlayerMenuItem.qml">player/qml/PlayerMenuItem.qml</file>
46
<file alias="LanguageMenu.qml">player/qml/LanguageMenu.qml</file>
47
<file alias="ButtonsLayout.qml">player/qml/ButtonsLayout.qml</file>
48
+ <file alias="PlaybackSpeed.qml">player/qml/PlaybackSpeed.qml</file>
49
</qresource>
50
<qresource prefix="/about">
51
<file alias="About.qml">dialogs/help/qml/About.qml</file>
52
53
<file alias="CustomDialog.qml">dialogs/dialogs/qml/CustomDialog.qml</file>
54
<file alias="Dialogs.qml">dialogs/dialogs/qml/Dialogs.qml</file>
55
<file alias="ModalDialog.qml">dialogs/dialogs/qml/ModalDialog.qml</file>
56
+ <file alias="WindowDialog.qml">dialogs/dialogs/qml/WindowDialog.qml</file>
57
<file alias="EditorDummyButton.qml">dialogs/toolbar/qml/EditorDummyButton.qml</file>
58
<file alias="EditorDNDDelegate.qml">dialogs/toolbar/qml/EditorDNDDelegate.qml</file>
59
<file alias="ToolbarEditorButtonList.qml">dialogs/toolbar/qml/ToolbarEditorButtonList.qml</file>
60
<file alias="ToolbarEditor.qml">dialogs/toolbar/qml/ToolbarEditor.qml</file>
61
+ <file alias="ToolbarEditorDialog.qml">dialogs/toolbar/qml/ToolbarEditorDialog.qml</file>
62
<file alias="EditorDNDView.qml">dialogs/toolbar/qml/EditorDNDView.qml</file>
63
<file alias="EditorTabButton.qml">dialogs/toolbar/qml/EditorTabButton.qml</file>
64
</qresource>
65
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/native/customwidgets.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/native/customwidgets.cpp
Changed
51
1
2
#include "customwidgets.hpp"
3
#include "qt.hpp" /* needed for qtr, but not necessary */
4
5
+#include <QtMath> // for wheel deadzone calculation
6
#include <QPainter>
7
#include <QRect>
8
#include <QKeyEvent>
9
10
11
int qtWheelEventToVLCKey( const QWheelEvent& e )
12
{
13
- int i_vlck = 0;
14
- /* Handle modifiers */
15
- i_vlck |= qtKeyModifiersToVLC( e );
16
+ const qreal v_cos_deadzone = 0.45; // ~63 degrees
17
+ const qreal h_cos_deadzone = 0.95; // ~15 degrees
18
19
-#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
20
- if ( e.angleDelta().y() > 0 )
21
-#else
22
- if ( e.delta() > 0 )
23
-#endif
24
- {
25
- i_vlck |= KEY_MOUSEWHEELUP;
26
- }
27
- else
28
+ int i_vlck = qtKeyModifiersToVLC(e); // Handle modifiers
29
+
30
+ QPoint p = e.angleDelta();
31
+ if (!p.isNull())
32
{
33
- i_vlck |= KEY_MOUSEWHEELDOWN;
34
+ qreal cos = qFabs(p.x())/qSqrt(qPow(p.x(), 2) + qPow(p.y(), 2));
35
+
36
+ if (cos < v_cos_deadzone)
37
+ {
38
+ if (p.y() > 0) i_vlck |= KEY_MOUSEWHEELUP;
39
+ else i_vlck |= KEY_MOUSEWHEELDOWN;
40
+ }
41
+ else if (cos > h_cos_deadzone)
42
+ {
43
+ if (p.x() > 0) i_vlck |= KEY_MOUSEWHEELLEFT;
44
+ else i_vlck |= KEY_MOUSEWHEELRIGHT;
45
+ }
46
}
47
+
48
return i_vlck;
49
}
50
51
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/native/roundimage.cpp
Added
201
1
2
+/*****************************************************************************
3
+ * roundimage.cpp: Custom widgets
4
+ ****************************************************************************
5
+ * Copyright (C) 2021 the VideoLAN team
6
+ *
7
+ * Authors: Prince Gupta <guptaprince8832@gmail.com>
8
+ *
9
+ * This program is free software; you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation; either version 2 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
+ *****************************************************************************/
23
+
24
+
25
+#ifdef HAVE_CONFIG_H
26
+# include "config.h"
27
+#endif
28
+
29
+#include "roundimage.hpp"
30
+
31
+#include <QBrush>
32
+#include <QImage>
33
+#include <QPainterPath>
34
+#include <QPen>
35
+#include <QQuickWindow>
36
+#include <QSvgRenderer>
37
+#include <QGuiApplication>
38
+
39
+#ifdef QT_NETWORK_LIB
40
+#include <QNetworkAccessManager>
41
+#include <QNetworkReply>
42
+#include <QNetworkRequest>
43
+#endif
44
+
45
+namespace
46
+{
47
+ QString getPath(const QUrl &url)
48
+ {
49
+ QString path = url.isLocalFile() ? url.toLocalFile() : url.toString();
50
+ if (path.startsWith("qrc:///"))
51
+ path.replace(0, strlen("qrc:///"), ":/");
52
+ return path;
53
+ }
54
+
55
+ QByteArray readFile(const QUrl &url)
56
+ {
57
+#ifdef QT_NETWORK_LIB
58
+ if (url.scheme() == "http" || url.scheme() == "https")
59
+ {
60
+ QNetworkAccessManager networkMgr;
61
+ networkMgr.setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
62
+ auto reply = networkMgr.get(QNetworkRequest(url));
63
+ QEventLoop loop;
64
+ QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
65
+ loop.exec();
66
+ return reply->readAll();
67
+ }
68
+#endif
69
+
70
+ QByteArray data;
71
+ QString path = getPath(url);
72
+ QFile file(path);
73
+ if (file.open(QIODevice::ReadOnly))
74
+ data = file.readAll();
75
+ return data;
76
+ }
77
+}
78
+
79
+RoundImage::RoundImage(QQuickItem *parent) : QQuickPaintedItem {parent}
80
+{
81
+ if (window() || qGuiApp)
82
+ setDPR(window() ? window()->devicePixelRatio() : qGuiApp->devicePixelRatio());
83
+
84
+ connect(this, &QQuickItem::heightChanged, this, &RoundImage::regenerateRoundImage);
85
+ connect(this, &QQuickItem::widthChanged, this, &RoundImage::regenerateRoundImage);
86
+}
87
+
88
+void RoundImage::paint(QPainter *painter)
89
+{
90
+ painter->drawImage(QPointF {0., 0.}, m_roundImage, m_roundImage.rect());
91
+}
92
+
93
+void RoundImage::classBegin()
94
+{
95
+ QQuickPaintedItem::classBegin();
96
+
97
+ m_isComponentComplete = false;
98
+}
99
+
100
+void RoundImage::componentComplete()
101
+{
102
+ QQuickPaintedItem::componentComplete();
103
+
104
+ Q_ASSERT(!m_isComponentComplete); // classBegin is not called?
105
+ m_isComponentComplete = true;
106
+ if (!m_source.isEmpty())
107
+ updateSource();
108
+}
109
+
110
+QUrl RoundImage::source() const
111
+{
112
+ return m_source;
113
+}
114
+
115
+qreal RoundImage::radius() const
116
+{
117
+ return m_radius;
118
+}
119
+
120
+QSizeF RoundImage::sourceSize() const
121
+{
122
+ return m_sourceSize;
123
+}
124
+
125
+void RoundImage::setSource(QUrl source)
126
+{
127
+ if (m_source == source)
128
+ return;
129
+
130
+ m_source = source;
131
+ emit sourceChanged(m_source);
132
+ updateSource();
133
+}
134
+
135
+void RoundImage::setRadius(qreal radius)
136
+{
137
+ if (m_radius == radius)
138
+ return;
139
+
140
+ m_radius = radius;
141
+ emit radiusChanged(m_radius);
142
+ regenerateRoundImage();
143
+}
144
+
145
+void RoundImage::setSourceSize(QSizeF sourceSize)
146
+{
147
+ if (m_sourceSize == sourceSize)
148
+ return;
149
+
150
+ m_sourceSize = sourceSize;
151
+ emit sourceSizeChanged(m_sourceSize);
152
+ updateSource();
153
+}
154
+
155
+void RoundImage::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value)
156
+{
157
+ if (change == QQuickItem::ItemDevicePixelRatioHasChanged)
158
+ setDPR(value.realValue);
159
+
160
+ QQuickPaintedItem::itemChange(change, value);
161
+}
162
+
163
+void RoundImage::setDPR(const qreal value)
164
+{
165
+ if (m_dpr == value)
166
+ return;
167
+
168
+ m_dpr = value;
169
+ if (m_sourceSize.isValid())
170
+ updateSource(); // "effectiveSourceSize" is changed
171
+ else
172
+ regenerateRoundImage();
173
+}
174
+
175
+void RoundImage::updateSource()
176
+{
177
+ if (!m_isComponentComplete)
178
+ return;
179
+
180
+ const QSizeF effectiveSourceSize = m_sourceSize.isValid() ? m_sourceSize * m_dpr : QSize {};
181
+ m_loader.reset(new Loader({m_source, effectiveSourceSize}));
182
+ connect(m_loader.get(), &BaseAsyncTask::result, this, [this]()
183
+ {
184
+ m_sourceImage = m_loader->takeResult();
185
+ m_loader.reset();
186
+
187
+ regenerateRoundImage();
188
+ });
189
+
190
+ m_loader->start(*QThreadPool::globalInstance());
191
+}
192
+
193
+void RoundImage::regenerateRoundImage()
194
+{
195
+ if (!m_isComponentComplete
196
+ || m_enqueuedGeneration
197
+ || m_loader /* when loader ends it will call regenerateRoundImage */)
198
+ return;
199
+
200
+ // use Qt::QueuedConnection to delay generation, so that dependent properties
201
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/native/roundimage.hpp
Added
141
1
2
+/*****************************************************************************
3
+ * roundimage.hpp: Custom widgets
4
+ ****************************************************************************
5
+ * Copyright (C) 2021 the VideoLAN team
6
+ *
7
+ * Authors: Prince Gupta <guptaprince8832@gmail.com>
8
+ *
9
+ * This program is free software; you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation; either version 2 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22
+ *****************************************************************************/
23
+
24
+#ifndef VLC_QT_ROUNDIMAGE_HPP
25
+#define VLC_QT_ROUNDIMAGE_HPP
26
+
27
+#include "qt.hpp"
28
+
29
+#include "util/asynctask.hpp"
30
+
31
+#include <QPixmap>
32
+#include <QPainter>
33
+#include <QQuickPaintedItem>
34
+#include <QUrl>
35
+
36
+class RoundImage : public QQuickPaintedItem
37
+{
38
+ Q_OBJECT
39
+
40
+ // url of the image
41
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
42
+
43
+ // sets the maximum number of pixels stored for the loaded image so that large images do not use more memory than necessary
44
+ Q_PROPERTY(QSizeF sourceSize READ sourceSize WRITE setSourceSize NOTIFY sourceSizeChanged)
45
+
46
+ Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
47
+
48
+public:
49
+ RoundImage(QQuickItem *parent = nullptr);
50
+
51
+ void paint(QPainter *painter) override;
52
+
53
+ void classBegin() override;
54
+ void componentComplete() override;
55
+
56
+ QUrl source() const;
57
+ qreal radius() const;
58
+ QSizeF sourceSize() const;
59
+
60
+public slots:
61
+ void setSource(QUrl source);
62
+ void setRadius(qreal radius);
63
+ void setSourceSize(QSizeF sourceSize);
64
+
65
+signals:
66
+ void sourceChanged(QUrl source);
67
+ void radiusChanged(int radius);
68
+ void sourceSizeChanged(QSizeF sourceSize);
69
+
70
+protected:
71
+ void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value) override;
72
+
73
+private:
74
+ class Image
75
+ {
76
+ public:
77
+ static std::shared_ptr<Image> getImage(const QUrl &source, const QSizeF &sourceSize);
78
+ virtual ~Image() = default;
79
+
80
+ // must be reentrant
81
+ virtual void paint(QPainter *painter, const QSizeF &size) = 0;
82
+ };
83
+
84
+ using ImagePtr = std::shared_ptr<Image>;
85
+
86
+ class Loader : public AsyncTask<ImagePtr>
87
+ {
88
+ public:
89
+ struct Params
90
+ {
91
+ QUrl source;
92
+ QSizeF sourceSize;
93
+ };
94
+
95
+ Loader(const Params ¶ms);
96
+
97
+ ImagePtr execute();
98
+
99
+ private:
100
+ const Params params;
101
+ };
102
+
103
+ class RoundImageGenerator : public AsyncTask<QImage>
104
+ {
105
+ public:
106
+ struct Params
107
+ {
108
+ qreal width;
109
+ qreal height;
110
+ qreal radius;
111
+ ImagePtr image;
112
+ };
113
+
114
+ RoundImageGenerator(const Params ¶ms);
115
+
116
+ QImage execute();
117
+
118
+ private:
119
+ const Params params;
120
+ };
121
+
122
+ void setDPR(qreal value);
123
+ void updateSource();
124
+ void regenerateRoundImage();
125
+
126
+ QUrl m_source;
127
+ ImagePtr m_sourceImage;
128
+ qreal m_radius = 0.0;
129
+ QSizeF m_sourceSize;
130
+ qreal m_dpr = 1.0; // device pixel ratio
131
+ QImage m_roundImage;
132
+ TaskHandle<Loader> m_loader {};
133
+ TaskHandle<RoundImageGenerator> m_roundImageGenerator {};
134
+
135
+ bool m_enqueuedGeneration = false;
136
+ bool m_isComponentComplete = true;
137
+};
138
+
139
+#endif
140
+
141
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/native/searchlineedit.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/native/searchlineedit.cpp
Changed
10
1
2
.adjusted( 3, 0, clearButton->width() + 1, 0 );
3
QPainter painter( this );
4
painter.setPen( palette().color( QPalette::Disabled, QPalette::Text ) );
5
- painter.drawText( rect, Qt::AlignLeft | Qt::AlignVCenter, qtr( I_PL_SEARCH ) );
6
+ painter.drawText( rect, Qt::AlignLeft | Qt::AlignVCenter, qfut( I_PL_SEARCH ) );
7
}
8
9
void SearchLineEdit::searchEditingFinished()
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/GridItem.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/GridItem.qml
Changed
201
1
2
property alias image: picture.source
3
property alias title: titleLabel.text
4
property alias subtitle: subtitleTxt.text
5
- property alias textHorizontalAlignment: subtitleTxt.horizontalAlignment
6
- property alias playCoverBorder: picture.playCoverBorder
7
+ property alias playCoverBorderWidth: picture.playCoverBorderWidth
8
property alias playCoverOnlyBorders: picture.playCoverOnlyBorders
9
property alias playIconSize: picture.playIconSize
10
property alias pictureRadius: picture.radius
11
property alias pictureOverlay: picture.imageOverlay
12
- property bool selected: false
13
+ property alias unselectedUnderlay: unselectedUnderlayLoader.sourceComponent
14
+ property alias selectedUnderlay: selectedUnderlayLoader.sourceComponent
15
16
- property alias progress: picture.progress
17
- property alias labels: picture.labels
18
- property bool showNewIndicator: false
19
property real pictureWidth: VLCStyle.colWidth(1)
20
property real pictureHeight: pictureWidth
21
property int titleMargin: VLCStyle.margin_xsmall
22
property Item dragItem
23
24
+ // if true, texts are horizontally centered, provided it can fit in pictureWidth
25
+ property bool textAlignHCenter: false
26
+
27
+ // if the item is selected
28
+ property bool selected: false
29
+
30
signal playClicked
31
signal addToPlaylistClicked
32
signal itemClicked(Item menuParent, int key, int modifier)
33
34
implicitWidth: mouseArea.implicitWidth
35
implicitHeight: mouseArea.implicitHeight
36
37
- readonly property bool _highlighted: mouseArea.containsMouse || content.activeFocus
38
+ readonly property bool highlighted: mouseArea.containsMouse || root.activeFocus
39
40
readonly property int selectedBorderWidth: VLCStyle.gridItemSelectedBorder
41
42
- property int _newIndicatorMedian: VLCStyle.margin_xsmall
43
property int _modifiersOnLastPress: Qt.NoModifier
44
45
- state: _highlighted ? "selected" : "unselected"
46
+ state: highlighted ? "selected" : "unselected"
47
states: [
48
State {
49
name: "unselected"
50
51
PropertyChanges {
52
- target: selectedShadow
53
+ target: selectedUnderlayLoader
54
opacity: 0
55
visible: false
56
}
57
58
PropertyChanges {
59
- target: unselectedShadow
60
+ target: unselectedUnderlayLoader
61
opacity: 1
62
visible: true
63
}
64
65
playCoverOpacity: 0
66
playCoverVisible: false
67
}
68
-
69
- PropertyChanges {
70
- target: root
71
- _newIndicatorMedian: VLCStyle.margin_xsmall
72
- }
73
},
74
State {
75
name: "selected"
76
77
PropertyChanges {
78
- target: selectedShadow
79
+ target: selectedUnderlayLoader
80
opacity: 1
81
visible: true
82
}
83
84
PropertyChanges {
85
- target: unselectedShadow
86
+ target: unselectedUnderlayLoader
87
opacity: 0
88
visible: false
89
}
90
91
playCoverOpacity: 1
92
playCoverVisible: true
93
}
94
-
95
- PropertyChanges {
96
- target: root
97
- _newIndicatorMedian: VLCStyle.margin_small
98
- }
99
}
100
]
101
102
103
104
SequentialAnimation {
105
PropertyAction {
106
- targets: [picture, selectedShadow]
107
+ targets: [picture, selectedUnderlayLoader]
108
properties: "playCoverVisible,visible"
109
}
110
111
- ParallelAnimation {
112
- NumberAnimation {
113
- properties: "opacity,playCoverOpacity"
114
- duration: 240
115
- easing.type: Easing.InSine
116
- }
117
-
118
- SmoothedAnimation {
119
- target: root
120
- property: "_newIndicatorMedian"
121
- duration: 240
122
- easing.type: Easing.InSine
123
- }
124
+ NumberAnimation {
125
+ properties: "opacity,playCoverOpacity"
126
+ duration: 240
127
+ easing.type: Easing.InSine
128
}
129
130
PropertyAction {
131
- target: unselectedShadow
132
+ target: unselectedUnderlayLoader
133
property: "visible"
134
}
135
}
136
137
138
SequentialAnimation {
139
PropertyAction {
140
- target: unselectedShadow
141
+ target: unselectedUnderlayLoader
142
property: "visible"
143
}
144
145
- ParallelAnimation {
146
- NumberAnimation {
147
- properties: "opacity,playCoverOpacity"
148
- duration: 200
149
- easing.type: Easing.OutSine
150
- }
151
-
152
- SmoothedAnimation {
153
- target: root
154
- duration: 200
155
- property: "_newIndicatorMedian"
156
- easing.type: Easing.OutSine
157
- }
158
+ NumberAnimation {
159
+ properties: "opacity,playCoverOpacity"
160
+ duration: 200
161
+ easing.type: Easing.OutSine
162
}
163
164
PropertyAction {
165
- targets: [picture, selectedShadow]
166
+ targets: [picture, selectedUnderlayLoader]
167
properties: "playCoverVisible,visible"
168
}
169
}
170
171
172
MouseArea {
173
id: mouseArea
174
- hoverEnabled: true
175
176
+ hoverEnabled: true
177
anchors.fill: parent
178
- implicitWidth: content.implicitWidth
179
- implicitHeight: content.implicitHeight
180
+ implicitWidth: layout.implicitWidth
181
+ implicitHeight: layout.implicitHeight
182
drag.target: root.dragItem
183
drag.axis: Drag.XAndYAxis
184
drag.onActiveChanged: {
185
186
}
187
}
188
189
- FocusScope {
190
- id: content
191
-
192
- anchors.fill: parent
193
- implicitWidth: layout.implicitWidth
194
- implicitHeight: layout.implicitHeight
195
- focus: true
196
-
197
- /* background visible when selected */
198
- Rectangle {
199
- id: selectionRect
200
+ /* background visible when selected */
201
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/GridShadows.qml
Added
72
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+import QtQuick 2.11
20
+
21
+import "qrc:///style/"
22
+
23
+Item {
24
+ id: root
25
+
26
+ property alias leftPadding: unselectedShadow.leftPadding
27
+ property alias topPadding: unselectedShadow.topPadding
28
+ property alias coverMargins: unselectedShadow.coverMargins
29
+ property alias coverWidth: unselectedShadow.coverWidth
30
+ property alias coverHeight: unselectedShadow.coverHeight
31
+ property alias coverRadius: unselectedShadow.coverRadius
32
+
33
+ property alias unselected: unselectedShadow.imageComponent
34
+ property alias selected: selectedShadow.imageComponent
35
+
36
+ ShadowCoverGenerator {
37
+ id: unselectedShadow
38
+
39
+ leftPadding: 0
40
+ topPadding: 0
41
+ coverMargins: 1
42
+ coverWidth: VLCStyle.colWidth(1)
43
+ coverHeight: VLCStyle.colWidth(1)
44
+ coverRadius: VLCStyle.gridCover_radius
45
+
46
+ secondaryVerticalOffset: VLCStyle.dp(1, VLCStyle.scale)
47
+ secondaryRadius: VLCStyle.dp(2, VLCStyle.scale)
48
+ secondarySamples: 1 + VLCStyle.dp(2, VLCStyle.scale) * 2
49
+ primaryVerticalOffset: VLCStyle.dp(4, VLCStyle.scale)
50
+ primaryRadius: VLCStyle.dp(9, VLCStyle.scale)
51
+ primarySamples: 1 + VLCStyle.dp(9, VLCStyle.scale) * 2
52
+ }
53
+
54
+ ShadowCoverGenerator {
55
+ id: selectedShadow
56
+
57
+ leftPadding: root.leftPadding
58
+ topPadding: root.topPadding
59
+ coverMargins: root.coverMargins
60
+ coverWidth: root.coverWidth
61
+ coverHeight: root.coverHeight
62
+ coverRadius: root.coverRadius
63
+
64
+ secondaryVerticalOffset: VLCStyle.dp(6, VLCStyle.scale)
65
+ secondaryRadius: VLCStyle.dp(18, VLCStyle.scale)
66
+ secondarySamples: 1 + VLCStyle.dp(18, VLCStyle.scale) * 2
67
+ primaryVerticalOffset: VLCStyle.dp(32, VLCStyle.scale)
68
+ primaryRadius: VLCStyle.dp(72, VLCStyle.scale)
69
+ primarySamples: 1 + VLCStyle.dp(72, VLCStyle.scale) * 2
70
+ }
71
+}
72
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/HorizontalResizeHandle.qml
Changed
18
1
2
// HorizontalResizeHandle actually doesn't resizes target
3
// you have to assign target's width manually using widthFactor property
4
// the idea behind using widthFactor is to maintain scale ratio when source itself resizes
5
-// e.g target.width: resizeHandle.clamp(sourceWidth / resizeHandle.widthFactor, minimumWidth, maximumWidth)
6
+// e.g target.width: Helpers.clamp(sourceWidth / resizeHandle.widthFactor, minimumWidth, maximumWidth)
7
MouseArea {
8
id: root
9
10
11
root.widthFactor = root.sourceWidth / (root.targetWidth + (delta * - f))
12
}
13
14
- function clamp(num, min, max) {
15
- return num <= min ? min : num >= max ? max : num;
16
- }
17
}
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/IconToolButton.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/IconToolButton.qml
Changed
11
1
2
3
enabled: !paintOnly
4
5
+ ToolTip.text: control.text
6
+ ToolTip.delay: 500
7
+
8
onActiveFocusChanged: {
9
if (!enabled) {
10
var keyNavigationLeft = control.KeyNavigation.left
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/KeyNavigableListView.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/KeyNavigableListView.qml
Changed
19
1
2
currentIndex = newIndex
3
selectionUpdated(0, oldIndex, newIndex)
4
} else {
5
- root.navigationDown(currentIndex)
6
+ listview_id.navigationDown(currentIndex)
7
}
8
}
9
onActionUp: {
10
11
currentIndex = newIndex
12
selectionUpdated(0, oldIndex, newIndex)
13
} else {
14
- root.navigationUp(currentIndex)
15
+ listview_id.navigationUp(currentIndex)
16
}
17
}
18
}
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
Changed
84
1
2
signal actionForSelection( var selection )
3
signal contextMenuButtonClicked(Item menuParent, var menuModel)
4
signal rightClick(Item menuParent, var menuModel, var globalMousePos)
5
- signal itemDoubleClicked(var model)
6
+ signal itemDoubleClicked(var index, var model)
7
8
property var sortModel: []
9
property Component colDelegate: Widgets.ListLabel {
10
11
property var selectionDelegateModel
12
property real rowHeight: VLCStyle.tableRow_height
13
readonly property int _contextButtonHorizontalSpace: VLCStyle.icon_normal + VLCStyle.margin_xxsmall * 2
14
- readonly property real availableRowWidth: width
15
- - ( !!section.property ? VLCStyle.table_section_width * 2 : 0 )
16
- - _contextButtonHorizontalSpace
17
property alias spacing: view.spacing
18
property int horizontalSpacing: VLCStyle.column_margin_width
19
20
+ property real availableRowWidth: 0
21
+ property real _availabeRowWidthLastUpdateTime: Date.now()
22
+
23
property alias fadeColor: view.fadeColor
24
property alias fadeRectBottomHovered: view.fadeRectBottomHovered
25
property alias fadeRectTopHovered: view.fadeRectTopHovered
26
27
view.positionViewAtIndex(index, mode)
28
}
29
30
+ Timer {
31
+ id: availableRowWidthUpdater
32
+
33
+ interval: 100
34
+ triggeredOnStart: false
35
+ repeat: false
36
+ onTriggered: {
37
+ _update()
38
+ }
39
+
40
+ function _update() {
41
+ root.availableRowWidth = root.width
42
+ - ( !!section.property ? VLCStyle.table_section_width * 2 : 0 )
43
+ - _contextButtonHorizontalSpace
44
+ root._availabeRowWidthLastUpdateTime = Date.now()
45
+ }
46
+
47
+ function enqueueUpdate() {
48
+ // updating availableRowWidth is expensive because of property bindings in sortModel
49
+ // and availableRowWidth is dependent on root.width which can update in a burst
50
+ // so try to maintain a minimum time gap between subsequent availableRowWidth updates
51
+ var sinceLastUpdate = Date.now() - root._availabeRowWidthLastUpdateTime
52
+ if ((root.availableRowWidth === 0) || (sinceLastUpdate > 128 && !availableRowWidthUpdater.running)) {
53
+ _update()
54
+ } else if (!availableRowWidthUpdater.running) {
55
+ availableRowWidthUpdater.interval = Math.max(128 - sinceLastUpdate, 32)
56
+ availableRowWidthUpdater.start()
57
+ }
58
+ }
59
+ }
60
+
61
+ onWidthChanged: {
62
+ availableRowWidthUpdater.enqueueUpdate()
63
+ }
64
+
65
+ onSectionChanged: {
66
+ availableRowWidthUpdater.enqueueUpdate()
67
+ }
68
+
69
KeyNavigableListView {
70
id: view
71
72
73
leftPadding: VLCStyle.table_section_text_margin
74
text: view.currentSection
75
color: VLCStyle.colors.accent
76
- visible: text !== "" && view.contentY > (row.height - col.height - row.topPadding)
77
verticalAlignment: Text.AlignTop
78
+ visible: view.headerPositioning === ListView.OverlayHeader
79
+ && text !== ""
80
+ && view.contentY > (row.height - col.height - row.topPadding)
81
}
82
83
Column {
84
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/MediaCover.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/MediaCover.qml
Changed
103
1
2
*****************************************************************************/
3
import QtQuick 2.11
4
import QtQuick.Controls 2.4
5
-import QtQuick.Layouts 1.11
6
7
import "qrc:///widgets/" as Widgets
8
import "qrc:///style/"
9
10
-Widgets.RoundImage {
11
+import org.videolan.controls 0.1
12
+
13
+RoundImage {
14
id: root
15
16
- property var labels: []
17
- property alias progress: progressBar.value
18
- property alias playCoverOpacity: playCover.opacity
19
- property alias playCoverVisible: playCover.visible
20
- property alias playCoverOnlyBorders: playCover.onlyBorders
21
- property alias playIconSize: playCover.iconSize
22
- property alias playCoverBorder: playCover.border
23
+ property alias playCoverOpacity: playCoverLoader.opacity
24
+ property alias playCoverVisible: playCoverLoader.visible
25
+ property bool playCoverOnlyBorders: false
26
+ property real playIconSize: VLCStyle.play_cover_normal
27
+ property real playCoverBorderWidth: VLCStyle.table_cover_border
28
property alias imageOverlay: overlay.sourceComponent
29
signal playIconClicked
30
31
height: VLCStyle.listAlbumCover_height
32
width: VLCStyle.listAlbumCover_width
33
+ sourceSize: Qt.size(width, height)
34
35
Loader {
36
id: overlay
37
38
anchors.fill: parent
39
}
40
41
- RowLayout {
42
- anchors {
43
- top: parent.top
44
- left: parent.left
45
- right: parent.right
46
- topMargin: VLCStyle.margin_xxsmall
47
- leftMargin: VLCStyle.margin_xxsmall
48
- rightMargin: VLCStyle.margin_xxsmall
49
- }
50
-
51
- spacing: VLCStyle.margin_xxsmall
52
-
53
- Repeater {
54
- model: labels
55
- VideoQualityLabel {
56
- Layout.preferredWidth: implicitWidth
57
- Layout.preferredHeight: implicitHeight
58
- text: modelData
59
- }
60
- }
61
+ Loader {
62
+ id: playCoverLoader
63
64
- Item {
65
- Layout.fillWidth: true
66
+ anchors.fill: parent
67
+ visible: false
68
+ active: false
69
+ sourceComponent: Widgets.PlayCover {
70
+ onlyBorders: root.playCoverOnlyBorders
71
+ iconSize: root.playIconSize
72
+ border.width: root.playCoverBorderWidth
73
+ radius: root.radius
74
+
75
+ onIconClicked: root.playIconClicked()
76
}
77
- }
78
-
79
- Widgets.VideoProgressBar {
80
- id: progressBar
81
82
- visible: !playCover.visible && value > 0
83
- anchors {
84
- bottom: parent.bottom
85
- left: parent.left
86
- right: parent.right
87
+ onVisibleChanged: {
88
+ if (visible && !active)
89
+ active = true
90
}
91
}
92
-
93
- Widgets.PlayCover {
94
- id: playCover
95
-
96
- anchors.fill: parent
97
- iconSize: VLCStyle.play_root_small
98
- radius: root.radius
99
-
100
- onIconClicked: root.playIconClicked()
101
- }
102
}
103
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/OverlayMenu.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/OverlayMenu.qml
Changed
34
1
2
color: colors.text
3
}
4
5
- ListLabel {
6
- visible: modelData.marking.length >= 1
7
-
8
- Layout.alignment: Qt.AlignHCenter
9
+ Loader {
10
+ active: (button.yieldsAnotherModel ||
11
+ ( (!!modelData.marking) && (modelData.marking.length >= 1) ))
12
+
13
+ sourceComponent: ListLabel {
14
+ Layout.alignment: Qt.AlignHCenter
15
+
16
+ text: {
17
+ if (button.yieldsAnotherModel)
18
+ "⮕"
19
+ else if (!!modelData.marking)
20
+ modelData.marking
21
+ }
22
23
- text: {
24
- if (button.yieldsAnotherModel)
25
- "⮕"
26
- else if (!!modelData.marking)
27
- modelData.marking
28
+ color: colors.text
29
}
30
- color: colors.text
31
}
32
}
33
34
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/ScrollingText.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/ScrollingText.qml
Changed
24
1
2
target: label
3
property: "x"
4
from: 0
5
- to: (label.horizontalAlignment == Text.AlignHCenter) ? (label.width - label.contentWidth) / 2 : label.width - label.contentWidth
6
-
7
- maximumEasingTime: 0
8
- velocity: 20
9
- }
10
-
11
- PauseAnimation {
12
- duration: 1000
13
- }
14
-
15
- SmoothedAnimation {
16
- target: label
17
- property: "x"
18
- to: (label.horizontalAlignment == Text.AlignHCenter) ? (label.contentWidth - label.width) / 2 : label.width - label.contentWidth
19
- duration: (label.horizontalAlignment == Text.AlignHCenter) ? -1 : 1
20
+ to: label.width - label.contentWidth
21
22
maximumEasingTime: 0
23
velocity: 20
24
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/SearchBox.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/SearchBox.qml
Changed
12
1
2
3
font.pixelSize: VLCStyle.fontSize_normal
4
5
- color: VLCStyle.colors.buttonText
6
+ palette.text: VLCStyle.colors.buttonText
7
+ palette.highlight: VLCStyle.colors.bgHover
8
+ palette.highlightedText: VLCStyle.colors.bgHoverText
9
10
selectByMouse: true
11
12
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/ShadowCoverGenerator.qml
Added
105
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+import QtQuick 2.11
21
+import QtGraphicalEffects 1.0
22
+
23
+import "qrc:///style/"
24
+
25
+Item {
26
+ id: root
27
+
28
+ property real leftPadding: 0
29
+ property real topPadding: 0
30
+ property real coverMargins: 0
31
+ property real coverWidth: 0
32
+ property real coverHeight: 0
33
+ property real coverRadius: 0
34
+ property color coverColor: VLCStyle.colors.bg
35
+
36
+ property alias primaryVerticalOffset: primaryShadow.verticalOffset
37
+ property alias primaryRadius: primaryShadow.radius
38
+ property alias primarySamples: primaryShadow.samples
39
+ property alias secondaryVerticalOffset: secondaryShadow.verticalOffset
40
+ property alias secondaryRadius: secondaryShadow.radius
41
+ property alias secondarySamples: secondaryShadow.samples
42
+
43
+ readonly property real _kernalRadius: Math.max(0, Math.ceil(root.primarySamples / 2))
44
+ property real _reference: 0
45
+
46
+ property Component imageComponent: ShaderEffectSource {
47
+ sourceItem: container
48
+ live: true
49
+ x: - root._kernalRadius + root.leftPadding
50
+ y: - root._kernalRadius + root.primaryVerticalOffset + root.topPadding
51
+ width: container.width
52
+ height: container.height
53
+ hideSource: true
54
+
55
+ Component.onCompleted: ++root._reference;
56
+ Component.onDestruction: --root._reference;
57
+ }
58
+
59
+ Item {
60
+ id: container
61
+
62
+ // if imageComponent is used with invisible container, generated shadows are too dark
63
+ // another possible fix is to set DropShadow::cached = false, but that has performance penalty
64
+ visible: root._reference > 0
65
+
66
+ width: baseRect.width + 2 * root._kernalRadius
67
+ height: baseRect.height + 2 * root._kernalRadius
68
+
69
+ Rectangle {
70
+ id: baseRect
71
+
72
+ x: root._kernalRadius + root.coverMargins
73
+ y: root._kernalRadius - root.primaryVerticalOffset + root.coverMargins
74
+ width: root.coverWidth - root.coverMargins * 2
75
+ height: root.coverHeight - root.coverMargins * 2
76
+ radius: root.coverRadius
77
+ color: root.coverColor
78
+ }
79
+
80
+ DropShadow {
81
+ id: primaryShadow
82
+
83
+ anchors.fill: baseRect
84
+ source: baseRect
85
+ horizontalOffset: 0
86
+ spread: 0
87
+ color: Qt.rgba(0, 0, 0, .22)
88
+ samples: 1 + radius * 2
89
+ cached: true
90
+ }
91
+
92
+ DropShadow {
93
+ id: secondaryShadow
94
+
95
+ anchors.fill: baseRect
96
+ source: baseRect
97
+ horizontalOffset: 0
98
+ spread: 0
99
+ color: Qt.rgba(0, 0, 0, .18)
100
+ samples: 1 + radius * 2
101
+ cached: true
102
+ }
103
+ }
104
+}
105
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/TabButtonExt.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/TabButtonExt.qml
Changed
19
1
2
property string iconTxt: ""
3
property int iconSize: VLCStyle.icon_normal
4
property bool selected: false
5
- property color color: focusBackground.foregroundColor
6
+ property alias color: focusBackground.defaultForeground
7
property bool busy: false
8
9
font.pixelSize: VLCStyle.fontSize_normal
10
11
12
Widgets.ListLabel {
13
text: control.text
14
- color: control.color
15
+ color: focusBackground.foregroundColor
16
}
17
}
18
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/TableColumns.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/TableColumns.qml
Changed
48
1
2
import QtQuick.Layouts 1.4
3
4
import "qrc:///widgets/" as Widgets
5
+import "qrc:///util/Helpers.js" as Helpers
6
import "qrc:///style/"
7
8
Item {
9
10
11
anchors.fill: parent
12
source: (rowModel ? (root.showTitleText ? rowModel.cover : rowModel[model.criteria]) : VLCStyle.noArtCover) || VLCStyle.noArtCover
13
- mipmap: true // this widget can down scale the source a lot, so for better visuals we use mipmap
14
playCoverVisible: currentlyFocused || containsMouse
15
playIconSize: VLCStyle.play_cover_small
16
onPlayIconClicked: medialib.addAndPlay( rowModel.id )
17
radius: root.titleCover_radius
18
- labels: root.titlecoverLabels(rowModel)
19
+
20
+ imageOverlay: Item {
21
+ width: cover.width
22
+ height: cover.height
23
+
24
+ Widgets.VideoQualityLabels {
25
+ anchors {
26
+ top: parent.top
27
+ right: parent.right
28
+ topMargin: VLCStyle.margin_xxsmall
29
+ leftMargin: VLCStyle.margin_xxsmall
30
+ rightMargin: VLCStyle.margin_xxsmall
31
+ }
32
+
33
+ labels: root.titlecoverLabels(rowModel)
34
+ }
35
+ }
36
}
37
}
38
39
40
width: timeTextMetric.width
41
height: parent.height
42
horizontalAlignment: Text.AlignHCenter
43
- text: !rowModel ? "" : rowModel[model.criteria] || ""
44
+ text: !rowModel || !rowModel[model.criteria] ? "" : Helpers.msToString(rowModel[model.criteria], true)
45
color: foregroundColor
46
}
47
}
48
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/qt/widgets/qml/TableViewDelegate.qml -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/TableViewDelegate.qml
Changed
31
1
2
3
selectionDelegateModel.updateSelection(mouse.modifiers, view.currentIndex, index);
4
5
- view.currentIndex = rowModel.index;
6
+ view.currentIndex = index;
7
8
delegate.forceActiveFocus();
9
}
10
11
}
12
13
onDoubleClicked: {
14
- actionForSelection(selectionDelegateModel.selectedIndexes);
15
-
16
- root.itemDoubleClicked(root.model);
17
+ if (mouse.button === Qt.LeftButton)
18
+ root.itemDoubleClicked(delegate._index, rowModel)
19
}
20
21
drag.onActiveChanged: {
22
23
24
visible: hoverArea.containsMouse
25
26
- onClicked: root.contextMenuButtonClicked(this, delegate.rowModel)
27
+ onClicked: root.contextMenuButtonClicked(this, delegate.rowModel)
28
}
29
}
30
}
31
vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/qt/widgets/qml/VideoQualityLabels.qml
Added
53
1
2
+/*****************************************************************************
3
+ * Copyright (C) 2021 VLC authors and VideoLAN
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * ( at your option ) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+import QtQuick 2.11
20
+import QtQuick.Controls 2.4
21
+
22
+import "qrc:///style/"
23
+
24
+Row {
25
+ property alias labels: repeater.model
26
+
27
+ spacing: VLCStyle.margin_xxsmall
28
+
29
+ Repeater {
30
+ id: repeater
31
+
32
+ delegate: Label {
33
+ id: label
34
+
35
+ text: modelData
36
+ color: "white"
37
+ bottomPadding: VLCStyle.margin_xxxsmall
38
+ topPadding: VLCStyle.margin_xxxsmall
39
+ leftPadding: VLCStyle.margin_xxxsmall
40
+ rightPadding: VLCStyle.margin_xxxsmall
41
+ font.pixelSize: VLCStyle.fontSize_normal
42
+ background: Rectangle {
43
+ anchors.fill: label
44
+ color: "black"
45
+ opacity: 0.5
46
+ radius: 3
47
+ }
48
+
49
+ Accessible.ignored: true
50
+ }
51
+ }
52
+}
53
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/skins2/src/window_manager.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/skins2/src/window_manager.cpp
Changed
201
1
2
WindowManager::WindowManager( intf_thread_t *pIntf ):
3
SkinObject( pIntf ), m_magnet( 0 ), m_alpha( 255 ), m_moveAlpha( 255 ),
4
m_opacityEnabled( false ), m_opacity( 255 ), m_direction( kNone ),
5
- m_maximizeRect(0, 0, 50, 50), m_pTooltip( NULL ), m_pPopup( NULL )
6
+ m_maximizeRect(0, 0, 50, 50), m_pPopup( NULL )
7
{
8
// Create and register a variable for the "on top" status
9
VarManager *pVarManager = VarManager::instance( getIntf() );
10
11
m_opacity = 255 * var_InheritFloat( getIntf(), "qt-opacity" );
12
}
13
14
-
15
-WindowManager::~WindowManager()
16
-{
17
- delete m_pTooltip;
18
-}
19
-
20
+WindowManager::~WindowManager() = default;
21
22
void WindowManager::registerWindow( TopWindow &rWindow )
23
{
24
25
checkAnchors( &rWindow, xOffset, yOffset );
26
27
// Move all the windows
28
- WinSet_t::const_iterator it;
29
- for( it = m_movingWindows.begin(); it != m_movingWindows.end(); ++it )
30
- {
31
- (*it)->move( (*it)->getLeft() + xOffset, (*it)->getTop() + yOffset );
32
- }
33
+ for( auto *window : m_movingWindows )
34
+ window->move( window->getLeft() + xOffset, window->getTop() + yOffset );
35
}
36
37
38
39
const AncList_t &ancList1 = rLayout.getAnchorList();
40
41
// Iterate through all the hanged windows
42
- for( itWin = m_dependencies[rLayout.getWindow()].begin();
43
- itWin != m_dependencies[rLayout.getWindow()].end(); ++itWin )
44
+ for( auto *window : m_dependencies[rLayout.getWindow()] )
45
{
46
// Now, check for anchoring between the 2 windows
47
const AncList_t &ancList2 =
48
- (*itWin)->getActiveLayout().getAnchorList();
49
- for( itAnc1 = ancList1.begin(); itAnc1 != ancList1.end(); ++itAnc1 )
50
+ window->getActiveLayout().getAnchorList();
51
+ for( auto *anc1 : ancList1 )
52
{
53
- for( itAnc2 = ancList2.begin();
54
- itAnc2 != ancList2.end(); ++itAnc2 )
55
+ for( auto *anc2 : ancList2 )
56
{
57
- if( (*itAnc1)->isHanging( **itAnc2 ) )
58
+ if( anc1->isHanging( *anc2 ) )
59
{
60
// Add the dependencies of the hanged window to one of the
61
// lists of moving windows
62
Position::Ref_t aRefPos =
63
- (*itAnc1)->getPosition().getRefLeftTop();
64
+ anc1->getPosition().getRefLeftTop();
65
if( aRefPos == Position::kRightTop )
66
- buildDependSet( m_resizeMovingE, *itWin );
67
+ buildDependSet( m_resizeMovingE, window );
68
else if( aRefPos == Position::kLeftBottom )
69
- buildDependSet( m_resizeMovingS, *itWin );
70
+ buildDependSet( m_resizeMovingS, window );
71
else if( aRefPos == Position::kRightBottom )
72
- buildDependSet( m_resizeMovingSE, *itWin );
73
+ buildDependSet( m_resizeMovingSE, window );
74
break;
75
}
76
}
77
78
rLayout.refreshAll();
79
80
// Move all the anchored windows
81
- WinSet_t::const_iterator it;
82
if( m_direction == kResizeE ||
83
m_direction == kResizeSE )
84
{
85
- for( it = m_resizeMovingE.begin(); it != m_resizeMovingE.end(); ++it )
86
+ for( auto *window : m_resizeMovingE )
87
{
88
- (*it)->move( (*it)->getLeft() + xNewOffset,
89
- (*it)->getTop() );
90
+ window->move( window->getLeft() + xNewOffset,
91
+ window->getTop() );
92
}
93
}
94
if( m_direction == kResizeS ||
95
m_direction == kResizeSE )
96
{
97
- for( it = m_resizeMovingS.begin(); it != m_resizeMovingS.end(); ++it )
98
+ for( auto *window : m_resizeMovingS )
99
{
100
- (*it)->move( (*it)->getLeft(),
101
- (*it)->getTop( )+ yNewOffset );
102
+ window->move( window->getLeft(),
103
+ window->getTop( )+ yNewOffset );
104
}
105
}
106
if( m_direction == kResizeE ||
107
m_direction == kResizeS ||
108
m_direction == kResizeSE )
109
{
110
- for( it = m_resizeMovingSE.begin(); it != m_resizeMovingSE.end(); ++it )
111
+ for( auto *window : m_resizeMovingSE )
112
{
113
- (*it)->move( (*it)->getLeft() + xNewOffset,
114
- (*it)->getTop() + yNewOffset );
115
+ window->move( window->getLeft() + xNewOffset,
116
+ window->getTop() + yNewOffset );
117
}
118
}
119
}
120
121
122
void WindowManager::synchVisibility() const
123
{
124
- WinSet_t::const_iterator it;
125
- for( it = m_allWindows.begin(); it != m_allWindows.end(); ++it )
126
+ for( auto *window : m_allWindows )
127
{
128
// Show the window if it has to be visible
129
- if( (*it)->getVisibleVar().get() )
130
+ if( window->getVisibleVar().get() )
131
{
132
- (*it)->innerShow();
133
+ window->innerShow();
134
}
135
}
136
}
137
138
139
void WindowManager::saveVisibility()
140
{
141
- WinSet_t::const_iterator it;
142
m_savedWindows.clear();
143
- for( it = m_allWindows.begin(); it != m_allWindows.end(); ++it )
144
+ for( auto *window : m_allWindows )
145
{
146
// Remember the window if it is visible
147
- if( (*it)->getVisibleVar().get() )
148
+ if( window->getVisibleVar().get() )
149
{
150
- m_savedWindows.insert( *it );
151
+ m_savedWindows.insert( window );
152
}
153
}
154
}
155
156
msg_Warn( getIntf(), "restoring visibility for no window" );
157
}
158
159
- WinSet_t::const_iterator it;
160
- for( it = m_savedWindows.begin(); it != m_savedWindows.end(); ++it )
161
+ for( auto *window : m_savedWindows )
162
{
163
- (*it)->show();
164
+ window->show();
165
}
166
}
167
168
169
void WindowManager::raiseAll() const
170
{
171
// Raise all the windows
172
- WinSet_t::const_iterator it;
173
- for( it = m_allWindows.begin(); it != m_allWindows.end(); ++it )
174
+ for( auto *window : m_allWindows )
175
{
176
- (*it)->raise();
177
+ window->raise();
178
}
179
}
180
181
182
void WindowManager::showAll( bool firstTime ) const
183
{
184
// Show all the windows
185
- WinSet_t::const_iterator it;
186
- for( it = m_allWindows.begin(); it != m_allWindows.end(); ++it )
187
+ for( auto *window : m_allWindows )
188
{
189
// When the theme is opened for the first time,
190
// only show the window if set as visible in the XML
191
- if( (*it)->getInitialVisibility() || !firstTime )
192
+ if( window->getInitialVisibility() || !firstTime )
193
{
194
- (*it)->show();
195
+ window->show();
196
}
197
}
198
}
199
200
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/gui/skins2/src/window_manager.hpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/gui/skins2/src/window_manager.hpp
Changed
18
1
2
#include <map>
3
#include <set>
4
#include <utility>
5
+#include <memory>
6
7
8
class GenericFont;
9
10
/// Rect of the last maximized window
11
SkinsRect m_maximizeRect;
12
/// Tooltip
13
- Tooltip *m_pTooltip;
14
+ std::unique_ptr<Tooltip> m_pTooltip;
15
/// Active popup, if any
16
Popup *m_pPopup;
17
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/misc/Makefile.am -> vlc-beta-20210430.0b6b242324.tar.xz/modules/misc/Makefile.am
Changed
24
1
2
misc_LTLIBRARIES += libiokit_inhibit_plugin.la
3
endif
4
5
+libuikit_inhibit_plugin_la_SOURCES = misc/inhibit/uikit-inhibit.m
6
+libuikit_inhibit_plugin_la_LDFLAGS = $(AM_LDFLAGS) -Wl,-framework,UIKit,-framework,Foundation
7
+libuikit_inhibit_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) -fobjc-arc
8
+if HAVE_IOS
9
+misc_LTLIBRARIES += libuikit_inhibit_plugin.la
10
+endif
11
+
12
+if HAVE_TVOS
13
+misc_LTLIBRARIES += libuikit_inhibit_plugin.la
14
+endif
15
+
16
libxdg_screensaver_plugin_la_SOURCES = misc/inhibit/xdg.c
17
if HAVE_XCB
18
if !HAVE_WIN32
19
20
libmedialibrary_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(miscdir)'
21
EXTRA_LTLIBRARIES += libmedialibrary_plugin.la
22
misc_LTLIBRARIES += $(LTLIBmedialibrary)
23
-
24
vlc-beta-20210430.0b6b242324.tar.xz/modules/misc/inhibit/uikit-inhibit.m
Added
69
1
2
+/*****************************************************************************
3
+ * Copyright © 2021 Videolabs
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify it
6
+ * under the terms of the GNU Lesser General Public License as published by
7
+ * the Free Software Foundation; either version 2.1 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with this program; if not, write to the Free Software Foundation,
17
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
18
+ *****************************************************************************/
19
+
20
+/**
21
+ * \file uikit-inhibit.m
22
+ * \brief iOS display and idle sleep inhibitor using UIKit
23
+ */
24
+
25
+#ifdef HAVE_CONFIG_H
26
+# include "config.h"
27
+#endif
28
+
29
+#include <vlc_common.h>
30
+#include <vlc_plugin.h>
31
+#include <vlc_inhibit.h>
32
+#include <vlc_vout_window.h>
33
+
34
+#include <UIKit/UIKit.h>
35
+
36
+static void UpdateInhibit(vlc_inhibit_t *ih, unsigned mask)
37
+{
38
+ [UIApplication sharedApplication].idleTimerDisabled =
39
+ (mask & VLC_INHIBIT_DISPLAY) == VLC_INHIBIT_DISPLAY;
40
+}
41
+
42
+static int OpenInhibit(vlc_object_t *obj)
43
+{
44
+ vlc_inhibit_t *ih = (vlc_inhibit_t *)obj;
45
+ vout_window_t *wnd = vlc_inhibit_GetWindow(ih);
46
+ if (wnd->type != VOUT_WINDOW_TYPE_NSOBJECT)
47
+ return VLC_EGENERIC;
48
+
49
+ UIView * view = (__bridge UIView*)wnd->handle.nsobject;
50
+
51
+ if (unlikely(![view respondsToSelector:@selector(isKindOfClass:)]))
52
+ return VLC_EGENERIC;
53
+
54
+ if (![view isKindOfClass:[UIView class]])
55
+ return VLC_EGENERIC;
56
+
57
+ ih->inhibit = UpdateInhibit;
58
+ return VLC_SUCCESS;
59
+}
60
+
61
+vlc_module_begin()
62
+ set_shortname("UIKit sleep inhibition")
63
+ set_description("UIKit screen sleep inhibition for iOS and tvOS")
64
+ set_category(CAT_ADVANCED)
65
+ set_subcategory(SUBCAT_ADVANCED_MISC)
66
+ set_capability("inhibit", 10)
67
+ set_callback(OpenInhibit)
68
+vlc_module_end()
69
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/misc/medialibrary/entities.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/misc/medialibrary/entities.cpp
Changed
50
1
2
#include <medialibrary/IAlbumTrack.h>
3
#include <medialibrary/IGenre.h>
4
#include <medialibrary/ILabel.h>
5
+#include <medialibrary/IMediaGroup.h>
6
#include <medialibrary/IPlaylist.h>
7
#include <medialibrary/IAudioTrack.h>
8
#include <medialibrary/IVideoTrack.h>
9
10
return strdup_helper( input->name(), output.psz_name );
11
}
12
13
+bool Convert( const medialibrary::IMediaGroup* input, vlc_ml_group_t& output )
14
+{
15
+ output.i_id = input->id();
16
+
17
+ output.i_nb_total_media = input->nbTotalMedia();
18
+
19
+ output.i_duration = input->duration();
20
+
21
+ output.i_creation_date = input->creationDate();
22
+
23
+ if( strdup_helper( input->name(), output.psz_name ) == false )
24
+ return false;
25
+
26
+ return true;
27
+}
28
+
29
bool Convert( const medialibrary::IPlaylist* input, vlc_ml_playlist_t& output )
30
{
31
output.i_id = input->id();
32
33
+ output.i_creation_date = input->creationDate();
34
+
35
+ output.b_is_read_only = input->isReadOnly();
36
+
37
if( !strdup_helper( input->name(), output.psz_name ) ||
38
!strdup_helper( input->artworkMrl(), output.psz_artwork_mrl ) )
39
return false;
40
+
41
+ // NOTE: mrl() must only be called when isReadOnly() is true.
42
+ if( output.b_is_read_only && !strdup_helper( input->mrl(), output.psz_mrl ) )
43
+ return false;
44
+ else
45
+ output.psz_mrl = nullptr;
46
+
47
return true;
48
}
49
50
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/misc/medialibrary/medialibrary.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/misc/medialibrary/medialibrary.cpp
Changed
189
1
2
#include <medialibrary/IGenre.h>
3
#include <medialibrary/IMetadata.h>
4
#include <medialibrary/IShow.h>
5
+#include <medialibrary/IMediaGroup.h>
6
#include <medialibrary/IPlaylist.h>
7
#include <medialibrary/IBookmark.h>
8
9
10
void assignToEvent( vlc_ml_event_t* ev, vlc_ml_artist_t* a ) { ev->creation.p_artist = a; }
11
void assignToEvent( vlc_ml_event_t* ev, vlc_ml_album_t* a ) { ev->creation.p_album = a; }
12
void assignToEvent( vlc_ml_event_t* ev, vlc_ml_genre_t* g ) { ev->creation.p_genre = g; }
13
+void assignToEvent( vlc_ml_event_t* ev, vlc_ml_group_t* g ) { ev->creation.p_group = g; }
14
void assignToEvent( vlc_ml_event_t* ev, vlc_ml_playlist_t* p ) { ev->creation.p_playlist = p; }
15
void assignToEvent( vlc_ml_event_t* ev, vlc_ml_bookmark_t* b ) { ev->creation.p_bookmark = b; }
16
17
18
wrapEntityDeletedEventCallback( m_vlc_ml, albumIds, VLC_ML_EVENT_ALBUM_DELETED );
19
}
20
21
+//-------------------------------------------------------------------------------------------------
22
+// Groups
23
+
24
+void MediaLibrary::onMediaGroupsAdded( std::vector<medialibrary::MediaGroupPtr> groups )
25
+{
26
+ wrapEntityCreatedEventCallback<vlc_ml_group_t>( m_vlc_ml, groups, VLC_ML_EVENT_GROUP_ADDED );
27
+}
28
+
29
+void MediaLibrary::onMediaGroupsModified( std::set<int64_t> groupIds )
30
+{
31
+ wrapEntityModifiedEventCallback( m_vlc_ml, groupIds, VLC_ML_EVENT_GROUP_UPDATED );
32
+}
33
+
34
+void MediaLibrary::onMediaGroupsDeleted( std::set<int64_t> groupIds )
35
+{
36
+ wrapEntityDeletedEventCallback( m_vlc_ml, groupIds, VLC_ML_EVENT_GROUP_DELETED );
37
+}
38
+
39
+//-------------------------------------------------------------------------------------------------
40
+
41
void MediaLibrary::onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> playlists )
42
{
43
wrapEntityCreatedEventCallback<vlc_ml_playlist_t>( m_vlc_ml, playlists, VLC_ML_EVENT_PLAYLIST_ADDED );
44
45
wrapEntityDeletedEventCallback( m_vlc_ml, genreIds, VLC_ML_EVENT_GENRE_DELETED );
46
}
47
48
-void MediaLibrary::onMediaGroupsAdded( std::vector<medialibrary::MediaGroupPtr> )
49
-{
50
-}
51
-
52
-void MediaLibrary::onMediaGroupsModified( std::set<int64_t> )
53
-{
54
-}
55
-
56
-void MediaLibrary::onMediaGroupsDeleted( std::set<int64_t> )
57
-{
58
-}
59
-
60
void MediaLibrary::onBookmarksAdded( std::vector<medialibrary::BookmarkPtr> bookmarks )
61
{
62
wrapEntityCreatedEventCallback<vlc_ml_bookmark_t>( m_vlc_ml, bookmarks,
63
64
vlc_assert_unreachable();
65
}
66
}
67
+ case VLC_ML_LIST_GROUPS:
68
+ case VLC_ML_COUNT_GROUPS:
69
+ case VLC_ML_LIST_GROUP_MEDIA:
70
+ case VLC_ML_COUNT_GROUP_MEDIA:
71
+ return listGroup( listQuery, paramsPtr, psz_pattern, nbItems, offset, args );
72
case VLC_ML_LIST_PLAYLIST_MEDIA:
73
case VLC_ML_COUNT_PLAYLIST_MEDIA:
74
case VLC_ML_LIST_PLAYLISTS:
75
76
auto show = m_ml->show( id );
77
return CreateAndConvert<vlc_ml_show_t>( show.get() );
78
}
79
+ case VLC_ML_GET_GROUP:
80
+ {
81
+ auto id = va_arg( args, int64_t );
82
+ auto group = m_ml->mediaGroup( id );
83
+ return CreateAndConvert<vlc_ml_group_t>( group.get() );
84
+ }
85
case VLC_ML_GET_PLAYLIST:
86
{
87
auto id = va_arg( args, int64_t );
88
89
return VLC_ML_LIST_SHOW_EPISODES;
90
case VLC_ML_PARENT_GENRE:
91
return VLC_ML_LIST_GENRE_TRACKS;
92
+ case VLC_ML_PARENT_GROUP:
93
+ return VLC_ML_LIST_GROUP_MEDIA;
94
case VLC_ML_PARENT_PLAYLIST:
95
return VLC_ML_LIST_PLAYLIST_MEDIA;
96
default:
97
98
return VLC_ML_COUNT_SHOW_EPISODES;
99
case VLC_ML_PARENT_GENRE:
100
return VLC_ML_COUNT_GENRE_TRACKS;
101
+ case VLC_ML_PARENT_GROUP:
102
+ return VLC_ML_COUNT_GROUP_MEDIA;
103
case VLC_ML_PARENT_PLAYLIST:
104
return VLC_ML_COUNT_PLAYLIST_MEDIA;
105
default:
106
107
}
108
}
109
110
+int MediaLibrary::listGroup( int listQuery, const medialibrary::QueryParameters* paramsPtr,
111
+ const char* pattern, uint32_t nbItems, uint32_t offset, va_list args )
112
+{
113
+ switch( listQuery )
114
+ {
115
+ case VLC_ML_LIST_GROUPS:
116
+ case VLC_ML_COUNT_GROUPS:
117
+ {
118
+ medialibrary::Query<medialibrary::IMediaGroup> query;
119
+
120
+ if ( pattern )
121
+ query = m_ml->searchMediaGroups( pattern, paramsPtr );
122
+ else
123
+ query = m_ml->mediaGroups( medialibrary::IMedia::Type::Unknown, paramsPtr );
124
+
125
+ if ( query == nullptr )
126
+ return VLC_EGENERIC;
127
+
128
+ switch ( listQuery )
129
+ {
130
+ case VLC_ML_LIST_GROUPS:
131
+ *va_arg( args, vlc_ml_group_list_t** ) =
132
+ ml_convert_list<vlc_ml_group_list_t, vlc_ml_group_t>(
133
+ query->items( nbItems, offset ) );
134
+ return VLC_SUCCESS;
135
+
136
+ case VLC_ML_COUNT_GROUPS:
137
+ *va_arg( args, size_t* ) = query->count();
138
+ return VLC_SUCCESS;
139
+
140
+ default:
141
+ vlc_assert_unreachable();
142
+ }
143
+ }
144
+
145
+ case VLC_ML_LIST_GROUP_MEDIA:
146
+ case VLC_ML_COUNT_GROUP_MEDIA:
147
+ {
148
+ auto group = m_ml->mediaGroup( va_arg( args, int64_t ) );
149
+
150
+ if ( group == nullptr )
151
+ return VLC_EGENERIC;
152
+
153
+ medialibrary::Query<medialibrary::IMedia> query;
154
+
155
+ if ( pattern )
156
+ query = group->searchMedia( pattern, medialibrary::IMedia::Type::Unknown,
157
+ paramsPtr );
158
+ else
159
+ query = group->media( medialibrary::IMedia::Type::Unknown, paramsPtr );
160
+
161
+ if ( query == nullptr )
162
+ return VLC_EGENERIC;
163
+
164
+ switch ( listQuery )
165
+ {
166
+ case VLC_ML_LIST_GROUP_MEDIA:
167
+ *va_arg( args, vlc_ml_media_list_t**) =
168
+ ml_convert_list<vlc_ml_media_list_t, vlc_ml_media_t>(
169
+ query->items( nbItems, offset ) );
170
+ return VLC_SUCCESS;
171
+
172
+ case VLC_ML_COUNT_GROUP_MEDIA:
173
+ *va_arg( args, size_t* ) = query->count();
174
+ return VLC_SUCCESS;
175
+
176
+ default:
177
+ vlc_assert_unreachable();
178
+ }
179
+ }
180
+
181
+ default:
182
+ vlc_assert_unreachable();
183
+ }
184
+}
185
+
186
int MediaLibrary::listPlaylist( int listQuery, const medialibrary::QueryParameters* paramsPtr,
187
const char* pattern, uint32_t nbItems, uint32_t offset, va_list args )
188
{
189
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/misc/medialibrary/medialibrary.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/misc/medialibrary/medialibrary.h
Changed
18
1
2
const char* pattern, uint32_t nbItems, uint32_t offset, va_list args );
3
int listGenre( int listQuery, const medialibrary::QueryParameters* paramsPtr,
4
const char* pattern, uint32_t nbItems, uint32_t offset, va_list args );
5
+ int listGroup( int listQuery, const medialibrary::QueryParameters* paramsPtr,
6
+ const char* pattern, uint32_t nbItems, uint32_t offset, va_list args );
7
int listPlaylist( int listQuery, const medialibrary::QueryParameters* paramsPtr,
8
const char* pattern, uint32_t nbItems, uint32_t offset, va_list args );
9
int listMedia( int listQuery, const medialibrary::QueryParameters* paramsPtr,
10
11
bool Convert( const medialibrary::IGenre* input, vlc_ml_genre_t& output );
12
bool Convert( const medialibrary::IShow* input, vlc_ml_show_t& output );
13
bool Convert( const medialibrary::ILabel* input, vlc_ml_label_t& output );
14
+bool Convert( const medialibrary::IMediaGroup* input, vlc_ml_group_t& output );
15
bool Convert( const medialibrary::IPlaylist* input, vlc_ml_playlist_t& output );
16
bool Convert( const medialibrary::IFolder* input, vlc_ml_entry_point_t& output );
17
bool Convert( const medialibrary::IBookmark* input, vlc_ml_bookmark_t& output );
18
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/misc/xml/libxml.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/misc/xml/libxml.c
Changed
80
1
2
*****************************************************************************/
3
static void Close( vlc_object_t *p_this )
4
{
5
-#ifdef LIBXML_GETS_A_CLUE_ABOUT_REENTRANCY_AND_MEMORY_LEAKS
6
- vlc_mutex_lock( &lock );
7
- xmlCleanupParser();
8
- vlc_mutex_unlock( &lock );
9
-#endif
10
+ /* /!\
11
+ * In theory, xmlCleanupParser() should be called here.
12
+ * Unfortunately that function is not thread-safe,
13
+ * operating on global state. So even if we would be
14
+ * able to know when this module is unloaded, we could
15
+ * still not call it then, as other libraries or the apps
16
+ * using libVLC could still use libxml themselves.
17
+ *
18
+ * Citing the libxml docs for xmlCleanupParser:
19
+ *
20
+ * > If your application is multithreaded or has plugin support
21
+ * > calling this may crash the application if another thread or
22
+ * > a plugin is still using libxml2. It's sometimes very hard to
23
+ * > guess if libxml2 is in use in the application, some libraries
24
+ * > or plugins may use it without notice. In case of doubt abstain
25
+ * > from calling this function or do it just before calling exit()
26
+ * > to avoid leak reports from valgrind!
27
+ */
28
VLC_UNUSED(p_this);
29
- return;
30
}
31
32
/*****************************************************************************
33
34
return likely(p_sys->node != NULL) ? ret : XML_READER_ERROR;
35
}
36
37
-#if 0
38
-static char *ReaderValue( xml_reader_t *p_reader )
39
-{
40
- const xmlChar *psz_value =
41
- xmlTextReaderConstValue( p_reader->p_sys->xml );
42
-
43
- return psz_value ? strdup( (const char *)psz_value ) : NULL;
44
-}
45
-#endif
46
-
47
static const char *ReaderNextAttr( xml_reader_t *p_reader, const char **pval )
48
{
49
xml_reader_sys_t *p_sys = p_reader->p_sys;
50
51
if( !p_libxml_reader )
52
{
53
free( p_sys );
54
+ /* /!\
55
+ * xmlCleanupParser should but can't be called here,
56
+ * for the same reason as in Close().
57
+ */
58
return VLC_ENOMEM;
59
}
60
61
62
xml_reader_sys_t *p_sys = p_reader->p_sys;
63
64
xmlFreeTextReader( p_sys->xml );
65
-#ifdef LIBXML_GETS_A_CLUE_ABOUT_REENTRANCY_AND_MEMORY_LEAKS
66
- vlc_mutex_lock( &lock );
67
- xmlCleanupParser();
68
- vlc_mutex_unlock( &lock );
69
-#endif
70
free( p_sys->node );
71
free( p_sys );
72
+
73
+ /* /!\
74
+ * xmlCleanupParser should but can't be called here,
75
+ * same reason as in Close() of the main xml module.
76
+ */
77
}
78
79
vlc_module_begin ()
80
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/mux/mpeg/ts.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/mux/mpeg/ts.c
Changed
94
1
2
"PCRs (Program Clock Reference) will be sent (in milliseconds). " \
3
"This value should be below 100ms. (default is 70ms).")
4
5
-#define BMIN_TEXT N_( "Minimum B (deprecated)")
6
-#define BMIN_LONGTEXT N_( "This setting is deprecated and not used anymore" )
7
-
8
-#define BMAX_TEXT N_( "Maximum B (deprecated)")
9
-#define BMAX_LONGTEXT N_( "This setting is deprecated and not used anymore")
10
-
11
#define DTS_TEXT N_("DTS delay (ms)")
12
#define DTS_LONGTEXT N_("Delay the DTS (decoding time " \
13
"stamps) and PTS (presentation timestamps) of the data in the " \
14
15
add_bool(SOUT_CFG_PREFIX "use-key-frames", false, KEYF_TEXT, KEYF_LONGTEXT, true)
16
17
add_integer( SOUT_CFG_PREFIX "pcr", 70, PCR_TEXT, PCR_LONGTEXT, true)
18
- add_integer( SOUT_CFG_PREFIX "bmin", 0, BMIN_TEXT, BMIN_LONGTEXT, true)
19
- add_integer( SOUT_CFG_PREFIX "bmax", 0, BMAX_TEXT, BMAX_LONGTEXT, true)
20
add_integer( SOUT_CFG_PREFIX "dts-delay", 400, DTS_TEXT, DTS_LONGTEXT, true)
21
22
+ add_obsolete_integer( "sout-ts-bmin" ) /* since 4.0.0 */
23
+ add_obsolete_integer( "sout-ts-bmax" ) /* since 4.0.0 */
24
+
25
add_bool( SOUT_CFG_PREFIX "crypt-audio", true, ACRYPT_TEXT, ACRYPT_LONGTEXT, true)
26
add_bool( SOUT_CFG_PREFIX "crypt-video", true, VCRYPT_TEXT, VCRYPT_LONGTEXT, true)
27
add_string( SOUT_CFG_PREFIX "csa-ck", NULL, CK_TEXT, CK_LONGTEXT, true)
28
29
"standard",
30
"pid-video", "pid-audio", "pid-spu", "pid-pmt", "tsid",
31
"netid", "sdtdesc",
32
- "es-id-pid", "shaping", "pcr", "bmin", "bmax", "use-key-frames",
33
+ "es-id-pid", "shaping", "pcr", "use-key-frames",
34
"dts-delay", "csa-ck", "csa2-ck", "csa-use", "csa-pkt", "crypt-audio", "crypt-video",
35
"muxpmt", "program-pmt", "alignment",
36
NULL
37
38
ts_mux_standard standard;
39
40
/* for TS building */
41
- int64_t i_bitrate_min;
42
- int64_t i_bitrate_max;
43
-
44
vlc_tick_t i_shaping_delay;
45
vlc_tick_t i_pcr_delay;
46
47
48
p_sys->i_pid_audio = var_GetInteger( p_mux, SOUT_CFG_PREFIX "pid-audio" );
49
p_sys->i_pid_spu = var_GetInteger( p_mux, SOUT_CFG_PREFIX "pid-spu" );
50
51
- /* Allow to create constrained stream */
52
- p_sys->i_bitrate_min = var_GetInteger( p_mux, SOUT_CFG_PREFIX "bmin" );
53
-
54
- p_sys->i_bitrate_max = var_GetInteger( p_mux, SOUT_CFG_PREFIX "bmax" );
55
-
56
- if( p_sys->i_bitrate_min > 0 && p_sys->i_bitrate_max > 0 &&
57
- p_sys->i_bitrate_min > p_sys->i_bitrate_max )
58
- {
59
- msg_Err( p_mux, "incompatible minimum and maximum bitrate, "
60
- "disabling bitrate control" );
61
- p_sys->i_bitrate_min = 0;
62
- p_sys->i_bitrate_max = 0;
63
- }
64
- if( p_sys->i_bitrate_min > 0 || p_sys->i_bitrate_max > 0 )
65
- {
66
- msg_Err( p_mux, "bmin and bmax no more supported "
67
- "(if you need them report it)" );
68
- }
69
-
70
var_Get( p_mux, SOUT_CFG_PREFIX "shaping", &val );
71
if( val.i_int <= 0 )
72
{
73
74
sout_mux_sys_t *p_sys = p_mux->p_sys;
75
int i_packet_count = p_chain_ts->i_depth;
76
77
- if ( likely(i_pcr_length / 1000 > 0) )
78
- {
79
- int i_bitrate = ((uint64_t)i_packet_count * 188 * 8000)
80
- / MS_FROM_VLC_TICK(i_pcr_length);
81
- if ( p_sys->i_bitrate_max && p_sys->i_bitrate_max < i_bitrate )
82
- {
83
- msg_Warn( p_mux, "max bitrate exceeded at %"PRId64
84
- " (%d bi/s for %d pkt in %"PRId64" us)",
85
- i_pcr_dts + p_sys->i_shaping_delay * 3 / 2 - vlc_tick_now(),
86
- i_bitrate, i_packet_count, i_pcr_length);
87
- }
88
- }
89
- else
90
+ if ( unlikely(i_pcr_length / 1000 <= 0) )
91
{
92
/* This shouldn't happen, but happens in some rare heavy load
93
* and packet losses conditions. */
94
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/packetizer/avparser.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/packetizer/avparser.c
Changed
67
1
2
if( unlikely( i_outlen <= 0 || !p_outdata ) )
3
goto out;
4
5
- block_t * p_ret = block_Alloc( i_outlen );
6
+ block_t * p_ret;
7
+ if( (size_t)i_outlen < p_block->i_buffer )
8
+ {
9
+ p_ret = block_Alloc( i_outlen );
10
+ if( unlikely ( !p_ret ) )
11
+ goto out;
12
+ }
13
+ else /* just pass block as-is */
14
+ {
15
+ p_ret = p_block;
16
+ }
17
18
- if( unlikely ( !p_ret ) )
19
- goto out;
20
+ if( p_ret != p_block )
21
+ {
22
+ p_ret->i_flags = p_block->i_flags;
23
+
24
+ if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
25
+ p_block->i_flags &= ~BLOCK_FLAG_DISCONTINUITY;
26
+
27
+ memcpy( p_ret->p_buffer, p_outdata, i_outlen );
28
+ p_ret->i_pts = p_block->i_pts;
29
+ p_ret->i_dts = p_block->i_dts;
30
+ p_block->i_pts = p_block->i_dts = VLC_TICK_INVALID;
31
+ }
32
+ else /* as-is block is now used */
33
+ {
34
+ p_sys->i_offset = 0;
35
+ *pp_block = NULL;
36
+ }
37
+
38
+ if( p_dec->fmt_in.i_cat == VIDEO_ES )
39
+ {
40
+ switch ( p_sys->p_parser_ctx->pict_type )
41
+ {
42
+ case AV_PICTURE_TYPE_I:
43
+ p_ret->i_flags |= BLOCK_FLAG_TYPE_I;
44
+ break;
45
+ case AV_PICTURE_TYPE_P:
46
+ p_ret->i_flags |= BLOCK_FLAG_TYPE_P;
47
+ break;
48
+ case AV_PICTURE_TYPE_B:
49
+ p_ret->i_flags |= BLOCK_FLAG_TYPE_B;
50
+ break;
51
+ default:
52
+ break;
53
+ }
54
+ }
55
56
- memcpy( p_ret->p_buffer, p_outdata, i_outlen );
57
- p_ret->i_pts = p_block->i_pts;
58
- p_ret->i_dts = p_block->i_dts;
59
if( p_sys->p_parser_ctx->key_frame == 1 )
60
p_ret->i_flags |= BLOCK_FLAG_TYPE_I;
61
62
- p_block->i_pts = p_block->i_dts = VLC_TICK_INVALID;
63
-
64
return p_ret;
65
66
out:
67
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/services_discovery/upnp.cpp -> vlc-beta-20210430.0b6b242324.tar.xz/modules/services_discovery/upnp.cpp
Changed
57
1
2
vlc_UrlParse( &url, psz_base_url );
3
4
/* Part 1: a user may have provided a custom playlist url */
5
- if (strncmp(psz_satip_channellist, "CustomList", 10) == 0) {
6
+ if (strcmp(psz_satip_channellist, "CustomList") == 0) {
7
char *psz_satip_playlist_url = config_GetPsz( "satip-channellist-url" );
8
if ( psz_satip_playlist_url ) {
9
p_server = new(std::nothrow) SD::MediaServerDesc( psz_udn, psz_friendly_name, psz_satip_playlist_url, iconUrl );
10
11
12
/* Part 2: device playlist
13
* In Automatic mode, or if requested by the user, check for a SAT>IP m3u list on the device */
14
- if (strncmp(psz_satip_channellist, "ServerList", 10) == 0 ||
15
- strncmp(psz_satip_channellist, "Auto", strlen ("Auto")) == 0 ) {
16
+ if (strcmp(psz_satip_channellist, "ServerList") == 0 ||
17
+ strcmp(psz_satip_channellist, "Auto") == 0 ) {
18
const char* psz_m3u_url = xml_getChildElementValue( p_device_element, "satip:X_SATIPM3U" );
19
if ( psz_m3u_url ) {
20
if ( strncmp( "http", psz_m3u_url, 4) )
21
22
msg_Dbg( m_sd, "SAT>IP server '%s' did not provide a playlist", url.psz_host);
23
}
24
25
- if(strncmp(psz_satip_channellist, "ServerList", 10) == 0) {
26
+ if(strcmp(psz_satip_channellist, "ServerList") == 0) {
27
/* to comply with the SAT>IP specifications, we don't fallback on another channel list if this path failed,
28
* but in Automatic mode, we continue */
29
free(psz_satip_channellist);
30
31
* MasterList is a list of usual Satellites */
32
33
/* In Auto mode, default to MasterList list from satip.info */
34
- if( strncmp(psz_satip_channellist, "Auto", strlen ("Auto")) == 0 ) {
35
+ if( strcmp(psz_satip_channellist, "Auto") == 0 ) {
36
free(psz_satip_channellist);
37
psz_satip_channellist = strdup( "MasterList" );
38
}
39
40
psz_album_artist = xml_getChildElementValue( itemElement, "upnp:albumArtist" );
41
psz_albumArt = xml_getChildElementValue( itemElement, "upnp:albumArtURI" );
42
const char *psz_media_type = xml_getChildElementValue( itemElement, "upnp:class" );
43
- if (strncmp(psz_media_type, "object.item.videoItem", 21) == 0)
44
+ if (strcmp(psz_media_type, "object.item.videoItem") == 0)
45
media_type = VIDEO;
46
- else if (strncmp(psz_media_type, "object.item.audioItem", 21) == 0)
47
+ else if (strcmp(psz_media_type, "object.item.audioItem") == 0)
48
media_type = AUDIO;
49
- else if (strncmp(psz_media_type, "object.item.imageItem", 21) == 0)
50
+ else if (strcmp(psz_media_type, "object.item.imageItem") == 0)
51
media_type = IMAGE;
52
- else if (strncmp(psz_media_type, "object.container", 16 ) == 0)
53
+ else if (strcmp(psz_media_type, "object.container") == 0)
54
media_type = CONTAINER;
55
else
56
return false;
57
vlc-beta-20210430.0b6b242324.tar.xz/modules/stream_out/chromecast/.gitignore
Added
4
1
2
+cast_channel.pb.cc
3
+cast_channel.pb.h
4
vlc-beta-20210430.0b6b242324.tar.xz/modules/video_filter/egl_surfacetexture.c
Added
201
1
2
+/*****************************************************************************
3
+ * egl_surfacetexture.c: OpenGL offscreen provider with SurfaceTexture
4
+ *****************************************************************************
5
+ * Copyright (C) 2021 Videolabs
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify it
8
+ * under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation; either version 2.1 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program; if not, write to the Free Software Foundation,
19
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
+ *****************************************************************************/
21
+#ifdef HAVE_CONFIG_H
22
+# include <config.h>
23
+#endif
24
+
25
+#include <vlc_common.h>
26
+#include <vlc_plugin.h>
27
+#include <vlc_modules.h>
28
+#include <vlc_picture.h>
29
+#include <vlc_filter.h>
30
+#include <vlc_opengl.h>
31
+#include <vlc_vout_display.h>
32
+#include <vlc_atomic.h>
33
+#include <EGL/egl.h>
34
+#include <EGL/eglext.h>
35
+
36
+#include "../video_output/android/utils.h"
37
+#include "../video_output/opengl/gl_api.h"
38
+
39
+#define BUFFER_COUNT 3
40
+
41
+struct video_ctx
42
+{
43
+ android_video_context_t android;
44
+ picture_pool_t *pool;
45
+ picture_t *pictures[BUFFER_COUNT];
46
+
47
+ EGLDisplay display;
48
+ EGLContext context;
49
+};
50
+
51
+struct picture_ctx
52
+{
53
+ struct picture_context_t context;
54
+ EGLSurface surface;
55
+
56
+ struct vlc_asurfacetexture *texture;
57
+};
58
+
59
+#define PRIV(pic_ctx) container_of(pic_ctx, struct picture_ctx, context)
60
+
61
+struct surfacetexture_sys
62
+{
63
+ android_video_context_t *avctx;
64
+
65
+ video_format_t fmt_out;
66
+
67
+ size_t current_flip;
68
+
69
+ struct vlc_gl_api api;
70
+
71
+ EGLConfig cfgv;
72
+
73
+ PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
74
+ PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
75
+
76
+ picture_t *current_picture;
77
+};
78
+
79
+static inline struct video_ctx *GetVCtx(vlc_gl_t *gl)
80
+{
81
+ return vlc_video_context_GetPrivate(gl->offscreen_vctx_out,
82
+ VLC_VIDEO_CONTEXT_AWINDOW);
83
+}
84
+
85
+static int MakeCurrent(vlc_gl_t *gl)
86
+{
87
+ struct surfacetexture_sys *sys = gl->sys;
88
+ struct video_ctx *vctx = GetVCtx(gl);
89
+
90
+ /* We must always have a surface mapped. */
91
+ assert(sys->current_picture);
92
+ assert(sys->current_picture->context);
93
+
94
+ struct picture_ctx *ctx = PRIV(sys->current_picture->context);
95
+
96
+ if (eglMakeCurrent (vctx->display, ctx->surface, ctx->surface,
97
+ vctx->context) != EGL_TRUE)
98
+ return VLC_EGENERIC;
99
+
100
+ return VLC_SUCCESS;
101
+}
102
+
103
+static void ReleaseCurrent(vlc_gl_t *gl)
104
+{
105
+ struct video_ctx *vctx = GetVCtx(gl);
106
+
107
+ eglMakeCurrent(vctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE,
108
+ EGL_NO_CONTEXT);
109
+}
110
+
111
+static void *GetSymbol(vlc_gl_t *gl, const char *procname)
112
+{
113
+ (void) gl;
114
+ return (void *)eglGetProcAddress(procname);
115
+}
116
+
117
+static const char *QueryString(vlc_gl_t *gl, int32_t name)
118
+{
119
+ struct video_ctx *vctx = GetVCtx(gl);
120
+
121
+ return eglQueryString(vctx->display, name);
122
+}
123
+
124
+static void *CreateImageKHR(vlc_gl_t *gl, unsigned target, void *buffer,
125
+ const int32_t *attrib_list)
126
+{
127
+ struct surfacetexture_sys *sys = gl->sys;
128
+ struct video_ctx *vctx = GetVCtx(gl);
129
+
130
+ return sys->eglCreateImageKHR(vctx->display, NULL, target, buffer,
131
+ attrib_list);
132
+}
133
+
134
+static bool DestroyImageKHR(vlc_gl_t *gl, void *image)
135
+{
136
+ struct surfacetexture_sys *sys = gl->sys;
137
+ struct video_ctx *vctx = GetVCtx(gl);
138
+
139
+ return sys->eglDestroyImageKHR(vctx->display, image);
140
+}
141
+
142
+static picture_context_t *CopyPictureContext(picture_context_t *input)
143
+{
144
+ vlc_video_context_Hold(input->vctx);
145
+ return input;
146
+}
147
+
148
+static void DestroyPictureContext(picture_context_t *input)
149
+{
150
+ (void) input;
151
+ /* video context is already released by picture_Release. */
152
+}
153
+
154
+static picture_context_t *CreatePictureContext(vlc_gl_t *gl)
155
+{
156
+ struct surfacetexture_sys *sys = gl->sys;
157
+ struct picture_ctx *ctx = malloc(sizeof(*ctx));
158
+ struct video_ctx *vctx = GetVCtx(gl);
159
+
160
+ ctx->texture = vlc_asurfacetexture_New(gl->device->opaque, false);
161
+
162
+ struct ANativeWindow *window = ctx->texture->window;
163
+ native_window_api_t *api =
164
+ AWindowHandler_getANativeWindowAPI(gl->device->opaque);
165
+ api->setBuffersGeometry(window, sys->fmt_out.i_width, sys->fmt_out.i_height,
166
+ AHARDWAREBUFFER_FORMAT_BLOB);
167
+
168
+ /* Create a drawing surface */
169
+ ctx->surface = eglCreateWindowSurface(vctx->display, sys->cfgv, window,
170
+ NULL);
171
+ if (ctx->surface == EGL_NO_SURFACE)
172
+ {
173
+ msg_Err(gl, "cannot create EGL window surface");
174
+ goto error;
175
+ }
176
+
177
+ ctx->context.vctx = gl->offscreen_vctx_out;
178
+ ctx->context.copy = CopyPictureContext;
179
+ ctx->context.destroy = DestroyPictureContext;
180
+
181
+ return &ctx->context;
182
+
183
+error:
184
+ free(ctx);
185
+ return NULL;
186
+}
187
+
188
+static int InitEGL(vlc_gl_t *gl)
189
+{
190
+ struct surfacetexture_sys *sys = gl->sys;
191
+ struct video_ctx *vctx = GetVCtx(gl);
192
+
193
+ vctx->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
194
+ if (vctx->display == EGL_NO_DISPLAY)
195
+ return VLC_EGENERIC;
196
+
197
+ /* Initialize EGL display */
198
+ EGLint major, minor;
199
+ if (eglInitialize(vctx->display, &major, &minor) != EGL_TRUE)
200
+ goto error;
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_filter/opengl.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_filter/opengl.c
Changed
59
1
2
if (sys == NULL)
3
return VLC_ENOMEM;
4
5
- unsigned width
6
- = filter->fmt_out.video.i_visible_width
7
- = filter->fmt_in.video.i_visible_width;
8
-
9
- unsigned height
10
- = filter->fmt_out.video.i_visible_height
11
- = filter->fmt_in.video.i_visible_height;
12
+ unsigned width = filter->fmt_out.video.i_visible_width;
13
+ unsigned height = filter->fmt_out.video.i_visible_height;
14
15
// TODO: other than BGRA format ?
16
#ifdef USE_OPENGL_ES2
17
18
if (!sys->filters)
19
{
20
msg_Err(obj, "Could not create filters");
21
+ free(glfilters_config);
22
goto filters_new_failure;
23
}
24
25
26
{
27
msg_Err(obj, "Could not load filters: %s", glfilters_config);
28
free(glfilters_config);
29
- goto filter_config_failure;
30
+ goto filters_load_failure;
31
}
32
free(glfilters_config);
33
34
35
= filter->fmt_out.i_codec
36
= sys->gl->offscreen_chroma_out;
37
38
- filter->fmt_out.video.i_frame_rate =
39
- filter->fmt_in.video.i_frame_rate;
40
-
41
- filter->fmt_out.video.i_frame_rate_base =
42
- filter->fmt_in.video.i_frame_rate_base;
43
-
44
- assert(filter->fmt_out.video.i_frame_rate_base != 0);
45
-
46
filter->vctx_out = sys->gl->offscreen_vctx_out;
47
48
return VLC_SUCCESS;
49
50
init_framebuffer_failure:
51
-filters_new_failure:
52
+filters_load_failure:
53
vlc_gl_filters_Delete(sys->filters);
54
55
+filters_new_failure:
56
filter_config_failure:
57
vlc_gl_interop_Delete(sys->interop);
58
59
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/Makefile.am -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/Makefile.am
Changed
10
1
2
-Wl,-framework,OpenGL,-framework,Cocoa
3
4
libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m
5
-libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) -DHAVE_GL_CORE_SYMBOLS
6
+libcaopengllayer_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_GL_CORE_SYMBOLS
7
libcaopengllayer_plugin_la_LIBADD = libvlc_opengl.la
8
libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
9
-Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/apple/VLCOpenGLES2VideoView.m -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/apple/VLCOpenGLES2VideoView.m
Changed
56
1
2
- (void)detachFromWindow;
3
@end
4
5
+static void vlc_dispatch_sync(void (^block_function)())
6
+{
7
+ CFRunLoopRef runloop = CFRunLoopGetMain();
8
+
9
+ __block vlc_sem_t performed;
10
+ vlc_sem_init(&performed, 0);
11
+
12
+ CFStringRef modes_cfstrings[] = {
13
+ kCFRunLoopDefaultMode,
14
+ CFSTR("org.videolan.vlccore.window"),
15
+ };
16
+
17
+ CFArrayRef modes = CFArrayCreate(NULL, (const void **)modes_cfstrings,
18
+ ARRAY_SIZE(modes_cfstrings),
19
+ &kCFTypeArrayCallBacks);
20
+
21
+ /* NOTE: we're using CFRunLoopPerformBlock with a custom mode tag
22
+ * to avoid deadlocks between the window module (main thread) and the
23
+ * display module, which would happen when using dispatch_sycn here. */
24
+ CFRunLoopPerformBlock(runloop, modes, ^{
25
+ (block_function)();
26
+ vlc_sem_post(&performed);
27
+ });
28
+ CFRunLoopWakeUp(runloop);
29
+
30
+ vlc_sem_wait(&performed);
31
+ CFRelease(modes);
32
+}
33
+
34
/*****************************************************************************
35
* vlc_gl_t callbacks
36
*****************************************************************************/
37
38
if (wnd->type != VOUT_WINDOW_TYPE_NSOBJECT)
39
return VLC_EGENERIC;
40
41
- @autoreleasepool {
42
- /* setup the actual OpenGL ES view */
43
- dispatch_sync(dispatch_get_main_queue(), ^{
44
+ @autoreleasepool {
45
+ /* NOTE: we're using CFRunLoopPerformBlock with the "vlc_runloop" tag
46
+ * to avoid deadlocks between the window module (main thread) and the
47
+ * display module, which would happen when using dispatch_sycn here. */
48
+ vlc_dispatch_sync(^{
49
gl->sys = (__bridge_retained void*)[[VLCOpenGLES2VideoView alloc]
50
- // TODO better rect
51
- initWithFrame:CGRectMake(0.,0.,320.,240.) gl:gl];
52
+ initWithFrame:CGRectMake(0.,0.,width,height) gl:gl];
53
});
54
55
if (gl->sys == NULL)
56
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/apple/VLCVideoUIView.m -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/apple/VLCVideoUIView.m
Changed
80
1
2
_tapRecognizer = [[UITapGestureRecognizer alloc]
3
initWithTarget:self action:@selector(tapRecognized:)];
4
5
+ CGSize size = _viewContainer.bounds.size;
6
+ [self reportEvent:^{
7
+ vout_window_ReportSize(_wnd, size.width, size.height);
8
+ }];
9
+
10
return self;
11
}
12
13
14
}
15
}
16
17
+- (void)reportEvent:(void(^)())eventBlock
18
+{
19
+ CFStringRef mode = CFSTR("org.videolan.vlccore.window");
20
+ CFRunLoopRef runloop = CFRunLoopGetCurrent();
21
+ CFRunLoopPerformBlock(runloop, mode, ^{
22
+ dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{
23
+ (eventBlock)();
24
+ CFRunLoopStop(runloop);
25
+ });
26
+ });
27
+ CFRunLoopWakeUp(runloop);
28
+ CFRunLoopRunInMode(mode, 0, NO);
29
+}
30
+
31
- (void)detachFromParent
32
{
33
/* We need to lock because we consider that _wnd might be destroyed
34
35
/* We need to lock to ensure _wnd is still valid, see detachFromParent. */
36
vlc_mutex_lock(&_mutex);
37
if (_wnd == NULL)
38
- goto end;
39
- vout_window_ReportSize(_wnd,
40
- viewSize.width * scaleFactor,
41
- viewSize.height * scaleFactor);
42
-end:
43
+ {
44
+ vlc_mutex_unlock(&_mutex);
45
+ return;
46
+ }
47
+
48
+ [self reportEvent:^{
49
+ vout_window_ReportSize(_wnd,
50
+ viewSize.width * scaleFactor,
51
+ viewSize.height * scaleFactor);
52
+ }];
53
vlc_mutex_unlock(&_mutex);
54
}
55
56
57
/* We need to lock to ensure _wnd is still valid, see detachFromParent. */
58
vlc_mutex_lock(&_mutex);
59
if (_wnd == NULL)
60
- goto end;
61
- vout_window_ReportMouseMoved(_wnd,
62
- (int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor);
63
- vout_window_ReportMousePressed(_wnd, MOUSE_BUTTON_LEFT);
64
- vout_window_ReportMouseReleased(_wnd, MOUSE_BUTTON_LEFT);
65
-end:
66
+ {
67
+ vlc_mutex_unlock(&_mutex);
68
+ return;
69
+ }
70
+
71
+ [self reportEvent:^{
72
+ vout_window_ReportMouseMoved(_wnd,
73
+ (int)touchPoint.x * scaleFactor, (int)touchPoint.y * scaleFactor);
74
+ vout_window_ReportMousePressed(_wnd, MOUSE_BUTTON_LEFT);
75
+ vout_window_ReportMouseReleased(_wnd, MOUSE_BUTTON_LEFT);
76
+ }];
77
vlc_mutex_unlock(&_mutex);
78
}
79
80
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/kms.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/kms.c
Changed
28
1
2
free(psz_device);
3
return VLC_EGENERIC;
4
}
5
- free(psz_device);
6
7
drmSetClientCap(sys->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
8
9
if (!ChromaNegotiation(vd))
10
+ {
11
+ free(psz_device);
12
goto err_out;
13
+ }
14
15
msg_Dbg(vd, "Using VLC chroma '%.4s', DRM chroma '%.4s'",
16
(char*)&sys->vlc_fourcc, (char*)&sys->drm_fourcc);
17
18
ret = drmGetCap(sys->drm_fd, DRM_CAP_DUMB_BUFFER, &dumbRet);
19
if (ret < 0 || !dumbRet) {
20
msg_Err(vd, "Device '%s' does not support dumb buffers", psz_device);
21
+ free(psz_device);
22
goto err_out;
23
}
24
+ free(psz_device);
25
26
modeRes = drmModeGetResources(sys->drm_fd);
27
if (modeRes == NULL) {
28
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/Makefile.am -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/Makefile.am
Changed
24
1
2
endif
3
4
libegl_pbuffer_filter_plugin_la_SOURCES = video_filter/egl_pbuffer.c \
5
- video_output/opengl/egl_display.c
6
+ video_output/opengl/egl_display.c video_output/opengl/egl_display.h
7
libegl_pbuffer_filter_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_FLAGS)
8
libegl_pbuffer_filter_plugin_la_LIBADD = $(EGL_LIBS)
9
10
11
vout_LTLIBRARIES += libegl_pbuffer_filter_plugin.la
12
endif
13
endif
14
+
15
+libegl_surfacetexture_plugin_la_SOURCES = video_filter/egl_surfacetexture.c
16
+libegl_surfacetexture_plugin_la_CFLAGS = $(AM_CFLAGS) $(EGL_CFLAGS) -DUSE_OPENGL_ES2
17
+libegl_surfacetexture_plugin_la_LIBADD = $(EGL_LIBS)
18
+
19
+if HAVE_ANDROID
20
+if HAVE_EGL
21
+vout_LTLIBRARIES += libegl_surfacetexture_plugin.la
22
+endif
23
+endif
24
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/filter.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/filter.c
Changed
28
1
2
priv->size_out.width = 0;
3
priv->size_out.height = 0;
4
5
- priv->has_framebuffer_out = false;
6
+ priv->tex_count = 0;
7
8
struct vlc_gl_filter *filter = &priv->filter;
9
filter->api = api;
10
+ filter->config.filter_planes = false;
11
filter->config.blend = false;
12
filter->config.msaa_level = 0;
13
filter->ops = NULL;
14
15
16
const opengl_vtable_t *vt = &filter->api->vt;
17
18
- if (priv->has_framebuffer_out)
19
+ if (priv->tex_count)
20
{
21
- vt->DeleteFramebuffers(1, &priv->framebuffer_out);
22
- vt->DeleteTextures(1, &priv->texture_out);
23
+ vt->DeleteFramebuffers(priv->tex_count, priv->framebuffers_out);
24
+ vt->DeleteTextures(priv->tex_count, priv->textures_out);
25
}
26
27
if (filter->config.msaa_level)
28
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/filter.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/filter.h
Changed
49
1
2
3
struct vlc_gl_input_meta {
4
vlc_tick_t pts;
5
+ unsigned plane;
6
};
7
8
typedef int
9
10
* Successive calls to this function for the same filter is guaranteed to
11
* always return the same sampler.
12
*
13
+ * Important: filter->config must be initialized *before* getting the
14
+ * sampler, since the sampler behavior may depend on it.
15
+ *
16
* \param filter the filter
17
* \return sampler the sampler, NULL on error
18
*/
19
20
21
struct {
22
/**
23
+ * An OpenGL filter may either operate on the input RGBA picture, or on
24
+ * individual input planes (without chroma conversion) separately.
25
+ *
26
+ * In practice, this is useful for deinterlace filters.
27
+ *
28
+ * This flag must be set by the filter module (default is false).
29
+ */
30
+ bool filter_planes;
31
+
32
+ /**
33
* A blend filter draws over the input picture (without reading it).
34
*
35
+ * Meaningless if filter_planes is true.
36
+ *
37
* This flag must be set by the filter module (default is false).
38
*/
39
bool blend;
40
41
* This value must be set by the filter module (default is 0, which
42
* means disabled).
43
*
44
+ * Meaningless if filter_planes is true.
45
+ *
46
* The actual MSAA level may be overwritten to 0 if multisampling is
47
* not supported, or to a higher value if another filter rendering on
48
* the same framebuffer requested a higher MSAA level.
49
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/filter_draw.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/filter_draw.c
Changed
94
1
2
3
struct vlc_gl_sampler *sampler = vlc_gl_filter_GetSampler(filter);
4
5
-#ifdef USE_OPENGL_ES2
6
-# define SHADER_VERSION "#version 100\n"
7
-# define FRAGMENT_SHADER_PRECISION "precision highp float;\n"
8
-#else
9
-# define SHADER_VERSION "#version 120\n"
10
-# define FRAGMENT_SHADER_PRECISION
11
-#endif
12
-
13
- static const char *const VERTEX_SHADER =
14
- SHADER_VERSION
15
+ static const char *const VERTEX_SHADER_BODY =
16
"attribute vec2 vertex_pos;\n"
17
"varying vec2 tex_coords;\n"
18
"void main() {\n"
19
20
" (vertex_pos.y + 1.0) / 2.0);\n"
21
"}\n";
22
23
- static const char *const VERTEX_SHADER_VFLIP =
24
- SHADER_VERSION
25
+ static const char *const VERTEX_SHADER_BODY_VFLIP =
26
"attribute vec2 vertex_pos;\n"
27
"varying vec2 tex_coords;\n"
28
"void main() {\n"
29
30
" (-vertex_pos.y + 1.0) / 2.0);\n"
31
"}\n";
32
33
- static const char *const FRAGMENT_SHADER_TEMPLATE =
34
- SHADER_VERSION
35
- "%s\n" /* extensions */
36
- FRAGMENT_SHADER_PRECISION
37
- "%s\n" /* vlc_texture definition */
38
+ static const char *const FRAGMENT_SHADER_BODY =
39
"varying vec2 tex_coords;\n"
40
"void main() {\n"
41
" gl_FragColor = vlc_texture(tex_coords);\n"
42
43
const char *extensions = sampler->shader.extensions
44
? sampler->shader.extensions : "";
45
46
- char *fragment_shader;
47
- int ret = asprintf(&fragment_shader, FRAGMENT_SHADER_TEMPLATE, extensions,
48
- sampler->shader.body);
49
- if (ret < 0)
50
- goto error;
51
-
52
const opengl_vtable_t *vt = &filter->api->vt;
53
54
+ const char *shader_version;
55
+ const char *shader_precision;
56
+ if (filter->api->is_gles)
57
+ {
58
+ shader_version = "#version 100\n";
59
+ shader_precision = "precision highp float;\n";
60
+ }
61
+ else
62
+ {
63
+ shader_version = "#version 120\n";
64
+ shader_precision = "";
65
+ }
66
+
67
config_ChainParse(filter, DRAW_CFG_PREFIX, filter_options, config);
68
bool vflip = var_InheritBool(filter, DRAW_CFG_PREFIX "vflip");
69
70
- const char *vertex_shader = vflip ? VERTEX_SHADER_VFLIP : VERTEX_SHADER;
71
+ const char *vertex_shader[] = {
72
+ shader_version,
73
+ vflip ? VERTEX_SHADER_BODY_VFLIP : VERTEX_SHADER_BODY,
74
+ };
75
+ const char *fragment_shader[] = {
76
+ shader_version,
77
+ extensions,
78
+ shader_precision,
79
+ sampler->shader.body,
80
+ FRAGMENT_SHADER_BODY,
81
+ };
82
+
83
GLuint program_id =
84
vlc_gl_BuildProgram(VLC_OBJECT(filter), vt,
85
- 1, &vertex_shader,
86
- 1, (const char **) &fragment_shader);
87
-
88
- free(fragment_shader);
89
+ ARRAY_SIZE(vertex_shader), vertex_shader,
90
+ ARRAY_SIZE(fragment_shader), fragment_shader);
91
if (!program_id)
92
goto error;
93
94
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/filter_mock.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/filter_mock.c
Changed
201
1
2
* Several instances may be combined:
3
*
4
* ./vlc file.mkv --video-filter='opengl{filter="mock{mask,speed=1}:mock{angle=180,speed=-1}"}'
5
+ *
6
+ * It can also be used to filter planes separately, drawing each one with a
7
+ * small offset:
8
+ *
9
+ * ./vlc file.mkv --video-filter='opengl{filter=mock{plane}}'
10
*/
11
-
12
#ifdef HAVE_CONFIG_H
13
# include "config.h"
14
#endif
15
16
#include "gl_common.h"
17
#include "gl_util.h"
18
19
-#ifdef USE_OPENGL_ES2
20
-# define SHADER_VERSION "#version 100\n"
21
-# define FRAGMENT_SHADER_PRECISION "precision mediump float;\n"
22
-#else
23
-# define SHADER_VERSION "#version 120\n"
24
-# define FRAGMENT_SHADER_PRECISION
25
-#endif
26
-
27
#define MOCK_CFG_PREFIX "mock-"
28
29
static const char *const filter_options[] = {
30
- "angle", "mask", "msaa", "speed", NULL
31
+ "angle", "mask", "msaa", "plane", "speed", NULL
32
};
33
34
struct sys {
35
36
GLint vertex_pos;
37
GLint rotation_matrix;
38
GLint vertex_color; // blend (non-mask) only
39
+ GLint plane;
40
} loc;
41
42
float theta0;
43
44
return VLC_SUCCESS;
45
}
46
47
+static int
48
+DrawPlane(struct vlc_gl_filter *filter, const struct vlc_gl_input_meta *meta)
49
+{
50
+ struct sys *sys = filter->sys;
51
+
52
+ const opengl_vtable_t *vt = &filter->api->vt;
53
+
54
+ vt->UseProgram(sys->program_id);
55
+
56
+ struct vlc_gl_sampler *sampler = vlc_gl_filter_GetSampler(filter);
57
+ vlc_gl_sampler_Load(sampler);
58
+
59
+ vt->Uniform1i(sys->loc.plane, (int) meta->plane);
60
+
61
+ vt->BindBuffer(GL_ARRAY_BUFFER, sys->vbo);
62
+ vt->EnableVertexAttribArray(sys->loc.vertex_pos);
63
+ vt->VertexAttribPointer(sys->loc.vertex_pos, 2, GL_FLOAT, GL_FALSE, 0,
64
+ (const void *) 0);
65
+
66
+ vt->Clear(GL_COLOR_BUFFER_BIT);
67
+ vt->DrawArrays(GL_TRIANGLE_STRIP, 0, 4);
68
+
69
+ return VLC_SUCCESS;
70
+}
71
+
72
static void
73
Close(struct vlc_gl_filter *filter)
74
{
75
76
struct sys *sys = filter->sys;
77
const opengl_vtable_t *vt = &filter->api->vt;
78
79
- static const char *const VERTEX_SHADER =
80
- SHADER_VERSION
81
+ static const char *const VERTEX_SHADER_BODY =
82
"attribute vec2 vertex_pos;\n"
83
"attribute vec3 vertex_color;\n"
84
"uniform mat4 rotation_matrix;\n"
85
86
" color = vertex_color;\n"
87
"}\n";
88
89
- static const char *const FRAGMENT_SHADER =
90
- SHADER_VERSION
91
- FRAGMENT_SHADER_PRECISION
92
+ static const char *const FRAGMENT_SHADER_BODY =
93
"varying vec3 color;\n"
94
"void main() {\n"
95
" gl_FragColor = vec4(color, 0.5);\n"
96
"}\n";
97
98
+ const char *shader_version;
99
+ const char *shader_precision;
100
+ if (filter->api->is_gles)
101
+ {
102
+ shader_version = "#version 100\n";
103
+ shader_precision = "precision highp float;\n";
104
+ }
105
+ else
106
+ {
107
+ shader_version = "#version 120\n";
108
+ shader_precision = "";
109
+ }
110
+
111
+ const char *vertex_shader[] = {
112
+ shader_version,
113
+ VERTEX_SHADER_BODY,
114
+ };
115
+ const char *fragment_shader[] = {
116
+ shader_version,
117
+ shader_precision,
118
+ FRAGMENT_SHADER_BODY,
119
+ };
120
+
121
GLuint program_id =
122
vlc_gl_BuildProgram(VLC_OBJECT(filter), vt,
123
- 1, (const char **) &VERTEX_SHADER,
124
- 1, (const char **) &FRAGMENT_SHADER);
125
+ ARRAY_SIZE(vertex_shader), vertex_shader,
126
+ ARRAY_SIZE(fragment_shader), fragment_shader);
127
128
if (!program_id)
129
return VLC_EGENERIC;
130
131
sys->loc.vertex_color = vt->GetAttribLocation(program_id, "vertex_color");
132
assert(sys->loc.vertex_color != -1);
133
134
+ sys->loc.rotation_matrix = vt->GetUniformLocation(sys->program_id,
135
+ "rotation_matrix");
136
+ assert(sys->loc.rotation_matrix != -1);
137
+
138
vt->GenBuffers(1, &sys->vbo);
139
140
static const GLfloat data[] = {
141
142
143
struct vlc_gl_sampler *sampler = vlc_gl_filter_GetSampler(filter);
144
145
- static const char *const VERTEX_SHADER =
146
- SHADER_VERSION
147
+ static const char *const VERTEX_SHADER_BODY =
148
"attribute vec2 vertex_pos;\n"
149
"uniform mat4 rotation_matrix;\n"
150
"varying vec2 tex_coords;\n"
151
152
" gl_Position = pos\n;"
153
"}\n";
154
155
- static const char *const FRAGMENT_SHADER_TEMPLATE =
156
- SHADER_VERSION
157
- "%s\n" /* extensions */
158
- FRAGMENT_SHADER_PRECISION
159
- "%s\n" /* vlc_texture definition */
160
+ static const char *const FRAGMENT_SHADER_BODY =
161
"varying vec2 tex_coords;\n"
162
"void main() {\n"
163
" gl_FragColor = vlc_texture(tex_coords);\n"
164
165
const char *extensions = sampler->shader.extensions
166
? sampler->shader.extensions : "";
167
168
- char *fragment_shader;
169
- int ret = asprintf(&fragment_shader, FRAGMENT_SHADER_TEMPLATE, extensions,
170
- sampler->shader.body);
171
- if (ret < 0)
172
- return VLC_EGENERIC;
173
+ const char *shader_version;
174
+ const char *shader_precision;
175
+ if (filter->api->is_gles)
176
+ {
177
+ shader_version = "#version 100\n";
178
+ shader_precision = "precision highp float;\n";
179
+ }
180
+ else
181
+ {
182
+ shader_version = "#version 120\n";
183
+ shader_precision = "";
184
+ }
185
+
186
+ const char *vertex_shader[] = {
187
+ shader_version,
188
+ VERTEX_SHADER_BODY,
189
+ };
190
+ const char *fragment_shader[] = {
191
+ shader_version,
192
+ extensions,
193
+ shader_precision,
194
+ sampler->shader.body,
195
+ FRAGMENT_SHADER_BODY,
196
+ };
197
198
GLuint program_id =
199
vlc_gl_BuildProgram(VLC_OBJECT(filter), vt,
200
- 1, (const char **) &VERTEX_SHADER,
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/filter_priv.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/filter_priv.h
Changed
27
1
2
3
#include <vlc_common.h>
4
#include <vlc_list.h>
5
+#include <vlc_picture.h>
6
7
#include "filter.h"
8
#include "sampler.h"
9
10
/* Only meaningful for non-blend filters { */
11
struct vlc_gl_sampler *sampler; /* owned */
12
13
- bool has_framebuffer_out;
14
- GLuint framebuffer_out; /* owned (this filter must delete it) */
15
- GLuint texture_out; /* owned (attached to framebuffer_out) */
16
+ /* owned (this filter must delete it) */
17
+ GLuint framebuffers_out[PICTURE_PLANE_MAX];
18
+
19
+ /* owned (each attached to framebuffers_out[i]) */
20
+ GLuint textures_out[PICTURE_PLANE_MAX];
21
+ GLsizei tex_widths[PICTURE_PLANE_MAX];
22
+ GLsizei tex_heights[PICTURE_PLANE_MAX];
23
+ unsigned tex_count;
24
25
/* For multisampling, if msaa_level != 0 */
26
GLuint framebuffer_msaa; /* owned */
27
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/filters.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/filters.c
Changed
201
1
2
}
3
4
static int
5
-InitFramebufferOut(struct vlc_gl_filter_priv *priv)
6
+InitPlane(struct vlc_gl_filter_priv *priv, unsigned plane, GLsizei width,
7
+ GLsizei height)
8
{
9
- assert(priv->size_out.width > 0 && priv->size_out.height > 0);
10
-
11
const opengl_vtable_t *vt = &priv->filter.api->vt;
12
13
- /* Create a texture having the expected size */
14
- vt->GenTextures(1, &priv->texture_out);
15
- vt->BindTexture(GL_TEXTURE_2D, priv->texture_out);
16
- vt->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, priv->size_out.width,
17
- priv->size_out.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
18
+ GLuint framebuffer = priv->framebuffers_out[plane];
19
+ GLuint texture = priv->textures_out[plane];
20
+
21
+ vt->BindTexture(GL_TEXTURE_2D, texture);
22
+ vt->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
23
+ GL_UNSIGNED_BYTE, NULL);
24
vt->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
25
vt->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
26
27
28
vt->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
29
30
/* Create a framebuffer and attach the texture */
31
- vt->GenFramebuffers(1, &priv->framebuffer_out);
32
- vt->BindFramebuffer(GL_FRAMEBUFFER, priv->framebuffer_out);
33
+ vt->BindFramebuffer(GL_FRAMEBUFFER, framebuffer);
34
vt->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
35
- GL_TEXTURE_2D, priv->texture_out, 0);
36
-
37
- priv->has_framebuffer_out = true;
38
+ GL_TEXTURE_2D, texture, 0);
39
40
GLenum status = vt->CheckFramebufferStatus(GL_FRAMEBUFFER);
41
if (status != GL_FRAMEBUFFER_COMPLETE)
42
43
}
44
45
static int
46
+InitFramebuffersOut(struct vlc_gl_filter_priv *priv)
47
+{
48
+ assert(priv->size_out.width > 0 && priv->size_out.height > 0);
49
+
50
+ const opengl_vtable_t *vt = &priv->filter.api->vt;
51
+
52
+ struct vlc_gl_filter *filter = &priv->filter;
53
+ if (filter->config.filter_planes)
54
+ {
55
+ struct vlc_gl_sampler *sampler = vlc_gl_filter_GetSampler(filter);
56
+ if (!sampler)
57
+ return VLC_EGENERIC;
58
+
59
+ priv->tex_count = sampler->tex_count;
60
+ vt->GenFramebuffers(priv->tex_count, priv->framebuffers_out);
61
+ vt->GenTextures(priv->tex_count, priv->textures_out);
62
+
63
+ for (unsigned i = 0; i < sampler->tex_count; ++i)
64
+ {
65
+ priv->tex_widths[i] = priv->size_out.width * sampler->tex_widths[i]
66
+ / sampler->tex_widths[0];
67
+ priv->tex_heights[i] = priv->size_out.height * sampler->tex_heights[i]
68
+ / sampler->tex_heights[0];
69
+ /* Init one framebuffer and texture for each plane */
70
+ int ret =
71
+ InitPlane(priv, i, priv->tex_widths[i], priv->tex_heights[i]);
72
+ if (ret != VLC_SUCCESS)
73
+ return ret;
74
+ }
75
+ }
76
+ else
77
+ {
78
+ priv->tex_count = 1;
79
+
80
+ /* Create a texture having the expected size */
81
+
82
+ vt->GenFramebuffers(1, priv->framebuffers_out);
83
+ vt->GenTextures(1, priv->textures_out);
84
+
85
+ priv->tex_widths[0] = priv->size_out.width;
86
+ priv->tex_heights[0] = priv->size_out.height;
87
+
88
+ int ret = InitPlane(priv, 0, priv->tex_widths[0], priv->tex_heights[0]);
89
+ if (ret != VLC_SUCCESS)
90
+ return ret;
91
+ }
92
+
93
+ return VLC_SUCCESS;
94
+}
95
+
96
+static int
97
InitFramebufferMSAA(struct vlc_gl_filter_priv *priv, unsigned msaa_level)
98
{
99
assert(msaa_level);
100
101
struct vlc_gl_filters *filters = priv->filters;
102
struct vlc_gl_filter_priv *prev_filter = priv->prev_filter;
103
104
+ bool expose_planes = filter->config.filter_planes;
105
struct vlc_gl_sampler *sampler;
106
if (!priv->prev_filter)
107
- sampler = vlc_gl_sampler_NewFromInterop(filters->interop);
108
+ sampler = vlc_gl_sampler_NewFromInterop(filters->interop,
109
+ expose_planes);
110
else
111
{
112
video_format_t fmt;
113
- video_format_Init(&fmt, VLC_CODEC_RGBA);
114
+
115
+ /* If the previous filter operated on planes, then its output chroma is
116
+ * the same as its input chroma. Otherwise, it's RGBA. */
117
+ vlc_fourcc_t chroma = prev_filter->filter.config.filter_planes
118
+ ? prev_filter->sampler->fmt.i_chroma
119
+ : VLC_CODEC_RGBA;
120
+
121
+ video_format_Init(&fmt, chroma);
122
fmt.i_width = fmt.i_visible_width = prev_filter->size_out.width;
123
fmt.i_height = fmt.i_visible_height = prev_filter->size_out.height;
124
125
- sampler =
126
- vlc_gl_sampler_NewFromTexture2D(filters->gl, filters->api, &fmt);
127
+ sampler = vlc_gl_sampler_NewFromTexture2D(filters->gl, filters->api,
128
+ &fmt, expose_planes);
129
}
130
131
priv->sampler = sampler;
132
133
|| (priv->size_out.width == size_in.width
134
&& priv->size_out.height == size_in.height));
135
136
+ /* A filter operating on planes may not blend. */
137
+ assert(!filter->config.filter_planes || !filter->config.blend);
138
+
139
+ /* A filter operating on planes may not use anti-aliasing. */
140
+ assert(!filter->config.filter_planes || !filter->config.msaa_level);
141
+
142
/* A blend filter may not read its input, so it is an error if a sampler
143
* has been requested.
144
*
145
146
147
if (filter->config.blend)
148
{
149
- if (!prev_filter)
150
+ if (!prev_filter || prev_filter->filter.config.filter_planes)
151
{
152
/* We cannot blend with nothing, so insert a "draw" filter to draw
153
* the input picture to blend with. */
154
155
/* "priv" is the last filter */
156
assert(priv); /* There is at least one filter */
157
158
- if (priv->filter.config.msaa_level)
159
- {
160
+ bool insert_draw =
161
/* Resolving multisampling to the default framebuffer might fail,
162
- * because its format may be different. So insert a "draw" filter. */
163
+ * because its format may be different. */
164
+ priv->filter.config.msaa_level ||
165
+ /* A filter operating on planes may produce several textures.
166
+ * They need to be chroma-converted to a single RGBA texture. */
167
+ priv->filter.config.filter_planes;
168
+ if (insert_draw)
169
+ {
170
struct vlc_gl_filter *draw =
171
vlc_gl_filters_Append(filters, "draw", NULL);
172
if (!draw)
173
174
if (!is_last)
175
{
176
/* It was the last non-blend filter before we append this one */
177
- assert(!priv->has_framebuffer_out);
178
+ assert(priv->tex_count == 0);
179
180
/* Every non-blend filter needs its own framebuffer, except the last
181
* one */
182
- int ret = InitFramebufferOut(priv);
183
+ int ret = InitFramebuffersOut(priv);
184
if (ret != VLC_SUCCESS)
185
return ret;
186
}
187
188
189
struct vlc_gl_input_meta meta = {
190
.pts = filters->pic.pts,
191
+ .plane = 0,
192
};
193
194
struct vlc_gl_filter_priv *priv;
195
196
if (previous)
197
{
198
/* Read from the output of the previous filter */
199
- int ret = vlc_gl_sampler_UpdateTexture(priv->sampler,
200
- previous->texture_out,
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/interop.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/interop.c
Changed
90
1
2
return size > 0 ? size * mul : size;
3
}
4
5
+static inline void
6
+DivideRationalByTwo(vlc_rational_t *r) {
7
+ if (r->num % 2 == 0)
8
+ r->num /= 2;
9
+ else
10
+ r->den *= 2;
11
+}
12
+
13
static int
14
interop_yuv_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
15
vlc_fourcc_t chroma,
16
17
if (desc->pixel_size == 1)
18
{
19
interop->texs[0] = (struct vlc_gl_tex_cfg) {
20
- { 1, 1 }, { 1, 1 }, oneplane_texfmt, oneplane_texfmt,
21
- GL_UNSIGNED_BYTE
22
+ { desc->p[0].w.num, desc->p[0].w.den },
23
+ { desc->p[0].h.num, desc->p[0].h.den },
24
+ oneplane_texfmt, oneplane_texfmt, GL_UNSIGNED_BYTE
25
};
26
interop->texs[1] = (struct vlc_gl_tex_cfg) {
27
- { 1, 2 }, { 1, 2 }, twoplanes_texfmt, twoplanes_texfmt,
28
- GL_UNSIGNED_BYTE
29
+ { desc->p[1].w.num, desc->p[1].w.den },
30
+ { desc->p[1].h.num, desc->p[1].h.den },
31
+ twoplanes_texfmt, twoplanes_texfmt, GL_UNSIGNED_BYTE
32
};
33
}
34
else if (desc->pixel_size == 2)
35
36
twoplanes16_texfmt, GL_UNSIGNED_SHORT) != 16)
37
return VLC_EGENERIC;
38
interop->texs[0] = (struct vlc_gl_tex_cfg) {
39
- { 1, 1 }, { 1, 1 }, oneplane16_texfmt, oneplane_texfmt,
40
- GL_UNSIGNED_SHORT
41
+ { desc->p[0].w.num, desc->p[0].w.den },
42
+ { desc->p[0].h.num, desc->p[0].h.den },
43
+ oneplane16_texfmt, oneplane_texfmt, GL_UNSIGNED_SHORT
44
};
45
interop->texs[1] = (struct vlc_gl_tex_cfg) {
46
- { 1, 2 }, { 1, 2 }, twoplanes16_texfmt, twoplanes_texfmt,
47
- GL_UNSIGNED_SHORT
48
+ { desc->p[1].w.num, desc->p[1].w.den },
49
+ { desc->p[1].h.num, desc->p[1].h.den },
50
+ twoplanes16_texfmt, twoplanes_texfmt, GL_UNSIGNED_SHORT
51
};
52
}
53
else
54
return VLC_EGENERIC;
55
+
56
+ /*
57
+ * If plane_count == 2, then the chroma is semiplanar: the U and V
58
+ * planes are packed in the second plane. As a consequence, the
59
+ * horizontal scaling, as reported in the vlc_chroma_description_t, is
60
+ * doubled.
61
+ *
62
+ * But once imported as an OpenGL texture, both components are stored
63
+ * in a single texel (the two first components of the vec4).
64
+ * Therefore, from OpenGL, the width is not doubled, so the horizontal
65
+ * scaling must be divided by 2 to compensate.
66
+ */
67
+ DivideRationalByTwo(&interop->texs[1].w);
68
}
69
else if (desc->plane_count == 1)
70
{
71
+ /* Only YUV 4:2:2 formats */
72
/* Y1 U Y2 V fits in R G B A */
73
interop->tex_count = 1;
74
interop->texs[0] = (struct vlc_gl_tex_cfg) {
75
- { 1, 2 }, { 1, 1 }, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE
76
+ { desc->p[0].w.num, desc->p[0].w.den },
77
+ { desc->p[0].h.num, desc->p[0].h.den },
78
+ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE
79
};
80
+
81
+ /*
82
+ * Currently, Y2 is ignored, so the texture is stored at chroma
83
+ * resolution. In other words, half the horizontal resolution is lost,
84
+ * so we must adapt the horizontal scaling.
85
+ */
86
+ DivideRationalByTwo(&interop->texs[0].w);
87
}
88
else
89
return VLC_EGENERIC;
90
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/interop_android.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/interop_android.c
Changed
10
1
2
priv->previous_texture = texture;
3
}
4
5
- if (!avctx->render(pic->context))
6
+ if (avctx->render && !avctx->render(pic->context))
7
goto success; /* already rendered */
8
9
/* Release previous image */
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/interop_dxva2.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/interop_dxva2.c
Changed
11
1
2
msg_Dbg(interop, "Failed to create the processor (error 0x%lX)", hr);
3
goto error;
4
}
5
+
6
+ free(capsList);
7
+ free(formatsList);
8
IDXVAHD_Device_Release( hd_device );
9
10
SetupProcessorInput(interop, &interop->fmt_in, src_format);
11
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/renderer.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/renderer.c
Changed
148
1
2
#undef ROW
3
}
4
5
-/* https://en.wikipedia.org/wiki/OpenGL_Shading_Language#Versions */
6
-#ifdef USE_OPENGL_ES2
7
-# define SHADER_VERSION "#version 100\n"
8
- /* In OpenGL ES, the fragment language has no default precision qualifier for
9
- * floating point types. */
10
-# define FRAGMENT_SHADER_PRECISION "precision highp float;\n"
11
-#else
12
-# define SHADER_VERSION "#version 120\n"
13
-# define FRAGMENT_SHADER_PRECISION
14
-#endif
15
-
16
-static char *
17
-BuildVertexShader(struct vlc_gl_filter *filter)
18
+static int
19
+opengl_link_program(struct vlc_gl_filter *filter)
20
{
21
struct vlc_gl_renderer *renderer = filter->sys;
22
+ struct vlc_gl_sampler *sampler = renderer->sampler;
23
+ const opengl_vtable_t *vt = renderer->vt;
24
25
- /* Basic vertex shader */
26
- static const char *template =
27
- SHADER_VERSION
28
+ static const char *const VERTEX_SHADER_BODY =
29
"attribute vec2 PicCoordsIn;\n"
30
"varying vec2 PicCoords;\n"
31
"attribute vec3 VertexPosition;\n"
32
33
" PicCoords = (StereoMatrix * vec3(PicCoordsIn, 1.0)).st;\n"
34
" gl_Position = ProjectionMatrix * ZoomMatrix * ViewMatrix\n"
35
" * vec4(VertexPosition, 1.0);\n"
36
- "}";
37
-
38
- char *code = strdup(template);
39
- if (!code)
40
- return NULL;
41
-
42
- if (renderer->dump_shaders)
43
- msg_Dbg(filter, "\n=== Vertex shader for fourcc: %4.4s ===\n%s\n",
44
- (const char *) &renderer->sampler->fmt.i_chroma, code);
45
- return code;
46
-}
47
-
48
-static char *
49
-BuildFragmentShader(struct vlc_gl_filter *filter)
50
-{
51
- struct vlc_gl_renderer *renderer = filter->sys;
52
- struct vlc_gl_sampler *sampler = renderer->sampler;
53
+ "}\n";
54
55
- static const char *template =
56
- SHADER_VERSION
57
- "%s" /* extensions */
58
- FRAGMENT_SHADER_PRECISION
59
- "%s" /* vlc_texture definition */
60
+ static const char *const FRAGMENT_SHADER_BODY =
61
"varying vec2 PicCoords;\n"
62
"void main() {\n"
63
" gl_FragColor = vlc_texture(PicCoords);\n"
64
65
const char *extensions = sampler->shader.extensions
66
? sampler->shader.extensions : "";
67
68
- char *code;
69
- int ret = asprintf(&code, template, extensions, sampler->shader.body);
70
- if (ret < 0)
71
- return NULL;
72
-
73
- if (renderer->dump_shaders)
74
- msg_Dbg(filter, "\n=== Fragment shader for fourcc: %4.4s, colorspace: %d ===\n%s\n",
75
- (const char *) &sampler->fmt.i_chroma,
76
- sampler->fmt.space, code);
77
-
78
- return code;
79
-}
80
-
81
-static int
82
-opengl_link_program(struct vlc_gl_filter *filter)
83
-{
84
- struct vlc_gl_renderer *renderer = filter->sys;
85
- struct vlc_gl_sampler *sampler = renderer->sampler;
86
- const opengl_vtable_t *vt = renderer->vt;
87
+ const char *shader_version;
88
+ const char *shader_precision;
89
+ if (filter->api->is_gles)
90
+ {
91
+ shader_version = "#version 100\n";
92
+ shader_precision = "precision highp float;\n";
93
+ }
94
+ else
95
+ {
96
+ shader_version = "#version 120\n";
97
+ shader_precision = "";
98
+ }
99
100
- char *vertex_shader = BuildVertexShader(filter);
101
- if (!vertex_shader)
102
- return VLC_EGENERIC;
103
+ const char *vertex_shader[] = {
104
+ shader_version,
105
+ VERTEX_SHADER_BODY,
106
+ };
107
+ const char *fragment_shader[] = {
108
+ shader_version,
109
+ extensions,
110
+ shader_precision,
111
+ sampler->shader.body,
112
+ FRAGMENT_SHADER_BODY,
113
+ };
114
115
- char *fragment_shader = BuildFragmentShader(filter);
116
- if (!fragment_shader)
117
+ if (renderer->dump_shaders)
118
{
119
- free(vertex_shader);
120
- return VLC_EGENERIC;
121
+ msg_Dbg(filter, "\n=== Vertex shader for fourcc: %4.4s ===\n",
122
+ (const char *) &renderer->sampler->fmt.i_chroma);
123
+ for (unsigned i = 0; i < ARRAY_SIZE(vertex_shader); ++i)
124
+ msg_Dbg(filter, "[%u] %s", i, vertex_shader[i]);
125
+
126
+ msg_Dbg(filter,
127
+ "\n=== Fragment shader for fourcc: %4.4s, colorspace: %d ===\n",
128
+ (const char *) &renderer->sampler->fmt.i_chroma,
129
+ sampler->fmt.space);
130
+ for (unsigned i = 0; i < ARRAY_SIZE(fragment_shader); ++i)
131
+ msg_Dbg(filter, "[%u] %s", i, fragment_shader[i]);
132
}
133
134
assert(sampler->ops &&
135
136
137
GLuint program_id =
138
vlc_gl_BuildProgram(VLC_OBJECT(filter), vt,
139
- 1, (const char **) &vertex_shader,
140
- 1, (const char **) &fragment_shader);
141
- free(vertex_shader);
142
- free(fragment_shader);
143
+ ARRAY_SIZE(vertex_shader), vertex_shader,
144
+ ARRAY_SIZE(fragment_shader), fragment_shader);
145
if (!program_id)
146
return VLC_EGENERIC;
147
148
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/sampler.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/sampler.c
Changed
201
1
2
struct vlc_gl_sampler sampler;
3
4
struct vlc_gl_t *gl;
5
- const opengl_vtable_t *vt;
6
+ const struct vlc_gl_api *api;
7
+ const opengl_vtable_t *vt; /* for convenience, same as &api->vt */
8
9
struct {
10
GLfloat OrientationMatrix[4*4];
11
12
13
GLuint textures[PICTURE_PLANE_MAX];
14
15
+ GLenum tex_target;
16
+
17
struct {
18
unsigned int i_x_offset;
19
unsigned int i_y_offset;
20
21
* - created with _NewFromInterop(), it receives input pictures from VLC
22
* (picture_t) via _UpdatePicture();
23
* - created with _NewFromTexture2D() (interop is NULL), it receives
24
- * directly OpenGL textures via _UpdateTexture().
25
+ * directly OpenGL textures via _UpdateTextures().
26
*/
27
struct vlc_gl_interop *interop;
28
29
/* Only used for "direct" sampler (when interop == NULL) */
30
video_format_t direct_fmt;
31
+
32
+ /* If set, vlc_texture() exposes a single plane (without chroma
33
+ * conversion), selected by vlc_gl_sampler_SetCurrentPlane(). */
34
+ bool expose_planes;
35
+ unsigned plane;
36
};
37
38
#define PRIV(sampler) container_of(sampler, struct vlc_gl_sampler_priv, sampler)
39
40
{
41
struct vlc_gl_sampler_priv *priv = PRIV(sampler);
42
43
- struct vlc_gl_interop *interop = priv->interop;
44
const opengl_vtable_t *vt = priv->vt;
45
46
if (priv->yuv_color)
47
48
vt->GetUniformLocation(program, "OrientationMatrix");
49
assert(priv->uloc.OrientationMatrix != -1);
50
51
- assert(interop->tex_count < 10); /* to guarantee variable names length */
52
- for (unsigned int i = 0; i < interop->tex_count; ++i)
53
+ assert(sampler->tex_count < 10); /* to guarantee variable names length */
54
+ for (unsigned int i = 0; i < sampler->tex_count; ++i)
55
{
56
- char name[sizeof("TexCoordsMapX")];
57
+ char name[sizeof("TexCoordsMaps[X]")];
58
59
- snprintf(name, sizeof(name), "Texture%1u", i);
60
+ snprintf(name, sizeof(name), "Textures[%1u]", i);
61
priv->uloc.Textures[i] = vt->GetUniformLocation(program, name);
62
assert(priv->uloc.Textures[i] != -1);
63
64
- snprintf(name, sizeof(name), "TexCoordsMap%1u", i);
65
+ snprintf(name, sizeof(name), "TexCoordsMaps[%1u]", i);
66
priv->uloc.TexCoordsMaps[i] = vt->GetUniformLocation(program, name);
67
assert(priv->uloc.TexCoordsMaps[i] != -1);
68
69
- if (interop->tex_target == GL_TEXTURE_RECTANGLE)
70
+ if (priv->tex_target == GL_TEXTURE_RECTANGLE)
71
{
72
- snprintf(name, sizeof(name), "TexSize%1u", i);
73
+ snprintf(name, sizeof(name), "TexSizes[%1u]", i);
74
priv->uloc.TexSizes[i] = vt->GetUniformLocation(program, name);
75
assert(priv->uloc.TexSizes[i] != -1);
76
}
77
78
GetTransformMatrix(const struct vlc_gl_interop *interop)
79
{
80
const GLfloat *tm = NULL;
81
- if (interop->ops && interop->ops->get_transform_matrix)
82
+ if (interop && interop->ops && interop->ops->get_transform_matrix)
83
tm = interop->ops->get_transform_matrix(interop);
84
if (!tm)
85
tm = MATRIX4_IDENTITY;
86
87
{
88
struct vlc_gl_sampler_priv *priv = PRIV(sampler);
89
90
- const struct vlc_gl_interop *interop = priv->interop;
91
const opengl_vtable_t *vt = priv->vt;
92
93
if (priv->yuv_color)
94
vt->UniformMatrix4fv(priv->uloc.ConvMatrix, 1, GL_FALSE,
95
priv->conv_matrix);
96
97
- for (unsigned i = 0; i < interop->tex_count; ++i)
98
+ for (unsigned i = 0; i < sampler->tex_count; ++i)
99
{
100
vt->Uniform1i(priv->uloc.Textures[i], i);
101
102
assert(priv->textures[i] != 0);
103
vt->ActiveTexture(GL_TEXTURE0 + i);
104
- vt->BindTexture(interop->tex_target, priv->textures[i]);
105
+ vt->BindTexture(priv->tex_target, priv->textures[i]);
106
107
vt->UniformMatrix3fv(priv->uloc.TexCoordsMaps[i], 1, GL_FALSE,
108
priv->var.TexCoordsMaps[i]);
109
}
110
111
- const GLfloat *tm = GetTransformMatrix(interop);
112
+ /* Return the expected transform matrix if interop == NULL */
113
+ const GLfloat *tm = GetTransformMatrix(priv->interop);
114
vt->UniformMatrix4fv(priv->uloc.TransformMatrix, 1, GL_FALSE, tm);
115
116
vt->UniformMatrix4fv(priv->uloc.OrientationMatrix, 1, GL_FALSE,
117
priv->var.OrientationMatrix);
118
119
- if (interop->tex_target == GL_TEXTURE_RECTANGLE)
120
+ if (priv->tex_target == GL_TEXTURE_RECTANGLE)
121
{
122
- for (unsigned i = 0; i < interop->tex_count; ++i)
123
+ for (unsigned i = 0; i < sampler->tex_count; ++i)
124
vt->Uniform2f(priv->uloc.TexSizes[i], priv->tex_widths[i],
125
priv->tex_heights[i]);
126
}
127
128
struct vlc_gl_sampler_priv *priv = PRIV(sampler);
129
const opengl_vtable_t *vt = priv->vt;
130
131
- priv->uloc.Textures[0] = vt->GetUniformLocation(program, "Texture0");
132
+ priv->uloc.Textures[0] = vt->GetUniformLocation(program, "Textures[0]");
133
assert(priv->uloc.Textures[0] != -1);
134
135
priv->uloc.TransformMatrix =
136
137
assert(priv->uloc.OrientationMatrix != -1);
138
139
priv->uloc.TexCoordsMaps[0] =
140
- vt->GetUniformLocation(program, "TexCoordsMap0");
141
+ vt->GetUniformLocation(program, "TexCoordsMaps[0]");
142
assert(priv->uloc.TexCoordsMaps[0] != -1);
143
}
144
145
146
sampler_xyz12_load(const struct vlc_gl_sampler *sampler)
147
{
148
struct vlc_gl_sampler_priv *priv = PRIV(sampler);
149
- const struct vlc_gl_interop *interop = priv->interop;
150
const opengl_vtable_t *vt = priv->vt;
151
152
vt->Uniform1i(priv->uloc.Textures[0], 0);
153
154
assert(priv->textures[0] != 0);
155
vt->ActiveTexture(GL_TEXTURE0);
156
- vt->BindTexture(interop->tex_target, priv->textures[0]);
157
+ vt->BindTexture(priv->tex_target, priv->textures[0]);
158
159
vt->UniformMatrix3fv(priv->uloc.TexCoordsMaps[0], 1, GL_FALSE,
160
priv->var.TexCoordsMaps[0]);
161
162
- const GLfloat *tm = GetTransformMatrix(interop);
163
+ /* Return the expected transform matrix if interop == NULL */
164
+ const GLfloat *tm = GetTransformMatrix(priv->interop);
165
vt->UniformMatrix4fv(priv->uloc.TransformMatrix, 1, GL_FALSE, tm);
166
167
vt->UniformMatrix4fv(priv->uloc.OrientationMatrix, 1, GL_FALSE,
168
169
* - reverse RGB gamma correction
170
*/
171
static const char *template =
172
- "uniform sampler2D Texture0;"
173
+ "uniform sampler2D Textures[1];"
174
"uniform vec4 xyz_gamma = vec4(2.6);"
175
"uniform vec4 rgb_gamma = vec4(1.0/2.2);"
176
/* WARN: matrix Is filled column by column (not row !) */
177
178
179
"uniform mat4 TransformMatrix;\n"
180
"uniform mat4 OrientationMatrix;\n"
181
- "uniform mat3 TexCoordsMap0;\n"
182
+ "uniform mat3 TexCoordsMaps[1];\n"
183
"vec4 vlc_texture(vec2 pic_coords)\n"
184
"{ "
185
" vec4 v_in, v_out;"
186
/* Homogeneous (oriented) coordinates */
187
" vec3 pic_hcoords = vec3((TransformMatrix * OrientationMatrix * vec4(pic_coords, 0.0, 1.0)).st, 1.0);\n"
188
- " vec2 tex_coords = (TexCoordsMap0 * pic_hcoords).st;\n"
189
- " v_in = texture2D(Texture0, tex_coords);\n"
190
+ " vec2 tex_coords = (TexCoordsMaps[0] * pic_hcoords).st;\n"
191
+ " v_in = texture2D(Textures[0], tex_coords);\n"
192
" v_in = pow(v_in, xyz_gamma);"
193
" v_out = matrix_xyz_rgb * v_in ;"
194
" v_out = pow(v_out, rgb_gamma) ;"
195
196
}
197
198
static int
199
-opengl_init_swizzle(const struct vlc_gl_interop *interop,
200
+opengl_init_swizzle(struct vlc_gl_sampler *sampler,
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/sampler.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/sampler.h
Changed
15
1
2
/* Input format */
3
video_format_t fmt;
4
5
+ /* Number of input planes */
6
+ unsigned tex_count;
7
+
8
+ /* Texture sizes (arrays of tex_count values) */
9
+ const GLsizei *tex_widths;
10
+ const GLsizei *tex_heights;
11
+
12
struct {
13
/**
14
* Piece of fragment shader code declaration OpenGL extensions.
15
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/opengl/sampler_priv.h -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/opengl/sampler_priv.h
Changed
66
1
2
* uploaded them to OpenGL textures.
3
*
4
* \param interop the interop
5
+ * \param expose_planes if set, vlc_texture() exposes a single plane at a time
6
+ * (selected by vlc_gl_sampler_SetCurrentPlane())
7
*/
8
struct vlc_gl_sampler *
9
-vlc_gl_sampler_NewFromInterop(struct vlc_gl_interop *interop);
10
+vlc_gl_sampler_NewFromInterop(struct vlc_gl_interop *interop,
11
+ bool expose_planes);
12
13
/**
14
* Create a new direct sampler
15
16
* \param gl the OpenGL context
17
* \param api the OpenGL API
18
* \param fmt the input format
19
+ * \param expose_planes if set, vlc_texture() exposes a single plane at a time
20
+ * (selected by vlc_gl_sampler_SetCurrentPlane())
21
*/
22
struct vlc_gl_sampler *
23
vlc_gl_sampler_NewFromTexture2D(struct vlc_gl_t *gl,
24
const struct vlc_gl_api *api,
25
- const video_format_t *fmt);
26
+ const video_format_t *fmt, bool expose_planes);
27
28
/**
29
* Delete a sampler
30
31
picture_t *picture);
32
33
/**
34
- * Update the input texture
35
+ * Update the input textures
36
*
37
* Warning: only call on sampler created by vlc_gl_sampler_NewFromTexture2D().
38
*
39
* \param sampler the sampler
40
- * \param texture the new texture, with target GL_TEXTURE_2D
41
- * \param tex_width the texture width
42
- * \param tex_height the texture height
43
+ * \param textures the new textures, with target GL_TEXTURE_2D
44
+ * \param tex_widths the textures width
45
+ * \param tex_heights the textures height
46
*/
47
int
48
-vlc_gl_sampler_UpdateTexture(struct vlc_gl_sampler *sampler, GLuint texture,
49
- GLsizei tex_width, GLsizei tex_height);
50
+vlc_gl_sampler_UpdateTextures(struct vlc_gl_sampler *sampler, GLuint textures[],
51
+ GLsizei tex_widths[], GLsizei tex_heights[]);
52
+
53
+/**
54
+ * Select the plane to expose
55
+ *
56
+ * If the sampler exposes planes separately (for plane filters), select the
57
+ * plane to expose via the GLSL function vlc_texture().
58
+ *
59
+ * \param sampler the sampler
60
+ * \param plane the plane number
61
+ */
62
+void
63
+vlc_gl_sampler_SelectPlane(struct vlc_gl_sampler *sampler, unsigned plane);
64
65
#endif
66
vlc-beta-20210405.f3c7ba5bb3.tar.xz/modules/video_output/win32/direct3d9.c -> vlc-beta-20210430.0b6b242324.tar.xz/modules/video_output/win32/direct3d9.c
Changed
11
1
2
msg_Dbg(vd, "Failed to create the processor (error 0x%lX)", hr);
3
goto error;
4
}
5
+
6
+ free(capsList);
7
+ free(formatsList);
8
IDXVAHD_Device_Release( hd_device );
9
10
SetupProcessorInput(vd, vd->source, d3dfmt);
11
vlc-beta-20210430.0b6b242324.tar.xz/po/.gitignore
Added
9
1
2
+*.gmo
3
+*.header
4
+*.sed
5
+*.sin
6
+POTFILES
7
+Rules-quot
8
+Makevars.template
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/po/Makevars -> vlc-beta-20210430.0b6b242324.tar.xz/po/Makevars
Changed
10
1
2
top_builddir = ..
3
4
# These options get passed to xgettext.
5
-XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=_ANS --keyword=qtr --keyword=Q_ --language=C++ --keyword=vlc_ngettext:1,2 --keyword=vlc_pgettext:1c,2 --add-comments=xgettext: --from-code=UTF-8
6
+XGETTEXT_OPTIONS = --directory=.. --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
7
8
# This is the copyright holder that gets inserted into the header of the
9
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/po/POTFILES.in -> vlc-beta-20210430.0b6b242324.tar.xz/po/POTFILES.in
Changed
69
1
2
modules/codec/cea708.h
3
modules/codec/cvdsub.c
4
modules/codec/daala.c
5
+modules/codec/dav1d.c
6
modules/codec/dca.c
7
modules/codec/ddummy.c
8
modules/codec/dmo/dmo.c
9
10
modules/gui/qt/dialogs/preferences/preferences.hpp
11
modules/gui/qt/dialogs/sout/sout.cpp
12
modules/gui/qt/dialogs/sout/sout.hpp
13
-modules/gui/qt/dialogs/toolbar/toolbareditor.cpp
14
-modules/gui/qt/dialogs/toolbar/toolbareditor.hpp
15
modules/gui/qt/dialogs/vlm/vlm.cpp
16
modules/gui/qt/dialogs/vlm/vlm.hpp
17
modules/gui/qt/dialogs/dialogs_provider.cpp
18
19
modules/gui/qt/dialogs/extensions/extensions_manager.hpp
20
modules/gui/qt/dialogs/playlists/playlists.cpp
21
modules/gui/qt/dialogs/playlists/playlists.hpp
22
+modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
23
+modules/gui/qt/dialogs/toolbar/controlbar_profile_model.hpp
24
modules/gui/qt/maininterface/main_interface.cpp
25
modules/gui/qt/maininterface/main_interface.hpp
26
modules/gui/qt/maininterface/main_interface_win32.cpp
27
28
modules/gui/qt/medialibrary/mlbookmarkmodel.hpp
29
modules/gui/qt/medialibrary/mlfoldersmodel.cpp
30
modules/gui/qt/medialibrary/mlfoldersmodel.hpp
31
+modules/gui/qt/medialibrary/mlgroup.cpp
32
+modules/gui/qt/medialibrary/mlgroup.hpp
33
+modules/gui/qt/medialibrary/mlgrouplistmodel.cpp
34
+modules/gui/qt/medialibrary/mlgrouplistmodel.hpp
35
modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
36
modules/gui/qt/medialibrary/mlplaylistlistmodel.hpp
37
modules/gui/qt/medialibrary/mlplaylistmedia.cpp
38
39
modules/gui/qt/util/singleton.hpp
40
modules/gui/qt/util/validators.cpp
41
modules/gui/qt/util/validators.hpp
42
+modules/gui/qt/player/player_controlbar_model.cpp
43
+modules/gui/qt/player/player_controlbar_model.hpp
44
modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml
45
modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml
46
+modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml
47
modules/gui/qt/dialogs/help/qml/About.qml
48
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
49
+modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml
50
modules/gui/qt/maininterface/qml/BannerSources.qml
51
modules/gui/qt/maininterface/qml/MainDisplay.qml
52
modules/gui/qt/maininterface/qml/MainInterface.qml
53
modules/gui/qt/maininterface/qml/NoMedialibHome.qml
54
modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
55
modules/gui/qt/medialibrary/qml/AudioGridItem.qml
56
+modules/gui/qt/medialibrary/qml/MediaGroupDisplay.qml
57
+modules/gui/qt/medialibrary/qml/MediaGroupList.qml
58
modules/gui/qt/medialibrary/qml/MusicAlbums.qml
59
modules/gui/qt/medialibrary/qml/MusicAlbumsDisplay.qml
60
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
61
62
modules/gui/qt/medialibrary/qml/VideoListDisplay.qml
63
modules/gui/qt/medialibrary/qml/VideoAll.qml
64
modules/gui/qt/medialibrary/qml/VideoAllDisplay.qml
65
+modules/gui/qt/medialibrary/qml/VideoGroupsDisplay.qml
66
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
67
modules/gui/qt/medialibrary/qml/PlaylistMedia.qml
68
modules/gui/qt/medialibrary/qml/PlaylistMediaDelegate.qml
69
vlc-beta-20210430.0b6b242324.tar.xz/share/.gitignore
Added
6
1
2
+vlc.desktop
3
+vlc-*.desktop
4
+vlc.appdata.xml
5
+vlc.appdata.xml.in
6
vlc-beta-20210430.0b6b242324.tar.xz/share/lua/.gitignore
Added
3
1
2
+*.luac
3
vlc-beta-20210430.0b6b242324.tar.xz/src/.gitignore
Added
8
1
2
+test_*
3
+fourcc_gen
4
+fourcc_tables.h
5
+libvlc_win32_rc.rc
6
+revision.c
7
+revision.txt
8
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/clock/clock.h -> vlc-beta-20210430.0b6b242324.tar.xz/src/clock/clock.h
Changed
14
1
2
3
enum vlc_clock_master_source
4
{
5
- VLC_CLOCK_MASTER_AUDIO = 0,
6
+ VLC_CLOCK_MASTER_AUTO= 0,
7
+ VLC_CLOCK_MASTER_AUDIO,
8
+ VLC_CLOCK_MASTER_INPUT,
9
VLC_CLOCK_MASTER_MONOTONIC,
10
- VLC_CLOCK_MASTER_DEFAULT = VLC_CLOCK_MASTER_AUDIO,
11
};
12
13
typedef struct vlc_clock_main_t vlc_clock_main_t;
14
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/clock/input_clock.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/clock/input_clock.c
Changed
99
1
2
/* */
3
struct input_clock_t
4
{
5
+ vlc_clock_t *clock_listener;
6
+
7
/* Last point
8
* It is used to detect unexpected stream discontinuities */
9
clock_point_t last;
10
11
12
static vlc_tick_t ClockGetTsOffset( input_clock_t * );
13
14
+static void UpdateListener( input_clock_t *cl )
15
+{
16
+ if( cl->clock_listener )
17
+ {
18
+ const vlc_tick_t system_expected =
19
+ ClockStreamToSystem( cl, cl->last.stream + AvgGet( &cl->drift ) ) +
20
+ cl->i_pts_delay + ClockGetTsOffset( cl );
21
+
22
+ vlc_clock_Update( cl->clock_listener, system_expected, cl->last.stream, cl->rate );
23
+ }
24
+}
25
+
26
/*****************************************************************************
27
* input_clock_New: create a new clock
28
*****************************************************************************/
29
-input_clock_t *input_clock_New( float rate )
30
+input_clock_t *input_clock_New( vlc_clock_t *clock_listener, float rate )
31
{
32
input_clock_t *cl = malloc( sizeof(*cl) );
33
if( !cl )
34
+ {
35
+ if( cl->clock_listener )
36
+ vlc_clock_Delete( cl->clock_listener );
37
return NULL;
38
+ }
39
+
40
+ cl->clock_listener = clock_listener;
41
42
cl->b_has_reference = false;
43
cl->ref = clock_point_Create( VLC_TICK_INVALID, VLC_TICK_INVALID );
44
45
void input_clock_Delete( input_clock_t *cl )
46
{
47
AvgClean( &cl->drift );
48
+ if( cl->clock_listener )
49
+ vlc_clock_Delete( cl->clock_listener );
50
free( cl );
51
}
52
53
54
cl->late.i_index = ( cl->late.i_index + 1 ) % INPUT_CLOCK_LATE_COUNT;
55
}
56
57
+ UpdateListener( cl );
58
+
59
return i_late;
60
}
61
62
63
cl->b_has_reference = false;
64
cl->ref = clock_point_Create( VLC_TICK_INVALID, VLC_TICK_INVALID );
65
cl->b_has_external_clock = false;
66
+
67
+ if( cl->clock_listener )
68
+ vlc_clock_Reset( cl->clock_listener );
69
}
70
71
/*****************************************************************************
72
73
cl->ref.system = cl->last.system - (vlc_tick_t) ((cl->last.system - cl->ref.system) / rate * cl->rate);
74
}
75
cl->rate = rate;
76
+
77
+ UpdateListener( cl );
78
}
79
80
/*****************************************************************************
81
82
{
83
cl->ref.system += i_duration;
84
cl->last.system += i_duration;
85
+
86
+ UpdateListener( cl );
87
}
88
}
89
cl->i_pause_date = i_date;
90
91
92
cl->ref.system += i_offset;
93
cl->last.system += i_offset;
94
+
95
+ UpdateListener( cl );
96
}
97
98
void input_clock_GetSystemOrigin( input_clock_t *cl, vlc_tick_t *pi_system, vlc_tick_t *pi_delay )
99
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/clock/input_clock.h -> vlc-beta-20210430.0b6b242324.tar.xz/src/clock/input_clock.h
Changed
24
1
2
3
#include <vlc_common.h>
4
#include <vlc_input.h> /* FIXME Needed for input_clock_t */
5
+#include "clock.h"
6
7
/** @struct input_clock_t
8
* This structure is used to manage clock drift and reception jitters
9
10
11
/**
12
* This function creates a new input_clock_t.
13
+ *
14
+ * \param clock_listener clock created with vlc_clock_main_CreateMaster(). If
15
+ * valid, the input_clock_t will take ownership of this clock and drive the
16
+ * main clock.
17
* You must use input_clock_Delete to delete it once unused.
18
*/
19
-input_clock_t *input_clock_New( float rate );
20
+input_clock_t *input_clock_New( vlc_clock_t *clock_listener, float rate );
21
22
/**
23
* This function destroys a input_clock_t created by input_clock_New.
24
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/input/es_out.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/input/es_out.c
Changed
165
1
2
/* Clock for this program */
3
input_clock_t *p_input_clock;
4
vlc_clock_main_t *p_main_clock;
5
- vlc_clock_t *p_master_clock;
6
+ const vlc_clock_t *p_master_clock;
7
8
vlc_tick_t i_last_pcr;
9
10
11
struct vlc_list programs;
12
es_out_pgrm_t *p_pgrm; /* Master program */
13
14
- enum es_format_category_e i_master_source_cat;
15
+ enum vlc_clock_master_source clock_source;
16
17
/* all es */
18
int i_id;
19
20
static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm );
21
static char *EsInfoCategoryName( es_out_id_t* es );
22
23
+struct clock_source_mapping
24
+{
25
+ char key[sizeof("monotonic")];
26
+ enum vlc_clock_master_source val;
27
+};
28
+
29
+static int clock_source_mapping_cmp(const void *key, const void *val)
30
+{
31
+ const struct clock_source_mapping *entry = val;
32
+ return strcasecmp( key, entry->key );
33
+}
34
+
35
+static enum vlc_clock_master_source
36
+clock_source_Inherit(vlc_object_t *obj)
37
+{
38
+ static const struct clock_source_mapping clock_source_list[] =
39
+ {
40
+ { "0", VLC_CLOCK_MASTER_AUDIO }, /* legacy option */
41
+ { "1", VLC_CLOCK_MASTER_MONOTONIC }, /* legacy option */
42
+ { "audio", VLC_CLOCK_MASTER_AUDIO },
43
+ { "auto", VLC_CLOCK_MASTER_AUTO },
44
+ { "input", VLC_CLOCK_MASTER_INPUT },
45
+ { "monotonic", VLC_CLOCK_MASTER_MONOTONIC },
46
+ };
47
+
48
+ char *master_source_str = var_InheritString(obj, "clock-master");
49
+ if (master_source_str == NULL)
50
+ goto default_val;
51
+
52
+ const struct clock_source_mapping *entry =
53
+ bsearch(master_source_str, clock_source_list, ARRAY_SIZE(clock_source_list),
54
+ sizeof (*clock_source_list), clock_source_mapping_cmp);
55
+ free(master_source_str);
56
+ if (entry == NULL)
57
+ goto default_val;
58
+
59
+ return entry->val;
60
+
61
+default_val:
62
+ return VLC_CLOCK_MASTER_AUTO;
63
+}
64
+
65
static inline int EsOutGetClosedCaptionsChannel( const es_format_t *p_fmt )
66
{
67
int i_channel;
68
69
70
p_sys->i_group_id = var_GetInteger( p_input, "program" );
71
72
- enum vlc_clock_master_source master_source =
73
- var_InheritInteger( p_input, "clock-master" );
74
- switch( master_source )
75
- {
76
- case VLC_CLOCK_MASTER_AUDIO:
77
- p_sys->i_master_source_cat = AUDIO_ES;
78
- break;
79
- case VLC_CLOCK_MASTER_MONOTONIC:
80
- default:
81
- p_sys->i_master_source_cat = UNKNOWN_ES;
82
- break;
83
- }
84
+ p_sys->clock_source = clock_source_Inherit( VLC_OBJECT(p_input) );
85
86
p_sys->i_pause_date = -1;
87
88
89
{
90
es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
91
input_thread_t *p_input = p_sys->p_input;
92
+ input_thread_private_t *priv = input_priv(p_input);
93
94
/* Sticky groups will be attached to any existing programs, no need to
95
* create one. */
96
97
p_pgrm->p_meta = NULL;
98
99
p_pgrm->p_master_clock = NULL;
100
- p_pgrm->p_input_clock = input_clock_New( p_sys->rate );
101
+
102
p_pgrm->p_main_clock = vlc_clock_main_New();
103
- if( !p_pgrm->p_input_clock || !p_pgrm->p_main_clock )
104
+ if( !p_pgrm->p_main_clock )
105
{
106
- if( p_pgrm->p_input_clock )
107
- input_clock_Delete( p_pgrm->p_input_clock );
108
free( p_pgrm );
109
return NULL;
110
}
111
+
112
+ vlc_clock_t *p_master_clock = NULL;
113
+ switch( p_sys->clock_source )
114
+ {
115
+ case VLC_CLOCK_MASTER_AUTO:
116
+ if (priv->b_can_pace_control)
117
+ break;
118
+ msg_Dbg( p_input, "The input can't pace, selecting the input (PCR) as the "
119
+ "clock source" );
120
+ /* Fall-through */
121
+ case VLC_CLOCK_MASTER_INPUT:
122
+ p_pgrm->p_master_clock = p_master_clock =
123
+ vlc_clock_main_CreateMaster( p_pgrm->p_main_clock, NULL, NULL );
124
+ break;
125
+ default:
126
+ break;
127
+ }
128
+
129
+ p_pgrm->p_input_clock = input_clock_New( p_master_clock, p_sys->rate );
130
+ if( !p_pgrm->p_input_clock )
131
+ {
132
+ vlc_clock_main_Delete( p_pgrm->p_main_clock );
133
+ free( p_pgrm );
134
+ return NULL;
135
+ }
136
+
137
if( p_sys->b_paused )
138
input_clock_ChangePause( p_pgrm->p_input_clock, p_sys->b_paused, p_sys->i_pause_date );
139
const vlc_tick_t pts_delay = p_sys->i_pts_delay + p_sys->i_pts_jitter
140
141
142
assert( p_es->p_pgrm );
143
144
+ enum es_format_category_e clock_source_cat;
145
+ switch( p_sys->clock_source )
146
+ {
147
+ case VLC_CLOCK_MASTER_AUTO:
148
+ case VLC_CLOCK_MASTER_AUDIO:
149
+ clock_source_cat = AUDIO_ES;
150
+ break;
151
+ case VLC_CLOCK_MASTER_MONOTONIC:
152
+ case VLC_CLOCK_MASTER_INPUT:
153
+ clock_source_cat = UNKNOWN_ES;
154
+ break;
155
+ default:
156
+ vlc_assert_unreachable();
157
+ }
158
+
159
if( p_es->fmt.i_cat != UNKNOWN_ES
160
- && p_es->fmt.i_cat == p_sys->i_master_source_cat
161
+ && p_es->fmt.i_cat == clock_source_cat
162
&& p_es->p_pgrm->p_master_clock == NULL )
163
{
164
p_es->master = true;
165
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/input/input.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/input/input.c
Changed
49
1
2
if( uri == NULL )
3
continue;
4
5
+ vlc_url_t parsed_uri;
6
+ if ( vlc_UrlParse( &parsed_uri, uri ) != VLC_SUCCESS )
7
+ {
8
+ msg_Err( p_input,
9
+ "Invalid url passed to the \"input-slave\" option" );
10
+ vlc_UrlClean( &parsed_uri );
11
+ free( uri );
12
+ continue;
13
+ }
14
+
15
enum slave_type i_type;
16
- if ( !input_item_slave_GetType(uri, &i_type) )
17
+ if ( !input_item_slave_GetType( parsed_uri.psz_path, &i_type ) )
18
{
19
msg_Warn( p_input,
20
"Can't deduce slave type of `%s\" with file extension.",
21
22
input_item_slave_t *p_slave =
23
input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER );
24
25
+ vlc_UrlClean( &parsed_uri );
26
free( uri );
27
28
if( unlikely( p_slave == NULL ) )
29
30
free( psz_autopath );
31
}
32
33
+ /* Add slaves from the "input-slave" option */
34
+ GetVarSlaves( p_input, &pp_slaves, &i_slaves );
35
+
36
/* Add slaves found by the directory demuxer or via libvlc */
37
input_item_t *p_item = input_priv(p_input)->p_item;
38
vlc_mutex_lock( &p_item->lock );
39
40
TAB_CLEAN( p_item->i_slaves, p_item->pp_slaves );
41
vlc_mutex_unlock( &p_item->lock );
42
43
- /* Add slaves from the "input-slave" option */
44
- GetVarSlaves( p_input, &pp_slaves, &i_slaves );
45
-
46
if( i_slaves > 0 )
47
qsort( pp_slaves, i_slaves, sizeof (input_item_slave_t*),
48
SlaveCompare );
49
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/input/input_internal.h -> vlc-beta-20210430.0b6b242324.tar.xz/src/input/input_internal.h
Changed
12
1
2
3
struct vlc_input_event_times
4
{
5
- float percentage;
6
- vlc_tick_t ms;
7
+ float position;
8
+ vlc_tick_t time;
9
vlc_tick_t normal_time;
10
vlc_tick_t length;
11
};
12
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/input/vlm.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/input/vlm.c
Changed
9
1
2
break;
3
}
4
}
5
- assert(psz_instance_name);
6
enum vlm_state_e vlm_state;
7
switch (new_state)
8
{
9
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/libvlc-module.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/libvlc-module.c
Changed
201
1
2
"algorithms should try to compensate (in milliseconds)." )
3
4
#define CLOCK_MASTER_TEXT N_("Clock master source")
5
+#define CLOCK_MASTER_LONGTEXT N_( "Select the clock master source:\n" \
6
+ "auto: best clock source, input if the access can't be paced " \
7
+ "(when playing live content), or audio otherwise (most likely).\n" \
8
+ "input: all tracks are driven by the input clock, via PCR updates " \
9
+ "from the demuxer. This restore the VLC 3.0 clock behavior where both audio " \
10
+ "and video tracks can be altered to catch up with the input.\n" \
11
+ "audio: if an audio track is playing, the audio output will drive the " \
12
+ "clock (Fallback to Monotonic if there is no audio tracks).\n" \
13
+ "monotonic: all tracks are driven by the monotonic clock of the system.")
14
15
-static const int pi_clock_master_values[] = {
16
- VLC_CLOCK_MASTER_AUDIO,
17
- VLC_CLOCK_MASTER_MONOTONIC,
18
+static const char *const ppsz_clock_master_values[] = {
19
+ "auto", "input", "audio", "monotonic",
20
};
21
static const char *const ppsz_clock_master_descriptions[] = {
22
+ N_("Auto"),
23
+ N_("Input (PCR)"),
24
N_("Audio"),
25
N_("Monotonic")
26
};
27
28
29
// DEPRECATED
30
#define CODEC_CAT_LONGTEXT N_( \
31
- "This option can be used to alter the way VLC selects " \
32
- "its codecs (decompression methods). Only advanced users should " \
33
- "alter this option as it can break playback of all your streams." )
34
+ "These options allow you to control the preferred modules used for " \
35
+ "accessing, demuxing and decoding (or encoding) inputs." )
36
37
#define CODEC_TEXT N_("Preferred decoders list")
38
#define CODEC_LONGTEXT N_( \
39
40
* Advanced
41
****************************************************************************/
42
43
-// DEPRECATED
44
-#define MISC_CAT_LONGTEXT N_( \
45
- "These options allow you to select default modules. Leave these " \
46
- "alone unless you really know what you are doing." )
47
-
48
#define ACCESS_TEXT N_("Access module")
49
#define ACCESS_LONGTEXT N_( \
50
"This allows you to force an access module. You can use it if " \
51
52
*/
53
54
vlc_module_begin ()
55
+ set_description( N_("core program") )
56
+
57
/* Audio options */
58
set_category( CAT_AUDIO )
59
set_subcategory( SUBCAT_AUDIO_GENERAL )
60
61
/* Input options */
62
set_category( CAT_INPUT )
63
set_subcategory( SUBCAT_INPUT_GENERAL )
64
+ add_category_hint( N_("Input"), INPUT_CAT_LONGTEXT )
65
66
set_section( N_( "Track settings" ), NULL )
67
add_integer( "program", 0,
68
69
add_integer( "clock-jitter", 5000, CLOCK_JITTER_TEXT,
70
CLOCK_JITTER_LONGTEXT, true )
71
change_safe()
72
- add_integer( "clock-master", VLC_CLOCK_MASTER_DEFAULT,
73
- CLOCK_MASTER_TEXT, NULL, true )
74
- change_integer_list( pi_clock_master_values, ppsz_clock_master_descriptions )
75
+ add_string( "clock-master", "auto",
76
+ CLOCK_MASTER_TEXT, CLOCK_MASTER_LONGTEXT, true )
77
+ change_string_list( ppsz_clock_master_values, ppsz_clock_master_descriptions )
78
79
add_directory("input-record-path", NULL,
80
INPUT_RECORD_PATH_TEXT, INPUT_RECORD_PATH_LONGTEXT)
81
82
add_string( "input-title-format", "$Z", INPUT_TITLE_FORMAT_TEXT, INPUT_TITLE_FORMAT_LONGTEXT, false );
83
84
/* Decoder options */
85
- set_subcategory( SUBCAT_INPUT_VCODEC )
86
- add_category_hint(N_("Decoders"), CODEC_CAT_LONGTEXT)
87
- add_string( "codec", NULL, CODEC_TEXT,
88
- CODEC_LONGTEXT, true )
89
- add_bool( "hw-dec", true, HW_DEC_TEXT, HW_DEC_LONGTEXT, true )
90
- add_obsolete_string( "encoder" ) /* since 4.0.0 */
91
- add_module("dec-dev", "decoder device", "any", DEC_DEV_TEXT, DEC_DEV_LONGTEXT)
92
-
93
+ add_category_hint(N_("Input access and codecs"), CODEC_CAT_LONGTEXT)
94
set_subcategory( SUBCAT_INPUT_ACCESS )
95
- add_category_hint(N_("Input"), INPUT_CAT_LONGTEXT)
96
+
97
add_module("access", "access", NULL, ACCESS_TEXT, ACCESS_LONGTEXT)
98
99
set_subcategory( SUBCAT_INPUT_DEMUX )
100
+
101
add_module("demux", "demux", "any", DEMUX_TEXT, DEMUX_LONGTEXT)
102
+ add_string( "demux-filter", NULL, DEMUX_FILTER_TEXT, DEMUX_FILTER_LONGTEXT, true )
103
+
104
set_subcategory( SUBCAT_INPUT_ACODEC )
105
+ set_subcategory( SUBCAT_INPUT_VCODEC )
106
+
107
+ add_string( "codec", NULL, CODEC_TEXT, CODEC_LONGTEXT, true )
108
+ add_bool( "hw-dec", true, HW_DEC_TEXT, HW_DEC_LONGTEXT, true )
109
+ add_obsolete_string( "encoder" ) /* since 4.0.0 */
110
+ add_module("dec-dev", "decoder device", "any", DEC_DEV_TEXT, DEC_DEV_LONGTEXT)
111
+
112
set_subcategory( SUBCAT_INPUT_SCODEC )
113
+
114
add_obsolete_bool( "prefer-system-codecs" )
115
116
set_subcategory( SUBCAT_INPUT_STREAM_FILTER )
117
+
118
add_module_list("stream-filter", "stream_filter", NULL,
119
STREAM_FILTER_TEXT, STREAM_FILTER_LONGTEXT)
120
121
- add_string( "demux-filter", NULL, DEMUX_FILTER_TEXT, DEMUX_FILTER_LONGTEXT, true )
122
-
123
/* Stream output options */
124
set_category( CAT_SOUT )
125
set_subcategory( SUBCAT_SOUT_GENERAL )
126
127
add_obsolete_bool( "altivec" ) /* since 2.0.0 */
128
#endif
129
130
-/* Misc options */
131
+/* Advanced options */
132
set_subcategory( SUBCAT_ADVANCED_MISC )
133
+ add_category_hint(N_("Advanced"), NULL)
134
set_section( N_("Special modules"), NULL )
135
- add_category_hint(N_("Miscellaneous"), MISC_CAT_LONGTEXT)
136
add_module("vod-server", "vod server", NULL,
137
VOD_SERVER_TEXT, VOD_SERVER_LONGTEXT)
138
139
140
add_string( "services-discovery", "", SD_TEXT, SD_LONGTEXT, true )
141
change_short('S')
142
143
+ /* HACK so these don't get displayed in the GUI */
144
+ set_subcategory( -1 )
145
+ set_section(N_("Bookmarks"), NULL)
146
+ add_string( "bookmark1", NULL,
147
+ BOOKMARK1_TEXT, BOOKMARK_LONGTEXT, false )
148
+ add_string( "bookmark2", NULL,
149
+ BOOKMARK2_TEXT, BOOKMARK_LONGTEXT, false )
150
+ add_string( "bookmark3", NULL,
151
+ BOOKMARK3_TEXT, BOOKMARK_LONGTEXT, false )
152
+ add_string( "bookmark4", NULL,
153
+ BOOKMARK4_TEXT, BOOKMARK_LONGTEXT, false )
154
+ add_string( "bookmark5", NULL,
155
+ BOOKMARK5_TEXT, BOOKMARK_LONGTEXT, false )
156
+ add_string( "bookmark6", NULL,
157
+ BOOKMARK6_TEXT, BOOKMARK_LONGTEXT, false )
158
+ add_string( "bookmark7", NULL,
159
+ BOOKMARK7_TEXT, BOOKMARK_LONGTEXT, false )
160
+ add_string( "bookmark8", NULL,
161
+ BOOKMARK8_TEXT, BOOKMARK_LONGTEXT, false )
162
+ add_string( "bookmark9", NULL,
163
+ BOOKMARK9_TEXT, BOOKMARK_LONGTEXT, false )
164
+ add_string( "bookmark10", NULL,
165
+ BOOKMARK10_TEXT, BOOKMARK_LONGTEXT, false )
166
+
167
/* Interface options */
168
set_category( CAT_INTERFACE )
169
set_subcategory( SUBCAT_INTERFACE_GENERAL )
170
+ add_category_hint( N_("Interface"), INTF_CAT_LONGTEXT )
171
add_integer( "verbose", 0, VERBOSE_TEXT, VERBOSE_LONGTEXT,
172
false )
173
change_short('v')
174
175
add_integer( "long-jump-size", 300, JILONG_TEXT,
176
JILONG_LONGTEXT, false )
177
178
- /* HACK so these don't get displayed */
179
- set_category( -1 )
180
- set_subcategory( -1 )
181
+ set_section ( N_("Bookmarks"), NULL )
182
add_key("key-set-bookmark1", KEY_SET_BOOKMARK1,
183
SET_BOOKMARK1_KEY_TEXT, SET_BOOKMARK_KEY_LONGTEXT)
184
add_key("key-set-bookmark2", KEY_SET_BOOKMARK2,
185
186
add_key("key-subtitle-text-scale-down", KEY_SUBTEXT_SCALEDOWN,
187
SUBTEXT_SCALEDOWN_KEY_TEXT, SUBTEXT_SCALE_KEY_LONGTEXT)
188
189
- add_string( "bookmark1", NULL,
190
- BOOKMARK1_TEXT, BOOKMARK_LONGTEXT, false )
191
- add_string( "bookmark2", NULL,
192
- BOOKMARK2_TEXT, BOOKMARK_LONGTEXT, false )
193
- add_string( "bookmark3", NULL,
194
- BOOKMARK3_TEXT, BOOKMARK_LONGTEXT, false )
195
- add_string( "bookmark4", NULL,
196
- BOOKMARK4_TEXT, BOOKMARK_LONGTEXT, false )
197
- add_string( "bookmark5", NULL,
198
- BOOKMARK5_TEXT, BOOKMARK_LONGTEXT, false )
199
- add_string( "bookmark6", NULL,
200
- BOOKMARK6_TEXT, BOOKMARK_LONGTEXT, false )
201
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/libvlccore.sym -> vlc-beta-20210430.0b6b242324.tar.xz/src/libvlccore.sym
Changed
17
1
2
vlc_ml_genre_release
3
vlc_ml_media_release
4
vlc_ml_album_release
5
+vlc_ml_group_release
6
vlc_ml_playlist_release
7
vlc_ml_label_list_release
8
vlc_ml_file_list_release
9
10
vlc_ml_album_list_release
11
vlc_ml_show_list_release
12
vlc_ml_genre_list_release
13
+vlc_ml_group_list_release
14
vlc_ml_playlist_list_release
15
vlc_ml_entry_point_list_release
16
vlc_ml_bookmark_release
17
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/misc/block.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/misc/block.c
Changed
10
1
2
3
block_t *block_Alloc (size_t size)
4
{
5
- if (unlikely(size >> 27))
6
+ if (unlikely(size >> 28))
7
{
8
errno = ENOBUFS;
9
return NULL;
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/misc/medialibrary.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/misc/medialibrary.c
Changed
48
1
2
free( p_genre );
3
}
4
5
+//-------------------------------------------------------------------------------------------------
6
+// Group
7
+
8
+static void vlc_ml_group_release_inner( vlc_ml_group_t* p_group )
9
+{
10
+ free( p_group->psz_name );
11
+}
12
+
13
+void vlc_ml_group_release( vlc_ml_group_t* p_group )
14
+{
15
+ if ( p_group == NULL )
16
+ return;
17
+ vlc_ml_group_release_inner( p_group );
18
+ free( p_group );
19
+}
20
+
21
+//-------------------------------------------------------------------------------------------------
22
+
23
static void vlc_ml_playlist_release_inner( vlc_ml_playlist_t* p_playlist )
24
{
25
- free( p_playlist->psz_artwork_mrl );
26
free( p_playlist->psz_name );
27
+ free( p_playlist->psz_mrl );
28
+ free( p_playlist->psz_artwork_mrl );
29
}
30
31
void vlc_ml_playlist_release( vlc_ml_playlist_t* p_playlist )
32
33
free( p_list );
34
}
35
36
+void vlc_ml_group_list_release( vlc_ml_group_list_t* p_list )
37
+{
38
+ if ( p_list == NULL )
39
+ return;
40
+ for ( size_t i = 0; i < p_list->i_nb_items; ++i )
41
+ vlc_ml_group_release_inner( &p_list->p_items[i] );
42
+ free( p_list );
43
+}
44
+
45
void vlc_ml_playlist_list_release( vlc_ml_playlist_list_t* p_list )
46
{
47
if ( p_list == NULL )
48
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/misc/picture.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/misc/picture.c
Changed
27
1
2
picture_t *clone = picture_NewFromResource(&picture->format, &res);
3
if (likely(clone != NULL)) {
4
((picture_priv_t *)clone)->gc.opaque = opaque;
5
+
6
+ /* The picture context is responsible for potentially holding the
7
+ * video context attached to the picture if needed. */
8
+ if (picture->context != NULL)
9
+ clone->context = picture->context->copy(picture->context);
10
+
11
picture_Hold(picture);
12
}
13
+
14
return clone;
15
}
16
17
picture_t *picture_Clone(picture_t *picture)
18
{
19
picture_t *clone = picture_InternalClone(picture, picture_DestroyClone, picture);
20
- if (likely(clone != NULL)) {
21
- if (picture->context != NULL)
22
- clone->context = picture->context->copy(picture->context);
23
- }
24
return clone;
25
}
26
27
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/misc/update_crypto.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/misc/update_crypto.c
Changed
88
1
2
#define packet_header_len( c ) ( ( c & 0x03 ) + 1 ) /* number of bytes in a packet header */
3
4
5
-static inline int scalar_number( const uint8_t *p, int header_len )
6
+static inline uint32_t scalar_number( const uint8_t *p, int header_len )
7
{
8
assert( header_len == 1 || header_len == 2 || header_len == 4 );
9
10
11
else if( header_len == 2 )
12
return( (p[0] << 8) + p[1] );
13
else if( header_len == 4 )
14
- return( (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3] );
15
+ return( ((uint32_t)p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3] );
16
else
17
abort();
18
}
19
20
21
/* number of data bytes in a MPI */
22
-static int mpi_len(const uint8_t *mpi)
23
+static uint32_t mpi_len(const uint8_t *mpi)
24
{
25
return (scalar_number(mpi, 2) + 7) / 8;
26
}
27
28
gcry_sexp_t key_sexp, hash_sexp, sig_sexp;
29
key_sexp = hash_sexp = sig_sexp = NULL;
30
31
- int i_n_len = mpi_len( p_key->sig.rsa.n );
32
- int i_e_len = mpi_len( p_key->sig.rsa.e );
33
+ size_t i_e_len = mpi_len( p_key->sig.rsa.e );
34
+ size_t i_n_len = mpi_len( p_key->sig.rsa.n );
35
if( gcry_mpi_scan( &n, GCRYMPI_FMT_USG, p_key->sig.rsa.n + 2, i_n_len, NULL ) ||
36
gcry_mpi_scan( &e, GCRYMPI_FMT_USG, p_key->sig.rsa.e + 2, i_e_len, NULL ) ||
37
gcry_sexp_build( &key_sexp, &erroff, key_sexp_s, n, e ) )
38
goto out;
39
40
uint8_t *p_s = sign->algo_specific.rsa.s;
41
- int i_s_len = mpi_len( p_s );
42
+ size_t i_s_len = mpi_len( p_s );
43
if( gcry_mpi_scan( &s, GCRYMPI_FMT_USG, p_s + 2, i_s_len, NULL ) ||
44
gcry_sexp_build( &sig_sexp, &erroff, sig_sexp_s, s ) )
45
goto out;
46
47
gcry_sexp_t key_sexp, hash_sexp, sig_sexp;
48
key_sexp = hash_sexp = sig_sexp = NULL;
49
50
- int i_p_len = mpi_len( p_key->sig.dsa.p );
51
- int i_q_len = mpi_len( p_key->sig.dsa.q );
52
- int i_g_len = mpi_len( p_key->sig.dsa.g );
53
- int i_y_len = mpi_len( p_key->sig.dsa.y );
54
+ size_t i_p_len = mpi_len( p_key->sig.dsa.p );
55
+ size_t i_q_len = mpi_len( p_key->sig.dsa.q );
56
+ size_t i_g_len = mpi_len( p_key->sig.dsa.g );
57
+ size_t i_y_len = mpi_len( p_key->sig.dsa.y );
58
if( gcry_mpi_scan( &p, GCRYMPI_FMT_USG, p_key->sig.dsa.p + 2, i_p_len, NULL ) ||
59
gcry_mpi_scan( &q, GCRYMPI_FMT_USG, p_key->sig.dsa.q + 2, i_q_len, NULL ) ||
60
gcry_mpi_scan( &g, GCRYMPI_FMT_USG, p_key->sig.dsa.g + 2, i_g_len, NULL ) ||
61
62
63
uint8_t *p_r = sign->algo_specific.dsa.r;
64
uint8_t *p_s = sign->algo_specific.dsa.s;
65
- int i_r_len = mpi_len( p_r );
66
- int i_s_len = mpi_len( p_s );
67
+ size_t i_r_len = mpi_len( p_r );
68
+ size_t i_s_len = mpi_len( p_s );
69
if( gcry_mpi_scan( &r, GCRYMPI_FMT_USG, p_r + 2, i_r_len, NULL ) ||
70
gcry_mpi_scan( &s, GCRYMPI_FMT_USG, p_s + 2, i_s_len, NULL ) ||
71
gcry_sexp_build( &sig_sexp, &erroff, sig_sexp_s, r, s ) )
72
goto out;
73
74
- int i_hash_len = gcry_md_get_algo_dlen (sign->digest_algo);
75
+ unsigned int i_hash_len = gcry_md_get_algo_dlen (sign->digest_algo);
76
if (i_hash_len > i_q_len)
77
i_hash_len = i_q_len;
78
if( gcry_mpi_scan( &hash, GCRYMPI_FMT_USG, p_hash, i_hash_len, NULL ) ||
79
80
( i_header_len != 1 && i_header_len != 2 && i_header_len != 4 ) )
81
goto error;
82
83
- int i_packet_len = scalar_number( pos, i_header_len );
84
+ size_t i_packet_len = scalar_number( pos, i_header_len );
85
pos += i_header_len;
86
87
if( pos + i_packet_len > max_pos )
88
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/player/input.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/player/input.c
Changed
19
1
2
bool changed = false;
3
vlc_tick_t system_date = VLC_TICK_INVALID;
4
5
- if (event->times.ms != VLC_TICK_INVALID
6
- && (input->time != event->times.ms
7
- || input->position != event->times.percentage))
8
+ if (event->times.time != VLC_TICK_INVALID
9
+ && (input->time != event->times.time
10
+ || input->position != event->times.position))
11
{
12
- input->time = event->times.ms;
13
- input->position = event->times.percentage;
14
+ input->time = event->times.time;
15
+ input->position = event->times.position;
16
system_date = vlc_tick_now();
17
changed = true;
18
vlc_player_SendEvent(player, on_position_changed,
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/posix/thread.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/posix/thread.c
Changed
10
1
2
count = sysconf (_SC_NPROCESSORS_ONLN);
3
free (cpulist);
4
return count ? count : 1;
5
+#elif defined(_SC_NPROCESSORS_ONLN)
6
+ return sysconf(_SC_NPROCESSORS_ONLN);
7
#elif defined(_SC_NPROCESSORS_CONF)
8
return sysconf(_SC_NPROCESSORS_CONF);
9
#else
10
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/test/thread.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/test/thread.c
Changed
19
1
2
static void *thread_func_tick_sleep(void *data)
3
{
4
assert(data == &thread_data_magic);
5
- vlc_tick_sleep(VLC_TICK_FROM_SEC(10));
6
+ (vlc_tick_sleep)(VLC_TICK_FROM_SEC(10));
7
return &thread_return_magic;
8
}
9
10
11
{
12
vlc_tick_t now = vlc_tick_now();
13
14
- vlc_tick_sleep(VLC_TICK_FROM_MS(25));
15
+ (vlc_tick_sleep)(VLC_TICK_FROM_MS(25));
16
17
vlc_tick_t elapsed = vlc_tick_now() - now;
18
assert(elapsed >= VLC_TICK_FROM_MS(25));
19
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/video_output/display.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/video_output/display.c
Changed
30
1
2
const video_format_t *source,
3
const vout_display_cfg_t *cfg)
4
{
5
+ bool from_source = true;
6
/* Requested by the user */
7
if (cfg->display.width != 0 && cfg->display.height != 0) {
8
*width = cfg->display.width;
9
10
else if (cfg->window_props.width != 0 && cfg->window_props.height != 0) {
11
*width = cfg->window_props.width;
12
*height = cfg->window_props.height;
13
+ /* The dimensions are not initialized from the source format */
14
+ from_source = false;
15
}
16
/* Use the original video size */
17
else if (source->i_sar_num >= source->i_sar_den) {
18
19
*width = *width * cfg->zoom.num / cfg->zoom.den;
20
*height = *height * cfg->zoom.num / cfg->zoom.den;
21
22
- if (ORIENT_IS_SWAP(source->orientation)) {
23
-
24
+ if (from_source && ORIENT_IS_SWAP(source->orientation)) {
25
+ /* Apply the source orientation only if the dimensions are initialized
26
+ * from the source format */
27
unsigned store = *width;
28
*width = *height;
29
*height = store;
30
vlc-beta-20210405.f3c7ba5bb3.tar.xz/src/video_output/video_output.c -> vlc-beta-20210430.0b6b242324.tar.xz/src/video_output/video_output.c
Changed
33
1
2
vlc_mutex_lock(&sys->display_lock);
3
4
/*
5
- * Get the subpicture to be displayed
6
+ * Get the rendering date for the current subpicture to be displayed.
7
*/
8
- const bool do_snapshot = vout_snapshot_IsRequested(sys->snapshot);
9
vlc_tick_t system_now = vlc_tick_now();
10
vlc_tick_t render_subtitle_date;
11
if (sys->pause.is_on)
12
13
}
14
15
/*
16
- * Get the subpicture to be displayed
17
+ * Check whether we let the display draw the subpicture itself (when
18
+ * do_dr_spu=true), and if we can fallback to blending the subpicture
19
+ * ourselves (do_early_spu=true).
20
*/
21
+ const bool do_snapshot = vout_snapshot_IsRequested(sys->snapshot);
22
const bool do_dr_spu = !do_snapshot &&
23
vd->info.subpicture_chromas &&
24
*vd->info.subpicture_chromas != 0;
25
26
}
27
}
28
29
+ /* Get the subpicture to be displayed. */
30
video_format_t fmt_spu_rot;
31
video_format_ApplyRotation(&fmt_spu_rot, &fmt_spu);
32
subpicture_t *subpic = !sys->spu ? NULL :
33
vlc-beta-20210430.0b6b242324.tar.xz/test/.gitignore
Added
3
1
2
+test_*
3
vlc-beta-20210405.f3c7ba5bb3.tar.xz/test/Makefile.am -> vlc-beta-20210430.0b6b242324.tar.xz/test/Makefile.am
Changed
59
1
2
test_libvlc_media_list \
3
test_libvlc_media_player \
4
test_libvlc_media_discoverer \
5
+ test_libvlc_meta \
6
test_libvlc_renderer_discoverer \
7
test_libvlc_slaves \
8
test_src_config_chain \
9
10
modules/lua/telnet.sh \
11
check_POTFILES.sh
12
13
-# Disabled test:
14
-# meta: No suitable test file
15
+# Disabled tests:
16
EXTRA_PROGRAMS = \
17
- test_libvlc_meta \
18
test_libvlc_media_list_player \
19
test_src_input_stream_net \
20
$(NULL)
21
22
-#check_DATA = samples/test.sample samples/meta.sample
23
EXTRA_DIST = \
24
samples/certs/certkey.pem \
25
samples/empty.voc \
26
samples/image.jpg \
27
+ samples/meta.mp3 \
28
samples/subitems \
29
samples/slaves \
30
$(check_SCRIPTS)
31
32
33
TESTS = $(check_PROGRAMS) check_POTFILES.sh
34
35
-DISTCLEANFILES = samples/test.sample samples/meta.sample
36
-
37
-# Samples server
38
-SAMPLES_SERVER=http://streams.videolan.org/streams-videolan/reference
39
-
40
-samples/test.sample:
41
- mkdir -p `dirname $@`
42
- curl $(SAMPLES_SERVER)/avi/Hero-Div3.avi > $@
43
-
44
-samples/meta.sample:
45
- mkdir -p `dirname $@`
46
- curl $(SAMPLES_SERVER)/metadata/id3tag/Wesh-Bonneville.mp3 > $@
47
-
48
AM_CFLAGS = -DSRCDIR=\"$(srcdir)\"
49
AM_LDFLAGS = -no-install
50
LIBVLCCORE = -L../src/ -lvlccore
51
52
if HAVE_IOS
53
noinst_PROGRAMS += vlccoreios
54
endif
55
+
56
+if HAVE_TVOS
57
+noinst_PROGRAMS += vlccoreios
58
+endif
59
vlc-beta-20210430.0b6b242324.tar.xz/test/dynamicoverlay/.gitignore
Added
3
1
2
+overlay-test
3
vlc-beta-20210405.f3c7ba5bb3.tar.xz/test/iosvlc.m -> vlc-beta-20210430.0b6b242324.tar.xz/test/iosvlc.m
Changed
48
1
2
#include <vlc_variables.h>
3
#include <vlc_plugin.h>
4
5
+#include <TargetConditionals.h>
6
+
7
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
8
@public
9
libvlc_instance_t *_libvlc;
10
UIWindow *window;
11
UIView *subview;
12
+
13
+#if TARGET_OS_IOS
14
UIPinchGestureRecognizer *_pinchRecognizer;
15
+#endif
16
17
CGRect _pinchRect;
18
CGPoint _pinchOrigin;
19
20
21
22
@implementation AppDelegate
23
+#if TARGET_OS_IOS
24
- (void)pinchRecognized:(UIPinchGestureRecognizer *)pinchRecognizer
25
{
26
UIGestureRecognizerState state = [pinchRecognizer state];
27
28
_pinchPreviousCenter.x + newPosition.x - _pinchOrigin.x,
29
_pinchPreviousCenter.y + newPosition.y - _pinchOrigin.y);
30
}
31
+#endif
32
+
33
/* Called after application launch */
34
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
35
{
36
37
[window addSubview:subview];
38
[window makeKeyAndVisible];
39
40
+#if TARGET_OS_IOS
41
_pinchRecognizer = [[UIPinchGestureRecognizer alloc]
42
initWithTarget:self action:@selector(pinchRecognized:)];
43
[window addGestureRecognizer:_pinchRecognizer];
44
+#endif
45
46
/* Start glue interface, see code below */
47
libvlc_add_intf(_libvlc, "ios_interface,none");
48
vlc-beta-20210405.f3c7ba5bb3.tar.xz/test/libvlc/meta.c -> vlc-beta-20210430.0b6b242324.tar.xz/test/libvlc/meta.c
Changed
10
1
2
vlc = libvlc_new (argc, argv);
3
assert (vlc != NULL);
4
5
- media = libvlc_media_new_path (vlc, "samples/meta.sample");
6
+ media = libvlc_media_new_path (vlc, "samples/meta.mp3");
7
assert( media );
8
9
libvlc_media_parse (media);
10
vlc-beta-20210430.0b6b242324.tar.xz/test/samples/meta.mp3
Added