(format: CodecFormat)
| 201 | |
| 202 | impl HwRamEncoder { |
| 203 | pub fn try_get(format: CodecFormat) -> Option<CodecInfo> { |
| 204 | let mut info = None; |
| 205 | if let Ok(hw) = get_config().map(|c| c.e) { |
| 206 | let best = CodecInfo::prioritized(hw); |
| 207 | match format { |
| 208 | CodecFormat::H264 => { |
| 209 | if let Some(v) = best.h264 { |
| 210 | info = Some(v); |
| 211 | } |
| 212 | } |
| 213 | CodecFormat::H265 => { |
| 214 | if let Some(v) = best.h265 { |
| 215 | info = Some(v); |
| 216 | } |
| 217 | } |
| 218 | _ => {} |
| 219 | } |
| 220 | } |
| 221 | info |
| 222 | } |
| 223 | |
| 224 | pub fn encode(&mut self, yuv: &[u8]) -> ResultType<Vec<EncodeFrame>> { |
| 225 | match self.encoder.encode(yuv) { |
nothing calls this directly
no test coverage detected