Commit graph

128 commits

Author SHA1 Message Date
Sebastian Dröge
a7d282d272 utils: Export linear regression calculation as public function
It is useful outside the GstClock code too.

https://bugzilla.gnome.org/show_bug.cgi?id=774916
2016-11-28 14:26:50 +02:00
Jan Schmidt
e1dc60524e dynamic types: Implement dynamic types in the registry
Implement GstDynamicTypeFactory as a new registry feature.

GstDynamicTypeFactory provides a way of registering a GType
into the registry, such that it will be registered as a dynamic
type when the registry is loaded, and then automatically loaded
if the type is needed during caps parsing.

This allows using non-core types in pad templates, by loading a
registry feature to create the GType on the fly.

https://bugzilla.gnome.org/show_bug.cgi?id=750079
2016-11-02 11:21:37 +11:00
Guillaume Desmottes
40727d9c83 element: clean up thread pool from gst_task_cleanup_all()
This ensures that all async operations (started from gst_element_call_async())
have been completed and so there is no extra thread running.

Fix races when checking for leaks on unit tests as some of those
operations were still running when the leaks tracer was checking for
leaked objects.

https://bugzilla.gnome.org/show_bug.cgi?id=768577
2016-07-08 17:27:32 +01: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
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
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
Stefan Sauer
4859494945 tracer: add an internal ptr format for tracer serialisation
We need to apply the string wrapping that value serialisation does also in the
tracer logging, otherwise we can't parse nested structures.
2016-01-20 09:14:12 +01:00
Stefan Sauer
10b78d872b tracerrecord: add a log record class
We use this class to register tracer log entry metadata and build a log
template. With the log template we can serialize log data very efficiently.
This also simplifies the logging code, since that is now a simple varargs
function that is not exposing the implementation details.

Add docs for the new class and basic tests.

Remove the previous log handler.

Fixes #760267
2016-01-15 21:54:01 +01:00
Sebastian Dröge
d787105fd5 gst: Rename _priv_gst_info_start_time to _priv_gst_start_time and initialize it centrally
It's used by the debugging and tracer subsystem and in various files, make it
a central thing that is initialized independ of the existence of those
subsystems.
2016-01-07 18:41:25 +02:00
Stefan Sauer
46ea9729df tracer: split into tracer and tracerutils
Keep tracer base class in tracer and move core support into the utils module.
Add a unstable-api guard to the tracer.h so that external modules would need to
acknowledge the status by setting GST_USE_UNSTABLE_API.
2015-10-05 20:59:39 +02:00
Stefan Sauer
4e5d586c7d tracer: initial prototype for the tracing subsystem 2015-10-05 20:59:39 +02:00
Thibault Saunier
749810b238 registry: Add plugins to the registry we are loading and not default one
When running gst_registry_scan_plugin_file we were losing the
information about the registry being loaded and ended up adding the
plugin to the default registry which was not correct.

https://bugzilla.gnome.org/show_bug.cgi?id=752662
2015-08-05 17:32:00 -04:00
Alex Ashley
abdafb0d64 protection: add GstProtectionMeta to support protected content
In order to support some types of protected streams (such as those
protected using DASH Common Encryption) some per-buffer information
needs to be passed between elements.

This commit adds a GstMeta type called GstProtectionMeta that allows
protection specific information to be added to a GstBuffer. An example
of its usage is qtdemux providing information to each output sample
that enables a downstream element to decrypt it.

This commit adds a utility function to select a supported protection
system from the installed Decryption elements found in the registry.
The gst_protection_select_system function that takes an array of
identifiers and searches the registry for a element of klass Decryptor that
supports one or more of the supplied identifiers. If multiple elements
are found, the one with the highest rank is selected.

This commit adds a unit test for the gst_protection_select_system
function that adds a fake Decryptor element to the registry and then
checks that it can correctly be selected by the utility function.

This commit adds a unit test for GstProtectionMeta that creates
GstProtectionMeta and adds & removes it from a buffer and performs some
simple reference count checks.

API: gst_buffer_add_protection_meta()
API: gst_buffer_get_protection_meta()
API: gst_protection_select_system()
API: gst_protection_meta_api_get_type()
API: gst_protection_meta_get_info()

https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-18 12:24:06 +01:00
Tim-Philipp Müller
1dd72f56ea debugutils: nicer printing of caps features
Only print interesting caps features, don't
append (memory:SystemMemory) to all caps,
which makes them much more unwieldy and
harder to read. Also use internal function
to get caps features so that our printing
has no side effects on the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=746809
2015-04-01 12:15:30 +01:00
Tim-Philipp Müller
da7847d1ad message, bus: fix async message delivery
Async message delivery (where the posting thread gets blocked
until the message has been processed and/or freed) was pretty
much completely broken.

For one, don't use GMutex implementation details to check
whether a mutex has been initialized or not, esp. not
implementation details that don't hold true any more with
newer GLib versions where atomic ops and futexes are used
(spotted by Josep Torras). This led to async message
delivery no longer blocking with newer GLib versions on
Linux.

Secondly, after async delivery don't free mutex/GCond
embedded inside the just-freed message structure.

Use a new (private) mini object flag to signal GstMessage
that the message being freed is part of an async delivery
on the bus so that the dispose handler can keep the message
alive and the bus can free it once it's done cleaning up
stuff.
2015-02-17 09:52:09 +00:00
Jan Schmidt
81d613694c clock: Improve slaving regression.
Add domain checks for the input values, and a variable precision
calculation that loops if necessary to ensure we never overflow
accumulators and then silently produce garbage results.

Make the (non-public) linear regression function available for
unit testing by putting it in a separate source file the test
can include. Add a unit test that the new regression function
produces sensible results for several inputs taken from real-world
captures.
2015-01-21 22:27:18 +11:00
Stefan Sauer
3fbc3d76dc private: allow internal access to the debug base-time
Moving the extern to the head lets us access this from other parts as well. This
is neeed in the tracer branch.
2014-07-23 21:30:21 +02:00
Olivier Crête
7992174a1a DeviceProvider: Rename from DeviceMonitor 2014-06-26 14:45:30 -04:00
Edward Hervey
37e8ffcc4f gst_private: Fix duplicate definition 2014-06-19 08:43:36 +02:00
Sebastian Dröge
db1e4422b6 gst: Store more basic type GTypes in variables
Micro optimization to change a function call to a variable access
for all our basic types.
2014-06-19 08:06:55 +02:00
Olivier Crête
e4e85fc88a devicemonitor: Add GstDeviceMonitor and related
Also add GstDevice and GstDeviceMonitorFactory
And add code to the registry to save them

https://bugzilla.gnome.org/show_bug.cgi?id=678402
2014-03-16 14:38:07 +00:00
Stefan Sauer
1e58699376 private: remove left-over comment
The caps are saved in the registry.
2013-10-25 21:28:30 +02:00
Tim-Philipp Müller
0e1dd050a5 printf: don't build if debugging subsystem was disabled 2013-04-13 01:19:41 +01:00
Sebastian Dröge
7477b25df5 caps: Add new data type for handling caps features to the caps
These are meant to specify features in caps that are required
for a specific structure, for example a specific memory type
or meta.

