mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 14:38:48 +00:00
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
This commit is contained in:
parent
b3fa06c3c1
commit
20633cec19
3 changed files with 17 additions and 4 deletions
|
@ -526,8 +526,12 @@ not been tested and explicitely activated if you set use --wanted-tests ALL""")
|
||||||
elif not self.options.generate_info:
|
elif not self.options.generate_info:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
media_descriptor = GstValidateMediaDescriptor.new_from_uri(uri, True)
|
media_descriptor = GstValidateMediaDescriptor.new_from_uri(uri, True,
|
||||||
|
self.options.generate_info_full)
|
||||||
|
if media_descriptor:
|
||||||
self._add_media(media_descriptor, uri)
|
self._add_media(media_descriptor, uri)
|
||||||
|
else:
|
||||||
|
self.warning("Could not get any descriptor for %s" % uri)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -1138,13 +1138,15 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
||||||
self.media_xml.attrib["seekable"]
|
self.media_xml.attrib["seekable"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def new_from_uri(uri, verbose=False):
|
def new_from_uri(uri, verbose=False, full=False):
|
||||||
media_path = utils.url2path(uri)
|
media_path = utils.url2path(uri)
|
||||||
descriptor_path = "%s.%s" % (media_path, GstValidateMediaDescriptor.MEDIA_INFO_EXT)
|
descriptor_path = "%s.%s" % (media_path, GstValidateMediaDescriptor.MEDIA_INFO_EXT)
|
||||||
args = GstValidateMediaDescriptor.DISCOVERER_COMMAND.split(" ")
|
args = GstValidateMediaDescriptor.DISCOVERER_COMMAND.split(" ")
|
||||||
args.append(uri)
|
args.append(uri)
|
||||||
|
|
||||||
args.extend(["--output-file", descriptor_path])
|
args.extend(["--output-file", descriptor_path])
|
||||||
|
if full:
|
||||||
|
args.extend(["--full"])
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
printc("Generating media info for %s\n"
|
printc("Generating media info for %s\n"
|
||||||
|
@ -1163,7 +1165,6 @@ class GstValidateMediaDescriptor(MediaDescriptor):
|
||||||
if verbose:
|
if verbose:
|
||||||
printc("Result: Passed", Colors.OKGREEN)
|
printc("Result: Passed", Colors.OKGREEN)
|
||||||
|
|
||||||
|
|
||||||
return GstValidateMediaDescriptor(descriptor_path)
|
return GstValidateMediaDescriptor(descriptor_path)
|
||||||
|
|
||||||
def get_path(self):
|
def get_path(self):
|
||||||
|
|
|
@ -218,6 +218,10 @@ def main(libsdir):
|
||||||
parser.add_argument("-g", "--generate-media-info", dest="generate_info",
|
parser.add_argument("-g", "--generate-media-info", dest="generate_info",
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
help="Set it in order to generate the missing .media_infos files")
|
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",
|
parser.add_argument("-lt", "--long-test-limit", dest="long_limit",
|
||||||
default=utils.LONG_TEST, action='store',
|
default=utils.LONG_TEST, action='store',
|
||||||
help="Defines the limite from which a test is concidered as long (in seconds)"),
|
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:
|
if options.paths is None:
|
||||||
options.paths = os.path.join(options.clone_dir, MEDIAS_FOLDER)
|
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 options.http_server_dir is None:
|
||||||
if isinstance(options.paths, list):
|
if isinstance(options.paths, list):
|
||||||
options.http_server_dir = options.paths[0]
|
options.http_server_dir = options.paths[0]
|
||||||
|
|
Loading…
Reference in a new issue