Commit graph

8232 commits

Author SHA1 Message Date
Tim-Philipp Müller
3ef7a5999b info: always check match patterns for new debug categories
Not only if a match pattern was set originally via GST_DEBUG.
Patterns might be set programmatically as well after all.
2017-12-06 16:39:33 +02:00
Tim-Philipp Müller
5682141f0f info: fix performance issue with registering categories after gst_init()
When registering a new debug category after gst_init(), simply check
the existing patterns against that new category.

No need to iterate over all categories and recheck them all against
the existing patterns.

Also, no need to re-parse the existing pattern string set via GST_DEBUG
and add the same set of match patterns all over again to the existing
list of match patterns every time we register a new debug category.

Combined with iterating all debug categories on a change this would
make adding debug categories after gst_init() very very very slow.
2017-12-06 16:39:28 +02:00
Edward Hervey
2d0a1669b3 gstinfo: Use free instead of g_free
Because
2017-12-01 09:48:39 +01:00
Edward Hervey
9df84971c7 gstinfo: Don't leak array of strings
The array provided by backtrace_symbols needs to be freed.
2017-12-01 09:48:39 +01:00
Edward Hervey
23ee27987d gstutils: Fix linear regression comparision
The check for dropping precision was wrong when sxx and syy were negative.

if they are negative then "G_MAXINT64 - val" would always overflow

The check was meant to use G_MININT64 (like in the loop contained just
after).
2017-12-01 09:48:39 +01:00
Tim-Philipp Müller
e33d740474 ghostpad: access internal pad with lock held 2017-12-01 09:48:39 +01:00
Havard Graff
b81223213f ghostpad: fix race-condition while tearing down
An upstream query will take a ref on the internal proxypad, and can
hence end up owning the last reference to that pad, causing a crash.
2017-12-01 09:48:39 +01:00
Edward Hervey
6019d8c3cd gstpad: Make pad (de)activation atomic
The following could happen previously:
* T1: calls gst_pad_set_active()
* T2: currently (de)activating it
* T1: gst_pad_set_active() returns, caller assumes that the pad has
  completed the requested (de)activation ... whereas it is not
  the case since the actual (de)activation in T2 might still be
  going on.

To ensure atomicity of pad (de)activation, we use a internal
variable (and cond) to ensure only one thread at a time goes through
the actual (de)activation block

https://bugzilla.gnome.org/show_bug.cgi?id=790431
2017-12-01 09:48:39 +01:00
Edward Hervey
4fbdffd8d6 gstpad: Make calls to GstPadActivateFunction MT-safe
checking whether we already were in the target GstPadMode was being
done too early and there was the risk that we *would* end up
(de)activating a pad more than once.

Instead, re-do the check for pad mode when entering the final pad
(de)activation block.

https://bugzilla.gnome.org/show_bug.cgi?id=790431
2017-12-01 09:48:39 +01:00
Edward Hervey
4cd9898832 gstvalue: Cast GST_MAKE_FOURCC arguments
To make it explicit that we are dealing with uint32 targets

Avoids erroneous  runtime error: left shift of negative value -1

https://bugzilla.gnome.org/show_bug.cgi?id=789700
2017-12-01 09:48:39 +01:00
Mathieu Duponchelle
82fb85403c gstbuffer: fix meta removal in gst_buffer_foreach_meta
When updating the linked list, prev->next = next is correct
if prev is actually updated after being set to the head
of the list at the start.

https://bugzilla.gnome.org/show_bug.cgi?id=788617
2017-10-11 20:13:21 +02:00
Ashish Kumar
a2b6dac456 device-provider: gst_device_provider_unhide_provider() always fails
https://bugzilla.gnome.org/show_bug.cgi?id=788520
2017-10-05 09:45:44 +01:00
Sebastian Dröge
58d1e790cc info: GstStackTraceFlags were added in 1.12 2017-09-17 19:00:50 +03:00
Nicolas Dufresne
8dca248e10 Also use default visibility for plugins symbol 2017-09-08 14:30:45 +03:00
Tim-Philipp Müller
0352283f43 gstconfig.h: use default visibility for GST_EXPORT for gcc/clang too
This will be needed later when we switch to using -fvisibility=hidden.
2017-09-08 14:30:38 +03:00
Thibault Saunier
6a0b0b653e value: Handle serializing NULL GValueArray
Consider them as an empty array and do not segfault...

