platform/upstream/gstreamer.git
4 years agogstcurlhttpsink: Set 'Expect: 100-continue'-header
Mats Lindestam [Sun, 17 May 2020 08:27:03 +0000 (10:27 +0200)]
gstcurlhttpsink: Set 'Expect: 100-continue'-header

In the upgrade of libcurl from 7.64.1 to 7.69.1 the
EXPECT_100_THRESHOLD has been increased from 1 Kb to 1 Mb
(see https://curl.haxx.se/mail/lib-2020-01/0050.html).
This caused the gstcurlhttpsink to not being able to rewind
and resend in the case, e.g. response '401 Unauthorized'.
Now the 'Expect: 100-continue'-header is explicitly set in
the gstcurlhttpsink.

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

4 years agoopensles: Remove hard-coded buffer-/latency-time values
Arun Raghavan [Wed, 29 Apr 2020 20:43:06 +0000 (16:43 -0400)]
opensles: Remove hard-coded buffer-/latency-time values

These were originally required in early Android versions, but are no
longer needed.

4 years agomediafoundation: Refactor GstMFSourceObject implementation
Seungha Yang [Thu, 14 May 2020 11:47:06 +0000 (20:47 +0900)]
mediafoundation: Refactor GstMFSourceObject implementation

* Move CoInitializeEx/CoUninitialize pair into thread function in order to
  ensure MTA COM thread
* Move common code to baseclass

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

4 years agomediafoundation: Remove COM thread constraints from GstMFTransform object
Seungha Yang [Thu, 14 May 2020 11:17:33 +0000 (20:17 +0900)]
mediafoundation: Remove COM thread constraints from GstMFTransform object

Move CoInitializeEx/CoUninitialize pair into our dedicated thread so that
we can ensure COM thread is MTA. This will remove thread constraints
around plugin init.

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

4 years agoamcvideodec: fix sync meta copying not taking a reference
Matthew Waters [Fri, 15 May 2020 03:52:06 +0000 (13:52 +1000)]
amcvideodec: fix sync meta copying not taking a reference

Fixup for
9b9e39be248389370e80b429da5a528418733483: amc: Fix crash when a sync_meta survives its sink
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/603

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

4 years agosrtobject: add streamid property
J. Kim [Mon, 13 Apr 2020 09:09:55 +0000 (18:09 +0900)]
srtobject: add streamid property

The stream id starts with '#!::' according to SRT Access Control[1],
but GstURI requires URI encoded string.This commit introduces additional
property to set the id by normal string.

[1] https://github.com/Haivision/srt/blob/master/docs/AccessControl.md

4 years agomeson: Pass native: false to add_languages()
Nirbheek Chauhan [Mon, 11 May 2020 23:30:36 +0000 (05:00 +0530)]
meson: Pass native: false to add_languages()

This is needed for cross-compiling without a build machine compiler
available. The option was added in 0.54, but we only need this in
Cerbero and it doesn't affect older versions so it should be ok.
Will only cause a spurious warning.

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

4 years agompegtsmux: detect and ignore gap buffers
Alex Hoenig [Tue, 12 May 2020 14:55:45 +0000 (10:55 -0400)]
mpegtsmux: detect and ignore gap buffers

Fixes #1291.  Without this, when a stream has gaps and then resumes, the next buffer PTS that is written to the TS is given the PTS of the first gap.

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

4 years agoccconverter: check fraction multiply for overflow
Matthew Waters [Tue, 12 May 2020 06:05:01 +0000 (16:05 +1000)]
ccconverter: check fraction multiply for overflow

It should not happen and if it does, something went very wrong earlier

CID 1463350

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

4 years agoccconverter: tighten up a couple of NULL checks
Matthew Waters [Tue, 12 May 2020 06:01:42 +0000 (16:01 +1000)]
ccconverter: tighten up a couple of NULL checks

CID 1463347
CID 1463346
CID 1463345

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

4 years agoccconverter: fix unintialized read of mapped output info in error case
Matthew Waters [Tue, 12 May 2020 06:00:58 +0000 (16:00 +1000)]
ccconverter: fix unintialized read of mapped output info in error case

We only need to gst_buffer_unmap() if we have gst_buffer_map()ed.  In
most cases we can shorten the lenght of time we need to map the output
buffer.  Fix similar occurences elsewhere.

CID 1463349

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

4 years agoccconverter: fix uninitialized read in error case
Matthew Waters [Tue, 12 May 2020 05:24:32 +0000 (15:24 +1000)]
ccconverter: fix uninitialized read in error case

CID 1463351

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

4 years agov4l2codecs: Fix compilation error on FreeBSD
Ting-Wei Lan [Sun, 10 May 2020 09:38:11 +0000 (17:38 +0800)]
v4l2codecs: Fix compilation error on FreeBSD

This commit does the following things to fix compilation on FreeBSD:

1. Add required typedefs to linux/types-compat.h.
2. Remove unnecessary include linux/ioctl.h and replace linux/types.h
   with linux/types-compat.h. Both files do not exist on FreeBSD.
3. Check the header including makedev macro. FreeBSD does not have
   sys/sysmacros.h, and including it unconditionally causes error.

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

4 years agoccconverter: implement discont handling
Matthew Waters [Mon, 11 May 2020 07:14:09 +0000 (17:14 +1000)]
ccconverter: implement discont handling

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

4 years agoccconverter: use a better padding byte sequence for writing cdp
Matthew Waters [Thu, 7 May 2020 13:59:30 +0000 (23:59 +1000)]
ccconverter: use a better padding byte sequence for writing cdp

0xf8 can be interpreted as cea608 data at the beginning of a cdp packet
as the cc_valid bit is not checked when cc_valid in (0b00 or 0b01).

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

4 years agoccconverter: split temporary storage into 3
Matthew Waters [Thu, 19 Mar 2020 06:42:13 +0000 (17:42 +1100)]
ccconverter: split temporary storage into 3

Instead of storing the raw cc_data, store the 2 cea608 fields individually
as well as the ccp data.

Simply copying the input cc_data to the output cc_data violates a number of
requirements in the cea708 specification.  The most prominent being, that
cea608 triples must be placed at the beginning of each cdp.

We also need to comply with the framerate-dpendent limits for both the
cea608 and the ccp data which may involve splitting or merging some
cea608 data but not ccp data or vice versa.

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

4 years agoccconvert: compact input cc_data where possible
Matthew Waters [Tue, 17 Mar 2020 06:23:44 +0000 (17:23 +1100)]
ccconvert: compact input cc_data where possible

Skip over padding cc_data triples.

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

4 years agoccconverter: implement support for CDP framerate conversions
Matthew Waters [Thu, 12 Mar 2020 23:54:02 +0000 (10:54 +1100)]
ccconverter: implement support for CDP framerate conversions

- Any format involving CDP is supported.
- Time codes (if present) are scaled as well.

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

4 years agotests/ccconverter: test the time codes are successfully passed through
Matthew Waters [Thu, 12 Mar 2020 05:08:54 +0000 (16:08 +1100)]
tests/ccconverter: test the time codes are successfully passed through

Where time codes are not stored in the caption data themselves

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

4 years agoccconverter: introduce define for max cdp packet length
Matthew Waters [Thu, 12 Mar 2020 04:06:46 +0000 (15:06 +1100)]
ccconverter: introduce define for max cdp packet length

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

4 years agoccconverter: don't rely on external state in *_internal()
Matthew Waters [Thu, 12 Mar 2020 04:01:02 +0000 (15:01 +1100)]
ccconverter: don't rely on external state in *_internal()

This allows using the _internal() variants for simply converting some
caption data without relying on any external state.

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

4 years agoccconverter: cc_count limits are per framerate
Matthew Waters [Thu, 12 Mar 2020 03:06:49 +0000 (14:06 +1100)]
ccconverter: cc_count limits are per framerate

Enforce this and add a test for cdp input being too large.

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

4 years agoccconverter: refactor cdp id, fps, max_cc_count into a table
Matthew Waters [Thu, 12 Mar 2020 01:54:41 +0000 (12:54 +1100)]
ccconverter: refactor cdp id, fps, max_cc_count into a table

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

4 years agoccconverter: pivot to implementing generate_output
Matthew Waters [Wed, 11 Mar 2020 22:55:40 +0000 (09:55 +1100)]
ccconverter: pivot to implementing generate_output

Will make a n-n buffer element much easier to implement.

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

4 years agovulkan: Drop use of VK_RESULT_BEGIN_RANGE
Jan Alexander Steffens (heftig) [Sat, 9 May 2020 17:59:46 +0000 (19:59 +0200)]
vulkan: Drop use of VK_RESULT_BEGIN_RANGE

This was removed in Vulkan 1.2.140.

> Shortly after 2020-04-24, we will be removing the automatically
> generated `VK_*_BEGIN_RANGE`, `VK_*_END_RANGE`, and `VK_*_RANGE_SIZE`
> tokens from the Vulkan headers. These tokens are currently defined for
> some enumerated types, but are explicitly not part of the Vulkan API.
> They existed only to support some Vulkan implementation internals,
> which no longer require them. We will be accepting comments on this
> topic in [#1230], but we strongly suggest any external projects using
> these tokens immediately migrate away from them.

[#1230]: https://github.com/KhronosGroup/Vulkan-Docs/issues/1230

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

4 years agoaudiobuffersplit: Perform discont tracking on running time
Sebastian Dröge [Fri, 8 May 2020 19:36:01 +0000 (22:36 +0300)]
audiobuffersplit: Perform discont tracking on running time

Otherwise we would have to drain on every segment event. Like this we
can handle segment events that don't cause a discontinuity in running
time to be handled without draining.

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

4 years agoaudiobuffersplit: Keep incoming and outgoing segments separate
Sebastian Dröge [Fri, 8 May 2020 18:36:44 +0000 (21:36 +0300)]
audiobuffersplit: Keep incoming and outgoing segments separate

We might have to drain already queued input based on the old segment
before forwarding the new segment event. The new segment is only
forwarded after a discont as otherwise we might cause unnecessary
timestamp jumps as we output buffers timestamped based on sample counts.

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

4 years agowebrtc: move filtering properties to webrtcice
Chris Ayoup [Thu, 30 Apr 2020 16:01:13 +0000 (16:01 +0000)]
webrtc: move filtering properties to webrtcice

We want webrtcbin to only expose properties that are defined in JSEP, so
these additional properties should be moved out.  In order to access
them, the webrtcice instance is exposed from webrtcbin.

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

4 years agowebrtc: allow setting local IP addresses
Chris Ayoup [Fri, 17 Apr 2020 18:00:59 +0000 (18:00 +0000)]
webrtc: allow setting local IP addresses

If a local IP address is specified, ICE gathering can be much faster
in environments where there are multiple IP addreses but only some are
usable (for example, if you are running docker on the machine).

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

4 years agowebrtc: Allow toggling TCP and UDP candidates
Chris Ayoup [Thu, 16 Apr 2020 22:37:35 +0000 (22:37 +0000)]
webrtc: Allow toggling TCP and UDP candidates

Add some properties to allow TCP and UDP candidates to be toggled.  This
is useful in cases where someone is using this element in an environment
where it is known in advance whether a given transport will work or not
and will prevent wasting time generating and checking candidate pairs
that will not succeed.

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

4 years agomsdkvpp: clear the parameters after closing the session
Haihao Xiang [Thu, 2 Apr 2020 02:44:31 +0000 (10:44 +0800)]
msdkvpp: clear the parameters after closing the session

Otherwise the stale values are used for the new process.

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

4 years agospanplc: Don't segfault when retrieving the stats property without a spanplc context
Sebastian Dröge [Sun, 10 May 2020 08:23:02 +0000 (11:23 +0300)]
spanplc: Don't segfault when retrieving the stats property without a spanplc context

For example when trying to get the property value in NULL state.

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

4 years agoonviftimestamp: Add missing `break` in set_property()
Sebastian Dröge [Sun, 10 May 2020 08:16:44 +0000 (11:16 +0300)]
onviftimestamp: Add missing `break` in set_property()

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

4 years agotest: h265parse: Test parsing buffer the ends with half a NAL header
Nicolas Dufresne [Thu, 7 May 2020 18:05:16 +0000 (14:05 -0400)]
test: h265parse: Test parsing buffer the ends with half a NAL header

This test cover the case where we are parsing, but our current buffers ends
with half the NAL header (which is 2 bytes in HEVC). Previously we would
throw an error message on the bus.

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

4 years agoh265parse: Ensure parsing ends on start-code + full header
Nicolas Dufresne [Thu, 7 May 2020 17:59:33 +0000 (13:59 -0400)]
h265parse: Ensure parsing ends on start-code + full header

The parser is used all over the place assuming that after calling
gst_h265_parser_identify_nalu(), the start-code found is can also be
identified. In H264 this works, because scan_for_start_code rely on
gst_byte_reader_masked_scan_uint32() that ensures that 1 byte passed the 3
bytes start code is found. But for HEVC, we need two bytes to identify the
following NAL.

This patch will return NO_NAL_END, even if a start code is found in the case
there was not enough bytes. This solution was chosen to maintain backward
compatibility, and reduce complexicity.

Fixes #1287

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

4 years agotest: h264/h265: Add test for four bytes start code initial skip
Nicolas Dufresne [Thu, 7 May 2020 15:09:23 +0000 (11:09 -0400)]
test: h264/h265: Add test for four bytes start code initial skip

This test detects if the parser have skipped too much and dropped meaninful
NALs.

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

4 years agotest: h264/h265: Constify all test buffers
Nicolas Dufresne [Thu, 7 May 2020 16:02:40 +0000 (12:02 -0400)]
test: h264/h265: Constify all test buffers

This ensure that no test modify other tests data.

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

4 years agoh264/h265parse: Fix initial skip
Nicolas Dufresne [Thu, 7 May 2020 15:06:45 +0000 (11:06 -0400)]
h264/h265parse: Fix initial skip

Account for start codes possibly be 4 bytes. For HEVC, also take into
account that we might be missing only one of the two identification
bytes.

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

4 years agoh265parse: Ensure correct timestamps
Nicolas Dufresne [Thu, 7 May 2020 12:29:28 +0000 (08:29 -0400)]
h265parse: Ensure correct timestamps

If the input has a miss-placed filler zero byte (e.g. a filler without a 4
bytes start code on the next NAL), we would endup using the same timestamp
twice. Ask the base class to read the timestamp from the buffer were the NAL
actually starts.

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

4 years agoh264parser: Removed impossible error case
Nicolas Dufresne [Thu, 7 May 2020 11:43:30 +0000 (07:43 -0400)]
h264parser: Removed impossible error case

Same as done for H264, this error was trying to catch the case where we had
a start code without any bytes afterward. This will never happen since the
start code scanner only returns a match if there is one byte after start
code (pattern 0x00000100 / mask 0xffffff00). In H264, once byte is sufficient
to identify the NALU.

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

4 years agoh264parse: Properly handle 4 bytes start code
Nicolas Dufresne [Thu, 7 May 2020 02:28:34 +0000 (22:28 -0400)]
h264parse: Properly handle 4 bytes start code

This will stop stripping four bytes start code. This was fixed and broken
again as it was causing the a timestamp shift. We now call
gst_base_parse_set_ts_at_offset() with the offset of the first NAL to ensure
that fixing a moderatly broken input stream won't affect the timestamps. We
also fixes the unit test, removing a comment about the stripping behaviour not
being correct.

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

4 years agoh265parser: Fix NAL size check for identification
Nicolas Dufresne [Thu, 7 May 2020 02:18:12 +0000 (22:18 -0400)]
h265parser: Fix NAL size check for identification

Unlike H264, H265 requires 2 bytes after the start code to allow NAL
identification. This would otherwise report a broken NAL and skip
important data.

Fixes #1287

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

4 years agoh265parser: Removed impossible error case
Nicolas Dufresne [Thu, 7 May 2020 02:13:45 +0000 (22:13 -0400)]
h265parser: Removed impossible error case

This error was trying to catch the case where we had a start code without any
bytes afterward. This will never happen since the start code scanner only returns
a match if there is one byte adter start code (pattern 0x00000100 / mask
0xffffff00).

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

4 years agomsdk: bufferpool: set alignment to video meta
Xu Guangxin [Wed, 29 Apr 2020 08:19:08 +0000 (16:19 +0800)]
msdk: bufferpool: set alignment to video meta

else gst_video_meta_validate_alignment will report error like
"videometa gstvideometa.c:416:gst_video_meta_validate_alignment: Stride of plane 0 defined in meta (384) is different from the one computed from the alignment (320)"

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

4 years agotimecodestamper: Unref latency query after usage
Sebastian Dröge [Wed, 6 May 2020 17:04:17 +0000 (20:04 +0300)]
timecodestamper: Unref latency query after usage

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

4 years agomusepackdec: Don't fail all queries if no sample rate is known yet
Sebastian Dröge [Wed, 6 May 2020 08:47:56 +0000 (11:47 +0300)]
musepackdec: Don't fail all queries if no sample rate is known yet

The sample rate is only needed for the POSITION/DURATION queries and we
would otherwise fail important queries like the CAPS query.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/498

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

4 years agoopencv: allow compilation against 4.3.x
Luka Blaskovic [Fri, 1 May 2020 05:46:56 +0000 (07:46 +0200)]
opencv: allow compilation against 4.3.x

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

4 years agowebrtc: fix an off-by-one calculating low-threshold
Matthew Waters [Wed, 6 May 2020 05:36:19 +0000 (15:36 +1000)]
webrtc: fix an off-by-one calculating low-threshold

We were not signalling low-threshold when the previous amount was at
exactly the low-threshold mark.

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

4 years agowebrtc: fix a slightly racy test
Matthew Waters [Wed, 6 May 2020 05:35:26 +0000 (15:35 +1000)]
webrtc: fix a slightly racy test

There is no guarantee that the peer data channel has transitioned to
open when we do.

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

4 years agowebrtc: remove debugging leftover
Matthew Waters [Wed, 6 May 2020 05:49:05 +0000 (15:49 +1000)]
webrtc: remove debugging leftover

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

4 years agowebrtc: always reply to a promise
Matthew Waters [Tue, 5 May 2020 14:30:34 +0000 (00:30 +1000)]
webrtc: always reply to a promise

Otherwise, we defeat the purpose of a promise.

We were not replying when the state was closed.

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

4 years agowebrtc: name threads based on the element name
Matthew Waters [Tue, 5 May 2020 14:25:45 +0000 (00:25 +1000)]
webrtc: name threads based on the element name

Makes debugging a busy loop possibly easier

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

4 years agotests/webrtc: fix a data channel leak in a test
Matthew Waters [Tue, 5 May 2020 07:15:51 +0000 (17:15 +1000)]
tests/webrtc: fix a data channel leak in a test

test_data_channel_create_after_negotiate overrides the data_channel_data
without ever freeing it.

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

4 years agowebrtc: correctly use the pad template
Matthew Waters [Tue, 5 May 2020 07:14:46 +0000 (17:14 +1000)]
webrtc: correctly use the pad template

GstHarness uses this for releasing request pads correctly. Fixes
numerous leaks in the webrtc unit tests.

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

4 years agowebrtc: Fix a couple of renegotiation races
Matthew Waters [Tue, 5 May 2020 04:35:10 +0000 (14:35 +1000)]
webrtc: Fix a couple of renegotiation races

When negotiating the SDP we should only connect the streams that are
actually mentioned in the SDP.  All other streams are not relevant at
this time and would likely be part of a future SDP update.  Fixes a
couple of the renegotiation webrtc unit tests.

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

4 years agotests/webrtc: move bus thread creation earlier
Matthew Waters [Tue, 5 May 2020 04:33:34 +0000 (14:33 +1000)]
tests/webrtc: move bus thread creation earlier

Fixes a small deadlock race where the bus watch GSource could execute before
the unlock mutex GSource.

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

4 years agotests: add libnice to the plugin loading whitelist
Matthew Waters [Mon, 4 May 2020 04:39:45 +0000 (14:39 +1000)]
tests: add libnice to the plugin loading whitelist

Allows webrtcbin to actually unit test some negotiation scenarios.
Without this, only two of the possible 33 tests are being executed.

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

4 years agov4l2slvp8dec: Flip the meaning of segment_feature_mode
Nicolas Dufresne [Tue, 5 May 2020 16:01:21 +0000 (12:01 -0400)]
v4l2slvp8dec: Flip the meaning of segment_feature_mode

In section 9.3.4 a), segment_feature_mode have 0 for absolute and 1 for delta,
while in 19.2, it says the opposite. But the reference code, which usually
rules over the text state that 1 means absolute:

 if (hdr->update_data)
 {
     hdr->abs = bool_get_bit(bool);

And uses it with that meaning to decide weither to override the existing value
or just add the detla. This fixes multiple decoding issues.

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

4 years agov4l2slvp8dec: Copy header version
Nicolas Dufresne [Mon, 4 May 2020 19:33:39 +0000 (15:33 -0400)]
v4l2slvp8dec: Copy header version

This field was not copied.

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

4 years agov4l2slvp8dec: Add debugging for reference frames
Nicolas Dufresne [Mon, 4 May 2020 18:54:23 +0000 (14:54 -0400)]
v4l2slvp8dec: Add debugging for reference frames

This simply trace the frame number of the references used for decoding.

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

4 years agov4l2slvp8dec: Ensure width/height is always set
Nicolas Dufresne [Mon, 4 May 2020 18:52:45 +0000 (14:52 -0400)]
v4l2slvp8dec: Ensure width/height is always set

Our parser strictly read the bitstream. As it's known from DXVA that always
having a valid width/height might be needed, use the cached width/height
instead of the value from the parser. This didn't impact Hantro driver.

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

4 years agov4l2slvp8dec: Fix debug category name
Nicolas Dufresne [Mon, 4 May 2020 18:52:02 +0000 (14:52 -0400)]
v4l2slvp8dec: Fix debug category name

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

4 years agoiqa: Fix all leaks in error path
Edward Hervey [Tue, 5 May 2020 15:40:51 +0000 (17:40 +0200)]
iqa: Fix all leaks in error path

CID #1456049
CID #1456080
CID #1456083

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

4 years agotest: h265parser: Add a test case for SCC extension.
He Junyan [Sat, 28 Mar 2020 16:45:47 +0000 (00:45 +0800)]
test: h265parser: Add a test case for SCC extension.

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

4 years agolibs: parser: h265: Add SCC extension support.
He Junyan [Sat, 28 Mar 2020 06:46:13 +0000 (14:46 +0800)]
libs: parser: h265: Add SCC extension support.

Add support for screen content coding extensions profiles.

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

4 years agod3d11vp8dec: Remove useless assign operation
Seungha Yang [Tue, 5 May 2020 16:25:04 +0000 (01:25 +0900)]
d3d11vp8dec: Remove useless assign operation

It's already been done in the line just above.

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

4 years agocheck: Fix dash mpd unit test
Edward Hervey [Tue, 5 May 2020 14:07:40 +0000 (16:07 +0200)]
check: Fix dash mpd unit test

Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstMPDBaseURLNode' has no property named 'service location'

Stack trace:
gst_debug_get_stack_trace (gstinfo.c:3021)
gst_check_log_critical_func (gstcheck.c:281)
g_logv (gmessages.c:1350)
g_log (gmessages.c:1415)
g_object_set_valist (gobject.c:2327)
gst_mpd_client_add_baseurl_node (gstmpdclient.c:3142)
dash_mpdparser_check_mpd_client_set_methods (dash_mpd.c:6192)
srunner_run_tagged (check_run.c:465)
gst_check_run_suite (gstcheck.c:1086)
main (dash_mpd.c:6521)
__libc_start_main (libc-start.c:308)
_start (/home/bilboed/work/devel/gst-build/build/subprojects/gst-plugins-bad/tests/check/elements_dash_mpd:0x40554a)

4 years agod3d11window: Fix processor output view resource leak
Seungha Yang [Tue, 5 May 2020 11:32:53 +0000 (20:32 +0900)]
d3d11window: Fix processor output view resource leak

Because this object holds reference to native d3d11 device handle internally,
related native d3d11 objects would be leaked as well.

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

4 years agosctp: enable usrsctp debug when supported
Matthew Waters [Fri, 1 May 2020 04:19:56 +0000 (14:19 +1000)]
sctp: enable usrsctp debug when supported

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

4 years agotests: curlhttpsrc: fix compiler warning on raspbian
Tim-Philipp Müller [Sun, 3 May 2020 10:05:32 +0000 (10:05 +0000)]
tests: curlhttpsrc: fix compiler warning on raspbian

tests/check/elements/curlhttpsrc.c:142:14: warning: format ‘%lu’
expects argument of type ‘long unsigned int’, but argument 8 has
type ‘gsize’ {aka ‘unsigned int’}

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

4 years agonvcodec: fix compiler warning in certain setups
Tim-Philipp Müller [Sun, 3 May 2020 09:59:45 +0000 (09:59 +0000)]
nvcodec: fix compiler warning in certain setups

Fixes gstnvh264dec.c:648:12: warning: unused variable ‘ret’
compiler warning on raspbian where HAVE_NVCODEC_GST_GL is
not defined.

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

4 years agoavtpsink: Log that AVTPDU transmission failure is due lateness
Ederson de Souza [Fri, 3 Apr 2020 17:41:44 +0000 (10:41 -0700)]
avtpsink: Log that AVTPDU transmission failure is due lateness

As ENOBUFS is not really clear about what is going on, let's check
socket error queue to see if packets are being dropped due being late.

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

4 years agoavtpsink: Accept buffers that fall out of segment
Ederson de Souza [Fri, 3 Apr 2020 17:41:31 +0000 (10:41 -0700)]
avtpsink: Accept buffers that fall out of segment

Proper calculate running time for buffers that are out of current
segment and try to honor them.

A typical case is for AVTP packets coming from avtpcvfpay element, as
those may have DTS that falls out of segment (which is about PTS).

By using gst_segment_to_running_time_full(), avtpsink can properly
calculate when to transmit those buffers.

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

4 years agoavtpcvfpay: Warn about timestamp issues on non-flushing seek
Ederson de Souza [Fri, 3 Apr 2020 17:41:04 +0000 (10:41 -0700)]
avtpcvfpay: Warn about timestamp issues on non-flushing seek

Seek events will cause new segments to be sent to avtpcvfpay, and for
flushing seeks, a pipeline running time reset. This running time
reset, which effectively changes pipeline base time, will cause
avtpcvfpay element to generate incorrect DTS for the initial set of
buffers sent after FLUSH_STOP.

This happens due the fact that base time change happens only when the
sink gets the first buffer after the FLUSH_STOP - so avtpcvfpay used
the wrong base time to do its calculations.

However, if the pipeline is paused before the seek, sink will update
base time when pipeline state goes to PLAYING again, before avtpcvfpay
gets the first buffers after the flush. Then avtpcvfpay element will be
able to normally calculate DTS for the outgoing packets.

This patch simply adds a warning message in case a flushing seek is
performed on a playing pipeline.

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

4 years agoavtpcvfpay: Ensure NAL fragments are transmitted following stream specs
Ederson de Souza [Fri, 3 Apr 2020 17:40:43 +0000 (10:40 -0700)]
avtpcvfpay: Ensure NAL fragments are transmitted following stream specs

TSN streams are expected to send packets to the network in a well
defined "pace", which is arbitrarily defined for each stream. This pace
is defined by the "measurement interval" property of a stream.

When the AVTP CVF payloader element - avtpcvfpay - fragments a video
frame that is too big to be sent to the network, it currently defines
that all fragments should be transmitted at the same time (via DTS
property of GstBuffers generated, as sink will use those to time the
transmission of the AVTPDU). This doesn't comply with stream definition,
which also has a limit on how many packets can be sent on a given
measurement interval.

This patch solves that by spreading in time the DTS of the GstBuffers
containing the AVTPDUs. Two new properties, "measurement-interval" and
"max-interval-frames", added to avptcvfpay element so that it knows
stream measurement interval and how many AVTPDUs it can send on any of
them. More details on the method used to proper spread DTS/PTS according
to measurement interval can be found in a code commentary inside this patch.

Tests also added for the new property and behaviour.

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

4 years agolibs: parser: Adds AV1 parser.
Georg Ottinger [Mon, 24 Feb 2020 14:38:39 +0000 (22:38 +0800)]
libs: parser: Adds AV1 parser.

This is the first version of AV1 parser implementation in GStreamer.

A test file is also provied with several test cases. It contains a
test sequence taken from the aom testdata set, with one key and one
inter-frame. The same test sequence has been reencoded to annexb.

testdata is taken from aom testdata (and reencoded for annexb) as well
as handcrafted testcases. Once reference testdata is available, the
testing could be imporved aswell.

Co-author: He Junyan <junyan.he@hotmail.com>
Co-author: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/785>

4 years agoautoconvert: fix compiler warnings with g_atomic on recent GLib versions
Tim-Philipp Müller [Fri, 1 May 2020 13:43:55 +0000 (14:43 +0100)]
autoconvert: fix compiler warnings with g_atomic on recent GLib versions

The volatile is not needed here and causes compiler warnings
with newer GLib versions.

gstautoconvert.c: In function ‘gst_auto_convert_dispose’ (and elsewhere):
glib/gatomic.h:108:3: warning: initialization discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
gstautoconvert.c:224:24: note: in expansion of macro ‘g_atomic_pointer_get’
  224 |     GList *factories = g_atomic_pointer_get (&autoconvert->factories);

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

4 years agowebrtcbin: also mark data channel transports as active
Matthew Waters [Thu, 30 Apr 2020 15:17:08 +0000 (01:17 +1000)]
webrtcbin: also mark data channel transports as active

Fixes negotiation of a bundled sdp with only a data channel.

Without marking the transport as active, we would never unblock the
transportreceivebin and thus no data would ever reach us.

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

4 years agowebrtcbin: fix bundle none case with remote offer bundling
Matthew Waters [Thu, 30 Apr 2020 14:47:53 +0000 (00:47 +1000)]
webrtcbin: fix bundle none case with remote offer bundling

If the remote is bundling, but we are not and remote is offering.
we cannot put the remote media sections into a bundled transport as that
is not how we are going to respond.

This specific failure case was that the remote ICE credentials were
never set on the ice stream and so ice connectivity would fail.

Technically, this whole bunde-policy=none handling should be removed
eventually when we implement bundle-policy=balanced.  Until such time,
we have this workaround.

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

4 years agotests: add tests for functions in gstavtpcrfutil.c
Vedang Patel [Fri, 27 Sep 2019 01:12:36 +0000 (18:12 -0700)]
tests: add tests for functions in gstavtpcrfutil.c

This adds tests for the helper functions in ext/avtp/gstavtpcrfutils.c

4 years agotests: Add the tests for CRF Checker element
Vedang Patel [Fri, 27 Sep 2019 01:11:42 +0000 (18:11 -0700)]
tests: Add the tests for CRF Checker element

This adds tests to ensure the avtpcrfchecker element validates and drops the
packets which do not match the CRF Synchronization criteria.

4 years agotests: Add tests for GstAvtpCrfBase base class.
Vedang Patel [Mon, 14 Oct 2019 20:56:49 +0000 (13:56 -0700)]
tests: Add tests for GstAvtpCrfBase base class.

This adds tests which test the functions which do not call any external
syscalls and the properties.

4 years agotests: Add tests for CRF Synchronizer element
Vedang Patel [Mon, 14 Oct 2019 20:56:36 +0000 (13:56 -0700)]
tests: Add tests for CRF Synchronizer element

This adds tests to validate whether the avtpcrfsync element applies the
adjustment correctly.

Also, the infrastructure to include additional source files while compiling
is added. This change is exactly the same as the one in gst-plugins-good.

4 years agoavtp: Introduce the CRF Check element
Vedang Patel [Mon, 14 Oct 2019 20:55:57 +0000 (13:55 -0700)]
avtp: Introduce the CRF Check element

This commit introduces the AVTP Clock Reference Format (CRF) Checker
element. This element re-uses the GstAvtpCrfBase class introduced along
with the CRF Synchronizer element.

This element will typically be used along with the avtpsrc element to
ensure that the AVTP timestamp (and H264 timestamp in case of CVF-H264
packets) is "aligned" with the incoming CRF stream. Here, "aligned" means
that the timestamp value should be within 25% of the period of the media
clock recovered from the CRF stream.

The user can also set an option (drop-invalid) in order to drop any packet
whose timestamp is not within the thresholds of the incoming CRF stream.

4 years agoavtp: Introduce the CRF Sync Element
Vedang Patel [Thu, 6 Feb 2020 00:17:39 +0000 (16:17 -0800)]
avtp: Introduce the CRF Sync Element

This commit introduces the AVTP Clock Reference Format (CRF) Synchronizer
element. This element implements the AVTP CRF Listener as described in IEEE
1722-2016 Section 10.

CRF is useful in synchronizing events within different systems by
distributing a common clock. This is useful in a scenario where there are
multiple talkers who are sending data to a single listener which is
processing that data. E.g.  CCTV cameras on a network sending AVTP video
streams to a base station to display on the same screen.

It is assumed that all the systems are already time-synchronized with each
other. So, the AVTP Talker essentially adjusts the AVTP Presentation Time
so it's phase-locked with the reference clock provided by the CRF stream.

There are 2 different roles of systems which participate in CRF data
exchange.  A system can either be a CRF Talker, which samples it's own
clock and generates a stream of timestamps to transmit over the network, or
a CRF Listener, the system which receives the generated timestamps and
recovers the media clock from the timestamps. It then adjusts it's own
clock to align with recovered media clock. The timestamps generated by the
talker may not be continuous and the listener might have to interpolate
some timestamps to recover the media clock. The number of timestamps to
interpolate is mentioned in the CRF stream AVTPDU (Refer IEEE 1722-2016
Section 10.4 for AVTPDU structure). Only CRF Listener has been implemented
in this commit.

The CRF Sync element will create a separate thread to listen for the CRF
stream. This thread will calculate and store the average period of the
recovered media clock. The pipeline thread will use this stored period
along with the first timestamp of the latest CRF AVTPDU received to
calculate adjustment for timestamps in the audio/video streams. In case of
CRF AVTPDUs with single timestamp, two consecutive CRF AVTPDUs will be used
to figure out the average period of the recovered media clock.

In case of H264 streams, both AVTP timestamp and H264 timestamp will be
adjusted.

In the future commits, another "CRF Checker" element will be introduced
which will validate the timestamps on the AVTP Listener side. Which is why
a lot of code has been implemented as part of the gstcrfbase class.

4 years agoclockselect: Add TAI clock support
Ederson de Souza [Fri, 13 Dec 2019 19:28:08 +0000 (11:28 -0800)]
clockselect: Add TAI clock support

Via new value for property clock-id, "tai", it's possible to use
GST_CLOCK_TYPE_TAI as pipeline clock.

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

4 years agoclockselect: Remove non-sense comment
Ederson de Souza [Mon, 27 Jan 2020 23:16:12 +0000 (15:16 -0800)]
clockselect: Remove non-sense comment

Commentary appears to assume `gst_harness_find_element` return value was
"transfer none", but it is not the case. So, element must be unrefed
before the end.

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

4 years agoUpdate gstsrtobject.c
krivoguzovVlad [Thu, 23 Jan 2020 15:57:34 +0000 (15:57 +0000)]
Update gstsrtobject.c

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

4 years agoristrtpdeext: Expose the largest sequence number received
Olivier Crête [Tue, 30 Jul 2019 21:09:55 +0000 (17:09 -0400)]
ristrtpdeext: Expose the largest sequence number received

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

4 years agoristrtpdeext: Update RTP header extension packet to latest spec
Olivier Crête [Wed, 18 Mar 2020 21:34:47 +0000 (17:34 -0400)]
ristrtpdeext: Update RTP header extension packet to latest spec

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

4 years agoristrtpext: Update RTP header extension packet to latest spec
Olivier Crête [Wed, 18 Mar 2020 21:14:14 +0000 (17:14 -0400)]
ristrtpext: Update RTP header extension packet to latest spec

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

4 years agorist: Document main profile support
Olivier Crête [Wed, 31 Jul 2019 16:01:07 +0000 (12:01 -0400)]
rist: Document main profile support

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

4 years agoristsrc: Add ristrtpdeext to the pipeline
Olivier Crête [Mon, 29 Jul 2019 21:53:21 +0000 (17:53 -0400)]
ristsrc: Add ristrtpdeext to the pipeline

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

4 years agoristsink: Add ristrtpext to sink
Olivier Crête [Mon, 29 Jul 2019 17:58:37 +0000 (13:58 -0400)]
ristsink: Add ristrtpext to sink

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

4 years agoristsink: Receive RIST seqnum ext and feed it to rtxsend
Olivier Crête [Fri, 26 Jul 2019 21:57:40 +0000 (17:57 -0400)]
ristsink: Receive RIST seqnum ext and feed it to rtxsend

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

4 years agoristsink: Pass the session id to the on-app-rtcp callback
Olivier Crête [Fri, 26 Jul 2019 21:43:57 +0000 (17:43 -0400)]
ristsink: Pass the session id to the on-app-rtcp callback

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

4 years agoristrtxsend: Use externally given seqnum extension when available
Olivier Crête [Fri, 26 Jul 2019 21:14:14 +0000 (17:14 -0400)]
ristrtxsend: Use externally given seqnum extension when available

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

4 years agoristrtxsend: Store sent packets with extended seqnum
Olivier Crête [Fri, 26 Jul 2019 20:50:21 +0000 (16:50 -0400)]
ristrtxsend: Store sent packets with extended seqnum

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

4 years agorist: Factor our seqnum extension code
Olivier Crête [Fri, 26 Jul 2019 20:49:51 +0000 (16:49 -0400)]
rist: Factor our seqnum extension code

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

4 years agorist: Add test for rtp ext code
Olivier Crête [Wed, 24 Jul 2019 21:32:07 +0000 (17:32 -0400)]
rist: Add test for rtp ext code

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