Commit graph

1849 commits

Author SHA1 Message Date
Sebastian Dröge
ab6a1085ee (multi)queue: Don't access query items during flushing 2013-05-27 16:38:18 +02:00
Sebastian Dröge
e472d9d261 multiqueue: Don't do serialized queries when we're flushing
Just immediately fail the query, otherwise we would wait forever
for the query to be answered.
2013-05-27 16:22:00 +02:00
Sebastian Dröge
a03435dfba queue2: First set query result, then signal GCond 2013-05-27 16:08:39 +02:00
Sebastian Dröge
6f042f13ae queue: Fix handling of serialized queries
During FLUSH_START the query needs to be unblocked already, otherwise
it can lead to deadlocks if the FLUSH_START is the result of something
done from the streaming thread of the srcpad (the queue will never be
emptied!).
2013-05-27 15:59:07 +02:00
Sebastian Dröge
cdc429f296 queue2: Unblock any waiting serialize queries on FLUSH_START
Fixes some deadlocks during flushing.

And store queue items differently to not accidentially read
already unreffed queries when flushing. Queries are owned by
upstream and not us.
2013-05-27 15:41:14 +02:00
Sebastian Dröge
b6fac17502 queue/queue2/multiqueue: When flushing, make sure to not lose any sticky events
https://bugzilla.gnome.org/show_bug.cgi?id=688824
2013-05-27 13:01:43 +02:00
Nicolas Dufresne
5bbc6f1c8c valve: Don't read sticky flag from unrefed event 2013-05-25 22:03:53 -04:00
Tim-Philipp Müller
789b68e506 tee: fix property description for now-unused "alloc-pad" property
Should probably proxy ALLOCATION queries on that though, if set.
But what else? CAPS and ACCEPT_CAPS too?
2013-05-24 23:28:04 +01:00
Sebastian Dröge
e692993e79 queue2: Add support for serialized queries if using a memory queue 2013-05-24 19:22:22 +02:00
Sebastian Dröge
46270f8925 queue: Set the last serialized query result to FALSE when flushing 2013-05-24 18:47:24 +02:00
Sebastian Dröge
a79d3a0220 multiqueue: Initialize all GstMultiQueueItem fields in both code paths 2013-05-24 18:42:55 +02:00
Sebastian Dröge
1c6341e6a4 multiqueue: Don't access the query after signalling the waiting thread
It might've free'd the query already.
2013-05-24 18:38:40 +02:00
Sebastian Dröge
3b44a44a01 multiqueue: Make sure to always signal any possible pending serialized queries
And don't unref them when flushing the queue, they're owned by the caller!

https://bugzilla.gnome.org/show_bug.cgi?id=700342
2013-05-24 18:30:44 +02:00
Sebastian Dröge
1d1946a321 typefind: Handle the force-caps property more similar to all typefinding code flow
This makes sure that events happen in order and simplifies the code a bit.
2013-05-15 13:22:04 +02:00
Sebastian Dröge
8e1f70473b queue: Store sticky events on the srcpad if we're dropping them because of leaking 2013-05-09 12:50:20 +02:00
Sebastian Dröge
f93c52684a outputselector: Always forward sticky events to all pads 2013-05-09 12:27:12 +02:00
Sebastian Dröge
1d40478014 inputselector: Forward all sticky events, including stream-start 2013-05-09 12:15:48 +02:00
Sebastian Dröge
172817e332 capsfilter: Add more debug output and forward caps events immediately too 2013-05-09 09:51:13 +02:00
Sebastian Dröge
e4cbae46cc capsfilter: Fix typo in last commit 2013-05-09 09:38:35 +02:00
Sebastian Dröge
98f6b75cd3 capsfilter: Send all events that should happen after CAPS after the CAPS event 2013-05-09 09:32:49 +02:00
Nicolas Dufresne
c86f42bc88 capsfilter: Send caps before segment
In the case the source has no caps, caps must be sent before segment. This
fixes few unit tests that where failing due to the new misordering warning.

https://bugzilla.gnome.org/show_bug.cgi?id=699968
2013-05-09 09:14:49 +02:00
Nicolas Dufresne
ba354f6b03 typefind: Send stream-start before anything else
To do so, send stream-start when the streaming thread goes up for the first
time.

https://bugzilla.gnome.org/show_bug.cgi?id=699767
2013-05-07 09:17:13 +02:00
Sebastian Dröge
c24bcbf511 typefind: Always leave TYPEFIND mode when we're stopping typefinding 2013-04-29 13:24:56 +02:00
Sebastian Dröge
11f6e08aae typefind: Simplify code
This is only called when in TYPEFIND mode.
2013-04-29 13:24:56 +02:00
Sebastian Dröge
7982f682dd typefind: Push pending events independent of the existence of a downstream chain function and peer
Downstream might create a peer only as result of the events in theory.
2013-04-29 13:24:56 +02:00
Sebastian Dröge
32e05f8a1e typefind: Only push CAPS event once if we get one from upstream
https://bugzilla.gnome.org/show_bug.cgi?id=692784
2013-04-29 13:24:56 +02:00
Sebastian Dröge
2a34f767d4 typefind: Stop typefinding if we get a CAPS event from upstream 2013-04-29 13:24:56 +02:00
Sebastian Dröge
0fda329bbb typefind: Improve handling of GAP events
There's still room for improvement though.
2013-04-29 13:24:56 +02:00
Sebastian Dröge
fc4105c1f9 typefind: Forward events that should happen before the caps event directly
There's no point in storing them and sending them later, and doing so would
later require to distinguish between events that should come before caps and
after.

