mirror of
https://github.com/rustdesk/magnum-opus.git
synced 2026-04-23 00:20:44 +00:00
Rename CodingMode to Application
Makes it more in line with the Opus terminology
This commit is contained in:
committed by
Tad Hardesty
parent
4173ad0371
commit
0117ef5011
@@ -32,9 +32,9 @@ const OPUS_GET_SAMPLE_RATE: c_int = 4029; // out *i32
|
||||
const OPUS_SET_BITRATE: c_int = 4002; // in i32
|
||||
const OPUS_GET_BITRATE: c_int = 4003; // out *i32
|
||||
|
||||
/// The possible coding modes for the codec.
|
||||
/// The possible applications for the codec.
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
|
||||
pub enum CodingMode {
|
||||
pub enum Application {
|
||||
/// Best for most VoIP/videoconference applications where listening quality and intelligibility matter most.
|
||||
Voip = 2048,
|
||||
/// Best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input.
|
||||
@@ -121,7 +121,7 @@ pub struct Encoder {
|
||||
|
||||
impl Encoder {
|
||||
/// Create and initialize an encoder.
|
||||
pub fn new(sample_rate: u32, channels: Channels, mode: CodingMode) -> Result<Encoder> {
|
||||
pub fn new(sample_rate: u32, channels: Channels, mode: Application) -> Result<Encoder> {
|
||||
let mut error = 0;
|
||||
let ptr = unsafe { ffi::opus_encoder_create(
|
||||
sample_rate as i32,
|
||||
|
||||
Reference in New Issue
Block a user