Commit graph

1046 commits

Author SHA1 Message Date
Edward Hervey
ece40dacbc basesink: Re-using GstClockID instead of constantly recreating one
Makes _sink_wait_clock at least 2 times faster.

https://bugzilla.gnome.org/show_bug.cgi?id=632778
2010-12-02 19:04:56 +01:00
Edward Hervey
7115b77aab basesink: Pass along miniobject type through various functions
Avoids doing useless GST_IS_*

https://bugzilla.gnome.org/show_bug.cgi?id=632778
2010-12-02 19:04:56 +01:00
Edward Hervey
606e59468d basesink: Switch enable_last_buffer to an atomic int
Avoids having to take a lock to read/write it.

https://bugzilla.gnome.org/show_bug.cgi?id=632778
2010-12-02 19:04:56 +01:00
Edward Hervey
7cc08390b9 gstdataqueue: Only emit g_cond_signal when needed
Keep track of which cond we're waiting for and only emit when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=632779
2010-12-02 19:04:55 +01:00
Evan Nemerson
4906671694 introspection: Include exported packages information in GIRs
https://bugzilla.gnome.org/show_bug.cgi?id=635389
2010-11-21 00:36:30 +00:00
Jonathan Matthew
754c3038be basetransform: use input position for queries if we have no output position 2010-10-29 15:45:04 +02:00
Wim Taymans
ce919c0573 basetransform: fix reverse negotiation
When the downstream element suggests a new format, pass the suggestion
upstream if we can't convert to it.

Fixes #633147
2010-10-29 12:03:48 +01:00
Tim-Philipp Müller
07755fd5ee bytereader: const-ify byte reader argument in peek/scan API
Because we can.
2010-10-22 12:04:09 +01:00
Mark Nauwelaerts
21c5064783 basesink: recompute correct running time for buffer ending flushing step
Prevents delaying/hanging when resuming PLAYING.

Fixes #632433.
2010-10-20 18:46:39 +02:00
Tim-Philipp Müller
b0d7c61f18 docs: fix misc. gtk-doc warnings in libs
(for gtk-doc 1.15)
2010-10-16 19:19:47 +01:00
Tim-Philipp Müller
1d9fbd1a7c Revert "libs/gst/dataqueue: Document gst_data_queue_new_full"
This reverts commit 80727c1177.

This doesn't make sense. gst_data_queue_new_full() is already
documented above. And we need the doc blurb for _new() here.
2010-10-16 18:30:18 +01:00
Tim-Philipp Müller
5b25761f29 docs: add some gtk-doc Since: markers
Add some gtk-doc Since: markers, fix one Since: marker,
fix typo.
2010-10-16 16:53:49 +01:00
Edward Hervey
80727c1177 libs/gst/dataqueue: Document gst_data_queue_new_full 2010-10-13 12:07:56 +02:00
Edward Hervey
906ae99742 base/gstdataqueue: inline some functions, get levels with memcpy. 2010-10-13 12:07:17 +02:00
Stefan Kost
ad2e7b1de3 docs: use the gtk-doc shortcuts to get coloured and xrefed example 2010-10-11 16:44:01 +03:00
Wim Taymans
428a6477d8 basesrc: tag as a SOURCE element
Tag all elements deriving from the basesrc with the IS_SOURCE flag.
2010-10-11 11:16:27 +02:00
Sebastian Dröge
14023fff89 basetransform: Report the output position on POSITION queries on the srcpad
There can be a difference between input and output last_stop.

Fixes bug #629410.
2010-10-10 18:18:23 +02:00
Sebastian Dröge
894f833da9 bytewriter: Add missing file 2010-10-08 12:48:42 +02:00
Sebastian Dröge
69ef479ce4 bytewriter: Add unchecked variants of the writing functions
These don't check if there's enough free space available and are
available as inline functions only.

API: gst_byte_writer_put_int8_unchecked
API: gst_byte_writer_put_int16_be_unchecked
API: gst_byte_writer_put_int16_le_unchecked
API: gst_byte_writer_put_int24_be_unchecked
API: gst_byte_writer_put_int24_le_unchecked
API: gst_byte_writer_put_int32_be_unchecked
API: gst_byte_writer_put_int32_le_unchecked
API: gst_byte_writer_put_int64_be_unchecked
API: gst_byte_writer_put_int64_le_unchecked
API: gst_byte_writer_put_uint8_unchecked
API: gst_byte_writer_put_uint16_be_unchecked
API: gst_byte_writer_put_uint16_le_unchecked
API: gst_byte_writer_put_uint24_be_unchecked
API: gst_byte_writer_put_uint24_le_unchecked
API: gst_byte_writer_put_uint32_be_unchecked
API: gst_byte_writer_put_uint32_le_unchecked
API: gst_byte_writer_put_uint64_be_unchecked
API: gst_byte_writer_put_uint64_le_unchecked
API: gst_byte_writer_put_float32_be_unchecked
API: gst_byte_writer_put_float32_le_unchecked
API: gst_byte_writer_put_float64_be_unchecked
API: gst_byte_writer_put_float64_le_unchecked
API: gst_byte_writer_put_data_unchecked
API: gst_byte_writer_fill_unchecked
2010-10-08 12:19:45 +02:00
Sebastian Dröge
3ee6ae4030 bytewriter: Fix possible infinite loop caused by an overflow 2010-10-08 09:47:12 +02:00
Stefan Kost
a11b047d00 basesink: don't take preroll-lock in get_property
Use atomic ops to read and write more properties. Taking the preroll lock in get_property
can lock up applications reading the property during preroll.
2010-10-05 12:30:34 +03:00
Stefan Kost
72e9834e88 basesink: add a fixme for 0.11 2010-10-05 12:29:19 +03:00
Wim Taymans
c9c9894552 basesink: format negative values better
Format negative values properly in the debug log.
2010-10-04 15:56:59 +02:00
Sebastian Dröge
f758e465c8 bytewriter: Add inline variants of all important functions 2010-10-03 23:32:06 +02:00
Sebastian Dröge
dd762eb49f bitreader: Add inlined and unchecked versions of the important functions
API: gst_bit_reader_skip_unchecked
API: gst_bit_reader_skip_to_byte_unchecked
API: gst_bit_reader_get_bits_uint16_unchecked
API: gst_bit_reader_get_bits_uint32_unchecked
API: gst_bit_reader_get_bits_uint64_unchecked
API: gst_bit_reader_get_bits_uint8_unchecked
API: gst_bit_reader_peek_bits_uint16_unchecked
API: gst_bit_reader_peek_bits_uint32_unchecked
API: gst_bit_reader_peek_bits_uint64_unchecked
API: gst_bit_reader_peek_bits_uint8_unchecked

This alone makes flacparse about 3 times faster.
2010-10-03 15:32:41 +02:00
Sebastian Dröge
10c18151d2 bytewriter: Add guards to the inlined get_pos/get_remaining/get_size/etc functions 2010-10-03 15:32:41 +02:00
Sebastian Dröge
c41c2f7964 bitreader: Optimize peek_bits/get_bits a bit
Use local variables instead of dereferencing the bitreader
pointer all the time and don't copy the reader for peek_bits.
2010-10-03 15:32:41 +02:00
Wim Taymans
29e23e9142 basesink: improve adjust_time()
Add some more comments.
Make sure we don't end up with negative timestamps.
2010-09-24 12:22:33 +02:00
Havard Graff
54a5871434 basesink: renderdelay needs to be subtracted in adjust_time()
latency is already sink-latency + render-delay, and here we only
want to deal with the sink-latency.

