Commit graph

8027 commits

Author SHA1 Message Date
Guillaume Desmottes
e11539c30b bus: chain up GObject::constructed() to the parent class' implementation
Needed so GstBus can be tracked by the leaks tracer.

https://bugzilla.gnome.org/show_bug.cgi?id=768141
2016-06-28 17:23:17 +03:00
Nirbheek Chauhan
54fa564e01 gstconfig.h: Don't use extern with dllexport
GCC emits an error for this with -Werror:

plugin.c:22:1: error: 'gst_plugin_desc' initialized and declared 'extern' [-Werror]

This matches how glib does symbol exporting.

https://bugzilla.gnome.org/show_bug.cgi?id=767463
2016-06-24 01:09:32 +01:00
Nirbheek Chauhan
48088867db win32: Don't use dllexport/import when only building statically
If the prototypes in the public API have dllimport in them when building
statically on Windows, the compiler will look for symbols with symbol
mangling and indirection corresponding to a DLL. This will cause a build
failure when trying to link tests/examples/etc.

External users of GStreamer also need to define -DGST_STATIC_COMPILATION
if they want to link to static gstreamer libraries on Windows.

A similar version of this patch has been committed to all gstreamer
repositories.

https://bugzilla.gnome.org/show_bug.cgi?id=767463
2016-06-23 23:39:45 +01:00
Sebastian Dröge
6b9e70d193 device: Fix typo
paramater -> parameter
2016-06-15 16:12:36 +02:00
Tim-Philipp Müller
09d5ff4097 info: flesh out GST_PTR_FORMAT docs a bit 2016-06-14 19:16:33 +01:00
Sebastian Dröge
37713c3388 pad: Log pad offsets as signed times 2016-06-11 22:18:22 +03:00
Tim-Philipp Müller
665de91347 gstconfig.h.in: indent #if #else jungle for better readability 2016-06-09 17:48:40 +01:00
Sebastian Dröge
1dbb27f3a7 utils: Add gst_pad_link_maybe_ghosting() for consistency
We already had a _full() version, but having that alone seems inconsistent.
Add a non-full version that mirrors the behaviour of gst_pad_link() vs
gst_pad_link_full().
2016-06-08 12:12:28 +03:00
Tim-Philipp Müller
56b9290073 deviceprovider: remove base_class_finalize function
It's not going to get called anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=765540
2016-06-04 13:35:12 +01:00
Tim-Philipp Müller
38c74e41c7 element: remove base_class_finalize_func which is never called
Won't be called for static types, so no point keeping it around.

https://bugzilla.gnome.org/show_bug.cgi?id=765540
2016-06-04 13:11:55 +01:00
Guillaume Desmottes
4a41468ce7 Use MAY_BE_LEAKED_FLAG
This helps having "make check" passing with the leaks tracer enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=766008
2016-06-02 23:14:15 +01:00
Guillaume Desmottes
21070c8114 tracing: add hooks when objects or miniobjects are created and destroyed
https://bugzilla.gnome.org/show_bug.cgi?id=765052
2016-06-02 23:10:44 +01:00
Guillaume Desmottes
194964b4e0 gst_deinit: move down tracers cleaning
We want the tracer detecting leaks to be finalized as late as possible
to give the chance to other gst components to be properly cleaned first.

https://bugzilla.gnome.org/show_bug.cgi?id=765052
2016-06-02 23:08:04 +01:00
Guillaume Desmottes
aa336008b3 tracerrecord: allow G_TYPE_POINTER for field types
Tracers may want to display the address of an object.

https://bugzilla.gnome.org/show_bug.cgi?id=765052
2016-06-02 22:53:28 +01:00
Stefan Sauer
b23cb42ae9 docs: xref the free function and expand allocation query docs
Add xrefs for how to parse pool details from an allocation query.
2016-05-30 02:04:18 -07:00
Nicolas Dufresne
446778464b object: Notify name change when using _set_name()
There was a 0.11 FIXME about notifying the name change or removing that
function. Clearly we can't remove this function, so let's notify it.

https://bugzilla.gnome.org/show_bug.cgi?id=766923
2016-05-26 15:36:05 -04:00
Edward Hervey
6bfb88b410 gst_private: Fix gstconfig include
Since it's a generated header, we need to specify the gst subdir so
that it gets properly included in out-of-dir compilation
2016-05-25 15:31:52 +02:00
Tim-Philipp Müller
5628f7ea73 gst: make sure to include gstconfig.h also in gst_private.h
For GST_EXPORT define and also things like GST_DISABLE_REGISTRY.
Hopefully fixes the following build failure on cerbero-cross-mingw32:
helpers/gst-plugin-scanner.c:50: undefined reference to `_imp___gst_disable_registry_cache'
2016-05-25 10:48:05 +01:00
Tim-Philipp Müller
0274650e42 g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2016-05-24 00:40:27 +01:00
Tim-Philipp Müller
af47500d12 gst: g-i: pass compiler with quotes
So CC="ccache gcc" works properly.
2016-05-23 21:15:48 +01:00
Ray Strode
4152f266f7 gst: attempt to fix/track-down mysterious gnome-continuous build failures 2016-05-23 21:08:07 +01:00
Tim-Philipp Müller
e0de5ed915 iterator: only unset GValue if it was inited
And add some function guards. From GLib 2.48 on it is
allowed to pass an uninitialised GValue to g_value_unset().

https://bugzilla.gnome.org/show_bug.cgi?id=763762
2016-05-23 18:09:48 +01:00
Nirbheek Chauhan
1c8711816e gst/parse: Also pass -DGST_EXPORTS here
This static library gets included directly into libgstreamer-1.0.so, so it needs
the same GST_EXPORTS definition as the rest of the code that's compiled into
that otherwise it will try to find the constants it uses from gstinfo via DLL
importing (__declspec(dllimport)).

Fixes https://ci.gstreamer.net/job/cerbero-cross-mingw32/4393/
2016-05-23 14:24:16 +01:00
Nirbheek Chauhan
161eee6694 gstconfig.h: Always use dllexport/import on Windows
__declspec(dllexport/import) are supported by GCC and are needed for
properly generating code that fetches the values of constants from DLLs
built with __declspec(dllexport) which happens when anything using
GST_EXPORT is built with MSVC.

See: https://msdn.microsoft.com/en-us/library/619w14ds.aspx

Essentially, if you built gstreamer with MSVC and then tried to use
constants from it (such as GST_TYPE_CAPS) in a plugin, GCC would
retrieve the address of the value instead of the value itself.
2016-05-23 12:13:53 +01:00
Guillaume Desmottes
56ee365077 (mini)object: add MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=766008
2016-05-20 09:11:08 +01:00
Tim-Philipp Müller
ef1444cfe4 bin: emit deep-element-{added,removed} for children of newly-added/removed bin
https://bugzilla.gnome.org/show_bug.cgi?id=578933
2016-05-16 09:10:09 +01:00
Tim-Philipp Müller
81dec8cc4d bin: add "deep-element-added" and "deep-element-removed" signals
This means applications and bin sub-classes can easily track when
a new child element is added to the pipeline sub-hierarchy or
removed.

Currently doesn't signal deep added/removed for elements inside
a bin if a bin is added/removed.

https://bugzilla.gnome.org/show_bug.cgi?id=578933
2016-05-16 09:10:09 +01:00
Sebastian Dröge
edb27a8ec2 pad: Improve IDLE probe docs
Make it explicit that the pad is only blocked while the callback is running,
and the pad will be unblocked again once the callback returned.

If BLOCK and IDLE behaviour is needed, both need to be used.

https://bugzilla.gnome.org/show_bug.cgi?id=766002
2016-05-15 15:02:49 +03:00
Jan Schmidt
174a5e93e2 bin: Fix EOS forwarding on PLAYING->PLAYING
When doing a transition from PLAYING to PLAYING, we will fail
to forward an EOS message on the bus, and noone else will ever
send it because there'll be no actual state changed message.

Allow EOS through directly in that case.
2016-05-14 23:46:47 +10:00
Edward Hervey
794944f779 pad: Don't drop LATENCY queries with default implementation
If there is only one pad in the internal pads, when folding for
LATENCY queries it will just drop the response if it's not live.

This is maybe not the proper fix, but it will just accept the first
peer responses, and if there are any other pads, it will only take
them into account if the response is live.

This *should* properly handle the aggregation/folding behaviour of
multiple live peer responses, while at the same time handling the
simple one-pad-only-and-forward use-case

https://bugzilla.gnome.org/show_bug.cgi?id=766360
2016-05-13 11:36:12 +02:00
Jan Schmidt
fe3180dcca debug: Instantiate GType when dumping debug categories.
A lot of debug categories are declared in element class_init
functions, which don't get run until the element is first created
(not just registered in the plugin load function). This means
that --gst-debug-help doesn't print out a lot of categories.

Creating an instance of each element from the element factory
makes them visible, at some extra cost - 2-3 times longer, which can
be a full second or two of extra waiting. Yikes!

https://bugzilla.gnome.org/show_bug.cgi?id=741001
2016-05-13 18:05:39 +10:00
Wonchul Lee
58f964da96 debugutils: fix warning on enum properties printing
https://bugzilla.gnome.org/show_bug.cgi?id=766251
2016-05-11 10:02:49 +03:00
Sebastian Dröge
14f71d2e27 pad: Fix pad state when deactivating from one mode and then trying to activate another and failing
When activating a pad in PULL mode, it might already be in PUSH mode. We now
first try to deactivate it from PUSH mode and then try to activate it in PULL
mode. If the activation fails, we would set the pad to flushing and set it
back to its old mode. However the old mode is wrong, the pad is not in PUSH
mode anymore but in NONE mode.

This fixes e.g. typefind in decodebin reactivating PUSH/PULL mode if upstream
actually fails to go into PULL mode after first PUSHING data to typefind.
2016-05-10 15:07:51 +03:00
Guillaume Desmottes
30ee36e630 utils: fix element leak in find_common_root()
The root element was not unreffed when iterating over ancestors.

https://bugzilla.gnome.org/show_bug.cgi?id=765961
2016-05-04 12:03:53 +03:00
Guillaume Desmottes
0ff10ac3ca uri: unref instead of using _gst_uri_free() directly
This confuses gst_tracing as we shortcut the mini object reference
system.

https://bugzilla.gnome.org/show_bug.cgi?id=765958
2016-05-04 10:08:24 +03:00
Guillaume Desmottes
782bc97e6f deviceproviderfactory: fix factory leak
The code path when early returning was leaking the extra reference on
the factory.

https://bugzilla.gnome.org/show_bug.cgi?id=765904
2016-05-03 10:49:24 +03:00
Tim-Philipp Müller
c7bb52934e query: fix compiler warning
C4146: unary minus operator applied to unsigned type, result still unsigned
2016-05-02 10:53:04 +01:00
Tim-Philipp Müller
12a1418f7f Fix some nonsensical g-i annotations 2016-04-30 14:15:08 +01:00
Sebastian Dröge
8177173db0 element: Add gst_element_call_async()
This calls a function from another thread, asynchronously. This is to be
used for cases when a state change has to be performed from a streaming
thread, directly via gst_element_set_state() or indirectly e.g. via SEEK
events.

Calling those functions directly from the streaming thread will cause
deadlocks in many situations, as they might involve waiting for the
streaming thread to shut down from this very streaming thread.

This is mostly a convenience function around a GThreadPool and is for example
used by GstBin to continue asynchronous state changes.

https://bugzilla.gnome.org/show_bug.cgi?id=760532
2016-04-27 18:51:33 +03:00
Guillaume Desmottes
8daad351a4 caps: add cleanup priv function
Those are allocated in _priv_gst_caps_initialize() so it makes
sense to have a symetric cleanup functions called by gst_deinit().

https://bugzilla.gnome.org/show_bug.cgi?id=765606
2016-04-26 14:29:08 +01:00
Guillaume Desmottes
21a2b26bb2 capsfeature: add cleanup priv function
Those are allocated in _priv_gst_caps_features_initialize() so it makes
sense to have a symetric cleanup functions called by gst_deinit().

https://bugzilla.gnome.org/show_bug.cgi?id=765606
2016-04-26 14:29:01 +01:00
Sebastian Dröge
2076be19ed datetime: Sanity check year, month and day when parsing ISO-8601 strings
Passing years > 9999, months > 12 or days > 31 to gst_date_time_new() will
cause an assertion and generally does not make much sense. Instead consider it
as a parsing error like hours > 24 and return NULL.
2016-04-21 13:49:32 +03:00
Guillaume Desmottes
1ea831bd6c allocator: add cleanup method
Make tracking memory leaks easier.

https://bugzilla.gnome.org/show_bug.cgi?id=765212
2016-04-18 11:33:32 -04:00
Sebastian Dröge
3f3af84a8f meta: Warn if a meta implementation is registered without init function
This previously caused uninitialized memory unless something else was
initializing all the fields explicitly to something.

To be on the safe side, we also allocate metas without init function to all
zeroes now as it was relatively common.

https://bugzilla.gnome.org/show_bug.cgi?id=764902
2016-04-13 10:21:15 +03:00
Tim-Philipp Müller
6e3fb7af52 element: add API to get property change notifications via messages
Be notified in the application thread via bus messages about
notify::* and deep-notify::* property changes, instead of
having to deal with it in a non-application thread.

API: gst_element_add_property_notify_watch()
API: gst_element_add_property_deep_notify_watch()
API: gst_element_remove_property_notify_watch()
API: gst_message_new_property_notify()
API: gst_message_parse_property_notify()
API: GST_MESSAGE_PROPERTY_NOTIFY

https://bugzilla.gnome.org/show_bug.cgi?id=763142
2016-04-08 13:27:59 +01:00
Tim-Philipp Müller
e3cc67a133 memory: fix C++ compiler warnings with GST_MAP_INFO_INIT 2016-04-06 17:46:31 +01:00
Matthew Waters
e8c8c27ae8 utils: check the correct element's state on ghosting pads
Checking the current element's state when we're adding pads to
the parent element is checking the wrong thing.

Silences a 'attempting to add an inactive pad to a running element'
warning when adding a ghost pad to a running parent bin of the parent
bin of the element.

https://bugzilla.gnome.org/show_bug.cgi?id=764176
2016-04-06 23:26:41 +10:00
Matthew Waters
f876306638 utils: expose pad_link_maybe_ghosting
This is a useful function to automatically add ghost pads when linking
two elements across bin boundaries without know their exact parentage.

e.g. when using gst_parse_bin_from_description (with or without it ghosting pads),
one can simply retreive the src/sink pads from the bin to link to another pad.

Similar functionality is provided by gst_element_link_pads{_full}() however only
by pad name rather than by actual pads.

API: gst_pad_link_maybe_ghosting_full

https://bugzilla.gnome.org/show_bug.cgi?id=764176
2016-04-06 23:26:41 +10:00
Mark Combellack
b8f2929dac GST_REFCOUNTING: Add logging of pointer address for dispose, finalize, etc messages
Updated the GST_REFCOUNTING logging so that it includes the pointer
address of the object that is being disposed or finalized.

With this change is is then possible to match up GST_REFCOUNTING log messages
for object allocation/disposal/finalization. This can help with diagnosing
"memory leaks" in applications that have not correctly disposed of all the
GStreamer objects it creates.

https://bugzilla.gnome.org/show_bug.cgi?id=749427
2016-04-02 18:18:10 +01:00
Luis de Bethencourt
1bb699446a info: only open log file when adding it to the log function
This avoids the leak of opening it and then not passing it or closing it
before it goes out of scope.
2016-04-02 10:47:57 +01:00