Coverage for src/pythia/applications/demo.py: 89%

14 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2022-10-07 19:27 +0000

1"""Playbin.""" 

2 

3from pythia.applications.command_line import CliApplication 

4from pythia.utils.ext import IS_JETSON 

5from pythia.utils.gst import gst_init 

6 

7 

8class _Demo(CliApplication): 

9 @classmethod 

10 def _play(cls, uri: str, *, background: bool = False) -> None: 

11 gst_init() 

12 egltransform = "nvegltransform ! " if IS_JETSON else "" 

13 app = cls.from_pipeline_string( 

14 f"uridecodebin uri={uri} ! {egltransform}nveglglessink" 

15 ) 

16 if background: 16 ↛ 17line 16 didn't jump to line 17, because the condition on line 16 was never true

17 raise NotImplementedError("background mode not yet supported") 

18 app() 

19 

20 play = _play 

21 

22 

23Demo = _Demo