(cfg: crate::codec::EncoderCfg, i444: bool)
| 218 | |
| 219 | impl EncoderApi for AomEncoder { |
| 220 | fn new(cfg: crate::codec::EncoderCfg, i444: bool) -> ResultType<Self> |
| 221 | where |
| 222 | Self: Sized, |
| 223 | { |
| 224 | match cfg { |
| 225 | crate::codec::EncoderCfg::AOM(config) => { |
| 226 | let i = call_aom_ptr!(aom_codec_av1_cx()); |
| 227 | let c = webrtc::enc_cfg(i, config, i444)?; |
| 228 | |
| 229 | let mut ctx = Default::default(); |
| 230 | // Flag options: AOM_CODEC_USE_PSNR and AOM_CODEC_USE_HIGHBITDEPTH |
| 231 | let flags: aom_codec_flags_t = 0; |
| 232 | call_aom!(aom_codec_enc_init_ver( |
| 233 | &mut ctx, |
| 234 | i, |
| 235 | &c, |
| 236 | flags, |
| 237 | AOM_ENCODER_ABI_VERSION as _ |
| 238 | )); |
| 239 | webrtc::set_controls(&mut ctx, &c)?; |
| 240 | Ok(Self { |
| 241 | ctx, |
| 242 | width: config.width as _, |
| 243 | height: config.height as _, |
| 244 | i444, |
| 245 | yuvfmt: Self::get_yuvfmt(config.width, config.height, i444), |
| 246 | }) |
| 247 | } |
| 248 | _ => Err(anyhow!("encoder type mismatch")), |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | fn encode_to_message(&mut self, input: EncodeInput, ms: i64) -> ResultType<VideoFrame> { |
| 253 | let mut frames = Vec::new(); |
nothing calls this directly
no test coverage detected