Skip to content

feat(display_stream): parameterize max_bitrate in screen video offers - #6

Merged
Derrors merged 1 commit into
masterfrom
feat/screen-video-offer-bitrate
Dec 6, 2026
Merged

Derrors merged 1 commit into
masterfrom
feat/screen-video-offer-bitrate

Conversation

@Derrors

@Derrors Derrors commented Dec 6, 2026

Copy link
Copy Markdown
Owner

Summary

Implements Track F1 so downstream callers (such as iphone-control) can request custom screen video bitrate caps directly instead of byte-patching the protobuf varint and hand-wrapping uncompressed zlib blocks:

  • Export DEFAULT_SCREEN_VIDEO_BITRATE: u32 = 6_000_000 from display_stream::negotiation, display_stream, and core_device.
  • Parameterize build_screen_media_blob, build_screen_video_offer, and MediaNegotiationBlob::video_offer with max_bitrate: u32 so both the 0x20000 TXMaxBitrate ladder entry and StreamGroupStream::max_network_bitrate stay consistent.
  • Preserve DEFAULT_SCREEN_VIDEO_BITRATE in build_screen_audio_offer and tools/src/coredevice_stream.rs.
  • Add unit tests verifying default/custom bitrate encoding inside the zlib-compressed protobuf offer blob, unchanged remaining ladder entries, audio offer stability, and MediaNegotiationBlob::video_offer roundtrip.

Verification

  • PYTHONPATH=scripts python3 -m unittest -v scripts/test_release.py && python3 scripts/release.py validate: pass (5/5)
  • cargo fmt -- --check: pass
  • cargo test -p idevice --lib --locked --no-default-features --features "<IPHONE_CONTROL_FEATURES>" (Rust 1.99.1): 72 passed / 0 failed
  • cargo clippy -p idevice --lib --tests --locked --no-default-features --features "ring,full" -- -D warnings: pass
  • cargo clippy -p idevice-tools --all-targets --locked --no-default-features --features "ring" -- -D warnings: pass
  • cargo check -p idevice --lib --locked --no-default-features --features "<IPHONE_CONTROL_FEATURES>" (Rust 1.89.0 MSRV): pass

🤖 Generated with Claude Code

- Export `DEFAULT_SCREEN_VIDEO_BITRATE` (`6_000_000` bit/s).
- Parameterize `build_screen_media_blob`, `build_screen_video_offer`, and `MediaNegotiationBlob::video_offer` with explicit `max_bitrate: u32`, setting both the `0x20000` parameter ladder entry and `StreamGroupStream::max_network_bitrate` consistently.
- Keep `build_screen_audio_offer` on `DEFAULT_SCREEN_VIDEO_BITRATE`.
- Update `idevice-tools` (`coredevice_stream.rs`) and add unit tests verifying bitrate encoding and roundtrip.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Derrors
Derrors merged commit 8d242ae into master Dec 6, 2026
2 checks passed
@Derrors
Derrors deleted the feat/screen-video-offer-bitrate branch December 6, 2026 09:21
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.

1 participant