(mut ctx: RecorderContext)
| 99 | |
| 100 | impl Recorder { |
| 101 | pub fn new(mut ctx: RecorderContext) -> ResultType<Self> { |
| 102 | ctx.set_filename()?; |
| 103 | let recorder = match ctx.format { |
| 104 | CodecFormat::VP8 | CodecFormat::VP9 | CodecFormat::AV1 => Recorder { |
| 105 | inner: Box::new(WebmRecorder::new(ctx.clone())?), |
| 106 | ctx, |
| 107 | pts: None, |
| 108 | }, |
| 109 | #[cfg(feature = "hwcodec")] |
| 110 | _ => Recorder { |
| 111 | inner: Box::new(HwRecorder::new(ctx.clone())?), |
| 112 | ctx, |
| 113 | pts: None, |
| 114 | }, |
| 115 | #[cfg(not(feature = "hwcodec"))] |
| 116 | _ => bail!("unsupported codec type"), |
| 117 | }; |
| 118 | recorder.send_state(RecordState::NewFile(recorder.ctx.filename.clone())); |
| 119 | Ok(recorder) |
| 120 | } |
| 121 | |
| 122 | fn change(&mut self, mut ctx: RecorderContext) -> ResultType<()> { |
| 123 | ctx.set_filename()?; |
nothing calls this directly
no test coverage detected