| 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/api/audio_codecs/audio_encoder.h" | 15 #include "webrtc/api/audio_codecs/audio_encoder.h" |
| 16 #include "webrtc/api/rtpreceiverinterface.h" | 16 #include "webrtc/api/rtpreceiverinterface.h" |
| 17 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
| 18 #include "webrtc/base/race_checker.h" | 18 #include "webrtc/base/race_checker.h" |
| 19 #include "webrtc/base/thread_checker.h" | 19 #include "webrtc/base/thread_checker.h" |
| 20 #include "webrtc/call/rtp_packet_sink_interface.h" |
| 20 #include "webrtc/voice_engine/channel_manager.h" | 21 #include "webrtc/voice_engine/channel_manager.h" |
| 21 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 22 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 22 | 23 |
| 23 #include <memory> | 24 #include <memory> |
| 24 #include <string> | 25 #include <string> |
| 25 #include <vector> | 26 #include <vector> |
| 26 | 27 |
| 27 namespace webrtc { | 28 namespace webrtc { |
| 28 | 29 |
| 29 class AudioSinkInterface; | 30 class AudioSinkInterface; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 43 | 44 |
| 44 class Channel; | 45 class Channel; |
| 45 | 46 |
| 46 // This class provides the "view" of a voe::Channel that we need to implement | 47 // This class provides the "view" of a voe::Channel that we need to implement |
| 47 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two | 48 // webrtc::AudioSendStream and webrtc::AudioReceiveStream. It serves two |
| 48 // purposes: | 49 // purposes: |
| 49 // 1. Allow mocking just the interfaces used, instead of the entire | 50 // 1. Allow mocking just the interfaces used, instead of the entire |
| 50 // voe::Channel class. | 51 // voe::Channel class. |
| 51 // 2. Provide a refined interface for the stream classes, including assumptions | 52 // 2. Provide a refined interface for the stream classes, including assumptions |
| 52 // on return values and input adaptation. | 53 // on return values and input adaptation. |
| 53 class ChannelProxy { | 54 class ChannelProxy : public RtpPacketSinkInterface { |
| 54 public: | 55 public: |
| 55 ChannelProxy(); | 56 ChannelProxy(); |
| 56 explicit ChannelProxy(const ChannelOwner& channel_owner); | 57 explicit ChannelProxy(const ChannelOwner& channel_owner); |
| 57 virtual ~ChannelProxy(); | 58 virtual ~ChannelProxy(); |
| 58 | 59 |
| 59 virtual bool SetEncoder(int payload_type, | 60 virtual bool SetEncoder(int payload_type, |
| 60 std::unique_ptr<AudioEncoder> encoder); | 61 std::unique_ptr<AudioEncoder> encoder); |
| 61 virtual void ModifyEncoder( | 62 virtual void ModifyEncoder( |
| 62 rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier); | 63 rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier); |
| 63 | 64 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 87 int payload_frequency); | 88 int payload_frequency); |
| 88 virtual bool SendTelephoneEventOutband(int event, int duration_ms); | 89 virtual bool SendTelephoneEventOutband(int event, int duration_ms); |
| 89 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); | 90 virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms); |
| 90 virtual void SetRecPayloadType(int payload_type, | 91 virtual void SetRecPayloadType(int payload_type, |
| 91 const SdpAudioFormat& format); | 92 const SdpAudioFormat& format); |
| 92 virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); | 93 virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); |
| 93 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 94 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); |
| 94 virtual void SetInputMute(bool muted); | 95 virtual void SetInputMute(bool muted); |
| 95 virtual void RegisterExternalTransport(Transport* transport); | 96 virtual void RegisterExternalTransport(Transport* transport); |
| 96 virtual void DeRegisterExternalTransport(); | 97 virtual void DeRegisterExternalTransport(); |
| 97 virtual void OnRtpPacket(const RtpPacketReceived& packet); | 98 |
| 99 // Implements RtpPacketSinkInterface |
| 100 void OnRtpPacket(const RtpPacketReceived& packet) override; |
| 98 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); | 101 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); |
| 99 virtual const rtc::scoped_refptr<AudioDecoderFactory>& | 102 virtual const rtc::scoped_refptr<AudioDecoderFactory>& |
| 100 GetAudioDecoderFactory() const; | 103 GetAudioDecoderFactory() const; |
| 101 virtual void SetChannelOutputVolumeScaling(float scaling); | 104 virtual void SetChannelOutputVolumeScaling(float scaling); |
| 102 virtual void SetRtcEventLog(RtcEventLog* event_log); | 105 virtual void SetRtcEventLog(RtcEventLog* event_log); |
| 103 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( | 106 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( |
| 104 int sample_rate_hz, | 107 int sample_rate_hz, |
| 105 AudioFrame* audio_frame); | 108 AudioFrame* audio_frame); |
| 106 virtual int NeededFrequency() const; | 109 virtual int NeededFrequency() const; |
| 107 virtual void SetTransportOverhead(int transport_overhead_per_packet); | 110 virtual void SetTransportOverhead(int transport_overhead_per_packet); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 135 rtc::RaceChecker audio_thread_race_checker_; | 138 rtc::RaceChecker audio_thread_race_checker_; |
| 136 rtc::RaceChecker video_capture_thread_race_checker_; | 139 rtc::RaceChecker video_capture_thread_race_checker_; |
| 137 ChannelOwner channel_owner_; | 140 ChannelOwner channel_owner_; |
| 138 | 141 |
| 139 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); | 142 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); |
| 140 }; | 143 }; |
| 141 } // namespace voe | 144 } // namespace voe |
| 142 } // namespace webrtc | 145 } // namespace webrtc |
| 143 | 146 |
| 144 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ | 147 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ |
| OLD | NEW |