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

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

Issue 2452183003: Revert of Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Created 4 years, 1 month 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. |prior_frames_skipped| contains the number of 31 // number of frames filled. |frames_skipped| contains the number of frames
32 // frames
33 // the consumer has skipped, if any. 32 // the consumer has skipped, if any.
34 // The |delay| argument represents audio device output latency, 33 // TODO(jameswest): Change to use the same signature as
35 // |delay_timestamp| represents the time when |delay| was obtained. 34 // AudioOutputStream::AudioSourceCallback::OnMoreData.
36 virtual int Render(base::TimeDelta delay, 35 virtual int Render(AudioBus* dest,
37 base::TimeTicks delay_timestamp, 36 uint32_t frames_delayed,
38 int prior_frames_skipped, 37 uint32_t frames_skipped) = 0;
39 AudioBus* dest) = 0; 38
40 // Signals an error has occurred. 39 // Signals an error has occurred.
41 virtual void OnRenderError() = 0; 40 virtual void OnRenderError() = 0;
42 41
43 protected: 42 protected:
44 virtual ~RenderCallback() {} 43 virtual ~RenderCallback() {}
45 }; 44 };
46 45
47 // Sets important information about the audio stream format. 46 // Sets important information about the audio stream format.
48 // It must be called before any of the other methods. 47 // It must be called before any of the other methods.
49 virtual void Initialize(const AudioParameters& params, 48 virtual void Initialize(const AudioParameters& params,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 const url::Origin& security_origin, 103 const url::Origin& security_origin,
105 const OutputDeviceStatusCB& callback) = 0; 104 const OutputDeviceStatusCB& callback) = 0;
106 105
107 protected: 106 protected:
108 ~SwitchableAudioRendererSink() override {} 107 ~SwitchableAudioRendererSink() override {}
109 }; 108 };
110 109
111 } // namespace media 110 } // namespace media
112 111
113 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 112 #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