-
Notifications
You must be signed in to change notification settings - Fork 12
Give a Linux video frame the shape the other cameras give #689
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
Open
DarksaCY
wants to merge
12
commits into
Positronic-Robotics:main
Choose a base branch
from
DarksaCY:linux-video-adapter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
073ce3a
Give a Linux video frame the shape the other cameras give
DarksaCY 54c1600
Drop a video buffer that arrives short of a frame
DarksaCY 467aa1f
Keep the video library's ioctl log out of a debug run
DarksaCY 38505ca
Tell a decoder holding a frame back from a buffer short of one
DarksaCY 852f53d
Name the buffer a camera hands over for its size, not its tail
DarksaCY 3eba9af
Say why a camera buffer that is not a frame is counted, not raised
DarksaCY 9b2bf0d
Hand the frame port the newest image of a buffer, not all of them
DarksaCY 1e1c141
Name the fake video module once, and state the buffer waiver as a con…
DarksaCY eb9b422
Take the type errors this branch removed out of the baseline
DarksaCY 6240b6a
Say that the video driver yields commands, not sleeps
DarksaCY d8c58a4
Take the return-type error out of the baseline
DarksaCY 6efdc48
Let the fake device record itself when it is opened
DarksaCY File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """A stand-in for the vendor package the Linux video driver imports. | ||
|
|
||
| ``linuxpy`` ships only in the ``hardware`` extra, so the driver module cannot be imported from a default | ||
| sync. The tests drive a device of their own, so a module carrying the names the driver binds at import is | ||
| enough. Installed here, before any test module imports the driver, and only where the real package is | ||
| absent. | ||
| """ | ||
|
|
||
| import importlib.util | ||
| import sys | ||
| import types | ||
| from enum import Enum | ||
|
|
||
| VENDOR = 'linuxpy' | ||
| VIDEO_MODULE = f'{VENDOR}.video' | ||
| DEVICE_MODULE = f'{VIDEO_MODULE}.device' | ||
|
|
||
| if importlib.util.find_spec(VENDOR) is None: | ||
| # The formats the driver names. The values are the V4L2 four-character codes, as `linuxpy` reports them. | ||
| PixelFormat = Enum('PixelFormat', ['YUYV', 'UYVY', 'RGB24', 'H264', 'HEVC', 'VP8', 'VP9', 'MPEG4', 'MJPEG']) | ||
|
|
||
| device = types.ModuleType(DEVICE_MODULE) | ||
| device.__dict__.update(Device=object, PixelFormat=PixelFormat) | ||
|
|
||
| video = types.ModuleType(VIDEO_MODULE) | ||
| video.__dict__.update(device=device) | ||
|
|
||
| package = types.ModuleType(VENDOR) | ||
| package.__dict__.update(video=video) | ||
|
|
||
| sys.modules.update({VENDOR: package, VIDEO_MODULE: video, DEVICE_MODULE: device}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.