Fixes #630436
2010-09-24 12:16:48 +02:00
Havard Graff
51d20158be basetransform: Make a WARNING into a DEBUG statement
Fixes bug #630437.
2010-09-23 21:55:04 +02:00
Wim Taymans
90d65cb446 basetransform: avoid useless memcpy
Because of the awkward refcounting in prepare_output_buffer, we might end up
with writable buffers that point to the same data. Check for those cases so that
we avoid a useless memcpy and keep valgrind quiet.

Fixes #628176
2010-09-23 18:23:39 +02:00
David Schleef
9dbe690f72 adapter: Add check for pattern bits not in mask 2010-09-18 19:29:09 -07:00
Wim Taymans
1afaa1680f adapter: add function to get a list of buffers
Add a function to retrieve a list of buffers containing the first N bytes from
the adapter. This can be done without a memcpy and should make it possible to
transfer the list to a GstBufferList later.
2010-09-17 17:35:41 +02:00
Wim Taymans
a144882871 adapter: reuse more data in _peek()
Optimize _peek() some more by reusing already assembled data when we can.
2010-09-17 15:07:50 +02:00
Wim Taymans
961e2029db adapter: optimize _take() a little more
When we have already assembled some data before, reuse this data and only copy
the part that is new.
2010-09-17 13:57:39 +02:00
Wim Taymans
fc4caf55c9 adapter: refactor adapter take
Move some common code into one place
2010-09-17 12:48:55 +02:00
Wim Taymans
1dde3cb440 adapter: add support for 0 sized buffers
Add support for 0 sized buffers. This is interesting in combination with the
timestamp functions.

Fixes #629553
2010-09-17 12:40:12 +02:00
Jeffrey S. Smith
4375e998ee Fix casts in a bunch of inline functions to maintain correct const-ness
Make code including GStreamer headers compile with -Wcast-qual by
maintaining const-ness when casting. Also fix function signature of
gst_byte_writer_set_pos(): the byte writer should not be marked as
const.

https://bugzilla.gnome.org/show_bug.cgi?id=627910
2010-09-02 00:09:08 +01:00
Tim-Philipp Müller
f9204d5d70 build: use new AG_GST_PKG_CONFIG_PATH m4 macro from common
Sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am
(avoids trailing ':' in PKG_CONFIG_PATH used). A useful side
effect of this is also that the PKG_CONFIG_PATH environment
is now logged in the configure output.
2010-09-01 17:08:58 +01:00
Sebastian Dröge
2dfb0d2772 base: Stop using GST_FLOW_IS_FATAL()
And document the special handling of WRONG_STATE.
2010-08-27 16:59:09 +02:00
Wim Taymans
f8abf35000 basetransform: recover from invalid downstream suggestions
When we are handling a buffer and need to allocate an output buffer, handle the
case when downstream suggests us a format that we can't convert the input buffer
to. In that case, check if there is another format available downstream instead
of failing.

Fixes #621332 and see also #614296
2010-08-26 15:18:47 +02:00
Thiago Santos
ac9bfe25ae gstcollectpads: Fix docs about GstCollectData list
Add to the docs the fact that is only safe to iterate
GstCollectPad's data list inside the collected callback.

Fixes #610366
2010-08-12 16:05:35 -03:00
Sebastian Dröge
27bebf7456 basesrc: Make sure the buffer metadata is writable before changing it 2010-08-06 18:44:33 +02:00
Stefan Kost
2237af4b6b debug: logging improvements
Use the event serialisation. Log formats name instead of number.
2010-08-05 10:31:50 +03:00
Stefan Kost
71b494639b basesrc: log seek event details 2010-08-05 10:31:50 +03:00
Stefan Kost
a82b607885 basesrc: avoid some caps manipulation
After the intersect we have writable caps. Copy the template caps so that also
there we have writable caps.
2010-08-05 09:40:02 +03:00
Thiago Santos
1b99e2e2dc bytereader: Fix docs
Fix typo in docs for the unsigned peek functions
2010-08-04 13:47:23 -03:00
Rob Clark
29289ee79e basetransform fix for upstream caps-renegotiation
If initially pass-through caps are negotiated between a transform element's
sink and src pads, but then the downstream element returns different caps
on a buffer from pad_alloc(), basetransform gets stuck with proxy_alloc=TRUE
even though the upstream peer doesn't accept the caps, causing
gst_pad_peer_accept_caps() to be called on each buffer in _buffer_alloc():

    if (!gst_caps_is_equal (newcaps, caps)) {
      GST_DEBUG_OBJECT (trans, "caps are new");
      /* we have new caps, see if we can proxy downstream */
>>    if (gst_pad_peer_accept_caps (pad, newcaps)) {
        /* peer accepts the caps, return a buffer in this format */
        GST_DEBUG_OBJECT (trans, "peer accepted new caps");

which is taking ~40ms/frame.

This patch does two things.  (1) if the buffer returned from pad_alloc() has
new caps, trigger the decision whether to proxy the buffer-alloc to be
revisited, and (2) disable proxy if peer does not accept new caps.  (The first
part may not be strictly needed, but seemed like a good idea.)

Note that this issue would not arise except in case of downstream elements
who have on their template-caps, some that would be suitable for pass-through,
but at runtime pick more restrictive caps (for ex, after querying a driver for
what formats it actually supports).
2010-07-27 17:34:49 +02:00
Thiago Santos
574e6ab423 basetransform: Try suggesting caps on bad caps pad_alloc
When basetransform received an unsupported caps on pad_alloc
it just returned not-negotiated. This patch makes it query
the allowed caps between his sinkpad and upstream's srcpad
to find a caps to suggest.

This happens when dinamically switching pipeline elements
and upstream pad_allocs with the previous caps that was
being used.

Fixes #614296
2010-07-26 14:49:14 -03:00
Sebastian Dröge
29a35e70e1 basetransform: Allow the subclass to add new fields to caps when getting new caps from downstream
This was already done in all other cases where new caps are handled
except upstream negotiation.
2010-07-17 21:30:18 +02:00
Sebastian Dröge
55986b9a10 basesrc: Return values in stream time for the POSITION query
Fixes bug #623622.
2010-07-16 17:26:54 +02:00
Sebastian Dröge
249c4c18d0 basesink: Implement GstElement::get_query_types() 2010-07-16 17:26:50 +02:00
Sebastian Dröge
b2e7c4bd45 basesink: Only answer the SEGMENT query in pull mode
Otherwise the element handling the seeks should answer this query.

Fixes bug #623622.
2010-07-16 17:26:31 +02:00
Sebastian Dröge
e2db318921 basetransform: Implement POSITION query
Fixes bug #623541.
2010-07-16 17:26:22 +02:00
Alessandro Decina
3a553f4eda basesink: add accessors for the enable-last-buffer property.
API: gst_base_sink_set_last_buffer_enabled
API: gst_base_sink_is_last_buffer_enabled
2010-07-06 16:39:18 +02:00
Alessandro Decina
f079ff3f20 basesink: add new enable-last-buffer property.
Add a new enable-last-buffer property. When false, it disables storing the last
received buffer in basesink::last-buffer. This can be useful in cases where
buffers need to be released asap.

API: GstBaseSink::enable-last-buffer
2010-07-06 12:38:21 +02:00
Sebastian Dröge
a15344515a basesink: Initialize jitter to prevent printing an uninitialized variable if waiting for the clock failed 2010-06-17 13:20:13 +02:00
Wim Taymans
f80a824a2f basetransform: reevaluate proxy_alloc when reconfigured
When we reconfigure the transform element, make sure we reevaluate the proxying
of buffer_alloc the next time around.

Fixes #621332
2010-06-14 16:20:18 +02:00
Mark Nauwelaerts
7e23719a74 adapter: optimize progressive masked_scan
Retain the last scanned buffer entry and offset, so we can resume buffer
scanning there in case of a typical progressive scan.
Also potentially optimize _copy subsequently occurring in that area.
2010-06-14 15:09:59 +02:00
Mark Nauwelaerts
d5ed339f20 adapter: add extended masked_scan_uint32_peek that also provides matching value
Also add to .def and docs.

Fixes #619828.

API: gst_adapter_masked_scan_uint32_peek
2010-06-14 15:09:38 +02:00
Wim Taymans
76f7a001fc basetransform: add accept_caps vmethod
Allow subclasses to override the acceptcaps function because in some cases a
custom implementation can be much much faster than the default one.

See #621190
2010-06-14 12:45:20 +02:00
Olivier Crête
828f2a3389 basetransform: Assume size is the same if no transform_size/get_unit_size
Subclasses that don't implemen transform_size should be assumed to produce output
buffers of the same size.

https://bugzilla.gnome.org/show_bug.cgi?id=621334
2010-06-14 10:52:22 +02:00
Sebastian Dröge
83929a5849 basesink: Make sure we have a valid object to render in _render_object() 2010-06-13 18:05:41 +02:00
Sebastian Dröge
e6e29192bc Remove some dead assignments 2010-06-13 17:08:48 +02:00
Stefan Kost
9b5bc5199e basetransform: avoid a caps-copy
We can simply truncate the caps, as 'othercaps' is the result of intersect
operations and thus ours and writable.
2010-06-05 23:20:50 +03:00
Philippe Normand
6b8baaed50 basesink: Make gst_base_sink_query return TRUE if the segment query succeeded.
Fixes bug #620490.
2010-06-03 17:40:45 +02:00
Mark Nauwelaerts
aa8b8b57d7 adapter: fix _try_to_merge_up
That is, provide correct return value (as documented), and actually
loop to consider more than the first 2 buffers.
2010-05-27 14:57:29 +02:00
Mark Nauwelaerts
7479b64a2a collectpads: fix documentation glitch 2010-05-27 14:57:26 +02:00
Wim Taymans
3d72274b19 basesink: add jitter to debug output 2010-05-18 18:38:14 +02:00
Stefan Kost
a1c2071300 basesrc: reflow to truncate caps just once
We get writable caps from the intersection (unless it failed). As we truncate
those anyway, we don't need to manualy copy the first structure.
2010-05-06 17:04:53 +03:00
Tim-Philipp Müller
f77f7e987c docs: document that gst_byte_writer_put_string*() writes the terminator too 2010-05-05 16:34:47 +01:00
Wim Taymans
6e4fde7195 docs: clarify the pull_range functions
Clarify the gst_pad_pull_range(), GstBaseSrc::create(), gst_pad_get_range()
and GstPadGetRange functions a little.

Fixes #617733
2010-05-05 12:01:50 +02:00
Wim Taymans
d00e97b7ea basesrc: improve debugging 2010-05-04 11:45:02 +02:00
Stefan Kost
c96dec2a06 basesink: implement percentage position and duration queries
If upstream does not handle them, then implement those ourself.
2010-04-30 10:03:38 +03:00
Stefan Kost
c29e34113f basesink: use gst_pad_peer_query instead of reinventing. 2010-04-30 10:03:38 +03:00
Stefan Kost
2d49414eef queries: add more logging
Log human readable formats and log query result.
2010-04-30 10:03:38 +03:00
Jonas Holmberg
a120f9f4e6 basesrc: fix gst_base_src_new_seamless_segment()
Keep track of pending newsegment in gst_base_src_new_seamless_segment()
to avoid pushing newsegment update before newsegment.
2010-04-06 17:41:34 +02:00
Tim-Philipp Müller
c4a4f2dad2 libs: point gobject-introspection scanner to .la files
Point g-ir-scanner to the .la file of our library, which hopefully
makes it find the right dependencies in all cases (ie. our locally
built libgstreamer and not the system-installed one). This is also
how it's done in Gtk+ and how it's documented in the wiki, see
http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration

Based on patches by Vincent Untz and Alan Knowles.

Fixes #603710.
2010-04-03 13:41:52 +01:00
Thiago Santos
7558fed51b basetransform: Refactor caps suggestion on pad_alloc
Refactor the handling of sink suggestion caps variable
so that it always has a ref to the caps it points to.

Makes the code clearer.
2010-03-29 16:05:32 -03:00
Tim-Philipp Müller
1a72c2f01b libs: don't use fancy shell features when invoking gobject-introspection scanner
It's POSIX, but tcsh doesn't seem to support it.
2010-03-25 15:54:19 +00:00
Tim-Philipp Müller
8cc7274163 libs: fix PKG_CONFIG_PATH used when calling gobject-introspection scanner
Our own pkgconfig directory should come first, so that pkg-config uses
the in-tree libgstreamer and not some external one when --pkg=gstreamer-0.10
is passed to g-ir-scanner.

See #603710.
2010-03-25 13:48:19 +00:00
Edward Hervey
7a8004233a GstAdapter: add a unchecked variant of flush for internal usage
Trims off 10-20% cpu time when using gst_adapter_take[_buffer]
2010-03-25 10:28:21 +01:00
Robert Swain
9b6f93dcf3 basetransform: Implement QoS message posting
And some more for bug #322947
2010-03-18 16:57:17 +01:00
Wim Taymans
ba34494ce3 basesrc: catch, parse and store QoS event values
Catch, parse and store the QoS values from QoS events for later use.
2010-03-18 13:41:35 +01:00
Robert Swain
d576c1105e basesink: Implement QoS message posting in basesink
Post QoS messages when frames are dropped.
This goes a little further towards resolving bug #322947
2010-03-18 13:04:34 +01:00
Mart Raudsepp
96bff7ac62 docs: add missing "Since: 0.10.26" marker for gst_data_queue_new_full() 2010-03-17 11:03:15 +00:00
Tim-Philipp Müller
422e9c4ce3 docs: fix Since markers for gst_byte_writer_put_float*()
As the headers were broken in 0.10.26 the functions weren't really
usable back then, so we should advertise them as being there only
since 0.10.27.

Spotted by Mart Raudsepp.
2010-03-17 11:03:15 +00:00
Thiago Santos
a6a3c129d1 basetransform: Accept non-fixed caps suggestions
When doing pad_allocs, use non-fixed caps suggestions and
try to fixate them before using. This makes possible to
have suggested buffer size with 0 in basetransform just
to signal upstream a renegotiation is needed

Fixes #576234
Fixes #609046
2010-03-16 17:12:37 -03:00
Sebastian Dröge
2e05ca5de4 bytewriter: Use correct gtk-doc workaround 2010-03-15 14:52:41 +01:00
Benjamin Otte
e8f65e8bff Make code safe for -Wredundant-decls
Adds that warning to configure.ac

Includes a tiny change of the GST_BOILERPLATE_FULL() macro:
The get_type() function is no longer declared before being defined.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-10 20:45:33 +01:00
Sebastian Dröge
ce74a1ae19 build: Make some more rules silent if requested 2010-03-09 20:57:17 +00:00
Tim-Philipp Müller
91a09b9fd4 docs: fix up bytewriter doc chunks for float functions as well 2010-03-03 12:06:30 +00:00
Tim-Philipp Müller
e50b9aa71e bytewriter: fix headers for float/double writing functions
The functions are called gst_byte_writer_put_{float32|float64}_*() and not
gst_byte_writer_put_{float|double}_*().

Spotted by: Benjamin Otte <otte@redhat.com>
2010-03-03 11:28:27 +00:00
Mark Nauwelaerts
8cdf5a586f basesink: fix emergency rendering timestamp tracking
Specifically, if all (including initial) buffers turn up late,
emergency rendering should also kick in appropriately.

Fixes #611087.
2010-02-26 15:48:41 +01:00
Thiago Santos
035e5c74be collectpads: Improve docs about 'data' attribute
Adds a reminder to 'data' attribute doc

Fixes #610366
2010-02-18 17:00:05 -03:00
Edward Hervey
bc9e129990 basesrc: Don't use expensive cast checks in get_range.
_get_range() is a pad function set by ourselves, therefore we're certain that
the parent is a GstBaseSrc.

Speeds up _get_range by 38%, and the total call by 30%. (valgrind instruction
calls measurements).

Fixes #610246
2010-02-17 12:36:57 +01:00
Thiago Santos
bfff7a1b4e bytewriter: add _fill function
Adds a new function to GstByteWriter that writes
a constant value to a memory area (aka memset).
Useful for adding padding to buffers.

Also updates .def file and docs.

API: gst_byte_writer_fill()
2010-02-12 17:23:29 -03:00
Sebastian Dröge
fae502056f basesrc: Make locking of the segment a bit more strict and update documentation
Updating the segment values must only be done while holding the
STREAM_LOCK and OBJECT_LOCK. This means, reading can be done as
long as one of them is held, not both, which removes some lock-unlock
blocks from performance critical code paths.

Also document, that gst_base_src_set_format() *must* be called in
states <= READY and add an assertion for this. Changing the format
later will completely mess up the segment information.
2010-02-12 14:58:42 +01:00
Sebastian Dröge
5998e902a3 basesrc: Protect segment values from concurrent access from different threads
This could happen easily in the query functions or when the size is set
on appsrc from some non-streaming thread.
2010-02-12 11:02:08 +01:00
Thiago Santos
86a216b1ba gstbytewriter: Fix different function names in .h and .c
gst_byte_writer_reset_and_get_buffer wasn't declared
in .h, instead there was _reset_and_get_data_as_buffer.

Replace it with the real function name, that is smaller
and matches gst_byte_writer_free_and_get_buffer

https://bugzilla.gnome.org/show_bug.cgi?id=608726
2010-02-01 17:47:25 -03:00
Tim-Philipp Müller
087aa6ced4 gst_private.h: make sure gst_private.h is included before glib.h
For the reason outlined at the beginning of gst_private.h (inline
functions in glib may need the g_log_domain variable). Also include
gst_private.h before using any G_OS_* defines, esp. in plugin loader.
2010-01-20 01:48:56 +00:00
Sebastian Dröge
743cde4b49 basetransform: Only use suggested caps in buffer allocation if a size was suggested too 2010-01-17 08:23:48 +01:00
Sebastian Dröge
0a0c32ef88 basetransform: Handle buffers with NULL caps correctly
This means that the caps didn't change so don't try to handle
the NULL caps as the new caps.
2010-01-14 20:19:05 +01:00
Wim Taymans
8fff434835 typefind: add a new method that also uses the file extension
Add a method to perform get_range typefinding that also uses the
uri/location extension as an extra hint. It will first try to call the
typefind functions of the factories that handle the given extension. The result
is that in the common case, we only call one typefind function, which speeds up
the typefinding a lot.
2010-01-12 17:34:39 +01:00
Wim Taymans
d7ecbc6ac3 collectpads: don't keep buffers reffed longer than needed
Make sure we take ownership of the buffer early without increasing its refcount
when we go in the collect function. This reduces the amount of copies needed in
order to make the buffer writable in most cases.
2009-12-24 19:25:52 +01:00
Wim Taymans
633e8f4d9f collectpads: avoid doing subbuffers when we can
In some cases we can avoid allocating a subbuffer and instead simply ref
the buffer. Callers should perform _make_metadata_writable() in all
cases now.
2009-12-24 16:53:15 +01:00
Wim Taymans
4718b7ef09 collectpads: add ability to install clipping functions
Add a method to install a clipping function that is called when a buffer is
received. Users of collectpads can then perform clipping on the incomming
buffers.

Also retab the header file a little.

See #590265
2009-12-24 15:25:14 +01:00
Wim Taymans
a3fdb45aa6 basesink: add some more debugging 2009-12-11 16:19:18 +01:00
Sebastian Dröge
25fc43487b basesink: Allow update NEWSEGMENT events after EOS
This allows demuxers to update the segment stop of an already
finished stream. This might be needed if some stream goes to
EOS before the duration of the longest stream is known to properly
set the segment stop of all streams to the same value in the end.
2009-12-08 15:24:43 +01:00
Jan Schmidt
f490508490 basesrc: Shut down the pad task when the initial seek fails.
Set the pad flushing and stop the pad task when the initial seek fails
during activation. Avoids racy calls into the _create() function when
BaseSrc::stop() has already run.

Fixes: #603059

Also, fix some misspelled comments.
2009-12-04 12:41:58 +00:00
Edward Hervey
efa5aee509 basesrc/basesink: Register debug funcptr only once.
Makes basesrc/basesink initialization 3-4 times faster and avoids
contention on the global funcptr lock
2009-12-01 19:27:47 +01:00
Wim Taymans
8d34217dcc basesink: clip stepping boundaries
Rounding errors with the floating point rate could make it so that we
don't end up exactly at the required stepping duration.
Use the segment clipping boundaries, which are not subject to rate
adjustements, instead to detect when we reached the stepping duration.

Add some debug info related to going to the PAUSED state.
2009-11-28 22:34:19 +01:00
Stefan Kost
a9a6c0f0cd docs: fix broken xrefs 2009-11-27 18:31:39 +02:00
Stefan Kost
2ba8b37d15 docs: fix broken xrefs 2009-11-27 16:39:37 +02:00
Jan Schmidt
332eb4ea4d basesrc: Add gst_base_src_new_seamless_segment()
Merge new function from resindvd into the primary GstBaseSrc for
starting a new seamless segment.

API: gst_base_src_new_seamless_segment()
2009-11-21 18:23:51 +01:00
Tim-Philipp Müller
022970e9f9 bytewriter: fix compiler warning
Some gcc versions warn about bytewriter writing to memory accessed
via a const guint8 pointer, despite our explicit cast to guint8 *.
Work around that by using an intermediary variable.

Fixes #598526.
2009-11-20 16:14:54 +00:00
Jan Schmidt
81d3fda6e8 basesink: Clamp the base time correctly in position reporting
When clamping the base time, correctly use 'now', instead of
'-now' - the intent is to prevent 'now-base' ever being
negative, which would cause a position report outside the segment.

Fixes: #602419
2009-11-19 19:02:22 +01:00
Sebastian Dröge
cb28889b11 basesink: Handle the new sink-message event 2009-11-18 13:12:28 +01:00
Wim Taymans
9da89ef4e1 basesink: fix position reporting
Only update the current stream time after we checked if we got a new step
event. This improves the position reporting by the sink.

See #595958
2009-11-16 14:59:14 +01:00
Jan Schmidt
f83ea8233b basesink: Fix treating base_time as unsigned in position calculation
Element base_time is a signed quantity, which leads to basesink returning
a position of 0 when dealing with a negative base time - which are quite
legal when clocks (such as the audio clock) are close to 0.

This doesn't manifest in normal pipelines, of course - but can happen
(at least) when manually setting the base time on a pipeline.
2009-11-11 17:12:19 +00:00
Stefan Kost
f63ecd04a8 pad: rename new api from _refed to _reffed.
Due to popular demand rename the new api as we still can.
API: gst_pad_get_caps_reffed(), gst_pad_peer_get_caps_reffed()
2009-11-05 12:54:32 +02:00
Edward Hervey
27284628e4 optimisation : Use g_object_newv where possible.
This avoids:
* triple-checking for the GType when type-checking is enabled (see #597260)
* Avoids going through an expensive no-argument checking which landed in
  glib-2.22
* Avoids going through 2 extrac functions (g_object_new -> g_object_new_valist)
2009-10-28 09:31:17 +01:00
Tim-Philipp Müller
daecaf0e8a Remove GST_DEBUG_FUNCPTR where they're pointless
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a tenth of a polar bear.
2009-10-28 00:44:24 +00:00
Sebastian Dröge
c57e5bf07e typefindhelper: Remove obsolete FIXME
It's not necessary (and not a good idea) to cache the typefind factory
list anymore.
2009-10-24 13:14:25 +02:00
Edward Hervey
5067664c09 typefind: Keep typefind factories sorted in the registry. Fixes #599147
This avoids having to do the sorting everytime we use typefind

The behaviour of gst_type_find_factory_get_list has subtlely changed
in the sense that the order was previously undefined, whereas now
it returns them sorted by rank and then by name.
2009-10-24 10:44:09 +02:00
Edward Hervey
bb0918279f libs/base/typefindhelper: Remove useless typechecking in tight loop
The list against which we run the comparefunc will only contain
GstPluginFeature, therefore remove the 6 expensive type checks we do
for every single comparision.
2009-10-18 17:17:17 +02:00
Wim Taymans
e9f2714ff9 basesrc: fix race in PLAYING->PAUSED->PLAYING
When we quickly switch from PLAYING to PAUSED and back to PLAYING it's possible
in some cases that the task refuses to start, This is because when we go to
PAUSED, we unschedule the clock timeout, which could return UNSCHEDULED when
we're back to PLAYING, causing the task to PAUSE again with a wrong-state.

This patch checks if we are running when we return with an UNSCHEDULED return
value and if we are, try to create a new buffer.

Fixes #597550
2009-10-15 16:30:36 +02:00
Stefan Kost
7fcd73875f basesink: lets keep -1 for segmenst as they are guint64 and not GstClockTime 2009-10-09 17:44:28 +03:00
Stefan Kost
4efc01a61d basesink: use GST_CLOCK_TIME_NONE and GST_CLOCK_TIME_IS_VALID more 2009-10-09 17:15:52 +03:00
Edward Hervey
a8e03abd17 gst/base/basesink: Remove dead assignment.
The code was previously:
* checking if ret was != OK
* .. but if it was FLOW_STEP, swith it to OK
* .. and then not using ret

Instead we just make it more compact by checking if it's OK or STEP.
2009-10-08 08:53:54 +02:00
Tim-Philipp Müller
07d953b791 docs: fix Since: tags in docs for newly-added API 2009-10-07 23:34:44 +01:00
Stefan Kost
fcc5d783df pad: add variants of gst_pad_get_caps() that don't copy caps. Fixes #590941
In most places in core and baseclasses we just need the caps to do caps-
intersections. In that case ref'ed caps are enough (no need to copy).
This patch also switches the code to use the new functions.
API: gst_pad_get_caps_refed(), gst_pad_peer_get_caps_refed()
2009-10-07 22:41:30 +03:00
Mark Nauwelaerts
5f4daa8fd9 dataqueue: fix API documentation typo 2009-10-07 18:51:51 +02:00
Sebastian Dröge
41f7a3fe09 bytewriter: Add a generic byte writer
Fixes bug #590669.
2009-10-07 18:40:31 +02:00
Sebastian Dröge
f4c12be109 bitreader/bytereader: API: Add gst_(bit|byte)_reader_get_size()
... and GST_(BYTE|BIT)_READER() casts.
2009-10-07 17:59:51 +02:00
Sebastian Dröge
c7438c738b bytereader,bitreader: Remove FIXME 0.11 to remove non-inlined functions
The normal functions are always useful to have for bindings, especially
runtime-created bindings like Seed or new GObject-Introspection based
Python bindings.
2009-10-07 17:59:51 +02:00
Edward Hervey
ea9b0cedcd gstdataqueue: new constructor which takes callbacks.
This allows us to avoid going through glib's signalling system
2009-10-07 09:32:05 +02:00
Tim-Philipp Müller
d600ce0a29 bytereader: add inline version of gst_byte_reader_skip 2009-10-07 00:52:23 +01:00
Tim-Philipp Müller
6ce1f0cbce dataqueue, elements: avoid unnecessary runtime type checks 2009-10-06 20:04:10 +01:00
Sebastian Dröge
3c1f41ee7d introspection: Build pkgconfig before all libraries and set PKG_CONFIG_PATH
This way g-ir-scanner can find the gstreamer-0.10 pkg-config file.
2009-09-12 14:35:09 +02:00
Wim Taymans
b3d262d730 fix whitespace 2009-09-07 18:32:10 +02:00
Wim Taymans
8a19dc610e adapter: fix whitespace 2009-09-07 18:32:10 +02:00
Tim-Philipp Müller
96a565bdca bitreader, bytereader: add some FIXME 0.11 comments and fix indenting 2009-09-06 19:44:20 +01:00
Tim-Philipp Müller
4c103b00b5 bytereader: add unchecked and inline versions of the float getters/peekers
API: gst_byte_reader_get_float*_unchecked()
2009-09-06 18:51:18 +01:00
Tim-Philipp Müller
31ab124487 bytereader: add inline versions of the most common getters and setters 2009-09-06 18:51:18 +01:00
Tim-Philipp Müller
080b2e4fd5 bytereader: add inlined _unchecked() variants for some functions
API: gst_byte_reader_skip_unchecked()
API: gst_byte_reader_peek_*_unchecked()
API: gst_byte_reader_get_*_unchecked()
API: gst_byte_reader_{peek,get,dup}_data_unchecked()
2009-09-06 18:51:13 +01:00
Sebastian Dröge
741a946134 introspection: Strip Gst prefix from all types/functions 2009-09-05 12:30:07 +02:00
Sebastian Dröge
4b7518a4e5 introspection: Fix out-of-tree build 2009-09-05 12:04:59 +02:00
Sebastian Dröge
9f16dc384e introspection: Fix build if gir-repository is not installed 2009-09-05 11:51:55 +02:00
Sebastian Dröge
0bb8634b37 gstbase: Add gobject-introspection support 2009-09-05 10:28:46 +02:00
Tim-Philipp Müller
b9657d7477 docs: fix docs for gst_byte_reader_{get|peek}_float*() 2009-09-04 19:50:39 +01:00
Wim Taymans
bcb9eab392 basesrc: whitespace fixes 2009-09-01 16:52:32 +02:00
Wim Taymans
b6728ca46e adapter: whitespace fixes 2009-08-28 18:04:54 +02:00
Thijs Vermeir
0dd051eeb3 Check suggested caps for proxy alloc
Because we are trying to resolve a suggestion here we don't need
to check on caps for proxy_alloc but we need to check on the
suggested caps instead.
2009-08-28 18:04:50 +02:00
Wim Taymans
378594e520 basesink: whitespace fixes 2009-08-27 12:26:40 +02:00
Wim Taymans
76d9349956 basesrc: return result of _set_caps() 2009-08-24 17:57:16 +02:00
Wim Taymans
989d9861e3 basesink: whitespace fixes 2009-08-24 17:56:32 +02:00
Edward Hervey
8eb9d55627 basesink: Remove dead assignments 2009-08-08 14:47:57 +02:00
Stefan Kost
04470fc794 basetransform: use new _caps_can_intersect() 2009-08-06 15:30:33 +03:00
Stefan Kost
cfacd2cbb3 basetransform: only check caps_is_fixed() if they changed
The previous code could call gst_caps_is_fixed() for the same caps many times.
2009-08-06 15:30:33 +03:00
Wim Taymans
a2a973eafd basetransform: clarify _caps_is_equal() 2009-08-06 10:53:25 +02:00
Wim Taymans
ec4d259b67 basetransform: refactor metadata modifications
Check when we need to touch the metadata of the output buffer after selecting
the output buffer so that we have everything in one place.
Also take flags and timestamp modifications into account.
2009-08-06 10:53:22 +02:00
Wim Taymans
db6ce33e3a basetransform: enable optimisation
When we have the same input as output caps, reuse the input caps object. After
the caps refcounting has been sorted out now, we can finally enable this
optimisation.
2009-08-06 10:53:07 +02:00
Wim Taymans
6cf64beb79 basetransform: fix refcounting problem
Add some more debug info.
Make sure that the output buffer has writable metadata before we attempt to set
caps on it.

fixes #583999
2009-08-06 10:52:34 +02:00
Wim Taymans
575e1de88b basesink: cleanups in position queries
Use existing boolean flag to pass position queries upstream. Also add upstream
queries for the last position queries.
2009-08-06 10:45:30 +02:00
Stian Selnes
6033efb920 basesink: Query upstream for the position if conversion in PAUSED failed
Fixes bug #590045.
2009-08-06 06:41:57 +02:00
Kipp Cannon
6bc2bf8307 basetransform: Improve debug output in gst_base_transform_acceptcaps()
Fixes bug #589524.
2009-08-06 06:41:57 +02:00
Sebastian Dröge
6fd97a6d64 basetransform: Don't unset GAP flag if working in passthrough mode
Fixes bug #589314.
2009-08-06 06:41:57 +02:00
Mark Nauwelaerts
eeb6d810bc bytereader: avoid wrap-around in buffer size checks. Fixes #590622. 2009-08-03 20:55:21 +02:00
Edward Hervey
cfb22080e2 collectpads: Get the flushing state with the object lock taken.
Fixes #590056
2009-07-29 11:50:17 +02:00
Edward Hervey
c138aa8648 collectpads: Make sure the CollectData list is up-to-date when reading/setting it
Without this, we risked:
* Checking the flushing state on an unexisting list
* Not setting the flushing state on pads that had just been added

Partially fixes #590056
2009-07-29 11:50:06 +02:00
Edward Hervey
fcbba9b15a collectpads: Split out _check_pads into a version without lock taking.
This is so we can use _check_pads in places where we've already taken
the lock in question.

Partially fixes #590056
2009-07-29 11:49:39 +02:00
Robin Stocker
527da05476 basesrc: don't handle SEEKING queries for formats that don't match the one the source operates in
Return FALSE in basesrc's default query handler when we get a SEEKING query for
a format that's not the one the source operates in. Previously (ie. before, in
the git version) we would return TRUE in that case and seekable=FALSE, which
is more correct, but causes backwards compatibility problems. (Before that
we would change the format of the query when answering, which was completely
broken since callers don't expect that or check for it). Since the SEEKING
query is a fairly recent addition, not all demuxers, parsers and decoders
implement it yet, in which case any SEEKING query by an application will
just be passed upstream where it will then be handled by basesrc. Now, if
e.g. totem does a SEEKING query for TIME format and we have a demuxer that
doesn't implement the query, basesrc would answer it with seekable=FALSE in
most cases, and totem can only take that as authoritative answer, not knowing
that the demuxer doesn't implement the SEEKING query. To avoid this, we make
basesrc return FALSE to SEEKING queries in unhandled formats. That way
applications like totem can fall back on assuming seekability depending on
whether a duration is available, or somesuch. Downstream elements doing
such queries are likely to equate an unhandled query with a non-seekable
response as well, so this should be an acceptable fix for the time being.

See #584838, #588944, #589423 and #589424.
2009-07-24 11:54:31 +01:00
Wim Taymans
141e2af580 basesrc: make tag queuing threadsafe
See #588745
2009-07-20 13:40:16 +02:00
Edward Hervey
1d0c6a669f basesrc: Serialize tags into the dataflow. Fixes #588745 2009-07-20 08:49:43 +02:00
Tim-Philipp Müller
79c8e24885 docs: fix API docs for gst_{adapter|byte_reader}_masked_scan_uint32
Clarify byte reader docs a bit: offset is relative to the current
position of the reader, not to the start of the data. Also, the
examples in both the adapter docs and the byte reader docs have
the mask and pattern arguments swapped (see #587561). Spotted
by Carl-Anton Ingmarsson.
2009-07-16 14:17:03 +01:00
Stefan Kost
3ce0c64b45 basetransform: take size once 2009-07-14 08:32:24 +02:00
Stefan Kost
cfae0c15e7 collectpads: make it the best of wims and edwards patch.
Check the right flushing flag, but still add it to the pad-list.
2009-07-07 00:23:41 +01:00
Stefan Kost
2288f9f6ec basetransform: make comment a FIXME comment 2009-07-06 19:52:44 +01:00
Stefan Kost
4bfb312e13 logging: use perf category for dropped buffers 2009-07-06 19:52:44 +01:00
Edward Hervey
e6d949328f collectpads: Don't forward FLUSH_STOP if some input streams are still flushing.
This guarantees that only one FLUSH_STOP event (the last one) will be sent
downstream when a flushing seek is being done through collectpads.
2009-07-05 21:24:42 +02:00
Edward Hervey
ed18ceffe6 collectpads: Update the cookie when setting ourselves as flushing.
This forces the pad status to be re-evaluated on the next _check_pads().
2009-07-04 17:17:18 +02:00
Tim-Philipp Müller
4d76b175ef docs: fix gtk-doc /*< private >*/ marker 2009-07-02 01:18:57 +01:00
Wim Taymans
92b0f32d74 bufferlist: use faster gst_buffer_list_get()
Use the faster gst_buffer_list_get() to get the first buffer of a list.
2009-06-29 11:56:10 +02:00
Ognyan Tonchev
27fe127e76 basesink: take timestamp later
Make sure we don't accidentally cast a bufferlist of a buffer and try to take
the timestamp of it.

Refixes #585960
2009-06-29 11:46:00 +02:00
Stefan Kost
3e21ddf81f logging: add a performace log category
This category can be used to log slow code path and help auditing the
performance. Add FIXME-0.11 to some questionable categories.
2009-06-29 11:28:01 +03:00
Tim-Philipp Müller
31ff42de21 basesink: don't do things with side effects within a g_assert()
Make the bufferlist stuff work properly when things are compiled
with -DG_DISABLE_ASSERT.
2009-06-25 11:25:46 +01:00
Tim-Philipp Müller
6b64d41937 bytereader: add a bunch of utility functions for strings and a data dup function
API: gst_byte_reader_dup_data
API: gst_byte_reader_dup_string
API: gst_byte_reader_dup_string_utf8
API: gst_byte_reader_dup_string_utf16
API: gst_byte_reader_dup_string_utf32
API: gst_byte_reader_skip_string
API: gst_byte_reader_skip_string_utf8
API: gst_byte_reader_skip_string_utf16
API: gst_byte_reader_skip_string_utf32
API: gst_byte_reader_peek_string
API: gst_byte_reader_peek_string_utf8
API: gst_byte_reader_get_string
API: gst_byte_reader_get_string_utf8

And some basic unit tests. Fixes #586568.
2009-06-23 02:17:48 +01:00
Wim Taymans
dd3e2b557e collectpads: use the right flushing flag.
We need to use the pad private flag because the other pad flag is protected with
the pad lock instead.
2009-06-18 16:50:42 +02:00
Edward Hervey
a295d22575 collectpads: Properly handle flushing pads.
If a pad is flushing, it should not be considered as either eos or
containing data.
2009-06-18 16:43:27 +02:00
Wim Taymans
c88e05c861 basesink: add Since tag for new method 2009-06-16 13:34:38 +02:00
Branko Subasic
de5bcfc4cd basesink: add support for buffer list
Fixes #585960
2009-06-16 13:32:37 +02:00
Wim Taymans
6a1d8feccc collectpads: fix .h indentation 2009-06-15 18:44:14 +02:00
Wim Taymans
4c990aab3a basesrc: add some more debug 2009-06-15 18:43:52 +02:00
Tim-Philipp Müller
674447fafe bytereader: add gst_byte_reader_masked_scan_uint32()
Add a pattern scan function similar to the one recently added to
GstAdapter, and a unit test (based on the adapter one).
Fixes #585592.

API: add gst_byte_reader_masked_scan_uint32()
2009-06-13 10:53:49 +01:00
Wim Taymans
25067558dc stepping: more stepping improvements
Update design doc with step-start docs.
Add eos field to step done message
when stepping in reverse, update the segment time field.
Flush out the current step when we are flushing.
2009-06-12 13:20:36 +02:00
Wim Taymans
23b772664b basesink: post step-start
when we clip, also stop the stepping.
Don't do QoS when stepping
Post step-start when queueing and activating the step.
2009-06-12 13:16:29 +02:00
Wim Taymans
6e633cbe33 basesink: update segment start/stop for clipping
When we start stepping, store the start/stop values of the segment before we
install new start/stop values for clipping in non-flushing steps.

for non-flushing steps, update the element start time. For flushing steps, it
does not change because running_time does not advance

Make sure we always perform the stop_stepping operations even when we drop
frames.
2009-06-09 12:06:35 +02:00
Wim Taymans
72e8d9909c basesink: do proper clipping in stepping
Update the stop position of the segment so that we clip correctly.
After clipping in non-flushing mode, rerender the remainder of the buffer.
2009-06-09 10:25:34 +02:00
Wim Taymans
89c42f8506 stepping: do flushing steps correctly
Note in the docs that a flushing step in PLAYING brings the pipeline to the lost
state and skips the data before prerolling again.

Implement the flushing step correctly by invalidating the current step
operation, which would activate the new step operation.
2009-06-08 17:41:56 +02:00
Jan Schmidt
f0f9ed875f basesink: Change awkward wording in a translateable message. 2009-06-08 16:16:27 +01:00
Wim Taymans
a4c6d04b4c basesink: add non-flushing steps
Add support for non-flushing steps and with different rates.
Clear step info when flushing
2009-06-08 16:27:36 +02:00
Mark Nauwelaerts
4bb3702886 basesrc: reply to QUERY_SEEKING with original format. Fixes #584838. 2009-06-05 16:01:27 +02:00
Wim Taymans
fa7db7d247 basesink: fix clipped start/stop after step
Use the segment helpers to get a more accurate clipped start/stop position after
a stepping operation ended.
2009-06-04 17:27:03 +02:00
Wim Taymans
957e40343d basesink: use more correct segment methods
Use the more correct new segment methods for updating the segment before and
after a step.
2009-06-04 12:53:23 +02:00
Wim Taymans
a907f8d145 basesink; handle EOS correctly.
Handle EOS and buffers without a timestamp gracefully.
Remove a warning that is not so much a warning now anymore.
2009-06-03 15:39:13 +02:00
Wim Taymans
c811d51471 basesink: forget previous times when stepping
When we start a flushing step operation, forget about the previous stream time
so that the position reporting works correctly.
2009-06-03 10:39:53 +02:00
Wim Taymans
71a5ebe638 basesink: fix regression in unit tests
Store the timestamp of the buffer after prerolling. While we are prerolled we
want to report the position of the segment start value.
2009-06-02 15:37:22 +02:00
Wim Taymans
484d188440 basesink: post a warning on excessive framedrops
When we go into emergency rendering, post a warning informing the user about
this fact.
2009-06-01 19:37:14 +02:00
Wim Taymans
5479772bec basesink: more stepping in reverse
Fix stepping and position reporting in reverse playback.
2009-06-01 13:37:29 +02:00
Wim Taymans
8c54c70d9c basesink: use start_time as the step start
Use the start_time of the element as the point from where the step operation
starts. This fixes stepping in all paused states.
2009-06-01 13:37:29 +02:00
Wim Taymans
642bb32196 basesink: catch step cases in _wait_preroll()
When a subclass is blocking in _wait_preroll() in the _render method, make sure
we can unlock the subclass and detect this return value from the render method.
2009-06-01 13:37:29 +02:00
Wim Taymans
1caab05238 basesink: more stepping in reverse fixes 2009-06-01 13:37:28 +02:00
Wim Taymans
4be27fa555 basesink: small cleanups 2009-06-01 13:37:28 +02:00
Wim Taymans
0c205b96b4 framestep: implement backwards framestep
Update framestep document, we want to pass the flush flag in the step-done
message.

Add flush flag to the gstmessage.

Update examples to use the new step-done message api.

Implement framestep with playback rates < 0.0 too.
2009-06-01 13:37:28 +02:00
Wim Taymans
1839782379 basesink: add framestepping in time 2009-06-01 13:37:28 +02:00
Wim Taymans
7a7e9629ce basesink: keep track of stepped time
Pass running_time around so that the stepping code can calculate the elapsed
time correctly.
2009-06-01 13:37:27 +02:00
Wim Taymans
f07b86f18b basesink: move stuff around, more stepping
Make start and stop_stepping methods and move their invocation in the right
places.

Perform the atual stepping operation where we have full context about the
timestamps.
2009-06-01 13:37:27 +02:00
Wim Taymans
546c959f26 basesink: first stab at frame stepping in PAUSED
Unlock the prerolled frame and recheck if we need to step.
Keep a simple counter for the frames we're about to skip while stepping and
preroll/post step_done when stepping finished.
2009-06-01 13:37:26 +02:00
Arnout Vandecappelle
c74c3bf1b3 adapter: fix _masked_scan_uint32() at boundaries
gst_adapter_masked_scan_uint32 could return values smaller than offset
if the first byte(s) of the mask are 0 and the pattern matches the
beginning of the adapter.
Added examples to documentation of gst_adapter_masked_scan_uint32().
Also added some more masked boundary tests.
Fixes #584118
2009-05-28 22:02:21 +02:00
Edward Hervey
d72c17e328 gsttypefindhelper: Fix indentation 2009-05-22 12:57:10 +02:00
Wim Taymans
72232cfef1 adapter: improve the flush function
Remove a compare and branch from flush.
2009-05-20 22:20:46 +02:00
Wim Taymans
fd76e4fc93 adapter: potentially save a memcpy in _take
Directly use the assembled_data in _take() functions when we can instead of
copying it out.
2009-05-20 12:48:41 +02:00
Wim Taymans
f3ff7ad055 adapter: micro optimisations 2009-05-20 11:36:11 +02:00
Wim Taymans
49c4e367e9 adapter: avoid comparisions in fast path
Small tweaks to reduce the number of useless compares in loops.
2009-05-20 11:12:43 +02:00
Wim Taymans
9197f4399b adapter: avoid branch in copy code 2009-05-20 10:28:45 +02:00
Wim Taymans
270723c85c adapter: add _masked_scan_uint32
Add a reasonably optimized new gst_adapter_masked_scan_uint32() function
to scan the adapter for a pattern after applying a mask.

Add some unit tests.

API: GstAdapter::gst_adapter_masked_scan_uint32()

Fixes #583187
2009-05-20 00:37:53 +02:00
Wim Taymans
d6b21ba529 adapter: more optimisations
Remove duplicate copy code (_peek_into and _copy) and make a unified
optimized copy function.
2009-05-19 22:13:04 +02:00
Wim Taymans
b23279e922 adapter: don't use realloc, it does a memcpy
Don't use realloc to grow the scratch area because we don't want the memcpy the
old useless data into the new area before we write our new stuff in it.
2009-05-13 23:52:02 +02:00
Wim Taymans
cc7985ab48 adapter: use g_realloc for resizing the buffer
Use g_realloc for resizing the internal buffer instead of a
less fancy _free/_malloc pair.
2009-05-13 22:51:18 +02:00
Wim Taymans
bb013081a4 adapter: move new member to private struct
Move the new members to a private struct because we don't have enough padding
anymore on 32-bits platforms.
2009-05-13 21:35:23 +02:00
Wim Taymans
763a6f6761 adapter: update some docs 2009-05-13 18:50:23 +02:00
Wim Taymans
3d19b75147 adapter: add method to keep track of timestamps
Keep track of the timestamp and offset associated with the current head of the
adapter.

API: GstAdapter::gst_adapter_prev_timestamp()
2009-05-13 16:22:58 +02:00
Wim Taymans
8ceff30ca9 adapter: small cleanups 2009-05-13 16:20:26 +02:00
Wim Taymans
605639a2bf adapter: optimize taking the headbuffer
When a are requested to take a buffer from the adapter that is exactly the
headbuffer, don't make a subbuffer of it but return that head buffer.

Add a unit-test for this new optimisation.
2009-05-12 10:25:40 +02:00
Wim Taymans
50bcf96ffe basesrc: don't ignore pad_start return value 2009-05-11 23:06:39 +02:00
Stefan Kost
e778c5fd8b logging: fix unused variable warning when disabling debug logs.
The var was NULL anyway, bacause of the ifdefs there, the message makes no
sense including it.
2009-04-15 23:35:35 +03:00
Edward Hervey
9e4fa43657 basesink: Remove dead assignments.
sstart/sstop/rstart/rstop are all either:
* assigned values later on before being used in 'do_times:' (EOS and buffers)
* not used (non-EOS events)
2009-04-04 14:39:51 +02:00
Edward Hervey
ec3cd5d438 basesrc: remove dead assignment.
The variable will not be read before it's assigned a value line 942/945
2009-04-04 14:38:52 +02:00
Sebastian Dröge
d12034ab4b gst: Use g_once_init* or G_DEFINE_TYPE 2009-04-04 10:59:39 +02:00
Edward Hervey
471bd93af5 adapter: remove dead assignment.
The value set to to_copy at that line is never used, and is overwritten
further down before being read.
2009-04-03 12:57:24 +02:00
Edward Hervey
6577af3635 basesink : Remove unused variable.
sync is never used anywhere in that code.
2009-04-03 12:57:24 +02:00
Edward Hervey
9bf1d7247a basetransform: move unused variable in the #if 0 block.
That variable is only used by the code which has been if 0'd
2009-04-03 12:57:24 +02:00
Edward Hervey
00cbbc87c7 Remove unused variables detected by LLVM's Clang static analyzer. 2009-04-03 12:56:48 +02:00
Tim-Philipp Müller
13f8041238 basesink: fix once-per-second 'emergency rendering' for case where all buffers but the very first are late
Due to a typo basesink didn't do any emergency rendering of late buffers
if the only buffer ever rendered was the first one with timestamp 0. This
means that in cases where the decoder is very very slow, we'd never see
any buffers but the very first one rendered. Fixes #576381.
2009-03-23 12:34:34 +00:00
Stefan Kost
c2f1cb40fc collectpads: add debug logging to make it easier to trace it 2009-03-15 23:41:33 +02:00
Edward Hervey
c1a75a0b45 gstbasesrc: unsigned long is "%lu", not "%ul". Fixes build on macosx 2009-03-11 11:23:05 +01:00
Stefan Kost
36205e7d42 logging: some additional logging for tracing caps negotiation.
Demote one log that can come quite often. Remove one fixme that is done. Apply
gst-indent changes.
2009-03-10 21:13:40 +02:00
Stefan Kost
de48f9c507 collectpads: revert accidential commit from the queue (me should start using branches) 2009-03-06 22:10:10 +02:00
Stefan Kost
436b0e7275 collectpads: reliably go to eos. Fixes #574160
Update collectpads status when removing pads.
2009-03-06 21:50:19 +02:00