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:
@ -306,11 +306,13 @@ WebRtc_Word32 ViEEncoder::DeRegisterExternalEncoder(WebRtc_UWord8 pl_type) {
|
||||
|
||||
webrtc::VideoCodec current_send_codec;
|
||||
if (vcm_.SendCodec(¤t_send_codec) == VCM_OK) {
|
||||
if (vcm_.Bitrate(¤t_send_codec.startBitrate) != 0) {
|
||||
uint32_t current_bitrate_bps = 0;
|
||||
if (vcm_.Bitrate(¤t_bitrate_bps) != 0) {
|
||||
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo,
|
||||
ViEId(engine_id_, channel_id_),
|
||||
"Failed to get the current encoder target bitrate.");
|
||||
}
|
||||
current_send_codec.startBitrate = (current_bitrate_bps + 500) / 1000;
|
||||
}
|
||||
|
||||
if (vcm_.RegisterExternalEncoder(NULL, pl_type) != VCM_OK) {
|
||||
@ -681,11 +683,14 @@ WebRtc_Word32 ViEEncoder::UpdateProtectionMethod() {
|
||||
webrtc::VideoCodec codec;
|
||||
if (vcm_.SendCodec(&codec) == 0) {
|
||||
WebRtc_UWord16 max_pay_load = default_rtp_rtcp_->MaxDataPayloadLength();
|
||||
if (vcm_.Bitrate(&codec.startBitrate) != 0) {
|
||||
uint32_t current_bitrate_bps = 0;
|
||||
if (vcm_.Bitrate(¤t_bitrate_bps) != 0) {
|
||||
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideo,
|
||||
ViEId(engine_id_, channel_id_),
|
||||
"Failed to get the current encoder target bitrate.");
|
||||
}
|
||||
// Convert to start bitrate in kbps.
|
||||
codec.startBitrate = (current_bitrate_bps + 500) / 1000;
|
||||
if (vcm_.RegisterSendCodec(&codec, number_of_cores_, max_pay_load) != 0) {
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
|
||||
ViEId(engine_id_, channel_id_),
|
||||
|
||||
Reference in New Issue
Block a user