Rewrite the bootstrap body's player-context fields with our HD hints.
(self, body_bytes: bytes)
| 346 | self.template = pe.parse(self.init_body) |
| 347 | |
| 348 | def _patch_context(self, body_bytes: bytes) -> bytes: |
| 349 | """Rewrite the bootstrap body's player-context fields with our HD hints.""" |
| 350 | msg = pe.parse(body_bytes) |
| 351 | ctx = msg.first(1) |
| 352 | if ctx and isinstance(ctx.value, pe.Message): |
| 353 | ctx.value.set_varint(18, self.player_width) |
| 354 | ctx.value.set_varint(19, self.player_height) |
| 355 | ctx.value.set_varint(23, self.bandwidth_bps) |
| 356 | ctx.value.set_varint(59, self.max_height) |
| 357 | return pe.serialize(msg) |
| 358 | |
| 359 | def _do_bootstrap(self) -> Iterable[tuple[TrackKey, int, bytes]]: |
| 360 | """Send the captured init body with HD context patched in.""" |
no test coverage detected