https://bugzilla.gnome.org/show_bug.cgi?id=786670
2017-08-26 13:51:57 -03:00
Sebastian Dröge
f36083a99f pad: Recheck sticky events after non-blocking buffer probes and blocking event probes
Without the former, event changes (e.g. setting a pad offset) does not
take effect for the current buffer but only for the next one. Without
the latter, non-blocking event probes would not see any updated events
yet.
2017-08-11 11:00:38 +03:00
Sebastian Dröge
2225448db4 segment: Add missing out annotations for various parameters 2017-08-11 11:00:30 +03:00
Heekyoung Seo
a0207baabd utils: Fix leak in failed case of regression overflow checking
https://bugzilla.gnome.org/show_bug.cgi?id=783978
2017-06-20 10:58:22 +03:00
Heekyoung Seo
9fc5d66ed1 registrychunk: Fix leak in failed case of reading plugin dependency string
https://bugzilla.gnome.org/show_bug.cgi?id=783978
2017-06-20 10:58:22 +03:00
Sebastian Dröge
326541ee7e gsturi: Fixed incorrect escaping of path as a generic string
The gst_uri_construct function was escaping the location string
as a generic uri string. This is incorrect since the slash('/')
characters are reserved for use in this exact case. The patch
changes the escape_string function mode to handle the path correctly.

In 1.14 this function will be deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=783787
2017-06-15 11:40:51 +03:00
Sebastian Dröge
b43f6b016e object: Add missing annotations to get_value_array() / get_value_g_array()
Same as already used in GstControlBinding.
2017-05-29 10:55:25 +03:00
Sebastian Dröge
e99368a03f parse: Make gst_parse_context_copy() public for bindings 2017-05-29 10:55:16 +03:00
Matthew Waters
f9e6e42445 debugutils: add missing E character to the legend
The E character on pads indicates the presence of the EOS flag.
2017-05-20 16:59:43 +01:00
Sebastian Dröge
cd3a49b69b message: Don't pass a NULL debug string to g_utf8_validate()
g_utf8_validate() crashes on NULL, but NULL is valid for the debug
string nonetheless.
2017-05-02 14:35:50 +03:00
Víctor Manuel Jáquez Leal
d108ed2251 gst: check non-null before dereference
It is possible to use gst_deinit() without registering the base
classes. For example, when using gst_init_get_option_group() and
call the program with an invalid parameter. In that case,
gst_deinit() will lead to a segmentation fault, since there is a
dereference to a pointer that is null.

This patch validates if the type is non-null before dereferencing
it.

https://bugzilla.gnome.org/show_bug.cgi?id=781914
2017-04-28 21:01:43 +02:00
Thibault Saunier
b15d59b53c doc: Fix some doctsing making GI happy 2017-04-21 10:51:59 -03:00
Thibault Saunier
e6db45a8af doc: Fix GstChangeState docstring 2017-04-20 17:58:08 -03:00
Sebastian Dröge
04676df4a8 info: Move debug output in for_each_threshold_by_entry() to TRACE level
It's otherwise appearing many, many times in logs and usually is nothing
you're interested in.
2017-04-19 17:32:17 +01:00
Rico Tzschichholz
72e42f0ce9 meson: A couple for GIR-generation fixes 2017-04-13 10:05:53 +01:00
Olivier Crete
7c01da8476 meson: Only check the first parameter
https://bugzilla.gnome.org/show_bug.cgi?id=781155
2017-04-11 13:24:45 -03:00
Thibault Saunier
57fd614e02 meson: Check bison and flex are recent enough
https://bugzilla.gnome.org/show_bug.cgi?id=781155
2017-04-11 10:59:34 -03:00
Olivier Crête
dd1f0f49ab value: Accept NULL as a structure
Some GstStructure properties default to NULL, so it should
be a supported value.

With unit test.
2017-04-10 12:37:12 -04:00
Tim-Philipp Müller
519d64881f Don't use deprecated g_object_newv()
Use g_object_new() instead which nowadays has a shortcut for the
no-properties check. It still does an extra GType check in the
function guard, but there's a pending patch to remove that
and it's hardly going to be a performance issue in practice,
even less so on a system that's compiled without run-time checks.

Alternative would be to move to the new g_object_new_properties()
with a fallback define for older glib versions, but it makes the
code look more unwieldy and doesn't seem worth it.

Fixes deprecation warnings when building against newer GLib versions.

https://bugzilla.gnome.org/show_bug.cgi?id=780903
2017-04-08 09:49:59 +01:00
Olivier Crête
0b9eb621b6 structure: Don't print warning on NULL strings or pointers
Putting NULL for those is a valid serialization for the NULL value.
2017-04-06 19:25:06 -04:00
Sebastian Dröge
c173771ed2 gst: Use GstClockTimeDiff instead of GstClockTime as type for GST_SECOND and friends
They were (signed!) gint64 before because of G_GINT64_CONSTANT() already
and they are actually used in signed calculations.

With this change we at least ensure that an integer type of the correct
size is used for GI (it was using gint before).
2017-04-05 16:32:38 +03:00
Sebastian Dröge
ddd00c0d2f gst: Update some more types and values of combined-flags constants 2017-04-05 15:46:26 +03:00
Sebastian Dröge
42a8ffcd39 gst: Cast combined-flags constants to their respective target types
This makes C++ compilers a bit more happy without having the user of the
constants cast. It also provides the correct type information to GI.

