| 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_HTML_AUDIO_ELEMENT_CAPTURER_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_HTML_AUDIO_ELEMENT_CAPTURER_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_HTML_AUDIO_ELEMENT_CAPTURER_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_HTML_AUDIO_ELEMENT_CAPTURER_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 media::WebAudioSourceProviderImpl* audio_source); | 36 media::WebAudioSourceProviderImpl* audio_source); |
| 37 ~HtmlAudioElementCapturerSource() override; | 37 ~HtmlAudioElementCapturerSource() override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // MediaStreamAudioSource implementation. | 40 // MediaStreamAudioSource implementation. |
| 41 bool EnsureSourceIsStarted() final; | 41 bool EnsureSourceIsStarted() final; |
| 42 void EnsureSourceIsStopped() final; | 42 void EnsureSourceIsStopped() final; |
| 43 | 43 |
| 44 // To act as an WebAudioSourceProviderImpl::CopyAudioCB. | 44 // To act as an WebAudioSourceProviderImpl::CopyAudioCB. |
| 45 void OnAudioBus(std::unique_ptr<media::AudioBus> audio_bus, | 45 void OnAudioBus(std::unique_ptr<media::AudioBus> audio_bus, |
| 46 uint32_t delay_milliseconds, | 46 uint32_t frames_delayed, |
| 47 int sample_rate); | 47 int sample_rate); |
| 48 | 48 |
| 49 scoped_refptr<media::WebAudioSourceProviderImpl> audio_source_; | 49 scoped_refptr<media::WebAudioSourceProviderImpl> audio_source_; |
| 50 | 50 |
| 51 bool is_started_; | 51 bool is_started_; |
| 52 int last_sample_rate_; | 52 int last_sample_rate_; |
| 53 int last_num_channels_; | 53 int last_num_channels_; |
| 54 int last_bus_frames_; | 54 int last_bus_frames_; |
| 55 | 55 |
| 56 base::ThreadChecker thread_checker_; | 56 base::ThreadChecker thread_checker_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(HtmlAudioElementCapturerSource); | 58 DISALLOW_COPY_AND_ASSIGN(HtmlAudioElementCapturerSource); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace content | 61 } // namespace content |
| 62 | 62 |
| 63 #endif // CONTENT_RENDERER_MEDIA_HTML_AUDIO_ELEMENT_CAPTURER_SOURCE_H_ | 63 #endif // CONTENT_RENDERER_MEDIA_HTML_AUDIO_ELEMENT_CAPTURER_SOURCE_H_ |
| OLD | NEW |