Commit graph

7280 commits

Author SHA1 Message Date
Nicolas Dufresne
afa1c19b37 waylandsink: Fix double render check
Our code does not support rendering twice the same wl_buffer in a row, so it
tries to skip that case, but for this it relied on the GstBuffer pointer,
while the cache actually works at the GstMemory level now. To avoid this
compare the GstWlBuffer instead.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2526>
2021-09-17 14:14:42 +00:00
U. Artie Eoff
48474d3cf7 tests: skip cc tests if plugin is disabled
Skip the closedcaption element tests if the
closedcaption option is disabled at compile
time (i.e. -Dclosedcaption=disabled).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1388>
2021-09-15 10:04:14 -07:00
U. Artie Eoff
8b1634930f tests: skip aes test if elements not built
In ext/aes/meson.build, the aes_dep will return
not-found if -Daes=disabled, regardless of whether
openssl is found or not.  Thus, we don't need a
separate check for the option.  This will also
ensure that aes_dep is always defined and we can
use it in the tests/check/meson.build unit.

Fixes #1660

v2: handle -Daes=disabled, too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2522>
2021-09-14 23:15:44 -07:00
Philippe Normand
5dc39091f3 wpe: Add support for web:// URIs
The CEF source already supports this. No good reason for wpesrc not too ;)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2503>
2021-09-13 15:02:24 +00:00
Jan Schmidt
640aad2b46 mpeg2enc: Only allow 1 pending frame for encoding
Having an unlimited input queue is very bad if the
encoder can't run at real-time. Eventually it will
consume all RAM. I don't really see any reason to
have more than 1 outstanding encoded frame, so
remove the queue and limit things to 1 pending frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2499>
2021-09-06 14:14:50 +00:00
Thibault Saunier
cd3aa029d6 wpe: Fix race condition on teardown
There was a race when going to PAUSED while pushing a buffer to the
pipeline process (where we weren't even cancelling anything).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>
2021-09-03 15:56:31 +00:00
Thibault Saunier
f7cbbb5d9a wpe: Use the new element.get_current_running_time API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>
2021-09-03 15:56:31 +00:00
Thibault Saunier
0531eebf51 wpe: Mark first buffer as starting at 0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>
2021-09-03 15:56:31 +00:00
Philippe Normand
cfc80e5168 wpevideosrc: Uniformise default value for draw-background property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2498>
2021-08-31 17:59:06 +00:00
Philippe Normand
2b6f0404a7 wpevideosrc: Implement basic heuristic for raw caps negotiation
Before this patch raw caps could be negotiated already with a capsfilter, but in
cases where wpesrc is being auto-plugged this approach can't be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2498>
2021-08-31 17:59:06 +00:00
Philippe Normand
edc04df13c wpevideosrc: Ensure debug category is set
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2498>
2021-08-31 17:59:06 +00:00
Mathieu Duponchelle
20483c3449 cccombiner: fix scheduling with interlaced video buffers
The initial code was written with the misunderstanding that
IS_TOP_FIELD indicated that an interlaced buffer contained
a top field, not that it contained only a top field

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2413>
2021-08-30 21:27:44 +00:00
Alex Ashley
fd1e75900d dashdemux: copy ContentProtection element including xml namespaces
Commit bc09d8cc changed gstmpdparser to put the entire
<ContentProtection> element in the "value" field, so that DRMs
other than PlayReady could make use of the data inside this
element.

However, the data in the "value" field does not include any
XML namespace declarations that are used within the element. This
causes problems for a namespace aware XML parser that wants to
make use of this data.

This commit modifies the way the XML is converted to a string
so that XML namespaces are preserved in the output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2487>
2021-08-27 10:47:06 +00:00
Aaron Boxer
5cf4dc2b82 aes: add aes encryption and decryption elements
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1505>
2021-08-25 21:16:09 -04:00
Johan Sternerup
1a919a1e41 webrtcbin: Return typed "sctp-transport"
With GstWebRTCSCTPTransport type exposed we can now define
"sctp-transport" property as being of this type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2214>
2021-08-25 13:20:22 +00:00
Johan Sternerup
607ef6db60 webrtc: Split sctptransport into lib and implementation parts
GstWebRTCSCTPTransport is now made into into an abstract base class
that only contains property specifications matching the
RTCSctpTransport interface of the W3C WebRTC specification, see
https://w3c.github.io/webrtc-pc/#rtcsctptransport-interface. This
class is put into the WebRTC library to expose it for applications and
to allow for generation of bindings for non-dynamic languages using
GObject introspection.

The actual implementation is moved to the subclass WebRTCSCTPTransport
located in the WebRTC plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2214>
2021-08-25 13:20:22 +00:00
Johan Sternerup
7f9bb15055 webrtcbin: Expose SCTP Transport
Being able to access the SCTP Transport object from the application
means the application can access the associated DTLS Transport object
and its ICE Transport object. This means we can observe the ICE state
also for a data-channel-only session. The collated
ice-connection-state on webrtcbin only includes the ICE Transport
objects that resides on the RTP transceivers (which is exactly how it
is specified in
https://w3c.github.io/webrtc-pc/#rtciceconnectionstate-enum).

For the consent freshness functionality (RFC 7675) to work the ICE
state must be accessible and consequently the SCTP transport must be
accessible for enabling consent freshness checking for a
data-channel-only session.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2214>
2021-08-25 13:20:22 +00:00
Tim-Philipp Müller
67a49be61f openh264enc: fix broken header AU emission by base class
This encoder advertises alignment=au as output format, which means
each output frame should contain a full decodable access unit.

The video encoder base class is not aware of our output alignment
and will output spurious buffers with just the SPS/PPS inside when
we call gst_video_encoder_set_headers(), which is broken because
each buffer is supposed to contain a full decodable access unit
in our case.

Just don't tell the base class about our headers, they will be
sent at the beginning of each IDR frame anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2178>
2021-08-24 23:42:27 +01:00
Tim-Philipp Müller
90c1732849 openh264enc: fix caps and header buffer leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2178>
2021-08-24 23:42:27 +01:00
Tim-Philipp Müller
42a7edd40f openh264enc: fix broken sps/pps header generation
This was putting a truncated SPS into the initial header instead
of the PPS because it was always reading from the beginning of the
bitstream buffer (pBsBuf) and not from the offset where the current
NAL is at in the bitstream buffer (psBsBuf + nal_offset).

This was broken in commit 17113695.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2178>
2021-08-24 23:42:27 +01:00
Edward Hervey
e9996be658 dashdemux: Properly initalize GError
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2476>
2021-08-20 14:35:43 +02:00
Matthew Waters
18314764fc webrtc: improve matching on the correct jitterbuffer
The mapping between an RTP session and the SDP m= line is not always the
same, especially when BUNDLEing is used.

This causes a failure in a specific case where if when bundling,
if mline 0 is a data channel, and mline 1 an audio/video section,
then retrieving the transceiver at mline 0 (rtp session used) will fail
and cause an assertion.

This fix is actually potentially a regression for cases where the remote
part does not provide the a=ssrc: media level SDP attributes as is now
becoming common, especially when simulcast is involved.

The correct fix actually requires reading out header extensions as used
with bundle for signalling in the actual data, what media and therefore
transceiver is being used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2467>
2021-08-16 16:15:44 +00:00
Thibault Saunier
a917648be3 fdkaacdec: Add Converter class to hint gst-validate
fdkaacdec have minimal conversion capability, adding the Converter class allow
gst-validate to behave properly and not spit an error when it notice that the
number of channels or rate miss-match in and out.

Same logic as with opusdec, see: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1142>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2462>
2021-08-13 15:25:16 +00:00
Mathieu Duponchelle
152813e71d ccconverter: fix overflow when not doing framerate conversion
When converting from one framerate to another, counters are
reset periodically, however when not converting they never are
and can_genearte_output ends up making overflow-prone calculations
with large values for input_frames and output_frames.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2465>
2021-08-13 03:37:28 +00:00
Sebastian Dröge
01c430fa45 webrtcbin: Don't assume that non-audio medias are video medias when creating transceivers
And print the unknown media kind in the logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2464>
2021-08-12 12:31:15 +00:00
Sebastian Dröge
7a03acc546 webrtcbin: Use the correct media for deciding the media kind when creating the transceiver from the SDP
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2464>
2021-08-12 12:31:15 +00:00
Thibault Saunier
e4c82f450d openh264: Respect level set downstream
We were not specifying the requested level to openh264  meaning that
it was choosing anything and was not respecting what was specified\
downstream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2289>
2021-08-09 20:17:54 +00:00
He Junyan
c5fda68403 x265: Fix a deadlock when failing to create the x265enc.
The GST_ELEMENT_ERROR will call the gst_object_get_path_string and
use gst_object_get_parent to get the full object path name, which
needs to lock the object. But we are already in a locked context and
so this will cause a deadlock, the pipeline can not exit normally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2451>
2021-08-09 10:28:11 +00:00
R S Nikhil Krishna
34c81d13b6 rtmpsrc: mention setting librtmp flags in docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2424>
2021-08-09 01:27:01 +05:30
Mathieu Duponchelle
c5d725652d mpeg2enc: fix interlace-mode detection
Previously, the code was always assuming progressive input,
fix this by looking at the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2455>
2021-08-05 23:12:32 +02:00
Tim-Philipp Müller
a561b1bd86 Use g_memdup2() where available and add fallback for older GLib versions
g_memdup() is deprecated since GLib 2.68 and we want to avoid
deprecation warnings with recent versions of GLib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2280>
2021-08-05 20:51:00 +05:30
Mathieu Duponchelle
af7138ebc4 cccombiner: fix CDP padding detection
While a cc_data_pkt with cc_valid 0 should be considered padding,
it might be followed up by valid DTVCC packets, and should not
cause the whole CDP packet to get discarded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2440>
2021-07-28 11:53:12 +00:00
Philippe Normand
bc09d8cc66 dash: Store entire ContentProtection node in protection event data
Some manifests use the ContentProtection node to store additional information
such as the license server url. Our MPD parser used to process the
ContentProtection node, extracting Playready PSSH boxes. However for other DRM
systems, only the `value` attribute was passed down to the protection event, so
for example, Widevine data was not parsed at all and "Widevine" was passed to
the event, which is not very useful for decryptors that require a PSSH init
data.

Parsing should now be done by decryptors which will receive the entire
ContentProtection XML node as a string. This gives more "freedom" to the
decryptor which can then detect and parse custom nodes as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2400>
2021-07-15 13:05:54 +00:00
Philippe Normand
108eba3603 wpesrcbin: Use gst_buffer_new_memdup()
g_memdup() is deprecated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2406>
2021-07-13 16:03:10 +00:00
Víctor Manuel Jáquez Leal
1a32deefa6 vulkansink: Fix element metadata.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2396>
2021-07-12 05:08:09 +00:00
Philippe Normand
be7e0600ec dashdemux: Log protection events on corresponding pad
GstDashDemuxStream is not a GstObject, so use its pad as associated object when
emitting log messages.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2389>
2021-07-08 14:42:12 +00:00
Mathieu Duponchelle
64190e7452 cccombiner: mark field 0 as valid when generating padding CDP
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2383>
2021-07-08 00:26:05 +00:00
Stéphane Cerveau
a8c2b65880 dashsink: fix crash with no pad name for representation
if there is no pad name, the representation id
was NULL, causing a crash when writing the mpd file.

gst-launch-1.0 videotestsrc num-buffers=900 ! video/x-raw, width=800,
height=600, framerate=30/1 ! x264enc ! video/x-h264, profile=high !
dashsink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2064>
2021-07-07 13:50:35 +00:00
Stéphane Cerveau
506bd90bf7 dashsink: Add signals for allowing custom playlist/fragment
Instead of always going through the file system API we allow the
application to modify the behaviour. For the playlist itself and
fragments, the application can provide a GOutputStream. In addition the
sink notifies the application whenever a fragment can be deleted.

Following the HLS change:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/918

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2064>
2021-07-07 13:50:35 +00:00
Matthew Waters
8fd2c68968 ccconverter: fix framerate caps negotiation from non-cdp to cdp
We can only convert from non-cdp to cdp within the confines of valid cdp
framerates.  The existing caps negotiation code was allowing any
framerate to convert to a cdp output which is incorrect and would hit an
assertion later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2372>
2021-07-02 10:22:31 +03:00
Olivier Crête
e548916d85 webrtc receivebin: Drop serialized queries before receive queue
If they're not dropped, they can be blocked in the queue even if it is
leaky in the case where there is a buffer being pushed downstream. Since
in webrtc, it's unlikely that there will be a special allocator to
receive RTP packets, there is almost no downside to just ignoring the
queries.

Also drop queries if they get caught in the pad probe after the queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2363>
2021-06-29 00:42:20 -04:00
Olivier Crête
543fcb93a4 webrtc receivebin: Only set queue to leaky when the pad is blocked
When the pad is no longer blocked, remove the leakyness to make sure
everything gets into the jitterbuffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2363>
2021-06-29 00:42:20 -04:00
Olivier Crête
a07e52528c webrtc receivebin: Don't unblock pad until sender is unblocked
As ther OpenSSL session is created when the receiver goes into
playing, we have to wait for the ICE session to be connected before we
can start delivering packets to the DTLS element.

Fixes #1599

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2363>
2021-06-29 00:42:20 -04:00
Sebastian Dröge
0e559fc2f3 webrtcbin: Sync to the clock per stream and not per bundle
By using the clocksync inside the dtlssrtpenc, all streams inside a
bundled are synchronized together. This will cause problems if their
buffers are not already arriving synchronized: clocksync would wait for
a buffer on one stream and then buffers from the other stream(s) with
lower timestamps would all be sent out too late.

Placing the clocksync before the rtpbin and rtpfunnel synchronizes each
stream individually and they will be send out more smoothly as a result.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2355>
2021-06-28 16:38:33 +00:00
Olivier Crête
ee0124cb36 webrtc: Remove the webrtc-priv.h header from public headers
And this time for real, also import it in a couple more places
inside the webrtc element to make it build.

Fixes #1607

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2359>
2021-06-28 16:06:59 +00:00
Sebastian Dröge
096a7f1ac0 webrtcbin: Set transceiver kind and codec preferences immediately when creating it
Otherwise the on-new-transceiver signal will always be emitted with kind
set to UNKNOWN and no codec preferences although both are often known at
this point already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2360>
2021-06-25 14:35:43 +03:00
Sebastian Dröge
7ee8f4539e webrtcbin: Store newly created transceivers when creating an answer also in the seen transceivers list
Otherwise it might be used a second time for another media afterwards.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2310>
2021-06-25 09:45:24 +00:00
Sebastian Dröge
4efdb40f43 webrtcbin: When creating a new transceiver as part of creating the answer also take its codec preferences into account
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2310>
2021-06-25 09:45:24 +00:00
Sebastian Dröge
b7951fb897 webrtcbin: Fix a couple of caps leaks of the offer caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2310>
2021-06-25 09:45:24 +00:00
Philippe Normand
0f492a39c9 webrtcbin: Stop transceivers update after first SDP error on data channel
When invalid SDP is supplied, _update_data_channel_from_sdp_media() sets the
GError, so it is invalid to continue any further SDP processing, we have to exit
early when the first error is raised.

This change is similar to the one applied in
064428cb34.
See also #1595

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2356>
2021-06-25 05:12:37 +00:00