Semantically they could be though of as an extension of the media
type name of the structures and are handled exactly like that.
2013-03-31 18:15:52 +02:00
Sebastian Dröge
b909061031 gst: Add new GstContext miniobject for sharing contexts in a pipeline 2013-03-29 16:40:21 +01:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Tim-Philipp Müller
68a2eb5d18 gst: sprinkle some G_GNUC_INTERNAL for internal functions 2012-07-09 20:48:56 +01:00
Tim-Philipp Müller
93a2b6e9b3 value: use datetime serialise/deserialise functions for datetimes
This re-uses existing code and makes sure we properly serialise
and deserialise datetimes where not all fields are set (thus
fixing some warnings when serialising such datetimes).
2012-07-07 22:46:00 +01:00
Wim Taymans
afd5db3c6b info: add new locking debug category 2012-07-05 11:19:16 +02:00
Tim-Philipp Müller
5a6be2201d datetime: fix compare function
Take into account that not all fields might be valid (though they
are valid in the GDateTime structure). But we should just return
unordered if the set fields don't match. Also, don't check
microseconds when comparing datetimes, since we don't serialise
those by default if they're available. This ensures date times are
still regarded as equal after serialising+deserialising.
2012-06-27 13:51:33 +01:00
Tim-Philipp Müller
2c532aa821 toc: put toc directly into event/message/query structure
Now that TOCs are refcounted and have a GType, we can just
stuff a ref of the TOC directly into the various toc
event/message/query structures and get rid of lots of
cracktastic GstStructure <-> GstToc serialisation and
deserialisation code. We lose some TOC sanity checking
in the process, but that should really be done when
it's being created anyway.
2012-06-26 20:43:50 +01:00
Tim-Philipp Müller
68da2aeeed toc: use global quark table 2012-05-20 17:48:55 +01:00
Tim-Philipp Müller
5b4417ff9e pluginfeature: make GstPluginFeature structure private
Make GstPluginFeature opaque until we have time to
clean it up a little. Only GstElementFactory and
GstTypefindFactory derive from it, and they are
opaque already, and we currently don't support
custom plugin features in the registry anyway.
2012-05-19 17:25:24 +01:00
Tim-Philipp Müller
a9d19a6913 elementfactory: make object struct opaque for now
Make GstElementFactory opaque until we have time to
clean it up a little. It's not something anyone
would need to derive from.
2012-05-19 16:17:12 +01:00
Tim-Philipp Müller
5bcbdd83d1 typefindfactory: make object struct opaque for now
Make opaque until we have time to clean it up a little.
2012-05-01 23:23:41 +01:00
Tim-Philipp Müller
c7eca5ca15 plugin: use GstObject flags for plugin flags 2012-04-29 17:46:32 +01:00
Tim-Philipp Müller
19d4c0ba73 plugin: make GstPlugin object structure opaque for now
There's no reason anyone would want to derive from this, so
just make opaque until we manage to make all the private bits
private properly (which I'm not doing right now because it's
more invasive and I have registry modifications locally which
touch all that code as well).
2012-04-29 17:03:32 +01:00
Tim-Philipp Müller
730c263842 toc: don't export private functions 2012-04-02 23:23:46 +01:00
Stefan Sauer
1074a4e99a Merge branch '0.10'
Conflicts:
	docs/gst/gstreamer-sections.txt
	gst/Makefile.am
	gst/gst.c
	gst/gst.h
	gst/gstevent.c
	gst/gstevent.h
	gst/gstmessage.h
	gst/gstquark.c
	gst/gstquark.h
	gst/gstquery.c
	gst/gstquery.h
	tests/check/Makefile.am
2012-04-02 21:33:10 +02:00
Alexander Saprykin
63256d271d Add generic table of contents (TOC) support 2012-04-02 10:49:38 +02:00
Wim Taymans
391b4309f9 meta: improve debugging
Add category for metadata debug
2012-03-01 17:41:57 +01:00
Wim Taymans
e60b67f907 Update debug categories
Remove some categories marked for deletion.
Add a category for GstMemory.
2012-02-02 15:54:28 +01:00
Wim Taymans
166f6e1cc5 trace: make alloc trace work for miniobject again 2012-01-27 15:33:48 +01:00
Sebastian Dröge
148bf27ce3 Merge branch 'master' into 0.11 2012-01-10 13:00:07 +01:00
Idar Tollefsen
c8c961ac81 gstconfig.h: adds and uses SunPro visibility attribute for proper function exports
Define GST_EXPORT for SunPro.

https://bugzilla.gnome.org/show_bug.cgi?id=667289
2012-01-05 00:08:19 +00:00
Tim-Philipp Müller
95bd31443b registry: move private bits into private struct 2011-12-26 18:41:13 +00:00
Wim Taymans
facf937276 sample: add new sample miniobject
Add a new simple miniobject that is a combination of a GstBuffer, GstCaps,
GstSegment and other arbitrary info organized in a GstStructure. This object can
be used to exchange samples between an element and the application or for
storing album art in tags etc.
2011-12-01 16:37:46 +01:00
Tim-Philipp Müller
5842e3fc38 elementfactory: move private functions for registry to private header 2011-10-29 19:59:05 +01:00