vlc.git
7 weeks agoavi: Fix potential leak
Hugo Beauzée-Luyssen [Thu, 11 Jun 2020 14:14:58 +0000 (16:14 +0200)]
avi: Fix potential leak

When AVI_IndexLoad gets invoked multiple time on the same file, we end
up overwriting the previous index table.

8 weeks agoaout: wasapi: use a vlc_timer for the deferred start
Steve Lhomme [Tue, 7 Apr 2020 14:12:16 +0000 (16:12 +0200)]
aout: wasapi: use a vlc_timer for the deferred start

The timer API is not supported in Winstore builds so switch to something that
works for all.

The timer (thread based) is created once and armed/disarmed when needed.

8 weeks agotest: lib: media_player: test track API
Thomas Guillem [Wed, 10 Jun 2020 12:23:30 +0000 (14:23 +0200)]
test: lib: media_player: test track API

8 weeks agotest: lib: media_player: add event_ctx
Thomas Guillem [Wed, 10 Jun 2020 12:23:18 +0000 (14:23 +0200)]
test: lib: media_player: add event_ctx

This adds the possibility to pause the player callback, read the event, and
resume the player callback.

8 weeks agotest: lib: media_player: pause can now be always tested
Thomas Guillem [Tue, 9 Jun 2020 15:21:42 +0000 (17:21 +0200)]
test: lib: media_player: pause can now be always tested

Since the mock:// duration is 5seconds.

8 weeks agolib: media_player: fix wrong assert
Thomas Guillem [Tue, 9 Jun 2020 15:29:52 +0000 (17:29 +0200)]
lib: media_player: fix wrong assert

8 weeks agotest: media_player: use "mock://"
Thomas Guillem [Tue, 9 Jun 2020 13:29:10 +0000 (15:29 +0200)]
test: media_player: use "mock://"

8 weeks agolib: media_track: assert that tracks are deleted correctly
Thomas Guillem [Thu, 11 Jun 2020 12:24:04 +0000 (14:24 +0200)]
lib: media_track: assert that tracks are deleted correctly

This debug code assert that a track should not not deleted with
libvlc_media_track_delete() when it comes from a list.

8 weeks agolib: video: use libvlc_media_player_get_selected_track()
Thomas Guillem [Fri, 5 Jun 2020 09:00:29 +0000 (11:00 +0200)]
lib: video: use libvlc_media_player_get_selected_track()

8 weeks agotest: media: use libvlc_media_get_tracklist
Thomas Guillem [Fri, 5 Jun 2020 07:02:46 +0000 (09:02 +0200)]
test: media: use libvlc_media_get_tracklist

8 weeks agolib: update media_player track events
Thomas Guillem [Thu, 4 Jun 2020 21:13:49 +0000 (23:13 +0200)]
lib: update media_player track events

Use the string identifier from track events.

8 weeks agolib: add new player track API
Thomas Guillem [Thu, 4 Jun 2020 17:59:51 +0000 (19:59 +0200)]
lib: add new player track API

8 weeks agocore: fix vlc_es_id_IsStrIdStable not exposed
Thomas Guillem [Thu, 4 Jun 2020 21:06:30 +0000 (23:06 +0200)]
core: fix vlc_es_id_IsStrIdStable not exposed

8 weeks agolib: add libvlc_media_track_delete
Thomas Guillem [Thu, 4 Jun 2020 17:57:47 +0000 (19:57 +0200)]
lib: add libvlc_media_track_delete

8 weeks agolib: media_track: add new members
Thomas Guillem [Thu, 4 Jun 2020 17:56:54 +0000 (19:56 +0200)]
lib: media_track: add new members

That will be used by player tracks.

8 weeks agolib: add libvlc_media_get_tracklist()
Thomas Guillem [Tue, 2 Jun 2020 17:06:18 +0000 (19:06 +0200)]
lib: add libvlc_media_get_tracklist()

8 weeks agolib: add libvlc_media_tracklist API
Thomas Guillem [Tue, 2 Jun 2020 17:04:42 +0000 (19:04 +0200)]
lib: add libvlc_media_tracklist API

This common opaque struct will be used by the media and the media_player.

