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

Method set_quality

libs/scrap/src/common/vram.rs:165–174  ·  view source on GitHub ↗
(&mut self, quality: Quality)

Source from the content-addressed store, hash-verified

163 }
164
165 fn set_quality(&mut self, quality: Quality) -> ResultType<()> {
166 let b = Self::convert_quality(quality, &self.ctx.f);
167 let bitrate = base_bitrate(self.ctx.d.width as _, self.ctx.d.height as _) * b / 100;
168 if bitrate > 0 {
169 if self.encoder.set_bitrate((bitrate) as _).is_ok() {
170 self.bitrate = bitrate;
171 }
172 }
173 Ok(())
174 }
175
176 fn bitrate(&self) -> u32 {
177 self.bitrate

Callers

nothing calls this directly

Calls 1

base_bitrateFunction · 0.85

Tested by

no test coverage detected