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

Side by Side Diff: media/filters/opus_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, 6 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 | « media/filters/gpu_video_decoder.cc ('k') | media/filters/opus_audio_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ 6 #define MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/audio_decoder.h" 10 #include "media/base/audio_decoder.h"
(...skipping 14 matching lines...) Expand all
25 struct QueuedAudioBuffer; 25 struct QueuedAudioBuffer;
26 26
27 class MEDIA_EXPORT OpusAudioDecoder : public AudioDecoder { 27 class MEDIA_EXPORT OpusAudioDecoder : public AudioDecoder {
28 public: 28 public:
29 explicit OpusAudioDecoder( 29 explicit OpusAudioDecoder(
30 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 30 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
31 virtual ~OpusAudioDecoder(); 31 virtual ~OpusAudioDecoder();
32 32
33 // AudioDecoder implementation. 33 // AudioDecoder implementation.
34 virtual void Initialize(const AudioDecoderConfig& config, 34 virtual void Initialize(const AudioDecoderConfig& config,
35 const PipelineStatusCB& status_cb) OVERRIDE; 35 const PipelineStatusCB& status_cb,
36 const OutputCB& output_cb) OVERRIDE;
36 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, 37 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer,
37 const DecodeCB& decode_cb) OVERRIDE; 38 const DecodeCB& decode_cb) OVERRIDE;
38 virtual void Reset(const base::Closure& closure) OVERRIDE; 39 virtual void Reset(const base::Closure& closure) OVERRIDE;
39 virtual void Stop() OVERRIDE; 40 virtual void Stop() OVERRIDE;
40 41
41 private: 42 private:
42 // Reads from the demuxer stream with corresponding callback method. 43 // Reads from the demuxer stream with corresponding callback method.
43 void ReadFromDemuxerStream(); 44 void ReadFromDemuxerStream();
44 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& input, 45 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& input,
45 const DecodeCB& decode_cb); 46 const DecodeCB& decode_cb);
46 47
47 bool ConfigureDecoder(); 48 bool ConfigureDecoder();
48 void CloseDecoder(); 49 void CloseDecoder();
49 void ResetTimestampState(); 50 void ResetTimestampState();
50 bool Decode(const scoped_refptr<DecoderBuffer>& input, 51 bool Decode(const scoped_refptr<DecoderBuffer>& input,
51 scoped_refptr<AudioBuffer>* output_buffer); 52 scoped_refptr<AudioBuffer>* output_buffer);
52 53
53 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 54 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
54 55
55 AudioDecoderConfig config_; 56 AudioDecoderConfig config_;
57 OutputCB output_cb_;
56 OpusMSDecoder* opus_decoder_; 58 OpusMSDecoder* opus_decoder_;
57 59
58 // When the input timestamp is |start_input_timestamp_| the decoder needs to 60 // When the input timestamp is |start_input_timestamp_| the decoder needs to
59 // drop |config_.codec_delay()| frames. 61 // drop |config_.codec_delay()| frames.
60 base::TimeDelta start_input_timestamp_; 62 base::TimeDelta start_input_timestamp_;
61 63
62 scoped_ptr<AudioDiscardHelper> discard_helper_; 64 scoped_ptr<AudioDiscardHelper> discard_helper_;
63 65
64 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder); 66 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder);
65 }; 67 };
66 68
67 } // namespace media 69 } // namespace media
68 70
69 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_ 71 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/filters/opus_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698