codec/context: add some accessors
This commit is contained in:
parent
68a72feb08
commit
f93ab9488a
@ -4,7 +4,7 @@ use std::ptr;
|
|||||||
use ffi::*;
|
use ffi::*;
|
||||||
use ::media;
|
use ::media;
|
||||||
use ::{Error, Codec, Dictionary};
|
use ::{Error, Codec, Dictionary};
|
||||||
use super::Id;
|
use super::{Id, Debug, Compliance};
|
||||||
use super::decoder::Decoder;
|
use super::decoder::Decoder;
|
||||||
use super::encoder::Encoder;
|
use super::encoder::Encoder;
|
||||||
|
|
||||||
@ -83,6 +83,30 @@ impl Context {
|
|||||||
Id::from((*self.ptr).codec_id)
|
Id::from((*self.ptr).codec_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn bit_rate(&self) -> usize {
|
||||||
|
unsafe {
|
||||||
|
(*self.ptr).bit_rate as usize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn delay(&self) -> usize {
|
||||||
|
unsafe {
|
||||||
|
(*self.ptr).delay as usize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compliance(&mut self, value: Compliance) {
|
||||||
|
unsafe {
|
||||||
|
(*self.ptr).strict_std_compliance = value.into();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn debug(&mut self, value: Debug) {
|
||||||
|
unsafe {
|
||||||
|
(*self.ptr).debug = value.bits();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Context {
|
impl Drop for Context {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user