diff --git a/src/video_engine/vie_capture_impl.cc b/src/video_engine/vie_capture_impl.cc index 3dc209cb7..410720da1 100644 --- a/src/video_engine/vie_capture_impl.cc +++ b/src/video_engine/vie_capture_impl.cc @@ -237,7 +237,7 @@ int ViECaptureImpl::ConnectCaptureDevice(const int capture_id, } VideoCodec codec; bool use_hardware_encoder = false; - if (vie_encoder->GetEncoder(codec) == 0) { + if (vie_encoder->GetEncoder(&codec) == 0) { // Try to provide the encoder with pre-encoded frames if possible. if (vie_capture->PreEncodeToViEEncoder(codec, *vie_encoder, video_channel) == 0) { diff --git a/src/video_engine/vie_channel.cc b/src/video_engine/vie_channel.cc index 88c12303c..57b15a086 100644 --- a/src/video_engine/vie_channel.cc +++ b/src/video_engine/vie_channel.cc @@ -356,11 +356,11 @@ WebRtc_Word32 ViEChannel::SetReceiveCodec(const VideoCodec& video_codec) { return 0; } -WebRtc_Word32 ViEChannel::GetReceiveCodec(VideoCodec& video_codec) { +WebRtc_Word32 ViEChannel::GetReceiveCodec(VideoCodec* video_codec) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - if (vcm_.ReceiveCodec(&video_codec) != 0) { + if (vcm_.ReceiveCodec(video_codec) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Could not get receive codec", __FUNCTION__); return -1; @@ -429,7 +429,7 @@ WebRtc_Word32 ViEChannel::DeRegisterExternalDecoder( } WebRtc_Word32 ViEChannel::ReceiveCodecStatistics( - WebRtc_UWord32& num_key_frames, WebRtc_UWord32& num_delta_frames) { + WebRtc_UWord32* num_key_frames, WebRtc_UWord32* num_delta_frames) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -439,8 +439,8 @@ WebRtc_Word32 ViEChannel::ReceiveCodecStatistics( "%s: Could not get received frame information", __FUNCTION__); return -1; } - num_key_frames = received_frames.numKeyFrames; - num_delta_frames = received_frames.numDeltaFrames; + *num_key_frames = received_frames.numKeyFrames; + *num_delta_frames = received_frames.numDeltaFrames; return 0; } @@ -498,10 +498,10 @@ WebRtc_Word32 ViEChannel::SetRTCPMode(const RTCPMethod rtcp_mode) { return rtp_rtcp_->SetRTCPStatus(rtcp_mode); } -WebRtc_Word32 ViEChannel::GetRTCPMode(RTCPMethod& rtcp_mode) { +WebRtc_Word32 ViEChannel::GetRTCPMode(RTCPMethod* rtcp_mode) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - rtcp_mode = rtp_rtcp_->RTCP(); + *rtcp_mode = rtp_rtcp_->RTCP(); return 0; } @@ -711,29 +711,29 @@ WebRtc_Word32 ViEChannel::SetRemoteSSRCType(const StreamType usage, return rtp_rtcp_->SetRTXReceiveStatus(true, SSRC); } -WebRtc_Word32 ViEChannel::GetLocalSSRC(WebRtc_UWord32& SSRC) { +WebRtc_Word32 ViEChannel::GetLocalSSRC(uint32_t* ssrc) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - SSRC = rtp_rtcp_->SSRC(); + *ssrc = rtp_rtcp_->SSRC(); return 0; } -WebRtc_Word32 ViEChannel::GetRemoteSSRC(WebRtc_UWord32& SSRC) { +WebRtc_Word32 ViEChannel::GetRemoteSSRC(uint32_t* ssrc) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - SSRC = rtp_rtcp_->RemoteSSRC(); + *ssrc = rtp_rtcp_->RemoteSSRC(); return 0; } -WebRtc_Word32 ViEChannel::GetRemoteCSRC(unsigned int CSRCs[kRtpCsrcSize]) { +WebRtc_Word32 ViEChannel::GetRemoteCSRC(uint32_t CSRCs[kRtpCsrcSize]) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - WebRtc_UWord32 arrayCSRC[kRtpCsrcSize]; + uint32_t arrayCSRC[kRtpCsrcSize]; memset(arrayCSRC, 0, sizeof(arrayCSRC)); - WebRtc_Word32 num_csrcs = rtp_rtcp_->RemoteCSRCs(arrayCSRC); + int num_csrcs = rtp_rtcp_->RemoteCSRCs(arrayCSRC); if (num_csrcs > 0) { memcpy(CSRCs, arrayCSRC, num_csrcs * sizeof(WebRtc_UWord32)); for (int idx = 0; idx < num_csrcs; idx++) { @@ -871,11 +871,11 @@ WebRtc_Word32 ViEChannel::SendApplicationDefinedRTCPPacket( return 0; } -WebRtc_Word32 ViEChannel::GetSendRtcpStatistics(WebRtc_UWord16& fraction_lost, - WebRtc_UWord32& cumulative_lost, - WebRtc_UWord32& extended_max, - WebRtc_UWord32& jitter_samples, - WebRtc_Word32& rtt_ms) { +WebRtc_Word32 ViEChannel::GetSendRtcpStatistics(uint16_t* fraction_lost, + uint32_t* cumulative_lost, + uint32_t* extended_max, + uint32_t* jitter_samples, + int32_t* rtt_ms) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -888,7 +888,7 @@ WebRtc_Word32 ViEChannel::GetSendRtcpStatistics(WebRtc_UWord16& fraction_lost, // it++) { // RtpRtcp* rtp_rtcp = *it; // } - WebRtc_UWord32 remoteSSRC = rtp_rtcp_->RemoteSSRC(); + uint32_t remote_ssrc = rtp_rtcp_->RemoteSSRC(); // Get all RTCP receiver report blocks that have been received on this // channel. If we receive RTP packets from a remote source we know the @@ -903,7 +903,7 @@ WebRtc_Word32 ViEChannel::GetSendRtcpStatistics(WebRtc_UWord16& fraction_lost, std::vector::const_iterator statistics = remote_stats.begin(); for (; statistics != remote_stats.end(); ++statistics) { - if (statistics->remoteSSRC == remoteSSRC) + if (statistics->remoteSSRC == remote_ssrc) break; } @@ -912,66 +912,64 @@ WebRtc_Word32 ViEChannel::GetSendRtcpStatistics(WebRtc_UWord16& fraction_lost, // we have not received any RTP packets. // Use the first received report block instead. statistics = remote_stats.begin(); - remoteSSRC = statistics->remoteSSRC; + remote_ssrc = statistics->remoteSSRC; } - fraction_lost = statistics->fractionLost; - cumulative_lost = statistics->cumulativeLost; - extended_max = statistics->extendedHighSeqNum; - jitter_samples = statistics->jitter; + *fraction_lost = statistics->fractionLost; + *cumulative_lost = statistics->cumulativeLost; + *extended_max = statistics->extendedHighSeqNum; + *jitter_samples = statistics->jitter; WebRtc_UWord16 dummy; WebRtc_UWord16 rtt = 0; - if (rtp_rtcp_->RTT(remoteSSRC, &rtt, &dummy, &dummy, &dummy) != 0) { + if (rtp_rtcp_->RTT(remote_ssrc, &rtt, &dummy, &dummy, &dummy) != 0) { WEBRTC_TRACE(kTraceWarning, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Could not get RTT", __FUNCTION__); return -1; } - rtt_ms = rtt; + *rtt_ms = rtt; return 0; } -WebRtc_Word32 ViEChannel::GetReceivedRtcpStatistics( - WebRtc_UWord16& fraction_lost, - WebRtc_UWord32& cumulative_lost, - WebRtc_UWord32& extended_max, - WebRtc_UWord32& jitter_samples, - WebRtc_Word32& rtt_ms) { +WebRtc_Word32 ViEChannel::GetReceivedRtcpStatistics(uint16_t* fraction_lost, + uint32_t* cumulative_lost, + uint32_t* extended_max, + uint32_t* jitter_samples, + int32_t* rtt_ms) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); WebRtc_UWord8 frac_lost = 0; - if (rtp_rtcp_->StatisticsRTP(&frac_lost, &cumulative_lost, &extended_max, - &jitter_samples) != 0) { + if (rtp_rtcp_->StatisticsRTP(&frac_lost, cumulative_lost, extended_max, + jitter_samples) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Could not get received RTP statistics", __FUNCTION__); return -1; } - fraction_lost = frac_lost; + *fraction_lost = frac_lost; - WebRtc_UWord32 remoteSSRC = rtp_rtcp_->RemoteSSRC(); - WebRtc_UWord16 dummy = 0; - WebRtc_UWord16 rtt = 0; - if (rtp_rtcp_->RTT(remoteSSRC, &rtt, &dummy, &dummy, &dummy) != 0) { + uint32_t remote_ssrc = rtp_rtcp_->RemoteSSRC(); + uint16_t dummy = 0; + uint16_t rtt = 0; + if (rtp_rtcp_->RTT(remote_ssrc, &rtt, &dummy, &dummy, &dummy) != 0) { WEBRTC_TRACE(kTraceStateInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Could not get RTT", __FUNCTION__); } - rtt_ms = rtt; + *rtt_ms = rtt; return 0; } -WebRtc_Word32 ViEChannel::GetRtpStatistics( - WebRtc_UWord32& bytes_sent, - WebRtc_UWord32& packets_sent, - WebRtc_UWord32& bytes_received, - WebRtc_UWord32& packets_received) const { +WebRtc_Word32 ViEChannel::GetRtpStatistics(uint32_t* bytes_sent, + uint32_t* packets_sent, + uint32_t* bytes_received, + uint32_t* packets_received) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - if (rtp_rtcp_->DataCountersRTP(&bytes_sent, - &packets_sent, - &bytes_received, - &packets_received) != 0) { + if (rtp_rtcp_->DataCountersRTP(bytes_sent, + packets_sent, + bytes_received, + packets_received) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Could not get counters", __FUNCTION__); return -1; @@ -980,8 +978,8 @@ WebRtc_Word32 ViEChannel::GetRtpStatistics( for (std::list::const_iterator it = simulcast_rtp_rtcp_.begin(); it != simulcast_rtp_rtcp_.end(); it++) { - WebRtc_UWord32 bytes_sent_temp = 0; - WebRtc_UWord32 packets_sent_temp = 0; + uint32_t bytes_sent_temp = 0; + uint32_t packets_sent_temp = 0; RtpRtcp* rtp_rtcp = *it; rtp_rtcp->DataCountersRTP(&bytes_sent_temp, &packets_sent_temp, NULL, NULL); bytes_sent += bytes_sent_temp; @@ -990,34 +988,32 @@ WebRtc_Word32 ViEChannel::GetRtpStatistics( return 0; } -void ViEChannel::GetBandwidthUsage(WebRtc_UWord32& total_bitrate_sent, - WebRtc_UWord32& video_bitrate_sent, - WebRtc_UWord32& fec_bitrate_sent, - WebRtc_UWord32& nackBitrateSent) const { +void ViEChannel::GetBandwidthUsage(uint32_t* total_bitrate_sent, + uint32_t* video_bitrate_sent, + uint32_t* fec_bitrate_sent, + uint32_t* nackBitrateSent) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - rtp_rtcp_->BitrateSent(&total_bitrate_sent, - &video_bitrate_sent, - &fec_bitrate_sent, - &nackBitrateSent); + rtp_rtcp_->BitrateSent(total_bitrate_sent, video_bitrate_sent, + fec_bitrate_sent, nackBitrateSent); CriticalSectionScoped cs(rtp_rtcp_cs_.get()); for (std::list::const_iterator it = simulcast_rtp_rtcp_.begin(); it != simulcast_rtp_rtcp_.end(); it++) { - WebRtc_UWord32 stream_rate = 0; - WebRtc_UWord32 video_rate = 0; - WebRtc_UWord32 fec_rate = 0; - WebRtc_UWord32 nackRate = 0; + uint32_t stream_rate = 0; + uint32_t video_rate = 0; + uint32_t fec_rate = 0; + uint32_t nackRate = 0; RtpRtcp* rtp_rtcp = *it; rtp_rtcp->BitrateSent(&stream_rate, &video_rate, &fec_rate, &nackRate); - total_bitrate_sent += stream_rate; - fec_bitrate_sent += fec_rate; - nackBitrateSent += nackRate; + *total_bitrate_sent += stream_rate; + *fec_bitrate_sent += fec_rate; + *nackBitrateSent += nackRate; } } int ViEChannel::GetEstimatedReceiveBandwidth( - WebRtc_UWord32* estimated_bandwidth) const { + uint32_t* estimated_bandwidth) const { return rtp_rtcp_->EstimatedReceiveBandwidth(estimated_bandwidth); } @@ -1097,8 +1093,8 @@ WebRtc_Word32 ViEChannel::SetLocalReceiver(const WebRtc_UWord16 rtp_port, #endif } -WebRtc_Word32 ViEChannel::GetLocalReceiver(WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, +WebRtc_Word32 ViEChannel::GetLocalReceiver(WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, char* ip_address) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1120,8 +1116,8 @@ WebRtc_Word32 ViEChannel::GetLocalReceiver(WebRtc_UWord16& rtp_port, } char multicast_ip_address[UdpTransport::kIpAddressVersion6Length]; - if (socket_transport_.ReceiveSocketInformation(ip_address, rtp_port, - rtcp_port, + if (socket_transport_.ReceiveSocketInformation(ip_address, *rtp_port, + *rtcp_port, multicast_ip_address) != 0) { WebRtc_Word32 socket_error = socket_transport_.LastError(); WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), @@ -1258,10 +1254,10 @@ WebRtc_Word32 ViEChannel::SetSendDestination( WebRtc_Word32 ViEChannel::GetSendDestination( char* ip_address, - WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, - WebRtc_UWord16& source_rtp_port, - WebRtc_UWord16& source_rtcp_port) const { + WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, + WebRtc_UWord16* source_rtp_port, + WebRtc_UWord16* source_rtcp_port) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1280,18 +1276,18 @@ WebRtc_Word32 ViEChannel::GetSendDestination( "%s: send sockets not initialized", __FUNCTION__); return -1; } - if (socket_transport_.SendSocketInformation(ip_address, rtp_port, rtcp_port) - != 0) { + if (socket_transport_.SendSocketInformation(ip_address, *rtp_port, + *rtcp_port) != 0) { WebRtc_Word32 socket_error = socket_transport_.LastError(); WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: could not get send socket information. Socket error: %d", __FUNCTION__, socket_error); return -1; } - source_rtp_port = 0; - source_rtcp_port = 0; + *source_rtp_port = 0; + *source_rtcp_port = 0; if (socket_transport_.SourcePortsInitialized()) { - socket_transport_.SourcePorts(source_rtp_port, source_rtcp_port); + socket_transport_.SourcePorts(*source_rtp_port, *source_rtcp_port); } return 0; #else @@ -1461,8 +1457,8 @@ bool ViEChannel::Receiving() { #endif } -WebRtc_Word32 ViEChannel::GetSourceInfo(WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, +WebRtc_Word32 ViEChannel::GetSourceInfo(WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, char* ip_address, WebRtc_UWord32 ip_address_length) { { @@ -1487,8 +1483,8 @@ WebRtc_Word32 ViEChannel::GetSourceInfo(WebRtc_UWord16& rtp_port, return -1; } - if (socket_transport_.RemoteSocketInformation(ip_address, rtp_port, rtcp_port) - != 0) { + if (socket_transport_.RemoteSocketInformation(ip_address, *rtp_port, + *rtcp_port) != 0) { WebRtc_Word32 socket_error = socket_transport_.LastError(); WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Error getting source ports. Socket error: %d", @@ -1502,7 +1498,8 @@ WebRtc_Word32 ViEChannel::GetSourceInfo(WebRtc_UWord16& rtp_port, return -1; #endif } -WebRtc_Word32 ViEChannel::RegisterSendTransport(Transport& transport) { + +WebRtc_Word32 ViEChannel::RegisterSendTransport(Transport* transport) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1526,8 +1523,8 @@ WebRtc_Word32 ViEChannel::RegisterSendTransport(Transport& transport) { "%s: transport already registered", __FUNCTION__); return -1; } - external_transport_ = &transport; - vie_sender_.RegisterSendTransport(&transport); + external_transport_ = transport; + vie_sender_.RegisterSendTransport(transport); WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Transport registered: 0x%p", __FUNCTION__, &external_transport_); @@ -1665,8 +1662,8 @@ WebRtc_Word32 ViEChannel::SetSourceFilter(const WebRtc_UWord16 rtp_port, #endif } -WebRtc_Word32 ViEChannel::GetSourceFilter(WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, +WebRtc_Word32 ViEChannel::GetSourceFilter(WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, char* ip_address) const { callback_cs_->Enter(); WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", @@ -1685,7 +1682,7 @@ WebRtc_Word32 ViEChannel::GetSourceFilter(WebRtc_UWord16& rtp_port, // Logging done in module. return -1; } - if (socket_transport_.FilterPorts(rtp_port, rtcp_port) != 0) { + if (socket_transport_.FilterPorts(*rtp_port, *rtcp_port) != 0) { // Logging done in module. return -1; } @@ -1724,8 +1721,8 @@ WebRtc_Word32 ViEChannel::SetToS(const WebRtc_Word32 DSCP, #endif } -WebRtc_Word32 ViEChannel::GetToS(WebRtc_Word32& DSCP, - bool& use_set_sockOpt) const { +WebRtc_Word32 ViEChannel::GetToS(WebRtc_Word32* DSCP, + bool* use_set_sockOpt) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); { @@ -1737,7 +1734,7 @@ WebRtc_Word32 ViEChannel::GetToS(WebRtc_Word32& DSCP, } } #ifndef WEBRTC_EXTERNAL_TRANSPORT - if (socket_transport_.ToS(DSCP, use_set_sockOpt) != 0) { + if (socket_transport_.ToS(*DSCP, *use_set_sockOpt) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Socket error: %d", __FUNCTION__, socket_transport_.LastError()); @@ -1781,9 +1778,9 @@ WebRtc_Word32 ViEChannel::SetSendGQoS(const bool enable, #endif } -WebRtc_Word32 ViEChannel::GetSendGQoS(bool& enabled, - WebRtc_Word32& service_type, - WebRtc_Word32& overrideDSCP) const { +WebRtc_Word32 ViEChannel::GetSendGQoS(bool* enabled, + WebRtc_Word32* service_type, + WebRtc_Word32* overrideDSCP) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); { @@ -1795,7 +1792,7 @@ WebRtc_Word32 ViEChannel::GetSendGQoS(bool& enabled, } } #ifndef WEBRTC_EXTERNAL_TRANSPORT - if (socket_transport_.QoS(enabled, service_type, overrideDSCP) != 0) { + if (socket_transport_.QoS(*enabled, *service_type, *overrideDSCP) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Socket error: %d", __FUNCTION__, socket_transport_.LastError()); @@ -1961,7 +1958,7 @@ RtpRtcp* ViEChannel::rtp_rtcp() { return rtp_rtcp_.get(); } -WebRtc_Word32 ViEChannel::FrameToRender(VideoFrame& video_frame) { +WebRtc_Word32 ViEChannel::FrameToRender(VideoFrame& video_frame) { // NOLINT CriticalSectionScoped cs(callback_cs_.get()); if (decoder_reset_) { @@ -1973,8 +1970,8 @@ WebRtc_Word32 ViEChannel::FrameToRender(VideoFrame& video_frame) { // VCM::ReceiveCodec returns the codec set by // RegisterReceiveCodec, which might not be the size we're // actually decoding. - decoder.width = static_cast(video_frame.Width()); - decoder.height = static_cast(video_frame.Height()); + decoder.width = static_cast(video_frame.Width()); + decoder.height = static_cast(video_frame.Height()); codec_observer_->IncomingCodecChanged(channel_id_, decoder); } else { assert(false); diff --git a/src/video_engine/vie_channel.h b/src/video_engine/vie_channel.h index 92bf0be71..381b8c4ac 100644 --- a/src/video_engine/vie_channel.h +++ b/src/video_engine/vie_channel.h @@ -8,10 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -// vie_channel.h - -#ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_ -#define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_ +#ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_ // NOLINT +#define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_ // NOLINT #include @@ -21,7 +19,7 @@ #include "modules/video_coding/main/interface/video_coding_defines.h" #include "system_wrappers/interface/scoped_ptr.h" #include "system_wrappers/interface/tick_util.h" -#include "typedefs.h" +#include "typedefs.h" // NOLINT #include "video_engine/include/vie_network.h" #include "video_engine/include/vie_rtp_rtcp.h" #include "video_engine/vie_defines.h" @@ -75,7 +73,7 @@ class ViEChannel WebRtc_Word32 SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); WebRtc_Word32 SetReceiveCodec(const VideoCodec& video_codec); - WebRtc_Word32 GetReceiveCodec(VideoCodec& video_codec); + WebRtc_Word32 GetReceiveCodec(VideoCodec* video_codec); WebRtc_Word32 RegisterCodecObserver(ViEDecoderObserver* observer); // Registers an external decoder. |decoder_render| is set to true if the // decoder will do the rendering. If |decoder_render| is set,|render_delay| @@ -85,8 +83,8 @@ class ViEChannel bool decoder_render, WebRtc_Word32 render_delay); WebRtc_Word32 DeRegisterExternalDecoder(const WebRtc_UWord8 pl_type); - WebRtc_Word32 ReceiveCodecStatistics(WebRtc_UWord32& num_key_frames, - WebRtc_UWord32& num_delta_frames); + WebRtc_Word32 ReceiveCodecStatistics(WebRtc_UWord32* num_key_frames, + WebRtc_UWord32* num_delta_frames); WebRtc_UWord32 DiscardedPackets() const; // Only affects calls to SetReceiveCodec done after this call. @@ -98,7 +96,7 @@ class ViEChannel WebRtc_Word32 SetSignalPacketLossStatus(bool enable, bool only_key_frames); WebRtc_Word32 SetRTCPMode(const RTCPMethod rtcp_mode); - WebRtc_Word32 GetRTCPMode(RTCPMethod& rtcp_mode); + WebRtc_Word32 GetRTCPMode(RTCPMethod* rtcp_mode); WebRtc_Word32 SetNACKStatus(const bool enable); WebRtc_Word32 SetFECStatus(const bool enable, const unsigned char payload_typeRED, @@ -112,18 +110,18 @@ class ViEChannel WebRtc_Word32 EnableKeyFrameRequestCallback(const bool enable); // Sets SSRC for outgoing stream. - WebRtc_Word32 SetSSRC(const WebRtc_UWord32 SSRC, + WebRtc_Word32 SetSSRC(const uint32_t SSRC, const StreamType usage, const unsigned char simulcast_idx); // Gets SSRC for outgoing stream. - WebRtc_Word32 GetLocalSSRC(WebRtc_UWord32& SSRC); + WebRtc_Word32 GetLocalSSRC(uint32_t* ssrc); // Gets SSRC for the incoming stream. - WebRtc_Word32 GetRemoteSSRC(WebRtc_UWord32& SSRC); + WebRtc_Word32 GetRemoteSSRC(uint32_t* ssrc); // Gets the CSRC for the incoming stream. - WebRtc_Word32 GetRemoteCSRC(unsigned int CSRCs[kRtpCsrcSize]); + WebRtc_Word32 GetRemoteCSRC(uint32_t CSRCs[kRtpCsrcSize]); // Sets the starting sequence number, must be called before StartSend. WebRtc_Word32 SetStartSequenceNumber(WebRtc_UWord16 sequence_number); @@ -145,29 +143,29 @@ class ViEChannel WebRtc_UWord16 data_length_in_bytes); // Returns statistics reported by the remote client in an RTCP packet. - WebRtc_Word32 GetSendRtcpStatistics(WebRtc_UWord16& fraction_lost, - WebRtc_UWord32& cumulative_lost, - WebRtc_UWord32& extended_max, - WebRtc_UWord32& jitter_samples, - WebRtc_Word32& rtt_ms); + WebRtc_Word32 GetSendRtcpStatistics(uint16_t* fraction_lost, + uint32_t* cumulative_lost, + uint32_t* extended_max, + uint32_t* jitter_samples, + int32_t* rtt_ms); // Returns our localy created statistics of the received RTP stream. - WebRtc_Word32 GetReceivedRtcpStatistics(WebRtc_UWord16& fraction_lost, - WebRtc_UWord32& cumulative_lost, - WebRtc_UWord32& extended_max, - WebRtc_UWord32& jitter_samples, - WebRtc_Word32& rtt_ms); + WebRtc_Word32 GetReceivedRtcpStatistics(uint16_t* fraction_lost, + uint32_t* cumulative_lost, + uint32_t* extended_max, + uint32_t* jitter_samples, + int32_t* rtt_ms); // Gets sent/received packets statistics. - WebRtc_Word32 GetRtpStatistics(WebRtc_UWord32& bytes_sent, - WebRtc_UWord32& packets_sent, - WebRtc_UWord32& bytes_received, - WebRtc_UWord32& packets_received) const; - void GetBandwidthUsage(WebRtc_UWord32& total_bitrate_sent, - WebRtc_UWord32& video_bitrate_sent, - WebRtc_UWord32& fec_bitrate_sent, - WebRtc_UWord32& nackBitrateSent) const; - int GetEstimatedReceiveBandwidth(WebRtc_UWord32* estimated_bandwidth) const; + WebRtc_Word32 GetRtpStatistics(uint32_t* bytes_sent, + uint32_t* packets_sent, + uint32_t* bytes_received, + uint32_t* packets_received) const; + void GetBandwidthUsage(uint32_t* total_bitrate_sent, + uint32_t* video_bitrate_sent, + uint32_t* fec_bitrate_sent, + uint32_t* nackBitrateSent) const; + int GetEstimatedReceiveBandwidth(uint32_t* estimated_bandwidth) const; WebRtc_Word32 StartRTPDump(const char file_nameUTF8[1024], RTPDirections direction); @@ -202,8 +200,8 @@ class ViEChannel WebRtc_Word32 SetLocalReceiver(const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, const char* ip_address); - WebRtc_Word32 GetLocalReceiver(WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, + WebRtc_Word32 GetLocalReceiver(WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, char* ip_address) const; WebRtc_Word32 SetSendDestination(const char* ip_address, const WebRtc_UWord16 rtp_port, @@ -211,12 +209,12 @@ class ViEChannel const WebRtc_UWord16 source_rtp_port, const WebRtc_UWord16 source_rtcp_port); WebRtc_Word32 GetSendDestination(char* ip_address, - WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, - WebRtc_UWord16& source_rtp_port, - WebRtc_UWord16& source_rtcp_port) const; - WebRtc_Word32 GetSourceInfo(WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, + WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, + WebRtc_UWord16* source_rtp_port, + WebRtc_UWord16* source_rtcp_port) const; + WebRtc_Word32 GetSourceInfo(WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, char* ip_address, WebRtc_UWord32 ip_address_length); @@ -230,7 +228,7 @@ class ViEChannel WebRtc_Word32 StopReceive(); bool Receiving(); - WebRtc_Word32 RegisterSendTransport(Transport& transport); + WebRtc_Word32 RegisterSendTransport(Transport* transport); WebRtc_Word32 DeregisterSendTransport(); // Incoming packet from external transport. @@ -246,18 +244,19 @@ class ViEChannel WebRtc_Word32 SetSourceFilter(const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, const char* ip_address); - WebRtc_Word32 GetSourceFilter(WebRtc_UWord16& rtp_port, - WebRtc_UWord16& rtcp_port, + WebRtc_Word32 GetSourceFilter(WebRtc_UWord16* rtp_port, + WebRtc_UWord16* rtcp_port, char* ip_address) const; WebRtc_Word32 SetToS(const WebRtc_Word32 DSCP, const bool use_set_sockOpt); - WebRtc_Word32 GetToS(WebRtc_Word32& DSCP, bool& use_set_sockOpt) const; + WebRtc_Word32 GetToS(WebRtc_Word32* DSCP, bool* use_set_sockOpt) const; WebRtc_Word32 SetSendGQoS(const bool enable, const WebRtc_Word32 service_type, const WebRtc_UWord32 max_bitrate, const WebRtc_Word32 overrideDSCP); - WebRtc_Word32 GetSendGQoS(bool& enabled, WebRtc_Word32& service_type, - WebRtc_Word32& overrideDSCP) const; + WebRtc_Word32 GetSendGQoS(bool* enabled, + WebRtc_Word32* service_type, + WebRtc_Word32* overrideDSCP) const; // Sets the maximum transfer unit size for the network link, i.e. including // IP, UDP and RTP headers. @@ -288,7 +287,7 @@ class ViEChannel RtpRtcp* rtp_rtcp(); // Implements VCMReceiveCallback. - virtual WebRtc_Word32 FrameToRender(VideoFrame& video_frame); + virtual WebRtc_Word32 FrameToRender(VideoFrame& video_frame); // NOLINT // Implements VCMReceiveCallback. virtual WebRtc_Word32 ReceivedDecodedReferenceFrame( @@ -398,4 +397,4 @@ class ViEChannel } // namespace webrtc -#endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_ +#endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_H_ // NOLINT diff --git a/src/video_engine/vie_channel_manager.cc b/src/video_engine/vie_channel_manager.cc index 5087668e6..44e786c6c 100644 --- a/src/video_engine/vie_channel_manager.cc +++ b/src/video_engine/vie_channel_manager.cc @@ -204,7 +204,7 @@ int ViEChannelManager::DeleteChannel(int channel_id) { group->SetChannelRembStatus(channel_id, false, false, vie_channel, vie_encoder); unsigned int ssrc = 0; - vie_channel->GetRemoteSSRC(ssrc); + vie_channel->GetRemoteSSRC(&ssrc); group->RemoveChannel(channel_id, ssrc); // Check if other channels are using the same encoder. @@ -347,7 +347,7 @@ bool ViEChannelManager::CreateChannelObject( return false; } VideoCodec encoder; - if (vie_encoder->GetEncoder(encoder) != 0 || + if (vie_encoder->GetEncoder(&encoder) != 0 || vie_channel->SetSendCodec(encoder) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id), "%s: Could not GetEncoder or SetSendCodec.", __FUNCTION__); diff --git a/src/video_engine/vie_codec_impl.cc b/src/video_engine/vie_codec_impl.cc index 065f23ee3..76138d08c 100644 --- a/src/video_engine/vie_codec_impl.cc +++ b/src/video_engine/vie_codec_impl.cc @@ -174,7 +174,7 @@ int ViECodecImpl::SetSendCodec(const int video_channel, } VideoCodec encoder; - vie_encoder->GetEncoder(encoder); + vie_encoder->GetEncoder(&encoder); // Make sure to generate a new SSRC if the codec type and/or resolution has // changed. This won't have any effect if the user has set an SSRC. @@ -271,7 +271,7 @@ int ViECodecImpl::GetSendCodec(const int video_channel, shared_data_->SetLastError(kViECodecInvalidChannelId); return -1; } - return vie_encoder->GetEncoder(video_codec); + return vie_encoder->GetEncoder(&video_codec); } int ViECodecImpl::SetReceiveCodec(const int video_channel, @@ -333,7 +333,7 @@ int ViECodecImpl::GetReceiveCodec(const int video_channel, return -1; } - if (vie_channel->GetReceiveCodec(video_codec) != 0) { + if (vie_channel->GetReceiveCodec(&video_codec) != 0) { shared_data_->SetLastError(kViECodecUnknownError); return -1; } @@ -408,7 +408,7 @@ int ViECodecImpl::GetSendCodecStastistics(const int video_channel, return -1; } - if (vie_encoder->SendCodecStatistics(key_frames, delta_frames) != 0) { + if (vie_encoder->SendCodecStatistics(&key_frames, &delta_frames) != 0) { shared_data_->SetLastError(kViECodecUnknownError); return -1; } @@ -432,7 +432,7 @@ int ViECodecImpl::GetReceiveCodecStastistics(const int video_channel, shared_data_->SetLastError(kViECodecInvalidChannelId); return -1; } - if (vie_channel->ReceiveCodecStatistics(key_frames, delta_frames) != 0) { + if (vie_channel->ReceiveCodecStatistics(&key_frames, &delta_frames) != 0) { shared_data_->SetLastError(kViECodecUnknownError); return -1; } diff --git a/src/video_engine/vie_encoder.cc b/src/video_engine/vie_encoder.cc index 27dccaca2..72610cc87 100644 --- a/src/video_engine/vie_encoder.cc +++ b/src/video_engine/vie_encoder.cc @@ -8,21 +8,21 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "vie_encoder.h" +#include "video_engine/vie_encoder.h" #include -#include "critical_section_wrapper.h" -#include "process_thread.h" -#include "rtp_rtcp.h" -#include "tick_util.h" -#include "trace.h" -#include "video_codec_interface.h" -#include "video_coding.h" -#include "video_coding_defines.h" -#include "vie_codec.h" -#include "vie_defines.h" -#include "vie_image_process.h" +#include "modules/rtp_rtcp/interface/rtp_rtcp.h" +#include "modules/utility/interface/process_thread.h" +#include "modules/video_coding/codecs/interface/video_codec_interface.h" +#include "modules/video_coding/main/interface/video_coding.h" +#include "modules/video_coding/main/interface/video_coding_defines.h" +#include "system_wrappers/interface/critical_section_wrapper.h" +#include "system_wrappers/interface/tick_util.h" +#include "system_wrappers/interface/trace.h" +#include "video_engine/include/vie_codec.h" +#include "video_engine/include/vie_image_process.h" +#include "video_engine/vie_defines.h" namespace webrtc { @@ -42,7 +42,7 @@ class QMVideoSettingsCallback : public VCMQMSettingsCallback { class ViEBitrateObserver : public BitrateObserver { public: - ViEBitrateObserver(ViEEncoder* owner) + explicit ViEBitrateObserver(ViEEncoder* owner) : owner_(owner) { } // Implements BitrateObserver. @@ -240,8 +240,8 @@ WebRtc_UWord8 ViEEncoder::NumberOfCodecs() { } WebRtc_Word32 ViEEncoder::GetCodec(WebRtc_UWord8 list_index, - webrtc::VideoCodec& video_codec) { - if (vcm_.Codec(list_index, &video_codec) != 0) { + VideoCodec* video_codec) { + if (vcm_.Codec(list_index, video_codec) != 0) { WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_, channel_id_), "%s: Could not get codec", __FUNCTION__); @@ -358,11 +358,11 @@ WebRtc_Word32 ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec) { return 0; } -WebRtc_Word32 ViEEncoder::GetEncoder(webrtc::VideoCodec& video_codec) { +WebRtc_Word32 ViEEncoder::GetEncoder(VideoCodec* video_codec) { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); - if (vcm_.SendCodec(&video_codec) != 0) { + if (vcm_.SendCodec(video_codec) != 0) { WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_, channel_id_), "Could not get VCM send codec"); @@ -582,7 +582,7 @@ int ViEEncoder::SendKeyFrame() { } WebRtc_Word32 ViEEncoder::SendCodecStatistics( - WebRtc_UWord32& num_key_frames, WebRtc_UWord32& num_delta_frames) { + WebRtc_UWord32* num_key_frames, WebRtc_UWord32* num_delta_frames) { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -593,8 +593,8 @@ WebRtc_Word32 ViEEncoder::SendCodecStatistics( "%s: Could not get sent frame information", __FUNCTION__); return -1; } - num_key_frames = sent_frames.numKeyFrames; - num_delta_frames = sent_frames.numDeltaFrames; + *num_key_frames = sent_frames.numKeyFrames; + *num_delta_frames = sent_frames.numDeltaFrames; return 0; } diff --git a/src/video_engine/vie_encoder.h b/src/video_engine/vie_encoder.h index 1379675b6..068bce368 100644 --- a/src/video_engine/vie_encoder.h +++ b/src/video_engine/vie_encoder.h @@ -8,20 +8,19 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ -#define WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ - -#include "common_types.h" -#include "typedefs.h" -#include "video_coding_defines.h" -#include "video_processing.h" -#include "vie_defines.h" -#include "vie_file_recorder.h" -#include "vie_frame_provider_base.h" +#ifndef WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ // NOLINT +#define WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ // NOLINT +#include "common_types.h" // NOLINT +#include "typedefs.h" //NOLINT #include "modules/bitrate_controller/include/bitrate_controller.h" #include "modules/rtp_rtcp/interface/rtp_rtcp_defines.h" +#include "modules/video_coding/main/interface/video_coding_defines.h" +#include "modules/video_processing/main/interface/video_processing.h" #include "system_wrappers/interface/scoped_ptr.h" +#include "video_engine/vie_defines.h" +#include "video_engine/vie_file_recorder.h" +#include "video_engine/vie_frame_provider_base.h" namespace webrtc { @@ -63,12 +62,12 @@ class ViEEncoder // Codec settings. WebRtc_UWord8 NumberOfCodecs(); - WebRtc_Word32 GetCodec(WebRtc_UWord8 list_index, VideoCodec& video_codec); + WebRtc_Word32 GetCodec(WebRtc_UWord8 list_index, VideoCodec* video_codec); WebRtc_Word32 RegisterExternalEncoder(VideoEncoder* encoder, WebRtc_UWord8 pl_type); WebRtc_Word32 DeRegisterExternalEncoder(WebRtc_UWord8 pl_type); WebRtc_Word32 SetEncoder(const VideoCodec& video_codec); - WebRtc_Word32 GetEncoder(VideoCodec& video_codec); + WebRtc_Word32 GetEncoder(VideoCodec* video_codec); WebRtc_Word32 GetCodecConfigParameters( unsigned char config_parameters[kConfigParameterSize], @@ -94,10 +93,9 @@ class ViEEncoder return; } - WebRtc_Word32 EncodeFrame(VideoFrame& video_frame); WebRtc_Word32 SendKeyFrame(); - WebRtc_Word32 SendCodecStatistics(WebRtc_UWord32& num_key_frames, - WebRtc_UWord32& num_delta_frames); + WebRtc_Word32 SendCodecStatistics(WebRtc_UWord32* num_key_frames, + WebRtc_UWord32* num_delta_frames); WebRtc_Word32 EstimatedSendBandwidth( WebRtc_UWord32* available_bandwidth) const; @@ -189,4 +187,4 @@ class ViEEncoder } // namespace webrtc -#endif // WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ +#endif // WEBRTC_VIDEO_ENGINE_VIE_ENCODER_H_ // NOLINT diff --git a/src/video_engine/vie_network_impl.cc b/src/video_engine/vie_network_impl.cc index ffa613d12..378d08f31 100644 --- a/src/video_engine/vie_network_impl.cc +++ b/src/video_engine/vie_network_impl.cc @@ -126,7 +126,7 @@ int ViENetworkImpl::GetLocalReceiver(const int video_channel, shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } - if (vie_channel->GetLocalReceiver(rtp_port, rtcp_port, ip_address) != 0) { + if (vie_channel->GetLocalReceiver(&rtp_port, &rtcp_port, ip_address) != 0) { shared_data_->SetLastError(kViENetworkLocalReceiverNotSet); return -1; } @@ -196,9 +196,9 @@ int ViENetworkImpl::GetSendDestination(const int video_channel, shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } - if (vie_channel->GetSendDestination(ip_address, rtp_port, rtcp_port, - source_rtp_port, - source_rtcp_port) != 0) { + if (vie_channel->GetSendDestination(ip_address, &rtp_port, &rtcp_port, + &source_rtp_port, + &source_rtcp_port) != 0) { shared_data_->SetLastError(kViENetworkDestinationNotSet); return -1; } @@ -233,7 +233,7 @@ int ViENetworkImpl::RegisterSendTransport(const int video_channel, shared_data_->SetLastError(kViENetworkAlreadySending); return -1; } - if (vie_channel->RegisterSendTransport(transport) != 0) { + if (vie_channel->RegisterSendTransport(&transport) != 0) { shared_data_->SetLastError(kViENetworkUnknownError); return -1; } @@ -334,7 +334,7 @@ int ViENetworkImpl::GetSourceInfo(const int video_channel, shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } - if (vie_channel->GetSourceInfo(rtp_port, rtcp_port, ip_address, + if (vie_channel->GetSourceInfo(&rtp_port, &rtcp_port, ip_address, ip_address_length) != 0) { shared_data_->SetLastError(kViENetworkUnknownError); return -1; @@ -498,7 +498,7 @@ int ViENetworkImpl::GetSourceFilter(const int video_channel, shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } - if (vie_channel->GetSourceFilter(rtp_port, rtcp_port, ip_address) != 0) { + if (vie_channel->GetSourceFilter(&rtp_port, &rtcp_port, ip_address) != 0) { shared_data_->SetLastError(kViENetworkUnknownError); return -1; } @@ -551,7 +551,7 @@ int ViENetworkImpl::GetSendToS(const int video_channel, shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } - if (vie_channel->GetToS((WebRtc_Word32&) DSCP, use_set_sockOpt) != 0) { + if (vie_channel->GetToS(&DSCP, &use_set_sockOpt) != 0) { shared_data_->SetLastError(kViENetworkUnknownError); return -1; } @@ -645,7 +645,7 @@ int ViENetworkImpl::GetSendGQoS(const int video_channel, shared_data_->SetLastError(kViENetworkInvalidChannelId); return -1; } - if (vie_channel->GetSendGQoS(enabled, service_type, overrideDSCP) != 0) { + if (vie_channel->GetSendGQoS(&enabled, &service_type, &overrideDSCP) != 0) { shared_data_->SetLastError(kViENetworkUnknownError); return -1; } diff --git a/src/video_engine/vie_rtp_rtcp_impl.cc b/src/video_engine/vie_rtp_rtcp_impl.cc index 8d2d1ed14..5554734f1 100644 --- a/src/video_engine/vie_rtp_rtcp_impl.cc +++ b/src/video_engine/vie_rtp_rtcp_impl.cc @@ -183,7 +183,7 @@ int ViERTP_RTCPImpl::GetLocalSSRC(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - if (vie_channel->GetLocalSSRC((WebRtc_UWord32&) SSRC) != 0) { + if (vie_channel->GetLocalSSRC(&SSRC) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -204,7 +204,7 @@ int ViERTP_RTCPImpl::GetRemoteSSRC(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - if (vie_channel->GetRemoteSSRC(SSRC) != 0) { + if (vie_channel->GetRemoteSSRC(&SSRC) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -301,7 +301,7 @@ int ViERTP_RTCPImpl::GetRTCPStatus(const int video_channel, return -1; } RTCPMethod module_mode = kRtcpOff; - if (vie_channel->GetRTCPMode(module_mode) != 0) { + if (vie_channel->GetRTCPMode(&module_mode) != 0) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id(), video_channel), "%s: could not get current RTCP mode", __FUNCTION__); @@ -413,7 +413,7 @@ int ViERTP_RTCPImpl::SendApplicationDefinedRTCPPacket( return -1; } RTCPMethod method; - if (vie_channel->GetRTCPMode(method) != 0 || method == kRtcpOff) { + if (vie_channel->GetRTCPMode(&method) != 0 || method == kRtcpOff) { WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id(), video_channel), "%s: RTCP disabled on channel %d.", __FUNCTION__, @@ -631,12 +631,11 @@ int ViERTP_RTCPImpl::GetReceivedRTCPStatistics(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - if (vie_channel->GetReceivedRtcpStatistics( - static_cast(fraction_lost), - static_cast(cumulative_lost), - static_cast(extended_max), - static_cast(jitter), - static_cast(rtt_ms)) != 0) { + if (vie_channel->GetReceivedRtcpStatistics(&fraction_lost, + &cumulative_lost, + &extended_max, + &jitter, + &rtt_ms) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -662,12 +661,9 @@ int ViERTP_RTCPImpl::GetSentRTCPStatistics(const int video_channel, return -1; } - if (vie_channel->GetSendRtcpStatistics( - static_cast(fraction_lost), - static_cast(cumulative_lost), - static_cast(extended_max), - static_cast(jitter), - static_cast(rtt_ms)) != 0) { + if (vie_channel->GetSendRtcpStatistics(&fraction_lost, &cumulative_lost, + &extended_max, &jitter, + &rtt_ms) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -691,11 +687,10 @@ int ViERTP_RTCPImpl::GetRTPStatistics(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - if (vie_channel->GetRtpStatistics( - static_cast(bytes_sent), - static_cast(packets_sent), - static_cast(bytes_received), - static_cast(packets_received)) != 0) { + if (vie_channel->GetRtpStatistics(&bytes_sent, + &packets_sent, + &bytes_received, + &packets_received) != 0) { shared_data_->SetLastError(kViERtpRtcpUnknownError); return -1; } @@ -719,11 +714,10 @@ int ViERTP_RTCPImpl::GetBandwidthUsage(const int video_channel, shared_data_->SetLastError(kViERtpRtcpInvalidChannelId); return -1; } - vie_channel->GetBandwidthUsage( - static_cast(total_bitrate_sent), - static_cast(video_bitrate_sent), - static_cast(fec_bitrate_sent), - static_cast(nackBitrateSent)); + vie_channel->GetBandwidthUsage(&total_bitrate_sent, + &video_bitrate_sent, + &fec_bitrate_sent, + &nackBitrateSent); return 0; }