Commit graph

7633 commits

Author SHA1 Message Date
Sebastian Dröge 6f9adbe273 pad: If the latency query fails for one of the pads, it fails overall 2015-02-19 01:12:49 +02:00
Tim-Philipp Müller 10f038d4fb message: revive async delivery message before bus thread can run unref
Revive message in dispose handler before we signal the bus thread,
otherwise the bus thread might be woken up and unref the message
before we had a chance to revive it yet.
2015-02-17 20:49:53 +00: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
Tim-Philipp Müller 9f58aa080a info: nicer buffer offset printing when offsets are not set
Print unset offsets as 'none' instead of humongous numbers,
for better readability.
2015-02-16 19:36:11 +00:00
Sebastian Dröge 9107a5e041 pad: Only initialize GValue to a type once, not on every retry
Otherwise we'll get warnings like this:
cannot initialize GValue with type 'gboolean', the value has already been initialized as 'gboolean'
2015-02-16 11:35:41 +02:00
Matthieu Bouron ee9ca5d48b gstutils: check uri before using it in gst_pad_create_stream_id_internal
If an element implements wrongly the URI query and set the uri to NULL and if
the element calls gst_pad_create_stream_id at some point, it will lead to crash
as the uri is not supposed to be NULL in the gst_pad_create_stream_id_internal
function.

https://bugzilla.gnome.org/show_bug.cgi?id=744520
2015-02-15 17:35:35 +00:00
Sebastian Dröge ae0b12b109 pad: gst_pad_iterate_internal_links() can return NULL if there are none 2015-02-12 14:03:15 +02:00
Sebastian Dröge 5141641dc8 pad: Return NULL instead of FALSE for pointers 2015-02-12 14:03:03 +02:00
Sebastian Dröge 1937d09a95 pad: Implement more useful default handling for the LATENCY query
Before we just took the values from the first pad that succeded the query,
now we accumulate the results of every sinkpad properly and return that
result.
2015-02-12 13:55:36 +02:00
Sebastian Dröge 4a5ce862a2 Improve and fix LATENCY query handling
This now follows the design docs everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 17:53:04 +02:00
Jan Schmidt 9d2b2768e3 clock: Make linear regression x/y base start from maximum observation.
Project the results of the linear regression to the end of the
regression range, so they're more directly comparable to results
going forward
2015-02-07 04:38:39 +11:00
Tim-Philipp Müller 08167e3234 pad: add "offset" property to go with gst_pad_set_offset()
So we can set the offset via gst-launch.
2015-02-05 13:49:47 +00:00
Stefan Sauer 423bd42d44 plugin: add more detail to logging when not loading a plugin
Improve the log messages and add e.g the version number we checked.
2015-02-02 09:41:06 +01:00
Jan Schmidt ae2b0bacb6 gstpad: Fix a typo in a docstring. 2015-02-02 17:38:00 +11:00
Nicolas Dufresne 2b7a15172f build: Check that _MSC_VER macro is defined 2015-02-01 14:23:26 -05:00
Ilya Konstantinov 05296b35a5 task: Add thread name support on OS X and iOS 2015-02-01 20:11:20 +01:00
Sebastian Dröge c3963ae7a3 clock: Don't use invalid objects for GST_DEBUG_OBJECT()
Not sure what "clock" actually is here, it must be something defined by one of
the headers that are included.
2015-01-29 16:37:07 +01:00
Sebastian Dröge 6e47237e66 buffer: Document that gst_buffer_copy_region() accepts -1 as size to copy until the end
It's just a wrapper around gst_buffer_copy_into() after all.
2015-01-29 12:10:49 +01:00
Jan Schmidt f3756af07b segment: Add new skip flags for clarifying trick mode playback.
Add GST_SEEK_FLAG_TRICKMODE_KEY_UNITS and
GST_SEEK_FLAG_TRICKMODE_NO_AUDIO, and rename GST_SEEK_FLAG_SKIP
to GST_SEEK_FLAG_TRICKMODE (with backwards compat define).

Do the same for the corresponding SEGMENT flags.

https://bugzilla.gnome.org/show_bug.cgi?id=735666
2015-01-27 01:51:58 +11:00
Sebastian Dröge 40a0275298 uri: Fix indention 2015-01-22 23:10:06 +02:00
David Waring ab9b66e6be uri: Fix parsing issues
Make host IPs in square brackets store only the IP, i.e. strip the brackets.
Strip leading whitespace characters in URIs.
Fail parsing when host part does not match any valid formats from RFC3986.

https://bugzilla.gnome.org/show_bug.cgi?id=743195
2015-01-22 22:08:00 +01:00
Edward Hervey a6373625f3 gstpad: Inline apply_pad_offset()
Avoid doing a function call for something which will mostly be unused
2015-01-21 14:13:15 +01:00
Edward Hervey 64b451c170 gstpad: Fix debug message 2015-01-21 14:13:15 +01:00
Edward Hervey 93f540bb62 gstpad: Fix PROBE_NO_DATA macro
The problem was that the macro was always used with 'ret' as the defaultval
argument.

This would result in the macro eventually expanding to
    if (G_UNLIKELY (ret != ret && ret != GST_FLOW_OK))

... ret != ret will always fail, and therefore we'd never call the
following line.

Instead of that, store the previous value locally for comparision
2015-01-21 14:11:41 +01: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
Jan Schmidt 4bc7d34f57 clock: Add gst_clock_add_observation_unapplied()
gst_clock_add_observation_unapplied() adds a new master/slave clock
observation and runs the regression without activating the new
calibration results.
2015-01-21 22:27:18 +11:00
Jan Schmidt b79b14815e clock: Add gst_clock_adjust_with_calibration()
gst_clock_adjust_with_calibration() uses directly passed calibration
parameters, instead of using the clock's current calibration,
allowing for calculations using pending or old calibration params
2015-01-21 22:27:18 +11:00
Thiago Santos 0ab956d2c2 docs: fix typo in GstEvent docs
send -> sent
2015-01-20 10:35:47 -03:00
Sebastian Dröge 5b2c79eda7 bin: Pass structs we plan to modify around by pointer, not value
Otherwise the struct is going to be copied, which is not very efficient. And
also has the nice side effect that modifications of the struct might be
done in a copy, and we later use the original struct without the changes.

Caused LATENCY queries to always return the initialization values in one of my
tests, instead of the actual values reported by child elements.
2015-01-16 19:17:31 +01:00
Phillip Wood aefb6fda5e preset: fix incorrect preset version comparison
Use app_version if there are no system presets, so that if the
application presets are newer than the user presets they are merged.

https://bugzilla.gnome.org/show_bug.cgi?id=742877
2015-01-14 11:05:01 +01:00
Stefan Sauer 70788b8578 preset: fix sorting presets
The glib docs are not clear on this, but the qsort man-page is - the
GCompareDataFunc does not get the strings, but pointers to them.
2015-01-11 23:02:57 +01:00
Stefan Sauer 266481e9ff preset: don't return empty preset lists
Add a shortcut for the cases where an element implements the preset iface but
has no presets and return NULL instead of an empty list in that case.
2015-01-04 23:26:19 +01:00
Stefan Sauer 7326d4d71b docs: fix two gtk-doc warnings
One by correcting the end-of-comment marker and one by making sure the function
prototype in the header is in sync with the c file and doc-blob.
2014-12-29 12:05:27 +01:00
Nirbheek Chauhan b627201e7e iterator: Fix outdated example code and accompanying documentation
GstIterator no longer returns a refcounted gpointer
2014-12-27 10:59:31 +00:00
Stefan Sauer ef4910b9e6 debugutils: use a constant for the max param length
Improve readability by using a define for the max-chars. Also use the unicode
ellipsis as dot files are utf-8.
2014-12-21 14:15:54 +01:00
Edward Hervey d92e18b722 gstinfo: Add new maximum level debugging
API: GST_LEVEL_MAX

