Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: webrtc/voice_engine/voe_network_impl.cc

Issue 1909333002: Switch voice transport to use Call and Stream instead of VoENetwork. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed coments on ps#6 Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/voice_engine/channel_proxy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 int VoENetworkImpl::RegisterExternalTransport(int channel, 37 int VoENetworkImpl::RegisterExternalTransport(int channel,
38 Transport& transport) { 38 Transport& transport) {
39 RTC_DCHECK(_shared->statistics().Initialized()); 39 RTC_DCHECK(_shared->statistics().Initialized());
40 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 40 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
41 voe::Channel* channelPtr = ch.channel(); 41 voe::Channel* channelPtr = ch.channel();
42 if (!channelPtr) { 42 if (!channelPtr) {
43 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel; 43 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel;
44 return -1; 44 return -1;
45 } 45 }
46 return channelPtr->RegisterExternalTransport(transport); 46 return channelPtr->RegisterExternalTransport(&transport);
47 } 47 }
48 48
49 int VoENetworkImpl::DeRegisterExternalTransport(int channel) { 49 int VoENetworkImpl::DeRegisterExternalTransport(int channel) {
50 RTC_CHECK(_shared->statistics().Initialized()); 50 RTC_CHECK(_shared->statistics().Initialized());
51 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 51 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
52 voe::Channel* channelPtr = ch.channel(); 52 voe::Channel* channelPtr = ch.channel();
53 if (!channelPtr) { 53 if (!channelPtr) {
54 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel; 54 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel;
55 return -1; 55 return -1;
56 } 56 }
(...skipping 20 matching lines...) Expand all
77 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 77 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
78 voe::Channel* channelPtr = ch.channel(); 78 voe::Channel* channelPtr = ch.channel();
79 if (!channelPtr) { 79 if (!channelPtr) {
80 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel; 80 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel;
81 return -1; 81 return -1;
82 } 82 }
83 if (!channelPtr->ExternalTransport()) { 83 if (!channelPtr->ExternalTransport()) {
84 LOG_F(LS_ERROR) << "No external transport for channel: " << channel; 84 LOG_F(LS_ERROR) << "No external transport for channel: " << channel;
85 return -1; 85 return -1;
86 } 86 }
87 return channelPtr->ReceivedRTPPacket((const int8_t*)data, length, 87 return channelPtr->ReceivedRTPPacket(static_cast<const uint8_t*>(data),
88 packet_time); 88 length, packet_time);
89 } 89 }
90 90
91 int VoENetworkImpl::ReceivedRTCPPacket(int channel, 91 int VoENetworkImpl::ReceivedRTCPPacket(int channel,
92 const void* data, 92 const void* data,
93 size_t length) { 93 size_t length) {
94 RTC_CHECK(_shared->statistics().Initialized()); 94 RTC_CHECK(_shared->statistics().Initialized());
95 RTC_CHECK(data); 95 RTC_CHECK(data);
96 if (length < 4) { 96 if (length < 4) {
97 LOG_F(LS_ERROR) << "Invalid packet length: " << length; 97 LOG_F(LS_ERROR) << "Invalid packet length: " << length;
98 return -1; 98 return -1;
99 } 99 }
100 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 100 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
101 voe::Channel* channelPtr = ch.channel(); 101 voe::Channel* channelPtr = ch.channel();
102 if (!channelPtr) { 102 if (!channelPtr) {
103 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel; 103 LOG_F(LS_ERROR) << "Failed to locate channel: " << channel;
104 return -1; 104 return -1;
105 } 105 }
106 if (!channelPtr->ExternalTransport()) { 106 if (!channelPtr->ExternalTransport()) {
107 LOG_F(LS_ERROR) << "No external transport for channel: " << channel; 107 LOG_F(LS_ERROR) << "No external transport for channel: " << channel;
108 return -1; 108 return -1;
109 } 109 }
110 return channelPtr->ReceivedRTCPPacket((const int8_t*)data, length); 110 return channelPtr->ReceivedRTCPPacket(static_cast<const uint8_t*>(data),
111 length);
111 } 112 }
112 113
113 } // namespace webrtc 114 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698