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

Side by Side Diff: webrtc/voice_engine/channel_proxy.h

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: AudioSendStream::Reconfigure() Created 3 years, 8 months 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
OLDNEW
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
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // 2. Provide a refined interface for the stream classes, including assumptions 49 // 2. Provide a refined interface for the stream classes, including assumptions
50 // on return values and input adaptation. 50 // on return values and input adaptation.
51 class ChannelProxy { 51 class ChannelProxy {
52 public: 52 public:
53 ChannelProxy(); 53 ChannelProxy();
54 explicit ChannelProxy(const ChannelOwner& channel_owner); 54 explicit ChannelProxy(const ChannelOwner& channel_owner);
55 virtual ~ChannelProxy(); 55 virtual ~ChannelProxy();
56 56
57 virtual bool SetEncoder(int payload_type, 57 virtual bool SetEncoder(int payload_type,
58 std::unique_ptr<AudioEncoder> encoder); 58 std::unique_ptr<AudioEncoder> encoder);
59 virtual void ModifyEncoder(
60 rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier);
59 61
60 virtual void SetRTCPStatus(bool enable); 62 virtual void SetRTCPStatus(bool enable);
61 virtual void SetLocalSSRC(uint32_t ssrc); 63 virtual void SetLocalSSRC(uint32_t ssrc);
62 virtual void SetRTCP_CNAME(const std::string& c_name); 64 virtual void SetRTCP_CNAME(const std::string& c_name);
63 virtual void SetNACKStatus(bool enable, int max_packets); 65 virtual void SetNACKStatus(bool enable, int max_packets);
64 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id); 66 virtual void SetSendAudioLevelIndicationStatus(bool enable, int id);
65 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id); 67 virtual void SetReceiveAudioLevelIndicationStatus(bool enable, int id);
66 virtual void EnableSendTransportSequenceNumber(int id); 68 virtual void EnableSendTransportSequenceNumber(int id);
67 virtual void EnableReceiveTransportSequenceNumber(int id); 69 virtual void EnableReceiveTransportSequenceNumber(int id);
68 virtual void RegisterSenderCongestionControlObjects( 70 virtual void RegisterSenderCongestionControlObjects(
(...skipping 20 matching lines...) Expand all
89 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink); 91 virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink);
90 virtual void SetInputMute(bool muted); 92 virtual void SetInputMute(bool muted);
91 virtual void RegisterExternalTransport(Transport* transport); 93 virtual void RegisterExternalTransport(Transport* transport);
92 virtual void DeRegisterExternalTransport(); 94 virtual void DeRegisterExternalTransport();
93 virtual void OnRtpPacket(const RtpPacketReceived& packet); 95 virtual void OnRtpPacket(const RtpPacketReceived& packet);
94 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length); 96 virtual bool ReceivedRTCPPacket(const uint8_t* packet, size_t length);
95 virtual const rtc::scoped_refptr<AudioDecoderFactory>& 97 virtual const rtc::scoped_refptr<AudioDecoderFactory>&
96 GetAudioDecoderFactory() const; 98 GetAudioDecoderFactory() const;
97 virtual void SetChannelOutputVolumeScaling(float scaling); 99 virtual void SetChannelOutputVolumeScaling(float scaling);
98 virtual void SetRtcEventLog(RtcEventLog* event_log); 100 virtual void SetRtcEventLog(RtcEventLog* event_log);
99 virtual void EnableAudioNetworkAdaptor(const std::string& config_string);
100 virtual void DisableAudioNetworkAdaptor();
101 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms,
102 int max_frame_length_ms);
103 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo( 101 virtual AudioMixer::Source::AudioFrameInfo GetAudioFrameWithInfo(
104 int sample_rate_hz, 102 int sample_rate_hz,
105 AudioFrame* audio_frame); 103 AudioFrame* audio_frame);
106 virtual int NeededFrequency() const; 104 virtual int NeededFrequency() const;
107 virtual void SetTransportOverhead(int transport_overhead_per_packet); 105 virtual void SetTransportOverhead(int transport_overhead_per_packet);
108 virtual void AssociateSendChannel(const ChannelProxy& send_channel_proxy); 106 virtual void AssociateSendChannel(const ChannelProxy& send_channel_proxy);
109 virtual void DisassociateSendChannel(); 107 virtual void DisassociateSendChannel();
110 virtual void GetRtpRtcp(RtpRtcp** rtp_rtcp, 108 virtual void GetRtpRtcp(RtpRtcp** rtp_rtcp,
111 RtpReceiver** rtp_receiver) const; 109 RtpReceiver** rtp_receiver) const;
112 virtual uint32_t GetPlayoutTimestamp() const; 110 virtual uint32_t GetPlayoutTimestamp() const;
113 virtual void SetMinimumPlayoutDelay(int delay_ms); 111 virtual void SetMinimumPlayoutDelay(int delay_ms);
114 virtual void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats); 112 virtual void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats);
115 virtual bool GetRecCodec(CodecInst* codec_inst) const; 113 virtual bool GetRecCodec(CodecInst* codec_inst) const;
116 virtual bool GetSendCodec(CodecInst* codec_inst) const;
117 virtual bool SetVADStatus(bool enable);
118 virtual bool SetCodecFECStatus(bool enable);
119 virtual bool SetOpusDtx(bool enable);
120 virtual bool SetOpusMaxPlaybackRate(int frequency_hz);
121 virtual bool SetSendCodec(const CodecInst& codec_inst);
122 virtual bool SetSendCNPayloadType(int type, PayloadFrequencies frequency);
123 114
124 private: 115 private:
125 Channel* channel() const; 116 Channel* channel() const;
126 117
127 // Thread checkers document and lock usage of some methods on voe::Channel to 118 // Thread checkers document and lock usage of some methods on voe::Channel to
128 // specific threads we know about. The goal is to eventually split up 119 // specific threads we know about. The goal is to eventually split up
129 // voe::Channel into parts with single-threaded semantics, and thereby reduce 120 // voe::Channel into parts with single-threaded semantics, and thereby reduce
130 // the need for locks. 121 // the need for locks.
131 rtc::ThreadChecker worker_thread_checker_; 122 rtc::ThreadChecker worker_thread_checker_;
132 rtc::ThreadChecker module_process_thread_checker_; 123 rtc::ThreadChecker module_process_thread_checker_;
133 // Methods accessed from audio and video threads are checked for sequential- 124 // Methods accessed from audio and video threads are checked for sequential-
134 // only access. We don't necessarily own and control these threads, so thread 125 // only access. We don't necessarily own and control these threads, so thread
135 // checkers cannot be used. E.g. Chromium may transfer "ownership" from one 126 // checkers cannot be used. E.g. Chromium may transfer "ownership" from one
136 // audio thread to another, but access is still sequential. 127 // audio thread to another, but access is still sequential.
137 rtc::RaceChecker audio_thread_race_checker_; 128 rtc::RaceChecker audio_thread_race_checker_;
138 rtc::RaceChecker video_capture_thread_race_checker_; 129 rtc::RaceChecker video_capture_thread_race_checker_;
139 ChannelOwner channel_owner_; 130 ChannelOwner channel_owner_;
140 131
141 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy); 132 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelProxy);
142 }; 133 };
143 } // namespace voe 134 } // namespace voe
144 } // namespace webrtc 135 } // namespace webrtc
145 136
146 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_ 137 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698