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

Side by Side Diff: media/filters/decrypting_audio_decoder.h

Issue 1143223007: media: Reland "Simplify {Audio|Video}Decoder initialization callback." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « media/filters/decoder_stream_traits.cc ('k') | media/filters/decrypting_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_DECRYPTING_AUDIO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ 6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 21 matching lines...) Expand all
32 public: 32 public:
33 DecryptingAudioDecoder( 33 DecryptingAudioDecoder(
34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
35 const SetDecryptorReadyCB& set_decryptor_ready_cb, 35 const SetDecryptorReadyCB& set_decryptor_ready_cb,
36 const base::Closure& waiting_for_decryption_key_cb); 36 const base::Closure& waiting_for_decryption_key_cb);
37 ~DecryptingAudioDecoder() override; 37 ~DecryptingAudioDecoder() override;
38 38
39 // AudioDecoder implementation. 39 // AudioDecoder implementation.
40 std::string GetDisplayName() const override; 40 std::string GetDisplayName() const override;
41 void Initialize(const AudioDecoderConfig& config, 41 void Initialize(const AudioDecoderConfig& config,
42 const PipelineStatusCB& status_cb, 42 const InitCB& init_cb,
43 const OutputCB& output_cb) override; 43 const OutputCB& output_cb) override;
44 void Decode(const scoped_refptr<DecoderBuffer>& buffer, 44 void Decode(const scoped_refptr<DecoderBuffer>& buffer,
45 const DecodeCB& decode_cb) override; 45 const DecodeCB& decode_cb) override;
46 void Reset(const base::Closure& closure) override; 46 void Reset(const base::Closure& closure) override;
47 47
48 private: 48 private:
49 // For a detailed state diagram please see this link: http://goo.gl/8jAok 49 // For a detailed state diagram please see this link: http://goo.gl/8jAok
50 // TODO(xhwang): Add a ASCII state diagram in this file after this class 50 // TODO(xhwang): Add a ASCII state diagram in this file after this class
51 // stabilizes. 51 // stabilizes.
52 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder. 52 // TODO(xhwang): Update this diagram for DecryptingAudioDecoder.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // Resets decoder and calls |reset_cb_|. 86 // Resets decoder and calls |reset_cb_|.
87 void DoReset(); 87 void DoReset();
88 88
89 // Sets timestamps for |frames| and then passes them to |output_cb_|. 89 // Sets timestamps for |frames| and then passes them to |output_cb_|.
90 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames); 90 void ProcessDecodedFrames(const Decryptor::AudioFrames& frames);
91 91
92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
93 93
94 State state_; 94 State state_;
95 95
96 PipelineStatusCB init_cb_; 96 InitCB init_cb_;
97 OutputCB output_cb_; 97 OutputCB output_cb_;
98 DecodeCB decode_cb_; 98 DecodeCB decode_cb_;
99 base::Closure reset_cb_; 99 base::Closure reset_cb_;
100 base::Closure waiting_for_decryption_key_cb_; 100 base::Closure waiting_for_decryption_key_cb_;
101 101
102 // The current decoder configuration. 102 // The current decoder configuration.
103 AudioDecoderConfig config_; 103 AudioDecoderConfig config_;
104 104
105 // Callback to request/cancel decryptor creation notification. 105 // Callback to request/cancel decryptor creation notification.
106 SetDecryptorReadyCB set_decryptor_ready_cb_; 106 SetDecryptorReadyCB set_decryptor_ready_cb_;
(...skipping 14 matching lines...) Expand all
121 121
122 base::WeakPtr<DecryptingAudioDecoder> weak_this_; 122 base::WeakPtr<DecryptingAudioDecoder> weak_this_;
123 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_; 123 base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_;
124 124
125 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); 125 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder);
126 }; 126 };
127 127
128 } // namespace media 128 } // namespace media
129 129
130 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ 130 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/decoder_stream_traits.cc ('k') | media/filters/decrypting_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698