Updates to send side streaming mode:
1. Disabling frame-droppers from the vie encoder and not the channel. 2. Accounting for qpMax in the VP8 wrapper. Review URL: https://webrtc-codereview.appspot.com/1101007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3492 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
79481474ad
commit
3d305c64b4
@ -239,7 +239,7 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
|
||||
config_->rc_resize_allowed = inst->codecSpecific.VP8.automaticResizeOn ?
|
||||
1 : 0;
|
||||
config_->rc_min_quantizer = 2;
|
||||
config_->rc_max_quantizer = 56;
|
||||
config_->rc_max_quantizer = inst->qpMax;
|
||||
config_->rc_undershoot_pct = 100;
|
||||
config_->rc_overshoot_pct = 15;
|
||||
config_->rc_buf_initial_sz = 500;
|
||||
|
@ -92,6 +92,7 @@ bool VCMCodecDataBase::Codec(int list_id,
|
||||
settings->width = VCM_DEFAULT_CODEC_WIDTH;
|
||||
settings->height = VCM_DEFAULT_CODEC_HEIGHT;
|
||||
settings->numberOfSimulcastStreams = 0;
|
||||
settings->qpMax = 56;
|
||||
settings->codecSpecific.VP8.resilience = kResilientStream;
|
||||
settings->codecSpecific.VP8.numberOfTemporalLayers = 1;
|
||||
settings->codecSpecific.VP8.denoisingOn = true;
|
||||
|
@ -733,19 +733,15 @@ int ViEChannel::EnableSenderStreamingMode(int target_delay_ms) {
|
||||
if (target_delay_ms == 0) {
|
||||
// Real-time mode.
|
||||
nack_history_size_sender_ = kSendSidePacketHistorySize;
|
||||
vcm_.EnableFrameDropper(true);
|
||||
} else {
|
||||
// The max size of the nack list should be large enough to accommodate the
|
||||
// the number of packets(frames) resulting from the increased delay.
|
||||
// Roughly estimating for ~15 packets per frame @ 30fps.
|
||||
nack_history_size_sender_ = target_delay_ms * 15 * 30 / 1000;
|
||||
// Roughly estimating for ~20 packets per frame @ 30fps.
|
||||
nack_history_size_sender_ = target_delay_ms * 20 * 30 / 1000;
|
||||
// Don't allow a number lower than the default value.
|
||||
if (nack_history_size_sender_ < kSendSidePacketHistorySize) {
|
||||
nack_history_size_sender_ = kSendSidePacketHistorySize;
|
||||
}
|
||||
// Disable external VCM frame-dropper. In streaming mode, we are more
|
||||
// flexible with rate control constraints.
|
||||
vcm_.EnableFrameDropper(false);
|
||||
}
|
||||
// Setting nack_history_size_.
|
||||
// First disabling (forcing free) and then resetting to desired value.
|
||||
|
@ -702,6 +702,18 @@ WebRtc_Word32 ViEEncoder::UpdateProtectionMethod() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ViEEncoder::EnableSenderStreamingMode(int target_delay_ms) {
|
||||
if (target_delay_ms > 0) {
|
||||
// Disable external frame-droppers.
|
||||
vcm_.EnableFrameDropper(false);
|
||||
vpm_.EnableTemporalDecimation(false);
|
||||
} else {
|
||||
// Real-time mode - enabling frame droppers.
|
||||
vpm_.EnableTemporalDecimation(true);
|
||||
vcm_.EnableFrameDropper(true);
|
||||
}
|
||||
}
|
||||
|
||||
WebRtc_Word32 ViEEncoder::SendData(
|
||||
const FrameType frame_type,
|
||||
const WebRtc_UWord8 payload_type,
|
||||
|
@ -113,6 +113,9 @@ class ViEEncoder
|
||||
// Loss protection.
|
||||
WebRtc_Word32 UpdateProtectionMethod();
|
||||
|
||||
// Streaming mode.
|
||||
void EnableSenderStreamingMode(int target_delay_ms);
|
||||
|
||||
// Implements VCMPacketizationCallback.
|
||||
virtual WebRtc_Word32 SendData(
|
||||
FrameType frame_type,
|
||||
|
@ -568,6 +568,15 @@ int ViERTP_RTCPImpl::EnableSenderStreamingMode(int video_channel,
|
||||
shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
ViEEncoder* vie_encoder = cs.Encoder(video_channel);
|
||||
if (!vie_encoder) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s: Could not get encoder for channel %d", __FUNCTION__,
|
||||
video_channel);
|
||||
shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Update the channel's streaming mode settings.
|
||||
if (vie_channel->EnableSenderStreamingMode(target_delay_ms) != 0) {
|
||||
@ -577,6 +586,9 @@ int ViERTP_RTCPImpl::EnableSenderStreamingMode(int video_channel,
|
||||
shared_data_->SetLastError(kViERtpRtcpUnknownError);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Update the encoder's streaming mode settings.
|
||||
vie_encoder->EnableSenderStreamingMode(target_delay_ms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user