Commit graph

534 commits

Author SHA1 Message Date
Olivier Crête f97ff39358 audioenc/dec: Avoid adding temporary structure
As a minor optimisation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3673>
2023-01-04 11:09:31 +00:00
Olivier Crête e03a10a0f2 audioenc/dec: Preserve downstream caps preference in get caps
This should fix pipelines such as this one to work as expected
  ... ! opusenc ! capsfilter caps='audio/x-opus,
  channels=1; audio/x-opus, channels=2' ! ...

The expectation is that the encoder will propose the first structure
before the second one to the source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3673>
2023-01-04 11:09:31 +00:00
Sebastian Dröge 401ea9f683 typefindfunctions: Check for the SVG namespace URL in addition to <svg and the doctype
Finding the SVG namespace URL gives a clear indication that this is
actually an SVG file while the `<svg>` tag only gives a likely
indication as it's rather short.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3631>
2023-01-04 00:49:47 +00:00
Sebastian Dröge 11520403a5 typefindfunctions: Make XML typefinder more strict
If a XMLDec is found, check also for its end. Similarly, check for the
end of the XML tag we're looking for and make sure that the following
characters are valid.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3632>
2023-01-03 12:07:43 +00:00
Edward Hervey 6beca9f055 urisourcebin: Fix parsebin handling
The goal of !3601 was to make sure we don't end up with non-streams-aware
adaptive demuxers. Since we know that parsebin is streams-aware, just remember
that and handle them that way.

Fixes issues with some scenarios where parsebin might add pads *before* the
collection is posted on the bus

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3658>
2022-12-30 08:46:14 +01:00
Edward Hervey 66b96baf23 uridecodebin3: Fix handling of "expected" pads
The number of expected pads was:
* Defaulting to 1
* Or being overriden by GST_MESSAGE_STREAMS_SELECTED

This fails if upstream isn't a selectable source and has multiple streams, and
would therefore cause failures with multi-stream gapless playback

Fixes #1672

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3658>
2022-12-30 08:46:14 +01:00
Edward Hervey 80e7c31514 uridecodebin3: Avoid repeatedly calling the blocking probe
When skipping an event, we want to unref it and say we handled it. This avoids
being repeatedly called for the same (sticky) events.

The events will be properly propagated once the pad is linked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3658>
2022-12-30 08:46:13 +01:00
Edward Hervey a0655d5131 uridecodebin3: Handle multiple pending pad block probes
It is quite possible to have the blocking probe called from different streaming
threads when all expected pads are present.

* Notify all waiters by using g_cond_broadcast instead of g_cond_signal
* Properly remove the probe after waiting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3658>
2022-12-30 08:46:13 +01:00
Sebastian Dröge 19603248c2 gl: Mark gst_gl_context_new_wrapped() return value as nullable
If a GL context is requested for which no API support is compiled in
then `NULL` is returned.

Also remove a useless `NULL` check: `g_object_new()` can't possibly
return `NULL`, ever.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3656>
2022-12-29 09:03:53 +00:00
F. Duncanh b713c141e0 plugins-base/tests/check/meson.build: add omitted Wayland dependence
SUSE places Wayland include files in /usr/include/wayland, and needs
a Cflag added to wayland_client_deps by pkg-config, which is added to
gl_winsys_deps: add this as a dependency in gstgl_dep to fix issue.

Fixes #1607

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3638>
2022-12-28 20:04:49 -05:00
Nirbheek Chauhan 36a619ba60 meson: Add gstreamer-gl-1.0 pkgconfig vars to internal dependency
So we can fetch gl_winsys, gl_platforms, etc directly using
gst_gl_dep.get_variable() when building gstreamer as a subproject, or
when building gst-plugins-rs's gtk4 plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3654>
2022-12-29 03:52:42 +05:30
Xavier Claessens cd78cbac86 Fix API visibility macros
This copies the logic from GLib discussed there:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2936

Beside being simpler, it also fix all public symbols being annotated
with dllexport when doing a static build, as discovered there:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3540#note_1678335

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3567>
2022-12-20 14:03:35 +00:00
Edward Hervey 74a503c197 urisourcebin: Modify check for streams-aware adaptive demuxers
Using the "GstBin" flags to check if an adaptive demuxer is streams-aware isn't
a good idea since it prevents using elements which aren't bins.

Instead we see if a collection was posted by the demuxer by the time a pad is
added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3601>
2022-12-19 15:23:32 +00:00
Philipp Zabel 2a602afe8a videoconvertscale: fix valid_tags NULL-terminated array of strings
The valid_tags array of strings must be NULL-terminated,
as it is passed to the g_strv_contains() function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3603>
2022-12-19 15:30:42 +01:00
Guillaume Desmottes 1f929ba32f uridecodebin3: fix typo in doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3602>
2022-12-19 14:24:06 +01:00
Thibault Saunier f7b342f1dd base:navigation: Cleanup navigation key modifiers enum
We were exposing the 'ALT' modifier as if we were guaranteeing its
accuracy but truth is we were only exposing configuration dependent
values.

Make the API simpler for now, the same way as Gtk3 was exposing it, and
when we have time to guarantee more values by making them take backends
configuration into account, we will expose those values in a accurate
way.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3565>
2022-12-15 16:47:13 +00:00
Matthew Waters e59b3c93c7 glupload: add CAN_ACCEPT_RAW to all dma-buf uploaders
Fixes cases where a dma-buf would be uploaded using direct-dma-buf
into an external-oes texture (using video/x-raw caps) and then
attempting to reconfigure the same source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3486>
2022-12-14 23:45:56 +00:00
Guillaume Desmottes e87a2c38c0 glvideomixer: override sink pad template
Allow us to pass the GType of its pad and so
improve the documentation when inspecting glvideomixer.

Fix #1253

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2527>
2022-12-14 12:50:36 +00:00
Philippe Normand d98c78251c video-format: Add macro checking for validity of GstVideoFormatInfo
Mostly to maintain consistency with the GST_AUDIO_FORMAT_INFO_IS_VALID_RAW
macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2800>
2022-12-12 19:39:10 +00:00
Philippe Normand 3345d16aed audio-format: Add macro checking for validity of GstAudioFormatInfo
`gst_audio_format_info_fill_silence()` not properly checking the validity of its
input may lead it into an infinite loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2800>
2022-12-12 19:39:10 +00:00
Tim-Philipp Müller b9d8fb3d63 timeoverlay: fix pad leak
Spotted by Jiri Uncovsky.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1336>
2022-12-11 23:54:50 +00:00
Sebastian Dröge 010ede30dd textrender: Negotiate caps on a GAP event if none were negotiated yet
Otherwise downstream wouldn't have received a segment event either and
wouldn't know what to do with the gap event

And also forward any pending segment event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3541>
2022-12-07 14:27:17 +00:00
Tim-Philipp Müller 1f65d7cc5c Back to development 2022-12-05 02:29:08 +00:00
Tim-Philipp Müller fd6a3948c6 Release 1.21.3 2022-12-05 01:28:21 +00:00
Tim-Philipp Müller 84e74ceb10 Remove ChangeLog files from git repository
This information is tracked fully in the git repository, so
no point having the ChangeLog duplicate it, and it interferes
with grepping the repository.

We are going to create the ChangeLogs on the fly when generating
tarballs going forward (with a limited history), since it's still
valuable for tarball consumers to be able to easily see a list of
recent changes.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-project/-/issues/73

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3521>
2022-12-04 18:16:25 +00:00
Tim-Philipp Müller 9eb081ea0a meson: Generate ChangeLog files for release tarballs on dist
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3521>
2022-12-04 18:16:25 +00:00
Edward Hervey 36c3bb0d05 uridecodebin3: Protect against NULL uri/suburi
Fixes #1625

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3511>
2022-12-02 16:55:05 +00:00
Edward Hervey 41017e6c34 uridecodebin3: Always store pending buffering messages
Fixes #1586

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3487>
2022-12-02 09:22:41 +00:00
Vivia Nikolaidou a0e61539f8 opusdec: Use proper guint/guint8 type conversion
Do not cast, that might yield wrong results.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
2022-11-30 21:11:55 +02:00
Vivia Nikolaidou c9afaf5cd9 opusdec: Negotiate default to 2 channels
In that place, dec->n_channels can still theoretically be 0. Default to
2 in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
2022-11-30 20:56:30 +02:00
Vivia Nikolaidou cdf411e82d opusenc: Reverse channel order in template caps
We want to make it so that we prefer a higher, not lower, number of
channels. Otherwise, this pipeline would convert from 2 to 1 channels:

gst-launch-1.0 audiotestsrc ! audio/x-raw,channels=2 ! opusenc ! queue ! opusdec ! queue ! opusenc ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
2022-11-30 20:52:05 +02:00
Philippe Normand fa863b2b7f audiodecoder: Make data processing errors non-fatal by default
The previous default value of `max-errors` was too small and would potentially trigger the
decoder to emit errors too often for most cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3478>
2022-11-30 10:27:50 +00:00
Philippe Normand 9e5cce0ab9 videodecoder: Make data processing errors non-fatal by default
The previous default value of `max-errors` was too small and would potentially trigger the
decoder to emit errors too often for most cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3478>
2022-11-30 10:27:27 +00:00
Sebastian Dröge 12aa3925d0 sdpmessage: Annotate SDP message parameters for parse_uri() and parse_buffer() correctly
They are not actually `out` parameters but must be allocated and
initialized to a valid SDP message by the caller. Just allocating them
without initialization will cause memory corruptions because the
functions will try to clear/append to the existing SDP message.

As such they should be just marked as `transfer none`.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3484>
2022-11-29 14:02:55 +02:00
Ignacio Casal Quinteiro 2aa34164f6 sdp: use g_strdup instead of strdup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3475>
2022-11-28 09:36:18 +00:00
Nicolas Dufresne b985c8eadd glimagesink: Fix render rect assertion
Whenever the surface is resized before the stream is negotiated, we endup
with an assertion in libgstvideo.

  gst_video_center_rect: assertion 'src->h != 0' failed

This fixes it, by following the style aready in place, which is to ensure
surfaces have a minimum size of 1x1.

Fixes #1139

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3467>
2022-11-28 07:52:25 +00:00
Tim-Philipp Müller dec3aa55e9 audioconvert, audioresample, audiofilter: fix divide by 0 for input buffer without caps
gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1
gst-launch-1.0 udpsrc ! audioconvert ! autoaudiosink

would crash with a floating point exception when clipping the input
buffer owing to a division by zero because no caps event was received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3469>
2022-11-26 08:47:49 +00:00
Edward Hervey 3a63eab2fa uridecodebin3: propagate about-to-finish for new inputs
If the pending next urisourcebin is already draining, make sure we propagate it
when activating it.

Fixes gapless playback of small entries

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:22 +00:00
Edward Hervey def2515ae2 uridecodebin3: Remove old fixme
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:22 +00:00
Edward Hervey 734a4554f3 (uri)decodebin3: Ensure group-id consistency
Make sure that group-id of a given play item are made consistent from the
start (sources) and all the way through the output.

This ensures that we can reliably detect that we have switched to the next play
item on the output of decodebin3 (and we can therefore properly free/release it)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey 353691602e uridecodebin3: Fix shutdown procedures in probe
When shutting down, we want to remove the urisourcebin blocking probes ... but
we also want to propagate a GST_FLOW_FLUSHING upstream (and not
GST_FLOW_NOT_LINKED) to make the upstream task gracefully stop instead of
posting an error message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey 7f5f7b3a77 decodebin3: Properly reset when going back to READY
Clear the remaining stream-related fields when going from PAUSED to READY, and
use when disposing.

Fixes various issues when re-using decodebin3/playbin3

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey d12534d21d decodebin3: Don't output bogus GST_MESSAGE_STREAMS_SELECTED
When `is_selection_done` is called, it checks that all the requested streams are
present in the active stream list ...

... except there could very well be a (about to be removed) stream from the
previous selection present.

Therefore filter the list of streams we add to the message by the streams which
are actually requested.

Fixes issues when switching between different stream types (ex: video-only to
audio-only).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey 948bc4291c oggdemux: Don't leak pending seek event
Make sure any pending seek event is released when going back down to READY.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey 1774d5c87a parsebin: Don't leak parsepad list on shutdown
Free it as it is down in other cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Sebastian Dröge 7af129b755 textrender: Don't pass plaintext as pango markup to Pango
Otherwise e.g. & in the text will cause Pango to complain about invalid
markup and render the text incorrectly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3445>
2022-11-21 18:47:50 +02:00
Sebastian Dröge 5b1a1c41b6 textrender: Don't blindly forward all events
Use gst_pad_event_default(), which does the right thing by default.
Especially it does not forward text/x-plain caps downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3445>
2022-11-21 18:43:54 +02:00
Matt Crane b11169bd32 rtpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders
Currently, when rtspsrc property add-reference-timestamp-metadata=true,
a downstream rtph264depay element will attach multiple copies of the
same GstReferenceTimestampMeta to the depayloaded media buffers. This
can have signficant performance impacts further downstream in a pipeline
like the following:

    rtspsrc add-reference-timestamp-metadata=true ! rtph264depay ! h264parse ! ... ! rtph264pay ! ...

For example, if there are 10 packet buffers for a frame of RTP H.264
video, each of those packet buffers will contain the same reference
timestamp meta. The rtph264depay element will then attach all 10
metadata to the depayloaded frame. And then later when we payload the
frame buffer again for proxying, we now have 10 more buffers each with
10 instance of the same metadata. Allocating/deallocating 100+ instances
of metadata @ 30fps for multiple streams has a pretty large performance
impact.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3431>
2022-11-19 07:57:44 +00:00
Nicolas Dufresne e60a94c27d video-frame: Avoid using tile width
The tile width in pixel is not always available. Notably for
8L128 10bit format, the tile is 8x128 bytes, and the pixel
format is fully packed. That means that the tile contains at
least 6 pixels per line, but it also hold some bits of the
pixel from the same line on the previous or next tile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00
Nicolas Dufresne 5980fb76e7 video: Add arbitrary tile dimensions support
In current tile representation, only tiles with power of two
width and height in bytes are supported. This limitation
prevents adding more complex tiles formats.

In this patch, we deprecate tile_ws and tile_hs from GstVideoFormatInfo and
replace if with an array of GstVideoTileInfo. Each plane tiles are then
described with their pixels width/height, line stride and total size.
The helper gst_video_format_info_get_tile_sizes() that depends on the
deprecated API is also being removed. This can simply be removed as it wasn't
in any stable release yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00