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_SINK_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... | |
34 public: | 34 public: |
35 class RenderCallback { | 35 class RenderCallback { |
36 public: | 36 public: |
37 // Attempts to completely fill all channels of |dest|, returns actual | 37 // Attempts to completely fill all channels of |dest|, returns actual |
38 // number of frames filled. | 38 // number of frames filled. |
39 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; | 39 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; |
40 | 40 |
41 // Signals an error has occurred. | 41 // Signals an error has occurred. |
42 virtual void OnRenderError() = 0; | 42 virtual void OnRenderError() = 0; |
43 | 43 |
44 // Signals that the consumer has skipped frames in playout. | |
DaleCurtis
2015/12/01 18:12:46
Why a new method instead of rolling this into the
Henrik Grunell
2015/12/03 17:01:07
I had some reason that I don't recall or can figur
| |
45 // TODO BEFORE COMMIT: Pure virtual. | |
46 virtual void OnFramesSkipped(uint32_t frames_skipped){}; | |
47 | |
44 protected: | 48 protected: |
45 virtual ~RenderCallback() {} | 49 virtual ~RenderCallback() {} |
46 }; | 50 }; |
47 | 51 |
48 // Sets important information about the audio stream format. | 52 // Sets important information about the audio stream format. |
49 // It must be called before any of the other methods. | 53 // It must be called before any of the other methods. |
50 virtual void Initialize(const AudioParameters& params, | 54 virtual void Initialize(const AudioParameters& params, |
51 RenderCallback* callback) = 0; | 55 RenderCallback* callback) = 0; |
52 | 56 |
53 // Starts audio playback. | 57 // Starts audio playback. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 // this. | 89 // this. |
86 | 90 |
87 class RestartableAudioRendererSink : public AudioRendererSink { | 91 class RestartableAudioRendererSink : public AudioRendererSink { |
88 protected: | 92 protected: |
89 ~RestartableAudioRendererSink() override {} | 93 ~RestartableAudioRendererSink() override {} |
90 }; | 94 }; |
91 | 95 |
92 } // namespace media | 96 } // namespace media |
93 | 97 |
94 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 98 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |
OLD | NEW |