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

Side by Side Diff: media/filters/ffmpeg_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/ffmpeg_audio_decoder.h" 5 #include "media/filters/ffmpeg_audio_decoder.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "media/base/audio_buffer.h" 9 #include "media/base/audio_buffer.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (state_ != kUninitialized) { 140 if (state_ != kUninitialized) {
141 ReleaseFFmpegResources(); 141 ReleaseFFmpegResources();
142 ResetTimestampState(); 142 ResetTimestampState();
143 } 143 }
144 } 144 }
145 145
146 std::string FFmpegAudioDecoder::GetDisplayName() const { 146 std::string FFmpegAudioDecoder::GetDisplayName() const {
147 return "FFmpegAudioDecoder"; 147 return "FFmpegAudioDecoder";
148 } 148 }
149 149
150 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, 150 void FFmpegAudioDecoder::Initialize(
151 const PipelineStatusCB& status_cb, 151 const AudioDecoderConfig& config,
152 const OutputCB& output_cb) { 152 const PipelineStatusCB& status_cb,
153 const OutputCB& output_cb,
154 const base::Closure& /* waiting_for_encryption_key_cb */) {
153 DCHECK(task_runner_->BelongsToCurrentThread()); 155 DCHECK(task_runner_->BelongsToCurrentThread());
154 DCHECK(!config.is_encrypted()); 156 DCHECK(!config.is_encrypted());
155 157
156 FFmpegGlue::InitializeFFmpeg(); 158 FFmpegGlue::InitializeFFmpeg();
157 159
158 config_ = config; 160 config_ = config;
159 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb); 161 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb);
160 162
161 if (!config.IsValidConfig() || !ConfigureDecoder()) { 163 if (!config.IsValidConfig() || !ConfigureDecoder()) {
162 initialize_cb.Run(DECODER_ERROR_NOT_SUPPORTED); 164 initialize_cb.Run(DECODER_ERROR_NOT_SUPPORTED);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 390
389 ResetTimestampState(); 391 ResetTimestampState();
390 return true; 392 return true;
391 } 393 }
392 394
393 void FFmpegAudioDecoder::ResetTimestampState() { 395 void FFmpegAudioDecoder::ResetTimestampState() {
394 discard_helper_->Reset(config_.codec_delay()); 396 discard_helper_->Reset(config_.codec_delay());
395 } 397 }
396 398
397 } // namespace media 399 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698