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

Function check_available_hwcodec

libs/scrap/src/common/hwcodec.rs:501–527  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

499}
500
501pub fn check_available_hwcodec() {
502 let ctx = EncodeContext {
503 name: String::from(""),
504 mc_name: None,
505 width: 1280,
506 height: 720,
507 pixfmt: DEFAULT_PIXFMT,
508 align: HW_STRIDE_ALIGN as _,
509 kbs: 0,
510 timebase: DEFAULT_TIME_BASE,
511 gop: DEFAULT_GOP,
512 quality: DEFAULT_HW_QUALITY,
513 rc: DEFAULT_RC,
514 thread_count: 4,
515 };
516 #[cfg(feature = "vram")]
517 let vram = crate::vram::check_available_vram();
518 #[cfg(not(feature = "vram"))]
519 let vram = "".to_owned();
520 let ram = Available {
521 e: Encoder::available_encoders(ctx, Some(vram.clone())),
522 d: Decoder::available_decoders(Some(vram.clone())),
523 };
524 if let Ok(ram) = serde_json::to_string_pretty(&ram) {
525 HwCodecConfig { ram, vram }.store();
526 }
527}
528
529#[cfg(any(target_os = "windows", target_os = "linux"))]
530pub fn start_check_process(force: bool) {

Callers

nothing calls this directly

Calls 3

check_available_vramFunction · 0.85
storeMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected