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

Side by Side Diff: webrtc/call/audio_send_stream.h

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Created 3 years, 10 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
11 #ifndef WEBRTC_CALL_AUDIO_SEND_STREAM_H_ 11 #ifndef WEBRTC_CALL_AUDIO_SEND_STREAM_H_
12 #define WEBRTC_CALL_AUDIO_SEND_STREAM_H_ 12 #define WEBRTC_CALL_AUDIO_SEND_STREAM_H_
13 13
14 #include <memory> 14 #include <memory>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/api/audio_codecs/audio_format.h"
18 #include "webrtc/api/call/transport.h" 19 #include "webrtc/api/call/transport.h"
19 #include "webrtc/base/optional.h" 20 #include "webrtc/base/optional.h"
20 #include "webrtc/config.h" 21 #include "webrtc/config.h"
21 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" 22 #include "webrtc/modules/audio_coding/codecs/audio_encoder_factory.h"
22 #include "webrtc/typedefs.h" 23 #include "webrtc/typedefs.h"
23 24
24 namespace webrtc { 25 namespace webrtc {
25 26
26 // WORK IN PROGRESS 27 // WORK IN PROGRESS
27 // This class is under development and is not yet intended for for use outside 28 // This class is under development and is not yet intended for for use outside
28 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. 29 // of WebRtc/Libjingle. Please use the VoiceEngine API instead.
29 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 30 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690
30 31
31 class AudioSendStream { 32 class AudioSendStream {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Note: This is still an experimental feature and not ready for real usage. 97 // Note: This is still an experimental feature and not ready for real usage.
97 int min_bitrate_bps = -1; 98 int min_bitrate_bps = -1;
98 int max_bitrate_bps = -1; 99 int max_bitrate_bps = -1;
99 100
100 // Defines whether to turn on audio network adaptor, and defines its config 101 // Defines whether to turn on audio network adaptor, and defines its config
101 // string. 102 // string.
102 rtc::Optional<std::string> audio_network_adaptor_config; 103 rtc::Optional<std::string> audio_network_adaptor_config;
103 104
104 struct SendCodecSpec { 105 struct SendCodecSpec {
105 SendCodecSpec(); 106 SendCodecSpec();
107 ~SendCodecSpec();
106 std::string ToString() const; 108 std::string ToString() const;
107 109
108 bool operator==(const SendCodecSpec& rhs) const; 110 bool operator==(const SendCodecSpec& rhs) const;
109 bool operator!=(const SendCodecSpec& rhs) const { 111 bool operator!=(const SendCodecSpec& rhs) const {
110 return !(*this == rhs); 112 return !(*this == rhs);
111 } 113 }
112 114
113 bool nack_enabled = false; 115 bool nack_enabled = false;
114 bool transport_cc_enabled = false; 116 bool transport_cc_enabled = false;
115 bool enable_codec_fec = false;
116 bool enable_opus_dtx = false;
117 int opus_max_playback_rate = 0;
118 int cng_payload_type = -1; 117 int cng_payload_type = -1;
119 int cng_plfreq = -1; 118 int cng_plfreq = -1;
120 int max_ptime_ms = -1; 119 int payload_type;
121 int min_ptime_ms = -1; 120 rtc::Optional<int> target_bitrate_bps;
122 webrtc::CodecInst codec_inst; 121 webrtc::AudioCodecSpec format;
ossu 2017/02/21 11:04:14 This isn't very nice. It leads to us having to ref
123 } send_codec_spec; 122 } send_codec_spec;
123
124 rtc::scoped_refptr<AudioEncoderFactory> encoder_factory;
124 }; 125 };
125 126
126 // Starts stream activity. 127 // Starts stream activity.
127 // When a stream is active, it can receive, process and deliver packets. 128 // When a stream is active, it can receive, process and deliver packets.
128 virtual void Start() = 0; 129 virtual void Start() = 0;
129 // Stops stream activity. 130 // Stops stream activity.
130 // When a stream is stopped, it can't receive, process or deliver packets. 131 // When a stream is stopped, it can't receive, process or deliver packets.
131 virtual void Stop() = 0; 132 virtual void Stop() = 0;
132 133
133 // TODO(solenberg): Make payload_type a config property instead. 134 // TODO(solenberg): Make payload_type a config property instead.
134 virtual bool SendTelephoneEvent(int payload_type, int payload_frequency, 135 virtual bool SendTelephoneEvent(int payload_type, int payload_frequency,
135 int event, int duration_ms) = 0; 136 int event, int duration_ms) = 0;
136 137
137 virtual void SetMuted(bool muted) = 0; 138 virtual void SetMuted(bool muted) = 0;
138 139
139 virtual Stats GetStats() const = 0; 140 virtual Stats GetStats() const = 0;
140 141
141 protected: 142 protected:
142 virtual ~AudioSendStream() {} 143 virtual ~AudioSendStream() {}
143 }; 144 };
144 } // namespace webrtc 145 } // namespace webrtc
145 146
146 #endif // WEBRTC_CALL_AUDIO_SEND_STREAM_H_ 147 #endif // WEBRTC_CALL_AUDIO_SEND_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698