8 weeks agolib: move track in media_track.c
Thomas Guillem [Thu, 28 May 2020 14:13:40 +0000 (16:13 +0200)]
lib: move track in media_track.c

And use a trackpriv struct to hold the specific audio/video/sub part, removing
an extra alloc usage.

8 weeks agolib: move libvlc_media_track_t to a specific header
Thomas Guillem [Thu, 28 May 2020 13:35:39 +0000 (15:35 +0200)]
lib: move libvlc_media_track_t to a specific header

8 weeks agolib: media: factorize track type conversion
Thomas Guillem [Wed, 29 Jan 2020 12:24:57 +0000 (13:24 +0100)]
lib: media: factorize track type conversion

8 weeks agopicture_Export: Fill visible_width & visible_height
Hugo Beauzée-Luyssen [Wed, 10 Jun 2020 11:53:58 +0000 (13:53 +0200)]
picture_Export: Fill visible_width & visible_height

This is what's used to provide the thumbnails sizes through libvlc

8 weeks agodirect3d11: fix crash on early failure
Steve Lhomme [Thu, 11 Jun 2020 07:54:10 +0000 (09:54 +0200)]
direct3d11: fix crash on early failure

Close() is called if any error occurs in Open() so it should be safe from
uninitialized fields.

8 weeks agodemux: ts: handle broken ADTS as LATM
Francois Cartegnie [Wed, 10 Jun 2020 14:32:48 +0000 (16:32 +0200)]
demux: ts: handle broken ADTS as LATM

refs #24842

8 weeks agopacketizer: mpeg4audio: reject truncated data
Francois Cartegnie [Wed, 10 Jun 2020 14:29:46 +0000 (16:29 +0200)]
packetizer: mpeg4audio: reject truncated data

8 weeks agoNEWS: UWP is only supported for Windows 10
Steve Lhomme [Wed, 10 Jun 2020 12:27:09 +0000 (14:27 +0200)]
NEWS: UWP is only supported for Windows 10

8 weeks agoavcodec: remove avcodec-fast support
Marvin Scholz [Thu, 4 Jun 2020 22:09:07 +0000 (00:09 +0200)]
avcodec: remove avcodec-fast support

The avcodec-fast option, if enabled, sets the AV_CODEC_FLAG2_FAST
option. Using AV_CODEC_FLAG2_FAST can cause use of unsafe code in
avcodec which could lead to crashes.

8 weeks agoes_out: fix inverted opaque/transparent forwarding
Francois Cartegnie [Fri, 29 May 2020 09:50:23 +0000 (11:50 +0200)]
es_out: fix inverted opaque/transparent forwarding

8 weeks agoplayer: fix teletext handling
Francois Cartegnie [Tue, 4 Feb 2020 15:22:06 +0000 (16:22 +0100)]
player: fix teletext handling

8 weeks agocontrib: gnutls: fix forbidden calls in Winstore builds
Steve Lhomme [Tue, 19 May 2020 14:02:15 +0000 (16:02 +0200)]
contrib: gnutls: fix forbidden calls in Winstore builds

Backport a UNICODE fix that was merged after the GnuTLS code freeze.

Forbid call to GetHandleInformation(). fcntl never goes in that code section in
Winstore builds. It's only used for linux random number generation.

Do not allow calling SecureZeroMemory which is forbidden which is forbidden
and not available as an inline function in some cases.

8 weeks agowin32: use windowsappcompat instead of winstorecompat
Steve Lhomme [Fri, 29 May 2020 09:22:55 +0000 (11:22 +0200)]
win32: use windowsappcompat instead of winstorecompat

This is the proper counterpart to windowsapp.

Now that we have a proper Docker image to build it:
registry.videolan.org/vlc-debian-llvm-uwp:20200603145315

A recent mingw64 8 (unreleased) is needed to make use of this. It's available
in our Docker images and in msys2 (although it's using msvcrt so it will
probably fail to link properly)

The forced -lwindowsappcompat is added like the other LDFLAGS in configure.ac.

8 weeks agopackage/win32: build.sh: only force win10 API's for UWP builds
Steve Lhomme [Mon, 8 Jun 2020 11:46:44 +0000 (13:46 +0200)]
package/win32: build.sh: only force win10 API's for UWP builds

The other UCRT builds might work in win7.

8 weeks agofreetype: fix linking for Winstore builds
Steve Lhomme [Tue, 9 Jun 2020 10:35:05 +0000 (12:35 +0200)]
freetype: fix linking for Winstore builds

-luuid is needed as we use IID_IUnknown

Add missing $(AM_LIBADD) messing up the order of libraries

8 weeks agodsm: fix mismatched pointer
Steve Lhomme [Mon, 8 Jun 2020 15:13:55 +0000 (17:13 +0200)]
dsm: fix mismatched pointer

Fixes this warning with clang10:
incompatible pointer types passing 'u_long *' (aka 'unsigned long *') to parameter of type 'uint32_t *' (aka 'unsigned int *')

Similar to what is done in access/smb2.c

8 weeks agoqml: use constants for Video and Music track list sizes
Prince Gupta [Fri, 5 Jun 2020 15:27:25 +0000 (20:57 +0530)]
qml: use constants for Video and Music track list sizes

8 weeks agoqml: add sizes for video and music tracklist in VLCStyle
Prince Gupta [Fri, 5 Jun 2020 15:27:24 +0000 (20:57 +0530)]
qml: add sizes for video and music tracklist in VLCStyle

8 weeks agoqml: show bgHover color when row has focus in KeyNavigableTableView
Prince Gupta [Fri, 5 Jun 2020 15:27:23 +0000 (20:57 +0530)]
qml: show bgHover color when row has focus in KeyNavigableTableView

8 weeks agoqml: change bgHover of VLCColors to match designs
Prince Gupta [Fri, 5 Jun 2020 15:27:22 +0000 (20:57 +0530)]
qml: change bgHover of VLCColors to match designs

8 weeks agoqml: show play cover on VideoList cover images
Prince Gupta [Fri, 5 Jun 2020 15:27:21 +0000 (20:57 +0530)]
qml: show play cover on VideoList cover images

8 weeks agoqml: show play cover on MusicTrackList cover images
Prince Gupta [Fri, 5 Jun 2020 15:27:20 +0000 (20:57 +0530)]
qml: show play cover on MusicTrackList cover images

8 weeks agoqml: add table cover border and cover icon size constants to KeyNavigableTableView
Prince Gupta [Fri, 5 Jun 2020 15:27:19 +0000 (20:57 +0530)]
qml: add table cover border and cover icon size constants to KeyNavigableTableView

8 weeks agoqml: attach containsMouse and currentlyFocused property to delegates in KeyNavigableT...
Prince Gupta [Fri, 5 Jun 2020 15:27:18 +0000 (20:57 +0530)]
qml: attach containsMouse and currentlyFocused property to delegates in KeyNavigableTableView

8 weeks agoqml: introduce PlayCover widget
Prince Gupta [Fri, 5 Jun 2020 15:27:17 +0000 (20:57 +0530)]
qml: introduce PlayCover widget

8 weeks agoconfigure: fix pollfd test ordering
Rémi Denis-Courmont [Mon, 8 Jun 2020 15:02:45 +0000 (18:02 +0300)]
configure: fix pollfd test ordering

8 weeks agoCheck for <poll.h> explicitly
Rémi Denis-Courmont [Sat, 6 Jun 2020 13:47:43 +0000 (16:47 +0300)]
Check for <poll.h> explicitly

8 weeks agohttpd: don't wait until all clients are idle
Rémi Denis-Courmont [Sat, 6 Jun 2020 17:26:48 +0000 (20:26 +0300)]
httpd: don't wait until all clients are idle

As long as at least one client is active, we need to keep trying to
read/write to drain the RX buffers or fill the TX buffers.

We still need to poll (with zero timeout) to detect new connections.

Fixes #24824.

8 weeks agohttpd: process client I/O before polling
Rémi Denis-Courmont [Sat, 6 Jun 2020 17:21:10 +0000 (20:21 +0300)]
httpd: process client I/O before polling

In case of TLS, the TCP socket poll state does not necessarily match
the TLS stream state: data may be in the library-side TLS buffers.
So we need to try to read/write regardless of the socket events.

Refs #24824.

8 weeks agohttpd: update activity time on actual activity
Rémi Denis-Courmont [Sat, 6 Jun 2020 17:04:16 +0000 (20:04 +0300)]
httpd: update activity time on actual activity

Account for actual data read or written, rather than iteration of the
poll loop.

Note: This won't count TLS handshake progress as activity. But if
the client cannot complete the handshake within a time-out interval,
we might as well drop it.

8 weeks agohttpd: return progress status from I/O functions
Rémi Denis-Courmont [Sat, 6 Jun 2020 16:59:56 +0000 (19:59 +0300)]
httpd: return progress status from I/O functions

So the caller knows if the client needs to be polled or not.

8 weeks agohttpd: reduce variable scope
Rémi Denis-Courmont [Sat, 6 Jun 2020 17:09:57 +0000 (20:09 +0300)]
httpd: reduce variable scope

8 weeks agohttpd: don't bother processing failed connection
Rémi Denis-Courmont [Sat, 6 Jun 2020 16:56:10 +0000 (19:56 +0300)]
httpd: don't bother processing failed connection

If the underlying stream failed, there's no point processing an
outstanding request. It's most likely incomplete, and in any case, we
won't be able to send the response.

That corner case only made sense for connections half-closed on read
end. (Even then, it's a little questionable, because half-closed
connections eventually time out if not fully closed.)

8 weeks agohttpd: match protocol before request verb
Rémi Denis-Courmont [Sat, 6 Jun 2020 16:50:57 +0000 (19:50 +0300)]
httpd: match protocol before request verb

8 weeks agohttpd: use ARRAY_SIZE()
Rémi Denis-Courmont [Sat, 6 Jun 2020 16:48:27 +0000 (19:48 +0300)]
httpd: use ARRAY_SIZE()

8 weeks agohttpd: reorder, de-indent
Rémi Denis-Courmont [Sat, 6 Jun 2020 16:45:10 +0000 (19:45 +0300)]
httpd: reorder, de-indent

(No functional changes)

8 weeks agomjpeg: fix incorrect vlc_object_t pointer usage
Steve Lhomme [Mon, 8 Jun 2020 11:27:21 +0000 (13:27 +0200)]
mjpeg: fix incorrect vlc_object_t pointer usage

"passing argument 1 of ‘vlc_obj_malloc’ from incompatible pointer type"
"expected ‘vlc_object_t *’ {aka ‘struct vlc_object_t *’} but argument is of type ‘demux_t *’"

Warnings introduced in

9a55abf4e2b9f37d577152df0cb3962b29e55002

8 weeks agodemux: adaptive: make Content-Type no longer authoritative
Francois Cartegnie [Sun, 7 Jun 2020 17:55:21 +0000 (19:55 +0200)]
demux: adaptive: make Content-Type no longer authoritative

tired of bogus HLS configs
ref #24817

2 months agortp: ignore MSG_TRUNC if missing
Rémi Denis-Courmont [Sun, 7 Jun 2020 07:35:02 +0000 (10:35 +0300)]
rtp: ignore MSG_TRUNC if missing

(same as VLC 3.0 does)

2 months agomjpeg: fix leak
Rémi Denis-Courmont [Sat, 6 Jun 2020 14:23:37 +0000 (17:23 +0300)]
mjpeg: fix leak

2 months agortp: fix include order
Rémi Denis-Courmont [Sat, 6 Jun 2020 13:46:31 +0000 (16:46 +0300)]
rtp: fix include order

System headers must be included before VLC ones, especially on Windows.

2 months agortp: fix typo
Rémi Denis-Courmont [Sat, 6 Jun 2020 13:41:00 +0000 (16:41 +0300)]
rtp: fix typo

2 months agortp: add missing HAVE_POLL guard
Rémi Denis-Courmont [Sat, 6 Jun 2020 09:05:10 +0000 (12:05 +0300)]
rtp: add missing HAVE_POLL guard

2 months agortp: fix build without SRTP
Rémi Denis-Courmont [Sat, 6 Jun 2020 09:04:12 +0000 (12:04 +0300)]
rtp: fix build without SRTP

2 months agognutls: remove EXPORT priority option (fixes #24823)
Rémi Denis-Courmont [Sat, 6 Jun 2020 06:04:10 +0000 (09:04 +0300)]
gnutls: remove EXPORT priority option (fixes #24823)

This does not or no longer exist.

2 months agoblock: fix copy paste error (fixes #24811)
Rémi Denis-Courmont [Wed, 3 Jun 2020 16:35:21 +0000 (19:35 +0300)]
block: fix copy paste error (fixes #24811)

2 months agoblock: zero counters on block_FifoEmpty()
Rémi Denis-Courmont [Wed, 3 Jun 2020 16:30:02 +0000 (19:30 +0300)]
block: zero counters on block_FifoEmpty()

Call vlc_fifo_DequeueAllUnlocked() so that the block and byte counters
are correctly reset to zero.

Refs #24811.

2 months agortp: remove constant thread_ready flag
Rémi Denis-Courmont [Sun, 26 Apr 2020 12:54:38 +0000 (15:54 +0300)]
rtp: remove constant thread_ready flag

2 months agortp: use struct vlc_dtls
Rémi Denis-Courmont [Sun, 10 May 2020 12:11:08 +0000 (15:11 +0300)]
rtp: use struct vlc_dtls

2 months agortp: add connection-oriented datagram socket support
Rémi Denis-Courmont [Sun, 10 May 2020 12:08:44 +0000 (15:08 +0300)]
rtp: add connection-oriented datagram socket support

(in other words, DCCP)

2 months agortp: add initial datagram socket abstraction
Rémi Denis-Courmont [Sun, 26 Apr 2020 08:08:35 +0000 (11:08 +0300)]
rtp: add initial datagram socket abstraction

RTP and RTCP are packet-based. The low-level I/O abstraction needed is
similar but different from that of connection-oriented streams as
provided by `struct vlc_tls'. So this adds a new suitable abstraction
for the RTP plugin(s).

2 months agoconfigure: link with synchronization library when building for win8+
Steve Lhomme [Fri, 5 Jun 2020 08:46:56 +0000 (10:46 +0200)]
configure: link with synchronization library when building for win8+

That's what should be used when calling WaitOnAddress.
It's not part of the kernel32.dll anymore.

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress

2 months agocontrib: gnutls: update to 3.6.14
Steve Lhomme [Thu, 28 May 2020 07:29:48 +0000 (09:29 +0200)]
contrib: gnutls: update to 3.6.14

ecc_scalar_random is public in the nettle they embed, but the symbol is not
mangled in the original nettle package, so it's not mangled here either. It
leads to the nettle symbol behind defined twice.

The bug is actually in nettle, not the script that imports nettle in gnutls.

2 months agocontrib: gmp: don't use the cross compiler to test the build compiler
Steve Lhomme [Thu, 4 Jun 2020 13:17:13 +0000 (15:17 +0200)]
contrib: gmp: don't use the cross compiler to test the build compiler

To build native tools it tries to use $CC when cross-compilation is detected,
which is most likely wrong.

This patch already exists in nettle that contains a version of gmp. But it's
not in the upstream version of gmp.

2 months agoconfigure: check if if_nametoindex is available on Windows
Steve Lhomme [Thu, 30 Apr 2020 08:53:27 +0000 (10:53 +0200)]
configure: check if if_nametoindex is available on Windows

It may link with iphlpapi but be forbidden in UWP.

This test relies on the fact that -Werror-implicit-function-declaration works
in the compiler. And that's why it's done after it's enabled.

It's only used for the --miface option to set the preferred multicast interface.

2 months agosrc: simplify logs
Steve Lhomme [Wed, 6 May 2020 13:45:34 +0000 (15:45 +0200)]
src: simplify logs

We know what app we're running.

2 months agocodec: hxxx_helper: fix distcheck
Thomas Guillem [Fri, 5 Jun 2020 06:53:13 +0000 (08:53 +0200)]
codec: hxxx_helper: fix distcheck

2 months agoCI: update the LLVM-MINGW image to a newer Clang/MingW version
Steve Lhomme [Thu, 4 Jun 2020 06:24:47 +0000 (08:24 +0200)]
CI: update the LLVM-MINGW image to a newer Clang/MingW version

This version uses msvcrt as the C runtime and not the UCRT which we can't
distribute on Win7 to Win8.1.

2 months agoCI: use newer gcc for windows builds
Steve Lhomme [Wed, 3 Jun 2020 07:18:22 +0000 (09:18 +0200)]
CI: use newer gcc for windows builds

2 months agohxxx_nal: reindent after previous commit
Thomas Guillem [Wed, 27 May 2020 11:04:34 +0000 (13:04 +0200)]
hxxx_nal: reindent after previous commit

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2 months agohxxx_nal: remove useless optim
Thomas Guillem [Wed, 27 May 2020 11:02:08 +0000 (13:02 +0200)]
hxxx_nal: remove useless optim

This special case is now useless since p_source is always copied to p_dest,
right after in the memmove loop.

Furthermore, this caused an invalid payload size when the buffer was actually
reallocated since the payload calculation was comparing two different buffers
offset.

CVE-2020-13428

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2 months agocodec: add hxxx_helper test decoder
Thomas Guillem [Wed, 27 May 2020 09:28:17 +0000 (11:28 +0200)]
codec: add hxxx_helper test decoder

It will test the hxxx_helper API that is only used by hw decoders (that are not
tested). It will also test annexB <-> xvcC conversion, via the
"hxxx-helper-testdec-xvcC" variable.

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2 months agocodec: put hxxx_helper in a static lib
Thomas Guillem [Wed, 27 May 2020 09:27:28 +0000 (11:27 +0200)]
codec: put hxxx_helper in a static lib

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2 months agodemux: use noinst_* for the mock module
Thomas Guillem [Thu, 28 May 2020 11:49:10 +0000 (13:49 +0200)]
demux: use noinst_* for the mock module

From Rémi:
"Test plugins should use noinst_*, IMO. With check_*, you would end up with
stale plugins and potentially weird crashes due to ABI breaks if alternating
make all and make check."

2 months agoopengl: do not pass the picture_t to the renderer
Romain Vimont [Thu, 6 Feb 2020 11:39:35 +0000 (12:39 +0100)]
opengl: do not pass the picture_t to the renderer

The renderer is expected to be independant of the input picture format.
Instead, update the sampler directly.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: remove all interop usages from renderer
Romain Vimont [Thu, 6 Feb 2020 11:12:30 +0000 (12:12 +0100)]
opengl: remove all interop usages from renderer

Remove the remaining usage of interop from renderer.

Now, the renderer only need to use the sampler.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: move sampler ownership to vgl
Romain Vimont [Thu, 6 Feb 2020 11:04:05 +0000 (12:04 +0100)]
opengl: move sampler ownership to vgl

The sampler were owned by the renderer.

Move it to vgl, so that the renderer never have to handle an interop
instance directly.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: expose video format in sampler
Romain Vimont [Thu, 6 Feb 2020 11:02:15 +0000 (12:02 +0100)]
opengl: expose video format in sampler

For convenience, expose the video format directly in sampler.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: update pictures from sampler
Romain Vimont [Thu, 6 Feb 2020 10:55:06 +0000 (11:55 +0100)]
opengl: update pictures from sampler

The renderer should not know the interop, so it may not be in charge of
uploading the textures.

Move the pictures update to sampler.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: move orientation matrix init to sampler
Romain Vimont [Thu, 6 Feb 2020 10:22:29 +0000 (11:22 +0100)]
opengl: move orientation matrix init to sampler

The orientation matrix is managed by the sampler. Move its
initialization to opengl_fragment_shader_init() (called by the sampler).

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: move sampler initialization to constructor
Romain Vimont [Thu, 6 Feb 2020 08:56:52 +0000 (09:56 +0100)]
opengl: move sampler initialization to constructor

Move opengl_fragment_shader_init() call from renderer to sampler.

This function initializes parts of the sampler.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: generate the extensions from the sampler
Romain Vimont [Wed, 5 Feb 2020 16:03:42 +0000 (17:03 +0100)]
opengl: generate the extensions from the sampler

The sampler handles the input pictures, so it is also responsible for
generating the necessary GLSL extensions code (if any).

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: store fragment shader in sampler
Romain Vimont [Wed, 5 Feb 2020 15:42:21 +0000 (16:42 +0100)]
opengl: store fragment shader in sampler

The function opengl_fragment_shader_init() both initializes the sampler
and creates the fragment shader.

To be able to move its initialization outside the renderer, store it in
the sampler instead of returning it.

This will also allow to provide the "extensions" part of the fragment
shader as a separate string.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: remove unused code
Romain Vimont [Fri, 24 Apr 2020 09:00:54 +0000 (11:00 +0200)]
opengl: remove unused code

The glexts variable was never used in vlc_gl_interop_New().

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agoopengl: fragment_shaders: fix TexSize0 usage
Alexandre Janniaux [Wed, 3 Jun 2020 13:23:50 +0000 (15:23 +0200)]
opengl: fragment_shaders: fix TexSize0 usage

In the case we're using GL_TEXTURE_RECTANGLE, we need to convert the
normalized texture coordinates into pixel coordinates using TexSize0.
This was done in the case of yuv (cf. is_yuv) in general but not when
is_yuv == false, which leads to failure when fetching uniform
locations on MacOSX.

In particular, this can be tested by forcing the chroma through the
--videotoolbox-cvpx-chroma=BGRA option on MacOSX.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agocvpx: fix leaking CVPixelBuffer
Marc Haisenko [Tue, 2 Jun 2020 10:54:20 +0000 (12:54 +0200)]
cvpx: fix leaking CVPixelBuffer

CVPixelBuffer references are retained and release by cvpxpic_attach so
releasing after attaching tie the buffer lifetime to the one of the
picture, but failing to release afterwards meant that it wouldn't be
released at all.

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2 months agomacosx: use vlc_safeDrawInBezierPath:angle:
Marvin Scholz [Wed, 3 Jun 2020 13:45:48 +0000 (15:45 +0200)]
macosx: use vlc_safeDrawInBezierPath:angle:

2 months agomacosx: add category for safe NSGradient drawing
Marvin Scholz [Wed, 3 Jun 2020 13:45:22 +0000 (15:45 +0200)]
macosx: add category for safe NSGradient drawing

Trying to draw a NSGradient into an empty NSBezierPath throws
and exception, crashing the application.

To prevent that we have workarounds at every place where we called
drawInBezierPath:angle:, instead just use a category which makes
the code cleaner and keeps the logic for the workaround in one place.

2 months agopackage/win32: build.sh: fix building ucrt builds with non-msys2 gcc
Steve Lhomme [Wed, 3 Jun 2020 11:36:15 +0000 (13:36 +0200)]
package/win32: build.sh: fix building ucrt builds with non-msys2 gcc

-mcrtdll is a msys2 only option. At least it's not in the regular gcc images
from our Dockers.

2 months agopackage/win32: build.sh: do not link with ucrtbase
Steve Lhomme [Wed, 3 Jun 2020 09:04:07 +0000 (11:04 +0200)]
package/win32: build.sh: do not link with ucrtbase

It's not allowed to link directly to the library (even though it exists).

For UCRT builds not packaged by MSVC vcruntime140* will not be found. It's not
a problem for UWP/UWP apps that are always built with MSVC.

It's a problem for UCRT builds that we might want to do in the future without
MSVC at all. We will need a replacement library for the calls we use. Some are
currently linked with a api-ms-win-crt-private DLL.

2 months agopackage/win32: build.sh: Force Win7 and MSVCRT when not using UCRT
Steve Lhomme [Tue, 2 Jun 2020 09:04:19 +0000 (11:04 +0200)]
package/win32: build.sh: Force Win7 and MSVCRT when not using UCRT

That's the minimum we support in VLC 4.0.

The CRT version to set for UCRT is 0xE00.

2 months agocontrib: pthreads: use a mingw-w64 version from git
Steve Lhomme [Fri, 29 May 2020 11:32:32 +0000 (13:32 +0200)]
contrib: pthreads: use a mingw-w64 version from git

2 months agovout: win32: assume DirectComposition is available to UWP apps
Steve Lhomme [Fri, 29 May 2020 08:32:40 +0000 (10:32 +0200)]
vout: win32: assume DirectComposition is available to UWP apps