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

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

Issue 9234066: Detect errors in audio output and report them upstream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/filters/ffmpeg_demuxer.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 8 #include <vector>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 // Fills entire buffer of length |number_of_frames| but returns actual 26 // Fills entire buffer of length |number_of_frames| but returns actual
27 // number of frames it got from its source (|number_of_frames| in case of 27 // number of frames it got from its source (|number_of_frames| in case of
28 // continuous stream). That actual number of frames is passed to host 28 // continuous stream). That actual number of frames is passed to host
29 // together with PCM audio data and host is free to use or ignore it. 29 // together with PCM audio data and host is free to use or ignore it.
30 // TODO(crogers): use base:Callback instead. 30 // TODO(crogers): use base:Callback instead.
31 virtual size_t Render(const std::vector<float*>& audio_data, 31 virtual size_t Render(const std::vector<float*>& audio_data,
32 size_t number_of_frames, 32 size_t number_of_frames,
33 size_t audio_delay_milliseconds) = 0; 33 size_t audio_delay_milliseconds) = 0;
34 34
35 // Signals an error has occurred.
36 virtual void OnError() = 0;
37
35 protected: 38 protected:
36 virtual ~RenderCallback() {} 39 virtual ~RenderCallback() {}
37 }; 40 };
38 41
39 virtual ~AudioRendererSink() {} 42 virtual ~AudioRendererSink() {}
40 43
41 // Sets important information about the audio stream format. 44 // Sets important information about the audio stream format.
42 // It must be called before any of the other methods. 45 // It must be called before any of the other methods.
43 virtual void Initialize(size_t buffer_size, 46 virtual void Initialize(size_t buffer_size,
44 int channels, 47 int channels,
(...skipping 17 matching lines...) Expand all
62 // Returns |true| on success. 65 // Returns |true| on success.
63 virtual bool SetVolume(double volume) = 0; 66 virtual bool SetVolume(double volume) = 0;
64 67
65 // Gets the playback volume, with range [0.0, 1.0] inclusive. 68 // Gets the playback volume, with range [0.0, 1.0] inclusive.
66 virtual void GetVolume(double* volume) = 0; 69 virtual void GetVolume(double* volume) = 0;
67 }; 70 };
68 71
69 } // namespace media 72 } // namespace media
70 73
71 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 74 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/filters/ffmpeg_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698