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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 177333003: Add support for midstream audio configuration changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ABS
Patch Set: disable fifo, add <cmath> to fix compile error Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_audio_decoder.cc
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index 279e19b07c5c46f768c6ae070f2f4843f6039bb3..7336f2175c71773cd6c3aae4d52fcf2d980f2ae5 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -42,9 +42,6 @@ DecryptingAudioDecoder::DecryptingAudioDecoder(
set_decryptor_ready_cb_(set_decryptor_ready_cb),
decryptor_(NULL),
key_added_while_decode_pending_(false),
- bits_per_channel_(0),
- channel_layout_(CHANNEL_LAYOUT_NONE),
- samples_per_second_(0),
weak_factory_(this) {}
void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
@@ -185,21 +182,6 @@ void DecryptingAudioDecoder::Stop(const base::Closure& closure) {
task_runner_->PostTask(FROM_HERE, closure);
}
-int DecryptingAudioDecoder::bits_per_channel() {
- DCHECK(task_runner_->BelongsToCurrentThread());
- return bits_per_channel_;
-}
-
-ChannelLayout DecryptingAudioDecoder::channel_layout() {
- DCHECK(task_runner_->BelongsToCurrentThread());
- return channel_layout_;
-}
-
-int DecryptingAudioDecoder::samples_per_second() {
- DCHECK(task_runner_->BelongsToCurrentThread());
- return samples_per_second_;
-}
-
DecryptingAudioDecoder::~DecryptingAudioDecoder() {
DCHECK(state_ == kUninitialized || state_ == kStopped) << state_;
}
@@ -260,7 +242,8 @@ void DecryptingAudioDecoder::FinishInitialization(bool success) {
}
// Success!
- UpdateDecoderConfig();
+ timestamp_helper_.reset(
+ new AudioTimestampHelper(config_.samples_per_second()));
decryptor_->RegisterNewKeyCB(
Decryptor::kAudio,
@@ -380,13 +363,6 @@ void DecryptingAudioDecoder::DoReset() {
base::ResetAndReturn(&reset_cb_).Run();
}
-void DecryptingAudioDecoder::UpdateDecoderConfig() {
- bits_per_channel_ = kSupportedBitsPerChannel;
- channel_layout_ = config_.channel_layout();
- samples_per_second_ = config_.samples_per_second();
- timestamp_helper_.reset(new AudioTimestampHelper(samples_per_second_));
-}
-
void DecryptingAudioDecoder::EnqueueFrames(
const Decryptor::AudioBuffers& frames) {
queued_audio_frames_ = frames;
« no previous file with comments | « media/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698