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

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

Issue 2405183002: Moving WebRtcVoiceMediaChannel::SendSetCodec to AudioSendStream. (Closed)
Patch Set: working version Created 4 years, 2 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
« no previous file with comments | « no previous file | webrtc/audio/audio_send_stream.h » ('j') | webrtc/audio/audio_send_stream.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_API_CALL_AUDIO_SEND_STREAM_H_ 11 #ifndef WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_
12 #define WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ 12 #define WEBRTC_API_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/config.h" 18 #include "webrtc/config.h"
19 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" 19 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
20 #include "webrtc/transport.h" 20 #include "webrtc/transport.h"
21 #include "webrtc/typedefs.h" 21 #include "webrtc/typedefs.h"
22 22
23 namespace webrtc { 23 namespace webrtc {
24 24
25 // TODO(minyue): This is copied from cricket::SendCodecSpec. Find better place
26 // for it.
27 struct SendCodecSpec {
28 SendCodecSpec() {
29 webrtc::CodecInst empty_inst = {0};
30 codec_inst = empty_inst;
31 codec_inst.pltype = -1;
32 }
33 bool operator==(const SendCodecSpec& rhs) const;
34 bool operator!=(const SendCodecSpec& rhs) const;
35
36 bool nack_enabled = false;
37 bool transport_cc_enabled = false;
38 bool enable_codec_fec = false;
39 bool enable_opus_dtx = false;
40 int opus_max_playback_rate = 0;
41 int red_payload_type = -1;
42 int cng_payload_type = -1;
43 int cng_plfreq = -1;
44 webrtc::CodecInst codec_inst;
45 };
46
25 // WORK IN PROGRESS 47 // WORK IN PROGRESS
26 // This class is under development and is not yet intended for for use outside 48 // This class is under development and is not yet intended for for use outside
27 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. 49 // of WebRtc/Libjingle. Please use the VoiceEngine API instead.
28 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 50 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690
29 51
30 class AudioSendStream { 52 class AudioSendStream {
31 public: 53 public:
32 struct Stats { 54 struct Stats {
33 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. 55 // TODO(solenberg): Harmonize naming and defaults with receive stream stats.
34 uint32_t local_ssrc = 0; 56 uint32_t local_ssrc = 0;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // passed to Call::CreateAudioSendStream(). 109 // passed to Call::CreateAudioSendStream().
88 // TODO(solenberg): Implement, once we configure codecs through the new API. 110 // TODO(solenberg): Implement, once we configure codecs through the new API.
89 // std::unique_ptr<AudioEncoder> encoder; 111 // std::unique_ptr<AudioEncoder> encoder;
90 int cng_payload_type = -1; // pt, or -1 to disable Comfort Noise Generator. 112 int cng_payload_type = -1; // pt, or -1 to disable Comfort Noise Generator.
91 113
92 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to 114 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to
93 // disable audio bitrate adaptation. 115 // disable audio bitrate adaptation.
94 // Note: This is still an experimental feature and not ready for real usage. 116 // Note: This is still an experimental feature and not ready for real usage.
95 int min_bitrate_kbps = -1; 117 int min_bitrate_kbps = -1;
96 int max_bitrate_kbps = -1; 118 int max_bitrate_kbps = -1;
119
120 int max_send_bitrate_bps = 0;
121 SendCodecSpec send_codec_spec;
97 }; 122 };
98 123
99 // Starts stream activity. 124 // Starts stream activity.
100 // When a stream is active, it can receive, process and deliver packets. 125 // When a stream is active, it can receive, process and deliver packets.
101 virtual void Start() = 0; 126 virtual void Start() = 0;
102 // Stops stream activity. 127 // Stops stream activity.
103 // When a stream is stopped, it can't receive, process or deliver packets. 128 // When a stream is stopped, it can't receive, process or deliver packets.
104 virtual void Stop() = 0; 129 virtual void Stop() = 0;
105 130
106 // TODO(solenberg): Make payload_type a config property instead. 131 // TODO(solenberg): Make payload_type a config property instead.
107 virtual bool SendTelephoneEvent(int payload_type, int event, 132 virtual bool SendTelephoneEvent(int payload_type, int event,
108 int duration_ms) = 0; 133 int duration_ms) = 0;
109 134
110 virtual void SetMuted(bool muted) = 0; 135 virtual void SetMuted(bool muted) = 0;
111 136
112 virtual Stats GetStats() const = 0; 137 virtual Stats GetStats() const = 0;
113 138
114 protected: 139 protected:
115 virtual ~AudioSendStream() {} 140 virtual ~AudioSendStream() {}
116 }; 141 };
117 } // namespace webrtc 142 } // namespace webrtc
118 143
119 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ 144 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/audio/audio_send_stream.h » ('j') | webrtc/audio/audio_send_stream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698