Add interface to signal a network down event.
- In real-time mode encoding will be paused until the network is back up. - In buffering mode the encoder will keep encoding, and packets will be buffered at the sender. When the buffer grows above the target delay encoding will be paused. - Fixes a couple of issues related to pacing which was found with the new test. - Introduces different max bitrates for pacing and for encoding. This allows the pacer to faster get rid of the queue after a network down event. (Work based on issue 1237004) BUG=1524 TESTS=trybots,vie_auto_test Review URL: https://webrtc-codereview.appspot.com/1258004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3730 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -60,6 +60,32 @@ int ViENetworkImpl::Release() {
|
||||
return ref_count;
|
||||
}
|
||||
|
||||
void ViENetworkImpl::SetNetworkTransmissionState(const int video_channel,
|
||||
const bool is_transmitting) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s(event: Network %s)", __FUNCTION__,
|
||||
is_transmitting ? "transmitting" : "not transmitting");
|
||||
if (!shared_data_->Initialized()) {
|
||||
shared_data_->SetLastError(kViENotInitialized);
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
|
||||
"%s - ViE instance %d not initialized", __FUNCTION__,
|
||||
shared_data_->instance_id());
|
||||
return;
|
||||
}
|
||||
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEEncoder* vie_encoder = cs.Encoder(video_channel);
|
||||
if (!vie_encoder) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"An encoder doesn't exist for this channel");
|
||||
shared_data_->SetLastError(kViENetworkInvalidChannelId);
|
||||
return;
|
||||
}
|
||||
vie_encoder->SetNetworkTransmissionState(is_transmitting);
|
||||
}
|
||||
|
||||
ViENetworkImpl::ViENetworkImpl(ViESharedData* shared_data)
|
||||
: shared_data_(shared_data) {
|
||||
WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(),
|
||||
|
||||
Reference in New Issue
Block a user