OLD | NEW |
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 |
11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/api/audio/audio_mixer.h" | 16 #include "webrtc/api/audio/audio_mixer.h" |
17 #include "webrtc/api/call/audio_sink.h" | 17 #include "webrtc/api/call/audio_sink.h" |
18 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/event.h" | 19 #include "webrtc/base/event.h" |
20 #include "webrtc/base/optional.h" | 20 #include "webrtc/base/optional.h" |
21 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" |
| 22 #include "webrtc/call/rtp_transport_controller_receive.h" |
22 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 23 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
23 #include "webrtc/common_types.h" | 24 #include "webrtc/common_types.h" |
24 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" | 25 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" |
25 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 26 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
26 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | 27 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" |
27 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 28 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
28 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 29 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
29 #include "webrtc/modules/audio_processing/rms_level.h" | 30 #include "webrtc/modules/audio_processing/rms_level.h" |
30 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 31 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
31 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 32 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 126 } |
126 | 127 |
127 private: | 128 private: |
128 rtc::CriticalSection lock_; | 129 rtc::CriticalSection lock_; |
129 State state_; | 130 State state_; |
130 }; | 131 }; |
131 | 132 |
132 class Channel | 133 class Channel |
133 : public RtpData, | 134 : public RtpData, |
134 public RtpFeedback, | 135 public RtpFeedback, |
| 136 public RtpPacketSinkInterface, |
135 public FileCallback, // receiving notification from file player & | 137 public FileCallback, // receiving notification from file player & |
136 // recorder | 138 // recorder |
137 public Transport, | 139 public Transport, |
138 public AudioPacketizationCallback, // receive encoded packets from the | 140 public AudioPacketizationCallback, // receive encoded packets from the |
139 // ACM | 141 // ACM |
140 public MixerParticipant, // supplies output mixer with audio frames | 142 public MixerParticipant, // supplies output mixer with audio frames |
141 public OverheadObserver { | 143 public OverheadObserver { |
142 public: | 144 public: |
143 friend class VoERtcpObserver; | 145 friend class VoERtcpObserver; |
144 | 146 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 int max_frame_length_ms); | 208 int max_frame_length_ms); |
207 | 209 |
208 // VoENetwork | 210 // VoENetwork |
209 int32_t RegisterExternalTransport(Transport* transport); | 211 int32_t RegisterExternalTransport(Transport* transport); |
210 int32_t DeRegisterExternalTransport(); | 212 int32_t DeRegisterExternalTransport(); |
211 int32_t ReceivedRTPPacket(const uint8_t* received_packet, | 213 int32_t ReceivedRTPPacket(const uint8_t* received_packet, |
212 size_t length, | 214 size_t length, |
213 const PacketTime& packet_time); | 215 const PacketTime& packet_time); |
214 // TODO(nisse, solenberg): Delete when VoENetwork is deleted. | 216 // TODO(nisse, solenberg): Delete when VoENetwork is deleted. |
215 int32_t ReceivedRTCPPacket(const uint8_t* data, size_t length); | 217 int32_t ReceivedRTCPPacket(const uint8_t* data, size_t length); |
216 void OnRtpPacket(const RtpPacketReceived& packet); | 218 |
| 219 // RtpPacketSinkInterface implementation. |
| 220 void OnRtpPacket(const RtpPacketReceived& packet) override; |
217 | 221 |
218 // VoEFile | 222 // VoEFile |
219 int StartPlayingFileLocally(const char* fileName, | 223 int StartPlayingFileLocally(const char* fileName, |
220 bool loop, | 224 bool loop, |
221 FileFormats format, | 225 FileFormats format, |
222 int startPosition, | 226 int startPosition, |
223 float volumeScaling, | 227 float volumeScaling, |
224 int stopPosition, | 228 int stopPosition, |
225 const CodecInst* codecInst); | 229 const CodecInst* codecInst); |
226 int StartPlayingFileLocally(InStream* stream, | 230 int StartPlayingFileLocally(InStream* stream, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 275 |
272 // DTMF. | 276 // DTMF. |
273 int SendTelephoneEventOutband(int event, int duration_ms); | 277 int SendTelephoneEventOutband(int event, int duration_ms); |
274 int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency); | 278 int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency); |
275 | 279 |
276 // VoERTP_RTCP | 280 // VoERTP_RTCP |
277 int SetLocalSSRC(unsigned int ssrc); | 281 int SetLocalSSRC(unsigned int ssrc); |
278 int GetLocalSSRC(unsigned int& ssrc); | 282 int GetLocalSSRC(unsigned int& ssrc); |
279 int GetRemoteSSRC(unsigned int& ssrc); | 283 int GetRemoteSSRC(unsigned int& ssrc); |
280 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); | 284 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); |
281 int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); | |
282 void EnableSendTransportSequenceNumber(int id); | 285 void EnableSendTransportSequenceNumber(int id); |
283 void EnableReceiveTransportSequenceNumber(int id); | |
284 | 286 |
285 void RegisterSenderCongestionControlObjects( | 287 void RegisterSenderCongestionControlObjects( |
286 RtpTransportControllerSendInterface* transport, | 288 RtpTransportControllerSendInterface* transport, |
287 RtcpBandwidthObserver* bandwidth_observer); | 289 RtcpBandwidthObserver* bandwidth_observer); |
288 void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); | 290 void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); |
289 void ResetSenderCongestionControlObjects(); | 291 void ResetSenderCongestionControlObjects(); |
290 void ResetReceiverCongestionControlObjects(); | 292 void ResetReceiverCongestionControlObjects(); |
291 void SetRTCPStatus(bool enable); | 293 void SetRTCPStatus(bool enable); |
292 int GetRTCPStatus(bool& enabled); | 294 int GetRTCPStatus(bool& enabled); |
293 int SetRTCP_CNAME(const char cName[256]); | 295 int SetRTCP_CNAME(const char cName[256]); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 546 |
545 const bool use_twcc_plr_for_ana_; | 547 const bool use_twcc_plr_for_ana_; |
546 | 548 |
547 rtc::TaskQueue* encoder_queue_ = nullptr; | 549 rtc::TaskQueue* encoder_queue_ = nullptr; |
548 }; | 550 }; |
549 | 551 |
550 } // namespace voe | 552 } // namespace voe |
551 } // namespace webrtc | 553 } // namespace webrtc |
552 | 554 |
553 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 555 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |