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

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

Issue 2712843002: media: Add DecoderConfigType in DecoderStreamTraits (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | media/filters/decoder_stream.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 #include "media/filters/decoder_selector.h" 5 #include "media/filters/decoder_selector.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 127
128 #if !defined(OS_ANDROID) 128 #if !defined(OS_ANDROID)
129 template <DemuxerStream::Type StreamType> 129 template <DemuxerStream::Type StreamType>
130 void DecoderSelector<StreamType>::InitializeDecryptingDecoder() { 130 void DecoderSelector<StreamType>::InitializeDecryptingDecoder() {
131 DVLOG(2) << __func__; 131 DVLOG(2) << __func__;
132 decoder_.reset(new typename StreamTraits::DecryptingDecoderType( 132 decoder_.reset(new typename StreamTraits::DecryptingDecoderType(
133 task_runner_, media_log_, waiting_for_decryption_key_cb_)); 133 task_runner_, media_log_, waiting_for_decryption_key_cb_));
134 134
135 traits_->InitializeDecoder( 135 traits_->InitializeDecoder(
136 decoder_.get(), input_stream_, cdm_context_, 136 decoder_.get(), StreamTraits::GetDecoderConfig(input_stream_),
137 input_stream_->liveness() == DemuxerStream::LIVENESS_LIVE, cdm_context_,
137 base::Bind(&DecoderSelector<StreamType>::DecryptingDecoderInitDone, 138 base::Bind(&DecoderSelector<StreamType>::DecryptingDecoderInitDone,
138 weak_ptr_factory_.GetWeakPtr()), 139 weak_ptr_factory_.GetWeakPtr()),
139 output_cb_); 140 output_cb_);
140 } 141 }
141 142
142 template <DemuxerStream::Type StreamType> 143 template <DemuxerStream::Type StreamType>
143 void DecoderSelector<StreamType>::DecryptingDecoderInitDone(bool success) { 144 void DecoderSelector<StreamType>::DecryptingDecoderInitDone(bool success) {
144 DVLOG(2) << __func__ << ": success=" << success; 145 DVLOG(2) << __func__ << ": success=" << success;
145 DCHECK(task_runner_->BelongsToCurrentThread()); 146 DCHECK(task_runner_->BelongsToCurrentThread());
146 147
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 202
202 if (decoders_.empty()) { 203 if (decoders_.empty()) {
203 ReturnNullDecoder(); 204 ReturnNullDecoder();
204 return; 205 return;
205 } 206 }
206 207
207 decoder_.reset(decoders_.front()); 208 decoder_.reset(decoders_.front());
208 decoders_.weak_erase(decoders_.begin()); 209 decoders_.weak_erase(decoders_.begin());
209 210
210 traits_->InitializeDecoder( 211 traits_->InitializeDecoder(
211 decoder_.get(), input_stream_, cdm_context_, 212 decoder_.get(), StreamTraits::GetDecoderConfig(input_stream_),
213 input_stream_->liveness() == DemuxerStream::LIVENESS_LIVE, cdm_context_,
212 base::Bind(&DecoderSelector<StreamType>::DecoderInitDone, 214 base::Bind(&DecoderSelector<StreamType>::DecoderInitDone,
213 weak_ptr_factory_.GetWeakPtr()), 215 weak_ptr_factory_.GetWeakPtr()),
214 output_cb_); 216 output_cb_);
215 } 217 }
216 218
217 template <DemuxerStream::Type StreamType> 219 template <DemuxerStream::Type StreamType>
218 void DecoderSelector<StreamType>::DecoderInitDone(bool success) { 220 void DecoderSelector<StreamType>::DecoderInitDone(bool success) {
219 DVLOG(2) << __func__ << ": success=" << success; 221 DVLOG(2) << __func__ << ": success=" << success;
220 DCHECK(task_runner_->BelongsToCurrentThread()); 222 DCHECK(task_runner_->BelongsToCurrentThread());
221 223
(...skipping 22 matching lines...) Expand all
244 246
245 // These forward declarations tell the compiler that we will use 247 // These forward declarations tell the compiler that we will use
246 // DecoderSelector with these arguments, allowing us to keep these definitions 248 // DecoderSelector with these arguments, allowing us to keep these definitions
247 // in our .cc without causing linker errors. This also means if anyone tries to 249 // in our .cc without causing linker errors. This also means if anyone tries to
248 // instantiate a DecoderSelector with anything but these two specializations 250 // instantiate a DecoderSelector with anything but these two specializations
249 // they'll most likely get linker errors. 251 // they'll most likely get linker errors.
250 template class DecoderSelector<DemuxerStream::AUDIO>; 252 template class DecoderSelector<DemuxerStream::AUDIO>;
251 template class DecoderSelector<DemuxerStream::VIDEO>; 253 template class DecoderSelector<DemuxerStream::VIDEO>;
252 254
253 } // namespace media 255 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/decoder_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698