By compiling gstreamer (or plugins) with GST_LEVEL_MAX defined, only
the debugging statements at or below that level will be compiled in.

This allows compiling in some debugging (like errors and warnings) which
helps in debugging, but without the full cpu/memory overhead of all debugging
enabled.
2014-12-19 11:35:24 +01:00
Arun Raghavan e4d6896d0c debugutils: Truncate parameter values that are too long
This removes some information from the dumps, but improves readability.

https://bugzilla.gnome.org/show_bug.cgi?id=739165
2014-12-18 17:19:36 +05:30
Sebastian Dröge 1f6d5d3ff5 structure/caps: Add gst_{structure,caps}_filter_and_map_in_place()
https://bugzilla.gnome.org/show_bug.cgi?id=739765
2014-12-16 18:22:46 +01:00
Sebastian Dröge bc11a1b79d caps: Add gst_caps_foreach() and gst_caps_map_in_place()
https://bugzilla.gnome.org/show_bug.cgi?id=739765
2014-12-16 18:22:46 +01:00
Nicolas Dufresne a8d6653037 bufferpool: Don't check size in config validation
Pools are allowed to change the size in order to adapt padding. So
don't check the size. Normally pool will change the size without
failing set_config(), but it they endup changing the size before
the validate method may fail on a false positive.

https://bugzilla.gnome.org/show_bug.cgi?id=741420
2014-12-16 10:20:37 -05:00
Wim Taymans 6f136b5399 bufferpool: log reason for discarded buffers
PERFORMANCE log the reason why a buffer could not be recycled in the
bufferpool.
2014-12-16 12:22:56 +01:00
Stefan Sauer a35094f1b3 preset: add gst_preset_is_editable()
Add a function to check if the preset iface implementation is editable and
document this from the implementers perspective.
API: gst_preset_is_editable()
2014-12-12 21:49:16 +01:00
Sebastian Dröge 82117cae03 debugutils: Fix compiler warning
gstdebugutils.c: In function 'gst_debug_bin_to_dot_data':
gstdebugutils.c:683:530: error: 'return' with no value, in function returning non-void [-Werror]
   g_return_if_fail (GST_IS_BIN (bin));
2014-12-12 13:57:39 +01:00
Arun Raghavan 8fadde9d23 debugutils: Add a gst_debug_bin_to_dot_data() method
This provides the dot file as a string, rather than dumping to a file.

https://bugzilla.gnome.org/show_bug.cgi?id=741425
2014-12-12 17:58:49 +05:30
Sebastian Dröge 154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +01:00
Edward Hervey 53cbbcd8d9 element: Fix doc and default implementation of send_event
The documentation states that gst_element_send_event is to "send an event
to an element".

Therefore we *send* upstream events to a source pad and downstream events
to a sink pad
2014-11-28 16:25:02 +01:00
Edward Hervey 78577fd8e4 element: Figure default send_event direction handling
If we get a downstream event we want to send it to a random SINK pad
(and vice-versa).
2014-11-28 11:16:00 +01:00
Wim Taymans 5cf630697c structure: don't overread input when searching for "
When searching for the string terminator don't read past the ending
0-byte when escaping characters.
Add unit test for various escaping cases.
2014-11-20 13:37:08 +01:00
Vincent Penquerc'h d4c551a292 pad: fail dropped queries
Previously, dropping a query from a pad probe would deem the
query succeeded, and the caller might then assume the query's
results are valid, and thus dereference an invalid object
such as a GstCaps.

We now assume dropped queries did not succeed. Dropped events
and buffers are still deemed a success.

Added back after previous revert, as it's been double checked.

https://bugzilla.gnome.org/show_bug.cgi?id=740003
2014-11-12 14:05:19 +00:00
Vincent Penquerc'h 1b06822ce3 Revert "pad: fail dropped queries"
This was pushed by mistake along with an unrelated patch.

This reverts commit c7103ce4b8.
2014-11-12 13:55:23 +00:00