https://bugzilla.gnome.org/show_bug.cgi?id=692784
2013-04-29 13:24:56 +02:00
Sebastian Dröge
cf0566f9ca typefind: Only push pending buffers and events if we have caps 2013-04-29 13:24:56 +02:00
Sebastian Dröge
922815996f typefind: Remove code that would cause caps to be sent twice
Whenever we set typefind->caps we will also send a caps event downstream.
2013-04-29 13:24:56 +02:00
Tim-Philipp Müller
e1c6a56596 typefind: fix caps leak when used in connection with uridecodebin and playbin
Don't leak forced sink caps.
2013-04-27 00:05:45 +01:00
Sebastian Dröge
a257cb6f5b inputselector: Try to not push read-only buffers
We should only increase the refcount before pushing if we're
really going to use the buffer afterwards.
2013-04-25 16:39:52 +02:00
Sebastian Dröge
18a7a1d062 gst: Add better support for static plugins
API: GST_PLUGIN_STATIC_DECLARE()
API: GST_PLUGIN_STATIC_REGISTER()

Based on a patch by Håvard Graff <havard.graff@tandberg.com>.

This now allows GST_PLUGIN_DEFINE() to create a static plugin if
GST_PLUGIN_BUILD_STATIC is defined. The resulting plugin can be
statically linked or dynamically linked during compilation but
can't be dynamically loaded during runtime.

Also adds GST_PLUGIN_STATIC_DECLARE() and GST_PLUGIN_STATIC_REGISTER(),
which allows to register a static linked plugin easily.
It is still required to manually register every single statically linked
plugin from inside the application as this can't be automated in a portable
way.

A new configure parameter --enable-static-plugins was added that allows
to build all plugins we build here as static plugins.

Fixes bug #667305.
2013-04-15 15:52:18 +02:00
Wim Taymans
fa371dad6d multiqueue: ignore empty not-linked queues
We need to ignore the not-linked queues in the underrun and overrun callbacks
because they are expected to be empty.
2013-04-05 10:15:37 +02:00
Wim Taymans
bda406c42f multiqueue: start pushing again on RECONFIGURE
When we got NOT_LINKED before and we receive a RECONFIGURE event, start pushing
again on the source pad.

See https://bugzilla.gnome.org/show_bug.cgi?id=676304
2013-04-04 19:16:23 +02:00
Wim Taymans
9ac409df48 queue2: start pushing again on RECONFIGURE
When we got NOT_LINKED before and we receive a RECONFIGURE event, start pushing
again on the source pad.

See https://bugzilla.gnome.org/show_bug.cgi?id=676304
2013-04-04 19:07:29 +02:00
Wim Taymans
c955ddc712 queue: start pushing again on RECONFIGURE
When we got NOT_LINKED before and we receive a RECONFIGURE event, start pushing
again on the source pad.

See https://bugzilla.gnome.org/show_bug.cgi?id=676304
2013-04-04 19:06:35 +02:00
Alexander Schrab
09bb0c2cdb queue: remove query from queue if queue is flushing
When querying a queue that is flushing we end up adding
a query to the queuearray without taking a reference to
that query (because the normal functionality is to block
until that query is done and discarded from the queue).
This later causes problem if the query is unreffed outside
of the queue before we discard the queue. There is a check
to avoid unreffing any lingering query-objects, but since
the query has been deleted that check fails.

This commit depends on other fixes done to gst_queue_array_find()
and gst_queue_array_drop_element().

https://bugzilla.gnome.org/show_bug.cgi?id=692691
2013-01-30 12:07:52 +00:00
Branko Subasic
17bff49262 multiqueue: correct overrun handling
The control of wheteher a SingleQueue is full is not correct.
Rewrote single_queue_overrun_cb() so it checks the correct variables
when checking if the queue has reached the hard limits, and to
increase the max buffer limit once for each call.

https://bugzilla.gnome.org/show_bug.cgi?id=690557
2012-12-20 15:34:01 +01:00
Wim Taymans
6c968bbdf1 queue2: implement buffering query for all modes
Also implement the buffering query for STREAM mode.
2012-12-20 11:59:54 +01:00
Wim Taymans
7c056a9473 queue2: refactor buffering percent and stats
Make methods to get the current buffering percent and the stats. We will use
this in the query later.
2012-12-20 11:30:25 +01:00
Wim Taymans
fac7eb0a50 NEWSEGMENT -> SEGMENT 2012-12-14 15:24:30 +01:00
Arnaud Vrac
b4a91de1be inputselector: fix clock leak in wait_running_time
https://bugzilla.gnome.org/show_bug.cgi?id=688477
2012-11-17 10:17:58 +00:00
Alessandro Decina
a47e5c72d0 queue: remove unused label. Fixes compiler warning. 2012-11-10 09:51:10 +01:00
Alessandro Decina
c257b19ead queue: don't fail in _sink_event for sticky events
Implement the same behaviour as gst_pad_push_event when pushing sticky events
fails, that is don't fail immediately but fail when data flow resumes and upstream
can aggregate properly.

This fixes segment seeks with decodebin and unlinked audio or video branches.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=687899
2012-11-09 18:42:16 +01:00
Tim-Philipp Müller
c99bafae39 elements: fix leading space in plugin description string 2012-11-06 16:58:04 +00:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Tim-Philipp Müller
af2482b170 queue: add "flush-on-eos" property
In flush-on-eos=true mode any data remaining in the queue is
discarded when an EOS event is received, and the EOS passed
downstream as soon as possible (instead of waiting for all
buffers in the queue to get processed by downstream first).

May or may not be useful in capture/encoding scenarios.
2012-10-31 19:33:30 +00:00
Jan Schmidt
698324d48b multiqueue: Add EOS status to debug output about filled/unfilled 2012-10-30 10:04:14 +11:00
Sebastian Dröge
09982c3c13 dataqueue/queuearray: Make public API again
These are actually used outside of coreelements nowadays.
Also hide lots of internals and add padding and documentation.
2012-10-25 14:03:01 +02:00
Wim Taymans
fc5849ef11 capsfilter: don't prefer passthrough
Basetransform should not try to negotiate in passthrough mode but
respect the order of what we return in the transform_caps method.
A typical case is that you specify some specific new caps in the
caps property but also allow the current caps to pass.
2012-10-04 11:18:19 +02:00
Wim Taymans
701424be9b typefind: send STREAM-START event
Send a STREAM_START event when we are operating in pull mode.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=684424
2012-09-26 13:25:03 +02:00
Mark Nauwelaerts
b14a3ad4ef identity: retimestamp both pts and dts when doing so 2012-09-26 10:55:47 +02:00
Mark Nauwelaerts
8e98ce54e1 identity: also track and store segment info in single segment mode 2012-09-25 15:06:43 +02:00
Josep Torra Valles
111fcc6e31 Make intel compiler happier
https://bugzilla.gnome.org/show_bug.cgi?id=552657
2012-09-25 00:56:26 +01:00
Mark Nauwelaerts
f495fa7a21 identity: transform GAP event in single segment mode 2012-09-19 15:14:35 +02:00
Wim Taymans
3abc720345 docs: fix some docs
from git grep for ffmpegcolorspace and x-raw-
2012-09-13 11:35:41 +02:00
Mark Nauwelaerts
947635d893 filesink: fix build on Cygwin
... where __fbufsize is not available
2012-09-12 17:16:41 +02:00
Tim-Philipp Müller
2fe8ebaae6 queue2: fix possible data corruption in ring buffer mode when seeking
Fix race that could cause data corruption when seeking in ring buffer
mode.

In perform_seek_to_offset(), called from the demuxer's pull_range
request, we drop the lock, tell upstream (usually a http source)
to seek to a different offset, then re-acquire the lock before we
do things to the ranges. However, between us sending the seek event
and re-acquiring the lock, the source thread might already have pushed
some data and moved along the range's writing_pos beyond the seek
offset. In that case we don't want to set the writing position back
to the requested seek position, as it would cause data to be written
to the wrong offset in the file or ring buffer.

Reproducible doing seek-emulated fast-forward/backward on 006653.

Conflicts:
	plugins/elements/gstqueue2.c
2012-09-12 12:59:50 +01:00
Tim-Philipp Müller
a85991eeb8 baseparse, typefind: only activate in pull mode if upstream is seekable
Upstream might support pull mode, but only sequential pulls,
which isn't gonna do much for us.

https://bugzilla.gnome.org/show_bug.cgi?id=634927
2012-09-11 01:40:53 +01:00
Jan Schmidt
8d8608c23b ghostpad: Make some debugging more verbose
Also, remove an unnecessary #include in input-selector
2012-08-31 06:25:37 -07:00
Arnaud Vrac
dc86e65265 inputselector: fix clock leak
https://bugzilla.gnome.org/show_bug.cgi?id=682997
2012-08-30 19:47:57 +01:00
Edward Hervey
0eb13f146f inputselector: Wait for other streams to advance on unselected pads
Otherwise we end up dropping a lot of data in the case where data starts
arriving on the non-selected pad, resulting in big gaps in stream switching
2012-08-14 18:44:38 +02:00
Edward Hervey
6b447acc3c inputselector: More debug statements 2012-08-14 18:43:54 +02:00
Edward Hervey
c33d2f7aba inputselector: Don't forward stream-start sticky events
Only one STREAM_START event should be let through, else it will
confuse downstream elements that think a new stream is starting
whereas in fact we are just switching to a different input.

In the future we might want to let them through but with the same
sequence number.
2012-08-14 18:42:31 +02:00
Edward Hervey
ea761a24b4 inputselector: Use the first created pad by default
This guarantees a bit more consistency in which input stream will
be selected by default. It would previously be the first pad on which
an event/buffer/query was received ... which was racy and non-predictable.
2012-08-06 11:36:29 +02:00
Tim-Philipp Müller
a9d1c529f6 input-selector: use generic marshaller for "block" action signal 2012-08-05 16:48:27 +01:00
Tim-Philipp Müller
ba39106758 typefind: send segment_done event in addition to segment_done message 2012-08-02 00:22:29 +01:00
Sebastian Dröge
389ec66946 basesrc: Add default handler for URI query in GstURIHandler subclasses 2012-07-31 17:26:37 +02:00
Wim Taymans
f05b0e222f Update for new seeking variable name
When seeking, the start value and type are now called start and start_type.
2012-07-27 15:24:52 +02:00
Wim Taymans
a1f1bbd363 typefind: require bytes before typefinding
Require that we have some bytes in the adapter before we attempt to typefind.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680479
2012-07-24 12:38:15 +02:00
Wim Taymans
a21575d640 plugins: print flags better
print the buffer flags as a hex number so that it becomes easier to see what
flags are set.
2012-07-23 13:40:38 +02:00
Wim Taymans
b5caa93f6d queue2: set buffering-left to 0 on 100% buffering
Set the buffering-left field in the query to 0 when we are completely buffered.
Improve the debug.
2012-07-19 12:42:05 +02:00
Wim Taymans
60091bf225 queue2: fix buffering query
Fix the buffering query, fill in the right buffering-left and estimated-total
values.
2012-07-19 12:14:29 +02:00
Wim Taymans
14550f2ee2 queue2: fix the buffering-left in the buffering message
The buffering-left field in the buffering message should contain a time estimate
in milliseconds about for long the buffering is going to take. We can calculate
this value when we do rate_estimates.
2012-07-19 11:13:45 +02:00
Tim-Philipp Müller
eecaca9140 queue: answer SCHEDULING query
Instead of letting the default query handler fail.
2012-07-18 09:15:51 +01:00
Tim-Philipp Müller
39054884fd queue2: handle CAPS event and drop it if operating in ring buffer mode
Fixes "Unexpected event of kind caps can't be added in temp file"
warning when doing download buffering.
2012-07-17 19:27:44 +01:00
Tim-Philipp Müller
f72ba83a84 plugins: embed GstAueueArray in dataqueue struct as well 2012-07-14 20:33:30 +01:00
Tim-Philipp Müller
92cba34e0b plugins: don't use one-time array in plugin_init 2012-07-14 20:28:54 +01:00
Tim-Philipp Müller
22d78bad25 queue: embed GstQueueArray structure 2012-07-14 20:26:23 +01:00
Tim-Philipp Müller
14632db174 plugins: sprinkle some more G_GNUC_INTERNAL 2012-07-14 20:05:53 +01:00
Tim-Philipp Müller
2b17de7504 plugins: add init/clear functions to GstQueueArray 2012-07-14 19:38:39 +01:00
Tim-Philipp Müller
94f6ba9c0b base: make GstQueueArray private to coreelements for now
Keep it private until we have a reason to make it public.
2012-07-14 19:36:02 +01:00
Edward Hervey
d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Tim-Philipp Müller
c51a2c1ddf basesrc, basesink, baseparse, typefind: use GST_SEGMENT_FLAG with segment flags 2012-07-09 21:51:07 +01:00
Tim-Philipp Müller
a8d5665db7 plugins: sprinkle G_GNUC_INTERNAL for dataqueue functions
And remove padding, since this is not public API any more.
2012-07-09 20:55:39 +01:00
Sebastian Dröge
af73f3fc02 queue: Fix handling of min-threshold and serialized queries
Only consider the queue empty if the minimum thresholds
are not reached and data is at the queue head. Otherwise
we would block forever on serialized queries.

This also makes sending of serialized events, like caps, happen
faster and potentially improves negotiation performance.

Fixes bug #679458.
2012-07-09 15:40:29 +02:00
Tim-Philipp Müller
dcc35b9c67 typefindelement: remove unimplemented maximum property 2012-07-06 11:26:14 +01:00
Tim-Philipp Müller
388237756e tee: remove unimplemented has-sink-loop property 2012-07-06 11:26:14 +01:00
Tim-Philipp Müller
41a762adb3 queue2: remove deprecated temp-location use, make it read-only 2012-07-06 11:26:14 +01:00
Tim-Philipp Müller
b23185a73a identity: remove deprecated check-perfect property
Replaced by the more specific check-imperfect-{timestamp,offset}
2012-07-06 11:26:14 +01:00
Edward Hervey
31accf2d01 dataqueue: Use GstQueueArray 2012-07-04 17:46:54 +02:00
Edward Hervey
96b9ae287e queue: Use new GstQueueArray for local storage.
Makes _chain() and _loop() 25% faster
2012-07-04 17:46:54 +02:00
Chun-wei Fan
cb5e8f2bb4 fdsink.c: fix G_OS_WIN32 #ifdef
Postpone the #ifdef to a point after glib.h (via gstfdsink.h) is included
so that the needed defines and header includes can be done correctly,
especially on Visual C++ builds.

https://bugzilla.gnome.org/show_bug.cgi?id=679112
2012-07-02 12:05:50 +01:00
Tim-Philipp Müller
31976c426e inputselector: remove some dead code for old GLib versions 2012-06-26 17:30:19 +01:00
Thiago Santos
42fab9db45 inputselector: avoid notify-tags holding lock
unlock before issuing this notification to prevent
deadlocks when other elements reacts to new tags.

Fixes #678220
2012-06-21 11:15:07 -03:00
Wim Taymans
76e8b2ecda task: add GDestroyNotify to _new
Add a GDestroyNotify to the user_data we pass to gst_task_new()
Change gst_pad_start_task() to also take the notify
2012-06-20 10:31:49 +02:00
Sebastian Dröge
7b966e4577 inputselector: Only proxy the allocation query for the active pad and send reconfigure events to the old/new pad when switching pads 2012-06-19 10:32:10 +01:00
Wim Taymans
7fb522718e queue2: fix percent scaling
Use _scale functions to scale the percent values.
Correctly scale the percent values in the buffering ranges.
2012-06-15 15:36:41 +02:00
David Svensson Fors
066b515985 gstfunnel: avoid access of freed pad
Save the value of the pad's got_eos in gst_funnel_release_pad,
before calling gst_element_remove_pad. This is because
gst_element_remove_pad may free the pad.

