Commit graph

1453 commits

Author SHA1 Message Date
Edward Hervey
0ee882cfb9 adaptivedemux2: Add missing break
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8286>
2025-01-13 08:08:00 +00:00
Edward Hervey
32ebee5594 adaptivedemux2: Fix usage of GstClockTime vs GstClockTimeDiff
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8286>
2025-01-13 08:08:00 +00:00
Edward Hervey
6d30b82054 splitmuxsrc: Ensure only a single stream-start event is pushed
Since we are simulating a single output, we want to ensure only a single
stream-start is pushed downstream. We do *not* want to send a (potentially) new
stream start event after flushing (like after seeks).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8252>
2025-01-10 15:01:04 +00:00
Will Miller
05158769c3 rtpvp9pay: fix profile parsing
Incorrect parsing of these bits meant that we were incorrectly parsing
the VP9 uncompressed bitstream header for some profiles, as the header
is of variable length and format depending on the profile. Amongst
various unintended effects, this caused the width and height from the SS
to be incorrectly parsed and set in the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8275>
2025-01-10 11:19:52 +00:00
Alex Ashley
f3e9330575 dashdemux2: mpdparser: add test for ISO8601 durations that overflow
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/82
and https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2576

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8209>
2025-01-07 14:49:26 +00:00
Piotr Brzeziński
8f5caeb86d osxaudiosrc: Work around timestamps on iOS not starting from 0
On macOS, you always get your own 'timeline' for the AudioUnit session, so timestamps start from 0.
On iOS however, AudioUnit seems to give you a 'shared' timeline so timestamps start at a later, non-0 point in time.
Simply offsetting seems to do the trick.

This was causing osxaudiosrc to not output any sound on iOS.

Regressed in 2df9283d3f

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
2025-01-07 11:55:03 +00:00
Piotr Brzeziński
212290baf0 osxaudiosrc: Fix render callback removal when pausing/stopping
At least on iOS, the 'input' callback kept being called after going to PAUSED.
Specifying the right type (like in gst_core_audio_io_proc_start()) fixes that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
2025-01-07 11:55:03 +00:00
Piotr Brzeziński
49489d35ae osxaudio: Fix AudioOutputUnitStart() deadlock on iOS >=17
At some point in iOS 17, this call started waiting for the first render callback (io_proc) to finish.
In our case, that callback also takes the ringbuf object lock by calling gst_audio_ring_buffer_set_timestamp(),
which results in a deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
2025-01-07 11:55:02 +00:00
Piotr Brzeziński
307cfc2561 osxaudio: Automatically set up AVAudioSession on iOS
A correctly configured AVAudioSession is needed on iOS to:
- allow the application to capture microphone audio (in some cases)
- avoid playback being silenced in silent mode

Without this, initializing AudioUnit for capture can fail on iOS >=17 (from my testing).

Since AVAudioSession has a lot of settings, in most cases its setup should be handled by the user/app.
However, just to have a basic default scenario covered, let's configure the bare minimum ourselves,
and allow anyone to disable that behaviour by setting configure-session=false on src/sink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
2025-01-07 11:55:02 +00:00
Dean Zhang (张安迪)
e000a1ec1f v4l2videodec: release decode only frame in input list
For some frames with decode-only flag, the v4l2 decoder will not
put them in output list. The corresponding decode-only frames will
be still kept in input list, which may cause potential performance
issue when the input list is full. So release the decode-only frames
according to the decode-only flag after they are processed by decoder
driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8153>
2025-01-06 16:27:53 +00:00
Sebastian Dröge
06a0ab7b33 matroskamux: Consider audio buffers as keyframes when writing out simpleblocks
Otherwise mpv complains and considers the file broken.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8225>
2025-01-06 11:43:59 +00:00
Sebastian Dröge
32e79c1041 matroskamux: Fix audio-only stream conditions
The num_a_streams and related counters are used for pad numbers and don't give
the absolute number of streams in this run of the muxer.

Also, consider the output audio-only if there are more than 1 audio stream too.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8225>
2025-01-06 11:43:59 +00:00
Christian Meissl
422fca76ca qtdemux: fix accumulated base offset in segment seeks
analog to fix for matroska-demux
commit f3c126d07c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8240>
2025-01-06 09:44:00 +00:00
Sebastian Dröge
0aeba9275c qtdemux: Add support for ISO/IEC 23003-5 raw PCM audio
And also support the ISO/IEC 14496-12 chnl channel layout box as required
by ISO/IEC 23003-5.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8171>
2025-01-03 10:11:31 +00:00
Jochen Henneberg
68cdeeb882 qtdemux: Undef helper macros after use
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8127>
2025-01-02 15:22:47 +00:00
Jochen Henneberg
d86f60ffdf qtdemux: Validate matrix before doing simplified multiply
The matrix multiplication makes some assumption about the element
values to simplify the math with fixpoint values. If this is allowed
for the given matrices is now checked first.

Then the debug output for matrix and a comment have been fixed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8127>
2025-01-02 15:22:47 +00:00
Jochen Henneberg
5c005733ea qtdemux: Fixup for orientation matrix parsing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8127>
2025-01-02 15:22:47 +00:00
Jochen Henneberg
c4d0f4bbd9 qtdemux: Use mvhd transform matrix and support for flipping
The mvhd matrix is now combined with the tkhd matrix. The combined
matrix is then checked if it matches one of the standard values for
GST_TAG_IMAGE_ORIENTATION.
This check now includes matrices with flipping.

Fixes #4064

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8127>
2025-01-02 15:22:47 +00:00
Albert Sjolund
90d99c7b52 rtpsession: send twcc struct in both directions
As there are signals around rtpsession in both directions,
send twcc data both upstream and downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7940>
2025-01-01 19:34:54 +00:00
Tim-Philipp Müller
a2119fb12e aacparse: add test to make sure output caps are set also on reuse
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/350

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8214>
2025-01-01 15:30:32 +00:00
Thibault Saunier
15e9573957 videoflip: Add support for Y444_16XX
Necessary code already existed, it was just a matter of advertising it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8177>
2024-12-27 14:58:38 +00:00
Robert Mader
04c6727fcd v4l2: object: Add P010 format
For 10bit content. Tested with HEVC on a Pixel3a (qcom).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8194>
2024-12-21 18:26:46 +01:00
Sebastian Dröge
10fc594847 splitmuxsrc: Post messages when a fragment is started
This allows the application to keep track which fragment is currently active.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8184>
2024-12-21 08:44:23 +00:00
Thibault Saunier
8be9074b0f doc: Handle gst_dep.get_variable('libexecdir') failure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8178>
2024-12-20 20:19:28 +00:00
Thibault Saunier
caa223baf4 doc: Allow updating the plugins cache for all modules even if hotdoc is not present
This was possible for some modules but not all, for no good reason.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8178>
2024-12-20 20:19:28 +00:00
Carlos Falgueras García
1dd4a6e832 rtph26xpay: Fix the default framerate
Use 0/1 instead of 0/0 as the default framerate for rtph26{4,5}pay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8176>
2024-12-19 11:55:29 +00:00
Nicolas Dufresne
0fb5d8afa8 doc: v4l2: Update documentation cache for DMA_DRM
The template caps now exposes DMA_DRM formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
3ee04883ee v4l2: object: Adjust DMABuf negotiation base on io-mode
If the io-mode is forced by user to MMAP, USERPTR or RW, don't try and
negotiated DMABuf caps feature. This would otherwise fail later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
3ec1feb88f v4l2: pool: Adjust pool behaviour when DMA_DRM is used
We disable the copy threshold and always add GstVideoMeta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
77744c3d63 v4l2: Add support for setting memory:DMABuf caps
This is the final step to allow negotiation of this caps features. Limiting the
features based on the io-mode shall come next.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
58b196d62b v4l2: object: Implement probing memory:DMABuf caps feature
This is the caps obtained trough caps query. We now have both system and
DMAbuf varaint, while maintaining support for meta:Interlaced feature.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
8860eadffd v4l2: object: Add memory:DMABuf caps feature to template caps
In this patch, we introduce memory:DMABuf caps feature into V4L2
elements template caps. This is required to allow caps query,
allocation query and set_format to use it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
14b5df4850 v4l2: Directly map V4L2 formats to DRM formats
As in the long term not all V4L2 formats will have a libgstvideo
implementation, add a dedicated DRM fourcc map. This will be used
to enable memory:DMABuf caps features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nicolas Dufresne
50bb74e0c1 v4l2: Include a copy of drm_fourcc.h
This one has been imported from libdrm 2.4.122.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7633>
2024-12-18 23:34:08 +00:00
Nirbheek Chauhan
e881817567 vtenc, osxaudio: Fix missing since markers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8120>
2024-12-16 18:52:21 +00:00
Nirbheek Chauhan
dc5594c575 atenc: Add missing since markers and mark plugin API
Also update the plugin docs cache.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8120>
2024-12-16 18:52:20 +00:00
Nirbheek Chauhan
88cb48108a docs: Update macOS plugin docs again
Contains the following updates:

