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

Side by Side Diff: media/base/android/audio_decoder_job.cc

Issue 1472943002: Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/base/android/audio_decoder_job.h" 5 #include "media/base/android/audio_decoder_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "media/base/android/media_codec_bridge.h" 10 #include "media/base/android/sdk_media_codec_bridge.h"
11 #include "media/base/audio_timestamp_helper.h" 11 #include "media/base/audio_timestamp_helper.h"
12 #include "media/base/timestamp_constants.h" 12 #include "media/base/timestamp_constants.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Use 16bit PCM for audio output. Keep this value in sync with the output 16 // Use 16bit PCM for audio output. Keep this value in sync with the output
17 // format we passed to AudioTrack in MediaCodecBridge. 17 // format we passed to AudioTrack in MediaCodecBridge.
18 const int kBytesPerAudioOutputSample = 2; 18 const int kBytesPerAudioOutputSample = 2;
19 } 19 }
20 20
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void AudioDecoderJob::OnOutputFormatChanged() { 188 void AudioDecoderJob::OnOutputFormatChanged() {
189 DCHECK(media_codec_bridge_); 189 DCHECK(media_codec_bridge_);
190 190
191 int old_sampling_rate = output_sampling_rate_; 191 int old_sampling_rate = output_sampling_rate_;
192 output_sampling_rate_ = media_codec_bridge_->GetOutputSamplingRate(); 192 output_sampling_rate_ = media_codec_bridge_->GetOutputSamplingRate();
193 if (output_sampling_rate_ != old_sampling_rate) 193 if (output_sampling_rate_ != old_sampling_rate)
194 ResetTimestampHelper(); 194 ResetTimestampHelper();
195 } 195 }
196 196
197 } // namespace media 197 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698