libtheora has two encoding modes, CBR, where it tries to hit a target
bitrate and VBR where it tries to achieve a target quality.
Internally if the target bitrate is set to anything other then 0 the
encoding-mode is CBR.
This means that the gstreamer element can leave the video_quality
setting alone as long as the user is tweaking the bitrate. Which has the
nice side-effect that if the user explicitely sets the bitrate to 0
(which is actually the default), the quality value doesn't get reset and
one ends up encoding VBR at quality-level 0...
case PROP_BITRATE:
GST_OBJECT_LOCK (enc);
enc->video_bitrate = g_value_get_int (value) * 1000;
- enc->video_quality = 0;
enc->bitrate_changed = TRUE;
GST_OBJECT_UNLOCK (enc);
break;
case PROP_QUALITY:
GST_OBJECT_LOCK (enc);
- if (GST_STATE (enc) >= GST_STATE_PAUSED && enc->video_quality == 0) {
+ if (GST_STATE (enc) >= GST_STATE_PAUSED && enc->video_bitrate > 0) {
GST_WARNING_OBJECT (object, "Can't change from bitrate to quality mode"
" while playing");
} else {