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_AUDIO_SEND_STREAM_H_ | 11 #ifndef WEBRTC_AUDIO_SEND_STREAM_H_ |
12 #define WEBRTC_AUDIO_SEND_STREAM_H_ | 12 #define WEBRTC_AUDIO_SEND_STREAM_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
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/stream.h" | |
21 #include "webrtc/transport.h" | 20 #include "webrtc/transport.h" |
22 #include "webrtc/typedefs.h" | 21 #include "webrtc/typedefs.h" |
23 | 22 |
24 namespace webrtc { | 23 namespace webrtc { |
25 | 24 |
26 // WORK IN PROGRESS | 25 // WORK IN PROGRESS |
27 // This class is under development and is not yet intended for for use outside | 26 // This class is under development and is not yet intended for for use outside |
28 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. | 27 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. |
29 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 | 28 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 |
30 | 29 |
31 class AudioSendStream : public SendStream { | 30 class AudioSendStream { |
32 public: | 31 public: |
33 struct Stats { | 32 struct Stats { |
34 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. | 33 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. |
35 uint32_t local_ssrc = 0; | 34 uint32_t local_ssrc = 0; |
36 int64_t bytes_sent = 0; | 35 int64_t bytes_sent = 0; |
37 int32_t packets_sent = 0; | 36 int32_t packets_sent = 0; |
38 int32_t packets_lost = -1; | 37 int32_t packets_lost = -1; |
39 float fraction_lost = -1.0f; | 38 float fraction_lost = -1.0f; |
40 std::string codec_name; | 39 std::string codec_name; |
41 int32_t ext_seqnum = -1; | 40 int32_t ext_seqnum = -1; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 int voe_channel_id = -1; | 81 int voe_channel_id = -1; |
83 | 82 |
84 // Ownership of the encoder object is transferred to Call when the config is | 83 // Ownership of the encoder object is transferred to Call when the config is |
85 // passed to Call::CreateAudioSendStream(). | 84 // passed to Call::CreateAudioSendStream(). |
86 // TODO(solenberg): Implement, once we configure codecs through the new API. | 85 // TODO(solenberg): Implement, once we configure codecs through the new API. |
87 // rtc::scoped_ptr<AudioEncoder> encoder; | 86 // rtc::scoped_ptr<AudioEncoder> encoder; |
88 int cng_payload_type = -1; // pt, or -1 to disable Comfort Noise Generator. | 87 int cng_payload_type = -1; // pt, or -1 to disable Comfort Noise Generator. |
89 int red_payload_type = -1; // pt, or -1 to disable REDundant coding. | 88 int red_payload_type = -1; // pt, or -1 to disable REDundant coding. |
90 }; | 89 }; |
91 | 90 |
91 // Starts stream activity. | |
92 // When a stream is active, it can receive, process and deliver packets. | |
93 virtual void Start() = 0; | |
94 // Stops stream activity. | |
95 // When a stream is stopped, it can't receive, process or deliver packets. | |
96 virtual void Stop() = 0; | |
97 // Deliver an incoming RTCP packet. | |
98 virtual bool DeliverRtcp(const uint8_t* packet, size_t length) = 0; | |
The Sun (google.com)
2016/04/27 19:39:46
same as in AudioReceiveStream - only keep this in
| |
99 | |
92 // TODO(solenberg): Make payload_type a config property instead. | 100 // TODO(solenberg): Make payload_type a config property instead. |
93 virtual bool SendTelephoneEvent(int payload_type, int event, | 101 virtual bool SendTelephoneEvent(int payload_type, int event, |
94 int duration_ms) = 0; | 102 int duration_ms) = 0; |
95 virtual Stats GetStats() const = 0; | 103 virtual Stats GetStats() const = 0; |
104 | |
105 protected: | |
106 virtual ~AudioSendStream() {} | |
96 }; | 107 }; |
97 } // namespace webrtc | 108 } // namespace webrtc |
98 | 109 |
99 #endif // WEBRTC_AUDIO_SEND_STREAM_H_ | 110 #endif // WEBRTC_AUDIO_SEND_STREAM_H_ |
OLD | NEW |