From 39e9659fc6a70f9416205c942d21deea060a8997 Mon Sep 17 00:00:00 2001 From: "leozwang@webrtc.org" Date: Thu, 1 Mar 2012 18:22:48 +0000 Subject: [PATCH] Correct wrong usage of WebRtc_Word8 in video enigne BUG=http://code.google.com/p/webrtc/issues/detail?id=311&sort=-id TEST=build on all platforms Review URL: https://webrtc-codereview.appspot.com/428002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1815 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/video_engine/vie_channel.cc | 26 +++++++++++++------------- src/video_engine/vie_channel.h | 22 +++++++++++----------- src/video_engine/vie_file_impl.cc | 3 +-- src/video_engine/vie_file_player.h | 6 +++--- src/video_engine/vie_receiver.cc | 6 +++--- src/video_engine/vie_receiver.h | 6 +++--- src/video_engine/vie_sync_module.cc | 6 +++--- src/video_engine/vie_sync_module.h | 4 ++-- 8 files changed, 39 insertions(+), 40 deletions(-) diff --git a/src/video_engine/vie_channel.cc b/src/video_engine/vie_channel.cc index e6f7a0adfc..be1bc6d677 100644 --- a/src/video_engine/vie_channel.cc +++ b/src/video_engine/vie_channel.cc @@ -799,7 +799,7 @@ WebRtc_Word32 ViEChannel::SetStartSequenceNumber( return rtp_rtcp_.SetSequenceNumber(sequence_number); } -WebRtc_Word32 ViEChannel::SetRTCPCName(const WebRtc_Word8 rtcp_cname[]) { +WebRtc_Word32 ViEChannel::SetRTCPCName(const char rtcp_cname[]) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); if (rtp_rtcp_.Sending()) { @@ -810,13 +810,13 @@ WebRtc_Word32 ViEChannel::SetRTCPCName(const WebRtc_Word8 rtcp_cname[]) { return rtp_rtcp_.SetCNAME(rtcp_cname); } -WebRtc_Word32 ViEChannel::GetRTCPCName(WebRtc_Word8 rtcp_cname[]) { +WebRtc_Word32 ViEChannel::GetRTCPCName(char rtcp_cname[]) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); return rtp_rtcp_.CNAME(rtcp_cname); } -WebRtc_Word32 ViEChannel::GetRemoteRTCPCName(WebRtc_Word8 rtcp_cname[]) { +WebRtc_Word32 ViEChannel::GetRemoteRTCPCName(char rtcp_cname[]) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1165,7 +1165,7 @@ WebRtc_Word32 ViEChannel::StopRTPDump(RTPDirections direction) { WebRtc_Word32 ViEChannel::SetLocalReceiver(const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, - const WebRtc_Word8* ip_address) { + const char* ip_address) { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1185,7 +1185,7 @@ WebRtc_Word32 ViEChannel::SetLocalReceiver(const WebRtc_UWord16 rtp_port, return -1; } - const WebRtc_Word8* multicast_ip_address = NULL; + const char* multicast_ip_address = NULL; if (socket_transport_.InitializeReceiveSockets(&vie_receiver_, rtp_port, ip_address, multicast_ip_address, @@ -1206,7 +1206,7 @@ WebRtc_Word32 ViEChannel::SetLocalReceiver(const WebRtc_UWord16 rtp_port, WebRtc_Word32 ViEChannel::GetLocalReceiver(WebRtc_UWord16& rtp_port, WebRtc_UWord16& rtcp_port, - WebRtc_Word8* ip_address) const { + char* ip_address) const { WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1226,7 +1226,7 @@ WebRtc_Word32 ViEChannel::GetLocalReceiver(WebRtc_UWord16& rtp_port, return -1; } - WebRtc_Word8 multicast_ip_address[UdpTransport::kIpAddressVersion6Length]; + char multicast_ip_address[UdpTransport::kIpAddressVersion6Length]; if (socket_transport_.ReceiveSocketInformation(ip_address, rtp_port, rtcp_port, multicast_ip_address) != 0) { @@ -1245,7 +1245,7 @@ WebRtc_Word32 ViEChannel::GetLocalReceiver(WebRtc_UWord16& rtp_port, } WebRtc_Word32 ViEChannel::SetSendDestination( - const WebRtc_Word8* ip_address, + const char* ip_address, const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, const WebRtc_UWord16 source_rtp_port, @@ -1364,7 +1364,7 @@ WebRtc_Word32 ViEChannel::SetSendDestination( } WebRtc_Word32 ViEChannel::GetSendDestination( - WebRtc_Word8* ip_address, + char* ip_address, WebRtc_UWord16& rtp_port, WebRtc_UWord16& rtcp_port, WebRtc_UWord16& source_rtp_port, @@ -1576,7 +1576,7 @@ bool ViEChannel::Receiving() { WebRtc_Word32 ViEChannel::GetSourceInfo(WebRtc_UWord16& rtp_port, WebRtc_UWord16& rtcp_port, - WebRtc_Word8* ip_address, + char* ip_address, WebRtc_UWord32 ip_address_length) { { CriticalSectionScoped cs(callback_cs_.get()); @@ -1748,7 +1748,7 @@ bool ViEChannel::IsIPv6Enabled() { WebRtc_Word32 ViEChannel::SetSourceFilter(const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, - const WebRtc_Word8* ip_address) { + const char* ip_address) { callback_cs_->Enter(); WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -1780,7 +1780,7 @@ WebRtc_Word32 ViEChannel::SetSourceFilter(const WebRtc_UWord16 rtp_port, WebRtc_Word32 ViEChannel::GetSourceFilter(WebRtc_UWord16& rtp_port, WebRtc_UWord16& rtcp_port, - WebRtc_Word8* ip_address) const { + char* ip_address) const { callback_cs_->Enter(); WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s", __FUNCTION__); @@ -2415,7 +2415,7 @@ void ViEChannel::OnApplicationDataReceived(const WebRtc_Word32 id, WebRtc_Word32 ViEChannel::OnInitializeDecoder( const WebRtc_Word32 id, const WebRtc_Word8 payload_type, - const WebRtc_Word8 payload_name[RTP_PAYLOAD_NAME_SIZE], + const char payload_name[RTP_PAYLOAD_NAME_SIZE], const int frequency, const WebRtc_UWord8 channels, const WebRtc_UWord32 rate) { diff --git a/src/video_engine/vie_channel.h b/src/video_engine/vie_channel.h index dac268f5f9..2d9bcd257c 100644 --- a/src/video_engine/vie_channel.h +++ b/src/video_engine/vie_channel.h @@ -124,13 +124,13 @@ class ViEChannel WebRtc_Word32 SetStartSequenceNumber(WebRtc_UWord16 sequence_number); // Sets the CName for the outgoing stream on the channel. - WebRtc_Word32 SetRTCPCName(const WebRtc_Word8 rtcp_cname[]); + WebRtc_Word32 SetRTCPCName(const char rtcp_cname[]); // Gets the CName for the outgoing stream on the channel. - WebRtc_Word32 GetRTCPCName(WebRtc_Word8 rtcp_cname[]); + WebRtc_Word32 GetRTCPCName(char rtcp_cname[]); // Gets the CName of the incoming stream. - WebRtc_Word32 GetRemoteRTCPCName(WebRtc_Word8 rtcp_cname[]); + WebRtc_Word32 GetRemoteRTCPCName(char rtcp_cname[]); WebRtc_Word32 RegisterRtpObserver(ViERTPObserver* observer); WebRtc_Word32 RegisterRtcpObserver(ViERTCPObserver* observer); WebRtc_Word32 SendApplicationDefinedRTCPPacket( @@ -186,7 +186,7 @@ class ViEChannel virtual WebRtc_Word32 OnInitializeDecoder( const WebRtc_Word32 id, const WebRtc_Word8 payload_type, - const WebRtc_Word8 payload_name[RTP_PAYLOAD_NAME_SIZE], + const char payload_name[RTP_PAYLOAD_NAME_SIZE], const int frequency, const WebRtc_UWord8 channels, const WebRtc_UWord32 rate); @@ -203,23 +203,23 @@ class ViEChannel WebRtc_Word32 SetLocalReceiver(const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, - const WebRtc_Word8* ip_address); + const char* ip_address); WebRtc_Word32 GetLocalReceiver(WebRtc_UWord16& rtp_port, WebRtc_UWord16& rtcp_port, - WebRtc_Word8* ip_address) const; - WebRtc_Word32 SetSendDestination(const WebRtc_Word8* ip_address, + char* ip_address) const; + WebRtc_Word32 SetSendDestination(const char* ip_address, const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, const WebRtc_UWord16 source_rtp_port, const WebRtc_UWord16 source_rtcp_port); - WebRtc_Word32 GetSendDestination(WebRtc_Word8* ip_address, + 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_Word8* ip_address, + char* ip_address, WebRtc_UWord32 ip_address_length); WebRtc_Word32 SetRemoteSSRCType(const StreamType usage, @@ -247,10 +247,10 @@ class ViEChannel bool IsIPv6Enabled(); WebRtc_Word32 SetSourceFilter(const WebRtc_UWord16 rtp_port, const WebRtc_UWord16 rtcp_port, - const WebRtc_Word8* ip_address); + const char* ip_address); WebRtc_Word32 GetSourceFilter(WebRtc_UWord16& rtp_port, WebRtc_UWord16& rtcp_port, - WebRtc_Word8* ip_address) const; + 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; diff --git a/src/video_engine/vie_file_impl.cc b/src/video_engine/vie_file_impl.cc index 28f98544a1..10d703c392 100644 --- a/src/video_engine/vie_file_impl.cc +++ b/src/video_engine/vie_file_impl.cc @@ -542,8 +542,7 @@ int ViEFileImpl::GetFileInformation(const char* file_name, const FileFormats file_format) { return ViEFilePlayer::GetFileInformation( shared_data_->instance_id(), - static_cast(file_name), - video_codec, audio_codec, file_format); + file_name, video_codec, audio_codec, file_format); } int ViEFileImpl::GetRenderSnapshot(const int video_channel, diff --git a/src/video_engine/vie_file_player.h b/src/video_engine/vie_file_player.h index 640b37c400..ef86601b9c 100644 --- a/src/video_engine/vie_file_player.h +++ b/src/video_engine/vie_file_player.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -66,7 +66,7 @@ class ViEFilePlayer protected: ViEFilePlayer(int Id, int engine_id, ViEInputManager& input_manager); - int Init(const WebRtc_Word8* file_nameUTF8, + int Init(const char* file_nameUTF8, const bool loop, const FileFormats file_format, VoiceEngine* voe_ptr); @@ -113,7 +113,7 @@ class ViEFilePlayer int local_audio_channel_; ViEFileObserver* observer_; - WebRtc_Word8 file_name_[FileWrapper::kMaxFileNameSize]; + char file_name_[FileWrapper::kMaxFileNameSize]; // VoE Interface. VoEFile* voe_file_interface_; diff --git a/src/video_engine/vie_receiver.cc b/src/video_engine/vie_receiver.cc index af0dc758a1..053efde243 100644 --- a/src/video_engine/vie_receiver.cc +++ b/src/video_engine/vie_receiver.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -80,14 +80,14 @@ void ViEReceiver::RegisterSimulcastRtpRtcpModules( void ViEReceiver::IncomingRTPPacket(const WebRtc_Word8* rtp_packet, const WebRtc_Word32 rtp_packet_length, - const WebRtc_Word8* from_ip, + const char* from_ip, const WebRtc_UWord16 from_port) { InsertRTPPacket(rtp_packet, rtp_packet_length); } void ViEReceiver::IncomingRTCPPacket(const WebRtc_Word8* rtcp_packet, const WebRtc_Word32 rtcp_packet_length, - const WebRtc_Word8* from_ip, + const char* from_ip, const WebRtc_UWord16 from_port) { InsertRTCPPacket(rtcp_packet, rtcp_packet_length); } diff --git a/src/video_engine/vie_receiver.h b/src/video_engine/vie_receiver.h index a99d388356..b6633ca610 100644 --- a/src/video_engine/vie_receiver.h +++ b/src/video_engine/vie_receiver.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -48,11 +48,11 @@ class ViEReceiver : public UdpTransportData, public RtpData { // Implements UdpTransportData. virtual void IncomingRTPPacket(const WebRtc_Word8* rtp_packet, const WebRtc_Word32 rtp_packet_length, - const WebRtc_Word8* from_ip, + const char* from_ip, const WebRtc_UWord16 from_port); virtual void IncomingRTCPPacket(const WebRtc_Word8* rtcp_packet, const WebRtc_Word32 rtcp_packet_length, - const WebRtc_Word8* from_ip, + const char* from_ip, const WebRtc_UWord16 from_port); // Receives packets from external transport. diff --git a/src/video_engine/vie_sync_module.cc b/src/video_engine/vie_sync_module.cc index d9b60acb75..ea1c558396 100644 --- a/src/video_engine/vie_sync_module.cc +++ b/src/video_engine/vie_sync_module.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -65,7 +65,7 @@ void ViESyncModule::SetNetworkDelay(int network_delay) { channel_delay_.network_delay = network_delay; } -WebRtc_Word32 ViESyncModule::Version(WebRtc_Word8* version, +WebRtc_Word32 ViESyncModule::Version(char* version, WebRtc_UWord32& remaining_buffer_in_bytes, WebRtc_UWord32& position) const { if (version == NULL) { @@ -73,7 +73,7 @@ WebRtc_Word32 ViESyncModule::Version(WebRtc_Word8* version, "Invalid in argument to ViESyncModule Version()"); return -1; } - WebRtc_Word8 our_version[] = "ViESyncModule 1.1.0"; + char our_version[] = "ViESyncModule 1.1.0"; WebRtc_UWord32 our_length = (WebRtc_UWord32) strlen(our_version); if (remaining_buffer_in_bytes < our_length + 1) { return -1; diff --git a/src/video_engine/vie_sync_module.h b/src/video_engine/vie_sync_module.h index 01373a9f87..8dd4f86027 100644 --- a/src/video_engine/vie_sync_module.h +++ b/src/video_engine/vie_sync_module.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -38,7 +38,7 @@ class ViESyncModule : public Module { void SetNetworkDelay(int network_delay); // Implements Module. - virtual WebRtc_Word32 Version(WebRtc_Word8* version, + virtual WebRtc_Word32 Version(char* version, WebRtc_UWord32& remaining_buffer_in_bytes, WebRtc_UWord32& position) const; virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);