Commit graph

7881 commits

Author SHA1 Message Date
Stefan Sauer ddc5654b60 tracer: mark GstTracerQuarkId as non GEnum
This reverts 72ca02b1de and marks the enum
accordingly.
2015-10-06 18:49:46 +02:00
Stefan Sauer b971c0979e tracer: fix the build with debug (tracer) disabled
Sync the macro definitions. The dummy defines has argument mismatches.
2015-10-06 14:01:21 +02:00
Stefan Sauer 73e8508bd4 tracer: fix the build with debug (tracer) disabled
Remove commas at the end of the macros.
2015-10-06 11:39:33 +02:00
Thiago Santos 72ca02b1de gst: adding tracer quark id to gst init and deinit
Fixes issues at make check
2015-10-05 19:06:41 -03:00
Marcin Kolny e8d0b019b3 tracer: add missing hooks
Add following hooks: element-new, element-add-pad, element-remove-pad,
bin-add-pre, bin-add-post, bin-remove-pre, bin-remove-post, pad-link-pre,
pad-link-post, pad-unlink-pre, pad-unlink-post.

https://bugzilla.gnome.org/show_bug.cgi?id=733187
2015-10-05 20:59:39 +02:00
Thiago Santos 567865c81c tracer: add pad query hooks 2015-10-05 20:59:39 +02:00
Mathieu Duponchelle eb0c8facca tracer: strdup the passed parameters. 2015-10-05 20:59:39 +02:00
Stefan Sauer 660049bb38 tracing: rename the global api to gst_tracing
This makes it more obvious what is the api for tracer elements and what is api
for the global state.
2015-10-05 20:59:39 +02:00
Stefan Sauer 5e2770566f tracers: eliminate var_args
Register tracer hooks as GCallback. Use macros for hook dispatch and cast the
hook functions back to the appropriate type.
2015-10-05 20:59:39 +02:00
Stefan Sauer 4881d1c16c tracer: use GQuark or strings for the hook id
This way one can define new tracing probes without changing the core. We are
using our own quark table, as 1) we only want to initialize them if we're
tracing, 2) we want to share them with the tracers.
2015-10-05 20:59:39 +02:00
Stefan Sauer 1a3e218b89 tracer: simplify hook api
Instead of a single invoke() function and a 'mask', register to individual
hooks. This avoids one level of indirection and allows us to remove the
hook enums. The message enms are now renamed to hook enums.
2015-10-05 20:59:39 +02:00
Stefan Sauer 7b24d76260 tracer: drop the HookId hid from the invoke method
The MessageId is more detailed and anyway needed to interpret the varargs.
2015-10-05 20:59:39 +02:00
Stefan Sauer 2ef32c8840 tracer: remove commented code 2015-10-05 20:59:39 +02:00
Stefan Sauer d7acb27dee tracer: use GST_PTR_FORMAT to log the structure
This way we only expand the structure when we're logging. This allows us to
meassure the pure tracing seperately from the logging.
Also add some comments on further improvements.
2015-10-05 20:59:39 +02:00
Stefan Sauer b92ea7a0bc quarks: revert the quark changes, we not using them anymore 2015-10-05 20:59:39 +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 6ea2b41364 docs: add gtk-doc blobs 2015-10-05 20:59:39 +02:00
Stefan Sauer 7dfc0a8ead tracers: add a logging helper to remove identical copies from the tracers 2015-10-05 20:59:39 +02:00
Stefan Sauer 2a01088079 tracer: use the same timebase as the logging 2015-10-05 20:59:39 +02:00
Stefan Sauer 81b27c7036 tracer: parse parameters 2015-10-05 20:59:39 +02:00
Stefan Sauer ce7ce2d866 tracer: add more hooks and handle it in the plugins 2015-10-05 20:59:39 +02:00
Stefan Sauer 11d6e13d73 tracer: use a macros for the enabled check
Avoid a function call and check the variables from the macro.
2015-10-05 20:59:39 +02:00
Stefan Sauer e08fab7d5f tracer: use macros for hooks
Wrap the hook with a pre and post macro. This looks less intrusive than the
previous version, although it is a little less optimized.
2015-10-05 20:59:39 +02:00
Stefan Sauer 9d3975b5da tracer: pass the timestamp directly
Avoid the structure mashalling (and weird field naming).
2015-10-05 20:59:39 +02:00
Stefan Sauer c2d5b35332 tracer: pass the instance to the vmethod 2015-10-05 20:59:39 +02:00
Stefan Sauer 764b5833b9 tracer: switch to quarks and add another hook for buffer flow
Use pre-defines quarks as this will be called quite often.
2015-10-05 20:59:39 +02:00
Stefan Sauer 68b1473846 tracer: add the hook-id to the invoke signature
Tracers that subscribe to multiple hooks can know what hook was used.
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
Sebastian Dröge 3e8ef4cf5a Update GLib dependency to 2.40.0 2015-10-02 22:18:24 +03:00
Matthew Waters d5ded15889 bin: implement context propagation when adding elements
When adding an element to a bin we need to propagate the GstContext's
to/from the element.

