Repository navigation
feat(moq-video): add the V4L2 stateful M2M hardware encoder and decoder #3332
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3ad3735
feat(moq-video): add the V4L2 M2M hardware encoder
Frando 6e07327
feat(moq-video): add the V4L2 M2M hardware decoder
Frando b45a32f
fix(moq-video): correct the V4L2 codec setup and buffer state machine
Frando ecd85a1
fix(moq-video): bound what the V4L2 encoder carries from unmatched bu…
Frando 7fa4a0b
docs(moq-video): correct and tighten the V4L2 backend comments
Frando 29eacac
test(moq-video): check the hand-built V4L2 request codes against the …
Frando 0b86572
docs(moq-video): put the ENUM_FMT safety comment next to its ioctl
Frando 3c84abd
docs(moq-video): record that the V4L2 backends now run on a Pi 4
Frando 78ecbf2
docs(moq-video): say what the V4L2 backends did on a Raspberry Pi 4
Frando c1362eb
fix(moq-video): pick the V4L2 H.264 level from every limit and keep h…
kixelated f32c5b3
fix(moq-video): keep V4L2 frames on their own timestamps and honor th…
kixelated 0dbb352
test(moq-video): cover the V4L2 decoder's timestamp bookkeeping
kixelated 5b6e931
fix(moq-video): read V4L2 payloads from the plane's data offset
kixelated e0da61c
fix(moq-video): forget only the V4L2 frame the driver dropped
kixelated 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,33 @@ | ||
| # [M] Drain pipelined decoders at group and track boundaries | ||
|
|
||
| ## Goal | ||
|
|
||
| A decoder that holds pictures back (NVDEC, the V4L2 stateful decoder) hands | ||
| every one of them over before a track ends, and a transcode's output groups | ||
| begin with the picture that began the input group rather than a straggler | ||
| from the one before. | ||
|
|
||
| ## Plan | ||
|
|
||
| `decode::Backend` has `decode` and `name` and nothing else: there is no way to | ||
| tell a backend the stream is pausing or over. A one-in-one-out decoder | ||
| (openh264, VideoToolbox) never needs one, but NVDEC and V4L2 both pipeline, so | ||
| the last few pictures of a finite stream stay inside the driver, and at a | ||
| group boundary in `moq-transcode` the encoder is flushed while the decoder is | ||
| not, so pictures from the closing group surface after the next group's first | ||
| access unit went in and are encoded ahead of its keyframe. | ||
|
|
||
| Add `flush` and `finish` to `decode::Backend`, mirroring the encode trait and | ||
| with the same rule: no default implementation, so a pipelined backend cannot | ||
| inherit a no-op and look like it worked. The V4L2 implementation is the | ||
| kernel's drain sequence (`V4L2_DEC_CMD_STOP`, dequeue CAPTURE through | ||
| `V4L2_BUF_FLAG_LAST`, `V4L2_DEC_CMD_START`), with a source change that lands | ||
| mid-drain handled the way `drain_tail` already handles one. NVDEC's is an | ||
| end-of-stream packet through the parser. Call `flush` where `moq-transcode` | ||
| flushes the encoder and `finish` before a consumer reports the track over, and | ||
| cover it with a delayed-backend test that proves no picture is lost or crosses | ||
| a group boundary. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Embedded video](/quest/m3/video-embedded.md) - the V4L2 decoder this drains |
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
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
Oops, something went wrong.
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.