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

Side by Side Diff: media/filters/decoder_selector.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/audio_decoder_unittest.cc ('k') | media/filters/decoder_selector.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_DECODER_SELECTOR_H_ 5 #ifndef MEDIA_FILTERS_DECODER_SELECTOR_H_
6 #define MEDIA_FILTERS_DECODER_SELECTOR_H_ 6 #define MEDIA_FILTERS_DECODER_SELECTOR_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_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // select from the decoders following the decoder that was last returned. 67 // select from the decoders following the decoder that was last returned.
68 // 3. |set_decryptor_ready_cb| is optional. If |set_decryptor_ready_cb| is 68 // 3. |set_decryptor_ready_cb| is optional. If |set_decryptor_ready_cb| is
69 // null, no decryptor will be available to perform decryption. 69 // null, no decryptor will be available to perform decryption.
70 void SelectDecoder(DemuxerStream* stream, 70 void SelectDecoder(DemuxerStream* stream,
71 const SetDecryptorReadyCB& set_decryptor_ready_cb, 71 const SetDecryptorReadyCB& set_decryptor_ready_cb,
72 const SelectDecoderCB& select_decoder_cb, 72 const SelectDecoderCB& select_decoder_cb,
73 const typename Decoder::OutputCB& output_cb, 73 const typename Decoder::OutputCB& output_cb,
74 const base::Closure& waiting_for_decryption_key_cb); 74 const base::Closure& waiting_for_decryption_key_cb);
75 75
76 private: 76 private:
77 void DecryptingDecoderInitDone(PipelineStatus status); 77 void DecryptingDecoderInitDone(bool success);
78 void DecryptingDemuxerStreamInitDone(PipelineStatus status); 78 void DecryptingDemuxerStreamInitDone(PipelineStatus status);
79 void InitializeDecoder(); 79 void InitializeDecoder();
80 void DecoderInitDone(PipelineStatus status); 80 void DecoderInitDone(bool success);
81 void ReturnNullDecoder(); 81 void ReturnNullDecoder();
82 82
83 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 83 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
84 ScopedVector<Decoder> decoders_; 84 ScopedVector<Decoder> decoders_;
85 85
86 DemuxerStream* input_stream_; 86 DemuxerStream* input_stream_;
87 SetDecryptorReadyCB set_decryptor_ready_cb_; 87 SetDecryptorReadyCB set_decryptor_ready_cb_;
88 SelectDecoderCB select_decoder_cb_; 88 SelectDecoderCB select_decoder_cb_;
89 typename Decoder::OutputCB output_cb_; 89 typename Decoder::OutputCB output_cb_;
90 base::Closure waiting_for_decryption_key_cb_; 90 base::Closure waiting_for_decryption_key_cb_;
91 91
92 scoped_ptr<Decoder> decoder_; 92 scoped_ptr<Decoder> decoder_;
93 scoped_ptr<DecryptingDemuxerStream> decrypted_stream_; 93 scoped_ptr<DecryptingDemuxerStream> decrypted_stream_;
94 94
95 // NOTE: Weak pointers must be invalidated before all other member variables. 95 // NOTE: Weak pointers must be invalidated before all other member variables.
96 base::WeakPtrFactory<DecoderSelector> weak_ptr_factory_; 96 base::WeakPtrFactory<DecoderSelector> weak_ptr_factory_;
97 97
98 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector); 98 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector);
99 }; 99 };
100 100
101 typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector; 101 typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector;
102 typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector; 102 typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector;
103 103
104 } // namespace media 104 } // namespace media
105 105
106 #endif // MEDIA_FILTERS_DECODER_SELECTOR_H_ 106 #endif // MEDIA_FILTERS_DECODER_SELECTOR_H_
OLDNEW
« no previous file with comments | « media/filters/audio_decoder_unittest.cc ('k') | media/filters/decoder_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698