761 Commits

Author SHA1 Message Date
Jan Schmidt
c086c83ac4 rtspsrc: Prefer an empty SET_PARAMETER call for keep-alive
In RTSP 2.0, they started recommending that clients use an
empty SET_PARAMETER request as the preferred keep-alive mechanism
as all cameras must support that method. It also works
for RTSP 1.0, so use it as the preferred method unconditionally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9577>
2025-08-28 00:46:19 +00:00
Jan Schmidt
492a420fa9 rtspsrc: Send RTSP keepalives in TCP/interleaved modes
When rtspsrc is using an interleaved connection to the camera,
it will continously receive a stream of tunnelled RTP packets
from the server, so the rtspconnection doesn't return ETIMEOUT
and trigger the keepalive. Add a check on the RTSP timer
and send the keepalive whenever we haven't sent a message to
the server in some time.

Fixes problems with some cameras that don't see the RTCP traffic
as sufficient proof of liveness, when using TCP/HTTP tunnelled
modes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9577>
2025-08-28 00:46:19 +00:00
Nirbheek Chauhan
e8e12db5f4 debug: Category init should happen in class_init when possible
plugin_init() will not get called if element/feature registration
happens manually, such as when using linking only specific plugin
features with gstreamer-full. That is possible when plugins contain
static features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9496>
2025-08-08 11:38:50 +05:30
Doug Nazar
63302342ff splitmuxsrc: Fix a memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9151>
2025-07-08 09:05:29 +00:00
Enock Gomes Neto
cade54e2af qtdemux: Fix incorrect FourCC used when iterating over sbgp atoms
In qtdemux_parse_traf(), the loop over sbgp atoms used FOURCC_sgpd instead
of FOURCC_sbgp when retrieving the next sibling node. This caused the loop
to either terminate early or attempt to parse sgpd atoms as sbgp, leading
to incorrect or incomplete seig group associations.

This fix ensures that all sbgp atoms are properly parsed in sequence.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4511
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9318>
2025-07-01 12:40:33 -03:00
Doug Nazar
b490629528 rtph265pay: Fix valgrind warning about uninitialized usage
Skip NALs less than minimum size of 2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9273>
2025-06-30 12:19:19 +00:00
Robert Mader
7e2b383553 matroskademux: Send tags after seeking
Similar to what qtdemux does in `gst_qtdemux_stream_update_segment()`,
in which case we want to resend tags according to our position.
By setting the changed flag for all stream tags we ensure they will all
be (re-)send as we progrees.

