rave_nvcodec/
nvenc_stub.rs1use rave_core::codec_traits::{BitstreamSink, FrameEncoder};
4use rave_core::error::{EngineError, Result};
5use rave_core::types::FrameEnvelope;
6
7#[derive(Clone, Debug)]
9pub struct NvEncConfig {
10 pub width: u32,
11 pub height: u32,
12 pub fps_num: u32,
13 pub fps_den: u32,
14 pub bitrate: u32,
15 pub max_bitrate: u32,
16 pub gop_length: u32,
17 pub b_frames: u32,
18 pub nv12_pitch: u32,
19}
20
21pub struct NvEncoder;
23
24impl NvEncoder {
25 pub fn new(
26 cuda_context: *mut std::ffi::c_void,
27 sink: Box<dyn BitstreamSink>,
28 config: NvEncConfig,
29 ) -> Result<Self> {
30 let _ = (cuda_context, sink, config);
31 Err(EngineError::Encode(
32 "rave-nvcodec built in stub mode: NVENC is unavailable on this build host".into(),
33 ))
34 }
35}
36
37impl FrameEncoder for NvEncoder {
38 fn encode(&mut self, frame: FrameEnvelope) -> Result<()> {
39 let _ = frame;
40 Err(EngineError::Encode(
41 "rave-nvcodec built in stub mode: NVENC is unavailable at runtime".into(),
42 ))
43 }
44
45 fn flush(&mut self) -> Result<()> {
46 Err(EngineError::Encode(
47 "rave-nvcodec built in stub mode: NVENC is unavailable at runtime".into(),
48 ))
49 }
50}