Make a new method to allocate a buffer + memory that takes the allocator and the
alignment as parameters. Provide a macro for the old method but prefer to use
the new method to encourage plugins to negotiate the allocator properly.
Add a new fill virtual method to basesrc. The purpose of this method is to fill
a provided buffer with data.
Add a default implementation of the create method that allocates a buffer and
calls the fill method on it. This would allow the base class to implement
bufferpool and allocator negotiation on behalf of the subclasses.
Fix the blocksize property.
Make filesrc use the new fill method.
Add a boolean to the flush_stop event to make it possible to implement flushes
that don't reset_time.
Make basesink post async_done with the reset_time property from the flush stop
event.
Fix some unit tests
This allows subclass to indicate that size reported by src may not be static
and should as such be updated regularly, rather than only when really
needed.
Particular examples are filesrc or fdsrc reading from a file that is still
growing (e.g. being downloaded).
Fixes#652037.
This reverts commit 934faf163c.
Original commit leads to possibly sending newsegment event downstream
in pull mode. In push mode, quite some downstream elements
are likely to only expect newsegment event following a seek they performed
and as such may have their state messed up.
Move the flag to indicate that a new_base_time should be distributed to the
pipeline, from the async_start to the async_done message. This would allow us to
decide when to reset the pipeline time based on other reasons than the
FLUSH_START event.
The main goal eventually is to make the FLUSH events not reset time at all but
reset the time based on the first buffer or segment that prerolls the pipeline
again.
Instead of passing it structure by structure. This allows
better optimized transform_caps functions and allows better
transformation decisions.
See bug #619844.
Don't error out when the allocation query returns success.
Do bufferpool query after we pushed the caps event downstream so that we can get
a good bufferpool suggestion.
Also proxy the bufferpool query downstream when we operate in in_place mode.
Avoid installing a setcaps function on the srcpad and calling the setcaps
function, we can do more efficiently with sending the event ourself and calling
our vmethod.
While some formats allow subclass to determine a specific subsequent
needed frame size, others may to need to scan for markers and can only
request 'additional data' by whatever reasonable available step.
In push mode, trying to minimize additional latency leads to step size
being the next input buffer. In pull mode, any reasonable step size
(such as already used by buffer caching) can be applied.
This reverts commit cf4fbc005c.
This change did not improve the situation for bindings because
queries are usually created, then directly passed to a function
and not stored elsewhere, and the writability problem with
miniobjects usually happens with buffers or caps instead.
Improve GstSegment, rename some fields. The idea is to have the GstSegment
structure represent the timing structure of the buffers as they are generated by
the source or demuxer element.
gst_segment_set_seek() -> gst_segment_do_seek()
Rename the NEWSEGMENT event to SEGMENT.
Make parsing of the SEGMENT event into a GstSegment structure.
Pass a GstSegment structure when making a new SEGMENT event. This allows us to
pass the timing info directly to the next element. No accumulation is needed in
the receiving element, all the info is inside the element.
Remove gst_segment_set_newsegment(): This function as used to accumulate
segments received from upstream, which is now not needed anymore because the
segment event contains the complete timing information.
Doing so avoids a large timestamp gap between first and second buffer
for live sources which take time to start up.
The first buffer now has a "live" timestamp based on the running time,
as other buffers do.
https://bugzilla.gnome.org/show_bug.cgi?id=649369
Hide the GstStructure of the event in the implementation specific part so that
we can change it.
Add methods to check and make the event writable.
Add a new method to get a writable GstStructure of the element.
Avoid directly accising the event structure.
Use the caps event to configure basetransform.
Remove force_alloc hack, we don't need this in 0.11 with new upstream
negotiation.
Avoid getting some pad caps.
This reverts commit 9ef1346b1f.
Way to much for one commit and I'm not sure we want to get rid of the pad caps
just like that. It's nice to have the buffer and its type in onw nice bundle
without having to drag the complete context with it.
Remove pad_alloc and all references. This can now be done more efficiently and
more flexible with the ALLOCATION query and the bufferpool objects. There is no
reverse negotiation yet but that will be done with an event later.
Protect index with its own lock. gst_index_get_writer_id() may take
the object lock internally (the default resolver, GST_INDEX_RESOLVER_PATH,
will anyway), so if we're using that to protect the index as well,
we'll deadlock.
https://bugzilla.gnome.org/show_bug.cgi?id=646811
Change semantics of gst_base_parse_push_frame() and make it take
ownership of the whole frame, not just the frame contents. This
is more in line with how gst_pad_push() etc. work. Just transfering
the content, but not the container of something that's not really
known to be a container is hard to annotate properly and probably
won't work. We mark frames allocated on the stack now with a private
flag in gst_base_parse_frame_init(), so gst_base_parse_frame_free()
only frees the contents in that case but not the frame struct itself.
https://bugzilla.gnome.org/show_bug.cgi?id=518857
API: gst_base_parse_frame_new()
1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.
This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
Remove the android/ top dir
Fixe the Makefile.am to be androgenized
To build gstreamer for android we are now using androgenizer which generates the needed Android.mk files.
Androgenizer can be found here: http://git.collabora.co.uk/?p=user/derek/androgenizer.git
Seems like the best fit to what it does, and is shorter than
set_frame_properties() which might also have been confusing
because of GstBaseParseFrame.
https://bugzilla.gnome.org/show_bug.cgi?id=518857
This is more in line with e.g. GstBaseTransform's API, and makes for nicer
to read code. No getters for now since I don't see any use case for them,
the API is for subclasses, which usually know what format they're
dealing with already and hence know what they've set.
https://bugzilla.gnome.org/show_bug.cgi?id=518857
The first because it seems a better fit conceptually, the second
to express booleanness. Also change the accessor macros for subclasses
to GST_BASE_PARSE_DRAINING and GST_BASE_PARSE_LOST_SYNC.
https://bugzilla.gnome.org/show_bug.cgi?id=518857
This is useful for parser like flacparse or h264parse which may need to process
some buffers before they can construct the final caps, in which case they may
want to delay pushing the initial buffers until the full and proper caps are
known.
https://bugzilla.gnome.org/show_bug.cgi?id=646341
This makes more sense conceptually, since the bitrate may be used
to estimate a seek position if there's no seek table or just for
duration reporting/estimation if we can't seek. Also, even if the
format is not syncable, we could still seek by pushing data from the
start and using the segment to make downstream clip.
https://bugzilla.gnome.org/show_bug.cgi?id=518857
Also change gst_base_parse_set_format(parse,flags,switch_on) to
gst_base_parse_set_format_flags(parse,flags) which is more in line
with the rest of our API and how the function is used.
Especially drop tag events when flushing to not send them over
and over again.
Should've been in the last commit already but I forgot to call
git rebase --continue...
basesrc's default event handler returns TRUE regardless of whether the
event is handled or not. This fixes the handler to conform with the
expected behaviour (which is to only return TRUE when the event has
actually benn handled). gst_bin_do_latency_func() depended on this
(incorrect) behaviour, and is now modified as well.
(Remaining 1-liner change in gstbasesrc.c is to keep gst-indent happy)
Deal with the hints from gtk-doc and fix the xrefs. Apply a work-around for ()
precedence over @. Move "MT Safe" text to doc body in many places. Trim eol
whitespaces.
If the element gave us caps in a specific order, let's retain that
by intersecting against the template but retaining the order given
by the element.
https://bugzilla.gnome.org/show_bug.cgi?id=617045
gstbytereader.h: In function ‘guint8* gst_byte_reader_dup_data_unchecked(GstByteReader*, guint)’:
gstbytereader.h:249:75: error: invalid conversion from ‘void*’ to ‘guint8*’
gstbytewriter.h: In function ‘gboolean _gst_byte_writer_ensure_free_space_inline(GstByteWriter*, guint)’:
gstbytewriter.h:196:75: error: invalid conversion from ‘void*’ to ‘guint8*’
https://bugzilla.gnome.org/show_bug.cgi?id=645595
Avoid doing unnecessary pad-allocs when on passthrough mode.
If multiple basetransform elements are on a pipeline, they
would do a pad-alloc for each received buffer, each element
would do this, so we would have lots of pad allocs on the
pipeline for a single buffer being pushed through it.
This patch attempts to reduce this amount by avoiding
doing pad-allocs if the element has already done it
after the last pushed buffer. So it will only be allowed
to do a new pad-alloc after it has pushed a buffer, so we get
1x1 pad-alloc and buffer ratio
https://bugzilla.gnome.org/show_bug.cgi?id=642373
If after computing the suggestion with downstream caps we still have
a non-fixed suggestion caps try to intersect with the input caps
of the pad alloc to avoid useless renegotiations.
https://bugzilla.gnome.org/show_bug.cgi?id=642130
Improve the calculation of the duration. When we have no input duration set on
the input buffers stop is set to start and then we end up using a 0 duration in
the average calculation.
Keep track of the earliest allowed timestamp according to the latest
QoS report and drop buffers before that time. Activate this filter
when throttling is enabled. We could later also activate this in the
other QoS cases.
See #638891
Apply fix from libgstbase to all core libs now that we know that it
works. Should fix problems with g-ir-scanner using the wrong
(ie. system) libgstreamer, leading to linking errors such as
undefined reference to `gst_clock_single_shot_id_reinit'.
https://bugzilla.gnome.org/show_bug.cgi?id=637549
Previously it was - probably due to copy/paste error - looking for
gstbase headers.
It's changed now to only include the one public header for gstnet.h
Only go into LIVE_WAIT when the are not live_running and only stop waiting when
live_running is TRUE. If we don't loop, we could deadlock when called from
outside of basesrc, such as baseaudiosrc.
Fixes#635785
This can happen for example when downstream proposed new caps, later proposed
the previous caps again which in turn enables passthrough mode in upstream
elements and the wrong-sized buffer appears in an element where the caps
change never happened. Simply allocate a new buffer in this case.
See bug #635461.
Only update the last_stop value when we had a valid stop position for the
clipping or else the clipping code assumes the stop position extends to the end
of the segment, which makes the position reporting return weird values.