summaryrefslogtreecommitdiff
path: root/media/base/audio_decoder.h
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-03-18 10:20:56 +0000
committerTorne (Richard Coles) <torne@google.com>2014-03-18 10:20:56 +0000
commita1401311d1ab56c4ed0a474bd38c108f75cb0cd9 (patch)
tree3437151d9ae1ce20a1e53a0d98c19ca01c786394 /media/base/audio_decoder.h
parentaf5066f1e36c6579e74752647e6c584438f80f94 (diff)
downloadchromium_org-a1401311d1ab56c4ed0a474bd38c108f75cb0cd9.tar.gz
Merge from Chromium at DEPS revision 257591
This commit was generated by merge_to_master.py. Change-Id: I0010df2ec3fbb5d4947cd026de2feb150ce7a6b5
Diffstat (limited to 'media/base/audio_decoder.h')
-rw-r--r--media/base/audio_decoder.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/media/base/audio_decoder.h b/media/base/audio_decoder.h
index 5aefb84aa6..901126d45b 100644
--- a/media/base/audio_decoder.h
+++ b/media/base/audio_decoder.h
@@ -7,9 +7,11 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "media/base/audio_decoder_config.h"
#include "media/base/channel_layout.h"
-#include "media/base/pipeline_status.h"
+#include "media/base/decoder_buffer.h"
#include "media/base/media_export.h"
+#include "media/base/pipeline_status.h"
namespace media {
@@ -18,11 +20,15 @@ class DemuxerStream;
class MEDIA_EXPORT AudioDecoder {
public:
- // Status codes for read operations.
+ // Status codes for decode operations.
+ // TODO(rileya): Now that both AudioDecoder and VideoDecoder Status enums
+ // match, break them into a decoder_status.h.
enum Status {
- kOk,
- kAborted,
- kDecodeError,
+ kOk, // We're all good.
+ kAborted, // We aborted as a result of Stop() or Reset().
+ kNotEnoughData, // Not enough data to produce a video frame.
+ kDecodeError, // A decoding error occurred.
+ kDecryptError // Decrypting error happened.
};
AudioDecoder();
@@ -31,23 +37,27 @@ class MEDIA_EXPORT AudioDecoder {
// Initializes an AudioDecoder with the given DemuxerStream, executing the
// callback upon completion.
// statistics_cb is used to update global pipeline statistics.
- virtual void Initialize(DemuxerStream* stream,
- const PipelineStatusCB& status_cb,
- const StatisticsCB& statistics_cb) = 0;
+ virtual void Initialize(const AudioDecoderConfig& config,
+ const PipelineStatusCB& status_cb) = 0;
// Requests samples to be decoded and returned via the provided callback.
- // Only one read may be in flight at any given time.
+ // Only one decode 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.
+ // Decode().
typedef base::Callback<void(Status, const scoped_refptr<AudioBuffer>&)>
- ReadCB;
- virtual void Read(const ReadCB& read_cb) = 0;
+ DecodeCB;
+ virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer,
+ const DecodeCB& decode_cb) = 0;
+
+ // Some AudioDecoders will queue up multiple AudioBuffers from a single
+ // DecoderBuffer, if we have any such queued buffers this will return the next
+ // one. Otherwise we return a NULL AudioBuffer.
+ virtual scoped_refptr<AudioBuffer> GetDecodeOutput();
// Resets decoder state, dropping any queued encoded data.
virtual void Reset(const base::Closure& closure) = 0;