(&mut self, mut ctx: RecorderContext)
| 120 | } |
| 121 | |
| 122 | fn change(&mut self, mut ctx: RecorderContext) -> ResultType<()> { |
| 123 | ctx.set_filename()?; |
| 124 | self.inner = match ctx.format { |
| 125 | CodecFormat::VP8 | CodecFormat::VP9 | CodecFormat::AV1 => { |
| 126 | Box::new(WebmRecorder::new(ctx.clone())?) |
| 127 | } |
| 128 | #[cfg(feature = "hwcodec")] |
| 129 | _ => Box::new(HwRecorder::new(ctx.clone())?), |
| 130 | #[cfg(not(feature = "hwcodec"))] |
| 131 | _ => bail!("unsupported codec type"), |
| 132 | }; |
| 133 | self.ctx = ctx; |
| 134 | self.pts = None; |
| 135 | self.send_state(RecordState::NewFile(self.ctx.filename.clone())); |
| 136 | Ok(()) |
| 137 | } |
| 138 | |
| 139 | pub fn write_message(&mut self, msg: &Message) { |
| 140 | if let Some(message::Union::VideoFrame(vf)) = &msg.union { |
no test coverage detected