Commit graph

121623 commits

Author SHA1 Message Date
Philippe Normand
a39f465692 rtpsession: Fix heap-use-after-free of twcc_packets structure
This is a regression introduced by 90d99c7b52.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8427>
2025-02-07 12:52:06 +00:00
Carlos Bentzen
bb74aceb5d h266parse: clean up unused APS fields
Since APS is always carried in-band, we don't need to keep the APS
NALs around in the parser anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
be98ba00d7 h266parser: do not fail when extension flags are set
For VPS, PPS, APS, OPI and DCI, the extension flags are the last syntax
in the structures, and according to the spec, should be ignored if set to 1.

Therefore, we can just ignore them rather than failing.

This fixes a few failures in fluster, like in the PSEXT_A_Nokia_2 stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
3a12b0beaa h266parse: add tests for vvc1 and vvi1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
5fad23d26b h266parse: enable vvc1 and vvi1 stream formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
05d4a2022e h266parse: handle packetized frames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
551782b32b h266parse: don't prepend APS NALs on IDR frames
Instead, APS NALs can just be pushed an in-band NALs like PH and SEI.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
c7e9aba025 h266parse: negotiate before handling codec_data NALs
If we find VPS/SPS/PPS in codec_data and call gst_h266_parse_process_nal
with them, we need to have negotiated before in order to correctly
process them with flags like h266parse->transform set or not depending
on the negotiation. This is important because in certain vvc1/vvi1 streams we
may have correct codec_data but faulty parameter sets in the stream and
we would want to push the parameter sets from codec_data first.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
f4f7e99e05 h266parse: parse codec_data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
8607ccdf2c h266parse: update IDR position in more cases
The IDR position should be updated if we're processing an
IDR frame or pushing codec NALs. Not only when picture_header_in_slice_header_flag
is set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
7c29249ca5 h266parse: fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
fe61b43814 h266parse: implement make_codec_data
implement serialization of codec_data containing VvcDecoderConfigurationRecord
as defined in ISO/IEC 14996-15.

