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

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

Issue 9325044: Remove AudioDecoder from the Filter heirarchy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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 | « no previous file | media/base/audio_decoder.cc » ('j') | media/base/pipeline.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_AUDIO_DECODER_H_
6 #define MEDIA_BASE_AUDIO_DECODER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/time.h"
10 #include "media/base/channel_layout.h"
11 #include "media/base/demuxer_stream.h"
12 #include "media/base/filters.h"
13 #include "media/base/pipeline_status.h"
14 #include "media/base/media_export.h"
15
16 namespace media {
17
18 class MEDIA_EXPORT AudioDecoder
19 : public base::RefCountedThreadSafe<AudioDecoder> {
20 public:
21 // Initialize a AudioDecoder with the given DemuxerStream, executing the
22 // callback upon completion.
23 // stats_callback is used to update global pipeline statistics.
24 virtual void Initialize(DemuxerStream* stream,
scherkus (not reviewing) 2012/02/03 23:31:29 I thought we agreed to do const scoped_refptr<T>&
Ami GONE FROM CHROMIUM 2012/02/04 00:10:21 Not sure who 'we' is... ffmpeg_audio_decoder.cc h
25 const PipelineStatusCB& callback,
26 const StatisticsCallback& stats_callback) = 0;
27
28 // Request samples to be decoded and returned via the provided callback.
29 // Only one read may be in flight at any given time.
30 //
31 // Implementations guarantee that the callback will not be called from within
32 // this method.
33 //
34 // Non-NULL sample buffer pointers will contain decoded audio data or may
35 // indicate the end of the stream. A NULL buffer pointer indicates an aborted
36 // Read(). This can happen if the DemuxerStream gets flushed and doesn't have
37 // any more data to return.
38 typedef base::Callback<void(scoped_refptr<Buffer>)> ReadCB;
39 virtual void Read(const ReadCB& callback) = 0;
40
41 // Returns various information about the decoded audio format.
42 virtual int bits_per_channel() = 0;
43 virtual ChannelLayout channel_layout() = 0;
44 virtual int samples_per_second() = 0;
45
46 protected:
47 friend class base::RefCountedThreadSafe<AudioDecoder>;
48 virtual ~AudioDecoder();
49 AudioDecoder();
50
51 DISALLOW_COPY_AND_ASSIGN(AudioDecoder);
52 };
53
54 } // namespace media
55
56 #endif // MEDIA_BASE_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_decoder.cc » ('j') | media/base/pipeline.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698