This moves the GstContext list from GstBin to GstElement and adds
convenience functions to get the currently set list of GstContext's.

This does not deal with the collection of GstContext's propagated
using GST_CONTEXT_QUERY.  Element subclasses are advised to call
gst_element_set_context if they need to propagate GstContext's
received from the context query.

https://bugzilla.gnome.org/show_bug.cgi?id=705579
2015-09-28 18:21:59 +10:00
Thiago Santos 4b5e79cd18 pad: don't fallback to caps queries with proxy pads
A proxy-pad should always proxy the caps related queries
and events to its down or upstream peers on the other side
of the element. Falling back to a caps query seems wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=754112
2015-09-26 07:13:45 -03:00
Vivia Nikolaidou 44ba1565d9 segment: Replaced gst_segment_to_position with gst_segment_position_from_running_time
gst_segment_to_position might cause confusion, especially with the addition of
gst_segment_position_from_stream_time . Deprecated gst_segment_to_position
now, and replaced it with gst_segment_position_from_running_time.

Also added unit tests.
2015-09-26 00:00:08 +02:00
Vivia Nikolaidou 26ef44f17c segment: gst_segment_to_stream_time: Renamed 'result' to 'stream_time'
Renamed the "result" variable to "stream_time" for better readability.
2015-09-25 23:59:59 +02:00
Vivia Nikolaidou c0d4b1b646 segment: Added gst_segment_position_from_stream_time()
gst_segment_position_from_stream_time() will convert stream time into a
position in the segment so that gst_segment_to_stream_time() with that
position returns the same stream time. It will return -1 if the stream time
given is not inside the segment.
2015-09-25 23:59:53 +02:00
Vivia Nikolaidou 60130eb5f0 segment: Rewording of struct field descriptions
The new wording makes it easier to understand exactly what each field of the
GstSegment struct represents.
2015-09-25 23:58:41 +02:00
Sebastian Dröge a3513d6e97 event: Make sure that timestamp + diff in QoS events is never smaller than 0
When a running-time-offset is stored in the event, it could become smaller
than 0 although the event is otherwise correct. This can happen when pad
offsets are used.

To prevent this, we set the timestamp to -diff, so that in the end the sum of
both is exactly 0.

https://bugzilla.gnome.org/show_bug.cgi?id=754356
2015-09-25 23:55:18 +02:00
Stian Selnes 0fbf1d3eb7 bin: element: Ignore activate result for removed pads on state change
This fixes a race where a state change may return failure if it has
request pads that are deactivated and removed (and thus have no
parent) at the same time as the element changes state and (de)activates
its pads.

https://bugzilla.gnome.org/show_bug.cgi?id=755342
2015-09-24 12:14:57 +02:00
Vikram Fugro c12bd5d807 gst: Documentation typo fix in caps & pad APIs
gst_caps_can_intersect() & GST_PAD_IS_ACCEPT_INTERSECT()
documentation typo fix.

https://bugzilla.gnome.org/show_bug.cgi?id=755257
2015-09-19 17:57:55 +02:00
Tim-Philipp Müller 366680ee59 bufferpool: sprinkle some allow-none and out annotations for g-i 2015-09-15 18:05:43 +01:00
Vineeth TM 09900bbfb1 bin: fix typo in log message when threadpool alloc fails
https://bugzilla.gnome.org/show_bug.cgi?id=754975
2015-09-14 16:03:51 +01:00
Igor Rondarev 6972e7a926 configure: Check for socketpair() in -lsocket too
On e.g. QNX it is in an external library, not libc.

https://bugzilla.gnome.org/show_bug.cgi?id=754875
2015-09-11 23:23:50 +02:00
Vivia Nikolaidou ee1bbe2f15 bin: Make sure we don't add/remove a bin to/from itself
Doing so would deadlock from trying to acquire the object lock twice

https://bugzilla.gnome.org/show_bug.cgi?id=754036
2015-08-25 10:19:44 +03:00
Stefan Sauer f3e122ffec debugutils: bring the dot style a bit closer to what we use in the docs
Use round corners for bins and elements. Put sink pads on the left and src pads
on the right of elements.
2015-08-17 22:08:07 +02:00
Sebastian Dröge 1176fbf6dc pad: Break sticky event array iterations if the type is bigger than the one we look for
Microoptimization we can do because the array is sorted by type.
2015-08-15 17:59:21 +02:00
Edward Hervey 7f0e0ff3ca gstpad: Add a new GST_PROBE_HANDLED return value for probes
In some cases, probes might want to handle the buffer/event/query
themselves and stop the data from travelling further downstream.

While this was somewhat possible with buffer/events and using
GST_PROBE_DROP, it was not applicable to queries, and would result
in the query failing.

With this new GST_PROBE_HANDLED value, the buffer/event/query will
be considered as successfully handled, will not be pushed further
and the appropriate return value (TRUE or GST_FLOW_OK) will be returned

This also allows probes to return a non-default GstFlowReturn when dealing
with buffer push. This can be done by setting the
GST_PAD_PROBE_INFO_FLOW_RETURN() field accordingly

https://bugzilla.gnome.org/show_bug.cgi?id=748643
2015-08-15 17:00:12 +02:00
Mathieu Duponchelle afff60b0b5 gstversion: Add missing include in .in file. 2015-08-15 13:26:12 +02:00
Mathieu Duponchelle 24e1abe367 Headers: add missing includes. 2015-08-15 13:17:07 +02:00
Thiago Santos b76ecfd992 pad: add GST_PAD_FLAG_ACCEPT_TEMPLATE
It will make the default accept-caps handler use the pad template
caps instead of the query-caps result to check if the caps is
acceptable. This is aligned with what the design docs says the
accept-caps should do (be non-recursive) and should be faster. It
is *not* enabled by default, though.

API: GST_PAD_FLAG_ACCEPT_TEMPLATE
API: GST_PAD_IS_ACCEPT_TEMPLATE
API: GST_PAD_SET_ACCEPT_TEMPLATE
API: GST_PAD_UNSET_ACCEPT_TEMPLATE

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 08:56:53 -03:00
Vivia Nikolaidou 88f6334af6 datetime: accept just a time as ISO 8601 string and use today's date then
If no date and only a time is given in gst_date_time_new_from_iso8601_string(),
assume that it is "today" and try to parse the time-only string. "Today" is
assumed to be in the timezone provided by the user (if any), otherwise Z -
just like the behavior of the existing code.

https://bugzilla.gnome.org/show_bug.cgi?id=753455
2015-08-11 09:50:50 +01:00
Wim Taymans ffa90b2e72 devicemonitor: fix provider leak 2015-08-08 17:59:51 +02:00
Edward Hervey 2ef06fd39d pad: Fix previous commit
We want to get the caps query *result*
2015-08-08 15:29:30 +02:00
Wim Taymans 5a7b7e66bd deviceprovider: Add method to hide devices from a provider
Add methods to add/remove the providers that should be hidden by this
provider. Also make a method to get a list of hidden providers.

This makes it possible to have multiple systems monitor the same devices
and remove duplicates.

Add a property to see all devices, even duplicate ones from hidden
providers.
2015-08-08 15:21:50 +02:00
Edward Hervey 2499349d94 pad: get_allowed_caps() should go through both pads
The previous implementation was doing a direct call to the peer pad,
which resulted in query probes never being called on the original pad.

Instead of that, get the peer pad caps by using gst_pad_peer_query()
which will call probes in the expected fashion.
2015-08-08 14:51:59 +02:00
Vineeth TM 0eb9dde1e8 value: free caps during failure
While calling gst_value_deserialize_sample, if there is a failure
after caps is ref'ed, then caps is getting leaked. Hence checking for
caps in fail: goto condition and unref'ing it

https://bugzilla.gnome.org/show_bug.cgi?id=753338
2015-08-07 10:17:02 +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
Wim Taymans 62f6207e04 devicemonitor: get a list of currently monitored providers
Get a list of the currently monitored providers.
2015-08-04 13:24:10 +02:00
George Kiagiadakis 794a08d7e9 pad: fix invalid unref after IDLE probe on non-OK flow return
In case there is an IDLE probe fired from gst_pad_push_data and it
doesn't return GST_FLOW_OK, the code jumps to the probe_stopped
label which tries to unref the data object. However, at this point
the data object belongs downstream and must not be touched.
By setting data = NULL, the code skips this unref.

https://bugzilla.gnome.org//show_bug.cgi?id=753151
2015-08-04 11:10:45 +01:00
Jan Schmidt cde3524f52 buffer: Fix the name of the parentbuffermeta debug category.
Don't use 'glbufferrefmeta' as the debug category for the
parent buffer meta.
2015-08-04 20:09:47 +10:00
Jan Schmidt fa370153bc buffer: Remove extra debug symbol from exports
Don't export the debug variable for the parent_buffer_meta.

This was accidentally exported and shouldn't be public
2015-08-04 20:02:00 +10:00
Tim-Philipp Müller 62bd514c8e docs: info: remove 0.8 terminology from log level description
We don't "iterate" bins or pipelines any more.
2015-07-30 17:29:25 +01:00
Nicolas Dufresne 48ab4f6fe2 doc/seekflags: Fix cross references
This fixes miss-use of @ instead of % to refer to enumeration
values.
2015-07-28 21:14:40 -04:00
Tim-Philipp Müller 0a50d1be52 docs: fix description of gst_buffer_extract_dup()
No GBytes involved.
2015-07-22 15:38:06 +01:00
Wim Taymans eedd9cb7b7 devicemonitor: do start and stop outside of the lock
Release the monitor lock when calling the provider start/stop methods.
Because we release the lock now, We need to make sure we check the
cookie again and keep track of started and removed providers.
2015-07-16 18:54:50 +02:00
Wim Taymans b4dbb9d742 deviceprovider: small cleanups
Protect against wrong arguments.
Clean up the header file indentation.
2015-07-16 18:54:50 +02:00
Wim Taymans 8caf9b7a87 devicemonitor: keep order of providers and devices
The deviceproviders are added to the array sorted by their rank. Make
sure we keep this ordering when removing a provider.

We use _prepend to collect the devices, use g_list_reverse to get the
devices in the right order; sorted by rank and in the same order as
returned by the provider.
2015-07-16 18:54:50 +02:00
Tim-Philipp Müller 162fc1f7d6 docs: drop reference to sourceforge mailing list adress 2015-07-16 17:13:35 +01:00
Wim Taymans 661a1947b1 device: add generic struct with properties
Add a generic structure to hold any additional properties about the
device.
2015-07-15 18:21:13 +02:00
Tim-Philipp Müller 3b6fa8e81a docs: bus: mention main loop requirement in gst_bus_add_watch() docs 2015-07-13 14:25:42 +01:00
Prashant Gotarne 3cea60dc6f task: add function guard for _set_lock() and fix guard for _join()
Should only access the object structure after checking
it's valid in gst_task_join().

https://bugzilla.gnome.org/show_bug.cgi?id=746385
https://bugzilla.gnome.org/show_bug.cgi?id=746431
2015-07-13 14:16:52 +01:00
Philippe Normand ee40730558 protection: implement meta transform function
Copy the GstMeta contents over to the new buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=749590
2015-07-11 00:19:20 +01:00
Hyunjun Ko eaf4153668 meta: transform_func: return FALSE if not supported or failed
https://bugzilla.gnome.org/show_bug.cgi?id=751778
2015-07-07 13:40:17 +03:00
Arun Raghavan f0da038c34 pad: Clarify pad probe return type documentation 2015-07-06 14:35:51 +05:30
Olivier Crête f126094dce pad: Enforce NEED_PARENT flag also for chain
The check for the presence of the parent in the presence of
the NEED_PARENT flag was missing for the chain function. Also keep
a ref on the parent in case the pad is removed mid-chain.
2015-07-03 12:56:01 -04:00
Stian Selnes 1a67066ddc memory: Add missing field initializers to GstMapInfo
https://bugzilla.gnome.org/show_bug.cgi?id=751881
2015-07-03 11:36:13 +02:00
Sebastian Dröge 0aae36567d buffer: Don't copy "memory" metas unconditionally
Don't copy memory metas if we only copied part of the buffer, didn't
copy memories or merged memories. In all these cases the memory
structure has changed and the memory meta becomes meaningless.

https://bugzilla.gnome.org/show_bug.cgi?id=751712
2015-07-01 10:37:37 +02:00
Sebastian Dröge d43f256a9e Revert "buffer: Don't copy POOLED and memory metadata unconditionally"
This reverts commit 7a08fa5ec4.
2015-07-01 10:37:35 +02:00
Sebastian Dröge 7a08fa5ec4 buffer: Don't copy POOLED and memory metadata unconditionally
https://bugzilla.gnome.org/show_bug.cgi?id=751712
2015-06-30 18:40:28 +02:00
Prashant Gotarne 03dccde1ef task: guard against NULL task function
https://bugzilla.gnome.org/show_bug.cgi?id=746439
2015-06-25 09:56:19 +01:00
Jonas Holmberg fb19ebbd8f bufferpool: Fixed compiler warning
The pool variable was unused when buidling with debug disabled.
2015-06-24 16:05:37 +02:00
Sebastian Dröge d78b9a5ada bufferlist: Warn if copying a buffer fails in gst_buffer_list_copy_deep() 2015-06-24 10:52:56 +02:00
Hyunjun Ko 7ecef53dbb bufferlist: add new api gst_buffer_list_copy_deep
https://bugzilla.gnome.org/show_bug.cgi?id=751420
2015-06-24 10:52:56 +02:00
Song Bing 5109173abf pad: Clear EOS flag after received STREAM_START event
Clear EOS flag after received STREAM_START event

https://bugzilla.gnome.org/show_bug.cgi?id=750761
2015-06-23 10:35:46 +02:00
Thiago Santos 1418e9e85c utils: use caps when getting a compatible pad by template
Do not ignore the caps argument when requesting a pad by template.

This is particularly harmful when the pad caps query by default
returns ANY so it will match the first template instead of the
one that actually intersects with the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=751235
2015-06-22 17:18:43 -03:00
Jan Schmidt cba677bebb gstsample.h: Include gstbufferlist.h now that it uses GstBufferList 2015-06-23 00:14:30 +10:00
Hyunjun e8db96b033 sample: add gst_sample_set/get_buffer_list apis
Allowed to set/get buffer list to sample if needed

