Commit graph

184 commits

Author SHA1 Message Date
Thibault Saunier b14e675a27 gir: Checkout all .gir files and check that they are updated on the CI
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3010>
2023-04-22 09:32:32 -04:00
Ruben Gonzalez a7f4d5716a gst: Delete inoperative ARG_PLUGIN_SPEW
Logic related with the option was deleted 20 years ago in commit:
086de421dc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4452>
2023-04-21 12:35:39 +00:00
Seungha Yang acdf70e576 pluginloader-win32: Fix for pipe connection error
Don't error out on WAIT_IO_COMPLETION. It means queued APC job
was executed but the job may not be our callback.
For example, user or system might be able to schedule APC on
gst_init() thread or so.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4405>
2023-04-13 07:08:09 +00:00
Sebastian Dröge 16ce61fb57 gst: tracer: Initialize tracing infrastructure even if the debug system is not compiled in
There is a separate #define for the tracing infrastructure.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4402>
2023-04-13 01:14:18 +00:00
Michael Gruner 53c145a158 gstelement: protect async state changes against spurious wake ups
When a pipeline is pre-rolling, it waits for all sink elements to report
they have received a buffer before completing the transition to paused.
This async wait is done using a state condition variable. The way this
waits are currently implemented do not protect against spurious conditional
wake ups, which may happen due to external factors in the kernel.