https://bugzilla.gnome.org/show_bug.cgi?id=678017
2012-06-14 14:10:22 +01:00
Matej Knopp
b3cee7155a typefindelement: Only send caps when pad is being activated
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677819
2012-06-11 10:47:40 +02:00
Sebastian Dröge
8d6ead8038 elements: Use gst_pad_set_caps() and don't ignore its return value 2012-06-08 15:45:38 +02:00
Wim Taymans
70c3a752be queue2: remove obsolete caps code 2012-06-05 09:40:14 +02:00
Andre Moreira Magalhaes (andrunko)
83559a5970 inputselector: Correctly get current running time when syncing to the segment information
Fixes bug #677263.
2012-06-01 16:37:50 +02:00
Mike Ruprecht
a71f3ce6e8 funnel: Only emit EOS event if all sinkpads have received one
If multiple sources are plugged into the funnel and one of the
sources emits an EOS, that event is propogated through the funnel
even though other sources connected to the funnel may still be
pushing data. This patch waits to send an EOS event until the
funnel has received an EOS event on each sinkpad.

Ported from d397ea97 in 0.10 branch.
2012-05-31 13:39:05 -04:00
Mike Ruprecht
18a73b8ef2 funnel: Fix buffer leak 2012-05-31 13:07:53 -04:00
Andre Moreira Magalhaes (andrunko)
0dca0dac71 inputselector: Don't try to sync on the segment if it has no TIME format
...and wait until it is actually configured and has a format before
trying to sync.
2012-05-31 17:46:23 +02:00
Sebastian Dröge
7aff9dba0e inputselector: No need to broadcast the signal in flush-stop
Everything stopped at this point already.

Conflicts:

	plugins/elements/gstinputselector.c
2012-05-31 17:05:08 +02:00
Bastien Nocera
6654bd0300 queue2: Fix property name in the docs
temp-template, not temp-tmpl

https://bugzilla.gnome.org/show_bug.cgi?id=677170
2012-05-31 12:56:22 +02:00
Andre Moreira Magalhaes (andrunko)
2f6dadaa7c inputselector: Properly sync when changing streams
This adds properties to use the clock time for deciding when
to drop buffers for inactive pads and a property to buffer all
not rendered buffers for the active pad to allow pad switching
without losing any buffers at all.

Conflicts:

	plugins/elements/gstinputselector.c
2012-05-31 12:38:20 +02:00
Tim-Philipp Müller
cd3875857e gst_tag_list_free() -> gst_tag_list_unref() 2012-05-28 00:08:18 +01:00
Tim-Philipp Müller
b259b5c476 fakesrc: put byte position rather than buffer count into GST_BUFFER_OFFSET
If we're sending a segment in BYTE format, the offset
should be in bytes as well.
2012-05-24 23:33:14 +01:00
Tim-Philipp Müller
a49b9a9946 filesrc: remove references to mmap in comments and debug messages 2012-05-15 19:12:58 +01:00
Alban Browaeys
10396f12d4 typefindelement: if sink pad is activated do not change mode
In commit bf0964b6 a check for pad is activated was not carried.
This leads to attempt to pull while in push mode when force_caps
is set. In this case without the attached check even when activated
in pull mode we activate back to push mode.

This is from comment in previous code , case number eight:
 8. if the sink pad is activated, we are in pull mode. succeed.
-     otherwise activate both pads in push mode and succeed.

Putting it back fixes playback of webm in webkit+gstreamer 1.0 .

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676003
2012-05-14 12:56:05 +02:00
Raimo Järvi
63234a9dab gst: Fix compiler warnings on mingw-w64
https://bugzilla.gnome.org/show_bug.cgi?id=675525
2012-05-09 09:35:35 +02:00
Руслан Ижбулатов
8a962bc1ab filesrc: rearrange sys/stat.h inclusion point for MinGW
gstplugin.h used to include this for us, but doesn't any longer.

https://bugzilla.gnome.org/show_bug.cgi?id=675171
2012-04-30 21:35:02 +01:00
Руслан Ижбулатов
f771d4619e tee: Remove unneeded unlock 2012-04-18 13:43:32 +02:00
Sebastian Dröge
014d10391c inputselector: Set sequence number on segment events 2012-04-16 10:27:29 +02:00
Sebastian Dröge
3146282d48 inputselector: Forward all sticky events when switching pads 2012-04-16 10:22:53 +02:00
Sebastian Dröge
d2811b19f2 tee: Store pad state directly inside the pads instead of GObject qdata 2012-04-16 10:05:02 +02:00
Sebastian Dröge
655bfbf776 inputselector: Send reconfigure event on the new active pad when pads are switched 2012-04-16 09:46:49 +02:00
Matej Knopp
c4b71c2574 multiqueue: gst_single_queue_flush unlocks the queue twice
https://bugzilla.gnome.org/show_bug.cgi?id=674044
2012-04-13 23:57:35 +01:00
Wim Taymans
8ab260d116 queue2: fix merge error 2012-04-11 13:20:18 +02:00
Wim Taymans
bfc87ac576 Merge remote-tracking branch 'origin/0.10'
Conflicts:
	gst/gsttoc.c
	plugins/elements/gstqueue2.c
2012-04-11 12:50:50 +02:00
Wim Taymans
bdda711d03 queue2: signal delete before waiting
When we don't have the requested data in the ringbuffer and we move our read
pointer to the requested position, signal the delete cond to inform the writer
that we changed the current fill level. If we don't, the writer might stay
blocked and we might wait forever.
2012-04-11 12:45:46 +02:00
Wim Taymans
ccbeb19881 queue2: update current read position before waiting
When we don't have enough bytes in the ringbuffer to satisfy the current
request, first update the current read position before waiting. If we don't do
that, the ringbuffer might appear full and the writer will never write more
bytes to wake us up.
2012-04-11 12:45:41 +02:00
Wim Taymans
463a8d9abf queue2: add range only on sinkpad
Only add the range when we receive a segment event on the sinkpad. The add_range
method will modify the write position, which only makes sense to do on the
sinkpad.
2012-04-11 12:45:37 +02:00
Wim Taymans
e3ca88ea7b queue2: fix debug message
We're not writing to the offset of the buffer
2012-04-11 12:45:31 +02:00
Wim Taymans
30c425c29f queue2: add_range already updates the level 2012-04-11 12:45:24 +02:00
Wim Taymans
05635b374f Merge remote-tracking branch 'origin/0.10' 2012-04-10 16:07:52 +02:00
Wim Taymans
2e28804a6e queue2: clear seeking flag in all cases
Also clear the seeking flag when downstream is in pull mode.
2012-04-10 16:06:41 +02:00
Wim Taymans
393c758a1c Merge remote-tracking branch 'origin/0.10'
Conflicts:
	gst/gst.c
	plugins/elements/gstqueue2.c
2012-04-10 12:55:31 +02:00
Wim Taymans
b7a8051d95 queue2: set seeking flag with the queue lock 2012-04-10 12:44:38 +02:00
Wim Taymans
5755e24379 queue2: Keep track of the seeking state
Set the seeking flag right before we send a seek event upstream and discard all
data untill we see a flush-stop again. We need to do this because we activate
the range that we seek to immediately after sending the seek event and it is
possible that we receive data in our chain function from before the seek
which would then be added to the wrong range resulting in data corruption.
2012-04-10 12:44:35 +02:00
Wim Taymans
49a4b801ac queue2: make range on newsegment for ringbuffer
When using the ringbuffer, handle the newsegment event like we handle it when
using the temp-file mode: create a new range for the new byte segment. The new
segment should normally already be created when we do a seek.
2012-04-10 12:44:30 +02:00
Sebastian Dröge
1a61f3ec19 Merge remote-tracking branch 'origin/0.10' 2012-04-09 16:42:30 +02:00
Sebastian Dröge
829eafad0e multiqueue: Don't use buffer after pushing it downstream 2012-04-09 16:40:47 +02:00
Tim-Philipp Müller
a63829b4ff plugins: use new gst_element_class_set_static_metadata() 2012-04-09 13:05:07 +01:00
Tim-Philipp Müller
4348851cd9 Merge remote-tracking branch 'origin/0.10'
Conflicts:
	gst/gstatomicqueue.c
2012-04-07 15:42:08 +01:00
Tim-Philipp Müller
d05d29d0c9 filesrc: set default block size from local define
Doesn't actually change the default value, just makes use of the
define there is. Superficial testing with fakesink and jpegdec did
not reveal improved performance for bigger block sizes, so leave
default as it is.
2012-04-07 15:21:29 +01:00
Wim Taymans
4638f15de2 queue2: don't update the current reading_pos in flush
A flush from the upstream element should not make buffering go to 0, the next
pull request might be inside a range that we have and then we don't need to
buffer at all. If the next pull is outside anything we have, buffering will
happen as usual anyway.
2012-04-06 16:46:58 +02:00
Wim Taymans
d5d0d10979 queue2: fix for merged changes 2012-04-06 12:42:39 +02:00
Wim Taymans
fb8fbdaeb3 Merge branch '0.10' 2012-04-06 12:37:41 +02:00
Wim Taymans
d8a61930af queue2: check the pad mode on the right pad 2012-04-06 12:32:49 +02:00
Wim Taymans
f06458aabc queue2: forward flush events correctly
We want to forward the flush events received on the sinkpad whenever the srcpad
is activated in pushmode, which can also happen when using the RINGBUFFER or
DOWNLOAD mode and downstream failed to activate us in pull mode.
2012-04-06 12:24:22 +02:00
Sebastian Dröge
aca083c56d gst: Change name parameter of GST_PLUGIN_DEFINE() to not take a string anymore
This will be needed when we later add support for static linking
of plugins without introducing new API or changing existing API.
2012-04-05 14:17:16 +02:00
Wim Taymans
0ba0f7cd5b Merge branch '0.10'
Conflicts:
	plugins/elements/gstqueue2.c
2012-04-05 10:36:08 +02:00
Wim Taymans
67ccad0621 queue2: stop waiting for more data after EOS
When we have EOS, read the remaining bytes in the buffer and make sure we don't
wait for more data. Also clip the output buffer to the amount of remaining
bytes.
2012-04-05 10:17:46 +02:00
Wim Taymans
9a1185673e queue2: check for filled buffer correctly
When using the ringbuffer mode, the buffer is filled when we reached the
max_level.bytes mark or the total size of the ringbuffer, whichever is smaller.
2012-04-05 10:16:52 +02:00
Wim Taymans
0bb0c68566 queue2: avoid waiting for a filled buffer
Use a threshold variable to hold the maximum distance from the current position
for with we will wait instead of doing a seek.
When using the ringbuffer and the requested offset is not available, avoid
waiting until the complete ringbuffer is filled but instead do a seek when the
requested data is further than the threshold.
Avoid doing the seek twice in the ringbuffer case.
Use the same threshold for ringbuffer and download buffering.
2012-04-05 10:16:46 +02:00
Sebastian Dröge
b0d89da6b6 gst: Change versioning
Remove GST_MAJORMINOR and replace it by GST_API_VERSION
Also set GST_VERSION_{MAJOR,MINOR,MICRO,NANO} explicitely
now.

All versions are at 1.0.0 now for the release soon but
API/ABI can still change until the 1.0.0 release.

