| 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 MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
| 6 #define MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 // TODO(guidou): remove this method. The output device of a mixer should | 43 // TODO(guidou): remove this method. The output device of a mixer should |
| 44 // never be switched, as it may result in a discrepancy between the output | 44 // never be switched, as it may result in a discrepancy between the output |
| 45 // parameters of the new device and the output parameters with which the | 45 // parameters of the new device and the output parameters with which the |
| 46 // mixer was initialized. See crbug.com/506507 | 46 // mixer was initialized. See crbug.com/506507 |
| 47 OutputDevice* GetOutputDevice(); | 47 OutputDevice* GetOutputDevice(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // AudioRendererSink::RenderCallback implementation. | 50 // AudioRendererSink::RenderCallback implementation. |
| 51 int Render(AudioBus* audio_bus, int audio_delay_milliseconds) override; | 51 int Render(AudioBus* audio_bus, |
| 52 int audio_delay_milliseconds, |
| 53 uint32_t frames_skipped) override; |
| 52 void OnRenderError() override; | 54 void OnRenderError() override; |
| 53 | 55 |
| 54 // Output sink for this mixer. | 56 // Output sink for this mixer. |
| 55 scoped_refptr<AudioRendererSink> audio_sink_; | 57 scoped_refptr<AudioRendererSink> audio_sink_; |
| 56 | 58 |
| 57 // ---------------[ All variables below protected by |lock_| ]--------------- | 59 // ---------------[ All variables below protected by |lock_| ]--------------- |
| 58 base::Lock lock_; | 60 base::Lock lock_; |
| 59 | 61 |
| 60 // List of error callbacks used by this mixer. | 62 // List of error callbacks used by this mixer. |
| 61 typedef std::list<base::Closure> ErrorCallbackList; | 63 typedef std::list<base::Closure> ErrorCallbackList; |
| 62 ErrorCallbackList error_callbacks_; | 64 ErrorCallbackList error_callbacks_; |
| 63 | 65 |
| 64 // Handles mixing and resampling between input and output parameters. | 66 // Handles mixing and resampling between input and output parameters. |
| 65 AudioConverter audio_converter_; | 67 AudioConverter audio_converter_; |
| 66 | 68 |
| 67 // Handles physical stream pause when no inputs are playing. For latency | 69 // Handles physical stream pause when no inputs are playing. For latency |
| 68 // reasons we don't want to immediately pause the physical stream. | 70 // reasons we don't want to immediately pause the physical stream. |
| 69 base::TimeDelta pause_delay_; | 71 base::TimeDelta pause_delay_; |
| 70 base::TimeTicks last_play_time_; | 72 base::TimeTicks last_play_time_; |
| 71 bool playing_; | 73 bool playing_; |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); | 75 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace media | 78 } // namespace media |
| 77 | 79 |
| 78 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 80 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
| OLD | NEW |