Commit graph

7970 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig)
5a1b56a0e0 mpegtsmux: Restore intervals when creating TsMux
Otherwise the settings from the properties would be overwritten with
the defaults.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1593>
2020-09-23 16:50:34 +00:00
Sanchayan Maity
248d2bb795 audiobuffersplit: Add support for specifying output buffer size
Currently for buffer splitting only output duration can be specified.
Allow specifying a buffer size in bytes for splitting.

Consider a use case of the below pipeline
appsrc ! rptL16pay ! capsfilter ! rtpbin ! udpsink

Maintaining MTU for RTP transfer is desirable but in a scenario
where the buffers being pushed to appsrc do not adhere to this,
an audiobuffersplit element placed between appsrc and rtpL16pay
with output buffer size specified considering the MTU can help
mitigate this.

While rtpL16pay already has a MTU setting, in case of where an
incoming buffer has a size close to MTU, for eg. with a MTU of
1280, a buffer of size 1276 bytes would be split into two buffers,
one of 1268 and other of 8 bytes considering RTP header size of
12 bytes. Putting audiobuffersplit between appsrc and rtpL16pay
can take care of this.

While buffer duration could still be used being able to specify
the size in bytes is helpful here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1578>
2020-09-21 15:17:18 +00:00
Haihao Xiang
4a93f6e651 h265parse: recognize more HEVC extension streams
There are streams which have the right general_profile_idc and
general_profile_compatibility_flag, but don't have the right extension
flags. We may try to use chroma_format_idc and bit_depth to
recognize these streams.

e.g.
https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/SCC/IBF_Disabled_A_MediaTek_2.zip

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1328>
2020-09-16 16:51:45 +00:00
yychao
c6ae415ca8 tsdemux: Parse Audio Preselection Descriptor
For Dolby AC4 audio experience, parsing PMTs/APD from transport stream layer for all available presentations.
Refer to ETSI EN 300 468 V1.16.1 (2019-05)

1. 6.4.1 Audio preselection descriptor
2. Table M.1: Mapping of codec specific values to the audio preselection descriptor

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1555>
2020-09-14 06:27:07 +00:00
yychao
5269777a97 tsdemux: Add new API for fetching extended descriptors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1555>
2020-09-14 06:27:07 +00:00
Seungha Yang
2b152eae69 videoparsers: Add vp9parse element
Adding vp9parse element to parse various stream information such as
resolution, profile, and so on. If upstream does not provide resolution and/or
profile, this would be useful for decodebin pipeline for autoplugging
suitable decoder element depending on template caps of each decoder element.

In addition, vp9parse element supports unpacking superframe into
single frame for decoders. The vp9 superframe is a frame which consists
of multiple frames (or superframe with one frame is allowed) followed by superframe
index block. Then unpacked each frame will be considered as normal frame
by decoder. The decision for unpacking will be done by downstream element's
"alignment" caps field, which can be "super-frame" or "frame".
If downstream specifies the "alignment" as "frame",
then vp9parse element will split an incoming superframe into single frames
and the superframe index (located at the end of the superframe) data
will be discarded by vp9parse element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1041>
2020-09-10 14:56:52 +00:00
Jan Alexander Steffens (heftig)
16a07d303a rtmp2: Replace stats queue with stats lock
Making the thread receiving the stats wait on the loop to respond was
not a good idea, as the latter can get blocked on the streaming thread.

Have get_stats read the values directly, adding a lock to ensure we
don't read garbage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1550>
2020-09-09 06:34:51 +00:00
Nazar Mokrynskyi
ebc057bb7a rtmp2sink: add docs section with since marker on new stop-commands property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1256>
2020-09-09 05:53:08 +00:00
Nazar Mokrynskyi
8c37eea410 rtmp2: fix code style, update documentation cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1256>
2020-09-09 05:53:08 +00:00
Jan Alexander Steffens (heftig)
30274dee52 rtmp2: Clean up (improve) GstRtmpStopCommands type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1256>
2020-09-09 05:53:08 +00:00
Nazar Mokrynskyi
9a2828c216 rtmp2sink: handle EOS event and close stream
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1285

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1256>
2020-09-09 05:53:08 +00:00
Jan Alexander Steffens (heftig)
66f9d37c37 mpegtsmux: Make handling of sinkpads thread-safe
Ensure we take the object lock while accessing `GstElement.sinkpads`.
Use an iterator when the code isn't simple to avoid deadlock.

When we find the best pad, take a reference so a concurrent pad
release doesn't destroy the pad before we're done with it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1553>
2020-09-09 02:25:40 +00:00
Edward Hervey
1068083135 mpegtsmux: Don't create streams with reserved PID
There are quite a few reserved PID in the various MPEG-TS (and derivate)
specifications which we should definitely not use. Those PID have a certain
meaning and purpose.

Furthermore, a lot of the code in the muxer implementation also makes assumption
on the purpose of streams based on their PID.

Therefore, when requesting a pad with a specific PID, make sure it is not a
restricted PID.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1561>
2020-09-08 21:09:36 +00:00
Sebastian Dröge
64039cdf84 gst: Update for gst_video_transfer_function_*() function renaming
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1557>
2020-09-07 12:14:47 +03:00
Jan Alexander Steffens (heftig)
ef8142ef90 mpegtsmux: Keep mux usable after stop
Otherwise you cannot request new pads until after it is started again.

gst_base_ts_mux_reset with FALSE is still called in the dispose
implementation, so the muxer still gets deallocated when we actually
clean up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1552>
2020-09-01 14:01:56 +00:00
Nirbheek Chauhan
ce18a344f4 rtmp2: Need to unescape the userinfo before setting
This regressed in 827afa206d. The same
fix was also committed to the webrtc element, but rtmp2 was missed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1547>
2020-08-30 09:53:42 +00:00
Jose Quaresma
fe3a0c2c90 proxysink: event_function needs to handle the event when it is disconnecetd from proxysrc
without this a disconneted proxysink fail when goes to play with error:

 Internal data stream error.
 streaming stopped, reason error (-5)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1508>
