use crate::rtp_transceiver::RtpTransceiverDirection;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Priority {
VeryLow,
Low,
Medium,
High,
}
#[derive(Debug, Clone)]
pub struct RtpHeaderExtensionParameters {
pub uri: String,
pub id: i32,
pub encrypted: bool,
}
#[derive(Debug, Clone, Default)]
pub struct RtpParameters {
pub codecs: Vec<RtpCodecParameters>,
pub header_extensions: Vec<RtpHeaderExtensionParameters>,
pub encodings: Vec<RtpEncodingParameters>,
pub rtcp: RtcpParameters,
pub(crate) transaction_id: String,
pub(crate) mid: String,
pub(crate) has_degradation_preference: bool,
pub(crate) degradation_preference: i32,
}
#[derive(Debug, Clone, Default)]
pub(crate) struct CodecFeedback {
pub feedback_type: i32,
pub has_message_type: bool,
pub message_type: i32,
}
#[derive(Debug, Clone, Default)]
pub struct RtpCodecParameters {
pub payload_type: u8,
pub mime_type: String, pub clock_rate: Option<u64>,
pub channels: Option<u16>,
pub(crate) name: String,
pub(crate) kind: i32,
pub(crate) has_max_ptime: bool,
pub(crate) max_ptime: i32,
pub(crate) has_ptime: bool,
pub(crate) ptime: i32,
pub(crate) rtcp_feedback: Vec<CodecFeedback>,
pub(crate) parameters: Vec<(String, String)>,
}
#[derive(Debug, Clone, Default)]
pub struct RtcpParameters {
pub cname: String,
pub reduced_size: bool,
pub(crate) mux: bool,
pub(crate) has_ssrc: bool,
pub(crate) ssrc: u32,
}
#[derive(Debug, Clone)]
pub struct RtpEncodingParameters {
pub active: bool,
pub max_bitrate: Option<u64>,
pub max_framerate: Option<f64>,
pub priority: Priority,
pub rid: String,
pub scale_resolution_down_by: Option<f64>,
pub scalability_mode: Option<String>,
pub has_ssrc: bool,
pub ssrc: u32,
}
#[derive(Debug, Clone)]
pub struct RtpCodecCapability {
pub channels: Option<u16>,
pub clock_rate: Option<u64>,
pub mime_type: String,
pub sdp_fmtp_line: Option<String>,
}
#[derive(Debug, Clone)]
pub struct RtpHeaderExtensionCapability {
pub uri: String,
pub direction: RtpTransceiverDirection,
}
#[derive(Debug, Clone)]
pub struct RtpCapabilities {
pub codecs: Vec<RtpCodecCapability>,
pub header_extensions: Vec<RtpHeaderExtensionCapability>,
}
impl Default for RtpEncodingParameters {
fn default() -> Self {
Self {
active: true,
max_bitrate: None,
max_framerate: None,
priority: Priority::Low,
rid: String::default(),
scale_resolution_down_by: None,
scalability_mode: None,
has_ssrc: false,
ssrc: 0,
}
}
}