This notably ensures that rotation tags are not lost when video players
finish playback and jump back to the beginning of a video.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8429>
2025-06-30 08:49:21 +00:00
Matthew Waters
87666a2d3b rtph265pay: add profile-id, tier-flag, and level-id to output rtp caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9300>
2025-06-27 07:36:47 +00:00
Doug Nazar
35bceff695 gstrtspsrc: Don't emit error during close if server is EOF
During a graceful close we try to notify the server that we're
finished. There is no reason to consider it an error if the
server has already closed the connection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9278>
2025-06-25 00:00:57 -04:00
Doug Nazar
805d532280 splitmuxsink: Only send closed message once per open fragment
We send a closed message on EOS. It's possible to receive multiple EOS
messages before opening the next fragment (from an element change state
for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9266>
2025-06-23 12:29:06 +00:00
Qian Hu (胡骞)
bbae7dba0a imagefreeze: fix not negotiate error when stop
when the chain is called between reset and pad deactive in base
change state, a "not negotiation" error is produced.
so, we add a judge for flushing and reset

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8916>
2025-06-23 10:28:06 +00:00
Johan Sternerup
c530453413 twcc: Fix reference timestamp wrapping (again)
With
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7527
an attempt was made to fix the wrapping of the TWCC 24-bit reference
time. Unfortunately this fix was not correct due to a late change and
the lack of unit tests to catch it. This time unit tests are provided to
make sure we have a correct fix for all the edge cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9051>
2025-06-18 10:43:34 +00:00
Matthew Waters
f51d9fc128 rtph265depay: output profile, tier, level in output caps
These values are very easy to provide and some cases in rtph265pay require
these values to be set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9223>
2025-06-18 07:35:52 +00:00
Sebastian Dröge
b003b2b023 wavparse: Don't error out always when parsing acid chunks
Remove stray goto introduced in ba8fd35e72b645c5048813d1bcc58271fb72ab6c

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9230>
2025-06-18 05:51:31 +00:00
Matthew Waters
7bbff29763 rtph265depay: CRA_NUT can also start an (open) GOP
https://datatracker.ietf.org/doc/html/rfc7798#section-3.1.1 says that a CRA_NUT
can start a GOP so add that to the list of nal types where VPS/SPS/PPS can be
inserted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9217>
2025-06-18 01:29:10 +00:00
Matthew Waters
9f4f426a89 rtph265depay: fix codec_data generation
When producing the profile_teir_level() struct, account for emulation
prevention bytes (0x0, 0x0, 0x3) in the source SPS.  Also copy from the correct
starting point in the source SPS and don't put the NAL header into codec_data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9205>
2025-06-17 11:40:23 +00:00
César Alejandro Torrealba Vázquez
49e53cb09e qtmux: Update chunk offsets when converting stco to co64 with faststart
When creating a faststart file, qtmux has to take into account that
any 32 bit stco atom may need to be converted into its 64 bit version
due to the offset that is added before the mdat data by the moov atom,
the extra atoms and the mdat header. If a stco atom is converted into
co64, the chunk offset of all stco and co64 atoms has to be increased,
which in turn may also cause that other stco atoms need to be converted
into co64, modifying the chunk offsets again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9102>
2025-06-17 07:02:47 +00:00
changyong.ahn
163e9e8df4 aacparse: Fix counting audio channels in program_config_element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9074>
2025-06-17 04:12:15 +00:00
changyong.ahn
300ff38178 gstaacparse: Fix counting audio channels in program_config_element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9074>
2025-06-17 04:12:15 +00:00
Piotr Brzeziński
fa44cfdaaa imagefreeze: Handle EOS from send_event()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9191>
2025-06-11 13:13:18 +02:00
Doug Nazar
09a0a6a9d5 rtpjpeg: fix copying of quant data if it spans memory segments
rtpjpeg no longer joins all memory segments before encoding. Ensure
we copy the data from the correct segments.

Re-arrange test data so it's not correctly ordered and add test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5533>
2025-06-09 10:36:07 +00:00
Sebastian Dröge
48bf6a92d7 qtdemux: Use byte reader to parse mvhd box
This avoids OOB reads.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4394
Fixes CVE-2025-47183

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9131>
2025-05-29 15:01:20 +01:00
L. E. Segovia
7b8d4c0974 orc: Update pregenerated files
Fixes -Wtype-limits on gstbayer.orc when emulating convuuslw.

Regenerated Orc files use OrcOnce, which increases the minimum version to 0.4.34.

See https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/212 (ORC_MIN)

See https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/238 (AVX2 convussql)

See 8a86d51753 (OrcOnce)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9067>
2025-05-25 14:36:17 +00:00
Seungha Yang
e10b460ed4 rtputils: Add debug category
Use rtputils specific debug category instead of "default"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9070>
2025-05-25 19:32:34 +09:00
Branko Subasic
73ef16864e matroskamux: Write stream headers before finishing file
In the rare case when we get EOS on all pads before we get any buffer we
would finish the file without writing headers, i.e. the file would be
corrupt. This patch makes sure that a header is always written.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9061>
2025-05-23 13:37:17 +00:00
Sebastian Dröge
571f32eec0 qtdemux: cmpd box is only mandatory for uncompressed video with uncC version 0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9039>
2025-05-21 17:04:26 +00:00
Sebastian Dröge
34efd430e4 videobalance: Implement basetransform meta transform function
This makes sure we can pass through more metas correctly, e.g.
GstVideoOverlayComposition meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9004>
2025-05-21 12:13:56 +00:00
Thibault Saunier
5658683881 imagefreeze: Reset 'flushing' state when receiving FLUSH_STOP
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9015>
2025-05-20 16:47:09 +00:00
Thibault Saunier
5fc7340a70 imagefreeze: Set seqnum from segment too
This is the right behavior, setting from seeks is also OK but we should take the seqnums from segment into account too

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9015>
2025-05-20 16:47:09 +00:00
Sebastian Dröge
c5520a7cae qtdemux: Add support for DNxHR
Apart from the fourcc it works the same as DNxHD and can be distinguished from
the beginning of each frame header.

ffmpeg uses the same codec ID for DNxHD and DNxHR so we use the same caps with
just an additional, optional profile field for the DNxHR profile.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
9fa7f8b001 qtdemux: Parse content light level and mastering display info if available
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
8a30c6b13b qtdemux: Use already parsed codec data boxes instead of parsing a second time
And parse common boxes in a central place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
cba7ce1228 qtdemux: Add missing codec sample entry fourccs to qtdemux_parse_node()
This allows parsing the various common sample entry boxes like btrt, colr, pasp,
chan, chnl, etc. for extending the caps with additional information.

Also unify some cases, which as a side effect makes them more correct because
many were not checking for different versions of the boxes and the corresponding
different offsets.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4403

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
118e66f59d qtdemux: Take Theora headers directly out of the already parsed nodes
Instead of parsing them yet another time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
137044195d qtdemux: Don't parse fiel box a second time for JPEG-2000
It was already parsed above in general for all video codecs. Just put the number
of fields into the JPEG-2000 in the specific field.

As a side effect this also actually checks if enough data is available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
45443603f8 qtdemux: Remove second parsing of fiel box for JPEG
Exactly the same is already done some hundred lines above for all video codecs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
8687ef453c qtdemux: Simplify parsing of SVQ3/VP31 boxes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
98d8bb9a12 qtdemux: Parse codec data for QDM2/QDMC correctly
First find the wave box then include its whole content instead of just including
everything from a random offset onwards.

Also actually do that for QDMC instead of leaving commented code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
cd6d2f16a6 qtdemux: Use already parsed damr box for AMR NB/WB streams
Instead of parsing it again and possibly getting the offset for reading
it wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
18db5538a0 qtdemux: Don't parse audio sample entry a second time in mp4a fallback case
These values were all passed a few hundred lines above already and can directly
be re-used here. The offset for the sample rate was also wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
d98df47e53 qtdemux: Add qtdemux_tree_get_child_by_index_full() helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
2b18846e39 qtdemux: Fix endianness/alignment problems with parsing omwa sample description entries
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
f575fe763c qtdemux: Handle stsd entry offset correctly for audio in qtdemux_parse_node()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
ae4d505fe0 qtdemux: Pass stsd entry node to caps creation functions
Also fix lpcm to only read its additional fields from sound sample description v2.
Previously it would read random data if a different stsd entry was used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
3ecb07c674 qtdemux: Don't parse invalid data from ISOBMFF AudioSampleEntryV1
The additional fields only exist in sound sample description v1, which
is only defined for MOV.

ISOBMFF has AudioSampleEntryV1 but it has the exact same layout as
AudioSampleEntry.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
fec61cc546 qtdemux: Don't retrieve video stsd entry multiple times
And remove various duplicated checks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
af5cce9968 qtdemux: Parse uncompressed video uncC / cmpd boxes from already parsed stsd entry
Also simplifies code and error checking considerably.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
a6e58f7331 qtdemux: Don't retrieve enca/encv boxes a second time, wrongly
They need to be retrieved by index and they were already correctly retrieved
just above so let's just use that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
bb50741b73 qtdemux: Use already parsed stsd entries instead of parsing them again
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00
Sebastian Dröge
cf2b1909ec qtdemux: Fix typo in debug message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
2025-05-17 07:59:46 +00:00