summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-02-04 15:34:04 +1100
committerMatthew Waters <matthew@centricular.com>2016-02-04 18:07:47 +1100
commitf352691a04896d0de3381fe8ee85ada948bd6337 (patch)
tree676a945a8e21c958c3fa97068e554e452ef01ef7 /gst
parent4bbe16bb7fd6217391aa9d4cfa8307d1e871c809 (diff)
downloadgstreamer-plugins-bad-f352691a04896d0de3381fe8ee85ada948bd6337.tar.gz
h264parse: try the current caps before querying downstream
If we have a stream that contains an unchanging SPS/PPS for every video frame, we don't need to to constantly query downstream for it's supported caps if the current caps are compatible with the negotiated caps. https://bugzilla.gnome.org/show_bug.cgi?id=761014
Diffstat (limited to 'gst')
-rw-r--r--gst/videoparsers/gsth264parse.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 21df95e2a..9b90ebe17 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1499,11 +1499,20 @@ get_compatible_profile_caps (GstH264SPS * sps)
static void
ensure_caps_profile (GstH264Parse * h264parse, GstCaps * caps, GstH264SPS * sps)
{
- GstCaps *filter_caps, *peer_caps, *compat_caps;
+ GstCaps *peer_caps, *compat_caps;
- filter_caps = gst_caps_new_empty_simple ("video/x-h264");
- peer_caps =
- gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (h264parse), filter_caps);
+ peer_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (h264parse));
+ if (!peer_caps || !gst_caps_can_intersect (caps, peer_caps)) {
+ GstCaps *filter_caps = gst_caps_new_empty_simple ("video/x-h264");
+
+ if (peer_caps)
+ gst_caps_unref (peer_caps);
+ peer_caps =
+ gst_pad_peer_query_caps (GST_BASE_PARSE_SRC_PAD (h264parse),
+ filter_caps);
+
+ gst_caps_unref (filter_caps);
+ }
if (peer_caps && !gst_caps_can_intersect (caps, peer_caps)) {
GstStructure *structure;
@@ -1534,7 +1543,6 @@ ensure_caps_profile (GstH264Parse * h264parse, GstCaps * caps, GstH264SPS * sps)
}
if (peer_caps)
gst_caps_unref (peer_caps);
- gst_caps_unref (filter_caps);
}
static const gchar *