This change implements the wait within a loop that iterates over the protected
variable to reinitiates the wait if the wakeup was spurious. More details in
the [GCond docs](https://docs.gtk.org/glib/struct.Cond.html).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4086>
2023-04-04 07:24:57 +00:00
Juan Navarro b41a5d3ccb gstutils: Add category and object to most logging messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4291>
2023-03-28 22:41:53 +00:00
Sebastian Dröge 49c9f31803 datetime: Return G_MAXFLOAT instead of G_MAXDOUBLE for no timezone offset
Returning G_MAXDOUBLE from a function returning a float is not going to
work well and MSVC also correctly warns about this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4264>
2023-03-27 16:50:33 +00:00
Tim-Philipp Müller 330836db8e taglist, plugins: fix compiler warnings with GLib >= 2.76
Fix compiler warnings about not using the return value when
freeing the GString segment with g_string_free(.., FALSE):

    ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’

which we get with newer GLib versions. These were all harmless.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4273>
2023-03-27 07:37:11 +00:00
Aleksandr Slobodeniuk 4f988e24d2 bin: fix documentation about event forwarding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4249>
2023-03-23 02:39:34 +00:00
Tim-Philipp Müller 574e6b7994 gstreamer: re-indent with GNU indent 2.2.12
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4182>
2023-03-17 03:18:53 +00:00
Mathieu Duponchelle e4a26238a0 parse: fix parsing arrays in caps for "implicit" capsfilters
When using such a launch line:

fakesrc ! "audio/x-opus, channel-mapping=(int)<0, 1>" ! fakesink

the caps string, with spaces escaped but no quotes gets passed to
gst_caps_from_string(), which then fails to parse the array because it
contains spaces.

When using an explicit capsfilter instead:

fakesrc ! capsfilter caps="audio/x-opus, channel-mapping=(int)<0, 1>" ! fakesink

the caps string, with spaces escaped and quotes gets passed through
gst_value_deserialize, which first calls gst_str_unwrap() on it and only
then gst_caps_from_string() on the result.

This fixes the inconsistency by using a custom version of str_unwrap()
in the parser, which doesn't expect a quoted string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4181>
2023-03-16 10:51:38 +00:00
Xavier Claessens 096bd3c4a2 gstbuffer: Add parent meta when a copy shares memory with parent
When copying a buffer, for example with gst_buffer_make_writable(), the
new buffer might reference the same GstMemory as the src buffer,
making those memories not writable. If the src buffer gets disposed
first it should return to its buffer pool, but since some of its
memories are not writable it gets discarded and new buffer/memory gets
allocated.

Solves this by making the new buffer keep a reference to the src buffer,
that ensures that by the time the src buffer gets disposed no other
buffer are referencing its memories and it can thus return safely to its
pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4176>
2023-03-16 00:03:11 +00:00
Xavier Claessens 22613b9baf gstbuffer: Unref memories before metas
gst_buffer_add_parent_buffer_meta() is used when a GstBuffer uses
GstMemory from another buffer that was allocated from a pool. In that
case we want to make sure the buffer returns to the pool when the memory
is writable again, otherwise a copy of the memory is created. That means
the child buffer must drop its ref to the memory first, then drop the
ref to parent buffer so it can return to the pool when it is the only
owner of the memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4176>
2023-03-16 00:03:11 +00:00
Xavier Claessens 174132af8d gstallocator: Use the right allocator instance to free memory
In the case GST_ALLOCATOR_FLAG_CUSTOM_ALLOC is set, `copy` is allocated
by the default allocator and not mem->allocator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4144>
2023-03-11 08:03:17 +00:00
Nirbheek Chauhan f3665ce800 gstvalue: Implement union for GstFractionRange
This fixes simplification of caps with GstFractionRange structures,
for example, this caps:

  video/x-raw, framerate=(fraction)5/1; video/x-raw, framerate=(fraction)[ 5/1, 30/1 ]

can now be simplified to:

  video/x-raw, framerate=(fraction)[ 5/1, 30/1 ]

instead of:

  video/x-raw, framerate=(fraction){ 5/1, [ 5/1, 30/1 ] }

And this:

  video/x-raw, framerate=(fraction)[ 2/1, 5/1 ]; video/x-raw, framerate=(fraction)[ 5/1, 30/1 ]

can be simplified to:

  video/x-raw, framerate=(fraction)[ 2/1, 30/1 ]

instead of

  video/x-raw, framerate=(fraction){ [ 2/1, 5/1 ], [ 5/1, 30/1 ] }

This fixes overly-complicated GL caps set by avfvideosrc on macOS and
iOS when capturing from a webcam.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4132>
2023-03-11 04:15:13 +00:00
Chao Guo dfa8661334 bin: Fix bin won't post async done message to parent while nothing pending in state changing
When we run Cheese 41.1 on our imx platform, Cheese preview freeze
at first frame.

During pipeline state changing from NULL to PLAYING, if there are
both elements that state change asynchronously and state change
with no preroll in the bin, the element inside may send ASYNC_DONE
message to it, while the bin's pending state is VOID_PENDING.

In this case, the bin will not post ASYNC_DONE message to parent
bin, which makes parent bin thinks that there are still elements
in it that haven't completed state changing, causing the pipeline
freeze in an intermediate state.

This commit modifies the bin_handle_async_done() function. When the
bin, whose pending state is VOIDING_PENDING, receives the ASYNC_DONE
message, it will also post this message to its parent bin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3490>
2023-03-03 12:22:08 +00:00
James Hilliard 1f1e7a3d99 buffer: fix copy meta reference debug log formatting
Fixes the following valgrind error:
==616== Conditional jump or move depends on uninitialised value(s)
==616==    at 0x4900E34: gst_debug_print_object (gstinfo.c:1143)
==616==    by 0x49010B6: gst_info_printf_pointer_extension_func (gstinfo.c:1215)
==616==    by 0x4959FDB: __gst_printf_pointer_extension_serialize (printf-extension.c:47)
==616==    by 0x495A487: printf_postprocess_args (vasnprintf.c:258)
==616==    by 0x495A52C: __gst_vasnprintf (vasnprintf.c:290)
==616==    by 0x4959F8F: __gst_vasprintf (printf.c:154)
==616==    by 0x4901C1F: gst_debug_message_get (gstinfo.c:791)
==616==    by 0x4901C75: _gst_debug_log_preamble (gstinfo.c:1431)
==616==    by 0x4903208: gst_debug_log_default (gstinfo.c:1575)
==616==    by 0x49020BA: gst_debug_log_full_valist (gstinfo.c:624)
==616==    by 0x490211D: gst_debug_log_valist (gstinfo.c:656)
==616==    by 0x49021AD: gst_debug_log (gstinfo.c:533)
==616==    by 0x48DDC11: gst_buffer_copy_into (gstbuffer.c:693)
==616==    by 0x48DF5F1: gst_buffer_copy_with_flags (gstbuffer.c:727)
==616==    by 0x48DF640: gst_buffer_copy_deep (gstbuffer.c:756)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4034>
2023-02-21 20:14:00 -07:00
Jan Alexander Steffens (heftig) aeb262a7e1 pad: Don't leak user_data in gst_pad_start_task
When the task already exists, we forgot to free the passed `user_data`.
This wasn't an issue for most C code, which doesn't pass a
`GDestroyNotify`, but bindings such as gstreamer-rs do!

That said, allocating a trampoline in gstreamer-rs just for it to get
thrown away again is awkward. Maybe we need a `gst_pad_resume_task`?

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3920>
2023-02-09 15:40:56 +00:00
Thibault Saunier 1bab0ef2aa bin: Do not deactivate pad in NULL_TO_READY
Since b76d336549
pads are deactivated when going to READY but in `uridecodebin(3)`, the
sources source pads are activated while in NULL state (when PULL mode is
supported), meaning that we are ending up deactivating those pads in
NULL_TO_READY, breaking the pipeline.

The intent of the commit mentioned above is to ensure that the pads are
deactivated either in PAUSED_TO_READY or READY_TO_READY, so it should
be safe to avoid deactivating in NULL_TO_READY.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3849>
2023-02-08 13:23:46 +00:00
medithe 3943503fc1 gstreamer: bin: Don't unlock unlocked mutex in gst_bin_remove_func()
Calling `g_mutex_unlock(mutex)` leads to an undefined behavior if the
mutex is not locked by the current thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3903>
2023-02-07 19:03:43 +02:00
Seungha Yang c0a4f41525 pluginloader-win32: Prepend gstreamer-1.0-0.dll directory to PATH env for child process
Usually gst-plugin-scanner.exe will be located under libexec/gstreamer-1.0
or even somewhere user specified location via GST_PLUGIN_SCANNER
environment. So, in order for child process to be able to load
GStreamer DLLs, parent process will need to update PATH env

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3886>
2023-02-03 14:25:21 +00:00
Jan Schmidt 138863b327 gsturi: Add API to order query strings
Add gst_uri_get_query_string_ordered() and gst_uri_to_string_with_keys() that
allow constructing the URI string with query arguments in a specific order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3803>
2023-02-02 11:02:47 +01:00
Thibault Saunier 3963396716 gstutils: Add a utility to create a stream-id without a pad
We already have functions to generate a stream-id from pads but in the
end those pads are not even used in most cases. This adds functions to
generate a stream-id even before creating the source pads for the
element that is going to use it. For example a demuxer that is properly
implements the GstStream/GstStreamCollection API will not have a Pad but
already needs to generate a stream-id.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3160>
2023-02-01 22:26:33 +00:00
Seungha Yang 09d29cca5a pluginloader-win32: Watch child process handle on connection
... so that parent can avoid waiting if child process got terminated
unexpectedly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3863>
2023-02-01 17:00:11 +00:00
Seungha Yang 464a8be3a4 pluginloader-win32: Check pipe state in child process
Retry if server is not ready for the connection

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3863>
2023-02-01 17:00:11 +00:00
Seungha Yang 0df7cd852c pluginloader-win32: Enhance debug log
Change log level to ERROR if it's unexpected, and print error reasons

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3863>
2023-02-01 17:00:10 +00:00
Seungha Yang f314884b7d pluginloader-win32: Zero initialize overlapped struct before use
Helper child process might be spawned multiple times for some reason
then overlapped struct can hold garbage data. Always clear the struct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3863>
2023-02-01 17:00:10 +00:00
Seungha Yang 621feb32e9 gst-plugin-scanner: Add support for Windows
Adding Win32 specific plugin loader implementation.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/11
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3512>
2023-01-25 18:24:28 +00:00
Sebastian Dröge bfaa02ab56 gst: Fix gst_type_find_peek() return value annotation
It's not possible to annotate a in-parameter for a return value array as
the array length. Both are assumed to have the same direction and the
current annotation causes the size parameter to be considered an out
parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3787>
2023-01-25 13:16:44 +00:00
Thibault Saunier 095a5ba425 factory: Add "Timestamper" as new factory type
This will be used by elements that correct timestamps (like the
h264timestamper for example)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3779>
2023-01-24 16:31:40 +00:00
Tim-Philipp Müller 1919030363 baseparse: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller c1baa37f74 tracerutils: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller 3261daa623 taskpool: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller eeced74fce segment: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller 19a6468a53 sample: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller f343d01f10 query: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller e190ff16cc iterator: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 6a0be7ea56 event: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller dcc8830bb2 info: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 2f88c68659 devicemonitor: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 15c1b9ad45 datetime: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 384c4f1bef clockentry: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 1c8bb3f8db context: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 267adee5b7 uri: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 755f214a52 meta: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 9dd70085f1 message: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 976861a07a gstvalue: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 76c8a619f9 caps, capsfeatures: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 7d58554f4c bus, poll: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00
Tim-Philipp Müller 5a2d643f9b bin: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:05 +00:00