Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video: add screenshot function #1612

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Emantor
Copy link
Member

@Emantor Emantor commented Feb 17, 2025

Description

Add screenshot support to the VideoProtocol and implement it for both drivers.
Checklist

  • PR has been tested (USBVideo part)

@Emantor Emantor self-assigned this Feb 17, 2025
@Emantor Emantor force-pushed the topic/video-screenshot branch from 0722e69 to 8894163 Compare February 17, 2025 13:52
Useful to create screenshots for regression testing.

Signed-off-by: Rouven Czerwinski <[email protected]>
@Emantor Emantor force-pushed the topic/video-screenshot branch from 8894163 to 45cfc3a Compare February 17, 2025 13:53
@jluebbe
Copy link
Member

jluebbe commented Feb 17, 2025

This should probably be exposed in labgrid-client as well, perhaps similar to tmc screen? In that case, the drivers API provides the data in memory, so the user code can decide what to do with it.

@Emantor Emantor force-pushed the topic/video-screenshot branch 2 times, most recently from 59d9a8c to d7005cf Compare February 17, 2025 19:03
Implement screenshots for HTTP video cameras. For this we factor out the
default_port function out of stream() and reuse it for screenshot().

The screenshot function takes the stream, waits for 75 buffers to ensure
we have hit an i-frame in the pipeline so we can encode a complete
picture and than encodes the picture into a jpeg file.

Signed-off-by: Rouven Czerwinski <[email protected]>
Extend the protocol with the screenshot function.

Signed-off-by: Rouven Czerwinski <[email protected]>
@Emantor Emantor force-pushed the topic/video-screenshot branch from d7005cf to 71f9d83 Compare February 17, 2025 19:11
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 23.40426% with 36 lines in your changes missing coverage. Please review.

Project coverage is 55.7%. Comparing base (71fe895) to head (71f9d83).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/usbvideodriver.py 11.1% 24 Missing ⚠️
labgrid/driver/httpvideodriver.py 33.3% 12 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1612     +/-   ##
========================================
- Coverage    55.8%   55.7%   -0.2%     
========================================
  Files         170     170             
  Lines       13380   13425     +45     
========================================
+ Hits         7469    7478      +9     
- Misses       5911    5947     +36     
Flag Coverage Δ
3.10 55.6% <23.4%> (-0.2%) ⬇️
3.11 55.6% <23.4%> (-0.2%) ⬇️
3.12 55.6% <23.4%> (-0.2%) ⬇️
3.13 55.6% <23.4%> (-0.2%) ⬇️
3.9 55.7% <23.9%> (-0.2%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants