Skip to main content

Crate saorsa_webrtc_codecs

Crate saorsa_webrtc_codecs 

Source
Expand description

Video and audio codec implementations

§Implementation Status

The current codec implementations are stub/simulation implementations designed for:

  • Development and testing without external codec libraries
  • API design validation and interface stabilization
  • Performance testing of the transport layer

§OpenH264 (Video)

  • Current: Simulation using compression (achieves ~25% size reduction for testing)
  • Production: Will integrate with real openh264 crate when h264 feature is enabled
  • Status: Safe for development/testing, not for production video calls

§Opus (Audio)

  • Current: Simulation with frame size validation and format conversion
  • Production: Will integrate with real opus crate when opus feature is enabled
  • Status: Safe for development/testing, not for production audio calls

§Migration Path

To use real codecs in production:

  1. Enable the respective features: features = ["h264", "opus"]
  2. Replace stub implementations in openh264.rs and opus.rs
  3. Run integration tests with actual codec libraries

The stub implementations maintain the same API surface, so migration is transparent to users.

Re-exports§

pub use openh264::OpenH264Decoder;
pub use openh264::OpenH264Encoder;
pub use opus::AudioFrame;
pub use opus::Channels;
pub use opus::OpusDecoder;
pub use opus::OpusEncoder;
pub use opus::OpusEncoderConfig;
pub use opus::SampleRate;

Modules§

openh264
OpenH264 codec implementation
opus
Opus audio codec implementation

Structs§

VideoFrame
Video frame

Enums§

AudioCodec
Audio codec selection
CodecError
Codec error types
VideoCodec
Video codec selection

Constants§

MAX_HEIGHT
MAX_RGB_SIZE
MAX_WIDTH
Maximum allowed dimensions for safety

Traits§

VideoDecoder
Video decoder trait
VideoEncoder
Video encoder trait

Type Aliases§

Result
Codec result type