OLD | NEW |
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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // The caller should call DecryptingDemuxerStream::Reset() before | 49 // The caller should call DecryptingDemuxerStream::Reset() before |
50 // calling Decoder::Reset() to release any pending decryption or read. | 50 // calling Decoder::Reset() to release any pending decryption or read. |
51 typedef base::Callback<void(std::unique_ptr<Decoder>, | 51 typedef base::Callback<void(std::unique_ptr<Decoder>, |
52 std::unique_ptr<DecryptingDemuxerStream>)> | 52 std::unique_ptr<DecryptingDemuxerStream>)> |
53 SelectDecoderCB; | 53 SelectDecoderCB; |
54 | 54 |
55 // |decoders| contains the Decoders to use when initializing. | 55 // |decoders| contains the Decoders to use when initializing. |
56 DecoderSelector( | 56 DecoderSelector( |
57 const scoped_refptr<base::SingleThreadTaskRunner>& message_loop, | 57 const scoped_refptr<base::SingleThreadTaskRunner>& message_loop, |
58 ScopedVector<Decoder> decoders, | 58 ScopedVector<Decoder> decoders, |
59 const scoped_refptr<MediaLog>& media_log); | 59 MediaLog* media_log); |
60 | 60 |
61 // Aborts pending Decoder selection and fires |select_decoder_cb| with | 61 // Aborts pending Decoder selection and fires |select_decoder_cb| with |
62 // NULL and NULL immediately if it's pending. | 62 // NULL and NULL immediately if it's pending. |
63 ~DecoderSelector(); | 63 ~DecoderSelector(); |
64 | 64 |
65 // Initializes and selects the first Decoder that can decode the |stream|. | 65 // Initializes and selects the first Decoder that can decode the |stream|. |
66 // The selected Decoder (and DecryptingDemuxerStream) is returned via | 66 // The selected Decoder (and DecryptingDemuxerStream) is returned via |
67 // the |select_decoder_cb|. | 67 // the |select_decoder_cb|. |
68 // Notes: | 68 // Notes: |
69 // 1. This must not be called again before |select_decoder_cb| is run. | 69 // 1. This must not be called again before |select_decoder_cb| is run. |
(...skipping 14 matching lines...) Expand all Loading... |
84 void DecryptingDecoderInitDone(bool success); | 84 void DecryptingDecoderInitDone(bool success); |
85 #endif | 85 #endif |
86 void InitializeDecryptingDemuxerStream(); | 86 void InitializeDecryptingDemuxerStream(); |
87 void DecryptingDemuxerStreamInitDone(PipelineStatus status); | 87 void DecryptingDemuxerStreamInitDone(PipelineStatus status); |
88 void InitializeDecoder(); | 88 void InitializeDecoder(); |
89 void DecoderInitDone(bool success); | 89 void DecoderInitDone(bool success); |
90 void ReturnNullDecoder(); | 90 void ReturnNullDecoder(); |
91 | 91 |
92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 92 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
93 ScopedVector<Decoder> decoders_; | 93 ScopedVector<Decoder> decoders_; |
94 scoped_refptr<MediaLog> media_log_; | 94 MediaLog* media_log_; |
95 | 95 |
96 StreamTraits* traits_; | 96 StreamTraits* traits_; |
97 | 97 |
98 // Could be the |stream| passed in SelectDecoder, or |decrypted_stream_| when | 98 // Could be the |stream| passed in SelectDecoder, or |decrypted_stream_| when |
99 // a DecryptingDemuxerStream is selected. | 99 // a DecryptingDemuxerStream is selected. |
100 DemuxerStream* input_stream_; | 100 DemuxerStream* input_stream_; |
101 | 101 |
102 CdmContext* cdm_context_; | 102 CdmContext* cdm_context_; |
103 SelectDecoderCB select_decoder_cb_; | 103 SelectDecoderCB select_decoder_cb_; |
104 typename Decoder::OutputCB output_cb_; | 104 typename Decoder::OutputCB output_cb_; |
(...skipping 10 matching lines...) Expand all Loading... |
115 | 115 |
116 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector); | 116 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderSelector); |
117 }; | 117 }; |
118 | 118 |
119 typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector; | 119 typedef DecoderSelector<DemuxerStream::VIDEO> VideoDecoderSelector; |
120 typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector; | 120 typedef DecoderSelector<DemuxerStream::AUDIO> AudioDecoderSelector; |
121 | 121 |
122 } // namespace media | 122 } // namespace media |
123 | 123 |
124 #endif // MEDIA_FILTERS_DECODER_SELECTOR_H_ | 124 #endif // MEDIA_FILTERS_DECODER_SELECTOR_H_ |
OLD | NEW |