Breaking out receive-stats, rtp-payload-registry and rtp-receiver from the
rtp_rtcp implementation. This refactoring significantly reduces the receive-side RTP parser and receiver complexity, and makes it possible to implement RTX correctly by having two instances of receive-statistics. With this change the dead-or-alive and packet timeout APIs are removed. TEST=trybots, vie_auto_test, voe_auto_test BUG=1811 R=mflodman@webrtc.org, pbos@webrtc.org, xians@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1745004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4301 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -196,99 +196,4 @@ int ViENetworkImpl::SetMTU(int video_channel, unsigned int mtu) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViENetworkImpl::SetPacketTimeoutNotification(const int video_channel,
|
||||
bool enable,
|
||||
int timeout_seconds) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s(channel: %d, enable: %d, timeout_seconds: %u)",
|
||||
__FUNCTION__, video_channel, enable, timeout_seconds);
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEChannel* vie_channel = cs.Channel(video_channel);
|
||||
if (!vie_channel) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"Channel doesn't exist");
|
||||
shared_data_->SetLastError(kViENetworkInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
if (vie_channel->SetPacketTimeoutNotification(enable,
|
||||
timeout_seconds) != 0) {
|
||||
shared_data_->SetLastError(kViENetworkUnknownError);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViENetworkImpl::RegisterObserver(const int video_channel,
|
||||
ViENetworkObserver& observer) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s(channel: %d)", __FUNCTION__, video_channel);
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEChannel* vie_channel = cs.Channel(video_channel);
|
||||
if (!vie_channel) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"Channel doesn't exist");
|
||||
shared_data_->SetLastError(kViENetworkInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
if (vie_channel->RegisterNetworkObserver(&observer) != 0) {
|
||||
shared_data_->SetLastError(kViENetworkObserverAlreadyRegistered);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViENetworkImpl::DeregisterObserver(const int video_channel) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s(channel: %d)", __FUNCTION__, video_channel);
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEChannel* vie_channel = cs.Channel(video_channel);
|
||||
if (!vie_channel) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"Channel doesn't exist");
|
||||
shared_data_->SetLastError(kViENetworkInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
if (!vie_channel->NetworkObserverRegistered()) {
|
||||
shared_data_->SetLastError(kViENetworkObserverNotRegistered);
|
||||
return -1;
|
||||
}
|
||||
return vie_channel->RegisterNetworkObserver(NULL);
|
||||
}
|
||||
|
||||
int ViENetworkImpl::SetPeriodicDeadOrAliveStatus(
|
||||
const int video_channel,
|
||||
bool enable,
|
||||
unsigned int sample_time_seconds) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s(channel: %d, enable: %d, sample_time_seconds: %ul)",
|
||||
__FUNCTION__, video_channel, enable, sample_time_seconds);
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEChannel* vie_channel = cs.Channel(video_channel);
|
||||
if (!vie_channel) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"Channel doesn't exist");
|
||||
shared_data_->SetLastError(kViENetworkInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
if (!vie_channel->NetworkObserverRegistered()) {
|
||||
shared_data_->SetLastError(kViENetworkObserverNotRegistered);
|
||||
return -1;
|
||||
}
|
||||
if (vie_channel->SetPeriodicDeadOrAliveStatus(enable, sample_time_seconds)
|
||||
!= 0) {
|
||||
shared_data_->SetLastError(kViENetworkUnknownError);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user