Commit graph

5846 commits

Author SHA1 Message Date
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
76559d4160 trace: don't put code with side effects into g_return_if_fail() 2011-04-09 23:54:20 +01:00
Tim-Philipp Müller
3fc68cf9e8 element: unref event in default_send_event in case element has no pads
Spotted by  Haakon Sporsheim.
2011-04-09 18:04:55 +01:00
Edward Hervey
87d16a992c gst: Don't forget to dist gstelementmetadata.h 2011-04-09 04:05:20 +02:00
David Schleef
e57cb6b47a baseparse: Create baseparse library 2011-04-08 15:44:56 +01:00
Mark Nauwelaerts
3882b7f2ed baseparse: tune QUERY_SEEKING response
Even if we currently do not have a duration yet, assume seekable if
it looks like we'll likely be able to determine it later on
(which coincides with needed information to perform seeking).

Fixes #641047.
2011-04-08 15:44:56 +01:00
Arun Raghavan
694d5c4b75 baseparse: Update min/max bitrate before first posting them
This avoids posting an initial min-bitrate of G_UINTMAX and max-bitrate
of 0.

https://bugzilla.gnome.org/show_bug.cgi?id=641857
2011-04-08 15:44:56 +01:00
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
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
Wim Taymans
a5e1ec0edc memory: add NO_SHARE flag to memory
Add a NO_SHARE flag to memory to indicate that it should not be shared
between buffers.
2011-04-07 16:02:43 +02:00
Wim Taymans
a13740db3f memory: don't follow the parent in the fallback share 2011-04-06 19:19:55 +02:00
Wim Taymans
f332b700d5 buffer: make memory writable in _peek
Make the memory writable when we are asked to _peek with MAP_WRITE.
Improve debugging of miniobject.
2011-04-06 19:00:28 +02:00
Wim Taymans
20ba453244 miniobject: fix debug 2011-04-06 16:37:40 +02:00
Sebastian Dröge
08b98cc7e9 Merge branch 'master' into 0.11 2011-04-06 14:20:59 +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
Sebastian Dröge
4bf8f1524f bus: Only create the signalling socket pair when required
Otherwise a new one would be created for every single bus and
the process could easily run out of file descriptors.

Fixes bug #646624.
2011-04-05 16:30:55 +02:00
Sebastian Dröge
5860734aaf structure: Add date as a type abbreviation of GDate
See bug #646696.
2011-04-05 14:37:55 +02:00
Wim Taymans
8bcaf95662 Merge branch 'master' into 0.11 2011-04-04 11:17:28 +02:00
Andoni Morales Alastruey
7c6d9c2725 gstpoll: retry reading the control socket to release properly all wakeups
if set->control_pending is set to 0 but we didn't not succed reading
the control socket, future calls to gst_poll_wait() will be awaiken
by the control socket which will not be released properly because
set->control_pending is already 0, causing an infinite loop.
2011-04-04 11:05:45 +02:00
Sebastian Dröge
eba33c1de1 structure: Don't allow invalid GDates in all structures and don't allow NULL GDates in taglists
Some code (e.g. gstvorbistag.c) assumes non-NULL GDates in taglists and
explodes otherwise and NULL or invalid GDates don't make much sense anyway.
2011-04-04 10:18:14 +02:00
Thomas Kristensen
d0d27e83fe poll: don't call WSAWaitForMultipleEvents with no events
Fixes error caught by Microsoft Application Verifier.
2011-04-04 09:23:57 +02:00
Tim-Philipp Müller
e1ac508cab docs: add pointer to part-seeking.txt design docs to event seek flags docs 2011-04-03 16:18:54 +01:00
Bastien Nocera
08e189badb utils: Avoid using "type" as name for a variable and a macro argument in GST_BOILERPLATE
This caused "re-declaration" problems.
./clutter-gst-video-sink.c: In function ‘clutter_gst_video_sink_init_interfaces’:
./clutter-gst-video-sink.c:231:1: warning: declaration of ‘ClutterGstVideoSink’ shadows a global declaration [-Wshadow]
./clutter-gst-video-sink.h:64:44: warning: shadowed declaration is here [-Wshadow]

