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

Unified 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: Moved audio_decoder_ out of Pipeline; AudioRendererBase is in charge of it now. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/audio_decoder.cc » ('j') | media/base/filter_collection.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_decoder.h
diff --git a/media/base/audio_decoder.h b/media/base/audio_decoder.h
new file mode 100644
index 0000000000000000000000000000000000000000..621f948634fa91fda06bc6f65fd89f048a7511d7
--- /dev/null
+++ b/media/base/audio_decoder.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_AUDIO_DECODER_H_
+#define MEDIA_BASE_AUDIO_DECODER_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/time.h"
scherkus (not reviewing) 2012/02/06 21:04:04 don't see this used
Ami GONE FROM CHROMIUM 2012/02/06 21:38:48 Done.
+#include "media/base/channel_layout.h"
+#include "media/base/demuxer_stream.h"
scherkus (not reviewing) 2012/02/06 21:04:04 fwd declare some of these instead?
Ami GONE FROM CHROMIUM 2012/02/06 21:38:48 Done.
+#include "media/base/filters.h"
+#include "media/base/pipeline_status.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+class MEDIA_EXPORT AudioDecoder
+ : public base::RefCountedThreadSafe<AudioDecoder> {
scherkus (not reviewing) 2012/02/06 21:04:04 AFAIK after this patch we'll be very close to repl
Ami GONE FROM CHROMIUM 2012/02/06 21:38:48 Yep.
+ public:
+ // Initialize a AudioDecoder with the given DemuxerStream, executing the
scherkus (not reviewing) 2012/02/06 21:04:04 s/a/an
Ami GONE FROM CHROMIUM 2012/02/06 21:38:48 Done.
+ // callback upon completion.
+ // stats_callback is used to update global pipeline statistics.
+ virtual void Initialize(const scoped_refptr<DemuxerStream> stream,
+ const PipelineStatusCB& callback,
+ const StatisticsCallback& stats_callback) = 0;
+
+ // Request samples to be decoded and returned via the provided callback.
+ // Only one read may be in flight at any given time.
+ //
+ // Implementations guarantee that the callback will not be called from within
+ // this method.
+ //
+ // Non-NULL sample buffer pointers will contain decoded audio data or may
+ // indicate the end of the stream. A NULL buffer pointer indicates an aborted
+ // Read(). This can happen if the DemuxerStream gets flushed and doesn't have
+ // any more data to return.
+ typedef base::Callback<void(scoped_refptr<Buffer>)> ReadCB;
+ virtual void Read(const ReadCB& callback) = 0;
+
+ // Reset decoder state, dropping any queued encoded data.
+ virtual void Reset(const base::Closure& closure) = 0;
+
+ // Returns various information about the decoded audio format.
+ virtual int bits_per_channel() = 0;
+ virtual ChannelLayout channel_layout() = 0;
+ virtual int samples_per_second() = 0;
+
+ protected:
+ friend class base::RefCountedThreadSafe<AudioDecoder>;
+ virtual ~AudioDecoder();
+ AudioDecoder();
+
+ DISALLOW_COPY_AND_ASSIGN(AudioDecoder);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_AUDIO_DECODER_H_
« no previous file with comments | « no previous file | media/base/audio_decoder.cc » ('j') | media/base/filter_collection.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698