Commit graph

10287 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
db382cbc3d videocrop: handle non raw caps features
Currently, videocrop, only negotiates raw caps (system memory) because
it's the type of memory it can modify. Nonetheless, it's also possible
for the element to handle non-raw caps when only adding the crop meta
is possible, in other words, when downstream buffer pools expose the
crop API.

This patch enable non-raw caps negotiation. If downstream doesn't
expose crop API and negotiated caps are featured, the negotiation
fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/915>
2021-03-26 10:19:03 +00:00
Sebastian Dröge
516988bfad rtpbin: Don't special-case G_SIGNAL_RUN_CLEANUP stage in signal accumulators
All these signals don't run the class handler in the CLEANUP stage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/913>
2021-03-26 09:31:11 +00:00
Sid Sethupathi
0a0333d9e4 shapewipe: fix broken link in docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/916>
2021-03-20 12:33:55 -05:00
Alba Mendez
20e80f1473 rtspsrc: Fix more signals
Behaviour change in GLib causes select-stream signal to discard
the value returned by handlers. See !909 for more info.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/912>
2021-03-19 07:23:42 +00:00
Matthew Waters
612102fdbc gst: don't use volatile to mean atomic
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead.  GCC 11 has started warning about using volatile
with atomic operations.

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/911>
2021-03-18 19:52:53 +11:00
Nirbheek Chauhan
95ef0a1df8 Update docs cache and fix before-send signal doc syntax
The docs for before-send were missing because of this

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/909>
2021-03-17 15:55:30 +05:30
Nirbheek Chauhan
73fb107a85 rtspsrc: Fix accumulation of before-send signal return values
Since glib 2.62, the accumulated return values in RUN_CLEANUP override the
accumulated return values in RUN_FIRST. Since:

1. We have a default handler that always returns TRUE, and
2. User handlers are only run in RUN_FIRST, and
3. Our accumulator just takes the latest return value

We were discarding the return value from the user handler and always
sending messages even if the user handler said not to. See
https://gitlab.gnome.org/GNOME/glib/-/issues/2352 for more details.

This signal does not need RUN_CLEANUP or RUN_FIRST, so just change it
to RUN_LAST so that it's emitted exactly once and accumulated once.

With this fix, this signal can now be used to intercept PAUSE when
going to GST_STATE_NULL so that the server does a TEARDOWN (if
necessary) and not a PAUSE, which will confuse other RTSP clients when
playing shared media.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/909>
2021-03-17 14:05:44 +05:30
Nirbheek Chauhan
55edd59f48 Revert unusable workaround for PAUSE being sent when going NULL
Directly setting rtspsrc to the NULL state before putting the pipeline
in the NULL state usually works, but it can cause a deadlock in some
cases, so it's not a reliable mechanism to fix this.

This reverts commit f37afdafff:
"rtspsrc: Fix state changes from PAUSED to PLAYING"

and commit 76d624b2df:
"rtspsrc: Do not send PAUSE command when going to GST_STATE_NULL"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/908>
2021-03-17 14:04:16 +05:30
Sebastian Dröge
00e73e1657 rtpjitterbuffer: Fix parsing of the mediaclk:direct= field
Due to an off-by-one when parsing the string, the most significant digit
or the clock offset was skipped when parsing the offset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/907>
2021-03-16 18:02:48 +00:00
Nirbheek Chauhan
f37afdafff rtspsrc: Fix state changes from PAUSED to PLAYING
This was accidentally broken in the last commit that touched this
because I missed the fall-through in the case immediately above this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/906>
2021-03-16 00:10:24 +05:30
Sebastian Dröge
242f3cae6d matroskademux: Fix extraction of multichannel WavPack
The old code had a couple of issues that all lead to potential memory
safety bugs.

  - Use a constant for the Wavpack4Header size instead of using sizeof.
    It's written out into the data and not from the struct and who knows
    what special alignment/padding requirements some C compilers have.
  - gst_buffer_set_size() does not realloc the buffer when setting a
    bigger size than allocated, it only allows growing up to the maximum
    allocated size. Instead use a GstAdapter to collect all the blocks
    and take out everything at once in the end.
  - Check that enough data is actually available in the input and
    otherwise handle it an error in all cases instead of silently
    ignoring it.

Among other things this fixes out of bounds writes because the code
assumed gst_buffer_set_size() can grow the buffer and simply wrote after
the end of the buffer.

Thanks to Natalie Silvanovich for reporting.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/859

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/902>
2021-03-15 12:34:49 +00:00
Sebastian Dröge
6c461e90bc matroskademux: Initialize track context out parameter to NULL before parsing
Various error return paths don't set it to NULL and callers are only
checking if the pointer is NULL. As it's allocated on the stack this
usually contains random stack memory, and more often than not the memory
of a previously parsed track.

This then causes all kinds of memory corruptions further down the line.

Thanks to Natalie Silvanovich for reporting.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/858

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/902>
2021-03-15 12:34:04 +00:00
Nirbheek Chauhan
76d624b2df rtspsrc: Do not send PAUSE command when going to GST_STATE_NULL
This usually doesn't matter, but it is disruptive when streaming from
a shared media since it will pause all other clients when any client
exits.

This new behaviour is opt-in and should be safe because you need to
set the NULL state on rtspsrc directly, instead of just on the
pipeline. See the updated documentation for an explanation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/901>
2021-03-15 12:59:09 +05:30
Mathieu Duponchelle
f2d909eb4e rtspsrc: fix title of a few properties docstrings
GstRtspSrc -> GstRTSPSrc

This would have been noticed by the since checker, but those
properties were introduced prior to that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/899>
2021-03-11 22:22:15 +01:00
Matthew Waters
e73559f815 matroska: also support push-mode from seek events sent to the element
Otherwise sending seek events would fail to actually seek.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/891>
2021-03-04 13:28:55 +00:00
Marc Leeman
c7356c70ee gstrtspsrc: 551 should not result in an unhandled error
Some cameras (e.g. HikVision DS-2CD2732F-IS) return "551 Option
not supported" when a command is sent that is not implemented
(e.g. PAUSE). Instead; it should return "501 Not Implemented".

This is wrong, as previously, the camera did announce support for PAUSE
in the OPTIONS.

In this case, handle the 551 as if it was 501 to avoid throwing errors
to application level. */

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/885>
2021-03-04 13:07:49 +01:00
Seungha Yang
614f4ec5b5 rtpmanager: Fix an MSVC compile warning
We don't expect this object is a part of public library.

gstrtphdrext-twcc.c(45): warning C4273: 'gst_rtp_header_extension_twcc_get_type': inconsistent dll linkage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/889>
2021-03-03 18:30:39 +09:00
Guillaume Desmottes
1796f3f5e4 wavparse: fix seeking in READY state
wavparse claims to be able to support seeking in the READY state by
saving the pending seek event and actually seeking later after having parsed the
header.
Problem was that this seek event was reset on the READY to PAUSED
transition, making all this code useless. Fixing it by stop resetting
on READY to PAUSED transition as we already reset on PAUSED to READY
and when initiating the element.

Note that DTS marker detection isn't support in such scenario as
gst_type_find_helper_for_buffer() needs a buffer containing the
beginning of the stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/879>
2021-02-18 16:32:24 +01:00
Mathieu Duponchelle
49de1e6679 rtph264depay: expose request-keyframe property
When set, the depayloader will request new keyframes on packet
loss

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/834>
2021-02-18 01:54:03 +00:00
Mathieu Duponchelle
20fc6da913 rtpvp8depay: expose request-keyframe property
When set, the depayloader will request new keyframes on packet
loss

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/834>
2021-02-18 01:54:03 +00:00
Mathieu Duponchelle
69a43dd00b rtph264depay: expose wait-for-keyframe property
Similar to rtpvp8depay, when packet loss occurs, the depayloader
starts waiting for a keyframe.

We try to only stop waiting when all the packets for the new keyframe
have been received, by only resetting waiting_for_keyframe when
encountering the first packet of a keyframe, this is slightly
fragile because there is no bit that explicitly marks the start
of an access unit, so we rely on the existing picture_start
detection code.

