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

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: 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
Index: media/filters/decrypting_audio_decoder.cc
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index 1af9b0e00d1f69d1d99ef7dcb42ece2e6111007f..cd1c85939b8f19b66981ca7aa4d7386c1ffaeda1 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,
@@ -189,21 +186,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;

Powered by Google App Engine
This is Rietveld 408576698