| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WEBAUDIO_MEDIA_STREAM_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBAUDIO_MEDIA_STREAM_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBAUDIO_MEDIA_STREAM_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBAUDIO_MEDIA_STREAM_SOURCE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // MediaStreamAudioTracks. Audio data is transported directly to the tracks in | 22 // MediaStreamAudioTracks. Audio data is transported directly to the tracks in |
| 23 // 10 ms chunks. | 23 // 10 ms chunks. |
| 24 class WebAudioMediaStreamSource final | 24 class WebAudioMediaStreamSource final |
| 25 : NON_EXPORTED_BASE(public MediaStreamAudioSource), | 25 : NON_EXPORTED_BASE(public MediaStreamAudioSource), |
| 26 public blink::WebAudioDestinationConsumer { | 26 public blink::WebAudioDestinationConsumer { |
| 27 public: | 27 public: |
| 28 explicit WebAudioMediaStreamSource(blink::WebMediaStreamSource* blink_source); | 28 explicit WebAudioMediaStreamSource(blink::WebMediaStreamSource* blink_source); |
| 29 | 29 |
| 30 ~WebAudioMediaStreamSource() override; | 30 ~WebAudioMediaStreamSource() override; |
| 31 | 31 |
| 32 void getSettings(blink::WebMediaStreamTrack::Settings&) override; |
| 33 |
| 32 private: | 34 private: |
| 33 // WebAudioDestinationConsumer implementation. | 35 // WebAudioDestinationConsumer implementation. |
| 34 // | 36 // |
| 35 // Note: Blink ensures setFormat() and consumeAudio() are not called | 37 // Note: Blink ensures setFormat() and consumeAudio() are not called |
| 36 // concurrently across threads, but these methods could be called on any | 38 // concurrently across threads, but these methods could be called on any |
| 37 // thread. | 39 // thread. |
| 38 void setFormat(size_t number_of_channels, float sample_rate) override; | 40 void setFormat(size_t number_of_channels, float sample_rate) override; |
| 39 void consumeAudio(const blink::WebVector<const float*>& audio_data, | 41 void consumeAudio(const blink::WebVector<const float*>& audio_data, |
| 40 size_t number_of_frames) override; | 42 size_t number_of_frames) override; |
| 41 | 43 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // This object registers with a blink::WebMediaStreamSource. We keep track of | 75 // This object registers with a blink::WebMediaStreamSource. We keep track of |
| 74 // that in order to be able to deregister before stopping this source. | 76 // that in order to be able to deregister before stopping this source. |
| 75 blink::WebMediaStreamSource blink_source_; | 77 blink::WebMediaStreamSource blink_source_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(WebAudioMediaStreamSource); | 79 DISALLOW_COPY_AND_ASSIGN(WebAudioMediaStreamSource); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace content | 82 } // namespace content |
| 81 | 83 |
| 82 #endif // CONTENT_RENDERER_MEDIA_WEBAUDIO_MEDIA_STREAM_SOURCE_H_ | 84 #endif // CONTENT_RENDERER_MEDIA_WEBAUDIO_MEDIA_STREAM_SOURCE_H_ |
| OLD | NEW |