Commit graph

512 commits

Author SHA1 Message Date
Jan Schmidt
f53dbb28b2 rtspsrc: Parse Speed/Scale before Range in responses
Parse the speed and scale in the server's response
*before* the range, so that the range start/stop
are swapped (or not swapped) correctly based
on the server's actual chosen values. Otherwise,
the old rate from the segment is used - what the
last seek asked for, but not necessarily what
the server chooses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6248>
2024-03-06 17:50:53 +00:00
Jan Schmidt
57013e1a7c rtspsrc: Handle queries and events with no manager
When doing direct output with no session manager, we still
want to respond to queries and events from downstream, so
install the handlers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6248>
2024-03-06 17:50:53 +00:00
Jan Schmidt
4d2f000125 rtspsrc: return NO_PREROLL on PLAYING->PAUSED too
When transitioning back to PAUSED and rtspsrc is live, return
NO_PREROLL so the pipeline knows to skip preroll here too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6248>
2024-03-06 17:50:53 +00:00
Tim-Philipp Müller
4db25f1500 rtspsrc: Consider 503 Service Not Available when handling broken control urls
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6213>
2024-03-05 17:45:18 +00:00
Nirbheek Chauhan
cf2238a522 rtspsrc: Increase rank to PRIMARY for autoplug purposes
This affects autoplug by gst_element_make_from_uri() in, for example,
uridecodebin. The element should've already been PRIMARY rank, but it
was NONE because gst_element_make_from_uri() doesn't ignore NONE rank
elements when searching for element factories, unlike decodebin.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/502

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6226>
2024-02-27 11:36:01 +00:00
Sebastian Dröge
69e4564c87 rtphdrext-clientaudiolevel: Fix typo in documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6175>
2024-02-21 17:25:43 +00:00
Tim-Philipp Müller
0a6948ee20 rtppassthroughpay: fix critical in gst-inspect
gst_segment_to_running_time() will fail noisily
if the segment has not been initialised yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6151>
2024-02-21 11:25:10 +00:00
Jan Schmidt
f7e494f348 rtspsrc: Reset combined flows after a seek before restarting
After a flushing seek, rtspsrc doesn't reset the last_ret value for
streams, so might immediately shut down again when it resumes pushing
buffers to pads due to a cached `GST_FLOW_FLUSHING` result

Prevent a stored flushing value from immediately stopping
playback again by resetting pad flows before (re)starting
playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6137>
2024-02-21 01:50:13 +00:00
Jochen Henneberg
6608b89977 rtpxqtdepay: Enabled header extension aggregation
Because this depayloader may build several output buffers within one
process run we push them all into a GstBufferList and push them out at
once to make sure that each buffer gets notified about each header
extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
5d1d0cf9a5 rtpmp4gdepay: Enabled header extension aggregation
Because this depayloader may build several output buffers within one
process run we push them all into a GstBufferList and push them out at
once to make sure that each buffer gets notified about each header
extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
75849c63c8 rtpsbcdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
3fffcd021a rtpvorbisdepay: Enabled header extension aggregation
Because this depayloader may build several output buffers within one
process run we push them all into a GstBufferList and push them out at
once to make sure that each buffer gets notified about each header
extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
e1e7421982 rtpmp4vdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
334ceaca21 rtptheoradepay: Enabled header extension aggregation
Because this depayloader may build several output buffers within one
process run we push them all into a GstBufferList and push them out at
once to make sure that each buffer gets notified about each header
extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
0a4918a509 rtpsv3vdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
d810049f01 rtpmp4adepay: Enabled header extension aggregation
Because this depayloader may build several output buffers within one process
run we push them all into a GstBufferList and push them out at once to
make sure that each buffer gets notified about each header extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
90b5d2eb93 rtpklvdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:17 +00:00
Jochen Henneberg
2c3f169ebb rtpjpegdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:16 +00:00
Jochen Henneberg
460813f7ee rtpj2kdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:16 +00:00
Jochen Henneberg
ae3a00abd2 rtph263pdepay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:16 +00:00
Jochen Henneberg
4fd4c240e0 rtph263depay: Enabled header extensions aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:16 +00:00
Jochen Henneberg
ae5bdaa7e1 rtph261depay: Enabled header extension aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
2024-02-19 11:23:16 +00:00
Sebastian Dröge
499474a76d Revert "rtpvp8pay: Use GstBitReader instead of dboolhuff implementation from libvpx"
This reverts commit b730e7a1b2.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6116>
2024-02-14 15:45:24 +00:00
Mathieu Duponchelle
91317aacaf webrtcbin, rtpbin: check before setting properties on jitterbuffer
In rtpbin we already systematically check for all property names
except latency, correct that.

In webrtcbin we need to check before trying to use the do-retransmission
property.

This is useful for the case where an element like identity gets passed
to rtpbin's request-jitterbuffer property, when the application wants
to use webrtcbin in an SFU situation, with no reordering and no added
latency

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6112>
2024-02-14 08:52:50 +00:00
Sebastian Dröge
c726add352 rtpfunnel: Handle NTP-64 RTP header extension in caps similar to TWCC
This is another header extension that is handled by rtpsession and needs
to be preserved in the caps that are created by rtpfunnel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6109>
2024-02-14 08:05:33 +00:00
Sebastian Dröge
17e7af7181 rtpfunnel: Also write TWCC RTP header extension into buffer list buffers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6110>
2024-02-14 01:56:20 +00:00
Philippe Normand
e9ecde83a7 matroska-demux: Basic support for container-specific-track-id tag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6041>
2024-02-12 10:37:29 +00:00
Philippe Normand
30bb88a91b qtdemux: Basic support for container-specific-track-id tag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6041>
2024-02-12 10:37:29 +00:00
Ignazio Pillai
34741e1db2 cutter: add audio-level-meta
Set GstAudioLevelMeta on buffers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5771>
2024-02-08 13:52:40 +00:00
Sebastian Dröge
b730e7a1b2 rtpvp8pay: Use GstBitReader instead of dboolhuff implementation from libvpx
All compressed frame header values that are read as part of the
payloader are encoded as bits with 50:50 probability, and as such are
just the plain bits as they are.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5810>
2024-01-31 16:52:28 +00:00
Daniel Morin
0a55c86e6a rtspsrc: update rtsp url on redirect
- If a redirect took place on a GET when rtsp is tunneled we update the
  rtsp url too.
- log source and final destination on redirect

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5222>
2024-01-31 11:43:45 +00:00
Thibault Saunier
e1a8ce16b4 matroskademux: Lower verbosity of some often happenning warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6011>
2024-01-30 09:09:22 +00:00
Thibault Saunier
77e7efe407 qtdemux: Lower verbosity of some often happenning warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6011>
2024-01-30 09:09:22 +00:00
Jonas K Danielsson
b0becfa46b splitmuxsrc: Use natural ordering to find files
Today when using the `splitmuxsrc` on a collection of files named as:

```
item0.mkv
item1.mkv
item2.mkv
[...]
item10.mkv
item11.mkv
[...]
```

You will get a continuous stream made in the order of:

```
item0.mkv -> item1.mkv -> item10.mkv -> item11.mkv -> [...]
```

You can fix this by having smarter names of the items:

```
item000.mkv
item001.mkv
item002.mkv
[...]
item010.mkv
item011.mkv
[...]
```

Will get you:
```
item000.mkv -> item001.mkv -> item003.mkv -> item004.mkv -> [...]
```

But, we could also "fix" the former case by using natural ordering when
comparing the files in gstsplitutils.c.

Fixes #2523

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4491>
2024-01-24 20:15:19 +00:00
Dan Searles
1d02d7eda0 rtspsrc: fix ttl setting for udpsink[1]
Fix ttl setting being incorrectly applied to udpsink[0] rather
than to udpsink[1].

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5955>
2024-01-23 13:54:51 +00:00
Dan Searles
da55b953a1 rtspsrc: set multicast-iface on udpsinks
Copy rtspsrc property multicast-iface to its udpsinks to
allow messages over those sinks back to the server to work (and
prevent 'Network unreachable' warnings).

