Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1391)

Side by Side Diff: media/base/audio_renderer_sink.h

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/audio_renderer_mixer_unittest.cc ('k') | media/base/fake_audio_render_callback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17 matching lines...) Expand all
28 // AudioRendererSink is an interface representing the end-point for 28 // AudioRendererSink is an interface representing the end-point for
29 // rendered audio. An implementation is expected to 29 // rendered audio. An implementation is expected to
30 // periodically call Render() on a callback object. 30 // periodically call Render() on a callback object.
31 31
32 class AudioRendererSink 32 class AudioRendererSink
33 : public base::RefCountedThreadSafe<media::AudioRendererSink> { 33 : public base::RefCountedThreadSafe<media::AudioRendererSink> {
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. |frames_skipped| contains the number of frames
39 virtual int Render(AudioBus* dest, int audio_delay_milliseconds) = 0; 39 // the consumer has skipped, if any.
40 virtual int Render(AudioBus* dest,
41 uint32_t audio_delay_milliseconds,
42 uint32_t frames_skipped) = 0;
40 43
41 // Signals an error has occurred. 44 // Signals an error has occurred.
42 virtual void OnRenderError() = 0; 45 virtual void OnRenderError() = 0;
43 46
44 protected: 47 protected:
45 virtual ~RenderCallback() {} 48 virtual ~RenderCallback() {}
46 }; 49 };
47 50
48 // Sets important information about the audio stream format. 51 // Sets important information about the audio stream format.
49 // It must be called before any of the other methods. 52 // It must be called before any of the other methods.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // this. 88 // this.
86 89
87 class RestartableAudioRendererSink : public AudioRendererSink { 90 class RestartableAudioRendererSink : public AudioRendererSink {
88 protected: 91 protected:
89 ~RestartableAudioRendererSink() override {} 92 ~RestartableAudioRendererSink() override {}
90 }; 93 };
91 94
92 } // namespace media 95 } // namespace media
93 96
94 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 97 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
OLDNEW
« no previous file with comments | « media/base/audio_renderer_mixer_unittest.cc ('k') | media/base/fake_audio_render_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698