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

Unified Diff: media/filters/decoder_stream.h

Issue 141243003: Add AudioBufferStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decoderstream_rebased
Patch Set: add TODOs Created 6 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/decoder_stream.h
diff --git a/media/filters/decoder_stream.h b/media/filters/decoder_stream.h
index 8f4658b34ddbe0e3ab1da13d0483e4e166108047..f511b0a6a260d425711f5b68df33a3f16c37bc7a 100644
--- a/media/filters/decoder_stream.h
+++ b/media/filters/decoder_stream.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
+#include "media/base/audio_decoder.h"
#include "media/base/decryptor.h"
#include "media/base/demuxer_stream.h"
#include "media/base/media_export.h"
@@ -34,6 +35,7 @@ class MEDIA_EXPORT DecoderStream {
typedef typename StreamTraits::DecoderType Decoder;
typedef typename StreamTraits::OutputType Output;
typedef typename StreamTraits::StreamInitCB InitCB;
+ typedef typename Decoder::Status DecoderStatus;
enum Status {
OK, // Everything went as planned.
@@ -82,6 +84,10 @@ class MEDIA_EXPORT DecoderStream {
// an Output.
bool CanReadWithoutStalling() const;
+ // TODO(rileya): Remove this once channel_layout/bits_per_channel/etc getters
+ // have been removed from AudioDecoder and plumbed elsewhere.
+ Decoder* decoder() { return decoder_.get(); }
+
private:
enum State {
STATE_UNINITIALIZED,
@@ -102,7 +108,8 @@ class MEDIA_EXPORT DecoderStream {
scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream);
// Satisfy pending |read_cb_| with |status| and |output|.
- void SatisfyRead(Status status, const scoped_refptr<Output>& output);
+ void SatisfyRead(Status status,
+ const scoped_refptr<Output>& output);
// Abort pending |read_cb_|.
void AbortRead();
@@ -116,7 +123,7 @@ class MEDIA_EXPORT DecoderStream {
// Callback for Decoder::Decode().
void OnDecodeOutputReady(int buffer_size,
- typename Decoder::Status status,
+ DecoderStatus status,
const scoped_refptr<Output>& output);
// Reads a buffer from |stream_| and returns the result via OnBufferReady().
@@ -162,7 +169,11 @@ class MEDIA_EXPORT DecoderStream {
DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream);
};
+template <>
+void DecoderStream<DemuxerStream::AUDIO>::ReadFromDemuxerStream();
+
typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream;
+typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream;
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698