Ejemplo n.º 1
0
    def set_source_pipeline_playing(self):
        if (self.source_pipeline.set_state(Gst.State.PAUSED) ==
                Gst.StateChangeReturn.NO_PREROLL):
            # This is a live source, drop frames if we get behind
            self.source_pipeline.get_by_name('_stbt_raw_frames_queue') \
                .set_property('leaky', to_native_str('downstream'))
            self.source_pipeline.get_by_name('appsink') \
                .set_property('sync', False)

        self.source_pipeline.set_state(Gst.State.PLAYING)
Ejemplo n.º 2
0
def temporary_config(contents, prefix="stbt-test-config"):
    with named_temporary_directory(prefix=prefix) as d:
        original_env = os.environ.get("STBT_CONFIG_FILE", "")
        filename = os.path.join(d, "stbt.conf")
        os.environ["STBT_CONFIG_FILE"] = to_native_str(":".join(
            [filename, original_env]))
        with open(filename, "w") as f:
            f.write(dedent(contents))
        _config_init(force=True)
        try:
            yield
        finally:
            os.environ["STBT_CONFIG_FILE"] = original_env
            _config_init(force=True)
Ejemplo n.º 3
0
from _stbt.logging import (debug)
from _stbt.match import (ConfirmMethod, match, match_all, MatchMethod,
                         MatchParameters, MatchResult, MatchTimeout,
                         wait_for_match)
from _stbt.motion import (detect_motion, MotionTimeout, wait_for_motion)
from _stbt.ocr import (apply_ocr_corrections, match_text, ocr, OcrEngine,
                       OcrMode, set_global_ocr_corrections, TextMatchResult)
from _stbt.precondition import (as_precondition, PreconditionError)
from _stbt.transition import (press_and_wait, StrictDiff, TransitionStatus,
                              wait_for_transition_to_end)
from _stbt.types import (NoVideo, Position, Region, UITestError, UITestFailure)
from _stbt.utils import (to_native_str)
from _stbt.wait import (wait_until)

__all__ = [
    to_native_str(x) for x in [
        "apply_ocr_corrections",
        "as_precondition",
        "ConfigurationError",
        "ConfirmMethod",
        "crop",
        "debug",
        "detect_motion",
        "draw_text",
        "for_object_repository",
        "Frame",
        "FrameDiffer",
        "FrameObject",
        "frames",
        "get_config",
        "get_frame",