The VPS/SPS/PPS NALs are added to the codec_data. APS NALs could be
optionally included as well but will be pushed in-band instead, because:
1. Logic is easier that way. We'd have to filter out for PREFIX_APS only
   (SUFFIX_APS aren't allowed in codec_data).
2. APS NALs can also be sent for every non-keyframe slice, and often are, so just pushing
   them in-band makes more sense to have less to keep track and avoid possible
   duplicates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:17 +00:00
Carlos Bentzen
4545d199c3 h266parser: add API to parse VVCDecoderConfigurationRecord
VVCDecoderConfigurationRecord is present in ISOBMFF files carrying
VVC/H.266 streams via the vvcC box, as defined in ISO/IEC 14496-15.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8359>
2025-02-07 08:25:16 +00:00
Nirbheek Chauhan
0aacc1a6a9 opencv: imgcodecs.hpp is also needed to build the plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8418>
2025-02-07 02:32:03 +00:00
Nirbheek Chauhan
bbdf8f5996 meson: Modernize opencv build definitions
Use the fs module instead of using `run_command('test')`, simplify
some indentation, fix dependency management

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8418>
2025-02-07 02:32:03 +00:00
Sebastian Dröge
7346764b8e play: Distinguish missing plugin errors and include more details in error/warning messages
Include the URI (and if possible) stream-id in the messages. These are provided
by uridecodebin3 / decodebin3 in most cases but there is fallback code to guess
them otherwise.

For missing plugin errors also the installer details are included.

The URI is included in all message types.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8236>
2025-02-07 01:02:01 +00:00
Seungha Yang
5dd695f81f docs: Add nvdswrapper docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8425>
2025-02-06 17:48:47 +00:00
Philippe Normand
1baa10ed07 wpe: Reduce gpointer usage in ThreadedView
Those gpointers were introduced when we had to support some old WPE API, no need
for them anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8413>
2025-02-06 17:00:39 +00:00
Jan Schmidt
9adc7bd9f0 test-onvif example: Add support for AAC backchannel
Detect upstream backchannel codec and support AAC in MPEG4-GENERIC
encapsulation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
d2dcfea052 rtsp-server: fix for creating backchannel stream dynamically
If collecting the backchannel stream after the stream has begun
preparing, make sure to join it to the RTSP media bin, as is
done for dynamic payloaders in the pad-added handler. Add a
new internal stream creation method for it, that could be
publically exposed later if it proves useful.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
6921405f40 onvif-media-factory: Fix pad ref leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
37f1077284 rtsp-media: Only wait for sender streams to block
When prerolling / blocking an RTSP media, don't consider receiver
streams like onvif backchannel in the 'is everything blocked' check,
as those streams won't receive data until after the RTSP stream
is running.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
1a4b683225 onvif-media: Error for streams that have EMPTY/ANY caps
Don't silently fail to put a stream in the SDP if the caps are
empty or ANY

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
c83c7f9a92 rtsp-onvif-media: Add some debugging
Add a debug category and some debug to the ONVIF media

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
84f8fcedc6 rtsp-onvif-media-factory: Add create_backchannel_stream() vfunc
Move the functionality that collects the backchannel bin and turns
it into an RTSP stream object into a vfunc so that implementations
can override the behaviour or timing of the call

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
a18b8c3f16 rtsp-media: Make sure to add appsink and appsrc to the pipeline
When decoupling send/receive loops in rtsp-media using appsink/appsrc,
put the appsink in the bin before linking it, as this code path
had that wrong.

For both sender and receiver paths, if the pipeline already started
also add the other appsrc/appsink of the pair to the pipeline
immediately instead of putting it in the pending elements list,
as they won't get added later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
11aed62ea8 rtsp-server: Make onvif sample support different codecs
Add some autoplugging to the onvif example to make it handle
different video codecs automatically, and add support for
outputting the audio stream too, if any.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Jan Schmidt
4fee71907a rtsp-server: Fix test-onvif-client position calculations
The example was switched to use autovideosink, which broke
current position calculation based on the last video frame.

Add code to retrieve the actual video sink from within autovideosink
to make it work again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8378>
2025-02-06 12:31:59 +00:00
Alicia Boya García
cf2dc2f94c gstreamer: parse: Fix log in gst_parse_perform_link
Suppose you're trying to debug why this pipeline doesn't work:

```
$ GST_DEBUG=GST_PIPELINE:DEBUG gst-launch-1.0 \
    videotestsrc num-buffers=10 ! x264enc name=enc ! mux.sink_0  \
    mpegtsmux name=mux ! fakesink
```

You will encounter this line in the logs:

> gst_parse_perform_link: linking some pad of GstX264Enc named enc to
> pad  mux of GstMpegTsMux named mux (0/1) with caps "(NULL)"

It would seem that the element name is being read as a pad name as well,
and that made me wonder if the parsing was not working. However, it was
just a bug in the code printing that log. This patch fixes that bug.

Note that it is possible to specify more than one pad name for each side
of the link. For instance, the following is a valid pipeline that will
remux the video and audio of an MP4 file into MKV:

```
$ GST_DEBUG=GST_PIPELINE:DEBUG gst-launch \
    filesrc location=input.mp4 ! qtdemux name=demux  \
    multiqueue name=mq  \
    matroskamux name=mux ! filesink location=output.mkv  \
    demux.video_0,audio_0 ! mq.sink_0,sink_1  \
    mq.src_0,src_1 ! mux.video_0,audio_0
```

The new logging accomodates this by using a new utility function to join
strings of pad name lists instead of `PRETTY_PAD_NAME_FMT` (which only
supports one pad name). For example:

> linking pads {video_0, audio_0} of GstQTDemux named demux to pads
> {sink_0, sink_1} of GstMultiQueue named mq with caps "(NULL)"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8415>
2025-02-06 11:20:39 +00:00
Patricia Muscalu
6b547ffc4b tracers: Fix build problem when tracer hooks are disabled
"undefined reference to `GST_TRACER_PAD_SEND_EVENT_PRE'
undefined reference to `GST_TRACER_PAD_SEND_EVENT_POST'"
errors are generated when trying to build GStreamer with
the following build configuration:
meson setup -Dgstreamer:tracer_hooks=false build

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8419>
2025-02-06 10:24:12 +00:00
Nicolas Dufresne
6fe6811eb7 docs: v4l2codecs: Add plugin index documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
ec8e2d6a31 doc: Push v4l2codecs documentation cache
These are normally autogenerated for the platform GStreamer runs on,
though it is convenient to have everything listed in the doc. This
was created with the new GST_V4L2_CODEC_GEN_DOC=1 environment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
bb37ea168d doc: v4l2codecs: Document all decoders
Add the documentation blob and since marker for all decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
3645f050af v4l2codecs: Remove uneeded per-codec abstract class
That subclass was not needed and was causing issues wit doc generation.
The only down side of removing it is that the decoder cast macro is no
longer type safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
2197627336 v4l2codecs: Add Hardware class to alpha decoders
This was accidently omitted, this is needed wen filterting hardware
codecs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
3b9fc2a29e v4l2codecs: Cleanup alpha decodebin class header
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
d13a414ddc v4l2codecs: Don't needlessly expose decoder types
We have explicit register functions and have no use for these types in
other components.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
76b36f1493 v4l2codecs: Use pragma once
This is a nice cleanup and removes comment referring to D3D notably.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
5e6411e2f6 v4l2codecs: Enable AV1 kernel version check
The uAPI finally got merged into 6.5.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
18f3ea41c0 v4l2codecs: Add a doc generation mode
This is enabled through an env, it allow exposing all elements without
the needed driver supports. This is useful to fill the documentation cache.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5555>
2025-02-06 00:58:01 +00:00
Nicolas Dufresne
7edb6a5634 waylandsink: Prefer DMABuf over system memory
Swap the template and caps query around to that the sink can describe a
preference for DMAbuf over system memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8404>
2025-02-05 18:57:29 -05:00
Nicolas Dufresne
e953693aff v4l2: object: Use libgstvideo DMA DRM mapping
Complete the mapping by pulling GST/DRM mapping from libgstvideo. This removes
the duplication.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8404>
2025-02-05 18:57:29 -05:00
Nicolas Dufresne
388f86131f video: dma-drm: Extend the format mapping
These formats were mapped in video4linux2 plugin, but not here. Add them
so te video4linux2 plugin can use the global mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8404>
2025-02-05 18:56:15 -05:00
Nicolas Dufresne
9eec7ddf19 video: Add support for big endian DRM formats
When a format is big endian, the 8bith of the fourcc is set. Handle this by
using a "_BE" suffix in serialization. The patch also update the design document
and introduce a unit test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8404>
2025-02-05 18:56:15 -05:00
Stéphane Cerveau
a960985d18 vkvideoencodeh265: fix PicOrderCntVal usage
remove `pic_order_cnt` member variable of GstVulkanH265EncodeFrame and
use always `pic_num` instead.

Intialize first `pic_num` value in test_encoder_h265_i_p.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8408>
2025-02-05 18:33:36 +00:00
Andoni Morales Alastruey
bc5e1eeb16 build: remove gst-indent as a subproject
gst-indent is now installable with pip. Remove it as
a subproject and update the documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8402>
2025-02-05 17:43:57 +00:00
Andoni Morales Alastruey
d0ab931628 pre-commit: install gst-indent through pip
Depends on: https://gitlab.freedesktop.org/gstreamer/gst-indent/-/merge_requests/13

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8402>
2025-02-05 17:43:57 +00:00
Stéphane Cerveau
bd62300d22 vkvideoencodeh26x: tests: set constant qp
Set constant qp to 26 in between 0 and 51, the qp range
for h264 and h265.

minQp in case of ANV is 10 for h265

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8407>
2025-02-05 16:48:56 +00:00
Seungha Yang
fbf698cc0b mediafoundation: Enable MinGW build
Update MinGW toolchain in cerbero can support MediaFoundation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8406>
2025-02-05 16:03:10 +00:00
Seungha Yang
7108147d78 mediafoundation: Use DEFINE_GUID instead of DECLSPEC_UUID
MinGW will not define IID for custom COM object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8406>
2025-02-05 16:03:10 +00:00