Commit graph

696 commits

Author SHA1 Message Date
Tim-Philipp Müller f04f86f3ee Revert "audiobasesink: Don't wait on gap events"
This reverts commit 8e923a8e2d.

This caused regressions, see #3303.

Without this commit, osxaudiosrc ! osxaudiosink won't work
right, but since that hasn't really been a huge problem
for years it's probably best to revert this until a proper
solution can be figured out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6356>
2024-03-13 12:49:41 +00:00
Piotr Brzeziński 66283e8865 audiovisualizer: Don't wrap temporary memory in buffers
Avoids potentially ending up with the buffermemory pointing to already-freed or reused addresses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6349>
2024-03-13 07:19:39 +00:00
Piotr Brzeziński f2ad031eff audioencoder: Avoid wrapping temporarily mapped memory with a GstBuffer and passing that to subclass
Memory from gst_adapter_map() could live shorter than the GstMemory that the GstBuffer wraps around it, which in lucky
cases 'just' caused a re-use of the same memory for multiple (potentially still in use!) input buffers, but could easily
end up pointing to an already-freed memory.

Manifested when an AudioToolbox encoder kept getting silence inserted in seemingly random circumstances, turned out
to be the memory being re-used by GStreamer at the same time that the AT API was processing it...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6349>
2024-03-13 07:19:39 +00:00
Guillaume Desmottes e62888c07f uridecodebin3: fix deadlock when switching input item
There was a race between urisourcebin src pad handlers.
One was starting the next item before the other was blocked.

See
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3297#note_2288799
for details.

Fix #3297

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6214>
2024-03-08 19:49:05 +00:00
Piotr Brzeziński adfefceea5 macos: Fix glimagesink not respecting preferred size
Cocoa version of glwindow only checks the preferred size upon window creation. glimagesink sets the size right before
calling gst_gl_window_show(), which might be way after the window is created in some cases. If the size was set too
late, glimagesink on macOS would remain 320x240 unless manually resized.

This change makes sure to resize the existing window when _show() is called.

Curiously, this has always been an issue, but went from manifesting every once in a while to being almost completely
broken once old event loop workarounds were removed and gst_macos_main() was introduced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6280>
2024-03-06 17:58:46 +00:00
Edward Hervey 30738b09c1 plugins: Fix wrong enum usage
gcc 13 now detects conflicting enum usages. Fix the various cases where it was wrong

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6234>
2024-02-28 01:18:22 +00:00
Loïc Molinari 44faeb532d video: Fix NV12_16L32S video frame size
The size of a NV12_16L32S video frame is bigger than expected because
it uses the size of a Y tile to compute the interleaved UV plane
size. Get the right UV tile size instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6135>
2024-02-16 18:13:32 +00:00
Edward Hervey 4e01c01483 urisourcebin: Don't acquire STATE_LOCK if shutting down
If we are shutting down (PAUSED->READY) we shouldn't take the STATE LOCK since
this function is being called from a streaming thread (which is trying to be
deactivated while the STATE LOCK is held)

Fixes #3292

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6123>
2024-02-15 11:11:07 +00:00
Tim-Philipp Müller dcd9d8a87d Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6111>
2024-02-13 16:27:38 +00:00
Tim-Philipp Müller 29d6413c3f Release 1.22.10 2024-02-13 14:39:08 +00:00
Piotr Brzeziński 2f4e8d14cf macos: Set activation policy in osxvideosink and glimagesink
Upon creating a window, glimagesink and osxvideosink now set the policy to
NSApplicationActivationPolicyRegular, which lets us show an icon in the Dock
for convenience and appear in the top menu bar like other apps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6103>
2024-02-12 18:25:18 +01:00
Edward Hervey 502e995677 musepack: Prefer using FFmpeg musepack decoder/demuxer
* Bump the rank of the musepack v7/v8 FFmpeg demuxers to SECONDARY
* Bump the rank of the musepack v7/v8 FFmpeg audio decoders to SECONDARY
* Demote the rank of the musepackdec element to MARGINAL

This is for two reasons:
* The musepack library is no longer maintained, whereas the FFmpeg
  implementation can/will receive fixes
* The `musepackdec` implementation was a all-in-one "parsing and decoding" blob
  which doesn't play nicely with decodebin3 and others

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6085>
2024-02-09 17:48:42 +00:00
Alexander Slobodeniuk 2748805bbe videoaggregator: fix bufferpool leak
that happens if it fails to activate the pool

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6047>
2024-02-04 18:19:12 +00:00
Christian Curtis Veng e111dfc39c glcolorconvert: fix wrong RGB to YUV matrix with bt709
Converting from RGB to YUV: When comparing the info.colorimetry to
GST_VIDEO_COLORIMETRY_BT709 it does not make sense to look at the input
signal because that is of type of RGB. The plugin needs to look at the
output YUV-type and compare GST_VIDEO_COLORIMETRY_BT709 to that, because
that is the YUV-type the plugin needs to convert input-RGB into.
Converting from YUV to RGB: Comparing to the input is correct, but because
here the color encoding info BT601/BT709 is on input side of the plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6046>
2024-02-04 17:14:14 +00:00
Jan Schmidt 6055e2f117 glvideoflip: fix setting of method property at construction time
A port of the same fix that
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4536
did for the non-GL videoflip element

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6010>
2024-02-04 14:05:30 +00:00
Tim-Philipp Müller 600e105e64 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5990>
2024-01-25 00:18:12 +00:00
Tim-Philipp Müller 3e41b8f18b Release 1.22.9 2024-01-24 18:21:13 +00:00
Michael Tretter 6744cb0d20 videorate: keep pool if max_buffers is unlimited
The value 0 for max_buffers means unlimited. If the max_buffers are unlimited,
the videorate element shouldn't throw away the bufferpool, but just increase the
min_buffers value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5957>
2024-01-22 20:00:02 +00:00
Jan Schmidt 8e923a8e2d audiobasesink: Don't wait on gap events
Don't call wait_event() at all for gap events, as basesink will
end up waiting for the time that the gap event would be rendered
out at the audio device. There's no need to render it at all,
just treat it as a handy point to resync the audio if needed,
let the ringbuffer render silence, and place the next buffer
into the ringbuffer where it belongs.

The only thing we really need to do is make sure the ringbuffer
and clock are running, and wait for preroll.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5953>
2024-01-22 16:09:12 +00:00
Sebastian Dröge 4950fcc6de glcolorconvert: Correct transform_caps direction
If GST_PAD_SINK is passed in this means that we're supposed to convert
from sink caps to src caps, not the other way around. In other words, if
GST_PAD_SINK is passed we're supposed to produce the possible output
caps.

Previously this was inverted. This had the effect that glcolorconvert
pretended to be able to convert *to* I420 without glDrawBuffers, which is
not possible, and pretended not to be able to convert *from* I420
without glDrawBuffers, which it always supports.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5947>
2024-01-21 12:09:30 +00:00
Damian Hobson-Garcia e3ff113370 gloverlay: Apply updated overlay coordinates correctly
When overlay coordinates are updated, after the initial coordinates
are set, the shader indices are applied to the wrong buffer, resulting
in the background image appearing where the overlay should.

Bind the array buffer before applying subsequent coordinate
updates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5909>
2024-01-11 10:42:27 +00:00
Guillaume Desmottes efd473fdd0 audioconvert: change gst_audio_convert_get_unit_size() log levels
INFO is a bit high for such technical details and best to use WARNING
when it fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5832>
2023-12-19 00:31:30 +00:00
Tim-Philipp Müller 79cdbc37d5 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5826>
2023-12-18 13:52:12 +00:00
Tim-Philipp Müller 4af14db10e Release 1.22.8 2023-12-18 12:09:37 +00:00
Doug Nazar 51939b62b8 audioringbuffer: Don't try to map MONO channel
Avoids critical message:

gstaudioringbuffer.c: line 2155 (gst_audio_ring_buffer_set_channel_positions):
should not be reached

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5793>
2023-12-09 21:03:51 +00:00
Seungha Yang a89f33c86c appsrc: Fix flow return when buffer is dropped
Flow EOS on buffer drop (upstream leaky mode) was not
intended behavior. Appsrc should return OK instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5755>
2023-12-01 18:11:47 +00:00
Jimmy Ohn 890e5533ee decodebin2: Properly free when shutting down in gst_decode_bin_expose
missing_plugin_details causes memory leakages when shutting down.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5750>
2023-12-01 15:01:41 +00:00
Jimmy Ohn c0bba84244 encoding-target: Properly free when missing type field in parse_encoding_profile
pname and description in parse_encoding_profile function causes
memory leakages when missing the 'type' field for streamprofile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5750>
2023-12-01 15:01:41 +00:00
Philippe Normand 36f653fdc5 pbutils: Don't include default vp9 parameters in resulting codec mime string
According to the document defining the vp9 codec string, the optional fields
should all be present only if at least one of them has a non-default value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5719>
2023-11-27 12:14:54 +00:00
Nicolas Dufresne b299760325 videorate: Don't forget last_ts on caps changes
Whenever that caps changes does not imply that a new segment will start.
Don't reset the last_ts if only the caps have changed. This fixes issues
if you have a stream without only first frame with TS=0, and have resolution
change happening. This was a regression introduced by !3059, which issue was
described in #1352. The reported issue is still fix after this change.

Fixes #1034

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5712>
2023-11-24 01:31:51 +00:00
Tim-Philipp Müller b1067c023d Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5650>
2023-11-13 14:57:09 +00:00
Tim-Philipp Müller 4d13eddc8b Release 1.22.7 2023-11-13 11:04:22 +00:00
Piotr Brzeziński 3dcb02ac64 basetextoverlay: Fix overlay never rendering again if width reaches 1px
If text width ever reached 1px, for example after resizing the output window, the overlay would stop rendering
and never return again. The 1px condition itself does not seem to make much sense here anyway.

This was a chain of events: width reached 1, so the composition was set to NULL. Then, after resizing the output window,
push_frame() was called but would not attempt to renegotiate because composition is NULL. This caused the width/height
to never be updated again, as that only happens during negotiation, so the overlay was gone for good.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5623>
2023-11-08 14:49:31 +00:00
Sebastian Dröge 8419c1e6dc audioaggregator: Make access to the pad list thread-safe while mixing
When mixing every single buffer the object lock is shortly released and
acquired again. In the meantime the pad list can become invalid because
a pad was removed or added, and equally the current pad might as well
have been finalized in the meantime.

To get around that, take a snapshot of all sinkpads before mixing and
work with that list of pads.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5553>
2023-10-25 14:58:06 +01:00
Jan Schmidt 970eb963c7 glfiter: Protect GstGLContext access
The propose and decide allocation vfuncs are called directly from
basetransform and need to use the locked accessor function for
retrieving a reliable reference to the GstGLContext (if available)

Fixes spurious crashes on shutdown during pad reconfiguration

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5518>
2023-10-20 11:02:02 +01:00
Piotr Brzeziński b5ca7eba4e glfilter: Only add parent meta if inbuf != outbuf
This was causing a memory leak in cases like `gltestsrc ! gltransformation scale-x=0.5 ! glimagesink`.
Parent meta was being added in assumption that those buffers are different, which was not the case here,
creating a reference loop and never freeing the buffer.

Co-authored-by: Matthew Waters <matthew@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5453>
2023-10-10 10:13:15 +01:00
Eric c7eed33e22 rtspconnection: Ignore trailing whitespace in headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5382>
2023-09-22 14:31:38 +00:00
Michiel Westerbeek b5f72d930b video-scaler, audio-resampler: downgrade 'can't find exact taps' to debug
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5381>
2023-09-22 15:47:39 +02:00
Tim-Philipp Müller 0cccb1c9a6 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5371>
2023-09-20 19:41:00 +01:00
Tim-Philipp Müller ddb4fbe431 Release 1.22.6 2023-09-20 18:10:57 +01:00
Stephan Seitz d8012a0ead sdp: fix wrong error message for missing clock-rate in caps
When using `gst_sdp_media_set_media_from_caps` on `application/x-rtp` caps
without `clock-rate` it wrongly reports missing payload type even if `payload`
is present in the caps.

This seems to be a copy&paste error from the error message for missing payload
type.

When using payload=10, both `clock-rate` and some other media properties are
defined by the RTP standard so I was wondering whether I could omit `clock-rate`
and was confused about the error message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5252>
2023-08-26 19:35:32 +01:00
Jan Schmidt df9482f39b audio: Make sure to stop ringbuffer on error
Add gst_audio_ring_buffer_set_errored() that will mark the
ringbuffer as errored only if it is currently started or paused,
so gst_audio_ringbuffer_stop() can be sure that the error
state means that the ringbuffer was started and needs stop called.

Fixes a crash with osxaudiosrc if the source element posts
an error, because the ringbuffer would not get stopped and CoreAudio
would continue trying to do callbacks.

Also, anywhere that modifies the ringbuffer state, make sure to
use atomic operations, to guarantee their visibility

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5216>
2023-08-21 19:22:53 +01:00
Olivier Crête 79cf124631 sdpmessage: Parse zero clock-rate as default
It seems there is at least one broken RTSP server out there that returns a clock-rate of 0.
Let's just ignore it and use the default in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5199>
2023-08-18 12:43:28 +01:00
Philippe Normand b979ca0dcc decodebin3: Ensure the slot is unlinked before linking to decoder
When switching from a raw stream to an encoded stream we need to make sure the
slot is unlinked, there is code in place for this but it wasn't triggered
because the slot being reconfigured wasn't advertised as linked beforehand.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5133>
2023-08-01 23:50:34 +01:00
Haihua Hu 03119a388c decodebin3: avoid identity, sinkpad, parsebin leakage when reset input
when reset_input, need remove identity/parsebin from decodebin3
when release_pad, need call free or reset input if collection
didn't change

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5086>
2023-07-21 18:20:37 +01:00
Tim-Philipp Müller 60120003c0 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5082>
2023-07-20 16:57:47 +01:00
Tim-Philipp Müller bf6ce1d64a Release 1.22.5 2023-07-20 15:22:48 +01:00
Ruslan Khamidullin 337d2457e0 video: add extensive tests for gst_video_time_code_is_valid()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5061>
2023-07-19 16:05:33 +01:00
Ruslan Khamidullin aded70efaf video: accept timecode of 119.88 (120/1.001) FPS
The drop-frame rules are specified in “SMPTE ST 12-3:2016” and are
consistent with the traditional ones:

“

To minimize fractional time deviation from real time, the first two
super-frame numbers (00 and 01) shall be omitted from the count at the
start of each minute except minutes 00, 10, 20, 30, 40, and 50. Thus the
first eight frame numbers (0 through 7) are omitted from the count at
the start of each minute except minutes 00, 10, 20, 30, 40, and 50.
”

Where “super-frame” is a group of 4 frames for 120 FPS.

Fixes #2797

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5061>
2023-07-19 16:05:06 +01:00
Sebastian Dröge 6910a24c14 video: timecode: Add support for framerates lower than 1fps
These are not explicitly defined but the existing calculations can be
extended to also cover that case by inverting them to avoid floating
point calculations.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5074>
2023-07-19 15:59:19 +01:00