aom encode/decode

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-05-08 20:35:24 +08:00
parent a3f3bb4751
commit e482dc3e2b
15 changed files with 780 additions and 34 deletions

View File

@@ -41,6 +41,7 @@ pub use self::convert::*;
pub const STRIDE_ALIGN: usize = 64; // commonly used in libvpx vpx_img_alloc caller
pub const HW_STRIDE_ALIGN: usize = 0; // recommended by av_frame_get_buffer
pub mod aom;
pub mod record;
mod vpx;
@@ -132,6 +133,7 @@ pub fn is_cursor_embedded() -> bool {
pub enum CodecName {
VP8,
VP9,
AV1,
H264(String),
H265(String),
}
@@ -140,6 +142,7 @@ pub enum CodecName {
pub enum CodecFormat {
VP8,
VP9,
AV1,
H264,
H265,
Unknown,
@@ -150,6 +153,7 @@ impl From<&VideoFrame> for CodecFormat {
match it.union {
Some(video_frame::Union::Vp8s(_)) => CodecFormat::VP8,
Some(video_frame::Union::Vp9s(_)) => CodecFormat::VP9,
Some(video_frame::Union::Av1s(_)) => CodecFormat::AV1,
Some(video_frame::Union::H264s(_)) => CodecFormat::H264,
Some(video_frame::Union::H265s(_)) => CodecFormat::H265,
_ => CodecFormat::Unknown,
@@ -162,6 +166,7 @@ impl From<&CodecName> for CodecFormat {
match value {
CodecName::VP8 => Self::VP8,
CodecName::VP9 => Self::VP9,
CodecName::AV1 => Self::AV1,
CodecName::H264(_) => Self::H264,
CodecName::H265(_) => Self::H265,
}
@@ -173,6 +178,7 @@ impl ToString for CodecFormat {
match self {
CodecFormat::VP8 => "VP8".into(),
CodecFormat::VP9 => "VP9".into(),
CodecFormat::AV1 => "AV1".into(),
CodecFormat::H264 => "H264".into(),
CodecFormat::H265 => "H265".into(),
CodecFormat::Unknown => "Unknow".into(),