https://bugzilla.gnome.org/show_bug.cgi?id=646531
2011-04-02 15:12:46 +01:00
Sebastian Dröge
38c07bac1d element: When requesting an existing pad print a g_critical() instead of using an assertion
Some applications are requesting the same pad name multiple times
and the behaviour is undefined and different from element to element
but we don't want to break applications that work just fine.

In 0.11 this check should be an assertion again, although elements
have to do manual checking if the pad already exists again because
it can't be done in a threadsafe way here.
2011-04-01 13:58:43 +02:00
Sebastian Dröge
9f3e48b55b element: Use gint64/guint64 string parsing functions
And check that the requested pad names are inside the valid
gint/guint range.
2011-04-01 13:58:43 +02:00
Josep Torra
c40dba242c element: strto[u]l() returns a g[u]long 2011-04-01 13:58:43 +02:00
Wim Taymans
468ec5bc40 bufferlist: simplify bufferlists
We now have multiple memory blocks as part of the buffers and we can therefore
reduce the bufferlist to a simple array of buffers.
2011-03-31 17:51:02 +02:00
Wim Taymans
7a62d32a07 Merge branch 'master' into 0.11-fdo
Conflicts:
	docs/plugins/gstreamer-plugins.hierarchy
	gst/gstelement.c
2011-03-30 19:58:52 +02:00
Wim Taymans
7cae289036 docs: update docs 2011-03-30 19:01:13 +02:00
Wim Taymans
800def04e2 docs: update documentation 2011-03-30 18:45:08 +02:00
Wim Taymans
ebb14d95b2 buffer: more API tweaks
_trim -> _resize
_create_sub -> copy_region
2011-03-30 16:47:55 +02:00
Wim Taymans
db230b6121 design: update docs 2011-03-30 13:04:34 +02:00
Wim Taymans
030fcde837 memory: further memory tweaking
Allow for automatic merging of memory block in the _map function and automatic
freeing of the temporary memory.
Remove some unneeded functions.
Add possibility to force writable spanned memory.
2011-03-29 19:17:55 +02:00
Wim Taymans
edbfc492bb buffer: implement COPY_MERGE 2011-03-29 17:17:46 +02:00
Wim Taymans
4e32ac8463 buffer: clean up _span and add more g_return_if.. 2011-03-29 16:52:21 +02:00
Sebastian Dröge
b8ea24d466 element: Fix sanity checks for request pad templates without % 2011-03-29 16:22:46 +02:00
Wim Taymans
d9becdcd27 buffer: optimize memory handling 2011-03-29 13:51:25 +02:00
Sebastian Dröge
cb3f09a719 element: Add some more sanity checks to the pad name checking of request pads in all cases
Especially check if a pad with that name already exists.
2011-03-29 11:57:58 +02:00
Sebastian Dröge
c9238f6f56 element: Check %u too when trying to find a pad template for a request pad 2011-03-29 11:52:06 +02:00
Wim Taymans
a6d2490b10 buffer: move implementation details in private struct 2011-03-29 11:31:30 +02:00
Wim Taymans
6da19ffeb2 buffer: more buffer updates 2011-03-29 11:07:36 +02:00
Wim Taymans
a12ede3fb1 Merge branch 'master' into 0.11-fdo
Conflicts:
	gst/gst.c
	libs/gst/base/gstcollectpads.c
2011-03-28 20:11:20 +02:00
Wim Taymans
121b82ce27 buffer: fix subbuffers 2011-03-28 20:08:47 +02:00
Wim Taymans
9ff103b3a5 buffer: implemet trim and set_size 2011-03-28 20:08:47 +02:00
Wim Taymans
826a7d83d4 buffer: more fixes 2011-03-28 20:08:47 +02:00
Wim Taymans
a12373b2ee buffer: add more methods 2011-03-28 20:08:47 +02:00
Wim Taymans
100a3799bb gst: add class init 2011-03-28 20:08:46 +02:00
Wim Taymans
beac9c4a95 buffer: fix remaining unit tests 2011-03-28 20:08:46 +02:00
Wim Taymans
f35847a094 buffer: fix unit test 2011-03-28 20:08:46 +02:00
Wim Taymans
121ab46aa6 memory: remove memory metadata again 2011-03-28 20:08:46 +02:00
Wim Taymans
6f2af5aa87 memory: more fixes
Automatically make the memory of a buffer writable when the buffer is writable
and the memory is asked to mapped WRITE.
Add docs
2011-03-28 20:08:46 +02:00
Wim Taymans
38ffe30745 memory: more work on implementing buffer memory 2011-03-28 20:08:46 +02:00
Wim Taymans
1af328e785 memory: more work on porting the unit tests 2011-03-28 20:08:46 +02:00
Wim Taymans
d82c8bd2af memory: port code to new buffer data API 2011-03-28 20:08:45 +02:00
Wim Taymans
1eed0785af memory: more fixes
Fix span and is_span
Implement buffer memory
2011-03-28 20:08:45 +02:00
Wim Taymans
6015312cf1 WIP use memory in buffer 2011-03-28 20:08:45 +02:00
Wim Taymans
dd74a925c9 memory: more improvements 2011-03-28 20:08:45 +02:00
Wim Taymans
b35c0df940 memory: more memory improvements 2011-03-28 20:08:45 +02:00
Wim Taymans
1a7e600f39 memory: add more memory operations 2011-03-28 20:08:45 +02:00
Wim Taymans
063abd4cf1 memory: add memory implementation 2011-03-28 20:08:45 +02:00
Wim Taymans
4fef929ed0 memory: add API for handling memory blocks
Adds some API to handle memory blocks.
2011-03-28 20:08:45 +02:00
Wim Taymans
c5983ac47c meta: fix docs 2011-03-28 20:06:35 +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
Edward Hervey
09d83e589a gstcaps: new API : gst_caps_intersect_full
Just like gst_caps_intersect, but adds a new parameter 'mode'
that allows selecting the intersection algorithm to use.

Currently we have GST_CAPS_INTERSECT_MODE_ZIG_ZAG (default) and
GST_CAPS_INTERSECT_MODE_FIRST.

API: gst_caps_intersect_full
API: GstCapsIntersectMode
API: GST_CAPS_INTERSECT_MODE_ZIG_ZAG
API: GST_CAPS_INTERSECT_MODE_FIRST

https://bugzilla.gnome.org/show_bug.cgi?id=617045
2011-03-24 11:14:18 -03:00
Thiago Santos
2f0dab0f44 gstelement: Fix typo in the docs
GST_ELEMENT_INFO will post a INFO message, not a WARNING
2011-03-22 16:27:35 -03:00
Thiago Santos
4b322b215a tagsetter: Removing unused debug category
tagsetter's debug category had a typo and was unused. Removing it.
2011-03-22 16:27:35 -03:00
Jason D. Clinton
a789096c04 build: fix build with -Werror with GCC 4.6.0
This touches three areas of code, removes unused variables and discards
return values from two functions with (void).

https://bugzilla.gnome.org/show_bug.cgi?id=645267
2011-03-21 09:29:19 +01:00
Sebastian Dröge
27c0a2b9b1 event: Add since marker to GST_EVENT_SINK_MESSAGE 2011-03-19 10:39:28 +01:00
Tim-Philipp Müller
02d27de048 task: fix GST_TASK_BROADCAST
Surprisingly enough, you can't "breadcast" on a GCond.

Spotted by Rune Sætre.

https://bugzilla.gnome.org/show_bug.cgi?id=645022
2011-03-17 23:42:48 +00:00
Sebastian Dröge
e86973bc10 utils: Remove deprecated gst_element_factory_can_{sink,src}_caps() 2011-03-17 10:54:27 +01:00
Sebastian Dröge
4e16347bfa Merge branch 'master' into 0.11
Conflicts:
	gst/gstbufferlist.c
