vtenc: Fix conversion of the bitrate property and our internal bitrate storage

The property is in kbit/s and we store it in bit/s, so just multiply and
divide by 1000. No need to put a factor of 8 in there.

kVTCompressionPropertyKey_AverageBitRate is also in bit/s according to
its documentation.
This commit is contained in:
Sebastian Dröge 2014-12-05 16:15:23 +01:00
parent 226a4fcea3
commit 1a2362eb2b

View file

@ -339,7 +339,7 @@ gst_vtenc_get_property (GObject * obj, guint prop_id, GValue * value,
switch (prop_id) {
case PROP_BITRATE:
g_value_set_uint (value, gst_vtenc_get_bitrate (self) * 8 / 1000);
g_value_set_uint (value, gst_vtenc_get_bitrate (self) / 1000);
break;
case PROP_ALLOW_FRAME_REORDERING:
g_value_set_boolean (value, gst_vtenc_get_allow_frame_reordering (self));
@ -364,7 +364,7 @@ gst_vtenc_set_property (GObject * obj, guint prop_id, const GValue * value,
switch (prop_id) {
case PROP_BITRATE:
gst_vtenc_set_bitrate (self, g_value_get_uint (value) * 1000 / 8);
gst_vtenc_set_bitrate (self, g_value_get_uint (value) * 1000);
break;
case PROP_ALLOW_FRAME_REORDERING:
gst_vtenc_set_allow_frame_reordering (self, g_value_get_boolean (value));