https://bugzilla.gnome.org/show_bug.cgi?id=751026
2015-06-22 13:17:01 +02:00
Nicolas Dufresne ddedc412f5 doc: Unify Since mark for attribute and enum
As this show up as prose in the doc, simply make it consistent
and "arguable" nicer to read.
2015-06-18 11:51:48 -04:00
Nicolas Dufresne 210c29665a doc: Remove parenthesis around Since:
This confuse the parser, hence it does not endup in the doc and the
index properly.
2015-06-18 11:48:50 -04:00
Jan Schmidt 4d4e436376 Add GstParentBufferMeta
A core meta which helps implement the old concept
of sub-buffering in some situations, by making it
possible for a buffer to keep a ref on a different
parent buffer. The parent buffer is unreffed when
the Meta is freed.

This meta is used to ensure that a buffer whose
memory is being shared to a child buffer isn't freed
and returned to a buffer pool until the memory
is.

https://bugzilla.gnome.org/show_bug.cgi?id=750039
2015-06-19 01:15:25 +10:00
Nicolas Dufresne 632431aecb gi: Use INTROSPECTION_INIT for --add-init-section
This new define was added to common. The new init section fixed
compilation warning found in the init line that was spread across
all files.
2015-06-16 18:08:24 -04:00
Nicolas Dufresne 5bdd92be75 clock: Fix _STIME_FORMAT macros
This macro didn't work well as it relied on the sign on the last
divided number (number of days). This value is most of the time
zero, and zero is considered positive in printf. Instead, deal with
the sign manually, and resuse the original macros for the rest. This
actually simplify the macro a lot.
2015-06-15 10:06:00 -04:00
Nicolas Dufresne 48700c7791 doc: More doc warning fixes
So from this point, the remaining warning for libgstreamer are about
protected member not showing in the doc. This may need some discussion
with upstream gtk-doc people.

* Remove % in from of none macro
* Fixed GST_TYPE_FAGS -> GST_TYPE_FAG_SET
* Minor wording fix
* Can't link to GstUri.port, so split the .port part
2015-06-14 10:29:04 -04:00
Nicolas Dufresne 6eb58a67a9 doc: In GstUri we meant nul-terminated, not %NULL
%NULL refers to the pointer. I've written it this way in one
word as this is what GLib uses.
2015-06-14 09:17:21 -04:00
Nicolas Dufresne 781865e0da doc: Cannot reference GST_PACKAGE_RELEASE_DATETIME
So simply remove the % sign.
2015-06-13 21:02:20 -04:00
Nicolas Dufresne b059520926 doc: Fix typo in ref _clock_wait_for_sync() 2015-06-13 20:52:01 -04:00
Nicolas Dufresne 6f2fb1e37e doc: Fix GstUri doc typos
* Use &perctn; instead of reserved character %
* NULL take two L
2015-06-13 20:37:34 -04:00
Nicolas Dufresne bd9ea8d18f doc: Fix Since: marks
There was few Since: mark missing their column. Also unify the way
we set the Since mark on enum value and structure members. These
sadly don't show up in the index.
2015-06-13 20:19:59 -04:00
Nicolas Dufresne b3f42b0c35 doc: Add gst_buffer_copy_deep() 2015-06-13 20:02:18 -04:00
Nicolas Dufresne 2ec88e0939 doc: Remove uneeded protectionevent section
These functions are part of gstevent section already. Keep the doc,
since it's good.
2015-06-13 13:14:30 -04:00
Nicolas Dufresne 7fdb15d6a2 taglist: Add missing scope to func param
This tell GI if this function is for actions (call) or is the
answer of this method being asynchronous (async). In this case
it's a call. This also silence warning from the GI scanner.
2015-06-13 12:32:49 -04:00
Nicolas Dufresne 92087ba75a gstprotection: Add missing Since 1.6 mark 2015-06-13 12:27:31 -04:00