Closes: #3239
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5955>
2024-01-23 13:54:51 +00:00
Guillaume Desmottes
fae6fbaa6b flvdemux: don't re-use segment from one stream if the other has buffer earlier
Fix first audio buffers being out of segment because the audio stream
is starting earlier than the video one which was the first demuxed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5940>
2024-01-19 11:05:05 +01:00
Guillaume Desmottes
632ee523fb flvdemux: factor out ensure_new_segment()
- Use the pad instead of the element for logs, so it's clearer on which
  pad this segment will be pushed.
- One copy was checking for invalid seq num, the other was not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5940>
2024-01-19 11:05:01 +01:00
Hou Qi
2539bb0b1d rtpjitterbuffer: Fix build warning in rtp_jitter_buffer_append_query()
This is to fix build warnings when using [-Wmaybe-uninitialized]
../gst/rtpmanager/rtpjitterbuffer.c:1237:10: warning: 'head' may be used uninitialized [-Wmaybe-uninitialized]
 1237 |   return head;

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5907>
2024-01-13 15:00:19 +00:00
Sebastian Dröge
6fa41f78bb rtpsession: Remove some unused fields
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5899>
2024-01-08 12:57:04 +02:00
Sanchayan Maity
00bbac6541 rtphdrext-clientaudiolevel: Fix level value being written by the extension
When level value is greater than 127, it was being clamped but this clamped
value was not the one being actually used. For level values greater than 127
this resulted in an incorrect value being used. As an example, a level value
of 187, after and'ed with 0x7F, it would result in 0x3B being reported as the
level value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5893>
2024-01-07 16:00:18 +05:30
Sebastian Dröge
c292da7044 rtpsession: Only warn once if configured latency needs to be known but isn't yet
Otherwise we would warn about this once for every single packet until
the LATENCY event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5854>
2023-12-27 11:00:44 +00:00
Tim-Philipp Müller
d415816cb1 rtpvrawdepay: only announce supported formats in sink template
For most video formats we currently just assume that they
have a depth of 8 bits, whilst advertising that we can
handle 8/10/12/16 bit depth.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5866>
2023-12-25 19:00:18 +01:00
Sebastian Dröge
c9c26eab26 rtpvp8pay: Also set partition IDs in the packets if meta exists but without temporal_scalability
Encoders will add the meta to every single buffer, but we only cannot set
partition IDs properly when the meta has temporal_scalability set

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5814>
2023-12-21 11:26:49 +00:00
Arun Raghavan
ee903a5afd rtp: Fix incorrect RTP channel order lookup by name
The g_ascii_strcasecmp() logic is inverted, since it returns 0 on equality.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5815>
2023-12-15 15:21:20 -05:00
Sebastian Dröge
14b94ea00b rtpvp9pay: Don't include unused dboolhuff.h header
It's only used by the VP8 payloader.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5784>
2023-12-09 11:17:15 +00:00
Guillaume Desmottes
a56923d5e6 qtdemux: fix bug report URL
Using PACKAGE_BUGREPORT as in other modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5762>
2023-12-05 09:25:22 +01:00
Thibault Saunier
14c7d3f4e9 qtdemux: Do not update demux->offset when droping data on EOS
The offset is updated right after and we were breaking it by updating it
twice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5724>
2023-12-02 08:08:26 +00:00
Thibault Saunier
b1b29de0fb qtdemux: Do not mark stream as EOS only if all streams are EOS
The `GstFlowCombiner` is responsible for tracking the flow of each
stream and handle the overal flow return value. Without that, we
can end up with the following scenario:

- Audio+video stream
- Only the video stream is linked downstream
- The audio stream goes EOS, video doesn't yet
  -> We update the Flow in the combiner with OK as all streams are not EOS
- Video goes EOS because downstream returned EOS
-> `qtdemux` returns `FLOW_OK` forever because the unlinked audio pad
  has `last_flowret==FLOW_OK`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5724>