Next release versions until 1.0.0 will be 0.10.9X and
these will be release candidates. GST_VERSION_* will
nonetheless stay at 1.0.0.0.
2012-04-04 14:28:55 +02:00
Руслан Ижбулатов
f140cb8dbd Timeout is not used on W32
Fixes #673267
2012-04-02 11:24:26 +02:00
Wim Taymans
38b96e6c8c buffer: improve the buffer memory methods
gst_buffer_take_memory -> gst_buffer_insert_memory because insert is what the
method does.
Make all methods deal with ranges so that we can replace, merge, remove and map
a certain subset of the memory in a buffer. With the new methods we can make
some code nicer and reuse more code. Being able to deal with a subset of the
buffer memory allows us to optimize more cases later (most notably RTP headers
and payload that could be in different memory objects).
Make some more convenient macros that call the more generic range methods.
2012-03-30 18:15:24 +02:00
Mark Nauwelaerts
bcb98f409b typefindelement: plug caps leaks 2012-03-30 16:53:09 +02:00
Edward Hervey
2bdd71a710 queue: Flush the internal queue when we see GST_FLOW_FLUSHING
Ensures that we don't end up with stale contents (like GstQuery) in
the internal GQueue after any blocking upstream thread returns.
2012-03-29 17:46:35 +02:00
Edward Hervey
c36748177f queue: Don't unref GstQuery travelling through the queue
Unlike events and buffers, the reference is not given to us
2012-03-29 17:46:35 +02:00
Sebastian Dröge
4b6c3c7fea Merge remote-tracking branch 'origin/0.10'
Conflicts:
	plugins/elements/gstmultiqueue.c
2012-03-29 14:54:53 +02:00
Sebastian Dröge
9441e711df multiqueue: Wake up all not-linked streams when a stream switches from linked to not-linked
We reset all the waiting streams, let them push another buffer to
see if they're now active again. This allows faster switching
between streams and prevents deadlocks if downstream does any
waiting too.

Also improve locking a bit, srcresult must be protected by the
multiqueue lock too because it's used/set from random threads.
2012-03-29 14:49:53 +02:00
Sebastian Dröge
17e691421f multiqueue: Recompute high-time too when flushing, not only high-id 2012-03-29 14:47:57 +02:00
Sebastian Dröge
d03e3d7772 inputselector: Only wait until the active pad's running time is reached if the active pad already saw data
Otherwise we might block forever because upstream (e.g. multiqueue) is waiting
for the previously active stream to return forever (which is waiting here
in inputselector) before pushing something on the newly selected stream.
2012-03-29 14:47:57 +02:00
Wim Taymans
f9c85a53dc pad: improve docs of get/pull_range
Improve the docs of the get/pull_range functions, define the lifetime of the
buffer in case of errors and short reads.
Make sure the code does what the docs say.
2012-03-20 13:14:55 +01:00
Wim Taymans
d540a5fc68 multiqueue: handle serialized queries 2012-03-19 11:45:27 +01:00
Wim Taymans
db1318ab4a pad: change the semantics of get/pull_range a little
Make it so that one can specify a buffer for get/pull_range where the downstream
element should write into. When passing NULL, upstream should allocate a buffer,
like in 0.10.
We also need to change the probes a little because before the pull probe, there
could already be a buffer passed. This then allows us to use the same PROBE
macro for before and after pulling.
While we're at the probes, make the query probe more powerful by handling the
GST_PAD_PROBE_DROP return value. Returning _DROP from a query probe will now
return TRUE upstream and will not forward the probe to the peer or handler.
Also handle _DROP for get/pull_range properly by not dispatching to the
peer/handler or by generating EOS when the probe returns DROP and no buffer.
Make filesrc handle the non-NULL buffer passed in the get_range function and
skip the allocation in that case, writing directly into the downstream provided
buffer.
Update tests because now we need to make sure to not pass a random value in the
buffer pointer to get/pull_range
2012-03-16 21:37:10 +01:00
Wim Taymans
b54b886fc5 typefind: proxy allocation query 2012-03-16 21:36:33 +01:00
Wim Taymans
85c9543841 memory: group allocation parameters in a struct
Group the extra allocation parameters in a GstAllocationParams structure to make
it easier to deal with them and so that we can extend them later if needed.
Make gst_buffer_new_allocate() take the GstAllocationParams for added
functionality.
Add boxed type for GstAllocationParams.
2012-03-15 13:42:17 +01:00
Wim Taymans
c93cde0a30 filesrc: only update buffer size on short read 2012-03-15 13:42:17 +01:00
Wim Taymans
0addca0810 queue: remove useless PROXY_ALLOCATION flag 2012-03-15 13:42:12 +01:00
Wim Taymans
9e2ef19dc2 queues: warn when receiving a serialized event
.. until we implement it.
2012-03-14 16:00:48 +01:00
Wim Taymans
2e864c4722 queue: add support for serialized queries 2012-03-14 15:42:33 +01:00
Wim Taymans
8a76c3269a caps: _do_simplify() -> _simplify()
Rename _do_simplify() to _simplify(). The name was introduced as a replacement
method for a deprecated method but we can now rename it again.
Fix some docs.
2012-03-12 11:38:37 +01:00
Wim Taymans
9cdbffea94 caps: improve _do_simplify
Make gst_caps_do_simplify() take ownership of the input caps and produce a
simplified output caps. This removes the requirement of having writable input
caps and the method can make the caps writable only when needed.
2012-03-12 10:42:23 +01:00
Wim Taymans
fe5fe438d3 typefind: remove const from refcounted GstCaps
Having const on refcounted objects require us to make copies instead of simply
taking a ref, don't do that.
2012-03-10 09:25:43 +01:00
Wim Taymans
cfa639c56c tee: fix refcount error 2012-03-08 10:47:39 +01:00
Sebastian Dröge
6b4091a30d Merge branch 'master' into 0.11
Conflicts:
	libs/gst/base/gstbaseparse.c
	libs/gst/base/gstbasetransform.c
	plugins/elements/gsttee.c
