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

Side by Side Diff: media/renderers/audio_renderer_impl.cc

Issue 1423163004: media: Replace DecryptorReadyCB with CdmReadyCB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed 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/renderers/audio_renderer_impl.h ('k') | media/renderers/audio_renderer_impl_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 (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/renderers/audio_renderer_impl.h" 5 #include "media/renderers/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING); 301 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING);
302 DCHECK(!pending_read_) << "Pending read must complete before seeking"; 302 DCHECK(!pending_read_) << "Pending read must complete before seeking";
303 303
304 ChangeState_Locked(kPlaying); 304 ChangeState_Locked(kPlaying);
305 AttemptRead_Locked(); 305 AttemptRead_Locked();
306 } 306 }
307 307
308 void AudioRendererImpl::Initialize( 308 void AudioRendererImpl::Initialize(
309 DemuxerStream* stream, 309 DemuxerStream* stream,
310 const PipelineStatusCB& init_cb, 310 const PipelineStatusCB& init_cb,
311 const SetDecryptorReadyCB& set_decryptor_ready_cb, 311 const SetCdmReadyCB& set_cdm_ready_cb,
312 const StatisticsCB& statistics_cb, 312 const StatisticsCB& statistics_cb,
313 const BufferingStateCB& buffering_state_cb, 313 const BufferingStateCB& buffering_state_cb,
314 const base::Closure& ended_cb, 314 const base::Closure& ended_cb,
315 const PipelineStatusCB& error_cb, 315 const PipelineStatusCB& error_cb,
316 const base::Closure& waiting_for_decryption_key_cb) { 316 const base::Closure& waiting_for_decryption_key_cb) {
317 DVLOG(1) << __FUNCTION__; 317 DVLOG(1) << __FUNCTION__;
318 DCHECK(task_runner_->BelongsToCurrentThread()); 318 DCHECK(task_runner_->BelongsToCurrentThread());
319 DCHECK(stream); 319 DCHECK(stream);
320 DCHECK_EQ(stream->type(), DemuxerStream::AUDIO); 320 DCHECK_EQ(stream->type(), DemuxerStream::AUDIO);
321 DCHECK(!init_cb.is_null()); 321 DCHECK(!init_cb.is_null());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 hw_params.sample_rate(), hw_params.bits_per_sample(), 360 hw_params.sample_rate(), hw_params.bits_per_sample(),
361 hardware_config_.GetHighLatencyBufferSize()); 361 hardware_config_.GetHighLatencyBufferSize());
362 } 362 }
363 363
364 audio_clock_.reset( 364 audio_clock_.reset(
365 new AudioClock(base::TimeDelta(), audio_parameters_.sample_rate())); 365 new AudioClock(base::TimeDelta(), audio_parameters_.sample_rate()));
366 366
367 audio_buffer_stream_->Initialize( 367 audio_buffer_stream_->Initialize(
368 stream, base::Bind(&AudioRendererImpl::OnAudioBufferStreamInitialized, 368 stream, base::Bind(&AudioRendererImpl::OnAudioBufferStreamInitialized,
369 weak_factory_.GetWeakPtr()), 369 weak_factory_.GetWeakPtr()),
370 set_decryptor_ready_cb, statistics_cb, waiting_for_decryption_key_cb); 370 set_cdm_ready_cb, statistics_cb, waiting_for_decryption_key_cb);
371 } 371 }
372 372
373 void AudioRendererImpl::OnAudioBufferStreamInitialized(bool success) { 373 void AudioRendererImpl::OnAudioBufferStreamInitialized(bool success) {
374 DVLOG(1) << __FUNCTION__ << ": " << success; 374 DVLOG(1) << __FUNCTION__ << ": " << success;
375 DCHECK(task_runner_->BelongsToCurrentThread()); 375 DCHECK(task_runner_->BelongsToCurrentThread());
376 376
377 base::AutoLock auto_lock(lock_); 377 base::AutoLock auto_lock(lock_);
378 378
379 if (!success) { 379 if (!success) {
380 state_ = kUninitialized; 380 state_ = kUninitialized;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 << buffering_state; 806 << buffering_state;
807 DCHECK_NE(buffering_state_, buffering_state); 807 DCHECK_NE(buffering_state_, buffering_state);
808 lock_.AssertAcquired(); 808 lock_.AssertAcquired();
809 buffering_state_ = buffering_state; 809 buffering_state_ = buffering_state;
810 810
811 task_runner_->PostTask(FROM_HERE, 811 task_runner_->PostTask(FROM_HERE,
812 base::Bind(buffering_state_cb_, buffering_state_)); 812 base::Bind(buffering_state_cb_, buffering_state_));
813 } 813 }
814 814
815 } // namespace media 815 } // namespace media
OLDNEW
« no previous file with comments | « media/renderers/audio_renderer_impl.h ('k') | media/renderers/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698