Skip to content

Commit 9ede8cc

Browse files
committed
protocol/videoprotocol: add screenshot function
Extend the protocol with the screenshot function. Signed-off-by: Rouven Czerwinski <[email protected]>
1 parent 78e851e commit 9ede8cc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

labgrid/driver/usbvideodriver.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def screenshot(self, filename, caps_hint=None, controls=None):
182182

183183
tx_cmd = self.video.command_prefix + ["gst-launch-1.0", "-q"]
184184
tx_cmd += pipeline.split()
185-
rx_cmd = ["gst-launch-1.0", "fdsrc", " num-buffers=75", "!", "jpegdec", "!", "jpegenc", "!", "filesink", f"location={filepath.absolute()}"]
185+
rx_cmd = ["gst-launch-1.0", "fdsrc", "num-buffers=75", "!", "decodebin", "!", "jpegenc", "!", "filesink", f"location={filepath.absolute()}"]
186186

187187
tx = subprocess.Popen(
188188
tx_cmd,

labgrid/protocol/videoprotocol.py

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ def get_qualities(self):
99
@abc.abstractmethod
1010
def stream(self, quality_hint=None):
1111
raise NotImplementedError
12+
13+
@abc.abstractmethod
14+
def screenshot(self, filename):
15+
raise NotImplementedError

0 commit comments

Comments
 (0)