410 Commits

Author SHA1 Message Date
Xavier Claessens
13eed32842 gst: Add _take and _steal to more mini objects
Those are simple wrappers around mini object API, similar to
what GstEvent does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9595>
2025-08-26 19:23:55 +00:00
Sebastian Dröge
9f19e0e0a2 gst: Convert is_writable() / make_writable() macros to inline functions
Plus actual functions that are exported from the library.

Apart from improving type-safety, this also makes bindings more happy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9588>
2025-08-23 12:42:12 +00:00
Thibault Saunier
3715b0b7b8 debugutils: Use SHOW_FULL_PARAMS when GstDotsTracer is active
When the dots tracer is detected among active tracers, switch from
SHOW_ALL to SHOW_FULL_PARAMS to prevent parameter ellipsization.
The dots tracer is designed to work with gst-dots-viewer which can
handle long parameter values, so we preserve the full text in dot files.

This improves the viewing experience when using the dots tracer with
the gst-dots-viewer tool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9547>
2025-08-19 15:34:45 +00:00
Thibault Saunier
e87b3b0359 tracerutils: keep tracers that do not register to any hook alive as others
This checks if a tracer has registered to any hook after
initialization and automatically registers it to the "none" hook if not
so the lifetime of those tracer is the same as tracer who registers to hooks.

For example the `dots` tracer was being freed right after initialization
which was unexpected.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9547>
2025-08-19 15:34:45 +00:00
Havard Graff
162c4b0008 buffer: Fix gst_buffer_memcmp() / gst_buffer_memset() using wrong memory index
Regression from 160205b483dc7a1ae5da60d80a722837cf7c01d0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9565>
2025-08-19 08:18:17 +00:00
Sebastian Dröge
58a48d92bb value: Consider NULL caps in array a fixed value
There's no requirement for caps in arrays to be non-NULL and NULL is clearly a
fixed, single value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9522>
2025-08-18 09:05:36 +00:00
Sebastian Dröge
a052257c03 gstreamer: Make sure to zero-initialize the GValue before G_VALUE_COLLECT_INIT
G_VALUE_INIT does not zero-initialize the data member as automatic
zero-initialization only happens for non-union types. For union types the
initialized value is undefined.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9525>
2025-08-11 08:39:53 +00:00
Sebastian Dröge
99ad6972c2 gstreamer: Disable miniobject inline functions for gobject-introspection for non-subprojects too
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9518>
2025-08-08 14:52:44 +00:00
Nirbheek Chauhan
3f1e8835b8 docs: Initialize the debug category in class_init when possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9496>
2025-08-08 11:38:50 +05:30
Nirbheek Chauhan
ba73cfd36e gstreamer: Disable C5287 warning on MSVC
```
../subprojects/gstreamer/gst/gstpad.c(3866): warning C5287:
operands are different enum types 'GstQueryType' and 'GstQueryTypeFlags';
use an explicit cast to silence this warning
```

We abuse these enums, and MSVC emits a warning for this specific case:

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-c5200-through-c5399

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9431>
2025-07-26 00:06:37 +00:00
Daniel Morin
a97757d6a9 caps: fix nested caps
- Fixes #4534
- Fix gst_caps_is_fixed(), fix gst_caps_fixate () for caps-in-caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9378>
2025-07-14 15:06:08 -04:00
Doug Nazar
160205b483 buffer: Find initial memory block without unnecessary mapping
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9354>
2025-07-09 12:14:52 +00:00
Doug Nazar
d155aeecb3 tracerutils: Fix a few memory leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9151>
2025-07-08 09:05:28 +00:00
Doug Nazar
c5b9e5dcd5 info: free dwarf cache during shutdown
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9115>
2025-07-07 13:01:34 +00:00
Daniel Morin
93241e4203 gstvalue: generalize gst_value_is_subset()
- Add case where we have element in subset that are equal to element in
  superset. In this case subset is still a subset if at least one element is a
  subset of the corresponding element in superset.
- clarify gst_value_is_subset inline documentation
- Add helper VALUE_TYPE_SINGLETON (type) to identify GType that represent a
  value that is not a collection.
- Fixed issue in gst_value_is_subset_array_array (<1, 2, 3>, <0, 1, 4, 2, 3>)
  would have returned TRUE because because the alignment of the subset could be
  done multiple times. Now once alignment of set as been done once, everything
  else in the superset need to be a subset of corresponding element without
  interuption. is_subset (<1, 2, 3>, <0, 1, 2, 3>) => TRUE, but is_subset (<1,
  2, 3>, <0, 1, 4, 2, 3>) => FALSE.
- If both array are fixed value and we perform a is_subset on them, both value
  can't be equal to be considered subset. (For consistency with other fixed
  values)