https://bugzilla.gnome.org/show_bug.cgi?id=780923
2017-04-05 14:45:46 +03:00
Sebastian Dröge
d96c201f5f gst: Set values and types for combined-flags constants in GI annotations 2017-04-05 14:42:16 +03:00
Sebastian Dröge
5399b29979 value: Properly set value and type for GST_FLAG_SET_MASK_EXACT in GI annotations
Storing a -1 inside an unsigned integer confuses GIR based bindings
generators.
2017-04-05 14:27:19 +03:00
Vincent Penquerc'h
c361365890 gstvalue: fix GstValue leak in structure_field_union_into
https://bugzilla.gnome.org/show_bug.cgi?id=780751
2017-03-31 11:57:36 +01:00
Vincent Penquerc'h
efbacf1931 streamcollection: fix racy user-after-free
The issue happens when the structure is printed by the logging
subsystem: the object is included in the log, and this will cause the
full object printout to be done there. However, after dispose, the queue
was already cleared, so the access to it (to print the object) would
assert, as the queue was already freed. The patch changes it so that the
queue is merely empty, and only freed in _finalize.

https://bugzilla.gnome.org/show_bug.cgi?id=776293
2017-03-31 11:32:31 +01:00
Tim-Philipp Müller
d8a1bf08b1 debugutils: add pad EOS flag in pipeline dot file dumps
But only if set. Helps debug issues with EOS propagation.
2017-03-27 18:30:35 +01:00
Nicolas Dufresne
1a65d5b252 paramspec: Fix array validation logic
A paramspec validation should modify the content to match what the spec
requires and return TURE if a modification happened. This previous
implementation would only fix the first element of the array and return.
It was also return TRUE for empty array, while no modification was
needed.

https://bugzilla.gnome.org/show_bug.cgi?id=780111
2017-03-24 13:43:34 -04:00
Nicolas Dufresne
3b9ff1245b array/fraction: In param types, use get_type() function directly
The GST_TYPE macro points to global variables initialized by the
first call to get_type. This is not an issue if you call gst_init()
but unfortunatly pygi will need to acces the param type before
init can be called. This removes an assertion.
2017-03-24 13:30:45 -04:00
Nicolas Dufresne
d486074a9c fraction/array: Make get_type() thread safe
Those aren't suppose to be called from multiple thread, but all
fundamental get_type() function are thread safe. Fix it to
be consistent and it may help if we change the typing mechanism
in GStreamer come day.
2017-03-24 13:30:45 -04:00
Nicolas Dufresne
2c056563bf gstutils: Add helpers to get/set array properties
This is to help bindings access properties of type GST_TYPE_ARRAY.
This function will get/set the property and convert form/to
GValueArray.

New API:
  gst_util_set_object_array
  gst_util_get_object_array

https://bugzilla.gnome.org/show_bug.cgi?id=753754
2017-03-24 13:30:45 -04:00
Nicolas Dufresne
c21e219ed4 structure: Add get/set_array/list using GValueArray
This adds a binding friendly interface to get and set arrays
and list into GstStructure.

New API:
 - gst_structure_set_array
 - gst_structure_set_list
 - gst_structure_get_array
 - gst_structure_get_list

https://bugzilla.gnome.org/show_bug.cgi?id=753754
2017-03-24 13:30:45 -04:00
Nicolas Dufresne
84f826a937 gstvalue: Add transformation to/from GValueArray
This allow transforming a GValue of type G_TYPE_VALUE_ARRAY to
and from GST_TYPE_ARRAY/LIST.

https://bugzilla.gnome.org/show_bug.cgi?id=753754
2017-03-24 13:30:45 -04:00
Jan Schmidt
0ff74f8d6d paramspecs: Use gst_value_array_get_type() for GstParamSpecArray type
When registering GstParamSpecArray, use the gst_value_array_get_type()
function to get the type, rather than the GST_TYPE_ARRAY macro, which
gets it from the _gst_value_array_type, which is in turn only
initialised during gst_init()

Fixes criticals with (python) bindings that look up all the
types from the gobject-introspection info as soon as they
are imported.

/usr/lib64/python3.5/site-packages/gi/module.py:178: Warning: g_param_type_register_static: assertion 'g_type_name (pspec_info->value_type) != NULL' failed
  g_type = info.get_g_type()
/usr/lib64/python3.5/site-packages/gi/module.py:212: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  type_ = g_type.pytype
/usr/lib64/python3.5/site-packages/gi/module.py:226: Warning: g_type_get_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper
/usr/lib64/python3.5/site-packages/gi/module.py:226: Warning: g_type_set_qdata: assertion 'node != NULL' failed
  g_type.pytype = wrapper
2017-03-24 17:53:31 +11:00