blob: b96a8ef988d27762fee545d2042e15bd8731c8d3 [file] [log] [blame]
Fredrik Solenberg04f49312015-06-08 13:04:56 +02001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_AUDIO_SEND_STREAM_H_
12#define WEBRTC_AUDIO_SEND_STREAM_H_
13
14#include <string>
15#include <vector>
16
17#include "webrtc/base/scoped_ptr.h"
18#include "webrtc/config.h"
19#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
Jelena Marusiccd670222015-07-16 09:30:09 +020020#include "webrtc/stream.h"
solenberg4fbae2b2015-08-28 04:07:10 -070021#include "webrtc/transport.h"
Fredrik Solenberg04f49312015-06-08 13:04:56 +020022#include "webrtc/typedefs.h"
23
24namespace webrtc {
25
Jelena Marusiccd670222015-07-16 09:30:09 +020026class AudioSendStream : public SendStream {
Fredrik Solenberg04f49312015-06-08 13:04:56 +020027 public:
28 struct Stats {};
29
30 struct Config {
solenberg4fbae2b2015-08-28 04:07:10 -070031 Config() = delete;
pbos2d566682015-09-28 09:59:31 -070032 explicit Config(Transport* send_transport)
solenberg4fbae2b2015-08-28 04:07:10 -070033 : send_transport(send_transport) {}
34
Fredrik Solenberg04f49312015-06-08 13:04:56 +020035 std::string ToString() const;
36
37 // Receive-stream specific RTP settings.
38 struct Rtp {
39 std::string ToString() const;
40
41 // Sender SSRC.
42 uint32_t ssrc = 0;
43
44 // RTP header extensions used for the received stream.
45 std::vector<RtpExtension> extensions;
46 } rtp;
47
solenbergc7a8b082015-10-16 14:35:07 -070048 // Transport for outgoing packets. The transport is expected to exist for
49 // the entire life of the AudioSendStream and is owned by the API client.
pbos2d566682015-09-28 09:59:31 -070050 Transport* send_transport = nullptr;
solenberg4fbae2b2015-08-28 04:07:10 -070051
solenbergcf18b342015-10-01 08:13:42 -070052 // Underlying VoiceEngine handle, used to map AudioSendStream to lower-level
53 // components.
54 // TODO(solenberg): Remove when VoiceEngine channels are created outside
55 // of Call.
56 int voe_channel_id = -1;
57
solenbergc7a8b082015-10-16 14:35:07 -070058 // Ownership of the encoder object is transferred to Call when the config is
59 // passed to Call::CreateAudioSendStream().
60 // TODO(solenberg): Implement, once we configure codecs through the new API.
61 // rtc::scoped_ptr<AudioEncoder> encoder;
Fredrik Solenberg04f49312015-06-08 13:04:56 +020062 int cng_payload_type = -1; // pt, or -1 to disable Comfort Noise Generator.
63 int red_payload_type = -1; // pt, or -1 to disable REDundant coding.
64 };
65
66 virtual Stats GetStats() const = 0;
Fredrik Solenberg04f49312015-06-08 13:04:56 +020067};
68} // namespace webrtc
69
70#endif // WEBRTC_AUDIO_SEND_STREAM_H_