As a consequence, the property is only meaningful when outputting
access units, and is ignored when outputting NALs directly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/834>
2021-02-18 01:54:03 +00:00
Mathieu Duponchelle
e71648e214 videomixer: document as deprecated
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/878>
2021-02-18 01:48:24 +01:00
Ashley Brighthope
2a4c63036b wavenc: Fixed INFO chunk corruption, caused by odd sized data not being padded. Code style was updated.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/873>
2021-02-17 09:54:40 +02:00
Jakub Adam
5fe0aa03eb rtpopuspay: add info regarding (non-standard) multichannel support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/832>
2021-02-11 07:46:04 +00:00
Jakub Adam
8f6969429d rtpopusdepay: support libwebrtc-compatible multichannel payload
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/832>
2021-02-11 07:46:04 +00:00
Jakub Adam
b9ed5c7fa0 rtpopuspay: support libwebrtc-compatible multichannel payload
When the audio has more than 2 channels, add optional fields to output
caps from which webrtcbin can generate SDP in the syntax recognized by
"multiopus" codec present in libwebrtc [1].

e.g. for 5.1 audio:

a=rtpmap:96 multiopus/48000/6
a=fmtp:96 num_streams=4;coupled_streams=2;channel_mapping=0,4,1,2,3,5

[1] https://webrtc-review.googlesource.com/c/src/+/129768

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/832>
2021-02-11 07:46:04 +00:00
Jakub Adam
8b4147c757 rtpopuspay: make use of gst_rtp_base_payload_set_outcaps_structure()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/832>
2021-02-11 07:46:04 +00:00
Olivier Crête
45d105bea2 effectv: Remove redundant license file
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/869>
2021-02-09 19:31:28 -05:00
Xabier Rodriguez Calvar
61d204ab22 qtdemux: added support for cbcs encryption scheme
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/865>
2021-02-04 12:30:22 +01:00
Guillaume Desmottes
7b7e49de31 rtp: add rtphdrextrfc6464
Header Extension for Client-to-Mixer Audio Level Indication as
defined in RFC 6464.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/630>
2021-02-04 11:12:51 +01:00
Guillaume Desmottes
4b6c3c9a1b level: add GstRTPAudioLevelMeta on buffers
This meta can be used by a RTP payloader to send the level information
to the peer.

Part of https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/446

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/630>
2021-02-04 11:12:47 +01:00
Robert Swain
25f98ab134 deinterlace: Provide documentation for GST_DEINTERLACE_BUFFER_STATE
More information available in
https://gstconf.ubicast.tv/videos/interlacing-and-telecine-in-gstreamer/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/866>
2021-02-03 17:10:20 +02:00
Vivia Nikolaidou
c7b11482d0 deinterlace: Fix telecine/onefield mixup
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/838

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/866>
2021-02-03 16:30:15 +02:00
Vivia Nikolaidou
4c4e1b580e deinterlace: Better alternate support
Improve line offset halving based on whether this field is top or
bottom.

Also handle the buffer state the same as mixed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/866>
2021-02-03 16:30:15 +02:00
Tobias Ronge
706d91371c rtspsrc: Do not wait for response while flushing
Due to the may_cancel flag in GstRTSPConnection, receiving might not get
cancelled when supposed to. In this case, gst_rtsp_src_receive_response
will have to wait until timeout instead but if busy receiving RTP
data, this timeout will never occur.

With this patch, gst_rtsp_src_receive_response returns GST_RTSP_EINTR
if flushing is set to TRUE instead of continuing to receive.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/831>
2021-01-15 09:24:51 +00:00
Xabier Rodriguez Calvar
c5ebaadf9d qtdemux: Allow streams with no specified protection system ID
This is necessary in cases like CMAF where there won't be any events
passing thru.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/852>
2021-01-14 10:11:10 +01:00
Sanchayan Maity
79efd372c1 udpsrc: Fix marker links
These should be with a single ':'. The double '::' results in a CI with
build failure message like below.

ERROR: [links]: (mandatory-link-not-found): Mandatory link Link GstSocketTimestamp -> None (GstSocketTimestamp) could not be resolved
ERROR: [check-missing-since-markers]: (missing-since-marker): Missing since marker for udpsrc:socket-timestamp
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/828>
2021-01-04 15:23:22 -05:00
Sanchayan Maity
e0b09a1612 udpsrc: Allow use of socket control message timestamps for DTS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/828>
2021-01-04 15:23:22 -05:00
Matthew Waters
db15ec9286 videoflip: fix possible crash when setting the video-direction while running
A classic case of not enough locking.

One interesting thing with this is the interaction between the
rotation value and caps negotiation.  i.e. the width/height of the caps
can be swapped depending on the video-direction property.  We can't lock
the entirety of the caps negotiation for obvious reasons so we need to
do something else.  This takes the approach of trying to use a single
rotation value throughout the entirety of the negotiation and then
subsequent output frame in a kind of latching sequence.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/792
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/836>
2021-01-04 12:10:12 +00:00
Ignacio Casal Quinteiro
219b659320 deinterlace: force -DPREFIX on macos
This is due to a bug in meson where it will not detect properly
the compiler if the symbols need an undercore.
https://github.com/mesonbuild/meson/issues/5482

Fixes #821

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/845>
2020-12-30 13:40:35 +01:00
Sebastian Dröge
39c6bc0507 rtspsrc: Use proper types instead of G_TYPE_POINTER for the RTSP messages in the "handle-request" signal
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/842>
2020-12-21 09:59:43 +00:00
Vivia Nikolaidou
81d2f67ba5 splitmuxsink: Avoid deadlock when releasing a pad from a running muxer
Might not drain correctly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/838>
2020-12-16 06:17:08 +00:00
Mathieu Duponchelle
6d4dcb430d rtpst2022-1-fecdec: don't xor out of bounds
When reconstituting packets from a stream with variable packet
sizes, don't xor larger packets past the length of the protected
packet

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/839>
2020-12-12 09:29:15 +00:00
Mathieu Duponchelle
6d98415fd4 rtpst2022-1-fecenc: memset when reallocating xored payload
When protecting packets with a variable payload length, we
reallocate the xored payload when needed. It is a good idea
to memset the extended memory to 0 so that we don't xor
data with garbage!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/839>
2020-12-12 09:29:15 +00:00
Mathieu Duponchelle
081509e030 rtpst2022-1-fec-*: protect additional RTP header fields
While the standard is a bit vague about whether the padding,
extension and marker bits should be protected:

> The usage, by senders and receivers, of the following bits shall
> be defined by the associated video/audio transport standards:

It is obviously necessary and useful for some formats (eg VP8)
that those indeed be protected.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/839>
2020-12-12 09:29:15 +00:00
Jan Schmidt
d7a9a844f6 splitmuxsink: Fix for 'reference bytes muxed' check.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/798
introduced a check in the need-new-fragment logic to avoid starting a
new fragment unless there has been some data on the reference stream,
but the check is done against the number of bytes that have been
received on the input, not the number that were released for output
into the current fragment.

Fix the check to remember and test against bytes that have been sent
for output.

This also fixes a problem where starting a new fragment fails to
request a new filename from the format-location signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/833>
2020-12-12 03:28:19 +11:00
Jan Schmidt
67f70af1bb splitmuxsink: Add debug for fragment opened/closed msgs
When posting fragment-opened and fragment-closed messages,
put a debug statement in the logs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/833>
2020-12-09 01:03:01 +11:00
Jan Schmidt
df8b147e75 splitmuxsink: Convert asserts into element errors.
Change some g_assert into element errors so that they can be
caught and the pipeline shut down.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/833>
2020-12-09 01:03:01 +11:00
Matthew Waters
656af79130 rtpmanager: update for rtp header extensions
Provide an implementation of the transport-wide-cc header extension and
use it in rtpfunnel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/808>
2020-12-04 13:24:19 +11:00
Nirbheek Chauhan
552da8569b deinterlace: Enable x86 assembly with nasm on MSVC
We need to remove x86inc.asm from the list of compiled assembly files
because it is not supposed to be compiled separately. It is directly
included by yadif.asm, and it exports no symbols.

The object file was getting ignored on all platforms except on msvc
where it was causing a linker hang when building with debugging
enabled because the object file had no debug symbols (or similar).
We've seen this before in FFmpeg too, which uses nasm:
https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg/-/merge_requests/46

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/825>
2020-11-24 22:11:50 +05:30