OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_H_ | 5 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_H_ |
6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_H_ | 6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_H_ |
7 | 7 |
8 #include <alsa/asoundlib.h> | 8 #include <alsa/asoundlib.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 virtual int MaxReadSize() = 0; | 86 virtual int MaxReadSize() = 0; |
87 | 87 |
88 // Pulls data from the input stream. The input stream should populate |dest| | 88 // Pulls data from the input stream. The input stream should populate |dest| |
89 // with |frames| frames of data to be mixed. The mixer expects data to be | 89 // with |frames| frames of data to be mixed. The mixer expects data to be |
90 // at a sample rate of |output_samples_per_second()|, so each input stream | 90 // at a sample rate of |output_samples_per_second()|, so each input stream |
91 // should resample as necessary before returning. |frames| is guaranteed to | 91 // should resample as necessary before returning. |frames| is guaranteed to |
92 // be no larger than the value returned by the most recent call to | 92 // be no larger than the value returned by the most recent call to |
93 // MaxReadSize(), and |dest->frames()| shall be >= |frames|. | 93 // MaxReadSize(), and |dest->frames()| shall be >= |frames|. |
94 virtual void GetResampledData(::media::AudioBus* dest, int frames) = 0; | 94 virtual void GetResampledData(::media::AudioBus* dest, int frames) = 0; |
95 | 95 |
| 96 // Called when this input has been skipped for output due to not having any |
| 97 // data available. This indicates that there will be a gap in the playback |
| 98 // from this stream. |
| 99 virtual void OnSkipped() = 0; |
| 100 |
96 // This is called for every InputQueue when the mixer writes data to ALSA | 101 // This is called for every InputQueue when the mixer writes data to ALSA |
97 // for any of its input streams. | 102 // for any of its input streams. |
98 virtual void AfterWriteFrames( | 103 virtual void AfterWriteFrames( |
99 const MediaPipelineBackendAlsa::RenderingDelay& | 104 const MediaPipelineBackendAlsa::RenderingDelay& |
100 mixer_rendering_delay) = 0; | 105 mixer_rendering_delay) = 0; |
101 | 106 |
102 // This will be called when a fatal error occurs in the mixer. | 107 // This will be called when a fatal error occurs in the mixer. |
103 virtual void SignalError(StreamMixerAlsaInput::MixerError error) = 0; | 108 virtual void SignalError(StreamMixerAlsaInput::MixerError error) = 0; |
104 | 109 |
105 // Notifies the input that it is being removed by the upper layers, and | 110 // Notifies the input that it is being removed by the upper layers, and |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 std::unique_ptr<AudioFilterInterface> pre_loopback_filter_; | 243 std::unique_ptr<AudioFilterInterface> pre_loopback_filter_; |
239 std::unique_ptr<AudioFilterInterface> post_loopback_filter_; | 244 std::unique_ptr<AudioFilterInterface> post_loopback_filter_; |
240 | 245 |
241 DISALLOW_COPY_AND_ASSIGN(StreamMixerAlsa); | 246 DISALLOW_COPY_AND_ASSIGN(StreamMixerAlsa); |
242 }; | 247 }; |
243 | 248 |
244 } // namespace media | 249 } // namespace media |
245 } // namespace chromecast | 250 } // namespace chromecast |
246 | 251 |
247 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_H_ | 252 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_H_ |
OLD | NEW |