2020-08-13 14:21:05 +00:00
Felix Yan
5886138c13 Correct typos in gsth264parse.c
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1511>
2020-08-12 17:03:00 +00:00
Nicolas Dufresne
76b4de79ca h264parse: Add new H.264 levels
The spec now list 6, 6.1 and 6.2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1509>
2020-08-12 08:30:14 -04:00
Jordan Petridis
26bbcae973 gstautoconvert.c: fix clang warnings
clang 10 is complaining about incompatible types due to the
glib typesystem.

```
gst-plugins-bad/gst/autoconvert/b5c3019@@gstautoconvert@sha/gstautoconvert.c.o' -c ../subprojects/gst-plugins-bad/gst/autoconvert/gstautoconvert.c
../subprojects/gst-plugins-bad/gst/autoconvert/gstautoconvert.c:898:8: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'GList **' (aka 'struct _GList **') [-Werror,-Wincompatible-pointer-types]
  if (!g_atomic_pointer_compare_and_exchange (&autoconvert->factories, NULL,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
    __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                           ^~~~~~~~~~~~~~
1 error generated.
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1487>
2020-08-04 11:37:52 +00:00
Nirbheek Chauhan
d4ca8820e7 webrtc, rtmp2: Warn if the user or password aren't escaped
If the user/pass aren't escaped, the userinfo will be ambiguous and we
won't know where to split. We will accidentally get it right if the :
belongs in the password.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1481>
2020-08-03 18:12:50 +00:00
Nirbheek Chauhan
827afa206d webrtc, rtmp2: Fix parsing of userinfo in URI strings
While parsing the string, `gst_uri_from_string()` also unescapes the
userinfo. This is bad if your username contains a `:` character, since
we will then split the userinfo at the wrong location when parsing it.

To fix this, we can use the new `gst_uri_from_string_escaped()` API
that was added in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/583

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/831

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1481>
2020-08-03 18:12:50 +00:00
George Kiagiadakis
fc9a612e2c ristsrc: drop stream-start & eos messages posted from the internal udp sink(s)
See #1368

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1472>
2020-07-29 13:20:28 +00:00
George Kiagiadakis
914161f902 rtpsrc: drop stream-start & eos messages posted from the internal udp sink(s)
See #1368

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1472>
2020-07-29 13:20:28 +00:00
Vivia Nikolaidou
d8b37973d2 tsmux: Fix PCR calculation for CBR live streams
Take the first ever timestamp as an offset

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1431>
2020-07-28 16:18:45 +00:00
Jan Alexander Steffens (heftig)
5a358b7687 tsmux: Refactor get_current_pcr
No functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1431>
2020-07-28 16:18:45 +00:00
Nicolas Dufresne
782dc857e0 rtpsrc: Add domain name support
This add domain name resolution (similar to udpsrc does) to the rtpsrc
element.

Fixes 1352

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1433>
2020-07-14 20:48:04 +00:00
Nicolas Dufresne
19c632f4e8 ristsrc: Add support for domain name
This add domain name resolution (similar to udpsrc does) to the ristsrc
element.

Fixes 1352

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1433>
2020-07-14 20:48:04 +00:00
Nicolas Dufresne
f6ac2e44bb rtpsrc: Always set rtcp socket address
Regardless if it's multicast or not, set the address property to match
the element address. This is the address of the interface to listen to,
which is expected to be ANY in most cases, but should be honnored even
for RTCP non-multicast case.

This also fixes an assertion if the address is not a parsable IPv4 or
IPv6 string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1433>
2020-07-14 20:48:04 +00:00
Nicolas Dufresne
82fe23f212 rtpsink: Fix error handling on bad DNS
This will properly print the DNS being attempted to resolved and avoid
trying to unref a NULL pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1433>
2020-07-14 20:48:04 +00:00
Nicolas Dufresne
89fbcc71d9 ristsink: Fix error handling on bad DNS
This will properly print the DNS being attempted to resolved and avoid
trying to unref a NULL pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1433>
2020-07-14 20:48:04 +00:00
Mathieu Duponchelle
13376f88fe basetsmux: make use of gst_aggregator_finish_buffer_list
Fixes #1276

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1429>
2020-07-10 20:12:11 +00:00
Tim-Philipp Müller
510e8ef8cb docs: fix element names in section headers
Hopefully that'll make hotdoc pick up the docs for these elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1428>
2020-07-10 19:22:29 +00:00
Andreas Frisch
0e075b4dbf mpegtsmux: Don't assume English for ISO-639 language descriptor
Previously, "en" (should have actually been "eng") was assumed
for the ISO-639 language descriptor if no language was explicitely given.
Neither ETSI EN 300 468 nor ATSC A/52 mandate for a language descriptor,
so we should simply not set it, if it's unknown.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1386>
2020-07-08 13:37:12 +00:00
Jan Schmidt
46cc64e09f mpegtsmux: Fix handling of MPEG-2 AAC
The audio/mpeg,mpegversion=2 caps in GStreamer refer to
MPEG-2 AAC (ISO 13818-7), not to the extended MP3 (ISO 13818-3),
which is audio/mpeg,mpegversion=1,mpegaudioversion=2/3

Fix the caps, and add handling for MPEG-2 AAC in both ADTS and raw
form, adding ADTS headers for the latter.
2020-07-08 12:24:13 +00:00
Tim-Philipp Müller
f3fdd76683 rtmp, transcodebin: fix i18n header includes
Fixes #1351

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1416>
2020-07-07 19:55:00 +01:00
Nicolas Dufresne
af741f0723 rist: Use g_signal_connect_object()
rtpbin can still emit signals when it is being disposed, and while
rtpbin is inside ristsrc/ristsink it can still live longer.

So we either have disconnect all signals at some point, or let GObject
take care of that automatically.

Related to !1412

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1413>
2020-07-07 15:37:57 +00:00
Josep Torra
7346e7c1e2 scenechange: use orc to compute score
Add an orc implementation for SAD operation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1024>
2020-07-07 15:06:55 +01:00
Sebastian Dröge
b812d1c743 rtpsrc/sink: Use g_signal_connect_object()
rtpbin can still emit signals when it is being disposed, and while
rtpbin is inside rtpsrc/rtpsink it can still live longer.

So we either have disconnect all signals at some point, or let GObject
take care of that automatically.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1412>
2020-07-07 12:42:36 +00:00
Jan Alexander Steffens (heftig)
cba9ba9b38 mpegtsmux: Avoid crash releasing pad with NULL prog
If we release a pad while the muxer is running which has never been used
for aggregation (thus it does not have an assigned program), `prog` is
NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1411>
2020-07-07 14:05:04 +02:00
Tim-Philipp Müller
7b2c3a984c meson: add update-orc-dist target
Add target to update backup orc -dist.[ch] files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1408>
2020-07-04 15:05:23 +01:00
Vivia Nikolaidou
31d5d04bb1 videoparseutils: Only add a single closed caption meta
Otherwise, having a stream go through a parser multiple times would
result in duplicate closed caption meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1396>
2020-07-03 08:25:54 +00:00
Jan Alexander Steffens (heftig)
afdde9fa40 videoparsers: Fix parsing ATSC bar data
It rejected the case of all bars being disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1394>
2020-07-01 20:02:35 +00:00
Jan Alexander Steffens (heftig)
01896c11d2 videoparsers: Fix parsing of ATSC AFD data
The test for 0x40 being set is repeated by
gst_video_parse_utils_parse_afd, which also extracts the low nibble
again, so we must not clear it here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1394>
2020-07-01 20:02:35 +00:00
Jan Alexander Steffens (heftig)
cedb07fe46 videoparsers: Give gstvideoparseutils.c a debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1394>
2020-07-01 20:02:35 +00:00
Jan Alexander Steffens (heftig)
1e29c5d52a rtmp2: Set connect args like libavformat does
To improve our compatibility. Critically, a server might elide data for
codecs we don't advertise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01 18:33:42 +00:00
Jan Alexander Steffens (heftig)
2ad3aab1d4 rtmp2: Add support for AGGREGATE messages
They're multiple frames (tags) of FLV data wrapped into a message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01 18:33:42 +00:00
Jan Alexander Steffens (heftig)
30b1187108 rtmp2: Move FLV tag header parsing into rtmputils.c
To be shared with the AGGREGATE handling.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01 18:33:42 +00:00
Jan Alexander Steffens (heftig)
368c038ef0 rtmp2: Mark our memory singleton as leakable
So it doesn't appear in the leaks tracer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01 18:33:42 +00:00
Jan Alexander Steffens (heftig)
edd3c4fadf rtmp2: Remove GST_ERROR from rtmputils.c
This file does not have debug logging set up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01 18:33:42 +00:00
Andreas Frisch
297e5022ca mpegtsmux: Correctly set ISO-639 language descriptor
fixes #1340
Only 2 of the necessary 3 letters were copied because the teminating '\0'
needs to be counted, too - cf.
https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strlcat

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1375>
2020-06-30 11:41:27 +00:00
Vivia Nikolaidou
290d0432c3 interlace: Make caps writable before modifying them
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1373>
2020-06-25 16:05:39 +03:00
Mathieu Duponchelle
e2f28c3d08 mxfvanc: document new sink pad template
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1368>
2020-06-25 06:59:18 +00:00
Sebastian Dröge
e54107db02 mxfdemux/mux: Add support for CEA-708 CDP from S436 essence tracks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1368>
2020-06-25 06:59:18 +00:00
Vivia Nikolaidou
482d2c9459 interlace: Switch field-pattern on the fly
The frame rate interlace uses changes when we change field-pattern, so
we need to issue a reconfigure event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1364>
2020-06-24 17:44:46 +00:00
Vivia Nikolaidou
1eeaee24d4 interlace: Re-indentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:31:15 +03:00
Vivia Nikolaidou
b53c1363f2 interlace: Don't change field-pattern on PAUSED or PLAYING state
It would otherwise change the caps the element produces and cause the
element to misbehave

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:31:15 +03:00
Vivia Nikolaidou
7c7ac7a0dc interlace: Don't fail negotiation if capsfilters decide framerate
Try to negotiate if the framerates on either sides of the interlace are
decided using capsfilters and the framerates are correct. Otherwise the
following pipelines would fail to negotiate:

gst-launch-1.0 videotestsrc !
video/x-raw,framerate=24/1,interlace-mode=progressive ! interlace
field-pattern=2 ! video/x-raw,framerate =30/1 ! fakesink

gst-launch-1.0 videotestsrc !
video/x-raw,framerate=60/1,interlace-mode=progressive ! interlace
field-pattern=0 ! video/x-raw,framerate=30/1 ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:15:48 +03:00
Vivia Nikolaidou
581d76b41a interlace: Restrict passthrough conditions
Don't do passthrough if interleave-mode=mixed or if we have one of the
telecine modes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:15:48 +03:00
Vivia Nikolaidou
76ce67e70b interlace: Add field switching mode for 2:2 field pattern
In the 2:2 field pattern, interlace can switch from bottom-field-first
to top-field-first.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:15:48 +03:00
Vivia Nikolaidou
ba500b816a interlace: Only half the framerate for 1:1 field pattern
Keep the framerate for 2:2 field pattern, and completely remove it from
the caps for all others. Otherwise, negotiation will fail if caps on
both sides of the element specify a framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:15:48 +03:00
Vivia Nikolaidou
0c63c8d1f5 interlace: Add FIXME comment about false passthrough bug
If interlace-mode is missing from upstream caps, we can falsely do
passthrough when in fact we'd have to switch fields.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1349>
2020-06-24 11:15:48 +03:00
Thibault Saunier
059e8ff44a docs: Document basecamerabinsrc 2020-06-23 13:02:57 -04:00
Mathieu Duponchelle
6baffc2931 docs: mark more types as plugin API 2020-06-23 12:10:17 -04:00
Sebastian Dröge
ea5f38440d audiobuffersplit: Specify in the template caps that only interleaved audio is supported
Needs special support for non-interleaved audio and e.g. use the
GstPlanarAudioAdapter.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/779

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1363>
2020-06-23 10:03:53 +03:00
Vivia Nikolaidou
652773de36 Revert "h264parse: Include interlace-mode in caps"
This reverts commit b75a61342f.

The parser would only set the mode to progressive or mixed, missing the
cases where it should have been interleaved. Interleaved is more
difficult to detect because in h264 it happens per frame. On the other
hand, h264 decoders detect the interlacing information per-frame and set
the caps correctly. By giving potentially incorrect interlacing
information in the parser already, it's being enforced downstream even
after decoding, breaking some use cases (e.g. an encoder can't properly
mark the stream as TFF or BFF). On the other hand, there's no valid use
case for having interlacing information on the caps at the parsing
stage, so after a lot of discussion, it was decided to revert this.

Initial commit message:
=========================
Those are the rules:

In the SPS:
  * if frame_mbs_only_flag=1 => all frame progressive
  * if frame_mbs_only_flag=0 => field_pic_flag defines if each frame is
    progressive or interlaced, thus the mode is 'mixed' in GStreamer
    terms.

https://bugzilla.gnome.org/show_bug.cgi?id=779309
=========================

Fixes #1313

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1335>
2020-06-22 16:08:41 +00:00
Jan Alexander Steffens (heftig)
434d685564 Revert "errorignore: Added convert-error signal"
The introduced API has [some problems][1] and [a better solution][2] was
found that made the feature obsolete.

This reverts commit f7626c1f2a.

[1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/736#note_357702
[2]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/736#note_238830

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/916

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/916>
2020-06-20 19:11:57 +01:00
Jan Schmidt
1cf3cae5e1 dvbsubenc: Add DVB Subtitle encoder
Add an element that converts AYUV video frames to a DVB
subpicture stream.

It's fairly simple for now. Later it would be good to support
input via a stream that contains only GstVideoOverlayComposition
meta.

The element searches each input video frame for the largest
sub-region containing non-transparent pixels and encodes that
as a single DVB subpicture region. It can also do palette
reduction of the input frames using code taken from
libimagequant.

There are various FIXME for potential improvements for now, but
it works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1227>
2020-06-17 12:50:13 +10:00
Tim-Philipp Müller
c7095abd31 yadif: remove plugin, there's now deinterlace method=yadif
Plugin code was still the GPL version, and the
functionality has now been moved into the deinterlace
element in gst-plugins-good as method=yadif (and LGPL).

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/444
and https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/621

Closes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/216
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/463

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1336>
2020-06-11 21:52:49 +01:00
Vivia Nikolaidou
969e647925 interlace: Fix crash with empty caps in setcaps
If the src_peer_caps are EMPTY (e.g. negotiation failed somewhere), the
assertion inside gst_video_info_from_caps would fail and the whole
pipeline would crash. Check for gst_caps_is_empty before
gst_video_info_from_caps and gracefully fail if it's empty.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1333>
2020-06-11 12:06:17 +00:00
Mathieu Duponchelle
a048ce81d4 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:40:42 +02:00
Sebastian Dröge
a5b1e1e96d clockselect: Don't register GstClockSelectClockId multiple times 2020-06-04 13:33:16 -04:00
Sebastian Dröge
74f2f733be plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-04 13:33:16 -04:00
Jan Alexander Steffens (heftig)
23a2916afd mpegtsdemux: Deliver all packets to tsparse
34af8ed66a changed the code to use the
packetizer's packets instead of the incoming buffers, but mpegtsbase
didn't actually push all packets to the subclass. As a result, padding
(PID 0x1FFF) packets got lost.

Add a new boolean to toggle pushing unknown packets to mpegtsbase and
have mpegtsparse make use of it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1300>
2020-05-28 16:41:30 +00:00
Sebastian Dröge
bd67ef18e9 audiobuffersplit: Unset DISCONT flag if not discontinuous
And also set/unset the RESYNC flag accordingly.

It can happen that the flag is preserved by GstAdapter from the input
buffer. For example if a big input buffer is split into many small ones,
each of the small ones would have the flag set.

All other buffer flags seem safe to keep here if they were set,
including the GAP flag.

Also ensure that the buffer is actually writable before changing any
flags or metadata on it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1298>
2020-05-25 12:41:32 +00:00
Jan Schmidt
3fdf25cc37 tsdemux: Handle old streams claiming to be HDMV with Opus
GStreamer 1.16 and earlier produced streams with HDMV registration id
but with Opus audio streams on the stream ID that AC-4 now uses. Make
sure those still play back by special casing the check for AC-4 in HDMV

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1295

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1296>
2020-05-25 01:51:46 +10:00
Andrey Sazonov
d806dd2543 asfmux: consistent sscanf args usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1286>
2020-05-21 20:37:49 +00:00
Andrey Sazonov
5044967382 sdpdemux: fix klocwork issues
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1287>
2020-05-21 15:14:32 +00:00
Edward Hervey
f3d6026ad2 rtmp2src: Answer scheduling query
Just like for rtmpsrc, we must inform downstream that we are a
sequential (i.e. don't do random access efficiently) and
bandwith-limited (i.e. might need buffering downstream) element

Fixes buffering issues with playbin3

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1282>
2020-05-20 10:55:55 +02:00
Jan Alexander Steffens (heftig)
9b2ed3a3fc mpegtsdemux: Close a buffer leak and simplify input_done
tsparse leaked input buffers quite badly:

    GST_TRACERS=leaks GST_DEBUG=GST_TRACER:9 gst-launch-1.0 audiotestsrc num-buffers=3 ! avenc_aac ! mpegtsmux ! tsparse ! fakesink

The input_done vfunc was passed the input buffer, which it had to
consume. For this reason, the base class takes a reference on the buffer
if and only if input_done is not NULL.

Before 34af8ed66a, input_done was used in
tsparse to pass on the input buffer on the "src" pad. That commit
changed the code to packetize for that pad as well and removed the use
of input_done.

Afterwards, 0d2e908523 set input_done
again in order to handle automatic alignment of the output buffers to
the input buffers. However, it ignored the provided buffer and did not
even unref it, causing a leak.

Since no code makes use of the buffer provided with input_done, just
remove the argument in order to simplify things a bit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1274>
2020-05-18 14:11:40 +00:00
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
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
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
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
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
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
Tim-Philipp Müller
270f2f83a1 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>
2020-05-01 14:50:58 +01:00
Ederson de Souza
3ea0f694de 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>
2020-04-30 19:21:37 +00:00
Olivier Crête
d9512dc132 ristrtpdeext: Expose the largest sequence number received
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
f2e8d4dcf2 ristrtpdeext: Update RTP header extension packet to latest spec
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
a602eb7eea ristrtpext: Update RTP header extension packet to latest spec
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
03a60a47b5 rist: Document main profile support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
15f89cd088 ristsrc: Add ristrtpdeext to the pipeline
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
a0de749814 ristsink: Add ristrtpext to sink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
f8bb1e0b85 ristsink: Receive RIST seqnum ext and feed it to rtxsend
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:32 +00:00
Olivier Crête
fc76254dfc ristsink: Pass the session id to the on-app-rtcp callback
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
e873780a1f ristrtxsend: Use externally given seqnum extension when available
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
58e31e116b ristrtxsend: Store sent packets with extended seqnum
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
efd78bb8d8 rist: Factor our seqnum extension code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
59b01048ae rist: Drop packets that are more than G_MAXINT16 seqnum late
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
fa5d206c2c rist: Insert RTP seqnum extension header
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
005bd960ee rist: Add element to remove the header extension
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Olivier Crête
7b0377c185 rist: Add element that inserts the RTP header extension
Currently can suppress the TS null packets, but can't insert
the seqnum extension yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1153>
2020-04-30 18:31:31 +00:00
Nicolas Dufresne
0d637c14c5 h264/h265parse: Fix handling of very last frame
Baseparse will never call us back on draining, so going into more: label will
cause the current frame to be discarded. So if we have a complete NAL, but not
a complete AU, make sure to terminate the frame properly.

This is a gression introduce by commit e88d848070 and
a194a87b26.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1275

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1208>
2020-04-23 12:28:54 +00:00
Guillaume Desmottes
b5a28df0f3 transcodebin: fix caps NULL unref
gst_pad_get_current_caps() can return a NULL pointer which was raisin a CRITICAL.
2020-04-16 16:17:56 +00:00
Xavier Claessens
95134cfda8 h264parse: Remove unused arguments 2020-04-15 14:10:16 +00:00
Nicolas Dufresne
1ea21ad922 h264parse: Don't push NALs before we have HEADERS
Otherwise we may endup pushing incomplete caps, which cause a renegotiation.
Note that this has the effect that caps are no longer pushed twice in presence
of valid framerate in the headers.
2020-04-15 14:10:16 +00:00
Nicolas Dufresne
ff137a2059 h265parse: Don't push NALs before we have HEADERS
Otherwise we may endup pushing incomplete caps. Note that this has the side
effect that caps are no longer pushed twice in presence of VUI with valid
framerate.
2020-04-15 14:10:16 +00:00
Nicolas Dufresne
c51922b06c h265parse: Differentiate PREFIX SEI from SUFFIX
There is some code to fixup broken stream that uses the SEI location,
this code is meant to locate SUFFIX SEI only. This should prevent
unwanted side effect if SUFFIX SEI is used.
2020-04-15 14:10:16 +00:00
Nicolas Dufresne
1aede43af6 h265parse: Don't add latency when not needed
We no longer add latency when doing AU->AU, AU->NAL and NAL->NAL
parsing.
2020-04-15 14:10:16 +00:00
Nicolas Dufresne
ceb68c4cf8 h265parse: Propagate MARKER flag 2020-04-15 14:10:16 +00:00
Nicolas Dufresne
e88d848070 h265parse: Don't wait for next NAL if input is aligned
Waiting for the next NAL increases the latency. If alignment=nal/au
has been negotiated, assumes the the buffer contains a complete
NAL and don't expect a second start-code. This way, nal -> nal,
au -> au and au -> nal no longer introduce latency.

As a side effect, the collect_pad() function was not able to poke at the
following NAL. This call is now moved before processing the NAL, so
it's looking at the current NAL before it's ingested into the parser
state in order to dermin if the end of an AU has been reached. The AUD
injection state as been adapted to support this.

This change will break pipelines if alignment=nal is used without respecting the
alignment. Effectively, the parser will no longer fix the broken aligment
which will result in parser error and the termination of the pipeline. Such
issue existed in tsdemux element and might exist in any forks of that code.

Related to https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1193
2020-04-15 14:10:16 +00:00
Nicolas Dufresne
7cba3847ec h265parse: Set PTS/DTS and DISCONT on crafted NAL
When we inject a NAL in the bitstream before another one, make
sure to pass both DTS and PTS. Also make sure to transfer the
DISCONT flag properly.
2020-04-15 14:10:16 +00:00
Nicolas Dufresne
c52fdf994c h264parse: Don't add latency when not needed
We no longer add latency when doing AU->AU, AU->NAL and NAL->NAL
parsing.
2020-04-15 14:10:15 +00:00
Nicolas Dufresne
ba8b605c6f h264parse: Propagate MARKER flag 2020-04-15 14:10:15 +00:00
Nicolas Dufresne
a194a87b26 h264parse: Don't wait for next NAL if input is aligned
Waiting for the next NAL increases the latency. If alignment=nal/au
has been negotiated, assumes that the buffer contains a complete
NAL and don't expect a second start-code. This way, nal -> nal,
au -> au and au -> nal no longer introduce latency.

As a side effect, the collect_pad() function was not able to poke at the
following NAL. This call is now moved before processing the NAL, so
it's looking at the current NAL before it's ingested into the parser
state in order to dermin if the end of an AU has been reached. The AUD
injection state as been adapted to support this.

This change will break pipelines if alignment=nal is used without respecting the
alignment. Effectively, the parser will no longer fix the broken aligment
which will result in parser error and the termination of the pipeline. Such
issue existed in tsdemux element and might exist in any forks of that code.

Related to https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1193
2020-04-15 14:10:15 +00:00
Nicolas Dufresne
ea99aee881 h264parse: Set PTS/DTS and DISCONT on crafted NAL
When we inject a NAL in the bitstream before another one, make
sure to pass both DTS and PTS. Also make sure to transfer the
DISCONT flag properly.
2020-04-15 14:10:15 +00:00
Nicolas Dufresne
596dfbdf37 h264parse: Remove no-op assignment
upstream was set to *out_ts, setting *out_ts to upstream here will
have no effect.
2020-04-15 14:10:15 +00:00
Sebastian Dröge
5394269c91 mpegtsmux: Chain up pad dispose function to the one of the parent class
Otherwise we will leak various memory.
2020-04-15 09:07:24 +00:00
Sebastian Dröge
b41ed0fbb0 mpegtsmux: Properly release requests pads by chaining up to aggregators function 2020-04-15 09:07:24 +00:00
Vivia Nikolaidou
fecd38c8f6 tsmux: Ability for streams to disappear and reappear
Until now, any streams in tsmux had to be present when the element
started its first buffer. Now they can appear at any point during the
stream, or even disappear and reappear later using the same PID.
2020-04-15 09:07:24 +00:00
Nicolas Dufresne
4a91a98ea1 mpegtsdemux: Don't pretend doing NAL alignment
Per specification in 2.14.2 "For PES packetization, no specific data
alignment constraints apply". So we should not advertise NAL
alignment.

This bug was introduced at the same moment the alignment field was introduced
10 years ago. The plan was that alignment=none (or no alignment field) was to
be used for mpegtsdemux, but no one noticed the error. The reason is that at
the same moment, everything dealing with H264 started defaulting to AU
alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=606662#c22

This patch will have a side effect that a parser is now needed after the
tsdemux element. The following pipeline will not negotiate anymore as the
mpegtsmux element requires alignment={nal,au}.

  ... ! tsdemux ! mpegtsmux ! ...

As a side effect, anyone that forked from tsdemux should updated their code to
fix this bug.
2020-04-14 11:36:16 -04:00
Seungha Yang
462a8130a6 h264parse: Remove useless comparison
sei_pic_struct is unsigned and GST_H264_SEI_PIC_STRUCT_FRAME is zero.

CID: 1461467
2020-04-13 12:28:14 +00:00
Nicolas Dufresne
eea520fe6d h264parse: Fix content light level value changes
Same as for H265, was found by Coverity.
2020-04-08 14:01:23 -04:00
Nicolas Dufresne
84a58b3633 h265parse: Fix content light level value changes
The comparision was not testing anything meaninful. This fixes the comparision
so we now update the caps whenever the value differ. This was detected by
coverity.

CID 1461291
2020-04-08 13:58:51 -04:00
Jan Alexander Steffens (heftig)
6680b70781
rtmp2: Avoid a deadlock when getting stats
We need to do this without holding the lock as the `g_async_queue_pop`
waits on the loop thread to deliver the stats. The loop thread might
attempt to take the lock as well, leading to a deadlock.

Taking a reference to the connection should be enough to keep this
safe.
2020-04-08 18:41:01 +02:00
Seungha Yang
be8cec5348 h264parse: Add support for inband timecode update
Add new property "update-timecode" to allow updating timecode
in picture timing SEI depending on timecode meta. Since the picture
timing SEI message requires proper VUI setting but we don't support
re-writing SPS, this might not work for some streams
2020-04-08 15:39:12 +00:00
Seungha Yang
fffbec11e4 h264parse: Don't unconditionally append timecode meta
If upstream buffer has its own timecode metatdata, don't append
new timecode meta into the buffer.
2020-04-08 15:39:12 +00:00
Seungha Yang
1a09251699 h264parser: Parse all SEI payload type even if it's not handled by parser
... so that user can handle it from outside of parser API
2020-04-08 15:39:12 +00:00
Michael Olbrich
01628fa847 sdpdemux: don't send EOS for unknown SSRC
The rtpbin sends signals for all SSRCs. Don't send an EOS when the SSRC
does not match the stream SSRC.

This avoids problems when an SSRC from another receiver times out.
2020-04-08 13:24:34 +00:00
Philippe Normand
12ff0a4797 fakevideosink: Allow allocation meta flags fine-tuning
In some scenarios the fakevideosink shouldn't advertize the overlay-composition
meta for instance, so that overlay elements perform subtitles blending
themselves.
2020-04-07 14:40:37 -04:00
Michael Olbrich
468408c6a6 mpegtspacketizer: be more tolerant when parsing the adaptation field
According to the specification, the adaptation field length must be 183 if
there is no payload data and < 183 if the packet contains an adaptation
field and payload data.

Unfortunately some payloaders always set the flag for payload data, even if
the adaptation field length is 183.

Don't return with an error in this case. Clear the payload data flag
instead and parse the adaptation field as usual. This avoids visual
artefacts for such streams.
2020-04-07 08:21:04 +00:00
Jan Schmidt
b9ebd885ff tsdemux: Send instant-rate-change event if requested in the SEEK event
Convert instant-rate-change seek events into a downstream
instant-rate-change event and skip any further local seek handling.
2020-04-02 11:26:46 +00:00
Seungha Yang
f05effe024 h264parse,h265parse: Update for video-hdr struct change
See the change of -base https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/594
2020-04-01 05:18:11 +00:00
Zeeshan Ali
355719bae7 h265parse: Set duration on buffers base on framerate 2020-03-31 14:13:30 +00:00
Zeeshan Ali
158d69fd45 h265parse: Derive src fps from vui_time_scale & vui_num_units_in_tick 2020-03-31 14:13:30 +00:00
Zeeshan Ali
51bc67d4ef h265parse: Handle interlaced video
For interlaced video:
* set the interlace mode in the src caps
* double the height from SPS in the caps.
* set field latency, instead of frame latency.

Fix #778
2020-03-31 14:13:30 +00:00
Seungha Yang
d81438a69e h264parse: Print all the syntax elements of frame packing for debugging
Other values might be useful for debugging
2020-03-31 08:30:50 +00:00
Seungha Yang
7f5347a664 rtmp2src: Add idle-timeout property
Add new property to signalling that there is no incoming data
from peer. This can be useful if users want to stop the streaming
when the connection is alive but no packet is arriving.
2020-03-27 10:25:37 +00:00
Guillaume Desmottes
c3a9d2dc64 interlace: add alternate support
Allow downstream elements to negotiate the alternate interlace mode,
splitting each input buffer in two fields, each having their own buffer.
2020-03-24 09:57:53 +01:00
Guillaume Desmottes
2db7c4e22c interlace: factor out interlace_mode_from_pattern() 2020-03-24 09:53:43 +01:00
Guillaume Desmottes
e755c45863 interlace: factor out gst_interlace_push_buffer() 2020-03-24 09:53:43 +01:00
Guillaume Desmottes
5bfbddf859 interlace: factor out gst_interlace_decorate_buffer_ts() 2020-03-24 09:53:43 +01:00
Guillaume Desmottes
eb914c127d interlace: rename copy_field()
It is actually copying both fields (to a single frame/buffer).
2020-03-24 09:53:43 +01:00
Seungha Yang
085f10340e tsdemux: Set mpegversion for AAC ADTS stream based on parsed ADTS header
Both 2 and 4 are supported version of AAC ADTS format stream.
So we need to set correct version to help negotiation
especially for non-autopluggable pipeline.
2020-03-23 10:57:26 +00:00
rubenrua
6c3f092afc asfmux: Fix typo in property description
s/milisecs/milliseconds/g
2020-03-12 18:38:11 +01:00
Thibault Saunier
fb888dada1 timecodestamper: Plug a leak 2020-03-11 21:38:13 -03:00
Edward Hervey
fa2916a159 mpegts: Add a property to ignore broken PCR streams
Some mpeg-ts (HLS, DVB, ...) streams out there have completely broken
PCR streams on which we can't reliably recover correct timestamps.

For those, provide a property that will ignore the program PCR stream
(by faking that it's not present (0x1fff)).
2020-03-11 16:28:03 +00:00
Seungha Yang
8e45fd27d1 mpegdemux: Add ignore-scr property to ignore broken SCR
Some MPEG-PS streams might not be compliant but the SCR can be ignored
if PTS/DTS in PES header is consistently increased.
2020-03-11 21:06:20 +09:00
Seungha Yang
f6328cec89 mpegdemux: Remove whitespace 2020-03-11 17:42:18 +09:00
Seungha Yang
4b06b1a56e h265parse: In-band sps/pps update if only codec_data differs in src caps
Apply in-band sps/pps resending implementation to h265parse.
2020-03-10 08:51:04 +00:00
Seungha Yang
82a7d1cd99 h264parse: In-band sps/pps update if only codec_data differs in src caps
Initially the case "only codec_data is different" was addressed in
https://bugzilla.gnome.org/show_bug.cgi?id=705333 in order for
unusual bitstreams to be handled. That's the case where sps and pps
are placed in bitstream. When sps/pps are signalled only via caps
by upstream, however, the updated codec_data is mandatory for decoder
and therefore we shouldn't ignore them.
2020-03-10 08:51:04 +00:00
Dong Il Park
691b066ec6 tsdemux: Add format_identifier for AC4 codec
According to following spec document, add format_identifier for AC4 in tsdemux.

ETSI TS 103 190-2 V1.2.1 : Annex D : AC-4 in MPEG-2 transport stream
2020-03-10 16:32:59 +09:00
yychao
adc3d12741 tsdemux: Add support for AC4
According to following two specs, add support for AC4 in tsdemux.

1. ETSI TS 103 190-2 V1.2.1 (2018-02) : Annex D (normative): AC-4 in MPEG-2 transport streams
2. ETSI EN 300 468 V1.16.1 (2019-08) : Annex D (normative):Service information implementation of AC-3, EnhancedAC-3, and AC-4 audio in DVB systems
2020-03-09 21:54:09 +00:00
Seungha Yang
959320264a h265parser: Add helper macro for nal type classification
Add some macros to remove code duplication and to make it more readable
2020-03-05 23:22:34 +09:00
Thibault Saunier
924006279a transcodebin: Avoid elements name duplication
By just letting GStreamer choose a good name
2020-03-05 09:17:49 -03:00
Guillaume Desmottes
469d2cac2f transcodebin: add converters before filters
User doesn't have any guarantee about the actual raw format decodebin will
produce so their filters may or may not fit.

Fix #1228
2020-03-04 14:15:34 +00:00
Guillaume Desmottes
667eadac92 transcodebin: fix logs when failing to link filter
- Display caps of the pad we actually tried to link.
- Use the template caps as the filter is likely to not have any caps set
  yet.
- Log pad name as well.
2020-03-04 14:15:34 +00:00
Thibault Saunier
a0423ee20f timecodestamper: Add seeking support
The approach is quite simple and doesn't take all use cases into account,
it only implements support when we are using the internal timecode we
create ourself.

Also the way we compute the sought frame count is naive, but it works
for simple cases.
2020-03-04 12:36:45 +00:00
Jan Alexander Steffens (heftig)
e83888302d rtmp2: Only grab stats on close when connection exists
If the connection attempt failed, self->connection is NULL.
2020-03-03 10:27:31 +00:00
Guillaume Desmottes
09367da35c transcodebin: mark properties as GST_PARAM_MUTABLE_READY
They are all used in the READY to PAUSED transition so should not be
changed after.
2020-02-28 16:57:30 +00:00
Guillaume Desmottes
de4ea94766 transcodebin: force decoding if a filter is defined
Filter operates on raw data so don't allow decodebin to produce
encoded data if one is defined.

My use case here is keeping the video stream untouched but apply a filter
on the audio one, while keeping the same audio format.
2020-02-28 16:57:30 +00:00
Guillaume Desmottes
4b6164339f transcodebin: logs when inserting, or not, a filter
It's not easy atm to figure out from the logs if a filter has actually be
inserted or not.
2020-02-28 16:57:30 +00:00
Olivier Crête
26ac42f7c0 fakevideosink: Align max-lateness/processing-deadline to GstVideoSink
To emulate correctly the timing video of a real sink, let's set those
properties just like a real video sink.
2020-02-27 23:25:44 +00:00
Guillaume Desmottes
2cb7c66ac7 transcodebin: consider 'any' as no restriction
gstreamer-rs set 'any' as default restriction which actually means 'no
restriction' so handle it as the absence of restriction.
2020-02-26 13:12:37 +00:00
Guillaume Desmottes
54d8360baa transcodebin: fix caps leak
encodecaps was leaked if the profile has restrictions.
2020-02-26 03:23:20 +00:00
Jan Alexander Steffens (heftig)
91a033a85e
rtmp2: Allow setting flash-version
In case the application has to deal with fussy servers. User agent
sniffing is so last decade.

Adds a property to set the Flash version on both the sink and the src.
The default stays the same (IIRC, Flash plugin for Linux from 2009).
2020-02-25 15:10:28 +01:00
Jan Alexander Steffens (heftig)
02a6a794ec
rtmp2: Expose connection stats as property
Save the stats before we destroy the connection, so we can still
retrieve them afterwards.
2020-02-21 19:26:35 +01:00
Jan Alexander Steffens (heftig)
f1a9a3146a
rtmp2: Add gst_rtmp_connection_get_stats and _get_null_stats
The former uses a thread-safe way of getting statistics from the
connection without having to protect the fields with a lock.

The latter produces a zeroed statistics structure for use when no
connection exists.
2020-02-21 19:26:35 +01:00
Jan Alexander Steffens (heftig)
5d720eb59e
rtmp2: Count outgoing bytes and acked bytes
For statistics.
2020-02-21 19:26:33 +01:00
Jan Alexander Steffens (heftig)
0c344a7efb rtmp2sink: Add a property for the outgoing chunk size 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
f7bb2cdeb7 rtmp2: Add gst_rtmp_connection_set_chunk_size 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
63ec837824 rtmp2: Handle outgoing set chunk/window size properly
Apply outgoing sizes only after writing the chunk to the peer. This is
important particularly for the set chunk size and allows exposing it
without threading issues.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
a566461294 rtmp2: Chunk messages as buffers in loop thread
Move output chunking from gst_rtmp_connection_queue_message into
gst_rtmp_connection_start_write, which effectively moves it from the
streaming thread into the loop thread.

This allows us to handle the outgoing chunk-size message (which is
generated by changing the future chunk-size property) properly, which
could come from any other thread.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
9a13df9ba5 rtmp2: Consistently use GstBuffer for RTMP chunks 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
b03780233e rtmp2: Add gst_rtmp_chunk_stream_serialize_all
Serializes an RTMP message into a series of chunks, all in one buffer.

Similar to what gst_rtmp_connection_queue_message does to serialize
into a GByteArray.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
cb7f0c4be7 rtmp2: Add gst_rtmp_output_stream_write_all_buffer_async
Similar to gst_rtmp_output_stream_write_all_bytes_async, but takes a
GstBuffer instead of a GBytes. It can also return the number of bytes
written, which might be lower in case of an error.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
286a3829b6 rtmp2: Improve handling incoming set chunk/window size
Reject out-of-spec sizes and warn about suspiciously small sizes.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
14fd7e0884 rtmp2: Lock self->lock before OBJECT_LOCK
OBJECT_LOCK is used to protect property access only. self->lock is
used to access the RtmpConnection, mostly between the streaming thread
and the loop thread.

To avoid deadlocks involving these two locks, we obey a lock order:
If both self->lock and OBJECT_LOCK are needed, self->lock must be locked
first. Clarify this.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
6583e00d50 rtmp2: Reject oversized messages
We only have 24 bits for the size, so reject anything larger.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
0044e7a1ba rtmp2: Count in_bytes_acked instead of in_bytes_unacked
This is nicer for statistics.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
11a1de0053 rtmp2: rtmpconnection: Use more appropriate size types
- guint32 for chunk size and window size
- guint64 for running counters
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
279e3c333c rtmp2: Add a g_return_val_if_fail 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
03c3257f0f rtmp2: Replace explicit unref with g_main_context_invoke_full 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
baad4fd91b rtmp2: rtmpconnection: Use GST_*_OBJECT logging
GstRtmpConnection isn't a GstObject with a name or path, but we still
get the GObject's type and address.
2020-02-21 15:20:41 +00:00
Marc Leeman
424c593871 rist: fix two minor memory leaks 2020-02-21 12:16:31 +01:00
Marc Leeman
6da6b6f3f0 rtpmanagerbad: fix two minor memory leaks 2020-02-21 12:16:28 +01:00
Marc Leeman
a710fbc12b rtpmanagerbad: reduce lock in rtpsink 2020-02-21 12:16:21 +01:00
Marc Leeman
61b062a12e rtpmanagerbad: documentation comment fix 2020-02-21 12:16:17 +01:00
Vivia Nikolaidou
3df3c3c5f6 tsparse: Add split-on-rai property
If set, buffers sized smaller than the alignment will be sent so that
RAI packets are at the start of a new buffer.

Fixes: #1190
2020-02-11 10:56:54 +00:00
Thiago Santos
0a128155b3 sdpdemux: check if connections are available on media entry before get
Otherwise we trigger an assert.
2020-02-02 22:15:40 +00:00
Vivia Nikolaidou
8d522bf3e6 mpegtsparse: Moved dispose function into finalize
dispose can be called several times and would double-free the flow
combiner in that case.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
0d2e908523 mpegtsparse: Added alignment property
alignment works like in mpegtsmux, joining several MpegTS packets into
one buffer. Default value of 0 joins as many as possible for each
incoming buffer, to optimise CPU usage.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
2f946274d5 mpegtsparse: Set delta unit flag on non-random-access buffers
If they don't have the random access flag set, they cannot be decoded
independently.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
34af8ed66a mpegtsparse: Packetize output on default srcpad
Align buffer boundaries with mpeg-ts packets, instead of keeping
whatever packetization we have from the source (network, file reading).
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
e44cbfb1da mpegtsparse: Factor common code into mpegts_packet_to_buffer
The same code was used twice for turning an MpegTSPacketizerPacket into
a GstBuffer.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
68f69d419b mpegtspacketizer: Fix typo in flag name 2020-01-29 20:39:44 +00:00
Sebastian Dröge
287f9b18b0 mpegdemux: Update the last_ts correctly if we have no DTS
If we have no DTS but a PTS then this means both are the same, and we
should update the last_ts with the PTS. Only if both are unknown then we
don't know the current position and should not update it at all.

Previously we would always update the last_ts to GST_CLOCK_TIME_NONE if
the DTS is unknown, which caused the position to jump around and to
cause spurious gap events to be sent.
2020-01-21 23:50:52 +00:00