Commit graph

5460 commits

Author SHA1 Message Date
Arun Raghavan eb73b3e933 baseparse: Don't emit bitrate tags too early
We wait to parse a minimum number of frames (10, arbitrarily) before
emiting bitrate tags so that our early estimates are not wildly
inaccurate for streams that start with a silence. If the stream ends
before that, we just emit the tags anyway.

While it _would_ be nicer to be specify the threshold to start pushing
the tags in terms of duration, this would introduce more complexity than
this merits.

https://bugzilla.gnome.org/show_bug.cgi?id=614991
2011-04-08 15:44:49 +01:00
Sebastian Dröge a6b20b62bd baseparse: Set the last stop to the buffer starttime if the duration is invalid
...instead of not setting it at all.
2011-04-08 15:44:49 +01:00
Joshua M. Doe e85f8c8ab6 baseparse: Send NEWSEGMENT event with correct start and position
Instead of taking the last stop (which could be buffer endtime instead
of starttime) always take the buffer starttime.

Fixes bug #614016.
2011-04-08 15:44:49 +01:00
Tim-Philipp Müller b0b9163125 audioparsers: remove unused GstBaseParseClassPrivate structure 2011-04-08 15:44:49 +01:00
Arun Raghavan 102ee0cf41 audioparsers: Add bitrate calculation to baseparse
This makes baseparse keep a running average of the stream bitrate, as
well as the minimum and maximum bitrates. Subclasses can override a
vfunc to make sure that per-frame overhead from the container is not
accounted for in the bitrate calculation.

We take care not to override the bitrate, minimum-bitrate, and
maximum-bitrate tags if they have been posted upstream. We also
rate-limit the emission of bitrate so that it is only triggered by a
change of >10 kbps.
2011-04-08 15:44:49 +01:00
Mark Nauwelaerts 8a2141f001 audioparsers: rename baseparse GType name to avoid possible conflicts 2011-04-08 15:44:49 +01:00
Mark Nauwelaerts cbc6dcc04b audioparsers: documentation fixes 2011-04-08 15:44:49 +01:00
Mark Nauwelaerts d249e34fb4 baseparse: adjust seek handling and newsegment sending
Perform sanity check on type of seek, and only perform one that is
appropriately supported.  Adjust downstream newsegment event
to first buffer timestamp that is sent downstream.
2011-04-08 15:44:48 +01:00
Mark Nauwelaerts 192aa0d41f baseparse: minor refactor cleanup
Also add some debug logging.
2011-04-08 15:44:48 +01:00
Mark Nauwelaerts abadf63413 baseparse: implement leftover draining in pull mode 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts b67b86fcdb baseparse: provide default conversion using bps if no fps available
Also store estimated duration as such, rather than pretending otherwise
(e.g. set by subclass).
2011-04-08 15:44:48 +01:00
Mark Nauwelaerts d0ea041a38 baseparse: check for remaining data when draining in push mode 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts 497105ca1b baseparse: fix pull mode cache size comparison 2011-04-08 15:44:48 +01:00
Michael Smith ab3bf9fd95 audioparse: fix a format string as reported on irc. 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts 0f85a2b685 baseparse: custom bufferflag indicates not to count frame in stats 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts f3d49be227 audioparsers: reference GstBaseParse now lives here 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts 3a4e980038 audioparsers: rename 'aacparse' plugin to generic 'audioparsers' plugin 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts 1dd6b12316 baseparse: reset passthrough mode to default (disabled) on activation 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts a9de98830a baseparse: ensure buffer metadata is writable 2011-04-08 15:44:48 +01:00
Mark Nauwelaerts 1bc8301c79 baseparse: fix/enhance DISCONT marking
In particular, consider DISCONT == !sync, and allow subclass to query
sync state, as it may want to perform additional checks depending
on whether sync was achieved earlier on.
Also arrange for subclass to query whether leftover data is being drained.
2011-04-08 15:44:47 +01:00
Mark Nauwelaerts 48b4912c2e baseparse: add timestamp handling, and default conversion
In particular, (optionally) provide baseparse with a notion of frames per second
(and therefore also frame duration) and have it track frame and byte counts.
This way, subclass can provide baseparse with fps and have it provide default
buffer time metadata and conversions, though subclass can still install
callbacks to handle such itself.
2011-04-08 15:44:47 +01:00
Mark Nauwelaerts 899a6de75b baseparse: documentation fixes 2011-04-08 15:44:47 +01:00
Mark Nauwelaerts 14a3a9f42a baseparse: use_fixed_caps for src pad
After all, stream is as-is, and there is little molding to downstream's
taste that can be done.  If subclass can and wants to do so, it can
still override as such.
2011-04-08 15:44:47 +01:00
Julien Moutte 9f5bb92e74 aacparse: Fix compilation warnings 2011-04-08 15:44:47 +01:00
Josep Torra 3803cc4411 aacparse: fix warnings in macosx snow leopard 2011-04-08 15:44:47 +01:00
Mark Nauwelaerts deb9e7bb30 aacparse: forego (bogus) parsing of already parsed (raw) input 2011-04-08 15:44:47 +01:00
Mark Nauwelaerts d6d066892e baseparse: prevent infinite loop when draining 2011-04-08 15:44:47 +01:00
Mark Nauwelaerts 569064282c baseparse: fix minor memory leak 2011-04-08 15:44:47 +01:00
Sebastian Dröge bd50c29658 aacparse: Add function for the baseparse subclass to push buffers downstream
Also handle the case gracefully where the subclass decides to drop
the first buffers and has no caps set yet. It's still required to
have valid caps set when the first buffer should be passed downstream.
2011-04-08 15:44:47 +01:00
Sebastian Dröge 2e4ed802a7 baseparse: Fix seek event leaking 2011-04-08 15:44:47 +01:00
Tim-Philipp Müller d49e8731c0 baseparse: propagate return value of GstBaseParse::set_sink_caps()
gst_base_parse_sink_setcaps() presumably should fail if the subclass
returns FALSE from its ::set_sink_caps() function.
2011-04-08 15:44:47 +01:00
Tim-Philipp Müller 09243a12bd baseparse: don't try to GST_LOG an already-freed caps string
The proper way to log caps is via GST_PTR_FORMAT anyway.
2011-04-08 15:44:46 +01:00
Mark Nauwelaerts 56605e51a7 baseparse: fix debug category 2011-04-08 15:44:46 +01:00
Mark Nauwelaerts ae1956092f baseparse: fix (regression in) newsegment handling
(aacparse, amrparse, flacparse).  Fixes #580133.
2011-04-08 15:44:46 +01:00
René Stadler 922c644bf3 baseparse: Fix slightly broken buffer-in-segment check (aacparse, amrparse, flacparse) 2011-04-08 15:44:46 +01:00
René Stadler da8fb9be91 baseparse: Fix push mode seeking (aacparse, amrparse)
Sending the flush-start event forward before taking the stream lock actually
works, in contrast to deadlocking in downstream preroll_wait (hunk 1).

After that we get the chain function being stuck in a busy loop. This is fixed
by updating the minimum frame size inside the synchronization loop because the
subclass asks for more data in this way (hunk 2).

Finally, this leads to a very probable crash because the subclass can find a
valid frame with a size greater than the currently available data in the
adapter. This makes the subsequent gst_adapter_take_buffer call return NULL,
which is not expected (hunk 3).
2011-04-08 15:44:46 +01:00
Mark Nauwelaerts 1b93e8ec03 baseparse: Delay newsegment as long as possible.
If newsegment is sent (too) early, caps may not yet be fixed/set,
and downstream may not have been linked.
2011-04-08 15:44:46 +01:00
Stefan Kost 5a971be3aa baseparse: revert last change and properly fix
Baseparse internaly breaks the semantics of a _chain function by calling it with
buffer==NULL. The reson I belived it was okay to remove it was that there is
also an unchecked access to buffer later in _chain. Actually that code is wrong,
as it most probably wants to set discont on the outgoing buffer.
2011-04-08 15:44:46 +01:00
Stefan Kost c0f1db7ebe baseparse: remove checks for buffer==NULL
Accordifn to docs for GstPadChainFunction buffer cannot be NULL. If we would
leave the check, we would also need more such check below.
2011-04-08 15:44:46 +01:00
Jan Schmidt 2f2e8a1c33 Fix the return value of the default parse_frame function.
Fix the return value of the default parse_frame function in both
copies of GstBaseParse
2011-04-08 15:44:46 +01:00
Stefan Kost e9da652db6 gst/: Fix baseparse type name.
Original commit message from CVS:
* gst/aacparse/gstbaseparse.c:
* gst/amrparse/gstbaseparse.c:
Fix baseparse type name.
2011-04-08 15:44:46 +01:00
Stefan Kost e37b6081ed Add two new baseparse based parsers (aac and amr) from Bug #518857.
Original commit message from CVS:
* configure.ac:
* gst/aacparse/Makefile.am:
* gst/aacparse/gstaacparse.c:
* gst/aacparse/gstaacparse.h:
* gst/aacparse/gstbaseparse.c:
* gst/aacparse/gstbaseparse.h:
* gst/amrparse/Makefile.am:
* gst/amrparse/gstamrparse.c:
* gst/amrparse/gstamrparse.h:
* gst/amrparse/gstbaseparse.c:
* gst/amrparse/gstbaseparse.h:
Add two new baseparse based parsers (aac and amr) from Bug #518857.
2011-04-08 15:44:46 +01:00
Stian Selnes c19f44e1d2 iterator: resync to avoid infinite loop 2011-04-08 14:43:21 +02:00
Sebastian Dröge 43cdbc17e6 bus: Removed unused GCond 2011-04-08 09:15:56 +02:00
Sebastian Dröge 80eb160e0f bus: Immediately drop messages after calling the sync handler if this is a synchronous bus
Otherwise we might wait forever for the message to be popped from
the queue if a sync handler returned GST_BUS_ASYNC.

https://bugzilla.gnome.org/show_bug.cgi?id=647005
2011-04-08 09:15:56 +02:00
Sebastian Dröge c41b0ade28 bus: Use a construct-only property to distinguish between child buses and normal buses
This allows to only create the socketpair when it is really required instead
of always creating it and immediately destroying it again for child buses.

https://bugzilla.gnome.org/show_bug.cgi?id=647005
2011-04-08 09:15:56 +02:00
Sebastian Dröge 874d60e589 bus: Add private API to set a GstBus in child mode
This is used by GstBin to create a child bus without
a socketpair because child buses will always work
synchronous. Otherwise too many sockets could be
created and the limit of file descriptors for the
process could be reached.

Fixes bug #646624.
2011-04-06 14:18:35 +02:00
Sebastian Dröge 79370d4b17 Revert "bus: Only create the signalling socket pair when required"
This reverts commit 4bf8f1524f.
2011-04-06 14:12:26 +02:00
Sebastian Dröge 2cb3e52351 Revert "bus: Check if pending messages are in the queue"
This reverts commit bd1c400114.
2011-04-06 14:12:26 +02:00
Sebastian Dröge bd1c400114 bus: Check if pending messages are in the queue
We can't rely completely on the poll fd because the fd might be
created after messages were posted to the bus.
2011-04-06 12:03:18 +02:00