Fix code to handle crashes for non-VP8.
Unit tests will be submitted Monday, submitting this part to get the Android bots green. BUG=1667, 1788 R=glaznev@webrtc.org Review URL: https://webrtc-codereview.appspot.com/44789004 Cr-Commit-Position: refs/heads/master@{#8811} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8811 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -1587,8 +1587,14 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodecAndOptions(
|
|||||||
|
|
||||||
// Set RTX payload type if RTX is enabled.
|
// Set RTX payload type if RTX is enabled.
|
||||||
if (!parameters_.config.rtp.rtx.ssrcs.empty()) {
|
if (!parameters_.config.rtp.rtx.ssrcs.empty()) {
|
||||||
|
if (codec_settings.rtx_payload_type == -1) {
|
||||||
|
LOG(LS_WARNING) << "RTX SSRCs configured but there's no configured RTX "
|
||||||
|
"payload type. Ignoring.";
|
||||||
|
parameters_.config.rtp.rtx.ssrcs.clear();
|
||||||
|
} else {
|
||||||
parameters_.config.rtp.rtx.payload_type = codec_settings.rtx_payload_type;
|
parameters_.config.rtp.rtx.payload_type = codec_settings.rtx_payload_type;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (IsNackEnabled(codec_settings.codec)) {
|
if (IsNackEnabled(codec_settings.codec)) {
|
||||||
parameters_.config.rtp.nack.rtp_history_ms = kNackHistoryMs;
|
parameters_.config.rtp.nack.rtp_history_ms = kNackHistoryMs;
|
||||||
@@ -1843,8 +1849,13 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::RecreateWebRtcStream() {
|
|||||||
parameters_.encoder_config.encoder_specific_settings =
|
parameters_.encoder_config.encoder_specific_settings =
|
||||||
ConfigureVideoEncoderSettings(codec_settings.codec, parameters_.options);
|
ConfigureVideoEncoderSettings(codec_settings.codec, parameters_.options);
|
||||||
|
|
||||||
stream_ = call_->CreateVideoSendStream(parameters_.config,
|
webrtc::VideoSendStream::Config config = parameters_.config;
|
||||||
parameters_.encoder_config);
|
if (!config.rtp.rtx.ssrcs.empty() && config.rtp.rtx.payload_type == -1) {
|
||||||
|
LOG(LS_WARNING) << "RTX SSRCs configured but there's no configured RTX "
|
||||||
|
"payload type the set codec. Ignoring RTX.";
|
||||||
|
config.rtp.rtx.ssrcs.clear();
|
||||||
|
}
|
||||||
|
stream_ = call_->CreateVideoSendStream(config, parameters_.encoder_config);
|
||||||
|
|
||||||
parameters_.encoder_config.encoder_specific_settings = NULL;
|
parameters_.encoder_config.encoder_specific_settings = NULL;
|
||||||
|
|
||||||
@@ -1907,6 +1918,11 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder(
|
|||||||
webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kVp8), type, false);
|
webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kVp8), type, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == webrtc::kVideoCodecVP9) {
|
||||||
|
return AllocatedDecoder(
|
||||||
|
webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kVp9), type, false);
|
||||||
|
}
|
||||||
|
|
||||||
// This shouldn't happen, we should not be trying to create something we don't
|
// This shouldn't happen, we should not be trying to create something we don't
|
||||||
// support.
|
// support.
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@@ -349,6 +349,19 @@ bool VideoSendStream::ReconfigureVideoEncoder(
|
|||||||
video_codec.codecSpecific.VP8.numberOfTemporalLayers =
|
video_codec.codecSpecific.VP8.numberOfTemporalLayers =
|
||||||
static_cast<unsigned char>(
|
static_cast<unsigned char>(
|
||||||
streams.back().temporal_layer_thresholds_bps.size() + 1);
|
streams.back().temporal_layer_thresholds_bps.size() + 1);
|
||||||
|
} else if (video_codec.codecType == kVideoCodecVP9) {
|
||||||
|
if (config.encoder_specific_settings != NULL) {
|
||||||
|
video_codec.codecSpecific.VP9 = *reinterpret_cast<const VideoCodecVP9*>(
|
||||||
|
config.encoder_specific_settings);
|
||||||
|
}
|
||||||
|
video_codec.codecSpecific.VP9.numberOfTemporalLayers =
|
||||||
|
static_cast<unsigned char>(
|
||||||
|
streams.back().temporal_layer_thresholds_bps.size() + 1);
|
||||||
|
} else if (video_codec.codecType == kVideoCodecH264) {
|
||||||
|
if (config.encoder_specific_settings != NULL) {
|
||||||
|
video_codec.codecSpecific.H264 = *reinterpret_cast<const VideoCodecH264*>(
|
||||||
|
config.encoder_specific_settings);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO(pbos): Support encoder_settings codec-agnostically.
|
// TODO(pbos): Support encoder_settings codec-agnostically.
|
||||||
assert(config.encoder_specific_settings == NULL);
|
assert(config.encoder_specific_settings == NULL);
|
||||||
|
Reference in New Issue
Block a user