MCPcopy Create free account
hub / github.com/Recordscript/recordscript / try_get

Method try_get

libs/scrap/src/common/hwcodec.rs:203–222  ·  view source on GitHub ↗
(format: CodecFormat)

Source from the content-addressed store, hash-verified

201
202impl 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) {

Callers

nothing calls this directly

Calls 2

get_configFunction · 0.85
enable_hwcodec_optionFunction · 0.85

Tested by

no test coverage detected