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

Method change

libs/scrap/src/common/record.rs:122–137  ·  view source on GitHub ↗
(&mut self, mut ctx: RecorderContext)

Source from the content-addressed store, hash-verified

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 {

Callers 2

write_frameMethod · 0.80
check_ptsMethod · 0.80

Calls 3

set_filenameMethod · 0.80
send_stateMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected