fix: implement review findings for VP9, colorbars & WebM#138
Merged
streamer45 merged 1 commit intovideofrom Mar 13, 2026
Merged
fix: implement review findings for VP9, colorbars & WebM#138streamer45 merged 1 commit intovideofrom
streamer45 merged 1 commit intovideofrom
Conversation
Implements all 13 actionable findings from the video feature review (finding #11 skipped — would require core PixelFormat serde changes): WebM muxer (webm.rs): - Add shutdown/cancellation handling to the receive loop via tokio::select! on context.control_rx, matching the pattern used by the OGG muxer and colorbars node (fix #1, important) - Remove dead chunk_size config field and DEFAULT_CHUNK_SIZE constant; update test that referenced it (fix #2, important) - Make Seek on Live MuxBuffer return io::Error(Unsupported) instead of warn-and-clamp to fail fast on unexpected seek calls (fix #3, important) - Add comment noting VP9 CodecPrivate constants must stay in sync with encoder config in video/mod.rs (fix #4, important) - Make OpusHead pre_skip configurable via WebMMuxerConfig::opus_preskip_samples instead of always using the hardcoded constant (fix #6, minor) - Group mux_frame loose parameters into MuxState struct (fix #12, nit) - Fix BitReader::read() doc comment range 1..=16 → 1..=32 (fix #14, nit) VP9 codec (vp9.rs): - Add startup-time ABI assertion verifying vpx_codec_vp9_cx/dx return non-null VP9 interfaces (fix #5, minor) Colorbars (colorbars.rs): - Add draw_time_use_pts config option to stamp PTS instead of wall-clock time, more useful for A/V timing debugging (fix #7, minor) - Document studio-range assumption in SMPTE bar YUV table comment with note explaining why white Y=180 (fix #13, nit) OGG muxer (ogg.rs): - Remove dead is_first_packet field and its no-op toggle (fix #10, minor) Tests (tests.rs): - Add File mode (WebMStreamingMode::File) test exercising the seekable temp-file code path (fix #8, minor) - Add edge-case tests: non-keyframe first video packet and truncated/ corrupt VP9 header — verify no panics (fix #9, minor) Signed-off-by: StreamKit Devin <devin@streamkit.dev> Signed-off-by: bot_apk <apk@cognition.ai> Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix: implement review findings for VP9, colorbars & WebM
Summary
Implements 13 of 14 actionable findings from the code review of the
videofeature branch (VP9 Codec, Colorbars & WebM Container area). Finding #11 (pixel_format String→enum) was skipped as it would require modifying the corePixelFormatserde representation, risking API breakage.Changes by file
WebM muxer (
webm.rs):tokio::select!oncontext.control_rx, matching the pattern used by the OGG muxer and colorbars nodechunk_sizeconfig field andDEFAULT_CHUNK_SIZEconstantSeekon LiveMuxBufferreturnio::Error(Unsupported)instead of warn-and-clamppre_skipconfigurable viaWebMMuxerConfig::opus_preskip_samplesmux_frameloose parameters intoMuxStatestructmoq_peercounters #14 (nit): FixBitReader::read()doc comment range1..=16→1..=32VP9 codec (
vp9.rs):vpx_codec_vp9_cx/dxreturn non-null VP9 interfacesColorbars (
colorbars.rs):draw_time_use_ptsconfig option to stamp PTS instead of wall-clock timeOGG muxer (
ogg.rs):is_first_packetfield and its no-op toggleTests (
tests.rs):WebMStreamingMode::File) testReview & Testing Checklist for Human
Shutdowncontrol message is sent while both audio and video streams are active. Thetokio::select!usesbiased;with shutdown checked first.MuxBuffer::LiveSeek impl now returnsErr(Unsupported). Verify that Live mode still works correctly end-to-end (theWriter::new_non_seekpath should never call seek, but confirm no regression).opus_head_codec_privatefunction now accepts apre_skipparameter. Default is still 312. Verify audio playback is correct with a real Opus stream.cargo test -p streamkit-nodes test_webm_mux_file_modeand verify it passes (exercises the temp-file seekable path).cargo test -p streamkit-nodes test_webm_mux_non_keyframe_first_video test_webm_mux_truncated_vp9_header— these verify no panics on bad input.Notes
just lintandjust testboth pass (0 failures).PixelFormatenum for colorbars config) was deliberately skipped:PixelFormatincrates/core/src/types.rshasSerialize/Deserializebut no#[serde(rename_all = "lowercase")], so changing the config type would break existing pipelines that use"nv12"etc.Devin Session: https://staging.itsdev.in/sessions/c2bb8883fc514013b37fd9ace9195d04