codec/parameters: impl AsRef for all codec::Context wrappers

This commit is contained in:
Tae-il Lim
2016-12-01 15:30:31 +09:00
committed by meh
parent 36ac2513c1
commit 4df56b516f
11 changed files with 82 additions and 7 deletions

View File

@ -7,7 +7,7 @@ use ffi::*;
use super::Encoder as Super;
use ::{packet, Error, Dictionary, ChannelLayout, frame};
use ::util::format;
use codec::traits;
use codec::{traits, Context};
pub struct Audio(pub Super);
@ -131,6 +131,12 @@ impl DerefMut for Audio {
}
}
impl AsRef<Context> for Audio {
fn as_ref(&self) -> &Context {
&self
}
}
pub struct Encoder(pub Audio);
impl Encoder {
@ -174,3 +180,9 @@ impl Deref for Encoder {
&self.0
}
}
impl AsRef<Context> for Encoder {
fn as_ref(&self) -> &Context {
&self
}
}