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.
Useful for video parses that want to attach matter or
find out if downstream supports certain metas.
API: GstBaseParseClass::src_query()
API: GstBaseParseClass::sink_query()
https://bugzilla.gnome.org/show_bug.cgi?id=691475
Add a max-bitrate property that will slightly delay rendering of buffers if it
would exceed the maximum defined bitrate. This can be used to do
rate control on network sinks, for example.
API: GstBaseSink::max-bitrate
API: gst_base_sink_set_max_bitrate()
API: gst_base_sink_get_max_bitrate()
Large streams would index one frame every second, which can get quite
large with multi-hour streams, so add an additional byte-based
minimum distance as well, which will kick in for long streams
and make sure we never have more than a couple of thousand index
entries.
https://bugzilla.gnome.org/show_bug.cgi?id=666053
Using multiple libraries causes problems for the C# bindings and
will for similiar languages such as Java when there are bindings
for them.
Also change --library=libgstfoo-X.la to --library=gstfoo-X as
the man page suggests it should be done.
https://bugzilla.gnome.org/show_bug.cgi?id=679315
Use a new GCond, protected with the object lock, to signal completion
of the async state change. We can't reuse the live lock because that
one can be locked when the create function blocks.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686723
gst_base_src_start_complete() can fail when the thread could not be
started, for example. Make sure it causes the state change to fail by
retrieving the result from _start_complete().
Basetransform attempts to do passthrough mode regardless of the order of
the transform_caps method. Add a method to disable this.
This is needed for elements like capsfilter that want to transform caps
based on the order of the caps property.
The 3rd parameter of gst_base_src_new_seamless_segment in
0.10 is the time associated with the start of the new segment,
not the position in the new segment. Fix the name of the parameter,
the docs, and the implementation to match the needs of the only
extant consumer: DVD playback.
It's not right, and we don't know what extra properties
that event might have set in future (e.g. sparseness).
This change means collectpad users need to create their
own stream-start event now. We could add a utility
function that creates a stream-start event based on
the input stream-start events.
Hacky, because the still-frame code all lives in -base, where we
can't use it - so this is a hacky duplication of -base code. Not
sure which way to fix this: Move baseparse to -base, or move still-frame
events to core?
Make the event handling more like what videodecoder does,
to ensure that all events are passed to child classes before being
placed on the pending queue or pushed onward.
We only deal in TIME format ourselves, but if the subclass can handle
converting other formats into TIME format, we can support that too.
Fixes seeking in DEFAULT (sample) format with flacparse,
and the flacdec unit test.
Sometimes a transform filter would need the buffer pool or the memory
allocator negotiated by the base class, for example, for querying different
parameters, such as a bigger number of buffers to allocate by the buffer pool.
This patch expose a two getters accessors: one for the buffer pool and the
other for the memory allocator.
Sometimes the sources would use the buffer pool or the memory allocator for
something else than just allocating output buffers; for example, querying for
different parameters, such as a bigger number of buffers to allocate by the
pool.
This patch expose a two getters accessors: one for the buffer pool and the
other for the memory allocator.
Don't just return FALSE for seek events with negative rates when
operating in push mode. An upstream demuxer may support this just
fine, so if we're not operating in pull mode always check upstream
first if it can handle the seek event. This fixes reverse playback
where the upstream demuxer supports it (e.g. with qtdemux). The
same code would work fine in 0.10, because baseparse will just
call the default pad event handler if FALSE was returned from the
baseparse event handler, and the pad event handler will just
forward it upstream. In 0.11 the baseclass or subclass is
responsible for chaining up to the parent class or forwarding the
event upstream in any case.
Disable reverse playback in pull mode for now, there seems to
be something going wrong with the segment configuration in that
case.
No need to use a custom main context and custom timeout sources,
just use g_socket_condition_timed_wait() instead, which was added
for exactly this case.
Also seems to help with the unit test deadlocking with glib 2.33.x
https://bugzilla.gnome.org/show_bug.cgi?id=681575
The fail() definition was changed to not fail with non-GCC compilers,
unfortunately the change was incorrect and appended the first argument
of fail to the expression string instead of making it the message.
This change does mean that fail() now requires a message to be passed
along.
https://bugzilla.gnome.org/show_bug.cgi?id=680755
This specifies if a given taglist applies to the complete
medium or only this specific stream. By default a taglist
has a stream scope.
Fixes bug #677619.
Define a 0 and -1 step amount. They used to almost do the same thing but now, 0
cancels/stops the current step and -1 keeps on stepping until the end of the
segment.
See https://bugzilla.gnome.org/show_bug.cgi?id=679378
Move code that checks for upstream seekability and all that to
the right place, otherwise it will never be done for formats
that have headers such as FLAC, as handle_and_push frame will
be called the first time only after headers have been processed
(and framecount is > 0). This then makes us report that we
can't seek, which disables the seek bar in totem.
when we have a new step event with a -1 amount, make sure that we follow the
regular code path so that the stop_end handler is called as usual. This takes
care of flushing the buffer in case of a flushing step and also posts a step end
message.
See https://bugzilla.gnome.org/show_bug.cgi?id=679378
In 0.11 the caller may provide a buffer to be filled by the source to
pull_range/get_range/create, but it's easy to miss this new case when
porting code from 0.10. Provide fallback that copies the created data
into the provided buffer for now.
This makes oggdemux in pull-mode work with dataurisrc.
Make gst_query_add_allocation_meta() take a copy of the passed caps instead of
taking ownership. This makes it easier for the caller in most cases because it
doesn't have to make a copy and deal with NULL values.
Make GstAllocator a GstObject instead of a GstMiniObject, like bufferpool.
Make a new gstallocator.c file. Make a GstAllocator subclass for the default
allocator.
Make it possible to add API specific flags to the ALLOCATION query. This makes
it possible to also check what kinds of subfeatures of the metadata API are
supported.
This is a queue which has the same API as GQueue, except that:
* It uses an array, instead of a doubled-linked-list
* The array can only grow.
This code is not-threadsafe. It is up to the owner to make sure the
proper locking is taken before calling this API.