- Define gst_value_subtract (singleton, array) and
  gst_value_subtract (array, singleton), to allow a gst_value_is_subset
  (singleton, array) and gst_value_is_subset (array, singleton). General
  case of gst_value_is_subset (v1, v2) use gst_value_subtract (v1, v2) and
  gst_value_subtract (v2, v1) to evaluate _is_subset(), therefore we need these
  for is_subset() operation that involve singleton and array.

  Note gst_value_subtract (array, array) is not implemented but this case is not
  require by gst_value_is_subset () and as it has a direct handling. Warned if
  the case is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9220>
2025-07-02 06:46:59 +00:00
Sebastian Dröge
4bd4c4d4f7 buffer: Add optional info structure to GstReferenceTimestampMeta
This allows carrying additional per-timestamp information if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9245>
2025-06-24 08:00:14 +00:00
Sebastian Dröge
f40726597e pad: Only remove TAG events on STREAM_START if the stream-id actually changes
Missing part from 88a36b53c5064d186acb317b0b72633ef5d886e3

See also https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4097

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9268>
2025-06-23 13:11:18 +00:00
Alicia Boya García
371100c743 tracers: Fix deadlock in latency tracer
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4317

This patch fixes a regression in
a35bf1e3847351703542869755b6b9e536b9d2fd.

The new calls to tracers in the affected change were being done while
holding the pad object lock, which wasn't the case in the old ones,
leading to the latency tracer deadlocking in gst_object_get_parent().

The dependency on the pad lock for those calls was accidental. This
patch removes it by temporarily unlocking during the affected calls,
not unlike how it's done when calling a probe callback or the
send_event() function of the downstream element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8925>
2025-06-19 09:12:14 +00:00
Daniel Morin
b44f19ccbc value: fix subset between arrays
- Adding gst_value_is_subset_array_array to test if an array is a subset of
  another array.
- Check gst_caps_is_subset() between containing arrays work.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9184>
2025-06-10 19:22:34 +00:00
Daniel Morin
848d55b96a gststructure: add gst_structure_get_caps
- Get field of type #GstCaps from #GstStructure

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9184>
2025-06-10 19:22:34 +00:00
James Cowgill
39a6ecf56a vecdeque: Use correct index type in gst_vec_deque_drop_struct
Fixes some `-Wsign-compare` warnings. These two indices should be
`gsize` like the other variables in this function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9171>
2025-06-05 11:53:16 +00:00
Thibault Saunier
0b12b883c9 gstinfo: Add missing log context stub functions when debugging disabled
When GST_DISABLE_GST_DEBUG is defined, the log context functions were
missing their stub implementations, causing link errors. Add the missing
stub functions to the disabled debug section.

Also add (nullable) annotation to gst_log_context_get_category since
it can return NULL when debugging is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9122>
2025-06-04 13:47:04 +02:00
Thibault Saunier
c4e9fc288a pad: Change incompatible caps warning to GST_INFO
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9122>
2025-06-04 10:42:55 +02:00
Thibault Saunier
313435f6cb general: Stop checking G_HAVE_GNUC_VARARGS now that we depend on c99
Cleaning up a bit the code now that we can rely on C99 which specifies
varargs for macros.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8990>
2025-05-30 15:30:36 +00:00
Doug Nazar
75cf21d834 gstreamer: A few small memory cleanups
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9044>
2025-05-27 10:44:37 +00:00
Thibault Saunier
78a44afc22 gst: Add a gst_structure_is_writable method
There are cases (in the gst-python bindings for example) where
it is interesting to know that the structure is not writable

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9027>
2025-05-25 15:16:37 +02:00
Sebastian Dröge
60d9ad038c meta: Add g_return_val_if_fail() for NULL valid_tags in gst_meta_api_type_tags_contain_only()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9054>
2025-05-25 06:45:27 +00:00
Jordan Petridis
98e8d3a127 gsttracerutils: Fix leak in gst_tracer_utils_create_tracer()
Co-authored-by: Alicia Boya García <aboya@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9028>
2025-05-23 12:37:15 +00:00
Thibault Saunier
c796abbf0a gst: info: Add a GstLogContext API
Add a new API to control logging behavior, particularly for implementing
"log once" functionality and periodic logging. This helps avoid spamming
logs with repetitive messages.

The API provides:
- Static and dynamic context creation
- Configurable message identity calculation
- Periodic reset capability
- Context-aware logging macros
- Element message variants with context support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6855>
2025-05-22 09:53:35 +00:00
Guillaume Desmottes
328b6bc55d core: gstvalue: fix ANY/EMPTY caps (features) hash
They should be special cases as both do not have any actual caps/features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9037>
2025-05-21 16:03:15 +00:00
Sebastian Dröge
bd3c267adb meta: Add gst_meta_api_type_tags_contain_only()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9004>
2025-05-21 12:13:56 +00:00
Sebastian Dröge
6877ca4d62 pipeline: Store the actual latency even if no static latency was configured
Previously the latency was only stored if a static latency was configured on the
pipeline, which caused gst_pipeline_get_configured_latency() to always return
GST_CLOCK_TIME_NONE in that case.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8972>
2025-05-17 08:58:58 +00:00
Sebastian Dröge
08c56f3e2d element: ref-sink the correct pad template when replacing an existing one
templ is the new one that is being stored and that needs to be ref-sinked,
padtempl is the old one that just needs to be unreffed.

Fixes leaking the old template, and also makes sure that the new template is not
floating which can cause use-after-frees with bindings as they might wrongly
take ownership of a still floating template.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8988>
2025-05-16 17:47:47 +00:00
Doug Nazar
5867c7900a all: Annotate *_set_property() contructor only props without free
Properties that are marked constructor only aren't required to be freed
before g_value_dup_*() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8978>
2025-05-13 19:15:21 -04:00
Xavier Claessens
cff1d1962b gstmessage: Debug error message is nullable
When debug is NULL, gst-launch-1.0 won't print
"Additional debug info:" line.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8943>
2025-05-10 22:13:22 +00:00
Santosh Mahto
700b665bf7 gstanalytics: Add transform function to copy the tensor meta
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8825>
2025-05-10 20:58:52 +00:00
Thibault Saunier
33f58f9da7 gst: debug: Add information about active tracers in dot files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8820>
2025-04-24 13:06:55 +00:00
Thibault Saunier
476bd6109e macos: Move macos function documentation to the .h so the introspection has the information
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8854>
2025-04-22 19:25:30 +00:00
Thibault Saunier
d1f43f781a tracerutils: Do not warn on empty string as tracername
It doesn't matter if there is an "empty tracer" specified.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8860>
2025-04-17 18:40:05 +00:00
Shengqi Yu (喻盛琪)
b144375974 pluginloader: fix pending_plugins Glist use-after-free issue
When plugin_loader_load_and_sync returns false in plugin_loader_replay_pending,
the cur Glist l->pending_plugins will be added to the blacklist.
However, the l->pending_plugins might have already been loaded and freed in handle_rx_packet,
so causing a use-after-free issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8747>
2025-04-16 05:06:40 +00:00
Seungha Yang
7d51dc615d pluginloader-win32: Fix helper executable path under devenv
lpApplicationName argument of CreateProcessW should be complete path
of executable.

Fixing regression introduced by
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8614

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8746>
2025-04-01 19:04:01 +00:00
Guillaume Desmottes
4e65d16bfc gstvalue: add hashing
Will be used to implement the Hash trait in gstreamer-rs, see
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1639

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8518>
2025-04-01 14:38:01 +02:00
Guillaume Desmottes
bde69a4fab taglist: add _gst_tag_list_structure() as internal API
Will be needed to implement hash on GValue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8518>
2025-04-01 14:37:26 +02:00
Guillaume Desmottes
76e9e4ceb6 gstvalue: rename internal table to gst_value_hash_table
Will use the gst_value_hash symbol to implement a new method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8518>
2025-04-01 14:37:26 +02:00
Doug Nazar
86161c084e tracer: Free various props before being set
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Doug Nazar
5f90a4ae67 all: Annotate *_set_property() contructor only props without free
Properties that are marked constructor only aren't required to be freed
before g_value_dup_string() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
David Smitmanis
f8f75503b7 pluginloader-win32: Correctly handle whitespace paths when executing gst-plugin-scanner
On Windows, if the path to gst-plugin-scanner.exe contained
whitespace, gstreamer would via CreateProcessW attempt to execute
several files "up" the path tree; e.g. if the scanner path was
"C:\Program Files\gstreamer app\gst-plugin-scanner.exe", it would try
to execute C:\Program, C:\Program.exe, C:\Program Files\gstreamer.exe"
and so on.

This is how CreateProcessW behaves with unquoted whitespace arguments
in lpCommandLine if lpApplicationName is NULL.

By passing the binary path as lpApplicationName instead, the problem
is avoided.

Also quote arguments to gst-plugin-scanner.exe as they are paths as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8614>
2025-03-25 21:58:00 +00:00
Branko Subasic
2f2b19be83 tracer: Make it compile when tracer hooks are disabled
The GST_TRACER_POOL_BUFFER_(DE)QUEUED macros used when tracer hooks are
disabled took only one argument, causing compile errors when building
with tracer hooks disabled.

Change-Id: I0958c0b018f1fc4a6d84ab0bdd9e42895ae1fe77
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8638>
2025-03-14 11:07:03 +00:00
Thibault Saunier
9979936703 tracer: Add a hook to track when buffers are queued/dequeued in pools
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8617>
2025-03-12 14:49:22 +00:00
Thibault Saunier
c3bf39e7a4 tracer: Add memory init/free hooks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8510>
2025-02-20 12:48:45 +00:00