OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SPEECH_RECOGNITION_AUDIO_SINK_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_SPEECH_RECOGNITION_AUDIO_SINK_H_ |
6 #define CONTENT_RENDERER_MEDIA_SPEECH_RECOGNITION_AUDIO_SINK_H_ | 6 #define CONTENT_RENDERER_MEDIA_SPEECH_RECOGNITION_AUDIO_SINK_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // content::MediaStreamAudioSink implementation. | 55 // content::MediaStreamAudioSink implementation. |
56 void OnReadyStateChanged( | 56 void OnReadyStateChanged( |
57 blink::WebMediaStreamSource::ReadyState state) override; | 57 blink::WebMediaStreamSource::ReadyState state) override; |
58 | 58 |
59 void OnData(const media::AudioBus& audio_bus, | 59 void OnData(const media::AudioBus& audio_bus, |
60 base::TimeTicks estimated_capture_time) override; | 60 base::TimeTicks estimated_capture_time) override; |
61 void OnSetFormat(const media::AudioParameters& params) override; | 61 void OnSetFormat(const media::AudioParameters& params) override; |
62 | 62 |
63 // media::AudioConverter::Inputcallback implementation. | 63 // media::AudioConverter::Inputcallback implementation. |
64 double ProvideInput(media::AudioBus* audio_bus, | 64 double ProvideInput(media::AudioBus* audio_bus, |
65 base::TimeDelta buffer_delay) override; | 65 uint32_t frames_delayed) override; |
66 | 66 |
67 // Returns the pointer to the audio input buffer mapped in the shared memory. | 67 // Returns the pointer to the audio input buffer mapped in the shared memory. |
68 media::AudioInputBuffer* GetAudioInputBuffer() const; | 68 media::AudioInputBuffer* GetAudioInputBuffer() const; |
69 | 69 |
70 // Number of frames per buffer in FIFO. When the buffer is full we convert and | 70 // Number of frames per buffer in FIFO. When the buffer is full we convert and |
71 // consume it on the |output_bus_|. Size of the buffer depends on the | 71 // consume it on the |output_bus_|. Size of the buffer depends on the |
72 // resampler. Example: for 44.1 to 16.0 conversion, it should be 4100 frames. | 72 // resampler. Example: for 44.1 to 16.0 conversion, it should be 4100 frames. |
73 int fifo_buffer_size_; | 73 int fifo_buffer_size_; |
74 | 74 |
75 // Used to DCHECK that some methods are called on the main render thread. | 75 // Used to DCHECK that some methods are called on the main render thread. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 // Callback for the renderer client. Called when the audio track was stopped. | 112 // Callback for the renderer client. Called when the audio track was stopped. |
113 const OnStoppedCB on_stopped_cb_; | 113 const OnStoppedCB on_stopped_cb_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionAudioSink); | 115 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionAudioSink); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace content | 118 } // namespace content |
119 | 119 |
120 #endif // CONTENT_RENDERER_MEDIA_SPEECH_RECOGNITION_AUDIO_SINK_H_ | 120 #endif // CONTENT_RENDERER_MEDIA_SPEECH_RECOGNITION_AUDIO_SINK_H_ |
OLD | NEW |