* New properties on avfvideosrc: screen-crop-*
* H265 and H265 Alpha support in vtdec and vtenc (VideoToolbox)
* ProRes support in vtenc
* New properties on vtenc elements: rate-control, data-rate-limits,
  max-frame-delay
* New plugin atenc (AudioToolbox) with support for encoding AAC
* Plugin move: atdec moved from -bad to -good
* New property on osxaudio elements: unique-id
* OS X -> macOS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8120>
2024-12-16 18:52:20 +00:00
Matthew Waters
c3cc8205b2 rtppassthroughpay: ensure buffer is writable before mapping writable
It is entirely possible that the incoming buffer into _chain() is not writable
and will result in a critical when trying to map().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8131>
2024-12-12 12:06:13 +11:00
Philippe Normand
eb07c4e6b3 rtpsession: Fix twcc stats structure leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8073>
2024-12-09 10:02:23 +00:00
Qian Hu
507db9cee5 v4l2object: move height setting outside of per-plane loop
In the V4L2 format, the height parameter
is an attribute of the entire image, not of an individual plane.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8088>
2024-12-06 20:28:17 +00:00
Sebastian Dröge
818f64a641 splitmuxsrc: Calculate the end offset of a fragment once known
If a new fragment is added with a valid duration but no offset then the start
offset is set later based on the end offset of the previous fragment. At that
point the end offset of this fragment can also be calculated and not doing so
would give the next fragment the same start offset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8069>
2024-12-05 23:28:24 +00:00
Sebastian Dröge
f9845d0266 flacparse: Improve header validity checks
Allow sample rate, number of channels and bps to change and in that case update
the caps accordingly.

Also move (non-fatal) validity checks and storing of the header values outside
the actual parsing once we actually know that a valid frame is available.

And also don't warn on the last frame with fixed block size blocking strategy
that the block size has changed: the last frame is allowed to be smaller.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8075>
2024-12-05 14:14:51 +00:00
Sebastian Dröge
519d86d9f3 qtdemux: Add size check for parsing SMI / SEQH atom
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-244
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3853

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
bfebca8307 qtdemux: Check for invalid atom length when extracting Closed Caption data
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-243
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3849

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
7d3f221d87 qtdemux: Actually handle errors returns from various functions instead of ignoring them
Ignoring them might cause the element to continue as if all is fine despite the
internal state being inconsistent. This can lead to all kinds of follow-up
issues, including memory safety issues.

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-245
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3847

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
19359e2b25 qtdemux: Make sure there are enough offsets to read when parsing samples
While this specific case is also caught when initializing co_chunk, the error
is ignored in various places and calling into the function would lead to out of
bounds reads if the error message doesn't cause the pipeline to be shut down
fast enough.

To avoid this, no matter what, make sure enough offsets are available when
parsing them. While this is potentially slower, the same is already done in the
non-chunks_are_samples case.

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-245
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3847

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
4a0e8bf92b qtdemux: Fix error handling when parsing cenc sample groups fails
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-238, GHSL-2024-239, GHSL-2024-240
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3846

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
98f3934c48 qtdemux: Fix length checks and offsets in stsd entry parsing
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-242
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3845

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
c1cd838706 qtdemux: Make sure enough data is available before reading wave header node
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-236
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3843

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00
Sebastian Dröge
1d534ac209 qtdemux: Make sure only an even number of bytes is processed when handling CEA608 data
An odd number of bytes would lead to out of bound reads and writes, and doesn't
make any sense as CEA608 comes in byte pairs.

Strip off any leftover bytes and assume everything before that is valid.

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-195
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3841

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8059>
2024-12-03 21:01:41 +00:00