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

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

Issue 935243002: Decryptors can report kNoKey to WebMediaPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 OpusAudioDecoder::OpusAudioDecoder( 246 OpusAudioDecoder::OpusAudioDecoder(
247 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) 247 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
248 : task_runner_(task_runner), 248 : task_runner_(task_runner),
249 opus_decoder_(NULL), 249 opus_decoder_(NULL),
250 start_input_timestamp_(kNoTimestamp()) {} 250 start_input_timestamp_(kNoTimestamp()) {}
251 251
252 std::string OpusAudioDecoder::GetDisplayName() const { 252 std::string OpusAudioDecoder::GetDisplayName() const {
253 return "OpusAudioDecoder"; 253 return "OpusAudioDecoder";
254 } 254 }
255 255
256 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config, 256 void OpusAudioDecoder::Initialize(
257 const PipelineStatusCB& status_cb, 257 const AudioDecoderConfig& config,
258 const OutputCB& output_cb) { 258 const PipelineStatusCB& status_cb,
259 const OutputCB& output_cb,
260 const base::Closure& /* waiting_for_encryption_key_cb */) {
259 DCHECK(task_runner_->BelongsToCurrentThread()); 261 DCHECK(task_runner_->BelongsToCurrentThread());
260 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb); 262 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb);
261 263
262 config_ = config; 264 config_ = config;
263 output_cb_ = BindToCurrentLoop(output_cb); 265 output_cb_ = BindToCurrentLoop(output_cb);
264 266
265 if (!ConfigureDecoder()) { 267 if (!ConfigureDecoder()) {
266 initialize_cb.Run(DECODER_ERROR_NOT_SUPPORTED); 268 initialize_cb.Run(DECODER_ERROR_NOT_SUPPORTED);
267 return; 269 return;
268 } 270 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 output_buffer->get()->TrimEnd(trim_frames); 480 output_buffer->get()->TrimEnd(trim_frames);
479 481
480 // Handles discards and timestamping. Discard the buffer if more data needed. 482 // Handles discards and timestamping. Discard the buffer if more data needed.
481 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) 483 if (!discard_helper_->ProcessBuffers(input, *output_buffer))
482 *output_buffer = NULL; 484 *output_buffer = NULL;
483 485
484 return true; 486 return true;
485 } 487 }
486 488
487 } // namespace media 489 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698