(Auto)update libjingle 79104430-> 79104922

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7602 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
buildbot@webrtc.org 2014-11-03 22:29:18 +00:00
parent 5f38c8d1b8
commit a663d90ae3
2 changed files with 60 additions and 35 deletions

View File

@ -3879,47 +3879,22 @@ bool WebRtcVideoMediaChannel::SetSendParams(
// only needed because some unit tests bypass the VideoAdapter, and // only needed because some unit tests bypass the VideoAdapter, and
// others expect behavior from the adapter different than what it // others expect behavior from the adapter different than what it
// actually does. We should fix the tests and remove this block. // actually does. We should fix the tests and remove this block.
int frame_width = static_cast<int>(frame.width);
int frame_height = static_cast<int>(frame.height);
VideoFormat max = send_channel->adapt_format(); VideoFormat max = send_channel->adapt_format();
size_t max_width = static_cast<size_t>(max.width);
size_t max_height = static_cast<size_t>(max.height);
if (!send_channel->last_captured_frame_info().IsSet() || if (!send_channel->last_captured_frame_info().IsSet() ||
(!frame.screencast && (!frame.screencast &&
(frame_width > max.width || frame_height > max.height))) { (frame.width > max_width || frame.height > max_height))) {
frame_width = max.width; frame.width = max_width;
frame_height = max.height; frame.height = max_height;
} }
// Set the new codec on vie. webrtc::VideoCodec codec;
webrtc::VideoCodec codec = send_params.codec; ConfigureVieCodecFromSendParams(channel_id, send_params, frame, &codec);
// TODO(pthatcher): Figure out a clean way to configure the max
// Settings for both screencast and non-screencast // framerate and sanitize the bitrates inside of
codec.width = frame_width; // ConfigureVieCodecFromSendParams.
codec.height = frame_height;
codec.maxFramerate = max.framerate(); codec.maxFramerate = max.framerate();
codec.targetBitrate = 0;
if (codec.codecType == webrtc::kVideoCodecVP8) {
codec.codecSpecific.VP8.numberOfTemporalLayers =
kDefaultNumberOfTemporalLayers;
codec.codecSpecific.VP8.resilience = webrtc::kResilienceOff;
}
if (frame.screencast) {
// Settings for screencast
codec.mode = webrtc::kScreensharing;
if (codec.codecType == webrtc::kVideoCodecVP8) {
codec.codecSpecific.VP8.denoisingOn = false;
codec.codecSpecific.VP8.automaticResizeOn = false;
codec.codecSpecific.VP8.frameDroppingOn = false;
}
} else {
// Settings for non-screencast
codec.mode = webrtc::kRealtimeVideo;
if (codec.codecType == webrtc::kVideoCodecVP8) {
codec.codecSpecific.VP8.denoisingOn =
options_.video_noise_reduction.GetWithDefaultIfUnset(true);
codec.codecSpecific.VP8.automaticResizeOn = true;
codec.codecSpecific.VP8.frameDroppingOn = true;
}
}
SanitizeBitrates(channel_id, &codec); SanitizeBitrates(channel_id, &codec);
// Get current vie codec. // Get current vie codec.
@ -3958,6 +3933,44 @@ bool WebRtcVideoMediaChannel::SetSendParams(
return true; return true;
} }
bool WebRtcVideoMediaChannel::ConfigureVieCodecFromSendParams(
int channel_id,
const VideoSendParams& send_params,
const CapturedFrameInfo& last_captured_frame_info,
webrtc::VideoCodec* codec_out) {
webrtc::VideoCodec codec = send_params.codec;
codec.width = static_cast<int>(last_captured_frame_info.width);
codec.height = static_cast<int>(last_captured_frame_info.height);
codec.targetBitrate = 0;
if (codec.codecType == webrtc::kVideoCodecVP8) {
codec.codecSpecific.VP8.numberOfTemporalLayers =
kDefaultNumberOfTemporalLayers;
codec.codecSpecific.VP8.resilience = webrtc::kResilienceOff;
}
if (last_captured_frame_info.screencast) {
codec.mode = webrtc::kScreensharing;
if (codec.codecType == webrtc::kVideoCodecVP8) {
codec.codecSpecific.VP8.denoisingOn = false;
codec.codecSpecific.VP8.automaticResizeOn = false;
codec.codecSpecific.VP8.frameDroppingOn = false;
}
} else {
codec.mode = webrtc::kRealtimeVideo;
if (codec.codecType == webrtc::kVideoCodecVP8) {
// TODO(pthatcher): Pass in options in VideoSendParams.
codec.codecSpecific.VP8.denoisingOn =
options_.video_noise_reduction.GetWithDefaultIfUnset(true);
codec.codecSpecific.VP8.automaticResizeOn = true;
codec.codecSpecific.VP8.frameDroppingOn = true;
}
}
*codec_out = codec;
return true;
}
void WebRtcVideoMediaChannel::SanitizeBitrates( void WebRtcVideoMediaChannel::SanitizeBitrates(
int channel_id, webrtc::VideoCodec* codec) { int channel_id, webrtc::VideoCodec* codec) {
codec->minBitrate = GetBitrate(codec->minBitrate, kMinVideoBitrate); codec->minBitrate = GetBitrate(codec->minBitrate, kMinVideoBitrate);

View File

@ -336,6 +336,18 @@ class WebRtcVideoMediaChannel : public rtc::MessageHandler,
return options_.conference_mode.GetWithDefaultIfUnset(false); return options_.conference_mode.GetWithDefaultIfUnset(false);
} }
// We take lots of things as input from applications (packaged in
// params), but ViE wants lots of those packed instead as a
// webrtc::VideoCodec. This is where we convert between the inputs
// we get from the applications and the input to give to ViE. We
// also configure the codec differently depending on the latest
// frame that we have received (in particular, depending on the
// resolution and whether the it was a screencast frame or not).
virtual bool ConfigureVieCodecFromSendParams(
int channel_id,
const VideoSendParams& send_params,
const CapturedFrameInfo& last_captured_frame_info,
webrtc::VideoCodec* codec);
// Checks the current bitrate estimate and modifies the bitrates // Checks the current bitrate estimate and modifies the bitrates
// accordingly, including converting kAutoBandwidth to the correct defaults. // accordingly, including converting kAutoBandwidth to the correct defaults.
virtual void SanitizeBitrates( virtual void SanitizeBitrates(