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

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

Issue 2517503003: Reland: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Comments from chcunningham@ and Dale Created 4 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 10 matching lines...) Expand all
21 // AudioRendererSink is an interface representing the end-point for 21 // AudioRendererSink is an interface representing the end-point for
22 // rendered audio. An implementation is expected to 22 // rendered audio. An implementation is expected to
23 // periodically call Render() on a callback object. 23 // periodically call Render() on a callback object.
24 24
25 class AudioRendererSink 25 class AudioRendererSink
26 : public base::RefCountedThreadSafe<media::AudioRendererSink> { 26 : public base::RefCountedThreadSafe<media::AudioRendererSink> {
27 public: 27 public:
28 class RenderCallback { 28 class RenderCallback {
29 public: 29 public:
30 // Attempts to completely fill all channels of |dest|, returns actual 30 // Attempts to completely fill all channels of |dest|, returns actual
31 // number of frames filled. |frames_skipped| contains the number of frames 31 // number of frames filled. |prior_frames_skipped| contains the number of
32 // frames
32 // the consumer has skipped, if any. 33 // the consumer has skipped, if any.
33 // TODO(jameswest): Change to use the same signature as 34 // The |delay| argument represents audio device output latency,
34 // AudioOutputStream::AudioSourceCallback::OnMoreData. 35 // |delay_timestamp| represents the time when |delay| was obtained.
35 virtual int Render(AudioBus* dest, 36 virtual int Render(base::TimeDelta delay,
36 uint32_t frames_delayed, 37 base::TimeTicks delay_timestamp,
37 uint32_t frames_skipped) = 0; 38 int prior_frames_skipped,
38 39 AudioBus* dest) = 0;
39 // Signals an error has occurred. 40 // Signals an error has occurred.
40 virtual void OnRenderError() = 0; 41 virtual void OnRenderError() = 0;
41 42
42 protected: 43 protected:
43 virtual ~RenderCallback() {} 44 virtual ~RenderCallback() {}
44 }; 45 };
45 46
46 // Sets important information about the audio stream format. 47 // Sets important information about the audio stream format.
47 // It must be called before any of the other methods. 48 // It must be called before any of the other methods.
48 virtual void Initialize(const AudioParameters& params, 49 virtual void Initialize(const AudioParameters& params,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 const url::Origin& security_origin, 104 const url::Origin& security_origin,
104 const OutputDeviceStatusCB& callback) = 0; 105 const OutputDeviceStatusCB& callback) = 0;
105 106
106 protected: 107 protected:
107 ~SwitchableAudioRendererSink() override {} 108 ~SwitchableAudioRendererSink() override {}
108 }; 109 };
109 110
110 } // namespace media 111 } // namespace media
111 112
112 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 113 #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