util/frame/audio: add samples accessor

This commit is contained in:
meh
2015-06-01 16:52:19 +02:00
parent fd7ff33f68
commit 72895052e6
5 changed files with 150 additions and 5 deletions

View File

@ -49,6 +49,10 @@ impl Sample {
}
}
pub fn is_packed(&self) -> bool {
!self.is_planar()
}
pub fn bytes(&self) -> usize {
unsafe {
av_get_bytes_per_sample((*self).into()) as usize