Skip to content

refactor(dgw): parse growing WebM with TagDecoder - #1941

Open
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
build/cadeau-webm-iterable-0.7from
refactor/video-streamer-tag-decoder
Open

refactor(dgw): parse growing WebM with TagDecoder#1941
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
build/cadeau-webm-iterable-0.7from
refactor/video-streamer-tag-decoder

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The original streamer treated incomplete tags as UnexpectedEOF and rewound the file.
ebml-iterable 0.7 keeps those tags pending, so live recordings can append without seek/skip.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com


Stack created with GitHub Stacks CLIGive Feedback 💬

@irvingoujAtDevolution

Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • webm_stream now feeds a TagDecoder instead of WebmIterator.
  • Incomplete tags stay in the buffer; EOF waits reopen the file at the decoder read head instead of UnexpectedEOF + seek/skip.
  • Start/Pull protocol is unchanged.
  • Unit test: incomplete_input_waits_then_resumes_after_refresh.

Note

LLM-assisted content (no human feedback).

@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) marked this pull request as ready for review August 21, 2026 20:54
Copilot AI balanced review requested due to automatic review settings August 21, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors growing WebM parsing to use TagDecoder, retaining incomplete tags until recordings append more data.

Changes:

  • Adds incremental buffered decoding and disk refresh support.
  • Updates streaming and benchmark paths.
  • Adds a growing-file regression test.

Two error-handling regressions were identified.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/video-streamer/src/streamer/mod.rs Integrates incremental decoding.
crates/video-streamer/src/streamer/iter.rs Implements buffered TagDecoder iteration.
crates/video-streamer/src/bench_support.rs Updates benchmark iteration.
crates/video-streamer/Cargo.toml Adds bytes.
Cargo.lock Locks the dependency update.
Suppressed comments (1)

crates/video-streamer/src/streamer/mod.rs:147

  • refresh_from_disk() only repositions the reader; it does not consume or reset the decoder's buffered bytes. Consequently, an InvalidTagData error is returned from the same bytes after every refresh, turning a permanent parse failure into repeated waits for up to 75 seconds. With TagDecoder, incomplete input is represented by None, so parser errors should fall through to the existing generic error arm.
                        webm_itr.refresh_from_disk()?;

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/video-streamer/src/streamer/mod.rs
@irvingoujAtDevolution

Copy link
Copy Markdown
Contributor Author

Review follow-up:

  • Dropped unused cluster_start_position after synthetic Cluster End went away.
  • Skip-to-end and live wait now treat incomplete input as None.
  • InvalidTagData / UnexpectedEOF are no longer retried; decode errors are fatal. IOError is the only dedicated IO arm.

Note

LLM-assisted content (no human feedback).

The original streamer treated incomplete tags as UnexpectedEOF and
rewound the file. ebml-iterable 0.7 keeps those tags pending, so
live recordings can append without seek/skip.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TagDecoder reports incomplete input as None, not UnexpectedEOF.
Retrying InvalidTagData just stalled on real corruption.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A parse error stays at the same offset. Swallowing it while
draining already-recorded tags hid corruption.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants