platform/upstream/gstreamer.git
2 years agoMerge branch 'tizen' into tizen_gst_1.19.2
Gilbok Lee [Wed, 19 Jan 2022 01:50:15 +0000 (10:50 +0900)]
Merge branch 'tizen' into tizen_gst_1.19.2

Change-Id: I4cebef33eadb3e868c122c1d09a70fb4afbfecb9

2 years agohlsdemux: Reset m3u8 sequence when fail three times to get next fragment
Gilbok Lee [Thu, 6 Jan 2022 05:21:25 +0000 (14:21 +0900)]
hlsdemux: Reset m3u8 sequence when fail three times to get next fragment

- When media sequence of m3u8 decreases on live stream, fail to get next fragment

Change-Id: Iaae7ba7cf3439fcca5155e9cc7f3a1a95e85909e

2 years agowebrtcbin: Add drop-probability-receiver property
Sangchul Lee [Fri, 17 Dec 2021 06:03:57 +0000 (15:03 +0900)]
webrtcbin: Add drop-probability-receiver property

If netsim property is enabled, this property can be set to simulate
loss of being received RTP packets.

Change-Id: I4f229d41f40e649bdefffd48827f6f7172401741
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 years agowebrtcbin: Add netsim and drop-probability-sender properties
Sangchul Lee [Thu, 16 Dec 2021 11:31:57 +0000 (20:31 +0900)]
webrtcbin: Add netsim and drop-probability-sender properties

These properties are added to simulate loss of sending RTP packets.

Change-Id: Ia633a32a902d6322189d1b0c033a3a15bdbc4e9d
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 years agowebrtcbin: Fix invalid structure type
Sangchul Lee [Fri, 17 Dec 2021 02:25:31 +0000 (11:25 +0900)]
webrtcbin: Fix invalid structure type

It also fix a build warning.

Change-Id: I4eebaa9c04ee20b85bb04a21f4c5464d58329e54
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 years agohlsdemux: update segment with valid pos info
Eunhye Choi [Fri, 17 Dec 2021 05:48:35 +0000 (14:48 +0900)]
hlsdemux: update segment with valid pos info

- add checking stream type to update segment position
- vtt stream is not proper to construct segment

Change-Id: Ibbdd91c6d75573afd708dc210dac20286290c3be

2 years agompegtsdemux: activate new stream when program update
Gilbok Lee [Wed, 1 Dec 2021 04:55:42 +0000 (13:55 +0900)]
mpegtsdemux: activate new stream when program update

Change-Id: If8f299f90e181d47579f143e9671d488f0b2dbe6

2 years agohlsdemux: fix block issue if webvtt data is empty
Eunhye Choi [Mon, 29 Nov 2021 07:09:19 +0000 (16:09 +0900)]
hlsdemux: fix block issue if webvtt data is empty

- send webvtt dummy buffer to avoid block and
  expose all the hlsdemux pad normally

Change-Id: I5ff48c4498752353ca4fd985a73df0c9bbe914f2

2 years agohlsdemux: set discont. only at start fragment
Eunhye Choi [Sat, 20 Nov 2021 05:45:31 +0000 (14:45 +0900)]
hlsdemux: set discont. only at start fragment

- discont have to be set in case of start fragment
  to update pts correctly.

Change-Id: I482dd48012b8dc76d54e97b91e83b3083ad81d5b

2 years agotsdemux: update pmt info
Eunhye Choi [Wed, 17 Nov 2021 12:00:30 +0000 (21:00 +0900)]
tsdemux: update pmt info

- to handle new pmt as psi,
  the pmt info have to be removed from the previous pes list

Change-Id: Ibd7df6f945287cb8f1ca8e9b6c6f71c07a3dc486

2 years agofixup! webrtcbin: Remove transceiver from array when releasing pad
Sangchul Lee [Wed, 17 Nov 2021 08:08:54 +0000 (17:08 +0900)]
fixup! webrtcbin: Remove transceiver from array when releasing pad

Change-Id: Idd611bc2f66adf24abc51ae0ef0b000adbe8f48c
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 years agowebrtcbin: Notify missing ice-gathering-state for COMPLETE
Sangchul Lee [Fri, 29 Oct 2021 06:45:18 +0000 (15:45 +0900)]
webrtcbin: Notify missing ice-gathering-state for COMPLETE

Occasionally, GATHERING_STATE_COMPLETE was obtained in _update_ice_
gathering_state_task() before consuming all the tasks for local ICE
candidates in _on_local_ice_candidate_task(). It missed notifying the
'ice-gathering-state' signal for gathering completion.
This patch fixes it.

Change-Id: Ie0a997e6976f48b876cb0741f488826a0c172116
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 years agohlsdemux: Add condition for setting stream discontinuity
Gilbok Lee [Tue, 16 Nov 2021 01:14:04 +0000 (10:14 +0900)]
hlsdemux: Add condition for setting stream discontinuity

- Set stream continuity when fragment time changes
- Change in the wrong define in the spec

Change-Id: I592f4cd915c2d186462f771714de797c4b424521

2 years agohlsdemux: Set stream discontinuity when the last PCR value differs by more than 1...
Gilbok Lee [Fri, 12 Nov 2021 05:45:42 +0000 (14:45 +0900)]
hlsdemux: Set stream discontinuity when the last PCR value differs by more than 1 second

Change-Id: I1747f7485c9f2eabae67f6f17e11005715a1a081

2 years agotsdemux: Handle invalid PCR_PID streams
Gilbok Lee [Fri, 12 Nov 2021 03:38:50 +0000 (12:38 +0900)]
tsdemux: Handle invalid PCR_PID streams

- If pcr_pid stream does not have PCR,
  find PCR in all streams and update the program PCR_pid

Change-Id: I53c7fcfc8c405eb9ff162d52000d56d7e9cf3bfb

2 years agowebrtcbin: Remove transceiver from array when releasing pad
Sangchul Lee [Fri, 15 Oct 2021 03:07:47 +0000 (12:07 +0900)]
webrtcbin: Remove transceiver from array when releasing pad

Previously, even after releasing a pad, 'create-offer' could not
get valid sdp message. It is fixed.

Change-Id: I21120e5a4064f0c51cdf6dce88f51079592f5161
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 years agoRelease 1.19.2
Tim-Philipp Müller [Thu, 23 Sep 2021 00:34:47 +0000 (01:34 +0100)]
Release 1.19.2

2 years agoaudiobuffersplit: Remove unneeded buffer_clip wrapper
Nicolas Dufresne [Wed, 22 Sep 2021 18:17:35 +0000 (14:17 -0400)]
audiobuffersplit: Remove unneeded buffer_clip wrapper

This is just a small cleanup noticed while reading.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2544>

2 years agoopencv: cvtracker: add draw property
Vivek R [Fri, 10 Jul 2020 14:01:13 +0000 (19:31 +0530)]
opencv: cvtracker: add draw property

This property controls the drawing of rectangle around the tracked object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2454>

2 years agoopencv: add cvtracker plugin
Vivek R [Sun, 24 May 2020 18:07:25 +0000 (23:37 +0530)]
opencv: add cvtracker plugin

This adds an object tracker plugin.
Tracker implementations from https://docs.opencv.org/3.4/d0/d0a/classcv_1_1Tracker.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2454>

2 years agoopencv: patch to ensure headers are detected
Vivek R [Mon, 25 May 2020 05:05:30 +0000 (10:35 +0530)]
opencv: patch to ensure headers are detected

This patch is used to ensure opencv headers are detected.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2454>

2 years agompegtsmux, mpegpsmux: remove GPL from choice of licenses and add SPDX license identifiers
Tim-Philipp Müller [Sun, 19 Sep 2021 00:18:00 +0000 (01:18 +0100)]
mpegtsmux, mpegpsmux: remove GPL from choice of licenses and add SPDX license identifiers

Some people need to avoid inclusion of GPL code for their use cases and thus
get easily spooked by GPL license headers. This code is actually licensed
under different licenses, only one of which is GPL, and it's already possible
to just upgrade from LGPL to GPL anyway so having the GPL listed explicitly
as one of the choices doesn't really add anything. So remove GPL from the list
and also add SPDX license identifiers while we're at it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2539>

2 years agowasapideviceprovider: Add support for dynamic device add/remove
Seungha Yang [Mon, 23 Aug 2021 18:54:27 +0000 (03:54 +0900)]
wasapideviceprovider: Add support for dynamic device add/remove

Adding IMMDeviceEnumerator::RegisterEndpointNotificationCallback
in order to support device monitoring.
On OnDeviceAdded(), OnDeviceRemoved(), and OnDefaultDeviceChanged()
callback, wasapi device provider implementation will enumerate
devices again and will notify newly added and removed device
via GstDeviceProvider API.

As a bonus point, this IMMDeviceEnumerator abstraction object
will spawn a dedicated internal COM thread, so various COM thread
related issues of WASAPI plugin can be resolved by this commit.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1649
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1110
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2484>

2 years agoopenjpeg: add unit test
Stéphane Cerveau [Mon, 1 Feb 2021 15:21:59 +0000 (16:21 +0100)]
openjpeg: add unit test

Test various format supported with subframes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agojpeg2000parse + openjpeg: Switch striped mode to its own caps
Stéphane Cerveau [Fri, 22 Jan 2021 09:39:56 +0000 (10:39 +0100)]
jpeg2000parse + openjpeg: Switch striped mode to its own caps

It's not compatible with any other element that use the non-striped
mode. In addition, in this mode, we require that every frame have the
same number of stripes or that the MARKER bit be present, which is
different from the other
formats too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agoopenjpegdec: Fix crash with AYUV64 in subframe mode
Stéphane Cerveau [Wed, 23 Dec 2020 10:03:34 +0000 (11:03 +0100)]
openjpegdec: Fix crash with AYUV64 in subframe mode

Remove useless generic fill_frame methods to use
the packed one for AYUV and AYUV64.

Fix gst-launch-1.0 -v videotestsrc  !
video/x-raw,width=640,height=480,format=AYUV64  !  openjpegenc
num-stripes=8   !  openjpegdec max-threads=8  ! videoconvert !
autovideosink sync=false

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agoopenjpegdec: support for a multithreaded decoding.
Stéphane Cerveau [Fri, 24 Apr 2020 14:15:42 +0000 (16:15 +0200)]
openjpegdec: support for a multithreaded decoding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agoopenjpegdec: enable sub frame mode
Aaron Boxer [Mon, 13 Jan 2020 19:02:39 +0000 (14:02 -0500)]
openjpegdec: enable sub frame mode

Rebuild output frame from multiple stripes input.

Keep the first frame and fill it with the following stripes to finish
a complete frame only once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agompegtsmux: Require frame alignment for JPEG 2000
Olivier Crête [Tue, 22 Dec 2020 23:19:40 +0000 (18:19 -0500)]
mpegtsmux: Require frame alignment for JPEG 2000

We have yet to implement stripe alignment with the required descriptor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agoopenjpegdec: Reject stripes for now
Olivier Crête [Tue, 22 Dec 2020 23:15:52 +0000 (18:15 -0500)]
openjpegdec: Reject stripes for now

They're not implemented.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agoopenjpegenc: Only allow stripe with image/x-jpc format
Olivier Crête [Tue, 22 Dec 2020 23:20:35 +0000 (18:20 -0500)]
openjpegenc: Only allow stripe with image/x-jpc format

It's the only format that our MPEG-TS muxer allows and the carriage of
JPEG 2000 stripes is only defined for MPEG-TS as far as I know.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agoopenjpegenc: support for a multithreaded encoding.
Stéphane Cerveau [Tue, 21 Apr 2020 18:56:03 +0000 (20:56 +0200)]
openjpegenc: support for a multithreaded encoding.

This commit introduces a multithreaded encoder allowing
to encode mulitple stripes or subframes in separated threads.
This feature aims to enhance the overall latency of a codec
pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/979>

2 years agowpe: context thread dispatch fixes
Philippe Normand [Sat, 18 Sep 2021 11:02:15 +0000 (12:02 +0100)]
wpe: context thread dispatch fixes

Use dedicated mutex/cond/flag for jobs being dispatched in the context thread.
The previous code was signalling the thread startup condition, which is wrong.
When WPEContextThread::dispatch() is invoked it means the thread has already
correctly been started up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2533>

2 years agowpe: Properly wait on context thread startup condition
Philippe Normand [Sat, 18 Sep 2021 11:01:39 +0000 (12:01 +0100)]
wpe: Properly wait on context thread startup condition

Fixes #1661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2533>

2 years agodoc: Update kmssink caps cache
Nicolas Dufresne [Mon, 20 Sep 2021 13:41:32 +0000 (09:41 -0400)]
doc: Update kmssink caps cache

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2530>

2 years agokmssink: Add RGB16/BGR16 support
Nicolas Dufresne [Fri, 17 Sep 2021 20:21:39 +0000 (16:21 -0400)]
kmssink: Add RGB16/BGR16 support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2530>

2 years agokmssink: Sort format according to GST_VIDEO_FORMATS_ALL
Nicolas Dufresne [Fri, 17 Sep 2021 20:14:36 +0000 (16:14 -0400)]
kmssink: Sort format according to GST_VIDEO_FORMATS_ALL

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2530>

2 years agokmssink: Remove big endian format inversion
Nicolas Dufresne [Fri, 17 Sep 2021 19:42:25 +0000 (15:42 -0400)]
kmssink: Remove big endian format inversion

This has been a bad interpretation of the DRM docuemntation. The formats are
fixed regardless the CPU, but for some formats, they expressed in the opposite
order as GStreamer. Same change was done in waylandsink 2 years ago.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/commit/b393b650ab9bfb9654fc116163ab331907216d74

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2530>

2 years agokmssink: Add NV61 support
Nicolas Dufresne [Fri, 17 Sep 2021 19:41:41 +0000 (15:41 -0400)]
kmssink: Add NV61 support

This identically handled to NV16, so no reason not to inclue it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2530>

2 years agokmssink: Add NV24 support
Nicolas Dufresne [Fri, 17 Sep 2021 19:39:54 +0000 (15:39 -0400)]
kmssink: Add NV24 support

This was tested on RK3566 platform, using vendor DRM driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2530>

2 years agocodecs: av1decoder: Use GstFlowReturn everywhere
Seungha Yang [Fri, 17 Sep 2021 15:33:12 +0000 (00:33 +0900)]
codecs: av1decoder: Use GstFlowReturn everywhere

The same modification as that of VP8 decoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>

2 years agocodecs: vp9decoder: Use GstFlowReturn everywhere
Seungha Yang [Fri, 17 Sep 2021 15:09:24 +0000 (00:09 +0900)]
codecs: vp9decoder: Use GstFlowReturn everywhere

The same modification as that of VP8 decoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>

2 years agocodecs: vp8decoder: Use GstFlowReturn everywhere
Seungha Yang [Fri, 17 Sep 2021 14:23:06 +0000 (23:23 +0900)]
codecs: vp8decoder: Use GstFlowReturn everywhere

boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>

2 years agompegtspacketizer: memcmp potentially seen_before data
Vivia Nikolaidou [Mon, 16 Aug 2021 15:15:42 +0000 (18:15 +0300)]
mpegtspacketizer: memcmp potentially seen_before data

Theoretically the version number is incremented every time there's a new
section, but in a world of streaming we can't easily make that
assumption.

An example of a broken use case is when we're cat-ing two mpeg-ts files
together, which is equivalent of capturing a DVB stream while switching
channels. A set-top box would know that we switched the channels and
reset the demuxer, but in practice this might not happen.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2468>

2 years agoplayer: Fix/add various annotations
Sebastian Dröge [Mon, 20 Sep 2021 08:35:51 +0000 (11:35 +0300)]
player: Fix/add various annotations

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2538>

2 years agomeson: va: Make AV1 support always optional
Seungha Yang [Sat, 18 Sep 2021 09:07:43 +0000 (18:07 +0900)]
meson: va: Make AV1 support always optional

Otherwise meson configure with -Dva=enabled will be failed
when installed libva version is < 1.8

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2532>

2 years agova: caps: Don't use image formats for decoded frames.
Víctor Manuel Jáquez Leal [Sat, 18 Sep 2021 09:03:16 +0000 (11:03 +0200)]
va: caps: Don't use image formats for decoded frames.

Initially we tried to use the internal color conversion used in i965
and Gallium drivers when decoding. But this approach has showed
limitations and problems.

This patch removes completely the possible color conversion at
decoding, since it show problems with deinterlacing, for example:

gst-launch-1.0 filesrc location=interlaced.mpg2 ! parsebin ! vampeg2dec ! vadeinterlace ! xvimagesink

Allowing only the surface formats when decoding is more stable.

For color conversion is better to do it explicitly with vapostproc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2531>

2 years agoplayer: Add missing nullable annotations
Marijn Suijten [Tue, 27 Apr 2021 09:59:15 +0000 (11:59 +0200)]
player: Add missing nullable annotations

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2197>

2 years agoplay: Add missing nullable annotations
Marijn Suijten [Tue, 27 Apr 2021 09:58:58 +0000 (11:58 +0200)]
play: Add missing nullable annotations

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2197>

2 years agosys: shm: Define shm_enable and shm_deps before escape meson subdir
Fabian Orccon [Sat, 18 Sep 2021 12:29:25 +0000 (14:29 +0200)]
sys: shm: Define shm_enable and shm_deps before escape meson subdir

Fixes meson configure in tests if the shm plugin is disabled

Fixes #1664

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2534>

2 years agod3d11videosink: Display title of content if possible
Seungha Yang [Fri, 17 Sep 2021 17:27:51 +0000 (02:27 +0900)]
d3d11videosink: Display title of content if possible

