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/optional.h" | 19 #include "webrtc/base/optional.h" |
| 20 #include "webrtc/call/rtp_transport_controller_receive.h" |
20 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 21 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
21 #include "webrtc/common_types.h" | 22 #include "webrtc/common_types.h" |
22 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" | 23 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" |
23 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 24 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
24 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 25 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
25 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 26 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
26 #include "webrtc/modules/audio_processing/rms_level.h" | 27 #include "webrtc/modules/audio_processing/rms_level.h" |
27 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 28 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
28 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 29 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 30 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 122 } |
122 | 123 |
123 private: | 124 private: |
124 rtc::CriticalSection lock_; | 125 rtc::CriticalSection lock_; |
125 State state_; | 126 State state_; |
126 }; | 127 }; |
127 | 128 |
128 class Channel | 129 class Channel |
129 : public RtpData, | 130 : public RtpData, |
130 public RtpFeedback, | 131 public RtpFeedback, |
| 132 public RtpPacketSinkInterface, |
131 public FileCallback, // receiving notification from file player & | 133 public FileCallback, // receiving notification from file player & |
132 // recorder | 134 // recorder |
133 public Transport, | 135 public Transport, |
134 public AudioPacketizationCallback, // receive encoded packets from the | 136 public AudioPacketizationCallback, // receive encoded packets from the |
135 // ACM | 137 // ACM |
136 public MixerParticipant, // supplies output mixer with audio frames | 138 public MixerParticipant, // supplies output mixer with audio frames |
137 public OverheadObserver { | 139 public OverheadObserver { |
138 public: | 140 public: |
139 friend class VoERtcpObserver; | 141 friend class VoERtcpObserver; |
140 | 142 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 int max_frame_length_ms); | 198 int max_frame_length_ms); |
197 | 199 |
198 // VoENetwork | 200 // VoENetwork |
199 int32_t RegisterExternalTransport(Transport* transport); | 201 int32_t RegisterExternalTransport(Transport* transport); |
200 int32_t DeRegisterExternalTransport(); | 202 int32_t DeRegisterExternalTransport(); |
201 int32_t ReceivedRTPPacket(const uint8_t* received_packet, | 203 int32_t ReceivedRTPPacket(const uint8_t* received_packet, |
202 size_t length, | 204 size_t length, |
203 const PacketTime& packet_time); | 205 const PacketTime& packet_time); |
204 // TODO(nisse, solenberg): Delete when VoENetwork is deleted. | 206 // TODO(nisse, solenberg): Delete when VoENetwork is deleted. |
205 int32_t ReceivedRTCPPacket(const uint8_t* data, size_t length); | 207 int32_t ReceivedRTCPPacket(const uint8_t* data, size_t length); |
206 void OnRtpPacket(const RtpPacketReceived& packet); | 208 |
| 209 // RtpPacketSinkInterface implementation. |
| 210 void OnRtpPacket(const RtpPacketReceived& packet) override; |
207 | 211 |
208 // VoEFile | 212 // VoEFile |
209 int StartPlayingFileLocally(const char* fileName, | 213 int StartPlayingFileLocally(const char* fileName, |
210 bool loop, | 214 bool loop, |
211 FileFormats format, | 215 FileFormats format, |
212 int startPosition, | 216 int startPosition, |
213 float volumeScaling, | 217 float volumeScaling, |
214 int stopPosition, | 218 int stopPosition, |
215 const CodecInst* codecInst); | 219 const CodecInst* codecInst); |
216 int StartPlayingFileLocally(InStream* stream, | 220 int StartPlayingFileLocally(InStream* stream, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 265 |
262 // DTMF. | 266 // DTMF. |
263 int SendTelephoneEventOutband(int event, int duration_ms); | 267 int SendTelephoneEventOutband(int event, int duration_ms); |
264 int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency); | 268 int SetSendTelephoneEventPayloadType(int payload_type, int payload_frequency); |
265 | 269 |
266 // VoERTP_RTCP | 270 // VoERTP_RTCP |
267 int SetLocalSSRC(unsigned int ssrc); | 271 int SetLocalSSRC(unsigned int ssrc); |
268 int GetLocalSSRC(unsigned int& ssrc); | 272 int GetLocalSSRC(unsigned int& ssrc); |
269 int GetRemoteSSRC(unsigned int& ssrc); | 273 int GetRemoteSSRC(unsigned int& ssrc); |
270 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); | 274 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); |
271 int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); | |
272 void EnableSendTransportSequenceNumber(int id); | 275 void EnableSendTransportSequenceNumber(int id); |
273 void EnableReceiveTransportSequenceNumber(int id); | |
274 | 276 |
275 void RegisterSenderCongestionControlObjects( | 277 void RegisterSenderCongestionControlObjects( |
276 RtpPacketSender* rtp_packet_sender, | 278 RtpPacketSender* rtp_packet_sender, |
277 TransportFeedbackObserver* transport_feedback_observer, | 279 TransportFeedbackObserver* transport_feedback_observer, |
278 PacketRouter* packet_router, | 280 PacketRouter* packet_router, |
279 RtcpBandwidthObserver* bandwidth_observer); | 281 RtcpBandwidthObserver* bandwidth_observer); |
280 void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); | 282 void RegisterReceiverCongestionControlObjects(PacketRouter* packet_router); |
281 void ResetCongestionControlObjects(); | 283 void ResetCongestionControlObjects(); |
282 | 284 |
283 void SetRTCPStatus(bool enable); | 285 void SetRTCPStatus(bool enable); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 505 std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
504 | 506 |
505 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. | 507 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. |
506 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 508 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
507 }; | 509 }; |
508 | 510 |
509 } // namespace voe | 511 } // namespace voe |
510 } // namespace webrtc | 512 } // namespace webrtc |
511 | 513 |
512 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 514 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |