From 20633cec19b10ef4d4f27f6cb364e88bded5d160 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 15 Sep 2014 19:14:27 +0200 Subject: [PATCH] validate: Add the possibility to generate media infos with frame descs + Fix a little issue when the generation fails. https://bugzilla.gnome.org/show_bug.cgi?id=736138 --- validate/tools/launcher/apps/gstvalidate.py | 8 ++++++-- validate/tools/launcher/baseclasses.py | 5 +++-- validate/tools/launcher/main.py | 8 ++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/validate/tools/launcher/apps/gstvalidate.py b/validate/tools/launcher/apps/gstvalidate.py index daa43ed737..ff8db20e7f 100644 --- a/validate/tools/launcher/apps/gstvalidate.py +++ b/validate/tools/launcher/apps/gstvalidate.py @@ -526,8 +526,12 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""") elif not self.options.generate_info: return True - media_descriptor = GstValidateMediaDescriptor.new_from_uri(uri, True) - self._add_media(media_descriptor, uri) + media_descriptor = GstValidateMediaDescriptor.new_from_uri(uri, True, + self.options.generate_info_full) + if media_descriptor: + self._add_media(media_descriptor, uri) + else: + self.warning("Could not get any descriptor for %s" % uri) return True diff --git a/validate/tools/launcher/baseclasses.py b/validate/tools/launcher/baseclasses.py index 698c2b21a0..187b40486e 100644 --- a/validate/tools/launcher/baseclasses.py +++ b/validate/tools/launcher/baseclasses.py @@ -1138,13 +1138,15 @@ class GstValidateMediaDescriptor(MediaDescriptor): self.media_xml.attrib["seekable"] @staticmethod - def new_from_uri(uri, verbose=False): + def new_from_uri(uri, verbose=False, full=False): media_path = utils.url2path(uri) descriptor_path = "%s.%s" % (media_path, GstValidateMediaDescriptor.MEDIA_INFO_EXT) args = GstValidateMediaDescriptor.DISCOVERER_COMMAND.split(" ") args.append(uri) args.extend(["--output-file", descriptor_path]) + if full: + args.extend(["--full"]) if verbose: printc("Generating media info for %s\n" @@ -1163,7 +1165,6 @@ class GstValidateMediaDescriptor(MediaDescriptor): if verbose: printc("Result: Passed", Colors.OKGREEN) - return GstValidateMediaDescriptor(descriptor_path) def get_path(self): diff --git a/validate/tools/launcher/main.py b/validate/tools/launcher/main.py index ce62580aae..3ddd7a1b3d 100644 --- a/validate/tools/launcher/main.py +++ b/validate/tools/launcher/main.py @@ -218,6 +218,10 @@ def main(libsdir): parser.add_argument("-g", "--generate-media-info", dest="generate_info", action="store_true", default=False, help="Set it in order to generate the missing .media_infos files") + parser.add_argument("-G", "--generate-media-info-with-frame-detection", dest="generate_info_full", + action="store_true", default=False, + help="Set it in order to generate the missing .media_infos files" + "It implies --generate-media-info but enabling frame detection") parser.add_argument("-lt", "--long-test-limit", dest="long_limit", default=utils.LONG_TEST, action='store', help="Defines the limite from which a test is concidered as long (in seconds)"), @@ -335,6 +339,10 @@ user argument, you can thus overrides command line options using that. if options.paths is None: options.paths = os.path.join(options.clone_dir, MEDIAS_FOLDER) + if options.generate_info_full is True: + options.generate_info = True + + if options.http_server_dir is None: if isinstance(options.paths, list): options.http_server_dir = options.paths[0]