mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-09 05:38:58 +00:00
gst/selector/gstinputselector.c: Move the select-all logic into the activation of the currently selected pad. We want...
Original commit message from CVS: * gst/selector/gstinputselector.c: (gst_selector_pad_bufferalloc), (gst_selector_pad_chain), (gst_input_selector_getcaps), (gst_input_selector_activate_sinkpad): Move the select-all logic into the activation of the currently selected pad. We want to remember the last pad with activity in select-all mode. Fix the getcaps function, we can produce the union of the upstream caps in select-all mode, not the intersection like proxy_getcaps() does.
This commit is contained in:
parent
68cd145e3e
commit
e0f52ef74d
2 changed files with 26 additions and 12 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2008-08-05 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/selector/gstinputselector.c: (gst_selector_pad_bufferalloc),
|
||||||
|
(gst_selector_pad_chain), (gst_input_selector_getcaps),
|
||||||
|
(gst_input_selector_activate_sinkpad):
|
||||||
|
Move the select-all logic into the activation of the currently selected
|
||||||
|
pad. We want to remember the last pad with activity in select-all mode.
|
||||||
|
Fix the getcaps function, we can produce the union of the upstream caps
|
||||||
|
in select-all mode, not the intersection like proxy_getcaps() does.
|
||||||
|
|
||||||
2008-08-05 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-08-05 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: Håvard Graff <havard dot graff at tandberg dot com>
|
Patch by: Håvard Graff <havard dot graff at tandberg dot com>
|
||||||
|
|
|
@ -464,7 +464,7 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
|
||||||
GST_INPUT_SELECTOR_LOCK (sel);
|
GST_INPUT_SELECTOR_LOCK (sel);
|
||||||
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
|
||||||
|
|
||||||
if (pad != active_sinkpad && !sel->select_all)
|
if (pad != active_sinkpad)
|
||||||
goto not_active;
|
goto not_active;
|
||||||
|
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||||
|
@ -550,7 +550,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore buffers from pads except the selected one */
|
/* Ignore buffers from pads except the selected one */
|
||||||
if (pad != active_sinkpad && !sel->select_all)
|
if (pad != active_sinkpad)
|
||||||
goto ignore;
|
goto ignore;
|
||||||
|
|
||||||
if (G_UNLIKELY (sel->pending_close)) {
|
if (G_UNLIKELY (sel->pending_close)) {
|
||||||
|
@ -1016,16 +1016,20 @@ gst_input_selector_getcaps (GstPad * pad)
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
parent = gst_object_get_parent (GST_OBJECT (pad));
|
parent = gst_object_get_parent (GST_OBJECT (pad));
|
||||||
if (GST_INPUT_SELECTOR (parent)->select_all) {
|
|
||||||
caps = gst_pad_proxy_getcaps (pad);
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
otherpad = gst_input_selector_get_linked_pad (pad, FALSE);
|
otherpad = gst_input_selector_get_linked_pad (pad, FALSE);
|
||||||
|
|
||||||
if (!otherpad) {
|
if (!otherpad) {
|
||||||
|
if (GST_INPUT_SELECTOR (parent)->select_all) {
|
||||||
|
GST_DEBUG_OBJECT (parent,
|
||||||
|
"Pad %s:%s not linked, returning merge of caps",
|
||||||
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
|
caps = gst_pad_proxy_getcaps (pad);
|
||||||
|
} else {
|
||||||
GST_DEBUG_OBJECT (parent,
|
GST_DEBUG_OBJECT (parent,
|
||||||
"Pad %s:%s not linked, returning ANY", GST_DEBUG_PAD_NAME (pad));
|
"Pad %s:%s not linked, returning ANY", GST_DEBUG_PAD_NAME (pad));
|
||||||
caps = gst_caps_new_any ();
|
caps = gst_caps_new_any ();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (parent,
|
GST_DEBUG_OBJECT (parent,
|
||||||
"Pad %s:%s is linked (to %s:%s), returning peer caps",
|
"Pad %s:%s is linked (to %s:%s), returning peer caps",
|
||||||
|
@ -1037,7 +1041,6 @@ gst_input_selector_getcaps (GstPad * pad)
|
||||||
gst_object_unref (otherpad);
|
gst_object_unref (otherpad);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
gst_object_unref (parent);
|
gst_object_unref (parent);
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
@ -1069,8 +1072,9 @@ gst_input_selector_activate_sinkpad (GstInputSelector * sel, GstPad * pad)
|
||||||
|
|
||||||
selpad->active = TRUE;
|
selpad->active = TRUE;
|
||||||
active_sinkpad = sel->active_sinkpad;
|
active_sinkpad = sel->active_sinkpad;
|
||||||
if (active_sinkpad == NULL) {
|
if (active_sinkpad == NULL || sel->select_all) {
|
||||||
/* first pad we get activity on becomes the activated pad by default */
|
/* first pad we get activity on becomes the activated pad by default, if we
|
||||||
|
* select all, we also remember the last used pad. */
|
||||||
active_sinkpad = sel->active_sinkpad = gst_object_ref (pad);
|
active_sinkpad = sel->active_sinkpad = gst_object_ref (pad);
|
||||||
GST_DEBUG_OBJECT (sel, "Activating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_OBJECT (sel, "Activating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue