blob: 61dd7f24b45f2662e897df12936f72bd86252c29 [file] [log] [blame]
solenbergc7a8b082015-10-16 14:35:07 -07001/*
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_AUDIO_SEND_STREAM_H_
12#define WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_
13
kwibergfffa42b2016-02-23 10:46:32 -080014#include <memory>
15
solenbergc7a8b082015-10-16 14:35:07 -070016#include "webrtc/audio_send_stream.h"
solenberg566ef242015-11-06 15:34:49 -080017#include "webrtc/audio_state.h"
kwiberg4485ffb2016-04-26 08:14:39 -070018#include "webrtc/base/constructormagic.h"
solenberg85a04962015-10-27 03:35:21 -070019#include "webrtc/base/thread_checker.h"
solenbergc7a8b082015-10-16 14:35:07 -070020
21namespace webrtc {
Stefan Holmerb86d4e42015-12-07 10:26:18 +010022class CongestionController;
solenberg3a941542015-11-16 07:34:50 -080023class VoiceEngine;
24
solenberg13725082015-11-25 08:16:52 -080025namespace voe {
26class ChannelProxy;
27} // namespace voe
solenbergc7a8b082015-10-16 14:35:07 -070028
solenberg13725082015-11-25 08:16:52 -080029namespace internal {
solenberg85a04962015-10-27 03:35:21 -070030class AudioSendStream final : public webrtc::AudioSendStream {
solenbergc7a8b082015-10-16 14:35:07 -070031 public:
solenberg85a04962015-10-27 03:35:21 -070032 AudioSendStream(const webrtc::AudioSendStream::Config& config,
Stefan Holmerb86d4e42015-12-07 10:26:18 +010033 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
34 CongestionController* congestion_controller);
solenbergc7a8b082015-10-16 14:35:07 -070035 ~AudioSendStream() override;
36
pbos1ba8d392016-05-01 20:18:34 -070037 // webrtc::AudioSendStream implementation.
solenbergc7a8b082015-10-16 14:35:07 -070038 void Start() override;
39 void Stop() override;
solenberg8842c3e2016-03-11 03:06:41 -080040 bool SendTelephoneEvent(int payload_type, int event,
41 int duration_ms) override;
solenbergc7a8b082015-10-16 14:35:07 -070042 webrtc::AudioSendStream::Stats GetStats() const override;
43
pbos1ba8d392016-05-01 20:18:34 -070044 void SignalNetworkState(NetworkState state);
45 bool DeliverRtcp(const uint8_t* packet, size_t length);
solenberg85a04962015-10-27 03:35:21 -070046 const webrtc::AudioSendStream::Config& config() const;
solenbergc7a8b082015-10-16 14:35:07 -070047
48 private:
solenberg3a941542015-11-16 07:34:50 -080049 VoiceEngine* voice_engine() const;
50
solenberg85a04962015-10-27 03:35:21 -070051 rtc::ThreadChecker thread_checker_;
solenbergc7a8b082015-10-16 14:35:07 -070052 const webrtc::AudioSendStream::Config config_;
solenberg566ef242015-11-06 15:34:49 -080053 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
kwibergfffa42b2016-02-23 10:46:32 -080054 std::unique_ptr<voe::ChannelProxy> channel_proxy_;
solenberg85a04962015-10-27 03:35:21 -070055
56 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
solenbergc7a8b082015-10-16 14:35:07 -070057};
58} // namespace internal
59} // namespace webrtc
60
61#endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_