| Index: chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
|
| diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
|
| index 53a48911f72ae92fe6fed42b1db7703d52aab2fd..2f28d56c41d2f669175c254ff13fbfabdbee1baf 100644
|
| --- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
|
| +++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
|
| @@ -28,6 +28,7 @@ class AudioBus;
|
| namespace chromecast {
|
| namespace media {
|
| class AlsaWrapper;
|
| +class FilterGroup;
|
|
|
| // Mixer implementation. The mixer has one or more input queues; these can be
|
| // added/removed at any time. When an input source pushes frames to an input
|
| @@ -67,6 +68,11 @@ class StreamMixerAlsa {
|
| // precedence for sample rates and will dictate when data is polled.
|
| virtual bool primary() const = 0;
|
|
|
| + // Returns a string describing the content type class.
|
| + // Should be from chromecast/media/base/audio_device_ids.h
|
| + // or media/audio/audio_device_description.h
|
| + virtual std::string name() const = 0;
|
| +
|
| // Returns true if PrepareToDelete() has been called.
|
| virtual bool IsDeleting() const = 0;
|
|
|
| @@ -195,10 +201,11 @@ class StreamMixerAlsa {
|
|
|
| void WriteFrames();
|
| bool TryWriteFrames();
|
| - void WriteMixedPcm(const ::media::AudioBus& mixed, int frames,
|
| - bool is_silence);
|
| + void WriteMixedPcm(std::vector<uint8_t>* interleaved, int frames);
|
| void UpdateRenderingDelay(int newly_pushed_frames);
|
| + size_t InterleavedSize(int frames);
|
| ssize_t BytesPerOutputFormatSample();
|
| + void ResizeBuffersIfNecessary(int chunk_size);
|
|
|
| static bool single_threaded_for_test_;
|
|
|
| @@ -229,26 +236,15 @@ class StreamMixerAlsa {
|
| std::vector<std::unique_ptr<InputQueue>> inputs_;
|
| std::vector<std::unique_ptr<InputQueue>> ignored_inputs_;
|
| MediaPipelineBackendAlsa::RenderingDelay rendering_delay_;
|
| - // Buffer to write final interleaved data before sending to snd_pcm_writei().
|
| - std::vector<uint8_t> interleaved_;
|
| -
|
| - // Buffers that hold audio data while it is mixed, before it is passed to the
|
| - // ALSA layer. These are kept as members of this class to minimize copies and
|
| - // allocations.
|
| - std::unique_ptr<::media::AudioBus> temp_;
|
| - std::unique_ptr<::media::AudioBus> mixed_;
|
|
|
| std::unique_ptr<base::Timer> retry_write_frames_timer_;
|
|
|
| int check_close_timeout_;
|
| std::unique_ptr<base::Timer> check_close_timer_;
|
|
|
| + std::vector<std::unique_ptr<FilterGroup>> filter_groups_;
|
| std::vector<CastMediaShlib::LoopbackAudioObserver*> loopback_observers_;
|
|
|
| - std::unique_ptr<AudioFilterInterface> pre_loopback_filter_;
|
| - std::unique_ptr<AudioFilterInterface> post_loopback_filter_;
|
| - int silence_frames_filtered_ = 0;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(StreamMixerAlsa);
|
| };
|
|
|
|
|