2023-12-02 08:08:26 +00:00
Thibault Saunier
8295b2ae5c qtdemux: Determine EOS based on the stream segment
Depending on the stream segment might vary (because of edts for example)
leading to EOS being sent at the wrong time (too early for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5724>
2023-12-02 08:08:26 +00:00
Hosang Lee
7bf646e5ba qtdemux: Don't overflow sample index
Don't reduce sample index if it is already at 0.
Assigning -1 to a guint32 variable causes unexpected behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5743>
2023-12-01 13:34:12 +00:00
Hosang Lee
041e0c6cab qtdemux: Fix reverse playback for pcm audio stream
Some raw lpcm or adpcm may have larger sample sizes than the max
buffer size value set.
Trimming the buffer causes bogus size error on reverse playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5742>
2023-12-01 15:11:04 +09:00
Robin Gustavsson
38a8411bdf rtpklvdepay: Recover after invalid fragmented KLV unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4816>
2023-11-17 09:01:10 +00:00
Sebastian Dröge
db77deef00 rtpjitterbuffer: Add new "rfc7273-reference-timestamp-meta-only" property
If this property is enabled then the jitterbuffer will do the normal PTS
calculations according to the configured mode instead of making use of
the RFC7273 media clock.

The timestamp calculated from the RFC7273 media clock will only be
stored in the reference timestamp meta, if addition of that meta is enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5512>
2023-11-16 15:23:29 +00:00
Sebastian Dröge
eae3ef7461 rtpjitterbuffer: Add new rfc7273-use-system-clock property
When this property is used, it is assumed that the system clock is
synced close enough to the media clock used by an RFC7273 stream.

As long as both clocks are at most a few seconds from each other this
will give the correct results and avoids having to create an actual
network clock that has to sync first.

If the system clock is actually synchronized to the media clock then
everything will behave exactly the same, otherwise the reference
timestamp meta will be correct but the buffer timestamps will be off by
the difference between the two clocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5512>
2023-11-16 15:23:29 +00:00
Sebastian Dröge
2956ba48fc rtpjitterbuffer: Improve handling of media clocks
Do more checks for clock equality than just checking pointers. The same
NTP/PTP clock might be used as pipeline clock but a new instance, so
instead also check what clock they are synced to.

Also handling setting / resetting of the media clock and pipeline clock
correctly by resetting the media clock's state accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5512>
2023-11-16 15:23:29 +00:00
Piotr Brzeziński
4037334143 qtdemux: Ignore raw audio streams when adjusting seek
Because we treat raw audio chunks/samples as keyframes, they were interfering
with seek time adjustment.
Became apparent when the accompanying video stream was I-frame only,
for example ProRes.
Since raw audio streams can be seeked freely, it's fine to just ignore them here,
giving priority to the real keyframes in the video stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4946>
2023-11-15 07:55:27 +00:00
Dongyun Seo
8db184085a dcaparse: keep upstream buffer meta
Some audio decoders cannot decode DTS stream if there is no
valid timestamp. So, keep upstream buffer meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5655>
2023-11-14 16:51:44 +09:00
Olivier Crête
c2a357c867 rtpopusdepay: set resync flag
- Set re-sync flag on output buffer when rtp had the marker flag set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5529>
2023-11-10 21:45:13 +00:00
Johan Adam Nilsson
808c27b4cc wavparse: fix buffer leak with adtl tag
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3020
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5595>
2023-11-03 19:38:38 +00:00
Tim-Philipp Müller
bce1d121ba rtpac3depay: should output audio/x-ac3 not audio/ac3
audio/x-ac3 is the canonical media format in GStreamer.
audio/ac3 is sometimes accepted as input (e.g. in rtpac3pay
or ac3parse), but shouldn't be output.

Fixes #3038.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5472>
2023-10-19 13:27:58 +00:00
Stéphane Cerveau
7c7a90b99d imagesequencesrc: fix regular image deadlock
With one regular image file path provided (without %05d),
the element was stuck in a dead loop counting the frames:

gst_image_sequence_src_count_frames

This allows to display any image file out of the element
for a given number of buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5471>
2023-10-12 22:06:02 +00:00
Guillaume Desmottes
a56aabc773 flvmux: set the src segment position as running time
We were already converting the pad last timestamp to running time but
not the segment position.
This segment position is used by gst_aggregator_simple_get_next_time()
to compute the waiting time when aggregating.

Those waiting times were wrong in my live pipeline using the system
clock, resulting in the aggregator to never wait at all.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5460>
2023-10-11 15:20:18 +00:00
Nicolas Dufresne
aaed9272c1 video-filters: Fix passthrough with ANY caps feature
With the support for DRM modifiers, passthrough caps must now include DMA_DRM
format, otherwise pipeline using thhese filters unconditionally may fail
to negotiate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
2023-10-03 21:13:00 +00:00
Xavier Claessens
0ab48250a9 GstCustomMeta: Use simplified API where possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5385>
2023-09-27 18:46:34 +00:00
Daniel Moberg
0e6cd64232 rtspsrc: Property for adding custom http request headers
This commit adds a property which enables adding custom http request headers to
the rtspsrc element. Added headers will be appended to http requests
made during http tunneling.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5268>
2023-09-26 06:35:43 +00:00
Stijn Last
4bda59f88d deinterlace: greedy, improve quality
scanlines->m1 = same line of the previous field
scanlines->t0 = line above of the current field
scanlines->b0 = line below of the current field
scanlines->mp = same line of the next field

Deinterlacing a field weaved frame:
When deinterlacing the top field, the next bottom field is available
(part of the same frame). but when deinterlacing the bottom field,
the next top field (part of the next frame) is not available and
scanlines->mp equals NULL.

In this case it's better to use greedy algorithm using the prevous field
(twice) rather then linear interpolation of the current field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5331>
2023-09-25 06:40:47 +00:00
Sebastian Dröge
2a2ef23829 rtpsource: Don't store invalid running times and calculate with it
If we end up with GST_CLOCK_TIME_NONE as running time for an RTP packet
then this can't be used for bitrate estimation, and also not for
constructing the next RTCP SR. Both would end up with completely wrong
values, and an RTCP SR with wrong values can easily break
synchronization in receivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5329>
2023-09-23 07:39:00 +00:00
Sebastian Dröge
fcd591c1af rtpjitterbuffer: Avoid integer overflow in max saveable packets calculation with negative offset
The timestamp offset can be negative, and it can be a bigger negative
number than the latency introduced by the rtpjitterbuffer so the overall
timeout offset can be negative.

Using the negative offset for calculating how many packets can still
arrive in time when encountering a lost packet in an equidistant stream
would then overflow and instead of considering fewer packets lost a lot
more packets are considered lost.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5296>
2023-09-12 08:38:53 +00:00
Jonas K Danielsson
749652e60c rtp: Add rtppassthroughpay element
This elements pass RTP packets along unchanged and appear as a RTP
payloader element.

This is useful, for example when using the gstreamer-rtsp-server
library, in the case where you are receiving RTP packets from a
different source and want to serve them over RTSP. Since the
gst-rtsp-server library expect the element marked as payX to be a RTP
payloader element and assumes certain properties are available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5204>
2023-08-22 14:01:09 +00:00
Guillaume Desmottes
bc06c2109c flvmux: add 'enforce-increasing-timestamps' property
The hack enforcing strictly increasing timestamps was, according to the
code comments, because librtmp was confused with backwards timestamps.

rtmp2sink is not using librtmp as rtmpsink did, so this is no longer
required.
Also changing the timestamps is causing audio glitches when streaming to
Youtube.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5212>
2023-08-21 14:26:06 +02:00
Sebastian Dröge
09045da073 rtpgstpay: Enable hdrext aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Jochen Henneberg
a97d3acb90 rtp/vp8depay+vp9depay: Enable hdrext aggregation for VP8 and VP9
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Jochen Henneberg
2673a66e60 rtp/h264depay+h265depay: Enable hdrext aggregation for H264 and H265
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Vivia Nikolaidou
3257ee4374 deinterlace: Fix vfir 16-bit orc calculations
memcpy works in bytes, but orc works in items, so given that the size
arguments is in bytes, we need to divide by the pixel stride.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5172>
2023-08-11 17:47:27 +00:00
Vivia Nikolaidou
6145a5c7cb deinterlace: Fix greedyh crash for alternate-field interlacing
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2645

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5172>
2023-08-11 17:47:27 +00:00
Stéphane Cerveau
1e4cc59a3f isomp4: update isml documentation
Closing #2893

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5165>
2023-08-09 09:15:30 +00:00
Tim-Philipp Müller
be2a3780c1 flvmux: use version template in metadata creator properties
Avoids documentation churn when the version changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Tim-Philipp Müller
5bbd8c2d71 rtspsrc: use version template in user-agent property
Avoids documentation churn when the version changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Charlie Blevins
05cffc19dd rtpjitterbuffer: Allow earlier reference-timestamp-meta
Allow reference-timestamp-meta to be added earlier if an RTCP sender
report is sent before the first RTP packet.

Fixes #2843

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5084>
2023-08-03 17:26:42 +00:00
Alicia Boya García
5fd3c8a16c qtdemux: Fix premature EOS when some files are played in push mode
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2771

This EOS branch exists so that if a seek with a stop is made, qtdemux
stops accepting bytes from the sink after the entire requested playback
range is demuxed, as otherwise we could keep download content that is
not being used.

This patch fixes two flaws that were present in that EOS check:

1) A comparison was made between track time and movie time without conversion.
This made the check trigger early in files with edit lists. This patch fixes
this by converting the track PTS to movie PTS (stream time) for the check.

