Commit graph

1061 commits

Author SHA1 Message Date
Thiago Santos 1a50186630 queue2: fix printf format
Cast the variable to gint to conform to the printf format used.
It is casted rather than changing the format because the
message is created with a cast to gint too.
2009-11-10 11:55:34 -03:00
Thiago Santos 245089c9bd queue2: avoid crashing due to negative percent
queue2 would crash when using small buffer sizes because
it would overflow when calculating the percentage, resulting
in the buffering GstMessage not being created and trying to be
used. This patch uses a gint64 instead of a gint to do the
percentage math, making it harder to overflow.
2009-11-10 10:10:56 -03:00
Thiago Santos 5c7104c002 queue2: Fix small doc typo 2009-11-10 09:52:30 -03:00
Bastien Nocera 9581e5887c implement buffering-left argument to buffer messages
Using the current fill level of the queue, and the average input
rate, we can determine how long it will take to finish downloading
the whole stream to the temporary file.

Fixes #600726
2009-11-05 15:22:35 +01:00
Stefan Kost 69ea131cfa build: include stdio.h for FILE 2009-11-03 17:30:14 +02:00
Sebastian Dröge 22fbce48bb queue2: Use "Queue 2" as long name 2009-10-29 11:38:21 +01:00
Sebastian Dröge 0f1c4ab188 queue2: Use GST_BOILERPLATE_FULL() and add pad templates/set details in base_init 2009-10-29 11:35:08 +01:00
Sebastian Dröge 5c821a0df5 queue2: Use gst_element_class_set_details_simple() 2009-10-29 11:30:57 +01:00
Sebastian Dröge 40732dd308 queue2: Integrate into coreplugins 2009-10-29 11:30:11 +01:00
Sebastian Dröge 08e3cb531c queue2: Move struct declarations to a separate header 2009-10-29 11:21:36 +01:00
Sebastian Dröge 9236921a34 queue2: Move queue2 to gstreamer coreplugins
Fixes bug #599996.
2009-10-29 11:18:20 +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
Tim-Philipp Müller ff7d9470b7 capsfilter: sprinkle some GST_DEBUG_FUNCPTR 2009-10-28 00:44:07 +00:00
Wim Taymans 03baa04059 multiqueue: buffering is implemented now 2009-10-27 14:40:19 +01:00
Wim Taymans b852da60d4 multiqueue: make sure percent increases
Keep track of the last posted percent message and make sure the next percent
messages are strictly increasing.
2009-10-27 14:40:17 +01:00
Wim Taymans 30fc865162 multiqueue: refactor buffering code
Move the buffering update code to a separate function so that we can call it
when the buffering state changes due to EOS.
Avoid dividing by 0.
2009-10-27 14:40:15 +01:00
Wim Taymans 99dd9830a9 multiqueue: add buffering support
Add support for buffering mode where we post BUFFERING messages based on the
level of the queues. It currently operates on the first queue that goes over or
under the high/low thresholds.
2009-10-27 14:40:12 +01:00
Wim Taymans 07991ae4ab multiqueue: don't check visible items in buffering
In buffering mode we want to ignore the max visible items to decide when the
queue is filled. Instead, we only look at the number of bytes and/or time in the
queue.
2009-10-27 14:40:09 +01:00
Wim Taymans 6ac9191527 multiqueue: hook up low/high percent
Hook up the low/high percent properties for the buffering mode.
2009-10-27 14:40:07 +01:00
Wim Taymans b9d4f6e550 multiqueue: hook up property for buffering 2009-10-27 14:40:02 +01:00
Wim Taymans c6b0d4a43d multiqueue: small cleanups
Remove unused variable to avoid confusion
Fix some typo
2009-10-27 13:22:47 +01:00
Wim Taymans 6082b0bc89 multiqueue: add FIXME for wrong code
Needs further investigation
2009-10-27 13:18:31 +01:00
Wim Taymans 354cf53f81 multiqueue: fix debug output 2009-10-27 13:18:29 +01:00
Wim Taymans 606852c586 multiqueue: avoid shadowing function argument
Don't shadow the sq argument in the underrun_cb function but use
a different variable name to iterate the other queues.
Use the same variable name in the overrun_cb function.
2009-10-27 13:18:25 +01:00
Wim Taymans 814ee012e7 multiqueue: make queue arg explicit
Make the queue argument to IS_FILLED explicit
2009-10-27 13:18:20 +01:00
Wim Taymans c490d7542c multiqueue: fix properties
Fix properties, make the extra-size properties as not implemented.
2009-10-27 13:18:00 +01:00
Wim Taymans 2f7b348fc0 tee: implement custom acceptcaps function
Implement a custom acceptcaps function on the sinkpad. We can accept any caps as
long as it is accepted by all downstream peer elements.
2009-10-21 16:26:01 -04:00
Wim Taymans b95cc5031b multiqueue: avoid lock for taking the counter
The counter for incomming data is already protected with the STREAM_LOCK so we
don't need to add another lock around it.
2009-10-21 13:38:57 -04:00
Stefan Kost 9f9353a84a queue: more queue optimizations
Split gst_queue_locked_enqueue() into variant for buffer and event to get rid of
the if() and make the code more readable (constant boolean parameters are never
nice). Removes the if (item) checks as we dereference the pointer before anyway.

Also apply the same idea of reusing the previous knowledge in
gst_queue_locked_dequeue to remove more type checks.
2009-10-08 10:54:42 +03:00
Stefan Kost 963932b1f1 multiqueue: split gst_multi_queue_item_new
Split gst_multi_queue_item_new into buffer and event variant to make save an if
and make code more readable.
2009-10-08 10:54:35 +03:00
Edward Hervey 4cfe11d42c plugins/gstfilesrc: Make a fast-path for length == 0 buffer creation.
If the requested length is 0, we don't need to read anything from the file.
2009-10-08 08:55:59 +02:00
Michael Smith 0c3a8165b6 filesink: Use _wfopen on win32 to open files with non-ascii filenames correctly. 2009-10-07 16:03:30 -07:00
Mark Nauwelaerts e51a34985f multiqueue: flush queue upon fatal flowreturn and release upstream thread 2009-10-07 18:51:52 +02:00
Edward Hervey 61ec6a561c plugins/multiqueue: Avoid instance check
We know earlier on in the code whether we're handling an event or a buffer,
just pass that information through.

This commit and the previous commit reduce instruction fetch:
* when pushing buffer (_chain) by 10%
* when popping buffer (_loop) by 3%
2009-10-07 10:07:01 +02:00
Edward Hervey c15879f94e plugins/multiqueue: Cache input/output time, avoid expensive calls.
* Cache the input/output time
* Only recalculate it when needed.

Avoids 50% calls to gst_segment_to_running_time
2009-10-07 10:07:01 +02:00
Stefan Kost cfb4aa4627 build: sprintf, sscanf need stdio.h 2009-10-07 10:59:54 +03:00
Edward Hervey 7c6d555848 plugins/multiqueue: Use new GstDataQueue constructor 2009-10-07 09:32:47 +02:00
Edward Hervey 8c67b6390e plugins/multiqueue: Use cached value instead of expensive object get.
The task will always exist as long as its owner (i.e. the pad) and that
owner's owner (i.e. multiqueue) exist.

Reduces the number of instruction fetches by 36%.
2009-10-07 09:25:41 +02:00
Edward Hervey d28a3e7435 plugins/queue: Use previous knowledge of data type to avoid typecheck.
We know whether we have a buffer or an event, use that instead of going
trough the expensive GLib typecheck.

The overall instruction fetch reduction introduced by this commit and the
2 previous commits:
* receiving a buffer (_chain) by 20%
* popping a buffer (_loop) by 14%

Numbers acquired through callgrind passing 100000 buffers through queue.
2009-10-07 09:15:13 +02:00
Edward Hervey 9be7fdc857 plugins/queue: Avoid useless segment_to_running_time() calculations.
* Cache src and sink time
* Use a boolean to know whether src/sink time need to be recalculated

Avoids 50% calls to gst_segment_to_running_time()
2009-10-07 09:06:21 +02:00
Edward Hervey b1945ad429 plugins/queue: Just cast to the object parent instead of typechecking. 2009-10-07 09:06:11 +02:00
Sebastian Dröge d6de0e4cce multiqueue: Improve iterate internal links function
Pads have their GstSingleQueue stored as element private data
so there's no need to iterate over the list of single queues
every time. Also every pad only has a single internal link so
use a single iterator instead of a complex custom iterator.

Set the element private data of the pad to NULL when freeing the
single queue.
2009-10-07 07:18:04 +02:00
Tim-Philipp Müller 6ce1f0cbce dataqueue, elements: avoid unnecessary runtime type checks 2009-10-06 20:04:10 +01:00
Wim Taymans b3d262d730 fix whitespace 2009-09-07 18:32:10 +02:00
Wim Taymans eaf7582b8f queue: whitespace fixes 2009-08-28 17:49:11 +02:00
Sebastian Dröge 269d3581c5 multiqueue: Use iterate_internal_links instead of deprecated get_internal_links 2009-08-18 14:57:18 +02:00
Laurent Glayal abafed991e filesink: Add property to allow to append to an already existing file
Fixes bug #591441.
2009-08-18 08:45:08 +02:00
Mark Nauwelaerts 3352c5d970 queue: post error message when pausing task
If downstream returns error and upstream has already delivered
everything (including EOS) and will no longer be around to find
out that we paused (and why), post error message.  Fixes #589991.
2009-08-06 13:42:25 +02:00
Wim Taymans 2f5ed9e29d capsfilter: only set caps when different
When we have an input buffer with caps and when those caps are different from
the caps we want, only then make a writable copy of the input buffer as the
output buffer and set the caps on that output buffer. This avoids some cases
where we took a subbuffer for setting caps that were the same.
2009-08-06 10:53:12 +02:00
Wim Taymans 49f24e2044 queue: get caps after making writable
Get the caps of the buffer after we made the buffer writable. This did not
cause any problems but it's nicer this way.
2009-08-06 10:52:56 +02:00