summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2015-08-16 14:53:42 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-08-16 15:48:16 +0200
commite0327521f6d8340f9c901697e69ba942916b32da (patch)
tree0266df9f9924950bd5eaca846bb5c9a787eb947e
parentd2df0fb032c36b366a08a1355c4f4c816eb53447 (diff)
downloadgst-omx-e0327521f6d8340f9c901697e69ba942916b32da.tar.gz
omxh264dec: implement is_format_change
The omxvideodecoder class only checks some of the caps parameters but if other fields change such as h264 profile and/or level it wouldn't trigger a reconfiguration. https://bugzilla.gnome.org/show_bug.cgi?id=752376
-rw-r--r--omx/gstomxh264dec.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/omx/gstomxh264dec.c b/omx/gstomxh264dec.c
index 2581889..2132d9f 100644
--- a/omx/gstomxh264dec.c
+++ b/omx/gstomxh264dec.c
@@ -83,6 +83,31 @@ static gboolean
gst_omx_h264_dec_is_format_change (GstOMXVideoDec * dec,
GstOMXPort * port, GstVideoCodecState * state)
{
+ GstCaps *old_caps = NULL;
+ GstCaps *new_caps = state->caps;
+ GstStructure *old_structure, *new_structure;
+ const gchar *old_profile, *old_level, *new_profile, *new_level;
+
+ if (dec->input_state) {
+ old_caps = dec->input_state->caps;
+ }
+
+ if (!old_caps) {
+ return FALSE;
+ }
+
+ old_structure = gst_caps_get_structure (old_caps, 0);
+ new_structure = gst_caps_get_structure (new_caps, 0);
+ old_profile = gst_structure_get_string (old_structure, "profile");
+ old_level = gst_structure_get_string (old_structure, "level");
+ new_profile = gst_structure_get_string (new_structure, "profile");
+ new_level = gst_structure_get_string (new_structure, "level");
+
+ if (g_strcmp0 (old_profile, new_profile) != 0
+ || g_strcmp0 (old_level, new_level) != 0) {
+ return TRUE;
+ }
+
return FALSE;
}