Refactor crate::codec (#78)

* Refactor AVCodec wrapper

* Implement new config interface

* Move ProfileIter to codec::profile

* Add CodecDescriptor
This commit is contained in:
FreezyLemon
2024-11-03 01:31:30 +01:00
committed by GitHub
parent f1e978b58d
commit f1c6b442b5
20 changed files with 929 additions and 509 deletions

View File

@ -18,7 +18,7 @@ impl Decoder {
}
}
pub fn open_as<D: traits::Decoder>(mut self, codec: D) -> Result<Opened, Error> {
pub fn open_as<T, D: traits::Decoder<T>>(mut self, codec: D) -> Result<Opened, Error> {
unsafe {
if let Some(codec) = codec.decoder() {
match avcodec_open2(self.as_mut_ptr(), codec.as_ptr(), ptr::null_mut()) {
@ -31,7 +31,7 @@ impl Decoder {
}
}
pub fn open_as_with<D: traits::Decoder>(
pub fn open_as_with<T, D: traits::Decoder<T>>(
mut self,
codec: D,
options: Dictionary,