OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_EXTERNAL_MEDIA_STREAM_AUDIO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_EXTERNAL_MEDIA_STREAM_AUDIO_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_EXTERNAL_MEDIA_STREAM_AUDIO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_EXTERNAL_MEDIA_STREAM_AUDIO_SOURCE_H_ |
7 | 7 |
8 #include "content/renderer/media/media_stream_audio_source.h" | 8 #include "content/renderer/media/media_stream_audio_source.h" |
9 | 9 |
10 #include "media/base/audio_capturer_source.h" | 10 #include "media/base/audio_capturer_source.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool is_remote); | 28 bool is_remote); |
29 | 29 |
30 ~ExternalMediaStreamAudioSource() final; | 30 ~ExternalMediaStreamAudioSource() final; |
31 | 31 |
32 private: | 32 private: |
33 // MediaStreamAudioSource implementation. | 33 // MediaStreamAudioSource implementation. |
34 bool EnsureSourceIsStarted() final; | 34 bool EnsureSourceIsStarted() final; |
35 void EnsureSourceIsStopped() final; | 35 void EnsureSourceIsStopped() final; |
36 | 36 |
37 // media::AudioCapturerSource::CaptureCallback implementation. | 37 // media::AudioCapturerSource::CaptureCallback implementation. |
38 void OnCaptureStarted() final; | |
39 void Capture(const media::AudioBus* audio_bus, | 38 void Capture(const media::AudioBus* audio_bus, |
40 int audio_delay_milliseconds, | 39 int audio_delay_milliseconds, |
41 double volume, | 40 double volume, |
42 bool key_pressed) final; | 41 bool key_pressed) final; |
43 void OnCaptureError(const std::string& message) final; | 42 void OnCaptureError(const std::string& message) final; |
44 | 43 |
45 // The external source provided to the constructor. | 44 // The external source provided to the constructor. |
46 scoped_refptr<media::AudioCapturerSource> source_; | 45 scoped_refptr<media::AudioCapturerSource> source_; |
47 | 46 |
48 // In debug builds, check that all methods that could cause object graph | 47 // In debug builds, check that all methods that could cause object graph |
49 // or data flow changes are being called on the main thread. | 48 // or data flow changes are being called on the main thread. |
50 base::ThreadChecker thread_checker_; | 49 base::ThreadChecker thread_checker_; |
51 | 50 |
52 // True once the source has been started successfully. | 51 // True once the source has been started successfully. |
53 bool was_started_; | 52 bool was_started_; |
54 | 53 |
55 DISALLOW_COPY_AND_ASSIGN(ExternalMediaStreamAudioSource); | 54 DISALLOW_COPY_AND_ASSIGN(ExternalMediaStreamAudioSource); |
56 }; | 55 }; |
57 | 56 |
58 } // namespace content | 57 } // namespace content |
59 | 58 |
60 #endif // CONTENT_RENDERER_MEDIA_EXTERNAL_MEDIA_STREAM_AUDIO_SOURCE_H_ | 59 #endif // CONTENT_RENDERER_MEDIA_EXTERNAL_MEDIA_STREAM_AUDIO_SOURCE_H_ |
OLD | NEW |