/* Decodebin3 pad to which src_pad is linked to */
GstPad *db3_sink_pad;
- /* TRUE if db3_sink_pad is a request pad */
- gboolean db3_pad_is_request;
-
/* TRUE if EOS went through the source pad. Marked as TRUE if decodebin3
* notified `about-to-finish` for pull mode */
gboolean saw_eos;
GstSourceHandler *handler = spad->handler;
GstPad *sinkpad = NULL;
- /* Try to link to main sink pad only if it's from a main handler */
- if (handler->is_main_source) {
- sinkpad = gst_element_get_static_pad (uridecodebin->decodebin, "sink");
- if (gst_pad_is_linked (sinkpad)) {
- gst_object_unref (sinkpad);
- sinkpad = NULL;
- }
- }
-
- if (sinkpad == NULL) {
- sinkpad =
- gst_element_request_pad_simple (uridecodebin->decodebin, "sink_%u");
- spad->db3_pad_is_request = TRUE;
- }
+ sinkpad = gst_element_request_pad_simple (uridecodebin->decodebin, "sink_%u");
if (sinkpad) {
GstPadLinkReturn res;
GST_DEBUG_PAD_NAME (new_spad->src_pad));
gst_pad_unlink (old_spad->src_pad, old_spad->db3_sink_pad);
new_spad->db3_sink_pad = old_spad->db3_sink_pad;
- new_spad->db3_pad_is_request = old_spad->db3_pad_is_request;
old_spad->db3_sink_pad = NULL;
/* NOTE : Pad will be linked further down */
}
}
- /* If the old pads contains the static decodebin3 sinkpad *and* we have a new
- * pad to activate, we re-use it */
- if (to_activate) {
- /* Remove unmatched old source pads */
- for (iterold = old_pads; iterold; iterold = iterold->next) {
- GstSourcePad *old_spad = iterold->data;
- if (old_spad->db3_sink_pad && !old_spad->db3_pad_is_request) {
- GstSourcePad *new_spad = to_activate->data;
-
- GST_DEBUG_OBJECT (uridecodebin, "Static sinkpad can be re-used");
- GST_DEBUG_OBJECT (uridecodebin, "Relinking %s:%s from %s:%s to %s:%s",
- GST_DEBUG_PAD_NAME (old_spad->db3_sink_pad),
- GST_DEBUG_PAD_NAME (old_spad->src_pad),
- GST_DEBUG_PAD_NAME (new_spad->src_pad));
- gst_pad_unlink (old_spad->src_pad, old_spad->db3_sink_pad);
- new_spad->db3_sink_pad = old_spad->db3_sink_pad;
- new_spad->db3_pad_is_request = old_spad->db3_pad_is_request;
- old_spad->db3_sink_pad = NULL;
-
- /* NOTE : Pad will be linked further down */
- old_pads = g_list_remove (old_pads, old_spad);
- to_activate = g_list_remove (to_activate, new_spad);
- break;
- }
- }
- }
-
/* Remove unmatched old source pads */
for (iterold = old_pads; iterold; iterold = iterold->next) {
GstSourcePad *old_spad = iterold->data;
- if (old_spad->db3_sink_pad && old_spad->db3_pad_is_request) {
+ if (old_spad->db3_sink_pad) {
GST_DEBUG_OBJECT (uridecodebin, "Releasing no longer used db3 pad");
gst_element_release_request_pad (uridecodebin->decodebin,
old_spad->db3_sink_pad);
"Source %" GST_PTR_FORMAT " removed pad %" GST_PTR_FORMAT " peer %"
GST_PTR_FORMAT, element, pad, spad->db3_sink_pad);
- if (spad->db3_sink_pad && spad->db3_pad_is_request)
+ if (spad->db3_sink_pad)
gst_element_release_request_pad (uridecodebin->decodebin,
spad->db3_sink_pad);