Follow-up fix for r3681.

TESTS=trybots and vie_auto_test
BUG=1514

Review URL: https://webrtc-codereview.appspot.com/1216006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3689 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2013-03-19 10:04:57 +00:00
parent ecfd32880e
commit 3d0b0d6902
9 changed files with 30 additions and 16 deletions

View File

@ -75,7 +75,8 @@ VCMGenericEncoder::SetChannelParameters(WebRtc_Word32 packetLoss, int rtt)
WebRtc_Word32
VCMGenericEncoder::SetRates(WebRtc_UWord32 newBitRate, WebRtc_UWord32 frameRate)
{
WebRtc_Word32 ret = _encoder.SetRates(newBitRate, frameRate);
uint32_t target_bitrate_kbps = (newBitRate + 500) / 1000;
WebRtc_Word32 ret = _encoder.SetRates(target_bitrate_kbps, frameRate);
if (ret < 0)
{
return ret;

View File

@ -176,13 +176,16 @@ VCMMediaOptimization::SetTargetRates(WebRtc_UWord32 target_bitrate,
_targetBitRate = target_bitrate - protection_overhead_bps;
// Update encoding rates following protection settings
_frameDropper->SetRates(target_bitrate_kbps, _incomingFrameRate);
float target_video_bitrate_kbps =
static_cast<float>(_targetBitRate) / 1000.0f;
_frameDropper->SetRates(target_video_bitrate_kbps, _incomingFrameRate);
if (_enableQm)
{
// Update QM with rates
_qmResolution->UpdateRates(target_bitrate_kbps, sent_video_rate_kbps,
_incomingFrameRate, _fractionLost);
_qmResolution->UpdateRates(target_video_bitrate_kbps,
sent_video_rate_kbps, _incomingFrameRate,
_fractionLost);
// Check for QM selection
bool selectQM = CheckStatusForQMchange();
if (selectQM)

View File

@ -676,7 +676,6 @@ VideoCodingModuleImpl::AddVideoFrame(const I420VideoFrame& videoFrame,
const CodecSpecificInfo* codecSpecificInfo)
{
CriticalSectionScoped cs(_sendCritSect);
if (_encoder == NULL)
{
return VCM_UNINITIALIZED;