2011-03-17 10:50:43 +01:00
Sebastian Dröge
b8d83f4e01 pad: Document that pad blocks only make sense for sink pads in pull mode and src pads in push mode
See bug #644907.
2011-03-16 12:01:21 +01:00
Sebastian Dröge
256e7238b4 ghostpad: The internally linked pad of the proxypad is the ghostpad
Previously we were returning the peerpad, which is the target
of the ghostpad.
2011-03-16 11:53:53 +01:00
Jonas Holmberg
c4c06a2b88 bufferlist: Use a GQueue instead of a GList
Adding a buffer to the end of a GstBufferList is supposed to be a fast
operation, but it was not since the iterator does not advance its
nextpointer when adding buffers and GList does not have a tail pointer.
Using a GQueue to store the buffers makes it easier to add buffers to
the end of the list and this operation will now be much more efficient.

Adding an entire GList of buffers using
gst_buffer_list_iterator_add_list() will however have to iterate over
the list being added to be able to update the tail pointer in the
GQueue.
2011-03-11 14:31:14 +01:00
Tim-Philipp Müller
90b4dc4869 utils: fix ABI break when compiling gstreamer with -DGST_DISABLE_DEPRECATED
GST_DISABLE_DEPRECATED should only affect visibility of declarations in headers,
not actually remove symbols. See GitDeveloperGuidelines and DeprecatingAPI
pages in wiki.

https://bugzilla.gnome.org/show_bug.cgi?id=402141
2011-03-10 17:50:51 +00:00
Wim Taymans
f0e3902a37 Merge branch 'master' into 0.11 2011-03-10 10:25:07 +01:00
Thijs Vermeir
dbc21e0174 gstutils: replace gst_element_factory_can_{sink,src}_caps
Add new functions to clarify how the caps are compared to the template caps of
the element factory. Improve the docs to point out the difference.

Deprecate: gst_element_factory_can_{src|sink}_caps
API: add gst_element_factory_can_{src|sink}_{any|all}_capps

https://bugzilla.gnome.org/show_bug.cgi?id=402141
2011-03-09 15:28:05 +02:00
Wim Taymans
fa0d993372 meta: implement transform function
Replace subbuffer and copy vmethods by a more generic transform function that
can then be parametrised by transform specific data. This should allow us to
implement make-writable and more future transform functions.
2011-03-08 17:11:23 +00:00
Wim Taymans
fd0fd97200 Merge branch 'master' into 0.11 2011-03-08 17:06:30 +00:00
Stefan Kost
8aa3f380a5 padtemplate: add missing ; in example (and trim whitespace) 2011-03-08 12:12:20 +02:00
Stefan Kost
d963503b26 structure: gst_structure_empty_new() does better error checking
No need to check for media_type!=NULL as the function we call that actual create
the structure does a full check anyway.
2011-03-08 10:07:17 +02:00
Stefan Kost
4d9e645551 caps,structure: trim trailing whitespace 2011-03-08 10:07:03 +02:00
Jonathan Matthew
2bbfa3304c caps: don't create broken caps for invalid media types
Check if structure has been created before appending it to the caps. Free the
caps in the case of an error to not conceal it be returning empty caps.

