| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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_PROXY_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| 13 | 13 |
| 14 #include "webrtc/api/audio/audio_mixer.h" | 14 #include "webrtc/api/audio/audio_mixer.h" |
| 15 #include "webrtc/base/constructormagic.h" | 15 #include "webrtc/base/constructormagic.h" |
| 16 #include "webrtc/base/race_checker.h" | 16 #include "webrtc/base/race_checker.h" |
| 17 #include "webrtc/base/thread_checker.h" | 17 #include "webrtc/base/thread_checker.h" |
| 18 #include "webrtc/voice_engine/channel_manager.h" | 18 #include "webrtc/voice_engine/channel_manager.h" |
| 19 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 19 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 20 | 20 |
| 21 #include <memory> | 21 #include <memory> |
| 22 #include <string> | 22 #include <string> |
| 23 #include <vector> | 23 #include <vector> |
| 24 | 24 |
| 25 namespace webrtc { | 25 namespace webrtc { |
| 26 | 26 |
| 27 struct SentTransportPacketRecord; |
| 28 |
| 27 class AudioSinkInterface; | 29 class AudioSinkInterface; |
| 28 class PacketRouter; | 30 class PacketRouter; |
| 29 class RtcEventLog; | 31 class RtcEventLog; |
| 30 class RtcpBandwidthObserver; | 32 class RtcpBandwidthObserver; |
| 31 class RtcpRttStats; | 33 class RtcpRttStats; |
| 32 class RtpPacketSender; | 34 class RtpPacketSender; |
| 33 class RtpPacketReceived; | 35 class RtpPacketReceived; |
| 34 class RtpReceiver; | 36 class RtpReceiver; |
| 35 class RtpRtcp; | 37 class RtpRtcp; |
| 36 class Transport; | 38 class Transport; |
| 37 class TransportFeedbackObserver; | 39 class TransportFeedbackObserver; |
| 38 | 40 |
| 41 namespace rtcp { |
| 42 class TransportFeedback; |
| 43 } // namespace rtcp |
| 44 |
| 39 namespace voe { | 45 namespace voe { |
| 40 | 46 |
| 41 class Channel; | 47 class Channel; |
| 42 | 48 |
| 43 // This class provides the "view" of a voe::Channel that we need to implement | 49 // This class provides the "view" of a voe::Channel that we need to implement |
| 44 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two | 50 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two |
| 45 // purposes: | 51 // purposes: |
| 46 // 1. Allow mocking just the interfaces used, instead of the entire | 52 // 1. Allow mocking just the interfaces used, instead of the entire |
| 47 // voe::Channel class. | 53 // voe::Channel class. |
| 48 // 2. Provide a refined interface for the stream classes, including assumptions | 54 // 2. Provide a refined interface for the stream classes, including assumptions |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 virtual void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats); | 116 virtual void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats); |
| 111 virtual bool GetRecCodec(CodecInst* codec_inst) const; | 117 virtual bool GetRecCodec(CodecInst* codec_inst) const; |
| 112 virtual bool GetSendCodec(CodecInst* codec_inst) const; | 118 virtual bool GetSendCodec(CodecInst* codec_inst) const; |
| 113 virtual bool SetVADStatus(bool enable); | 119 virtual bool SetVADStatus(bool enable); |
| 114 virtual bool SetCodecFECStatus(bool enable); | 120 virtual bool SetCodecFECStatus(bool enable); |
| 115 virtual bool SetOpusDtx(bool enable); | 121 virtual bool SetOpusDtx(bool enable); |
| 116 virtual bool SetOpusMaxPlaybackRate(int frequency_hz); | 122 virtual bool SetOpusMaxPlaybackRate(int frequency_hz); |
| 117 virtual bool SetSendCodec(const CodecInst& codec_inst); | 123 virtual bool SetSendCodec(const CodecInst& codec_inst); |
| 118 virtual bool SetSendCNPayloadType(int type, PayloadFrequencies frequency); | 124 virtual bool SetSendCNPayloadType(int type, PayloadFrequencies frequency); |
| 119 | 125 |
| 126 void HandleTransportFeedback(const std::vector<SentTransportPacketRecord>& |
| 127 packets_sent_since_last_feedback, |
| 128 const rtcp::TransportFeedback& feedback); |
| 129 |
| 120 private: | 130 private: |
| 121 Channel* channel() const; | 131 Channel* channel() const; |
| 122 | 132 |
| 123 // Thread checkers document and lock usage of some methods on voe::Channel to | 133 // Thread checkers document and lock usage of some methods on voe::Channel to |
| 124 // specific threads we know about. The goal is to eventually split up | 134 // specific threads we know about. The goal is to eventually split up |
| 125 // voe::Channel into parts with single-threaded semantics, and thereby reduce | 135 // voe::Channel into parts with single-threaded semantics, and thereby reduce |
| 126 // the need for locks. | 136 // the need for locks. |
| 127 rtc::ThreadChecker worker_thread_checker_; | 137 rtc::ThreadChecker worker_thread_checker_; |
| 128 rtc::ThreadChecker module_process_thread_checker_; | 138 rtc::ThreadChecker module_process_thread_checker_; |
| 129 // Methods accessed from audio and video threads are checked for sequential- | 139 // Methods accessed from audio and video threads are checked for sequential- |
| 130 // only access. We don't necessarily own and control these threads, so thread | 140 // only access. We don't necessarily own and control these threads, so thread |
| 131 // checkers cannot be used. E.g. Chromium may transfer "ownership" from one | 141 // checkers cannot be used. E.g. Chromium may transfer "ownership" from one |
| 132 // audio thread to another, but access is still sequential. | 142 // audio thread to another, but access is still sequential. |
| 133 rtc::RaceChecker audio_thread_race_checker_; | 143 rtc::RaceChecker audio_thread_race_checker_; |
| 134 rtc::RaceChecker video_capture_thread_race_checker_; | 144 rtc::RaceChecker video_capture_thread_race_checker_; |
| 135 ChannelOwner channel_owner_; | 145 ChannelOwner channel_owner_; |
| 136 | 146 |
| 137 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); | 147 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); |
| 138 }; | 148 }; |
| 139 } // namespace voe | 149 } // namespace voe |
| 140 } // namespace webrtc | 150 } // namespace webrtc |
| 141 | 151 |
| 142 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 152 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| OLD | NEW |