Update title text of window (currently it's always "Direct3D11 renderer")
when we are rendering on internal HWND, not external HWND.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2529>

2 years agod3d11videosink: Remove unused enum value
Seungha Yang [Fri, 17 Sep 2021 16:32:11 +0000 (01:32 +0900)]
d3d11videosink: Remove unused enum value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2529>

2 years agomsdkenc: Pass color properties to MediaSDK for encoding
Mengkejiergeli Ba [Wed, 15 Sep 2021 05:59:17 +0000 (13:59 +0800)]
msdkenc: Pass color properties to MediaSDK for encoding

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2523>

2 years agomsdkh265enc: Add profile main10 still picture for hevc
Mengkejiergeli Ba [Wed, 15 Sep 2021 08:32:02 +0000 (16:32 +0800)]
msdkh265enc: Add profile main10 still picture for hevc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2524>

2 years agowaylandsink: Fix double render check
Nicolas Dufresne [Thu, 16 Sep 2021 21:12:58 +0000 (17:12 -0400)]
waylandsink: Fix double render check

Our code does not support rendering twice the same wl_buffer in a row, so it
tries to skip that case, but for this it relied on the GstBuffer pointer,
while the cache actually works at the GstMemory level now. To avoid this
compare the GstWlBuffer instead.

This fixes crash when use in zero-copy with videorate element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2526>

2 years agocodecs: mpeg2decoder: Use tsg framerate for latency.
Víctor Manuel Jáquez Leal [Tue, 7 Sep 2021 07:45:54 +0000 (09:45 +0200)]
codecs: mpeg2decoder: Use tsg framerate for latency.

Latency setting relies on src pad caps, but they aren't set when the
function is called, and latency is never updated.

In order to fix it, this patch uses TSG framerate first, and if it's
not set yet, sinkpad caps are used to get the framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2514>

2 years agod3d11decoder: Refactor for more unified decoding flow
Seungha Yang [Wed, 15 Sep 2021 15:59:37 +0000 (00:59 +0900)]
d3d11decoder: Refactor for more unified decoding flow

... and various code cleanup.

* Move spreaded decoding API calls into one method
Previously, decoding flow of most codecs are
- Call DecoderBeginFrame() on start_picture()
- Call {Get,Release}DecoderBuffer() on decode_slice()
- Call SubmitDecoderBuffers() and DecoderEndFrame() on end_picture()
Such spreaded API calls make it hard to keep track of status
of decoding. Now it will be done at once in a new method.

* Drop a code for non-zero wBadSliceChopping
When bitstream buffer provided by driver is not sufficient
to write compressed bitstream data, host decoder needs to make use
of wBadSliceChopping so that driver can understand there are
multiple bitstream buffer. But it's a bit unrealistic and
not tested. Since FFMpeg's DXVA implemetaion doesn't support it,
we might be able to ignore the case for now.

* Make code more portable
Consider common logic of GstCodecs -> DXVA translation for all D3D APIs
(i,e., D3D9, D3D11, and D3D12).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2525>

2 years agod3d11decoder: Remove duplicated class_init and property related code
Seungha Yang [Wed, 15 Sep 2021 14:41:39 +0000 (23:41 +0900)]
d3d11decoder: Remove duplicated class_init and property related code

Move them into the decoder helper code to remove duplication

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2525>

2 years agod3d11: Get rid of "extern "C"" wrapping for GST_DEBUG_CATEGORY_EXTERN
Seungha Yang [Fri, 10 Sep 2021 15:43:26 +0000 (00:43 +0900)]
d3d11: Get rid of "extern "C"" wrapping for GST_DEBUG_CATEGORY_EXTERN

Instead, change the file defining debug category to cpp

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2525>

2 years agotests: skip cc tests if plugin is disabled
U. Artie Eoff [Tue, 30 Jun 2020 18:15:43 +0000 (11:15 -0700)]
tests: skip cc tests if plugin is disabled

Skip the closedcaption element tests if the
closedcaption option is disabled at compile
time (i.e. -Dclosedcaption=disabled).

v2: rename pangocairo_dep to avoid conflict
with later definition in ext/ttml/meson.build
as suggested by @tpm.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1388>

2 years agocodecs: h264dec: Check bumping again after inserting current picture.
He Junyan [Tue, 31 Aug 2021 09:16:05 +0000 (17:16 +0800)]
codecs: h264dec: Check bumping again after inserting current picture.

In order to get the lowest latency, we can add another bumping check after
inserting the current picture into the DPB immediately. That can avoid
waiting for another decoding circle of the next frame and so the latency
is lower.

Fix: #1628
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2501>

2 years agocodecs: h264: Add protection to to_insert picture in bump check.
He Junyan [Tue, 31 Aug 2021 09:37:11 +0000 (17:37 +0800)]
codecs: h264: Add protection to to_insert picture in bump check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2501>

2 years agocodecs: h264dec: Improve the policy to infer max_num_reorder_frames.
He Junyan [Tue, 31 Aug 2021 08:39:06 +0000 (16:39 +0800)]
codecs: h264dec: Improve the policy to infer max_num_reorder_frames.

The max_num_reorder_frames number can change the way we bumping the
pictures in the DPB. The smaller it is, the lower latency we will
get. So it is important for live mode streams, but it is not given
in VUI parameters sometimes. We now improve the policy to infer it:
1. Never guess it in the "strict" compliance.
2. For baseline and constrained baseline profiles, which do not have
   B frames, set it to 0.
3. For -intra only profiles, set it to 0.
4. Otherwise, not guess it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2501>

2 years agotests: skip aes test if elements not built
U. Artie Eoff [Wed, 15 Sep 2021 03:57:30 +0000 (20:57 -0700)]
tests: skip aes test if elements not built

In ext/aes/meson.build, the aes_dep will return
not-found if -Daes=disabled, regardless of whether
openssl is found or not.  Thus, we don't need a
separate check for the option.  This will also
ensure that aes_dep is always defined and we can
use it in the tests/check/meson.build unit.

Fixes #1660

v2: handle -Daes=disabled, too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2522>

2 years agowpe: Add support for web:// URIs
Philippe Normand [Tue, 31 Aug 2021 16:33:02 +0000 (17:33 +0100)]
wpe: Add support for web:// URIs

The CEF source already supports this. No good reason for wpesrc not too ;)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2503>

2 years agova: h264dec: Try to use ConstrainedBaseline or Main to decode BaseLine.
He Junyan [Fri, 23 Jul 2021 15:38:22 +0000 (23:38 +0800)]
va: h264dec: Try to use ConstrainedBaseline or Main to decode BaseLine.

In the h264, the Baseline profile is widely misused. A lot of streams declare
that they are the Baseline, but in fact they just conform to ConstrainedBaseline.
The features such as FMO and ASO are not used at all.
If the decoder does not strictly conforms to the SPEC, we can just use Baseline
or Main profile to decode it to avoid lots of streams failure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2428>

2 years agocodecs: h264dec: Improve the fast bump for the live mode.
He Junyan [Wed, 28 Jul 2021 15:19:15 +0000 (23:19 +0800)]
codecs: h264dec: Improve the fast bump for the live mode.

We control the policy of fast bump by the profile and the compliance
property. For baseline and constrained baseline profiles, we can use
more radical bump policy. User can also change the bump policy by
setting the compliance property in run time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2432>

2 years agocodecs: h264: Change the low_latency to an enum for dpb_needs_bump().
He Junyan [Wed, 28 Jul 2021 14:48:21 +0000 (22:48 +0800)]
codecs: h264: Change the low_latency to an enum for dpb_needs_bump().

The bool parameter of low_latency is not enough. We have multi policies for
low latency bumping, from the safest to something radical. So we need an enum
to represent the proper latency requirement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2432>

2 years agocodecs: h264dec: Add a compliance property to control behavior.
He Junyan [Mon, 26 Jul 2021 08:09:19 +0000 (16:09 +0800)]
codecs: h264dec: Add a compliance property to control behavior.

Some features such as the low-latency DPB bumping and mapping the
baseline profile as the constrained-baseline profile do not conform
to the H264 offical spec. But in practice, they are very useful and
are widely needed. We add this compliance property to control the
behavior of the decoder, make it fit more requirement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2432>

2 years agodocs: Update cache
Philippe Normand [Sun, 12 Sep 2021 11:23:36 +0000 (12:23 +0100)]
docs: Update cache

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2521>

2 years agova: Update vapostproc documentation.
Víctor Manuel Jáquez Leal [Tue, 7 Sep 2021 08:55:10 +0000 (10:55 +0200)]
va: Update vapostproc documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: Update todo lists, removing deinterlacing.
Víctor Manuel Jáquez Leal [Tue, 7 Sep 2021 08:16:05 +0000 (10:16 +0200)]
va: Update todo lists, removing deinterlacing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agoAdd vadeinterlace element.
Víctor Manuel Jáquez Leal [Mon, 23 Aug 2021 09:24:40 +0000 (11:24 +0200)]
Add vadeinterlace element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: filter: Add past and future frames in GstVaSample.
Víctor Manuel Jáquez Leal [Tue, 24 Aug 2021 11:53:12 +0000 (13:53 +0200)]
va: filter: Add past and future frames in GstVaSample.

And add them in the pipeline structure if they are provided.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: filter: Add gst_va_filter_add_deinterlace_buffer()
Víctor Manuel Jáquez Leal [Tue, 24 Aug 2021 11:33:29 +0000 (13:33 +0200)]
va: filter: Add gst_va_filter_add_deinterlace_buffer()

This function decorates gst_va_filter_add_filter_buffer() to get the
number of past and future frames to hold, given the method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: filter: Add deinterlacing method parameter.
Víctor Manuel Jáquez Leal [Mon, 21 Dec 2020 17:17:24 +0000 (18:17 +0100)]
va: filter: Add deinterlacing method parameter.

For exposing that gobject parameter a new helper function is added:

gst_va_filter_install_deinterlace_properties()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: filter: Protect filters array of overwrite.
Víctor Manuel Jáquez Leal [Mon, 23 Aug 2021 14:29:36 +0000 (16:29 +0200)]
va: filter: Protect filters array of overwrite.

It's possible to modify the filters array from another GStremer
thread, and the post-processing operation is not atomic, so the filter
array is reffed while the VA pipeline is processed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: filter: Add helper function to query pipeline caps.
Víctor Manuel Jáquez Leal [Mon, 23 Aug 2021 13:24:55 +0000 (15:24 +0200)]
va: filter: Add helper function to query pipeline caps.

This function is going to be shared for future deinterlace filter
processing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: filter: Shuffle _destroy_filters_unlocked().
Víctor Manuel Jáquez Leal [Mon, 23 Aug 2021 13:16:16 +0000 (15:16 +0200)]
va: filter: Shuffle _destroy_filters_unlocked().

In order to put it near to its caller.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agovapostproc: Move up color balance detection to plugin.
Víctor Manuel Jáquez Leal [Tue, 10 Aug 2021 15:55:43 +0000 (17:55 +0200)]
vapostproc: Move up color balance detection to plugin.

In order to install the color balance interface, a GstVaFilter is
instantiated and queried to know if it supports color balance
filter. It was done just after the GObject was registered. Now, it's
done before.

The reason of this change is that deinterlace element has to be
registered only if deinterlace filter is available, using only one
instantiate of GstVaFilter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: basetransform: Update documentation.
Víctor Manuel Jáquez Leal [Tue, 7 Sep 2021 09:35:09 +0000 (11:35 +0200)]
va: basetransform: Update documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: basetransform: Add autoptr clean up function.
Víctor Manuel Jáquez Leal [Thu, 9 Sep 2021 16:26:56 +0000 (18:26 +0200)]
va: basetransform: Add autoptr clean up function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agova: basetransform: Use copy_metadata() at buffer import.
Víctor Manuel Jáquez Leal [Mon, 23 Aug 2021 16:44:30 +0000 (18:44 +0200)]
va: basetransform: Use copy_metadata() at buffer import.

Instead of using only gst_buffer_copy_into() use copy_metadata()
vmethod to copy what's needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agovapostproc: don't chain up transform_meta()
Víctor Manuel Jáquez Leal [Mon, 23 Aug 2021 08:40:32 +0000 (10:40 +0200)]
vapostproc: don't chain up transform_meta()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>

2 years agocodecs: gstvp9statefulparser: feature_data should be 0 if feature_enable is 0
Daniel Almeida [Thu, 29 Jul 2021 15:20:30 +0000 (12:20 -0300)]
codecs: gstvp9statefulparser: feature_data should be 0 if feature_enable is 0

The spec says in 6.2.11 that feature_data[i][j] should be zero if
feature_enabled[i][j] is zero. Instead we retained the old value in the parser.
Fix it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2449>

2 years agogsth264parser: Fix handling of NALs with emulation byte set
Marek Vasut [Wed, 8 Sep 2021 03:28:22 +0000 (05:28 +0200)]
gsth264parser: Fix handling of NALs with emulation byte set

In case a set of NALs with emulation_prevention_three_byte is decoded using
hardware decoder like Hantro G1, wrong struct v4l2_ctrl_h264_decode_params
.dec_ref_pic_marking_bit_size is passed into the kernel, which results in
decoding artifacts. Subtract the number of emulation three bytes from the
.dec_ref_pic_m->bit_size to get the correct bit size and avoid having these
artifacts. Apply the exact same fix to slice->pic_order_cnt_bit_size as well.

The following NALs (7, 8, 6, 5) decode with artifacts,
.dec_ref_pic_marking_bit_size is set to 10 without this patch.
00000000  00 00 00 01 27 4d 00 20  89 8b 60 3c 04 bf 2e 02  |....'M. ..`<....|
00000010  d4 18 04 18 c0 c0 01 77  00 00 5d c1 7b df 05 00  |.......w..].{...|
00000020  00 00 01 28 ee 1f 20 00  00 01 06 05 10 b9 ed b9  |...(.. .........|
00000030  30 5d 21 4b 71 83 71 2c  10 a3 14 bb 29 80 00 00  |0]!Kq.q,....)...|
00000040  01 25 b8 00 05 00 00 03  03 7f fa 78 1e e7 fd fe  |.%.........x....|
                         ^^^^^^^^^^^^--- emulation 3 byte
00000050  b4 62 7a 31 ff 7d 81 fd  26 d8 62 b6 d6 25 46 ae  |.bz1.}..&.b..%F.|

The following NALs (7, 8, 6, 5) decode fine,
.dec_ref_pic_marking_bit_size is set to 2 without this patch.
00000000  00 00 00 01 27 4d 00 20  89 8b 60 3c 04 bf 2e 02  |....'M. ..`<....|
00000010  d4 18 04 18 c0 c0 01 77  00 00 5d c1 7b df 05 00  |.......w..].{...|
00000020  00 00 01 28 ee 1f 20 00  00 01 06 05 10 b9 ed b9  |...(.. .........|
00000030  30 5d 21 4b 71 83 71 2c  10 a3 14 bb 29 80 00 00  |0]!Kq.q,....)...|
00000040  01 25 b8 00 04 c0 00 03  7f fa 78 1e e7 fd fe b4  |.%........x.....|
00000050  62 7a 31 ff 7d 81 fd 26  d8 62 b6 d6 25 46 ae ce  |bz1.}..&.b..%F..|

Fixes: d0d65fa875 ("codecparsers: h264: record dec_ref_pic_marking() size")
Fixes: 0cc7d6f093 ("codecparsers: h264: record pic_order_cnt elements size")
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2517>

2 years agogsth264parser: reject memory management control op greater than 6
Aaron Boxer [Fri, 3 Sep 2021 18:57:09 +0000 (14:57 -0400)]
gsth264parser: reject memory management control op greater than 6

This prevents assertion from being thrown in
gst_h264_dpb_perform_memory_management_control_operation
if corrupt NAL has a control op greater than 6

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2508>

2 years agomsdk: Adjust the plugin and factories description based on MFX_VERSION.
Ung, Teng En [Tue, 24 Aug 2021 09:59:59 +0000 (09:59 +0000)]
msdk: Adjust the plugin and factories description based on MFX_VERSION.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2485>

2 years agovulkan: don't link to XOpenDisplay in documentation
Mathieu Duponchelle [Wed, 8 Sep 2021 15:32:30 +0000 (17:32 +0200)]
vulkan: don't link to XOpenDisplay in documentation

hotdoc doesn't know about that symbol

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2518>

2 years agotsdemux: Fix the check for the wrong event type
Gilbok Lee [Tue, 7 Sep 2021 01:34:49 +0000 (10:34 +0900)]
tsdemux: Fix the check for the wrong event type

Change-Id: I54222748b3432b5f76392bb6567b0359c43dbb90

2 years agompeg2enc: Only allow 1 pending frame for encoding
Jan Schmidt [Mon, 30 Aug 2021 13:26:39 +0000 (23:26 +1000)]
mpeg2enc: Only allow 1 pending frame for encoding

Having an unlimited input queue is very bad if the
encoder can't run at real-time. Eventually it will
consume all RAM. I don't really see any reason to
have more than 1 outstanding encoded frame, so
remove the queue and limit things to 1 pending frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2499>

2 years agotsdemux: Save custom event(HLSMedia info) when program is NULL
Gilbok Lee [Mon, 6 Sep 2021 04:52:58 +0000 (13:52 +0900)]
tsdemux: Save custom event(HLSMedia info) when program is NULL

Change-Id: Ida60c066ea5d069ccb7a64605317ee24805060bd

2 years agoMerge changes from topic "webrtc_based_on_1.19.1" into tizen
Sangchul Lee [Mon, 6 Sep 2021 04:53:59 +0000 (04:53 +0000)]
Merge changes from topic "webrtc_based_on_1.19.1" into tizen

* changes:
  tests/webrtc: check for more sdp things across the board
  webrtc: don't generate duplicate rtx payloads when bundle-policy is set
  webrtc ice: Add 'min/max-rtp-port' props for setting RTP port range
  webrtc ice: Only ever request one component, it's always rtcpmux
  webrtcbin: use regular ice nomination by default
  webrtc: expose transport property on sender and receiver
  webrtcbin: try harder not to pick duplicate media ids

2 years agowpe: Fix race condition on teardown
Thibault Saunier [Wed, 1 Sep 2021 21:35:45 +0000 (17:35 -0400)]
wpe: Fix race condition on teardown

There was a race when going to PAUSED while pushing a buffer to the
pipeline process (where we weren't even cancelling anything).

This rework base all the cancellation around the GCancellable
"cancelled" signal trying to ensure that the streaming thread will not
block once a cancel operation happens.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>

2 years agowpe: Use the new element.get_current_running_time API
Thibault Saunier [Wed, 1 Sep 2021 21:26:04 +0000 (17:26 -0400)]
wpe: Use the new element.get_current_running_time API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>

2 years agowpe: Mark first buffer as starting at 0
Thibault Saunier [Wed, 1 Sep 2021 21:24:45 +0000 (17:24 -0400)]
wpe: Mark first buffer as starting at 0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>

2 years agotests/webrtc: check for more sdp things across the board
Matthew Waters [Fri, 19 Mar 2021 05:36:41 +0000 (16:36 +1100)]
tests/webrtc: check for more sdp things across the board

e.g.

- test for a=setup:$val and direction attributes in all tests
- test number of media sections
- test number of formats in each m= section (for audio/video)
- test no duplicate formats

Change-Id: I9cbb75f9f127bc662f9f909bdc8bb33cd42326f6
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2093>

2 years agowebrtc: don't generate duplicate rtx payloads when bundle-policy is set
Matthew Waters [Mon, 1 Mar 2021 09:53:53 +0000 (20:53 +1100)]
webrtc: don't generate duplicate rtx payloads when bundle-policy is set

It was possible to generate a SDP that had an RTX payload type
that matched one of the media payload types when providing caps via
codec_preferences without any sink pads.

Fixes

m=video 9 UDP/TLS/RTP/SAVPF 96
...
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 nack pli
a=fmtp:96 apt=96

Change-Id: I0b2d360cb40abcf5a61035673d43f15a40fc09fa
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2046>

2 years agowebrtc ice: Add 'min/max-rtp-port' props for setting RTP port range
Ilya Kreymer [Thu, 15 Aug 2019 15:25:26 +0000 (08:25 -0700)]
webrtc ice: Add 'min/max-rtp-port' props for setting RTP port range

default min port == 0, max port == 65535 -- if min port == 0, uses existing random port selection (range ignored)
add 'gathering_started' flag to avoid changing ports after gathering has started
validity checks: min port <= max port enforced, error thrown otherwise
include tests to ensure port range is being utilized (by @hhardy)

Change-Id: I5fcc747bb3416c37e2dfdb6d83c9552e30583212
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/119>

2 years agowebrtc ice: Only ever request one component, it's always rtcpmux
Olivier Crête [Thu, 25 Feb 2021 16:58:57 +0000 (11:58 -0500)]
webrtc ice: Only ever request one component, it's always rtcpmux

Change-Id: Ic72fcc70844b5869961efed8878f815a087e71a9
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/119>