blob: 8b96350590b90cf5e659d5d805cf6be62573130f [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
14#include "webrtc/audio_send_stream.h"
solenberg566ef242015-11-06 15:34:49 -080015#include "webrtc/audio_state.h"
solenberg85a04962015-10-27 03:35:21 -070016#include "webrtc/base/thread_checker.h"
solenberg13725082015-11-25 08:16:52 -080017#include "webrtc/base/scoped_ptr.h"
solenbergc7a8b082015-10-16 14:35:07 -070018
19namespace webrtc {
Stefan Holmerb86d4e42015-12-07 10:26:18 +010020class CongestionController;
solenberg3a941542015-11-16 07:34:50 -080021class VoiceEngine;
22
solenberg13725082015-11-25 08:16:52 -080023namespace voe {
24class ChannelProxy;
25} // namespace voe
solenbergc7a8b082015-10-16 14:35:07 -070026
solenberg13725082015-11-25 08:16:52 -080027namespace internal {
solenberg85a04962015-10-27 03:35:21 -070028class AudioSendStream final : public webrtc::AudioSendStream {
solenbergc7a8b082015-10-16 14:35:07 -070029 public:
solenberg85a04962015-10-27 03:35:21 -070030 AudioSendStream(const webrtc::AudioSendStream::Config& config,
Stefan Holmerb86d4e42015-12-07 10:26:18 +010031 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
32 CongestionController* congestion_controller);
solenbergc7a8b082015-10-16 14:35:07 -070033 ~AudioSendStream() override;
34
35 // webrtc::SendStream implementation.
36 void Start() override;
37 void Stop() override;
38 void SignalNetworkState(NetworkState state) override;
39 bool DeliverRtcp(const uint8_t* packet, size_t length) override;
40
41 // webrtc::AudioSendStream implementation.
Fredrik Solenbergb5727682015-12-04 15:22:19 +010042 bool SendTelephoneEvent(int payload_type, uint8_t event,
43 uint32_t duration_ms) override;
solenbergc7a8b082015-10-16 14:35:07 -070044 webrtc::AudioSendStream::Stats GetStats() const override;
45
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_;
solenberg13725082015-11-25 08:16:52 -080054 rtc::scoped_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_