return;
}
- /* Only a single format */
- if (fmts[1] == -1) {
- format = gst_ffmpeg_smpfmt_to_audioformat (fmts[0]);
- if (format != GST_AUDIO_FORMAT_UNKNOWN)
- gst_caps_set_simple (caps, "format", G_TYPE_STRING,
- gst_audio_format_to_string (format), NULL);
- return;
- }
-
g_value_init (&va, GST_TYPE_LIST);
g_value_init (&v, G_TYPE_STRING);
while (*fmts != -1) {
}
fmts++;
}
- if (gst_value_list_get_size (&va) > 0)
+ if (gst_value_list_get_size (&va) == 1) {
+ /* The single value is still in v */
+ gst_caps_set_value (caps, "format", &v);
+ } else if (gst_value_list_get_size (&va) > 1) {
gst_caps_set_value (caps, "format", &va);
+ }
g_value_unset (&v);
g_value_unset (&va);
}
}
/* Only a single format */
- if (fmts[1] == -1) {
- format = gst_ffmpeg_pixfmt_to_videoformat (fmts[0]);
- if (format != GST_VIDEO_FORMAT_UNKNOWN)
- gst_caps_set_simple (caps, "format", G_TYPE_STRING,
- gst_video_format_to_string (format), NULL);
- return;
- }
-
g_value_init (&va, GST_TYPE_LIST);
g_value_init (&v, G_TYPE_STRING);
while (*fmts != -1) {
}
fmts++;
}
- if (gst_value_list_get_size (&va) > 0)
+ if (gst_value_list_get_size (&va) == 1) {
+ /* The single value is still in v */
+ gst_caps_set_value (caps, "format", &v);
+ } else if (gst_value_list_get_size (&va) > 1) {
gst_caps_set_value (caps, "format", &va);
+ }
g_value_unset (&v);
g_value_unset (&va);
}
GST_DEBUG ("Couldn't get sink caps for decoder '%s'", in_plugin->name);
sinkcaps = gst_caps_new_empty_simple ("unknown/unknown");
}
- srccaps = gst_caps_new_empty_simple ("video/x-raw");
+ srccaps = gst_ffmpeg_codectype_to_video_caps (NULL,
+ in_plugin->id, FALSE, in_plugin);
+ if (!srccaps) {
+ GST_DEBUG ("Couldn't get source caps for decoder '%s'", in_plugin->name);
+ srccaps = gst_caps_from_string ("video/x-raw");
+ }
/* pad templates */
sinktempl = gst_pad_template_new ("sink", GST_PAD_SINK,