diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-03-18 13:16:26 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-20 15:55:39 +0100 |
commit | 3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch) | |
tree | 92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc | |
parent | e90d7c4b152c56919d963987e2503f9909a666d2 (diff) |
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies
needed on Windows.
Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc')
-rw-r--r-- | chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc | 246 |
1 files changed, 215 insertions, 31 deletions
diff --git a/chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc b/chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc index ecfa1b669f5..2bd47beca92 100644 --- a/chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc +++ b/chromium/third_party/webrtc/video_engine/vie_rtp_rtcp_impl.cc @@ -796,14 +796,41 @@ int ViERTP_RTCPImpl::SetReceiveAbsoluteSendTimeStatus(int video_channel, ViEId(shared_data_->instance_id(), video_channel), "ViERTP_RTCPImpl::SetReceiveAbsoluteSendTimeStatus(%d, %d, %d)", video_channel, enable, id); - if (!shared_data_->channel_manager()->SetReceiveAbsoluteSendTimeStatus( - video_channel, enable, id)) { + 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), + "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); + shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); + return -1; + } + if (vie_channel->SetReceiveAbsoluteSendTimeStatus(enable, id) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } return 0; } +int ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(int video_channel, bool enable) { + WEBRTC_TRACE(kTraceApiCall, kTraceVideo, + ViEId(shared_data_->instance_id(), video_channel), + "ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(%d, %d)", + video_channel, enable); + + 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), + "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); + shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); + return -1; + } + vie_channel->SetRtcpXrRrtrStatus(enable); + return 0; +} + int ViERTP_RTCPImpl::SetTransmissionSmoothingStatus(int video_channel, bool enable) { WEBRTC_TRACE(kTraceApiCall, kTraceVideo, @@ -823,12 +850,10 @@ int ViERTP_RTCPImpl::SetTransmissionSmoothingStatus(int video_channel, return 0; } -int ViERTP_RTCPImpl::GetReceivedRTCPStatistics(const int video_channel, - uint16_t& fraction_lost, - unsigned int& cumulative_lost, - unsigned int& extended_max, - unsigned int& jitter, - int& rtt_ms) const { +int ViERTP_RTCPImpl::GetReceiveChannelRtcpStatistics( + const int video_channel, + RtcpStatistics& basic_stats, + int& rtt_ms) const { WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id(), video_channel), "%s(channel: %d)", __FUNCTION__, video_channel); @@ -841,23 +866,25 @@ int ViERTP_RTCPImpl::GetReceivedRTCPStatistics(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - if (vie_channel->GetReceivedRtcpStatistics(&fraction_lost, - &cumulative_lost, - &extended_max, - &jitter, - &rtt_ms) != 0) { + + // TODO(sprang): Clean this up when stats struct is propagated all the way. + uint16_t frac_lost; + if (vie_channel->GetReceivedRtcpStatistics( + &frac_lost, + &basic_stats.cumulative_lost, + &basic_stats.extended_max_sequence_number, + &basic_stats.jitter, + &rtt_ms) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } + basic_stats.fraction_lost = frac_lost; return 0; } -int ViERTP_RTCPImpl::GetSentRTCPStatistics(const int video_channel, - uint16_t& fraction_lost, - unsigned int& cumulative_lost, - unsigned int& extended_max, - unsigned int& jitter, - int& rtt_ms) const { +int ViERTP_RTCPImpl::GetSendChannelRtcpStatistics(const int video_channel, + RtcpStatistics& basic_stats, + int& rtt_ms) const { WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id(), video_channel), "%s(channel: %d)", __FUNCTION__, video_channel); @@ -871,20 +898,24 @@ int ViERTP_RTCPImpl::GetSentRTCPStatistics(const int video_channel, return -1; } - if (vie_channel->GetSendRtcpStatistics(&fraction_lost, &cumulative_lost, - &extended_max, &jitter, - &rtt_ms) != 0) { + // TODO(sprang): Clean this up when stats struct is propagated all the way. + uint16_t frac_lost; + if (vie_channel->GetSendRtcpStatistics( + &frac_lost, + &basic_stats.cumulative_lost, + &basic_stats.extended_max_sequence_number, + &basic_stats.jitter, + &rtt_ms) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } + basic_stats.fraction_lost = frac_lost; return 0; } -int ViERTP_RTCPImpl::GetRTPStatistics(const int video_channel, - unsigned int& bytes_sent, - unsigned int& packets_sent, - unsigned int& bytes_received, - unsigned int& packets_received) const { +int ViERTP_RTCPImpl::GetRtpStatistics(const int video_channel, + StreamDataCounters& sent, + StreamDataCounters& received) const { WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id(), video_channel), "%s(channel: %d)", __FUNCTION__, video_channel); @@ -897,10 +928,10 @@ int ViERTP_RTCPImpl::GetRTPStatistics(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - if (vie_channel->GetRtpStatistics(&bytes_sent, - &packets_sent, - &bytes_received, - &packets_received) != 0) { + if (vie_channel->GetRtpStatistics(&sent.bytes, + &sent.packets, + &received.bytes, + &received.packets) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -1100,4 +1131,157 @@ int ViERTP_RTCPImpl::DeregisterRTCPObserver(const int video_channel) { return 0; } +int ViERTP_RTCPImpl::RegisterSendChannelRtcpStatisticsCallback( + int video_channel, RtcpStatisticsCallback* callback) { + 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), + "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); + shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); + return -1; + } + vie_channel->RegisterSendChannelRtcpStatisticsCallback(callback); + return 0; +} + +int ViERTP_RTCPImpl::DeregisterSendChannelRtcpStatisticsCallback( + int video_channel, RtcpStatisticsCallback* callback) { + 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), + "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); + shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); + return -1; + } + vie_channel->RegisterSendChannelRtcpStatisticsCallback(NULL); + return 0; +} + +int ViERTP_RTCPImpl::RegisterReceiveChannelRtcpStatisticsCallback( + int channel, RtcpStatisticsCallback* callback) { + // TODO(sprang): Implement + return -1; +} + +int ViERTP_RTCPImpl::DeregisterReceiveChannelRtcpStatisticsCallback( + int channel, RtcpStatisticsCallback* callback) { + // TODO(sprang): Implement + return -1; +} + +int ViERTP_RTCPImpl::RegisterSendChannelRtpStatisticsCallback( + int video_channel, StreamDataCountersCallback* callback) { + 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); + assert(vie_channel != NULL); + vie_channel->RegisterSendChannelRtpStatisticsCallback(callback); + return 0; +} + +int ViERTP_RTCPImpl::DeregisterSendChannelRtpStatisticsCallback( + int video_channel, StreamDataCountersCallback* callback) { + 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); + assert(vie_channel != NULL); + vie_channel->RegisterSendChannelRtpStatisticsCallback(NULL); + return 0; +} + +int ViERTP_RTCPImpl::RegisterReceiveChannelRtpStatisticsCallback( + int channel, StreamDataCountersCallback* callback) { + // TODO(sprang): Implement + return -1; +} + +int ViERTP_RTCPImpl::DeregisterReceiveChannelRtpStatisticsCallback( + int channel, StreamDataCountersCallback* callback) { + // TODO(sprang): Implement + return -1; +} + +// Called whenever the send bitrate is updated. +int ViERTP_RTCPImpl::RegisterSendBitrateObserver( + const int video_channel, + BitrateStatisticsObserver* 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); + assert(vie_channel != NULL); + vie_channel->RegisterSendBitrateObserver(observer); + return 0; +} + +int ViERTP_RTCPImpl::DeregisterSendBitrateObserver( + const int video_channel, + BitrateStatisticsObserver* 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); + assert(vie_channel != NULL); + vie_channel->RegisterSendBitrateObserver(NULL); + return 0; +} + +int ViERTP_RTCPImpl::RegisterSendFrameCountObserver( + int video_channel, FrameCountObserver* callback) { + 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), + "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); + shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); + return -1; + } + vie_channel->RegisterSendFrameCountObserver(callback); + return 0; +} + +int ViERTP_RTCPImpl::DeregisterSendFrameCountObserver( + int video_channel, FrameCountObserver* callback) { + 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), + "%s: Channel %d doesn't exist", __FUNCTION__, video_channel); + shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); + return -1; + } + vie_channel->RegisterSendFrameCountObserver(NULL); + return 0; +} + } // namespace webrtc |