(&mut self, quality: Quality)
| 213 | } |
| 214 | |
| 215 | fn set_quality(&mut self, quality: Quality) -> ResultType<()> { |
| 216 | let mut c = unsafe { *self.ctx.config.enc.to_owned() }; |
| 217 | let (q_min, q_max, b) = Self::convert_quality(quality); |
| 218 | if q_min > 0 && q_min < q_max && q_max < 64 { |
| 219 | c.rc_min_quantizer = q_min; |
| 220 | c.rc_max_quantizer = q_max; |
| 221 | } |
| 222 | let bitrate = base_bitrate(self.width as _, self.height as _) * b / 100; |
| 223 | if bitrate > 0 { |
| 224 | c.rc_target_bitrate = bitrate; |
| 225 | } |
| 226 | call_vpx!(vpx_codec_enc_config_set(&mut self.ctx, &c)); |
| 227 | Ok(()) |
| 228 | } |
| 229 | |
| 230 | fn bitrate(&self) -> u32 { |
| 231 | let c = unsafe { *self.ctx.config.enc.to_owned() }; |
nothing calls this directly
no test coverage detected