Mark Nauwelaerts
ae23eb9955
baseparse: tune default duration estimate update interval
...
Rather than a fixed default frame count, estimate frame count to aim for
an interval duration depending on fps if available, otherwise use old
fixed default.
2011-04-08 15:44:56 +01:00
Mark Nauwelaerts
d6d56d2420
baseparse: reverse playback; mind keyframes for fragment boundary
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
6f933050b0
baseparse: ensure non-empty candidate frames
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
123b2b063c
baseparse: clarify some debug statements
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
dccb20cd58
baseparse: properly track upstream timestamps
...
... rather than with a delay.
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
212eae966a
baseparse: need proper frame duration to obtain sensible frame bitrate
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
ebf124251f
baseparse: proper initial values for index tracking variables
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
ef641d0515
baseparse: arrange for consistent event handling
2011-04-08 15:44:55 +01:00
Mark Nauwelaerts
ec835b45b7
baseparse: header style cleaning
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
070db250b3
baseparse: provide some more initial frame metadata in parse_frame
...
... and document accordingly.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
c38fbf8879
baseparse: refactor passthrough into format flags
...
Also add a format flag to signal baseparse that subclass/format can provide
(parsed) timestamp rather than an estimated one. In particular, such "strong"
timestamp then allows to e.g. determine duration.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
75bf0cfa32
baseparse: introduce a baseparse frame to serve as context
...
... and adjust subclass parsers accordingly
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
a27cc4ad83
baseparse: restrict duration scanning to pull mode and avoid extra set_caps call
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
efe6f065d6
baseparse: update some documentation
...
Also add some more debug.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
e567d1776c
baseparse: allow increasing min_size for current frame parsing only
...
Also check that subclass actually either directs to skip bytes or
increases expected frame size to avoid going nowhere in bogus
indefinite looping.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
cb4ec7388a
baesparse: fix refactor regression in loop based parsing
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
3cf81d066f
baseparse: pass all available data to subclass rather than minimum
...
Also reduce some adapter calls and add a few debug statements.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
c0cbab6981
baseparse: fix reverse playback handling
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
d191e8b496
baseparse: minor typo and debug statement cleanup
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
c1adec7c76
baseparse: reduce locking
...
... which is either already mute and/or implicitly handled by STREAM_LOCK.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
d45cdf65d5
baseparse: avoid loop in frame locating interpolation
2011-04-08 15:44:54 +01:00
Thiago Santos
a3e55038ac
audioparsers: baseparse: Be careful to not lose the event ref
...
Don't unref the event if it hasn't been handled, because the caller
assumes it is still valid and might reuse it.
I ran into this problem when transcoding an AVI (with mp3 inside)
to gpp.
https://bugzilla.gnome.org/show_bug.cgi?id=639555
2011-04-08 15:44:54 +01:00
Tim-Philipp Müller
40a5458392
docs: minor baseparse docs/comment fixes
...
Remove copy'n'paste leftovers.
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
4dc486ddc5
baseparse: increase keyframe awareness
...
... which is not particular relevant for audio parsing, but more so
in video cases. In particular, auto-determine if dealing with video (caps).
2011-04-08 15:44:54 +01:00
Mark Nauwelaerts
aed933c0ce
baseparse: avoid unexpected stray metadata
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
0cb02472f0
baseparse: use proper _NONE output value when applicable
2011-04-08 15:44:53 +01:00
Edward Hervey
dab512bb15
audioparsers: Remove dead assignments
2011-04-08 15:44:53 +01:00
Andoni Morales Alastruey
fc4885a3a3
audioparse: fix possible division-by-zero
...
https://bugzilla.gnome.org/show_bug.cgi?id=635786
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
4230c0b2e1
baseparse: use correct offset when adding index entry
...
... bearing in mind that BUFFER_OFFSET is media specific and may not
reflect the basic offset after having been parsed.
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
3faccbd29f
baseparse: enhancements for timestamp marked framed formats
...
That is, as such formats allow subclass to extract position from frame,
it is possible to extract duration (if not otherwise provided)
from (near) last frame, and a seek can fairly accurately target the required
position.
Fixes #631389 .
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
454f21f077
baseparse: refactor frame scanning peformed by _loop
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
10eae096fe
baseparse: slightly optimize sending of pending newsegment events
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
6d3447c6ec
baseparse: minor fixes and enhancements
...
Arrange for upstream as well as downstream flushing when seeking.
Also determine upstream size as well as seekability. Adjust some comments
to reality and employ debug statement in proper order.
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
0f9435888a
baseparse: use only upstream duration if it provides one
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
78ef0387e7
baseparse: reflow update_bitrate code
...
... which makes local variables represent real state better, and avoids
triggering unneeded updates/actions.
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
85307bf969
baseparse: add some debug statements
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
9394662f35
baseparse: perform bitrate handling and posting after newsegment sending
2011-04-08 15:44:53 +01:00
Mark Nauwelaerts
07eff44306
baseparse: immediately post subclass provided bitrate
2011-04-08 15:44:53 +01:00
Tim-Philipp Müller
a4f5db7088
Revert "baseparse: add skip property"
...
This reverts commit b5a3d60363
.
Reverting this for now, since no one really seems to remember why this
property exists or what it could possibly be good for. It seems to have
been in the original mp3parse since the beginning of time and was back-
ported from there.
2011-04-08 15:44:52 +01:00
Sebastian Dröge
ad6ce1e2d8
audioparser: Let the format string agree with the parameters to fix compiler warning
2011-04-08 15:44:52 +01:00
Arun Raghavan
c56f223da7
baseparse: Fix debug output
...
We lose the reference to the buffer after gst_pad_push(), so the debug
print should happen before.
https://bugzilla.gnome.org/show_bug.cgi?id=622276
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
cc8d04dad5
baseparse: support reverse playback
...
... in pull mode or upstream driven.
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
5e9cfceb26
baseparse: remove done TODOs and update documentation
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
67666768a2
baseparse: use determined seekability in answering SEEKING query
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
ba3d5da1ee
baseparse: add skip property
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
038821d30e
baseparse: use _set_frame_props to configure frame lead_in and lead_out
...
... provided a corresponding decoder with sufficient leading and following
frames to carry out full decoding for a particular segment.
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
668ad3836a
baseparse: use _set_duration to configure duration update interval
...
... as it logically belongs there as one or the other; either subclass
can provide a duration, or an estimate must be made (reguarly updated).
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
6b33f59406
baseparse: localize use of provided fps information
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
9db9d2eabf
baseparse: seek table and accurate seek support
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
3304f194a9
baseparse: proper and more extended segment and seek handling
...
That is, loop pause handling, segment seek support, newsegment for gaps, etc
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
4d20688af3
baseparse: add index support
2011-04-08 15:44:52 +01:00
Mark Nauwelaerts
224af37314
baseparse: refactor state reset
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
35bfc86e67
baseparse: prevent indefinite resyncing
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
31e676e4d7
baseparse: specific EOS handling if no output so far
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
d801f74366
baseparse: adjust _set_frame_prop documentation and set default as claimed
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
745de19963
baseparse: fix bitrate copy-and-paste and update heuristic
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
60a8533d48
baseparse: post duration message if average bitrates is updated
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
7ba1b6e4d7
baseparse: remove is_seekable vmethod and use a set_seek instead
...
Seekability, like duration, etc is unlikely to change (frequently), and
the default assumption covers most cases, so let subclass set when needed.
At the same time, allow subclass to indicate if it has seek-metadata (table)
available, and possibly have it provide an average bitrate.
2011-04-08 15:44:51 +01:00
Mark Nauwelaerts
4b0f92db79
baseparse: add another hook for subclass prior to pushing buffer
...
... and allow subclass to perform custom segment clipping, or to
emit tags or messages at this time.
2011-04-08 15:44:50 +01:00
Mark Nauwelaerts
b51b5d4b29
baseparse: 0 converts to 0 by default
2011-04-08 15:44:50 +01:00
Mark Nauwelaerts
3c656232eb
baseparse: refactor conversion using helper function and export default convert
2011-04-08 15:44:50 +01:00
Mark Nauwelaerts
12cc228d84
baseparse: streamline query handling
2011-04-08 15:44:50 +01:00
Mark Nauwelaerts
e274ebb292
baseparse: cleanup struct and remove unused member
2011-04-08 15:44:50 +01:00
Arun Raghavan
03164ad8ab
baseparse: Allow chaining of subclass event handlers
...
This allows the child class to chain its event handler with
GstBaseParse, so that subclasses don't have to duplicate all the default
event handling logic.
https://bugzilla.gnome.org/show_bug.cgi?id=622276
2011-04-08 15:44:50 +01:00
Sebastian Dröge
f3f338f14a
baseparse: Don't use GST_FLOW_IS_FATAL()
...
Also don't post an error message for UNEXPECTED and do it
for NOT_LINKED.
2011-04-08 15:44:49 +01:00
Mark Nauwelaerts
08e8dbf027
baseparse: non-TIME seek event is simply not handled
2011-04-08 15:44:49 +01:00
Mark Nauwelaerts
dc80b52372
baseparse: fix seek event ref handling
2011-04-08 15:44:49 +01:00
Mark Nauwelaerts
b4f1778a7d
baseparse: prevent arithmetic overflows in pull mode buffer cache handling
2011-04-08 15:44:49 +01:00
Mark Nauwelaerts
1b8a96e999
baseparse: fix seek handling
...
Allow a few more seek event type combinations, and really use the result
of gst_segment_set_seek to perform the seek. Also add some debug.
2011-04-08 15:44:49 +01:00
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