Commit graph

25867 commits

Author SHA1 Message Date
Alex Hoenig
0a2e026985 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>
2020-05-12 12:18:28 -04:00
Matthew Waters
6dae95d60f 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>
2020-05-12 16:06:32 +10:00
Matthew Waters
09cbe4cd03 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>
2020-05-12 16:06:32 +10:00
Matthew Waters
ebc19d19bb 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>
2020-05-12 16:06:32 +10:00
Matthew Waters
f077189809 ccconverter: fix uninitialized read in error case
CID 1463351

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1262>
2020-05-12 16:06:32 +10:00
Ting-Wei Lan
d10e2381c7 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>
2020-05-11 15:17:31 +00:00
Matthew Waters
12edc0d9b8 ccconverter: implement discont handling
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
ba1558a7ab 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
7ed0bc539f 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
3417a1709c 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
7d028af675 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
ddc7563ac9 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
75503017c2 ccconverter: introduce define for max cdp packet length
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
44c874fd9e 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
31a0bf367d 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>
2020-05-11 12:30:31 +00:00
Matthew Waters
b25d75f201 ccconverter: refactor cdp id, fps, max_cc_count into a table
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1116>
2020-05-11 12:30:31 +00:00
Matthew Waters
afc120fa74 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>
2020-05-11 12:30:31 +00:00
Jan Alexander Steffens (heftig)
dc57fb7095 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>
2020-05-11 12:04:08 +00:00
Sebastian Dröge
79e65951a9 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>
2020-05-11 07:25:39 +00:00
Sebastian Dröge
20756e3387 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>
2020-05-11 07:25:39 +00:00
Chris Ayoup
9937101e51 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>
2020-05-11 05:30:59 +00:00
Chris Ayoup
ca754245e9 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>
2020-05-11 05:30:59 +00:00
Chris Ayoup
3fc8818824 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>
2020-05-11 05:30:59 +00:00
Haihao Xiang
98600942e4 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>
2020-05-11 02:16:44 +00:00
Sebastian Dröge
d6f6c51f3c 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>
2020-05-10 08:44:09 +00:00
Sebastian Dröge
2a2e48fd9e onviftimestamp: Add missing break in set_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1257>
2020-05-10 11:17:19 +03:00
Nicolas Dufresne
fac627ba1b 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>
2020-05-07 14:17:28 -04:00
Nicolas Dufresne
90ca8850de 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>
2020-05-07 13:59:33 -04:00
Nicolas Dufresne
26296646d7 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>
2020-05-07 13:59:23 -04:00
Nicolas Dufresne
fd423c8468 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>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
269ab891c5 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>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
3784bd4a73 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>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
80524fb3da 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>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
dc4c470d75 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>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
9029631f75 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>
2020-05-07 12:08:36 -04:00
Nicolas Dufresne
4332dc195d 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>
2020-05-07 12:08:36 -04:00
Xu Guangxin
cab1ddf48b 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>
2020-05-07 05:45:36 +00:00
Sebastian Dröge
0dfd05e574 timecodestamper: Unref latency query after usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1249>
2020-05-06 20:05:06 +03:00
Sebastian Dröge
77784c7aba 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>
2020-05-06 08:51:38 +00:00
Luka Blaskovic
4cf362e2df opencv: allow compilation against 4.3.x
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1235>
2020-05-06 06:49:08 +00:00
Matthew Waters
02c8e66ff1 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>
2020-05-06 15:49:58 +10:00
Matthew Waters
d0b20f8bba 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>
2020-05-06 15:49:58 +10:00
Matthew Waters
18de5f8f04 webrtc: remove debugging leftover
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1247>
2020-05-06 15:49:58 +10:00
Matthew Waters
50644f5718 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>
2020-05-06 02:53:27 +00:00
Matthew Waters
1f395e3ddb 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>
2020-05-06 02:53:27 +00:00
Matthew Waters
d0be6b74f2 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>
2020-05-06 02:53:27 +00:00
Matthew Waters
d552c6556c 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>
2020-05-06 02:53:27 +00:00
Matthew Waters
46176fbcc7 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>
2020-05-06 02:53:27 +00:00
Matthew Waters
7aa58954c1 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>
2020-05-06 02:53:27 +00:00
Matthew Waters
a2b0c81900 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>
2020-05-06 02:53:27 +00:00