libaom 0.3.1

libaom bindings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::ffi::aom::*;
use std::ffi::CStr;

pub trait AOMCodec {
    fn get_context(&mut self) -> &mut aom_codec_ctx;

    /// Return a human-readable representation of the last error occurred
    fn error_to_str(&mut self) -> String {
        unsafe {
            let c_str = aom_codec_error(self.get_context());

            CStr::from_ptr(c_str).to_string_lossy().into_owned()
        }
    }
}