validate:media-descriptor-writer: Handle medias with 1 single stream

This commit is contained in:
Thibault Saunier 2014-07-15 11:59:23 +02:00
parent fa35a10779
commit f8a37a1c80

View file

@ -464,8 +464,8 @@ _run_frame_analisis (GstMediaDescriptorWriter * writer,
writer->priv->pipeline = gst_pipeline_new ("frame-analisis"); writer->priv->pipeline = gst_pipeline_new ("frame-analisis");
monitor = monitor =
gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer-> gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer->priv->
priv->pipeline), runner, NULL); pipeline), runner, NULL);
gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor)); gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor));
g_object_set (uridecodebin, "uri", uri, "caps", writer->priv->raw_caps, NULL); g_object_set (uridecodebin, "uri", uri, "caps", writer->priv->raw_caps, NULL);
@ -501,7 +501,7 @@ GstMediaDescriptorWriter *
gst_media_descriptor_writer_new_discover (GstValidateRunner * runner, gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
const gchar * uri, gboolean full, GError ** err) const gchar * uri, gboolean full, GError ** err)
{ {
GList *tmp, *streams; GList *tmp, *streams = NULL;
GstDiscovererInfo *info; GstDiscovererInfo *info;
GstDiscoverer *discoverer; GstDiscoverer *discoverer;
GstDiscovererStreamInfo *streaminfo; GstDiscovererStreamInfo *streaminfo;
@ -535,6 +535,8 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
gst_discoverer_info_get_tags (info)); gst_discoverer_info_get_tags (info));
streaminfo = gst_discoverer_info_get_stream_info (info); streaminfo = gst_discoverer_info_get_stream_info (info);
if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) {
((GstMediaDescriptor *) writer)->filenode->caps = ((GstMediaDescriptor *) writer)->filenode->caps =
gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO
(streaminfo)); (streaminfo));
@ -543,6 +545,9 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
for (tmp = streams; tmp; tmp = tmp->next) { for (tmp = streams; tmp; tmp = tmp->next) {
gst_media_descriptor_writer_add_stream (writer, tmp->data); gst_media_descriptor_writer_add_stream (writer, tmp->data);
} }
} else {
gst_media_descriptor_writer_add_stream (writer, streaminfo);
}
if (streams == NULL) if (streams == NULL)
writer->priv->raw_caps = writer->priv->raw_caps =