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

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

Issue 935243002: Decryptors can report kNoKey to WebMediaPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android changes Created 5 years, 9 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
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // the |select_decoder_cb|. 63 // the |select_decoder_cb|.
64 // Notes: 64 // Notes:
65 // 1. This must not be called again before |select_decoder_cb| is run. 65 // 1. This must not be called again before |select_decoder_cb| is run.
66 // 2. Decoders that fail to initialize will be deleted. Future calls will 66 // 2. Decoders that fail to initialize will be deleted. Future calls will
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 75
75 private: 76 private:
76 void DecryptingDecoderInitDone(PipelineStatus status); 77 void DecryptingDecoderInitDone(PipelineStatus status);
77 void DecryptingDemuxerStreamInitDone(PipelineStatus status); 78 void DecryptingDemuxerStreamInitDone(PipelineStatus status);
78 void InitializeDecoder(); 79 void InitializeDecoder();
79 void DecoderInitDone(PipelineStatus status); 80 void DecoderInitDone(PipelineStatus status);
80 void ReturnNullDecoder(); 81 void ReturnNullDecoder();
81 82
82 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 83 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
83 ScopedVector<Decoder> decoders_; 84 ScopedVector<Decoder> decoders_;
84 85
85 DemuxerStream* input_stream_; 86 DemuxerStream* input_stream_;
86 SetDecryptorReadyCB set_decryptor_ready_cb_; 87 SetDecryptorReadyCB set_decryptor_ready_cb_;
87 SelectDecoderCB select_decoder_cb_; 88 SelectDecoderCB select_decoder_cb_;
88 typename Decoder::OutputCB output_cb_; 89 typename Decoder::OutputCB output_cb_;
90 base::Closure waiting_for_decryption_key_cb_;
89 91
90 scoped_ptr<Decoder> decoder_; 92 scoped_ptr<Decoder> decoder_;
91 scoped_ptr<DecryptingDemuxerStream> decrypted_stream_; 93 scoped_ptr<DecryptingDemuxerStream> decrypted_stream_;
92 94
93 // NOTE: Weak pointers must be invalidated before all other member variables. 95 // NOTE: Weak pointers must be invalidated before all other member variables.
94 base::WeakPtrFactory<DecoderSelector> weak_ptr_factory_; 96 base::WeakPtrFactory<DecoderSelector> weak_ptr_factory_;
95 97
96 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector); 98 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector);
97 }; 99 };
98 100
99 typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector; 101 typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector;
100 typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector; 102 typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector;
101 103
102 } // namespace media 104 } // namespace media
103 105
104 #endif // MEDIA_FILTERS_DECODER_SELECTOR_H_ 106 #endif // MEDIA_FILTERS_DECODER_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698