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

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

Issue 1442933002: media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile errors Created 5 years, 1 month 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/opus_audio_decoder.h ('k') | media/filters/video_decoder_selector_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/opus_audio_decoder.h" 5 #include "media/filters/opus_audio_decoder.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 OpusAudioDecoder::OpusAudioDecoder( 126 OpusAudioDecoder::OpusAudioDecoder(
127 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) 127 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
128 : task_runner_(task_runner), opus_decoder_(nullptr) {} 128 : task_runner_(task_runner), opus_decoder_(nullptr) {}
129 129
130 std::string OpusAudioDecoder::GetDisplayName() const { 130 std::string OpusAudioDecoder::GetDisplayName() const {
131 return "OpusAudioDecoder"; 131 return "OpusAudioDecoder";
132 } 132 }
133 133
134 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config, 134 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config,
135 const SetCdmReadyCB& /* set_cdm_ready_cb */,
135 const InitCB& init_cb, 136 const InitCB& init_cb,
136 const OutputCB& output_cb) { 137 const OutputCB& output_cb) {
137 DCHECK(task_runner_->BelongsToCurrentThread()); 138 DCHECK(task_runner_->BelongsToCurrentThread());
138 InitCB bound_init_cb = BindToCurrentLoop(init_cb); 139 InitCB bound_init_cb = BindToCurrentLoop(init_cb);
139 140
140 if (config.is_encrypted()) { 141 if (config.is_encrypted()) {
141 bound_init_cb.Run(false); 142 bound_init_cb.Run(false);
142 return; 143 return;
143 } 144 }
144 145
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 output_buffer->get()->TrimEnd(trim_frames); 353 output_buffer->get()->TrimEnd(trim_frames);
353 354
354 // Handles discards and timestamping. Discard the buffer if more data needed. 355 // Handles discards and timestamping. Discard the buffer if more data needed.
355 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) 356 if (!discard_helper_->ProcessBuffers(input, *output_buffer))
356 *output_buffer = nullptr; 357 *output_buffer = nullptr;
357 358
358 return true; 359 return true;
359 } 360 }
360 361
361 } // namespace media 362 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/opus_audio_decoder.h ('k') | media/filters/video_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698