Commit graph

1110 commits

Author SHA1 Message Date
Wim Taymans 72232cfef1 adapter: improve the flush function
Remove a compare and branch from flush.
2009-05-20 22:20:46 +02:00
Stefan Kost 6784355d52 controller: fix assertion when freeing the control source 2009-05-20 17:33:18 +03: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
Sebastian Dröge 10743802be controller: Use ordered GSequence instead of GList
This makes lookups and insertions O(log n) instead of
always O(n) for insertions and O(n) in worst case for
lookups.

Fixes bug #582564.
2009-05-14 22:13:47 +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
Stefan Kost dd3c9ab6b6 controller: factor out duplicated code and add a description for it.
Also fix typo in the tests while reviewing them.
2009-04-14 22:08:56 +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 14b356b439 controller: remove dead assignment.
The value of prop is being overwritten just after without being read.
2009-04-03 12:57:24 +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
Sebastian Dröge 3933296685 gstcheck: Call gst_check_init() before creating the suite
This allows using the GStreamer or GObject API in the suite
creation function.
2009-04-02 10:44:23 +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 b118e869a2 controller: Fix generation of control-change arrays.
When generating arrays of control changes timestamp variable was used instead
the local ts variable that we increment when stepping through the array.
Pointed out by Martin Pokorny.
2009-03-20 11:28:37 +02:00
Tim-Philipp Müller d430552ec3 gstcheck: fix for check versions > 0.9.6
A new argument allowed_exit_value was added in SVN recently (#574213).
2009-03-19 21:31:08 +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
Andy Wingo e2ff005e63 basesink: propagate UPSTREAM events in pull mode too
* libs/gst/base/gstbasesink.c (gst_base_sink_send_event): Propagate
  upstream events in pull mode too.
2009-03-05 17:42:22 +01:00
Edward Hervey f0481cb717 GstAdapter: Discard empty buffers in _push(). Fixes #574024 2009-03-04 09:20:43 +01:00
Stefan Kost df620c9cb6 basesink: move left over handling of the error case to the activate_failed label.
If was left as dead code.
2009-02-26 15:42:06 +02:00
Wim Taymans 79c3c6a339 Error out more specifically on empty caps
When we get empty caps from the getcaps function in the default negotiate
function, post a more descriptive error.
2009-02-23 17:37:46 +01:00
LRN 4cd4883ed3 Fix signed when compiling with MSys/MinGW
fix signed issues when compiling with MSys/MinGW.
Fixes #572591.
2009-02-23 12:33:13 +01:00
Wim Taymans 805569c873 Don't forward LATENCY event when not ready
When we are not ready to handle a latency query (we are not yet prerolled) we
also don't try to forward the latency event because that might cause unexpected
errors when upstream is not yet linked.
2009-02-23 10:53:17 +01:00
Stefan Kost e31a7709c3 controller: remove unused variable 2009-02-05 13:42:30 +02:00
Stefan Kost f207841b89 check: Don't assume gst_pad_get_peer returns non NULL value. 2009-02-04 16:07:30 +02:00
Wim Taymans d807bca61c GstBaseSink: use new variable to schedule preroll
Use a separate variable to keep track if we need to call the preroll method
instead of abusing the commited variable.
2009-02-03 15:27:34 +01:00
Wim Taymans fe4233120c GstBaseSink: avoid calling preroll multiple times
Fix a regression introduced by fix for #567725 in commit
1c7ab4ed4f. We should only call the preroll
function once namely when we did not yet commit the state change.

Add a unit test to check that we call the preroll function when interrupting the
clock_wait (see #567725).

Add a unit test to check that we only call the preroll function once.
2009-02-03 12:52:49 +01:00
Thijs Vermeir 8a080229c7 Force reconfigure of basetransform to recheck alloc request
While reconfiguring a basetransform element we need also to recheck
the alloc request. Because it's possible that due to caps changes
the proxy_alloc state is not correct anymore.
(Re-commit after discusion with Wim on IRC)
2009-02-02 18:23:41 +01:00
Wim Taymans c786c5224a Revert "Check suggested caps for proxy alloc"
This reverts commit 50afd45957.

It breaks the interactive test-scale unit test.
2009-01-30 10:45:17 +01:00
Wim Taymans a371ea6e5f Revert "Force reconfigure of basetransform to recheck alloc request"
This reverts commit 3a4602d771.

It breaks the interactive test-scale unit test.
2009-01-30 10:45:16 +01:00
Stefan Kost 45a17154b7 Add logging in failure case. Add more details to a todo comment. 2009-01-29 17:46:52 +02:00