blob: 88304fd70216a4f0875a59e1052c4ec25b465f9f [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 {
solenberg3a941542015-11-16 07:34:50 -080020class VoiceEngine;
21
solenberg13725082015-11-25 08:16:52 -080022namespace voe {
23class ChannelProxy;
24} // namespace voe
solenbergc7a8b082015-10-16 14:35:07 -070025
solenberg13725082015-11-25 08:16:52 -080026namespace internal {
solenberg85a04962015-10-27 03:35:21 -070027class AudioSendStream final : public webrtc::AudioSendStream {
solenbergc7a8b082015-10-16 14:35:07 -070028 public:
solenberg85a04962015-10-27 03:35:21 -070029 AudioSendStream(const webrtc::AudioSendStream::Config& config,
solenberg566ef242015-11-06 15:34:49 -080030 const rtc::scoped_refptr<webrtc::AudioState>& audio_state);
solenbergc7a8b082015-10-16 14:35:07 -070031 ~AudioSendStream() override;
32
33 // webrtc::SendStream implementation.
34 void Start() override;
35 void Stop() override;
36 void SignalNetworkState(NetworkState state) override;
37 bool DeliverRtcp(const uint8_t* packet, size_t length) override;
38
39 // webrtc::AudioSendStream implementation.
Fredrik Solenbergb5727682015-12-04 15:22:19 +010040 bool SendTelephoneEvent(int payload_type, uint8_t event,
41 uint32_t duration_ms) override;
solenbergc7a8b082015-10-16 14:35:07 -070042 webrtc::AudioSendStream::Stats GetStats() const override;
43
solenberg85a04962015-10-27 03:35:21 -070044 const webrtc::AudioSendStream::Config& config() const;
solenbergc7a8b082015-10-16 14:35:07 -070045
46 private:
solenberg3a941542015-11-16 07:34:50 -080047 VoiceEngine* voice_engine() const;
48
solenberg85a04962015-10-27 03:35:21 -070049 rtc::ThreadChecker thread_checker_;
solenbergc7a8b082015-10-16 14:35:07 -070050 const webrtc::AudioSendStream::Config config_;
solenberg566ef242015-11-06 15:34:49 -080051 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
solenberg13725082015-11-25 08:16:52 -080052 rtc::scoped_ptr<voe::ChannelProxy> channel_proxy_;
solenberg85a04962015-10-27 03:35:21 -070053
54 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
solenbergc7a8b082015-10-16 14:35:07 -070055};
56} // namespace internal
57} // namespace webrtc
58
59#endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_