Commit graph

74 commits

Author SHA1 Message Date
Thiago Santos
a396ba2bde 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 10:24:46 -03:00
Andre Moreira Magalhaes (andrunko)
2424d9896c inputselector: Correctly get current running time when syncing to the segment information
Fixes bug #677263.
2012-06-01 16:36:19 +02:00
Andre Moreira Magalhaes (andrunko)
8f267451f4 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:45:29 +02:00
Sebastian Dröge
e8e9c45c21 inputselector: No need to broadcast the signal in flush-stop
Everything stopped at this point already.
2012-05-31 17:03:54 +02:00
Andre Moreira Magalhaes (andrunko)
cd798a0a52 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.
2012-05-31 11:49:29 +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
Idar Tollefsen
b9b3795c3c plugins: explicitly cast initialization values to the correct type
https://bugzilla.gnome.org/show_bug.cgi?id=667288
2012-01-04 23:59:57 +00:00
Sebastian Dröge
47de97df84 inputselector: Don't send a NEWSEGMENT event if a buffer arrived before the segment was configured 2011-12-07 11:01:49 +01:00
Tim-Philipp Müller
5889260d5a Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We can't change most of
these in 0.10 because they're part of our API and ABI.
2011-12-04 13:35:38 +00:00
Tim-Philipp Müller
16dcd5e958 docs: fix Since: markers for API added after 0.10.35 2011-11-08 00:32:36 +00:00
Tim-Philipp Müller
76ccd2a1e9 docs: fix up some Since markers and update for new multiqueue args 2011-05-14 14:05:52 +01:00
Sebastian Dröge
5229a26a76 inputselector: Add sync mode that syncs inactive pads to the running time of the active pad
Fixes bug #645017.
2011-05-14 11:39:35 +02:00
Ole André Vadla Ravnås
037efe8738 elements: Fix pad callbacks so they handle when parent goes away
1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.

This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
2011-04-13 17:41:17 +02:00
Sebastian Dröge
ba6054b862 inputselector: Fix getcaps and event function from last commit
Return ANY caps if the parent disappeared, i.e. the template caps
and don't leak events if the parent disappeared.
2011-04-08 14:50:10 +02:00
Havard Graff
297407438a inputselector: Protect against pad-parent disappearing 2011-04-08 14:48:16 +02:00
Sebastian Dröge
69e81448c1 inputselector: Stop waiting for a pad switch when the pad is flushing 2011-03-19 08:57:06 +01:00
Sebastian Dröge
d41fe48ce3 inputselector: Move locking and signalling macros from the header to the source file 2011-03-19 08:57:06 +01:00
Sebastian Dröge
c8ecd6e9eb inputselector: Hold the selector lock while reading properties of the active pad 2011-03-17 14:21:17 +01:00
Sebastian Dröge
5e60a80268 inputselector: Make sure that EOS is always sent downstream for the active pad
It can happen that the currently active pad got the EOS event
before it was activated and the previously active pad got the
EOS event after it was deactivated. In that case we have to
send the EOS event from an inactive pad downstream.
2011-03-17 14:10:49 +01:00
Sebastian Dröge
f19bb850ac inputselector: Return GST_FLOW_OK until the selected pad pushed something downstream
This makes sure that during switches at no point in time all pads
have returned not-linked, which can happen when playing an audio-only
file with playbin2 and switching between the streams for example.

Fixes bug #644935.
2011-03-17 12:06:39 +01:00
Tim-Philipp Müller
c8ffd4e395 docs: mention extra input-selector pad properties
https://bugzilla.gnome.org/show_bug.cgi?id=638381
2011-01-06 18:18:29 +00:00
Tim-Philipp Müller
c57934d7bf inputselector: remove "select-all" property
select-all mode is a bit broken (e.g. newsegment event
handling), so remove that for now. The funnel element
in farsight provides similar functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=539042
https://bugzilla.gnome.org/show_bug.cgi?id=638381
2011-01-05 15:53:28 +00:00
Tim-Philipp Müller
7f7721511c inputselector: make pad's get_type function thread-safe 2010-12-31 12:08:19 +00:00
Sebastian Dröge
3f89954c27 inputselector: Protected g_object_notify() calls for the active-pad with a recursive mutex
This works around a thread safety problem in GLib < 2.26.0 and should
be removed when we depend on 2.26.0.

Fixes bug #607513.
2010-12-31 12:27:45 +01:00
Tim-Philipp Müller
d692735f49 coreelements: GST_BOILERPLATE already sets parent_class 2010-12-31 00:56:11 +00:00
Tim-Philipp Müller
fdd65e382d input-selector, output-selector: minor clean-ups 2010-12-31 00:56:11 +00:00
Tim-Philipp Müller
52617c91f3 coreelements: move input-selector and output-selector to core
Moved to core from gst-plugins-bad.