Fixes #642271
2011-03-08 10:06:12 +02:00
Wim Taymans
dea2351539 miniobject: remove FIXME
Now that we don't subclass buffers anymore, the FIXME about limited
functionality of the copy function is irrelevant.
2011-03-04 18:11:19 +01:00
Wim Taymans
3b916bf57c gst: add flag registration 2011-03-04 17:43:24 +01:00
Wim Taymans
f505f778cc pad: more preroll lock to basesink
Move the preroll lock to basesink where it belongs.
2011-03-04 17:25:02 +01:00
Wim Taymans
b11ede5984 bufferpool: add more debug info 2011-03-04 12:06:11 +01:00
Wim Taymans
52a3fa9346 bufferpool: add debug 2011-03-04 10:17:06 +01:00
Wim Taymans
dbcb6eee72 bufferpool: add some more debug info 2011-03-04 10:16:54 +01:00
Wim Taymans
695facd923 bufferpool: add caps to the config
Add the caps to the configuration parameters of the pool.
Initialize the private data
2011-03-04 10:16:35 +01:00
Wim Taymans
673d90fb99 buffer: release buffer to pool in dispose
Use the dispose method to release the buffer to the pool when it is configured.
2011-03-02 11:57:06 +01:00
Wim Taymans
a55bc30f81 buffer: add pool to buffer structure
Keep a pointer to the bufferpool. Release the buffer to the pool when
finalizing. Make sure the pool sets itself as the pool member of buffers that it
sends out.
2011-03-02 11:33:24 +01:00
Wim Taymans
0a89debaf7 gst: add pool flags type 2011-03-02 11:24:27 +01:00
Wim Taymans
0986f3a64a bufferpool: Refactor stopping of the pool
Move some methods around.
Make sure we check for config parsing errors.
Increment the outstanding buffers before calling acquire so that we can be sure
that set_active() doesn't free the pool from under us.
2011-03-02 11:23:21 +01:00
Wim Taymans
e566910a18 bufferpool: Rework buffer management a little
Add start/stop methods to allow for bulk allocation of buffers.
Free buffers only when all outstanding buffers returned.
Make things more threadsafe wrt flushing and starting/stopping by
keeping track of start and stop method calls.
2011-03-02 11:23:21 +01:00
Wim Taymans
419a01af0f bufferpool: memory management cleanups
Use a lock to protect concurrect execution of set_config and set_active.
Start freeing the buffers when flushing and all buffers are returned to the
pool.
Make a copy of the config to avoid crashing with concurrent access.
2011-03-02 11:23:21 +01:00
Stefan Kost
1dff415d8a bufferpool: also allow NULL params in _acquire 2011-03-02 11:23:21 +01:00
Wim Taymans
9b1cadc329 bufferpool: more updates
Keep track if the buffer is configured and block activation when not configured
yet.
Keep track of outstanding buffers and disallow configuration when not all
buffers are returned to the pool. We need to do this or else we might end up
with wrong buffers in the pool.
Add return value to set_active.
Small cleanups. Fix finalize.
2011-03-02 11:23:21 +01:00
Wim Taymans
dd16af7a6c bufferpool: rename 'flushing' to 'active'
Rename the flushing variable and methods to active to better match
the other gstreamer name conventions
2011-03-02 11:23:21 +01:00
Wim Taymans
2496523b3e bufferpool: prealloc when unset flushing
According to the design doc we need to prealloc buffers when we unset the
flushing state, not in set_config.
Set the flushing state better.
2011-03-02 11:23:21 +01:00
Wim Taymans
2b50d0a2f4 bufferpool: use quarks for structure fields 2011-03-02 11:23:21 +01:00
Wim Taymans
0caa41e173 bufferpool: use GstStructure to configure the pool
Use a GstStructure to provide the pool with the right configuration. Also
provide some helper methods to configure such a structure.
don't pass the config in alloc_buffer, pool implementation will already have
parsed it during set_config.
Update defs
2011-03-02 11:23:21 +01:00
Wim Taymans
8c9e3e6af3 bufferpool: add simple bufferpool helper object 2011-03-02 11:22:44 +01:00
Wim Taymans
230c3455ac Merge branch 'master' into 0.11
Conflicts:
	gst/gstregistry.h
2011-03-02 11:08:34 +01:00
Tim-Philipp Müller
c71241d9dd docs: typo fixes
convinience -> convenience
2011-02-28 15:01:54 +00:00
Stefan Kost
c7881a21b5 docs: small updates as suggested on a blog
Link from convinience api to the underlying api.
2011-02-28 16:33:22 +02:00
Wim Taymans
d96cacc66c meta: add timing metadata 2011-02-28 10:05:47 +01:00
Wim Taymans
3a29d34923 miniobject: fix whitespace 2011-02-28 10:05:38 +01:00
Wim Taymans
cb86bf99bc meta: simplify a bit 2011-02-27 20:54:58 +01:00
Wim Taymans
362a724cfb meta: add default memory metadata
Add a metadata implementation for normall malloced memory.
2011-02-27 20:42:15 +01:00
Wim Taymans
58060d7528 meta: separate add and get methods
Make separate api for getting and adding metadata. This allows us to pass extra
parameters to the init functions when creating metadata, which is needed for
specific API implementations.
Add beginnings of memory metadata.
2011-02-27 19:40:45 +01:00
Wim Taymans
0969106993 docs: update docs and defs 2011-02-27 12:21:32 +01:00
Wim Taymans
9a3f158c73 buffer: remove useless method
Remove the method to retrieve metadata by api. One will always use the
GstMetaInfo to get metadata.
2011-02-26 18:14:36 +01:00
Wim Taymans
23aa5508f3 buffer: remove owner_priv now that we have metadata
Now that we have metadata we can remove the owner_priv field.
2011-02-25 16:31:11 +01:00
Wim Taymans
6f4a733063 metadata: Rename to GstMeta
Rename to the shorter GstMeta
Add docs
Add api to get metadata by API
2011-02-25 13:15:25 +01:00
Philippe Normand
376089db14 buffer: fix memory corruption 2011-02-25 10:34:52 +01:00
Wim Taymans
45645a11a1 buffermeta: fix compilation 2011-02-25 10:34:52 +01:00
Wim Taymans
8e4ab802f9 updates 2011-02-25 10:34:52 +01:00
Wim Taymans
8468dadc77 buffermeta: add beginnings of buffer metadata
Add first implementation of arbitrary buffer metadata. We use a simple linked
linked of slice allocated metadata chunks. Future implementations could use
something more performant.
Add get, remove, iterate methods to handle the metadata.
2011-02-25 10:34:47 +01:00
Tim-Philipp Müller
d3e7981527 uri: make win32 buildbot happy
gsturi.c:854:16: error: unused variable 'abs_clean'
gsturi.c:788:1: error: 'gst_file_utils_canonicalise_path' defined but not used
2011-02-24 17:12:00 +00:00
Tim-Philipp Müller
27027a2dd2 uri: add gst_filename_to_uri() that takes relative filenames
Add function that (unlike the GLib equivalent) also accepts paths that
aren't absolute and will clean up relative markers such as ./ and ../
before forming a URI.

Fixes warnings with e.g. filesrc location=foo ! typefind caused by the
recent switch to g_filename_to_uri(), but also actually creates valid
URIs for the first time.

Windows code paths could need some more work, e.g. we don't clean up
the relative markers there for now (because path could have \ and /
as separators).

API: gst_filename_to_uri()
2011-02-24 15:36:52 +00:00
Wim Taymans
39d486e526 buffer: add owner private as intermediate solution
Add an owner private field where the owner of a buffer can store some extra
information. We can use this to implement most of the subclassing that happens
now. Later this will be removed and replaced by arbitrary buffer metadata.
2011-02-24 13:55:35 +01:00
Wim Taymans
7e769a32b8 caps: remove poisoning 2011-02-24 10:28:20 +01:00
Wim Taymans
b108e3b999 miniobject: cleanups
Use the stored size in the miniobject to free the miniobject.
Refactor some init methods.
2011-02-23 16:48:00 +01:00
Wim Taymans
97be4713ea caps: warn when make_writable result is ignored 2011-02-23 12:44:54 +01:00
Wim Taymans
f78ceed43a gst: fix type registration
We need to have the types of the miniobjects before registering the
tranforms.
2011-02-23 12:01:55 +01:00
Wim Taymans
293ddfc5aa elementfactory: improve caps string management 2011-02-23 12:01:16 +01:00
Wim Taymans
be21f9cf42 miniobject: clear flags in init 2011-02-23 12:00:42 +01:00
Wim Taymans
fd59a2cead miniobject: fix flags 2011-02-23 10:35:36 +01:00
Wim Taymans
43b8ade170 fix compilation after rebase 2011-02-23 10:35:36 +01:00
Wim Taymans
70be8d8d95 improve type registration 2011-02-23 10:35:36 +01:00
Wim Taymans
cdde34f0ee fix compilation 2011-02-23 10:35:36 +01:00
Wim Taymans
b82a0f5050 fix macros 2011-02-23 10:35:36 +01:00
Wim Taymans
509abb2162 pad: set boxed type correctly 2011-02-23 10:35:36 +01:00