Commit graph

922 commits

Author SHA1 Message Date
Tim-Philipp Müller
84a92464cf baseparse: init frames on the stack with gst_base_parse_frame_init()
Frames must now be inited this way, can't just zero them
out and use them.
2011-04-15 18:52:18 +01:00
Tim-Philipp Müller
127df9a586 baseparse: more debug logging, minor clean-up
Trace frames, split out code to queue a frame for later.
2011-04-15 18:38:46 +01:00
Tim-Philipp Müller
8fe1924678 baseparse: change gst_base_parse_frame_init() to not take a GstBaseParse argument 2011-04-15 18:00:21 +01:00
Tim-Philipp Müller
e8ccbf4ca9 baseparse: make GstBaseParseFrame handling more bindings-friendly
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()
2011-04-15 17:50:46 +01:00
Tim-Philipp Müller
37d7857e18 baseparse: register boxed type for GstBaseFrameParse
To make this usable for bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=518857
2011-04-15 17:47:22 +01:00
Robert Swain
223a1f62be baseparse: Remove unused but set variable
GCC 4.6.0 spits warnings about these.
2011-04-15 10:53:56 +02:00
Ole André Vadla Ravnås
e7bf5484c7 base: Fix pad callbacks so they handle when parent goes away
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.
2011-04-13 17:39:05 +02:00
Alessandro Decina
3f1ef2255a android: make it ready for androgenizer
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
2011-04-11 01:08:07 +02:00
Tim-Philipp Müller
d353ddf38e docs: minor fixes for baseparse docs
Class vfunc references still aren't right, no idea what
the correct markup for those is.
2011-04-09 23:02:50 +01:00
Tim-Philipp Müller
2401fe36fd baseparse: minor variable name clean-up 2011-04-08 19:07:02 +01:00
Tim-Philipp Müller
9d98c62f0e baseparse: rename _set_frame_props() to _set_frame_rate()
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
2011-04-08 15:44:58 +01:00
Tim-Philipp Müller
5073948380 baseparse: replace format flags with gst_base_parse_set_{passthrough,syncable,has_timing_info}
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
2011-04-08 15:44:58 +01:00
Tim-Philipp Müller
1874d63808 baseparse: make DRAIN and SYNC flags on baseparse, not the frame, and change to DRAINING and LOST_SYNC
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
2011-04-08 15:44:58 +01:00
Tim-Philipp Müller
242e077e46 baseparse: add some padding to GstBaseParseFrame
Esp. since it's usually allocated on the stack.

https://bugzilla.gnome.org/show_bug.cgi?id=518857
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
99014adcae baseparse: fix typo in docs for GST_BASE_PARSE_FORMAT_FLAG_PASSTHROUGH
https://bugzilla.gnome.org/show_bug.cgi?id=518857
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
251dfa402c baseparse: use GQueue instead of GList for queued frames
and make buffer metadata writable before setting caps on queued
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=646341
2011-04-08 15:44:57 +01:00
Zaheer Abbas Merali
783dbb9a71 baseparse: add GST_BASE_PARSE_FLOW_QUEUED to queue buffers until caps are known
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
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
22b7dfc800 baseparse: add to docs and fix up gtk-doc markup a little
And add Since markers.
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
4709a26473 baseparse: replace set_seek() with _set_average_bitrate() and FLAG_SYNCABLE
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
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
de16d5adb3 baseparse: rename GstBaseFormat to GstBaseFormatFlags and fix up associated API
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.
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
f691be223e baseparse: don't expose GstAdapter in public header
None of the existing subclasses needs access to that, so there's
no reason to expose it for now.

https://bugzilla.gnome.org/show_bug.cgi?id=518857
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
e2bf3647f8 baseparse: move various segment-related members into the private instance struct
If none of the existing subclasses uses these, there's probably no
need to expose them at the moment. Keep the segment itself exposed
though.

https://bugzilla.gnome.org/show_bug.cgi?id=518857
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
b2a76895af baseparse: remove unused GST_BASE_PARSE_{SINK,SRC}_NAME
https://bugzilla.gnome.org/show_bug.cgi?id=518857
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
9f1b9f1419 baseparse: re-indent header 2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
c88a143cb6 baseparse: fix up GType name and make _get_type() function thread-safe
Rename GType from GstBaseParseBad to GstBaseParse.
2011-04-08 15:44:57 +01:00
Tim-Philipp Müller
20f29628aa libs: add GstBaseParse which was moved from -bad 2011-04-08 15:44:57 +01:00
David Schleef
d6847fd4a1 baseparse: make_metadata_writable() fix 2011-04-08 15:44:56 +01:00
Tim-Philipp Müller
940a47ae09 baseparse: rename GType from GstAudioBaseParseBad to GstBaseParseBad
We use it for video as well now.
2011-04-08 15:44:56 +01:00
Stefan Kost
0774878e92 baseparse: trim trailing whitespace 2011-04-08 15:44:56 +01:00
Stefan Kost
e8f04e76b7 baseparse: use delta-unit flags instead of none 2011-04-08 15:44:56 +01:00
David Schleef
35a7228ed5 baseparse: update documentation for API changes 2011-04-08 15:44:56 +01:00
David Schleef
e57cb6b47a baseparse: Create baseparse library 2011-04-08 15:44:56 +01:00
Havard Graff
3d833e42b6 basesrc: Make src query MT-safe
It is possible that the element might be going down while the event arrives
2011-04-08 14:58:41 +02:00
Sebastian Dröge
237e54d4fe base: Unref events if the parent element disappeared
And also unref events if the basetransform subclass has no
event handler and the event is not forwarded at all.
2011-04-08 14:57:05 +02:00
Havard Graff
0daedb7409 base: Make upstream events MT-safe 2011-04-08 14:57:00 +02:00
Sebastian Dröge
7945821f92 basesrc: Handle tag and custom downstream events the same
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...
2011-04-07 10:48:04 +02:00
Sebastian Dröge
c7c3e46b08 bla 2011-04-07 10:40:16 +02:00
Sebastian Dröge
1d9cd86af6 basesrc: Send syncronized custom downstream/both events downstream from the streaming thread
Instead of just silently dropping them. The same was done for tag events
before already.

Fixes bug #635718.
2011-04-07 10:29:41 +02:00
Arun Raghavan
bae67f116c basesrc: Return FALSE if we don't handle an event
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)
2011-03-28 21:48:23 +05:30
Stefan Kost
02eda0e3d9 docs: cleanup and xref fixes
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.
2011-03-24 18:32:20 +02:00
Stefan Kost
71dcd52cc0 basesink: print flow return as a name in debug log 2011-03-24 18:32:20 +02:00
Edward Hervey
d979eb3e9e basesrc: Keep downstream caps order when fixating
This allows use to use the first intersecting format prefered by downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=617045
2011-03-24 12:30:42 -03:00
Edward Hervey
0f0a62f316 basetransform: Retain caps order when getting caps
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
2011-03-24 11:47:32 -03:00
Tim-Philipp Müller
5300a5e73b bytereader, bytewriter: fix up inline functions to make g++ happy
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
2011-03-23 20:52:44 +00:00
Thiago Santos
83597767b1 basetransform: Be smarter with pad allocs
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
2011-02-21 10:31:22 -03:00
Thiago Santos
3aaef921c5 basetransform: Check for pad alloc caps when suggestion is not fixed
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
2011-02-14 15:59:25 +01:00
Wim Taymans
f8828eace6 basesink: improve duration calculation
Keep track of the average distance between incomming timestamps and
use that to estimate the frame duration when buffers have no duration set on
them.
2011-02-14 15:17:45 +01:00
Wim Taymans
79665e8247 basesink: improve rate calculation
When there is no duration on input buffers, assume the rate is 1.0
instead of (the undefined) 0.0.
2011-02-14 15:17:44 +01:00
Wim Taymans
9661a713ba basesink: improve average duration calculation
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.
2011-02-14 15:17:44 +01:00
Wim Taymans
dc0120fe28 basesink: rename variable
Rename an internal variable to better reflact what its value means.
2011-02-14 15:17:44 +01:00