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

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

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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/chunk_demuxer_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 <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
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
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
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_
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/decoder_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698