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

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

Issue 2455013003: Clean up abs-send-time for audio. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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/voe_rtp_rtcp_impl.h ('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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (!_shared->statistics().Initialized()) { 134 if (!_shared->statistics().Initialized()) {
135 _shared->SetLastError(VE_NOT_INITED, kTraceError); 135 _shared->SetLastError(VE_NOT_INITED, kTraceError);
136 return -1; 136 return -1;
137 } 137 }
138 if (enable && (id < kVoiceEngineMinRtpExtensionId || 138 if (enable && (id < kVoiceEngineMinRtpExtensionId ||
139 id > kVoiceEngineMaxRtpExtensionId)) { 139 id > kVoiceEngineMaxRtpExtensionId)) {
140 // [RFC5285] The 4-bit id is the local identifier of this element in 140 // [RFC5285] The 4-bit id is the local identifier of this element in
141 // the range 1-14 inclusive. 141 // the range 1-14 inclusive.
142 _shared->SetLastError( 142 _shared->SetLastError(
143 VE_INVALID_ARGUMENT, kTraceError, 143 VE_INVALID_ARGUMENT, kTraceError,
144 "SetReceiveAbsoluteSenderTimeStatus() invalid id parameter"); 144 "SetReceiveAudioLevelIndicationStatus() invalid id parameter");
145 return -1; 145 return -1;
146 } 146 }
147 // Set state and id for the specified channel. 147 // Set state and id for the specified channel.
148 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 148 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
149 voe::Channel* channel_ptr = ch.channel(); 149 voe::Channel* channel_ptr = ch.channel();
150 if (channel_ptr == NULL) { 150 if (channel_ptr == NULL) {
151 _shared->SetLastError( 151 _shared->SetLastError(
152 VE_CHANNEL_NOT_VALID, kTraceError, 152 VE_CHANNEL_NOT_VALID, kTraceError,
153 "SetReceiveAudioLevelIndicationStatus() failed to locate channel"); 153 "SetReceiveAudioLevelIndicationStatus() failed to locate channel");
154 return -1; 154 return -1;
155 } 155 }
156 return channel_ptr->SetReceiveAudioLevelIndicationStatus(enable, id); 156 return channel_ptr->SetReceiveAudioLevelIndicationStatus(enable, id);
157 } 157 }
158 158
159 int VoERTP_RTCPImpl::SetSendAbsoluteSenderTimeStatus(int channel,
160 bool enable,
161 unsigned char id) {
162 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
163 "SetSendAbsoluteSenderTimeStatus(channel=%d, enable=%d, id=%u)",
164 channel, enable, id);
165 if (!_shared->statistics().Initialized()) {
166 _shared->SetLastError(VE_NOT_INITED, kTraceError);
167 return -1;
168 }
169 if (enable && (id < kVoiceEngineMinRtpExtensionId ||
170 id > kVoiceEngineMaxRtpExtensionId)) {
171 // [RFC5285] The 4-bit id is the local identifier of this element in
172 // the range 1-14 inclusive.
173 _shared->SetLastError(
174 VE_INVALID_ARGUMENT, kTraceError,
175 "SetSendAbsoluteSenderTimeStatus() invalid id parameter");
176 return -1;
177 }
178 // Set state and id for the specified channel.
179 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
180 voe::Channel* channelPtr = ch.channel();
181 if (channelPtr == NULL) {
182 _shared->SetLastError(
183 VE_CHANNEL_NOT_VALID, kTraceError,
184 "SetSendAbsoluteSenderTimeStatus() failed to locate channel");
185 return -1;
186 }
187 return channelPtr->SetSendAbsoluteSenderTimeStatus(enable, id);
188 }
189
190 int VoERTP_RTCPImpl::SetReceiveAbsoluteSenderTimeStatus(int channel,
191 bool enable,
192 unsigned char id) {
193 WEBRTC_TRACE(
194 kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
195 "SetReceiveAbsoluteSenderTimeStatus(channel=%d, enable=%d, id=%u)",
196 channel, enable, id);
197 if (!_shared->statistics().Initialized()) {
198 _shared->SetLastError(VE_NOT_INITED, kTraceError);
199 return -1;
200 }
201 if (enable && (id < kVoiceEngineMinRtpExtensionId ||
202 id > kVoiceEngineMaxRtpExtensionId)) {
203 // [RFC5285] The 4-bit id is the local identifier of this element in
204 // the range 1-14 inclusive.
205 _shared->SetLastError(
206 VE_INVALID_ARGUMENT, kTraceError,
207 "SetReceiveAbsoluteSenderTimeStatus() invalid id parameter");
208 return -1;
209 }
210 // Set state and id for the specified channel.
211 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
212 voe::Channel* channelPtr = ch.channel();
213 if (channelPtr == NULL) {
214 _shared->SetLastError(
215 VE_CHANNEL_NOT_VALID, kTraceError,
216 "SetReceiveAbsoluteSenderTimeStatus() failed to locate channel");
217 return -1;
218 }
219 return channelPtr->SetReceiveAbsoluteSenderTimeStatus(enable, id);
220 }
221
222 int VoERTP_RTCPImpl::SetRTCPStatus(int channel, bool enable) { 159 int VoERTP_RTCPImpl::SetRTCPStatus(int channel, bool enable) {
223 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), 160 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
224 "SetRTCPStatus(channel=%d, enable=%d)", channel, enable); 161 "SetRTCPStatus(channel=%d, enable=%d)", channel, enable);
225 if (!_shared->statistics().Initialized()) { 162 if (!_shared->statistics().Initialized()) {
226 _shared->SetLastError(VE_NOT_INITED, kTraceError); 163 _shared->SetLastError(VE_NOT_INITED, kTraceError);
227 return -1; 164 return -1;
228 } 165 }
229 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 166 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
230 voe::Channel* channelPtr = ch.channel(); 167 voe::Channel* channelPtr = ch.channel();
231 if (channelPtr == NULL) { 168 if (channelPtr == NULL) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 "SetNACKStatus() failed to locate channel"); 308 "SetNACKStatus() failed to locate channel");
372 return -1; 309 return -1;
373 } 310 }
374 channelPtr->SetNACKStatus(enable, maxNoPackets); 311 channelPtr->SetNACKStatus(enable, maxNoPackets);
375 return 0; 312 return 0;
376 } 313 }
377 314
378 #endif // #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API 315 #endif // #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
379 316
380 } // namespace webrtc 317 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/voe_rtp_rtcp_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698