mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
media-check: enable 'full' for files which reference are also 'full'
If the reference file has frames information, enable it automatically so that the comparison file also has frames to be used. https://bugzilla.gnome.org/show_bug.cgi?id=758855
This commit is contained in:
parent
ee7cb88d02
commit
ae52807efd
3 changed files with 33 additions and 9 deletions
|
@ -547,6 +547,22 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_media_descriptor_has_frame_info (GstMediaDescriptor * self)
|
||||
{
|
||||
GList *tmpstream;
|
||||
|
||||
for (tmpstream = self->filenode->streams;
|
||||
tmpstream; tmpstream = tmpstream->next) {
|
||||
StreamNode *streamnode = (StreamNode *) tmpstream->data;
|
||||
|
||||
if (g_list_length (streamnode->frames))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GstClockTime
|
||||
gst_media_descriptor_get_duration (GstMediaDescriptor * self)
|
||||
{
|
||||
|
|
|
@ -151,6 +151,7 @@ gboolean gst_media_descriptors_compare (GstMediaDescriptor *ref,
|
|||
gboolean gst_media_descriptor_detects_frames (GstMediaDescriptor * self);
|
||||
gboolean gst_media_descriptor_get_buffers (GstMediaDescriptor * self,
|
||||
GstPad * pad, GCompareFunc compare_func, GList ** bufs);
|
||||
gboolean gst_media_descriptor_has_frame_info (GstMediaDescriptor * self);
|
||||
GstClockTime gst_media_descriptor_get_duration (GstMediaDescriptor * self);
|
||||
gboolean gst_media_descriptor_get_seekable (GstMediaDescriptor * self);
|
||||
GList * gst_media_descriptor_get_pads (GstMediaDescriptor * self);
|
||||
|
|
|
@ -97,6 +97,21 @@ main (int argc, gchar ** argv)
|
|||
g_option_context_free (ctx);
|
||||
|
||||
runner = gst_validate_runner_new ();
|
||||
|
||||
if (expected_file) {
|
||||
reference = gst_media_descriptor_parser_new (runner, expected_file, NULL);
|
||||
|
||||
if (reference == NULL) {
|
||||
g_print ("Could not parse file: %s\n", expected_file);
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!full && gst_media_descriptor_has_frame_info ((GstMediaDescriptor *)
|
||||
reference))
|
||||
full = TRUE; /* Reference has frame info, activate to do comparison */
|
||||
}
|
||||
|
||||
writer =
|
||||
gst_media_descriptor_writer_new_discover (runner, argv[1], full, TRUE,
|
||||
NULL);
|
||||
|
@ -113,15 +128,7 @@ main (int argc, gchar ** argv)
|
|||
}
|
||||
}
|
||||
|
||||
if (expected_file) {
|
||||
reference = gst_media_descriptor_parser_new (runner, expected_file, NULL);
|
||||
|
||||
if (reference == NULL) {
|
||||
g_print ("Could not parse file: %s\n", expected_file);
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (reference) {
|
||||
if (!gst_media_descriptors_compare (GST_MEDIA_DESCRIPTOR (reference),
|
||||
GST_MEDIA_DESCRIPTOR (writer))) {
|
||||
ret = 1;
|
||||
|
|
Loading…
Reference in a new issue