[domistream] Video packetizer: tests first (round trips through VideoDepacketizer, loss up to and beyond m, fixed vectors), API stubs
This commit is contained in:
@@ -20,8 +20,10 @@ use crate::util::{array, cap, malformed, need};
|
||||
use crate::{Error, Instant, Result};
|
||||
|
||||
pub mod packet;
|
||||
pub mod packetizer;
|
||||
|
||||
pub use packet::{FecInfo, FrameHeader, FrameType, NvVideoHeader, VideoFlags, VideoPacket, parse_video_packet};
|
||||
pub use packetizer::{EncodedFrame, VideoPacketizer, VideoPacketizerConfig};
|
||||
|
||||
/// Length of the prefix of an encrypted packet: IV 12 + frame number 4 + tag 16.
|
||||
pub const ENCRYPTION_PREFIX_LEN: usize = 12 + 4 + 16;
|
||||
@@ -69,6 +71,17 @@ impl VideoCipher {
|
||||
}
|
||||
}
|
||||
|
||||
impl VideoCipher {
|
||||
/// Seals one plaintext packet (host side): `IV ‖ frame number ‖ tag ‖ ciphertext`.
|
||||
///
|
||||
/// # Errors
|
||||
/// [`Error::Unimplemented`] (stub).
|
||||
pub fn encrypt(&self, counter: u64, frame_number: u32, packet: &[u8]) -> Result<Vec<u8>> {
|
||||
let _ = (counter, frame_number, packet, &self.key);
|
||||
Err(Error::Unimplemented)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for VideoCipher {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("VideoCipher(<redacted>)")
|
||||
|
||||
Reference in New Issue
Block a user