Commit graph

7678 commits

Author SHA1 Message Date
Vincent Penquerc'h
d6ae9c0feb segment: add gst_segment_is_equal
It beats memcmp due to the 'reserved' fields.

API: gst_segment_is_equal()

Found via, but probably not directly linked to,
https://bugzilla.gnome.org/show_bug.cgi?id=738216
2015-04-03 12:10:33 +01:00
Tim-Philipp Müller
5deb4f658e pad: allow probes to remove the data item whilst returning PROBE_OK
Use case: we want to block the source pad of a leaky queue and
drop the buffer that causes the block. If we return PROBE_DROP
then the buffer gets dropped, but we get called again. If we
return PROBE_OK we can't easily drop the buffer. If we just
replace the item into the GstPadProbeInfo structure with NULL,
GStreamer will push a NULL buffer to the next element when we
unblock the pad probe. This patch ensures it doesn't do that.

https://bugzilla.gnome.org/show_bug.cgi?id=734342
2015-04-03 00:07:26 +01:00
Olivier Crête
518babf6cb element: Document when a clock is available from gst_element_get_clock()
https://bugzilla.gnome.org/show_bug.cgi?id=744442
2015-04-02 17:33:22 -04:00
Olivier Crête
59d9992ed0 pipeline: Add binding friendly gst_pipeline_get_pipeline_clock()
Also skip gst_pipeline_get_clock() and gst_pipeline_set_clock() from the
bindings as they are confused with gst_element_*_clock().

API: gst_pipeline_get_pipeline_clock()

https://bugzilla.gnome.org/show_bug.cgi?id=744442
2015-04-02 17:33:22 -04:00
Ilya Konstantinov
82abdae1bb memory: improve docs for _copy() and _share() 2015-04-02 17:45:54 +01:00
Thibault Saunier
04d8b01e2e element: Add a FIXME for 2.0 about request_new_pad VS request_pad naming 2015-04-02 09:48:02 +02:00
Thibault Saunier
43a31d4835 element: Fix request_new_pad introspection
Marking gst_element_request_pad as the caller of the ->request_new_pad
virtual method.
2015-04-02 09:34:00 +02: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
Lubosz Sarnecki
373af462db debugutils: plot caps features
https://bugzilla.gnome.org/show_bug.cgi?id=746809
2015-03-31 20:16:39 +01:00
Wonchul Lee
ca380d16a0 pad: Fix a typo in a docstring
https://bugzilla.gnome.org/show_bug.cgi?id=747119
2015-03-31 19:28:51 +01:00
Edward Hervey
e4d07e161d introspection: Don't use g-ir-scanner cache at compile time
It pollutes user directories and we don't need to cache it

https://bugzilla.gnome.org/show_bug.cgi?id=747095
2015-03-31 11:16:09 +02:00
Tim-Philipp Müller
eb2d1f5b96 pad: fix outdated debug message
Buffer lists don't have groups any more in 1.0
2015-03-28 14:47:45 +00:00
Luis de Bethencourt
555e0211c8 gstvalue: only unwrap string delimited with "
Don't unwrap strings that start but don't finish with a double quote. If a
string is delimited by two quotes we unescape them and any special characters
in the middle (like \" or \\). If the first character or the last character
aren't a quote we assume it's part of an unescaped string.

Moved some deserialize_string unit tests because we don't try to unwrap strings
missing that second quote anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=688625
2015-03-27 17:18:23 +00:00
Luis de Bethencourt
c565c5ecb4 parse: check before truncating strings
Don't truncate the last character of a string if it isn't necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=688625
2015-03-27 17:16:07 +00:00
Sebastian Dröge
2064a07feb bus: Add guards against invalid arguments to set_flushing() and poll()
https://bugzilla.gnome.org/show_bug.cgi?id=746871
2015-03-27 10:15:45 +01:00
Michael Catanzaro
f718962467 pluginloader: Fix typos
https://bugzilla.gnome.org/show_bug.cgi?id=746585
2015-03-25 23:36:54 +00:00
Wim Taymans
bc282da83c segment: remove the bounds check from _to_running_time_full()
Do not do any checks for the start/stop in the new
gst_segment_to_running_time_full() method, we can let this be done by
the more capable gst_segment_clip() method. This allows us to remove the
enum of results and only return the sign of the calculated running-time.
We need to put the old clipping checks in the old
gst_segment_to_running_time() still because they work slightly
differently than the _clip methods.

See https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-20 09:00:47 +01:00
Wim Taymans
edf484ab6b segment: add option to disable clipping
Add a clip argument to gst_segment_to_running_time_full() to disable
the checks against the segment boundaries. This makes it possible to
generate an extrapolated running-time for timestamps outside of the
segment.

See https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-19 17:36:36 +01:00
Tim-Philipp Müller
1734915850 gst: ref/unref new enum type in gst_init/deinit() 2015-03-18 16:27:36 +00:00
Wim Taymans
8c8b3818e4 segment: add helper to get negative running-time
Add a helper method to get a running-time with a little more features
such as detecting if the value was before or after the segment and
negative running-time.

API: gst_segment_to_running_time_full()

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-18 11:35:42 +01:00
Wim Taymans
6e67ad7675 segment: fix offset handling with non 0 start
The position in the segment is relative to the start but the offset
isn't, so subtract the start from the position when setting the offset.
Add unit test for this as well.
2015-03-18 11:35:42 +01:00
Sebastian Dröge
c19809ef19 pluginloader: Fix indention 2015-03-17 15:41:38 +01:00
Ramiro Polla
5253a4d879 element: properly escape percent sign in documentation 2015-03-14 14:19:47 +00:00
Sebastian Dröge
21da311743 buffer: Use the correct enum type to fix a compiler warning
gstbuffer.c:522:58: error: implicit conversion from enumeration type 'GstBufferFlags' to
      different enumeration type 'GstBufferCopyFlags' [-Werror,-Wenum-conversion]
  if (!gst_buffer_copy_into (copy, (GstBuffer *) buffer, flags, 0, -1))
       ~~~~~~~~~~~~~~~~~~~~                              ^~~~~
gstbuffer.c:534:46: error: implicit conversion from enumeration type 'GstBufferCopyFlags' to
      different enumeration type 'GstBufferFlags' [-Werror,-Wenum-conversion]
  return gst_buffer_copy_with_flags (buffer, GST_BUFFER_COPY_ALL);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~          ^~~~~~~~~~~~~~~~~~~
./gstbuffer.h:433:31: note: expanded from macro 'GST_BUFFER_COPY_ALL'
  ...((GstBufferCopyFlags)(GST_BUFFER_COPY_METADATA | GST_BUFFER_COPY_MEMORY))
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2015-03-14 13:37:09 +00:00
Nicolas Dufresne
7f6b11a5b2 allocation: Allow allocation pool without size
This allow proposing a number of buffers required even if the size
of buffer is unfixed. This is often the case for encoded formats.
2015-03-14 12:00:53 +00:00
Nicolas Dufresne
c740bad1a0 bufferpool: Don't stop the pool in set_config()
Don't stop the pool in set_config(). Instead, let the controlling
element manage it. Most of the time, when an active pool is being
configured is because the caps didn't change.

https://bugzilla.gnome.org/show_bug.cgi?id=745377
2015-03-14 12:00:53 +00:00
Thiago Santos
96eaeadc0f gstbuffer: add gst_buffer_copy_deep
A variant of gst_buffer_copy that forces the underlying memory
to be copied.

This is added to avoid adding an extra reference to a GstMemory
that might belong to a bufferpool that is trying to be drained.
The use case is when the buffer copying is done to release the
old buffer and all its resources.

https://bugzilla.gnome.org/show_bug.cgi?id=745287
2015-03-13 18:37:04 +00:00
Sebastian Dröge
d8f572647f bus: Use g_list_free_full() instead of manually unreffing and freeing
Also unref the messages, not the GList nodes.
2015-03-13 15:31:30 +00:00
Sebastian Dröge
f50d809c25 bus: Fix another case where we hold the object lock while unreffing a message 2015-03-13 13:42:46 +00:00
Vivia Nikolaidou
721539dc4f bus: Unreferencing messages outside the lock
Shouldn't take the lock while unreferencing messages, because that may cause
more messages to be sent, which will try to take the lock and cause the app to
hang.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728777
2015-03-13 13:37:49 +00:00
Vivia Nikolaidou
6ec3c4bc66 utils: Add gst_bin_sync_children_states()
gst_bin_sync_children_states() will iterate over all the elements of a bin and
sync their states with the state of the bin. This is useful when adding many
elements to a bin and would otherwise have to call
gst_element_sync_state_with_parent() on each and every one of them.

https://bugzilla.gnome.org/show_bug.cgi?id=745042
2015-03-13 12:50:48 +00:00
Aurélien Zanelli
3da3e8df3e printf: handle unsigned modifier for long long
Otherwise, an unsigned integer will be displayed as a signed one if we
use internal print, ie HAVE_LONG_LONG_FORMAT is not defined.

https://bugzilla.gnome.org/show_bug.cgi?id=746096
2015-03-12 15:23:20 +00:00
Matej Knopp
b7f958abad printf: add support for %I32
https://bugzilla.gnome.org/show_bug.cgi?id=744281
2015-03-12 13:29:00 +00:00
Tim-Philipp Müller
2d92f5e6d8 info: move category level threshold check into log function dispatcher
Minor optimisation: check category log level earlier in the
log function dispatcher and not only in the default log
function.

https://bugzilla.gnome.org/show_bug.cgi?id=745213
2015-03-12 13:16:22 +00:00
Tim-Philipp Müller
bd7d1c8b61 Fix double semicolons 2015-03-10 09:24:28 +00:00
Tim-Philipp Müller
4e777233f5 info: avoid malloc/free if log object is NULL 2015-03-05 18:30:45 +00:00
Tim-Philipp Müller
5764316a8e info: move __FILE__ path shortening into default log handler
Instead of always shortening the __FILE__ path, even if the
log message is not actually printed, which might happen if
the log level is activated but the category is not, only
shorten the path if we're actually going to output it and
if it looks like it needs shortening. Log handlers had no
guarantee that they would get a name instead of a path
anyway on any architecture, so it shouldn't be a problem.

https://bugzilla.gnome.org/show_bug.cgi?id=745213
2015-03-05 17:57:58 +00:00
Peter Urbanec
6cbe86dc58 info: shorten __FILE__ on all platforms
This is useful not only for MSVC, but also with gcc/Linux
when doing cross-compilation builds and out-of-tree builds.

https://bugzilla.gnome.org/show_bug.cgi?id=745213
2015-03-05 17:53:16 +00:00
Tim-Philipp Müller
a988871074 utils: improve warning when linking elements without common ancestor
This comes up quite a lot and it's a common mistake, so let's
try to improve the warning message a little.
2015-03-02 20:31:58 +00:00
Arun Raghavan
be36d34aee pad: Don't fail latency query on unlinked pads
A single unlinked pad can make the latency query fail across the
pipeline, which is probably not desirable. Instead, we return a default
anything goes value.

Perhaps we should also be emitting a gst_message_new_latency() when a
PLAYING element has one of its pads linked.

https://bugzilla.gnome.org/show_bug.cgi?id=745197
2015-02-26 15:57:26 +05:30
Edward Hervey
075def0f97 gstvalue: Make sure GST_FOURCC_ARGS produces printable characters
Some systems will crash if we use non-printable characters in print/debug
statements.

Make sure that GST_FOURCC_ARGS never does that

https://bugzilla.gnome.org/show_bug.cgi?id=745144
2015-02-26 07:49:05 +01:00
Luis de Bethencourt
4245658d28 gstutils: remove incorrect Fixme comment
If the checks were changed to using g_return_if_fail() the GST_DEBUG lines
about the specific failure would be lost.
2015-02-25 16:11:06 +00:00
Luis de Bethencourt
5f027ae453 gstutils: remove obsolete Fixme comment
gst_pad_link_filtered() is very long gone and current
gst_element_link_pads_filtered() doesn't apply to this Fixme comment.
2015-02-25 16:02:39 +00:00
Luis de Bethencourt
bcce3fbcb8 GstDeviceMonitor: keep alphabetical order 2015-02-23 12:24:16 +00:00
Olivier Crête
f9baff11c8 Revert "element: set pads need-parent flag to false when removing"
This reverts commit 1911554cff.

This breaks the functionality of GST_PAD_FLAG_NEED_PARENT, the reason for this
flag is that if a pad is removed from a running element, you don't want
functions (such as chain or event) to be called on the pad without a parent set.
This can happen if you remove a request or sometimes pad from a running element.

I don't see the code that caused this in tsdemux, but if it needs to unset
the flag on remove, it should do it itself and then make sure that the parent
exists in any pad function.
2015-02-20 16:22:23 -05:00
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