2) To avoid sending a EOS prematurely when the segment stop is within a GOP and
B-frames are present, the check for EOS should only be done for keyframes. I
gather this was already the intention with the existing code, but because it
used `stream->on_keyframe` instead of the local variable `keyframe` the old
code was checking if the *previous* frame was a keyframe.

It's interesting to note that these two flaws in the old code mask each other
in most cases: the track PTS will have reached the movie end PTS, but EOS would
only be sent if the previous frame was a keyframe. A simple case where they
wouldn't mask each other, reproducing the bug, is a sequence of 3 frame GOPs
with structure I-B-P.

The following validateflow tests have been added to future-proof the
fix:

 * validate.test.mp4.qtdemux_ibpibp_non_frag_pull.default
 * validate.test.mp4.qtdemux_ibpibp_non_frag_push.default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5021>
2023-07-26 19:14:43 +00:00
Guillaume Desmottes
6b339b5d39 videoflip: fix concurrent access when modifying the tag list
We were checking if the tag list is writable, but it may actually be
shared through the same event (tee upstream or multiple consumers).

Fix a bug where multiple branches have a videoflip element checking the
taglist. The first one was changing the orientation back to rotate-0
which was resetting the other instances.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5097>
2023-07-25 15:18:05 +02:00
Xabier Rodriguez Calvar
5114fb4170 qtdemux: attach cbcs crypt info at the right moment
Before it was always added but that can cause issues when the stream begins
unencrypted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5085>
2023-07-25 10:06:48 +00:00
David Craven
c79d16ae80 matroska: demux: Strip signal byte from encrypted blocks
Removes the signal byte when the frame is unencrypted to
be consistent with when the frame is encrypted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4997>
2023-07-11 10:26:36 +00:00
Guillaume Desmottes
7b31c89f25 videoflip: fix critical when tag list is not writable
Fix this pipeline where the tag list is not writable:

