def register_defaults(self, project_paths=None):
        projects = list()
        if not self.args:
            if project_paths == None:
                path = self.options.projects_paths
            else:
                path = project_paths

            for root, dirs, files in os.walk(path):
                for f in files:
                    if not f.endswith(".xges"):
                        continue
                    projects.append(utils.path2url(os.path.join(path, root, f)))
        else:
            for proj_uri in self.args:
                if not utils.isuri(proj_uri):
                    proj_uri = utils.path2url(proj_uri)

                if os.path.exists(proj_uri):
                    projects.append(proj_uri)

        if self.options.long_limit != 0:
            scenarios = ["none",
                         "scrub_forward_seeking",
                         "scrub_backward_seeking"]
        else:
            scenarios = ["play_15s",
                         "scrub_forward_seeking_full",
                         "scrub_backward_seeking_full"]
        for proj_uri in projects:
            # First playback casses
            project = XgesProjectDescriptor(proj_uri)
            for scenario_name in scenarios:
                scenario = self._scenarios.get_scenario(scenario_name)
                if scenario is None:
                    continue

                if scenario.get_min_media_duration() >= (project.get_duration() / utils.GST_SECOND):
                    continue

                classname = "ges.playback.%s.%s" % (scenario.name,
                                                    os.path.basename(proj_uri).replace(".xges", ""))
                self.add_test(GESPlaybackTest(classname,
                                              self.options,
                                              self.reporter,
                                              project,
                                              scenario=scenario)
                                  )

            # And now rendering casses
            for comb in GES_ENCODING_TARGET_COMBINATIONS:
                classname = "ges.render.%s.%s" % (str(comb).replace(' ', '_'),
                                                  os.path.splitext(os.path.basename(proj_uri))[0])
                self.add_test(GESRenderTest(classname, self.options,
                                            self.reporter, project,
                                            combination=comb)
                                  )
    def _set_rendering_info(self):
        self.dest_file = path = os.path.join(self.options.dest,
                                             self.classname.replace(".render.", os.sep).
                                             replace(".", os.sep))
        utils.mkdir(os.path.dirname(urlparse.urlsplit(self.dest_file).path))
        if not utils.isuri(self.dest_file):
            self.dest_file = utils.path2url(self.dest_file)

        profile = self.get_profile(video_restriction="video/x-raw,format=I420")
        self.add_arguments("-f", profile, "-o", self.dest_file)
    def _set_rendering_info(self):
        self.dest_file = path = os.path.join(
            self.options.dest,
            self.classname.replace(".render.", os.sep).replace(".", os.sep))
        utils.mkdir(os.path.dirname(urlparse.urlsplit(self.dest_file).path))
        if not utils.isuri(self.dest_file):
            self.dest_file = utils.path2url(self.dest_file)

        profile = self.get_profile(video_restriction="video/x-raw,format=I420")
        self.add_arguments("-f", profile, "-o", self.dest_file)
Beispiel #4
0
    def list_tests(self):
        if self.tests:
            return self.tests

        projects = list()
        if not self.args:
            path = self.options.projects_paths
            for root, dirs, files in os.walk(path):
                for f in files:
                    if not f.endswith(".xges"):
                        continue
                    projects.append(utils.path2url(os.path.join(path, root, f)))
        else:
            for proj in self.args:
                if not utils.isuri(proj):
                    proj = utils.path2url(proj)

                if os.path.exists(proj):
                    projects.append(proj)

        SCENARIOS = ["play_15s",
                     "seek_forward",
                     "seek_backward",
                     "scrub_forward_seeking"]
        for proj in projects:
            # First playback casses
            for scenario_name in SCENARIOS:
                scenario = self._scenarios.get_scenario(scenario_name)
                if scenario is None:
                    continue
                classname = "ges.playback.%s.%s" % (scenario.name,
                                                    os.path.basename(proj).replace(".xges", ""))
                self.add_test(GESPlaybackTest(classname,
                                              self.options,
                                              self.reporter,
                                              proj,
                                              scenario=scenario)
                                  )

            # And now rendering casses
            for comb in GES_ENCODING_TARGET_COMBINATIONS:
                classname = "ges.render.%s.%s" % (str(comb).replace(' ', '_'),
                                                  os.path.splitext(os.path.basename(proj))[0])
                self.add_test(GESRenderTest(classname, self.options,
                                            self.reporter, proj,
                                            combination=comb)
                                  )

        return self.tests
    def register_defaults(self, project_paths=None):
        projects = list()
        if not self.args:
            if project_paths == None:
                path = self.options.projects_paths
            else:
                path = project_paths

            for root, dirs, files in os.walk(path):
                for f in files:
                    if not f.endswith(".xges"):
                        continue
                    projects.append(utils.path2url(os.path.join(path, root,
                                                                f)))
        else:
            for proj_uri in self.args:
                if not utils.isuri(proj_uri):
                    proj_uri = utils.path2url(proj_uri)

                if os.path.exists(proj_uri):
                    projects.append(proj_uri)

        if self.options.long_limit != 0:
            scenarios = [
                "none", "scrub_forward_seeking", "scrub_backward_seeking"
            ]
        else:
            scenarios = [
                "play_15s", "scrub_forward_seeking_full",
                "scrub_backward_seeking_full"
            ]
        for proj_uri in projects:
            # First playback casses
            project = XgesProjectDescriptor(proj_uri)
            for scenario_name in scenarios:
                scenario = self._scenarios.get_scenario(scenario_name)
                if scenario is None:
                    continue

                if scenario.get_min_media_duration() >= (
                        project.get_duration() / utils.GST_SECOND):
                    continue

                classname = "ges.playback.%s.%s" % (
                    scenario.name, os.path.basename(proj_uri).replace(
                        ".xges", ""))
                self.add_test(
                    GESPlaybackTest(classname,
                                    self.options,
                                    self.reporter,
                                    project,
                                    scenario=scenario))

            # And now rendering casses
            for comb in GES_ENCODING_TARGET_COMBINATIONS:
                classname = "ges.render.%s.%s" % (str(comb).replace(
                    ' ', '_'), os.path.splitext(os.path.basename(proj_uri))[0])
                self.add_test(
                    GESRenderTest(classname,
                                  self.options,
                                  self.reporter,
                                  project,
                                  combination=comb))