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

Unified Diff: media/base/audio_decoder.h

Issue 297553002: Add callback in VideoDecoder and AudioDecoder to return decoded frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/video_decoder.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
index 5c5e2941175dc8911cda4ae89db80c5aa7b982e0..39d4096e29cfd3a906eec02685d0b653a790cf81 100644
--- a/media/base/audio_decoder.h
+++ b/media/base/audio_decoder.h
@@ -26,11 +26,16 @@ class MEDIA_EXPORT AudioDecoder {
enum Status {
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.
};
+ // Callback to return decoded buffers.
+ typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB;
+
+ // Callback for Decode();
+ typedef base::Callback<void(Status)> DecodeCB;
xhwang 2014/05/29 22:15:14 What does this exactly mean? We need a comment her
Sergey Ulanov 2014/06/03 00:08:11 Done.
+
AudioDecoder();
virtual ~AudioDecoder();
@@ -38,7 +43,8 @@ class MEDIA_EXPORT AudioDecoder {
// callback upon completion.
// statistics_cb is used to update global pipeline statistics.
xhwang 2014/05/29 22:15:14 Add a comment on |output_cb|.
Sergey Ulanov 2014/06/03 00:08:11 Done.
virtual void Initialize(const AudioDecoderConfig& config,
- const PipelineStatusCB& status_cb) = 0;
+ const PipelineStatusCB& status_cb,
+ const OutputCB& output_cb) = 0;
// Requests samples to be decoded and returned via the provided callback.
xhwang 2014/05/29 22:15:14 This needs to be updated.
Sergey Ulanov 2014/06/03 00:08:11 Done.
// Only one decode may be in flight at any given time.
@@ -49,16 +55,9 @@ class MEDIA_EXPORT AudioDecoder {
// 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
// Decode().
- typedef base::Callback<void(Status, const scoped_refptr<AudioBuffer>&)>
- 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;
xhwang 2014/05/29 22:15:14 In this case, shall all decoded frames be simply d
Sergey Ulanov 2014/06/03 00:08:11 I think the comment is not entirely true. The buff
xhwang 2014/06/05 21:53:48 To clarify, do you mean when Reset() is called, th
Sergey Ulanov 2014/06/06 22:49:39 Yes, that's right.
« no previous file with comments | « no previous file | media/base/audio_decoder.cc » ('j') | media/base/video_decoder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698