gst-launch-1.0 videotestsrc ! taginject tags="image-orientation=rotate-90" ! videoflip video-direction=auto \
  ! autovideosink

GStreamer-CRITICAL **: 12:34:36.310: gst_tag_list_add: assertion 'gst_tag_list_is_writable (list)' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4987>
2023-07-07 11:17:43 +00:00
Seungha Yang
794cde703c rtspsrc: Fix crash when is-live=false
The pad's parent (i.e., rtspsrc) can be nullptr since we add pads
later.

Co-authored-by: Jan Schmidt <jan@centricular.com>

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2751
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4965>
2023-07-05 06:48:37 +00:00
Peter Stensson
33fb3bfd60 rtpvp9pay: Only mark first outgoing packet as non delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson
af43648bdf rtpvp8pay: Only mark first outgoing packet as non delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson
b40b4ffb81 rtph265pay: Only mark first NAL as non delta-unit
When the input buffer contained multiple NAL's the second one would keep
the non delta-unit flag for a key frame.

The delta-unit flag will now be set per NAL when preparing the buffer
list to payload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Mathieu Duponchelle
7445b73e76 rtpsession: expose timeout-inactive-sources property
In some situations it is not desirable to time out when no data is
received any longer, users can opt in to this behavior via a new
property.

The property is also exposed on rtpbin and sdpdemux

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4880>
2023-06-28 18:45:25 +00:00
Edward Hervey
2f95cbd551 matroska-demux: Properly handle early time-based segments
Refusing an incoming segment in < GST_MATROSKA_READ_STATE_DATA should only be
done if the incoming segment is not in GST_FORMAT_TIME.

In GST_FORMAT_TIME, we are just storing the values and returning, so we can
invert the order of the checks.

Fixes proper segment propagation in matroska/webm DASH use-cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
François Laignel
1d00f726a0 qtdemux: opus: set entry as sampled
... otherwise streams with constant size samples defined with a single
`sample_size` for all samples in the `stsz` box fall in the category
`chunks_are_samples` in `qtdemux_stbl_init`, overriding the actual
sample count.

`FOURCC_soun` would set this automatically for `compression_id == 0xfffe`,
however `compression_id` is read from the Audio Sample Entry box at an offset
marked as "pre-defined" in some version of the spec and set to 0 both by
GStreamer and FFmpeg for opus streams.

Considering the stream `sampled` flag is set explicitely by other fourcc
variants, doing so for opus seems consistent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4903>
2023-06-20 17:15:22 +00:00
Sebastian Dröge
dbbfc917fe flacparse: Avoid integer overflow in available data check for image tags
If the image length as stored in the file is some bogus integer then
adding it to the current byte readers position can overflow and wrongly
have the check for enough available data succeed.

This then later can cause NULL pointer dereferences or out of bounds
reads/writes when actually reading the image data.

Fixes ZDI-CAN-20775
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4894>
2023-06-20 10:02:19 +00:00
François Laignel
fa30504ec2 qtdemux: parse Opus and dOps as qtdemux nodes and add size checks
This allows checking the nodes conformity and dumping parsed values.

Note: Audio Sample Entry version parsing and offset handling is handled as part
of `FOURCC_soun` common processing and in `qtdemux_parse_node`.

Also, only read `stream_count` and `coupled_count` when
`channel_mapping_family` != 0. See:

https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4875>
2023-06-19 14:31:55 +00:00
François Laignel
439717ab65 qtdemux: fix byte order for opus extension and version field type
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4875>
2023-06-19 14:31:55 +00:00
François Laignel
f3496ea3bf qtmux: fix byte order for opus extension
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

In `build_opus_extension`, `gst_byte_writer_put*_le ()` variants were used,
causing audio streams conversion to Opus in mp4 to offset samples due to the
PreSkip field incorrect value (29ms early in our test cases).

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4875>
2023-06-19 14:31:55 +00:00
Mark Hymers
1ae8af4909 matroska: Add support for more pixel formats
- Add support for GRAY16_LE (using ffmpeg fourcc mapping)
- Update documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4824>
2023-06-14 13:40:58 +00:00
Daniel Morin
00178cbd89 matroska: Add new pixels format support
- Add support for GRAY10_BE32
- Add support for RGBA64_LE and BGRA64_LE

Sponsored by Living Optics

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4824>
2023-06-14 13:40:57 +00:00
Tim-Philipp Müller
f3c126d07c matroska-demux: fix accumulated base offset in segment seeks
When doing a segment seek, the base offset in the new segment
would be increased by segment.position which is basically the
timestamp of the last packet. This does not include the duration
of the last packet though, so might be slightly shorter than the
actual duration of the clip or the requested segment.

Increase the base offset by the segment duration instead when
accumulating segments, which is more correct as it doesn't cut
off the last frame and makes the effective loop segment duration
consistent with the actual duration returned from a duration
query.

In case a segment stop was specified it's also possible that
some data was sent beyond the stop that's necessary for decoding
so the base offset increment should be based on that then and
not on the timestamp of the last buffer pushed out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4604>
2023-06-13 18:19:48 +00:00
Jochen Henneberg
fd1d208446 rtspsrc: Cleanup code for next pending command
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4792>
2023-06-07 20:30:36 +00:00