playback: find raw caps correctly

This commit is contained in:
Wim Taymans 2012-02-20 15:17:29 +01:00
parent 6678c531e0
commit 4370d42cb9
3 changed files with 7 additions and 8 deletions

View file

@ -2895,8 +2895,7 @@ is_raw_structure (GstStructure * s)
name = gst_structure_get_name (s);
if (g_str_has_prefix (name, "video/x-raw") ||
g_str_has_prefix (name, "audio/x-raw"))
if (g_str_equal (name, "video/x-raw") || g_str_equal (name, "audio/x-raw"))
return TRUE;
return FALSE;
}

View file

@ -54,13 +54,13 @@ is_raw_caps (GstCaps * caps, gboolean audio)
gint i, n;
GstStructure *s;
const gchar *name;
const gchar *prefix = audio ? "audio/x-raw-" : "video/x-raw-";
const gchar *prefix = audio ? "audio/x-raw" : "video/x-raw";
n = gst_caps_get_size (caps);
for (i = 0; i < n; i++) {
s = gst_caps_get_structure (caps, i);
name = gst_structure_get_name (s);
if (!g_str_has_prefix (name, prefix))
if (!g_str_equal (name, prefix))
return FALSE;
}
@ -333,9 +333,9 @@ gst_play_sink_convert_bin_sink_setcaps (GstPlaySinkConvertBin * self,
name = gst_structure_get_name (s);
if (self->audio) {
raw = g_str_has_prefix (name, "audio/x-raw-");
raw = g_str_equal (name, "audio/x-raw");
} else {
raw = g_str_has_prefix (name, "video/x-raw-");
raw = g_str_equal (name, "video/x-raw");
}
GST_DEBUG_OBJECT (self, "raw %d, self->raw %d, blocked %d",

View file

@ -232,7 +232,7 @@ _is_raw_video (GstStructure * s)
name = gst_structure_get_name (s);
if (g_str_has_prefix (name, "video/x-raw"))
if (g_str_equal (name, "video/x-raw"))
return TRUE;
return FALSE;
}
@ -256,7 +256,7 @@ _is_video_pad (GstPad * pad, gboolean * hw_accelerated)
}
name = gst_structure_get_name (gst_caps_get_structure (caps, 0));
if (!strcmp (name, "video/x-raw")) {
if (g_str_equal (name, "video/x-raw")) {
ret = TRUE;
if (hw_accelerated)
*hw_accelerated = FALSE;