2012-03-08 10:19:52 +01:00
Sebastian Dröge
f000bbe924 tee: Fix 'use of logical '&&' with constant operand' compiler warning
This is actually a real bug.
2012-03-06 12:27:33 +01:00
Sebastian Dröge
cfe71423f0 gst: Remove gstmarshal.[ch] completely and use the generic marshaller
Fixes bug #671130.
2012-03-02 11:05:48 +01:00
Tim-Philipp Müller
f701237b77 fdsink: fix compilation after merge 2012-02-27 00:09:57 +00:00
Tim-Philipp Müller
1fbcc71dbd Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	NEWS
	RELEASE
	configure.ac
	docs/plugins/gstreamer-plugins.hierarchy
	docs/plugins/inspect/plugin-coreelements.xml
	libs/gst/base/gstcollectpads.c
	libs/gst/base/gstcollectpads2.c
	plugins/elements/gstfdsink.c
	win32/common/config.h
	win32/common/gstenumtypes.c
	win32/common/gstversion.h
2012-02-27 00:08:39 +00:00
Tim-Philipp Müller
4594e4311d fdsink: implement GstBaseSink::query instead of messing with the pad 2012-02-25 15:18:00 +00:00
Tim-Philipp Müller
965c610028 fdsink: implement SEEKING query
We may or may not support seeking. stdout to a
terminal doesn't support seeking, for example, but
... ! fdsink > file.foo just might.
2012-02-25 15:08:55 +00:00
Tim-Philipp Müller
82a9544385 filesink: implement SEEKING query
We may or may not do seeking, depends on the
output file/device really, it doesn't have to
be a file after all.
2012-02-25 15:07:43 +00:00
Tim-Philipp Müller
c5b335a0e2 fakesink: answer SEEKING query
We don't do seeking, in case anyone wants to know.
2012-02-25 15:07:05 +00:00
Wim Taymans
beea57dca7 basetransform: fix reconfigure methods
Rename gst_base_transform_suggest to gst_base_transform_reconfigure_sink because
that is what it does. Also remove the caps and size because that is not needed.
Rename gst_base_transform_reconfigure to gst_base_transform_reconfigure_src.
Remove some old unused code in capsfilter.
2012-02-24 11:00:21 +01:00
Wim Taymans
7b0e4f27fb memory: make _new_wrapped take user_data and notify
Make it possible to configure a GDestroyNotify and user_data for
gst_memory_new_wrapped() this allows for more flexible wrapping of foreign
memory blocks.
2012-02-22 02:10:21 +01:00
Tim-Philipp Müller
654b074477 input-selector: default to sync-streams=true
I think this is the expected behaviour, and we couldn't do this
in 0.10 for backwards-compatibility reasons, so change it now.
2012-02-21 21:07:49 +00:00
Wim Taymans
9a074e0e11 queue: remove some old code 2012-02-21 16:38:37 +01:00
Wim Taymans
ef5292c2ab queue: remove weird link behaviour
Remove the link functions and always start the pad task on the srcpad. If
applications need to autoplug they can put a blocking probe on the srcpad like
they would with any other element.
2012-02-21 12:52:44 +01:00
Wim Taymans
bd1566b9ae fakesrc: handle pts/dts 2012-02-21 12:52:18 +01:00
Wim Taymans
f7813b7ad9 fakesink: remove custom marshaller 2012-02-21 12:46:44 +01:00
Wim Taymans
812afd3a22 identity: also debug dts/pts 2012-02-21 12:43:18 +01:00
Wim Taymans
59893e38ca fakesink: debug pts and dts 2012-02-21 12:13:28 +01:00
Wim Taymans
8d5a11a0d8 identity: remove custom marshaller 2012-02-21 12:12:21 +01:00
Wim Taymans
58ecde9db9 typefind: don't ignore return value when starting a task 2012-02-15 10:13:37 +01:00
Wim Taymans
fed0284d3c typefind: clean up src query handler 2012-02-14 13:24:49 +01:00
Wim Taymans
374d5c36f9 typefind: pass results from activation 2012-02-14 12:57:14 +01:00
Tim-Philipp Müller
41841899c7 fakesrc, identity, fakesink: do not generate last-message updates by default
Default to not creating lots of overhead by doing a couple of
g_strdup_printf()/g_free() per buffer or event just to generate
a last-message update that rarely anyone listens to. This means
that you need to enable silent=true explicitly in order to get
last-message dumps in gst-launch -v now. On the upside, people
won't inadvertently end up benchmarking g_strdup_printf()
performance instead of gstreamer data handling performance any
more.

Maybe the silent property should be renamed to enable-last-message
or something like that?
2012-02-09 00:14:34 +00:00
Wim Taymans
7ab1d62c24 GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING 2012-02-08 16:18:04 +01:00
Mark Nauwelaerts
9f2077918c queue: use default query function to optionally forward query
... rather than querying peer unconditionally with possibly undesirable
outcome in case of e.g. SCHEDULING query.
2012-02-08 15:38:37 +01:00
Wim Taymans
27d639ec09 typefind: fix race in pad mode change
Fixes #668909 and presumably also #669483
2012-02-08 14:32:01 +01:00