https://bugzilla.gnome.org/show_bug.cgi?id=614306
2010-12-31 00:55:19 +00:00
Stefan Kost
246bb32dc5 inputselector: log times in human readable form 2010-12-31 00:54:05 +00:00
Stefan Kost
64beb26a56 inputselector: move reoccuring logs to LOG and remove a double info
Less debug spew in DEBUG category. No need to log pad again if we use
GST_LOG_OBJECT(pad,...).
2010-12-31 00:54:05 +00:00
Stefan Kost
d86c6f1956 various (gst): add missing G_PARAM_STATIC_STRINGS flags
Canonicalize property names as needed.
2010-12-31 00:54:05 +00:00
Stefan Kost
04c4e4fb9e inputselector: sync with copy in -base
Use _get_caps_reffed to avoid copies.
2010-12-31 00:54:05 +00:00
Stefan Kost
0da59d0795 inputselector: use GST_BOILERPLATE macro 2010-12-31 00:54:04 +00:00
Benjamin Otte
0b37d8bf36 gst_element_class_set_details => gst_element_class_set_details_simple 2010-12-31 00:54:04 +00:00
Sebastian Dröge
9d21103d42 Revert "inputselector: Protect g_object_notify() with the object's mutex"
This reverts commit 7e067615ff, it's causing
deadlocks with playbin2.
2010-12-31 00:54:04 +00:00
Kipp Cannon
15b1ee56d4 inputselector: Protect g_object_notify() with the object's mutex
This works around the thread unsafety of g_object_notify()

Fixes bug #607513.
2010-12-31 00:54:04 +00:00
Sebastian Dröge
acf1616ae1 inputselector: Remove useless variables and fix a uninitialized variable compiler warnings
Merged from gst-plugins-base, dfd51aa82a.
2010-12-31 00:54:04 +00:00
Sebastian Dröge
9b2753c6e9 inputselector: Make sure that running_time->timestamp calculation never becomes negative
Merged from gst-plugins-base, f365385458.
2010-12-31 00:54:04 +00:00
Sebastian Dröge
a1f6660655 inputselector: Use the start time (i.e. timestamp) as the last stop
Using the end time makes it impossible to replace buffers, which is
a big problem for subtitles that could have very long durations.

Merged from gst-plugins-base, 27034be461.
2010-12-31 00:54:04 +00:00
Sebastian Dröge
8b2d4ad8a3 inputselector: Improve debugging
Merged from gst-plugins-base.
2010-12-31 00:54:04 +00:00
Wim Taymans
9515cbcd08 Revert "inputselector: use get_caps_reffed()"
This reverts commit 49ec4f796a.

We can't use this new function yet.
2010-12-31 00:54:04 +00:00
Wim Taymans
b74b0f04f2 inputselector: use get_caps_reffed() 2010-12-31 00:54:04 +00:00
Stefan Kost
e955afd503 inputselector: also add inline to the proto to fix the build 2010-12-31 00:54:04 +00:00
Edward Hervey
f0010f15a9 gst: Remove dead assignments and resulting unused variables
Merged from gst-plugins-base, 8cd1b5209b.
2010-12-31 00:54:04 +00:00
Sebastian Dröge
d7669fa9cc inputselector: Use the same iterate internal links function as in gst-plugins-base 2010-12-31 00:54:04 +00:00
Tim-Philipp Müller
13cf296cb0 input-selector: 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 sixteenth of a polar bear.

Merged from gst-plugins-base, 6f4c1ac583.
2010-12-31 00:53:58 +00:00
David Schleef
11dc5f63cb input-selector: Remove Ronald Bultje from Authors field
Replaced with "GStreamer maintainers
<gstreamer-devel@lists.sourceforge.net>" or just removed,
depending on the number of other authors.

Merged from gst-plugins-base, 0e9bc5125a.
2010-12-31 00:53:50 +00:00
Wim Taymans
199c1bdbcb inputselector: set output caps before pushing
Set the output caps on the srcpad before pushing the buffer because else core
will do a rather expensive check to see if we can actually accept those caps on
the srcpad.

Merged from gst-plugins-base, bdfb4b46d7.
2010-12-31 00:53:50 +00:00
Wim Taymans
7c7acac0db inputselector: install an acceptcaps function
Install a custom acceptcaps function instead of using the default expensive
check. We accept whatever downstream accepts so we pass along the acceptcaps
call to the downstream peer.

Merged from gst-plugins-base, 5b72f2adf9.
2010-12-31 00:53:50 +00:00
Sebastian Dröge
8ee3931e5d inputselector: Use new single iterator for the internally linked pads
This fixes a deadlock and removes some useless code.
2010-12-31 00:53:50 +00:00
Sebastian Dröge
1543b0ea08 inputselector: Use iterate internal links instead of deprecated get internal links 2010-12-31 00:53:50 +00:00