mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
decodebin3: Avoid usage of parsebin even more
When dealing with push-based inputs, we are now delaying the creation of parsebin/identity until we get all pre-buffer events. We therefore can simplify the handling of new pads being linked and only have to check if upstream can handle pull-based or not. Avoids creating parsebin for parsed upstream data altogether Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6953>
This commit is contained in:
parent
013026b06a
commit
6c4f52ea20
1 changed files with 5 additions and 20 deletions
|
@ -1633,7 +1633,6 @@ gst_decodebin3_input_pad_link (GstPad * pad, GstObject * parent, GstPad * peer)
|
|||
GstDecodebin3 *dbin = (GstDecodebin3 *) parent;
|
||||
GstQuery *query;
|
||||
gboolean pull_mode = FALSE;
|
||||
gboolean has_caps = TRUE;
|
||||
GstPadLinkReturn res = GST_PAD_LINK_OK;
|
||||
DecodebinInput *input = g_object_get_data (G_OBJECT (pad), "decodebin.input");
|
||||
|
||||
|
@ -1650,26 +1649,12 @@ gst_decodebin3_input_pad_link (GstPad * pad, GstObject * parent, GstPad * peer)
|
|||
|
||||
GST_DEBUG_OBJECT (dbin, "Upstream can do pull-based : %d", pull_mode);
|
||||
|
||||
if (!pull_mode) {
|
||||
/* If push-based, query if it will provide some caps */
|
||||
query = gst_query_new_caps (NULL);
|
||||
if (gst_pad_query (peer, query)) {
|
||||
GstCaps *rescaps = NULL;
|
||||
gst_query_parse_caps_result (query, &rescaps);
|
||||
if (!rescaps || gst_caps_is_any (rescaps) || gst_caps_is_empty (rescaps)) {
|
||||
GST_DEBUG_OBJECT (dbin, "Upstream can't provide caps");
|
||||
has_caps = FALSE;
|
||||
}
|
||||
}
|
||||
gst_query_unref (query);
|
||||
}
|
||||
|
||||
/* If upstream *can* do pull-based OR it doesn't have any caps, we always use
|
||||
* a parsebin. If not, we will delay that decision to a later stage
|
||||
* (caps/stream/collection event processing) to figure out if one is really
|
||||
* needed or whether an identity element will be enough */
|
||||
/* If upstream *can* do pull-based we always use a parsebin. If not, we will
|
||||
* delay that decision to a later stage (caps/stream/collection event
|
||||
* processing) to figure out if one is really needed or whether an identity
|
||||
* element will be enough */
|
||||
INPUT_LOCK (dbin);
|
||||
if (pull_mode || !has_caps) {
|
||||
if (pull_mode) {
|
||||
if (!gst_decodebin_input_ensure_parsebin (input))
|
||||
res = GST_PAD_LINK_REFUSED;
|
||||
else if (input->identity) {
|
||||
|
|
Loading…
Reference in a new issue