mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
validate:tools: Add a 'discover-only' option to media-check
This commit is contained in:
parent
a61ebe671e
commit
a406ebb4c2
3 changed files with 33 additions and 19 deletions
|
@ -92,6 +92,7 @@ gst_validate_media_info_init (GstValidateMediaInfo * mi)
|
||||||
mi->reverse_playback_error = NULL;
|
mi->reverse_playback_error = NULL;
|
||||||
mi->track_switch_error = NULL;
|
mi->track_switch_error = NULL;
|
||||||
mi->is_image = FALSE;
|
mi->is_image = FALSE;
|
||||||
|
mi->discover_only = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1064,7 +1065,7 @@ check_is_image (GstDiscovererInfo *info)
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi,
|
gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi,
|
||||||
const gchar * uri, GError ** err)
|
const gchar * uri, gboolean discover_only, GError ** err)
|
||||||
{
|
{
|
||||||
GstDiscovererInfo *info;
|
GstDiscovererInfo *info;
|
||||||
GstDiscoverer *discoverer = gst_discoverer_new (GST_SECOND * 60, err);
|
GstDiscoverer *discoverer = gst_discoverer_new (GST_SECOND * 60, err);
|
||||||
|
@ -1094,7 +1095,10 @@ gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi,
|
||||||
if (mi->is_image)
|
if (mi->is_image)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
ret = check_seekable (mi, info) & ret;
|
check_seekable (mi, info);
|
||||||
|
if (discover_only)
|
||||||
|
goto done;
|
||||||
|
|
||||||
ret = check_playback (mi, &mi->playback_error) & ret;
|
ret = check_playback (mi, &mi->playback_error) & ret;
|
||||||
ret = check_reverse_playback (mi, &mi->reverse_playback_error) & ret;
|
ret = check_reverse_playback (mi, &mi->reverse_playback_error) & ret;
|
||||||
ret = check_track_selection (mi, &mi->track_switch_error) & ret;
|
ret = check_track_selection (mi, &mi->track_switch_error) & ret;
|
||||||
|
@ -1125,6 +1129,8 @@ gst_validate_media_info_compare (GstValidateMediaInfo * expected,
|
||||||
g_print ("File isn't seekable anymore\n");
|
g_print ("File isn't seekable anymore\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (extracted->discover_only == FALSE) {
|
||||||
if (expected->playback_error == NULL && extracted->playback_error) {
|
if (expected->playback_error == NULL && extracted->playback_error) {
|
||||||
g_print ("Playback is now failing with: %s\n", extracted->playback_error);
|
g_print ("Playback is now failing with: %s\n", extracted->playback_error);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
@ -1140,6 +1146,8 @@ gst_validate_media_info_compare (GstValidateMediaInfo * expected,
|
||||||
extracted->track_switch_error);
|
extracted->track_switch_error);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (expected->stream_info
|
if (expected->stream_info
|
||||||
&& !gst_caps_is_equal_fixed (expected->stream_info->caps,
|
&& !gst_caps_is_equal_fixed (expected->stream_info->caps,
|
||||||
extracted->stream_info->caps)) {
|
extracted->stream_info->caps)) {
|
||||||
|
|
|
@ -56,6 +56,8 @@ struct _GstValidateMediaInfo {
|
||||||
|
|
||||||
gchar *uri;
|
gchar *uri;
|
||||||
|
|
||||||
|
gboolean discover_only;
|
||||||
|
|
||||||
GstValidateStreamInfo *stream_info;
|
GstValidateStreamInfo *stream_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,7 +69,8 @@ gchar * gst_validate_media_info_to_string (GstValidateMediaInfo * mi, gsize * le
|
||||||
gboolean gst_validate_media_info_save (GstValidateMediaInfo * mi, const gchar * path, GError ** err);
|
gboolean gst_validate_media_info_save (GstValidateMediaInfo * mi, const gchar * path, GError ** err);
|
||||||
GstValidateMediaInfo * gst_validate_media_info_load (const gchar * path, GError ** err);
|
GstValidateMediaInfo * gst_validate_media_info_load (const gchar * path, GError ** err);
|
||||||
|
|
||||||
gboolean gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi, const gchar * uri, GError ** err);
|
gboolean gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi, const gchar * uri,
|
||||||
|
gboolean discover_only, GError ** err);
|
||||||
|
|
||||||
gboolean gst_validate_media_info_compare (GstValidateMediaInfo * expected, GstValidateMediaInfo * extracted);
|
gboolean gst_validate_media_info_compare (GstValidateMediaInfo * expected, GstValidateMediaInfo * extracted);
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ main (int argc, gchar ** argv)
|
||||||
gchar *expected_file = NULL;
|
gchar *expected_file = NULL;
|
||||||
gchar *output = NULL;
|
gchar *output = NULL;
|
||||||
gsize outputlength;
|
gsize outputlength;
|
||||||
gboolean ret;
|
gboolean ret, discover_only;
|
||||||
|
|
||||||
GOptionEntry options[] = {
|
GOptionEntry options[] = {
|
||||||
{"output-file", 'o', 0, G_OPTION_ARG_FILENAME,
|
{"output-file", 'o', 0, G_OPTION_ARG_FILENAME,
|
||||||
|
@ -181,6 +181,9 @@ main (int argc, gchar ** argv)
|
||||||
&expected_file, "Path to file containing the expected results "
|
&expected_file, "Path to file containing the expected results "
|
||||||
"(or the last results found) for comparison with new results",
|
"(or the last results found) for comparison with new results",
|
||||||
NULL},
|
NULL},
|
||||||
|
{"discover-only", 'e', 0, G_OPTION_ARG_NONE,
|
||||||
|
&discover_only, "Only discover files, no other playback tests",
|
||||||
|
NULL},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -213,7 +216,7 @@ main (int argc, gchar ** argv)
|
||||||
g_option_context_free (ctx);
|
g_option_context_free (ctx);
|
||||||
|
|
||||||
gst_validate_media_info_init (&mi);
|
gst_validate_media_info_init (&mi);
|
||||||
ret = gst_validate_media_info_inspect_uri (&mi, argv[1], NULL);
|
ret = gst_validate_media_info_inspect_uri (&mi, argv[1], discover_only, NULL);
|
||||||
output = gst_validate_media_info_to_string (&mi, &outputlength);
|
output = gst_validate_media_info_to_string (&mi, &outputlength);
|
||||||
|
|
||||||
if (output_file)
|
if (output_file)
|
||||||
|
|
Loading…
Reference in a new issue