Calling gst_buffer_get_size represented 2/3 of the cost of helper_find_peek
which was called whenever a typefindfunction wanted to peek at data.
We already know the size (from the GstMapInfo), so just use that.
Pass the fixed caps we're asked to accept as a filter for the caps
query, so we don't get a fully-expanded set of caps back (which we don't
need and can take a lot of time for intersection).
This reduces the time for camerabin to produce a second frame on a
logitech C910 camera from around 52 seconds to a bit less then 16
seconds on my system.
https://bugzilla.gnome.org/show_bug.cgi?id=702632
When we asynchronously go from READY to PLAYING, also call the
state change function so that subclasses can update their state for PLAYING.
Because the PREROLL lock is not recursive, we can't make this without
races and we must assume for now that the subclass can handle concurrent calls
to PAUSED->PLAYING and PLAYING->PAUSED. We can make this assumption because not
many elements actually do something in those state changes and the ones that
did would be broken even more without this change.
https://bugzilla.gnome.org/show_bug.cgi?id=702282
Doing it after every single create() is not very efficient and not necessary.
Especially on network file systems fstat() is not cached and causes network
traffic, making the source possibly unusable slow.
https://bugzilla.gnome.org/show_bug.cgi?id=652037
This makes sure that at least one buffer per second is rendered if buffers
are dropped before ::prepare. Without this change, at least one buffer per
second wouldn't be too late before ::prepare anymore but would be dropped
before ::render because of last_render_time being set before ::prepare
already.
This function works just like gst_data_queue_pop, but it doesn't
remove the object from the queue.
Useful when inspecting multiple GstDataQueues to decide from which
to pop the element from.
Add: gst_data_queue_peek
Importantly, this patch converts DTS to running time. Less importantly,
and possibly a problem for some muxers, is that it orders buffers by
DTS (if it is valid, otherwise PTS). This is generally correct, but
might be somewhat surprising to muxers.
Also note that once converted to running time, DTS can end up negative.
gst_pad_get_current_caps() on the source pad might yield NULL caps
if we're being shut down and the source pad has already been
deactivated by the other thread that's changing state. Just bail
out in that case, instead of passing NULL caps to the transform_size
function, which it might not expect.
Fixes spurious warnings in audioresample shutdown unit test.
https://bugzilla.gnome.org/show_bug.cgi?id=693996
... and tracking of DTS. Fixes cases where PTS is locked on to the
DTS of an incoming buffer with no PTS with invalid data, leading to
no outgoing PTS (since it is not allowed smaller than DTS).
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=691481
Use GSIZE_TO_POINTER instead. sizeof(GType) may be larger
than sizeof(gulong) and sizeof(int), so the casts may
chop off some bits from the GType value on some architectures.
Don't retry to negotiate when we fail to negotiate but instead produce a
NOT_NEGOTIATED error. We only want to retry negotiation if the result from
gst_pad_push() returned NOT_NEGOTIATED.
When negotiation fails, mark the pad as needing a reconfigure again so
that it gets picked up again next time.
Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=691986
The _1_0 suffixed environment variables override the
non-suffixed ones, so if we're in an environment that
sets the _1_0 suffixed ones, such as jhbuild, we need
to set those to make sure ours actually always get
used.