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

Method set_quality

libs/scrap/src/common/hwcodec.rs:170–179  ·  view source on GitHub ↗
(&mut self, quality: crate::codec::Quality)

Source from the content-addressed store, hash-verified

168 }
169
170 fn set_quality(&mut self, quality: crate::codec::Quality) -> ResultType<()> {
171 let b = Self::convert_quality(&self.config.name, quality);
172 let mut bitrate = base_bitrate(self.config.width as _, self.config.height as _) * b / 100;
173 if bitrate > 0 {
174 bitrate = Self::check_bitrate_range(&self.config, self.bitrate);
175 self.encoder.set_bitrate(bitrate as _).ok();
176 self.bitrate = bitrate;
177 }
178 Ok(())
179 }
180
181 fn bitrate(&self) -> u32 {
182 self.bitrate

Callers

nothing calls this directly

Calls 1

base_bitrateFunction · 0.85

Tested by

no test coverage detected