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

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

Issue 1472943002: Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/media_codec_audio_decoder.h" 5 #include "media/base/android/media_codec_audio_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "media/base/android/media_codec_bridge.h"
10 #include "media/base/android/media_statistics.h" 9 #include "media/base/android/media_statistics.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/demuxer_stream.h" 12 #include "media/base/demuxer_stream.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 DVLOG(0) << class_name() << "::" << __FUNCTION__ 137 DVLOG(0) << class_name() << "::" << __FUNCTION__
138 << " configuration parameters are required"; 138 << " configuration parameters are required";
139 return kConfigFailure; 139 return kConfigFailure;
140 } 140 }
141 141
142 media_codec_bridge_.reset(AudioCodecBridge::Create(configs_.audio_codec)); 142 media_codec_bridge_.reset(AudioCodecBridge::Create(configs_.audio_codec));
143 if (!media_codec_bridge_) 143 if (!media_codec_bridge_)
144 return kConfigFailure; 144 return kConfigFailure;
145 145
146 if (!(static_cast<AudioCodecBridge*>(media_codec_bridge_.get())) 146 if (!(static_cast<AudioCodecBridge*>(media_codec_bridge_.get()))
147 ->Start( 147 ->ConfigureAndStart(
148 configs_.audio_codec, 148 configs_.audio_codec,
149 configs_.audio_sampling_rate, 149 configs_.audio_sampling_rate,
150 configs_.audio_channels, 150 configs_.audio_channels,
151 &configs_.audio_extra_data[0], 151 &configs_.audio_extra_data[0],
152 configs_.audio_extra_data.size(), 152 configs_.audio_extra_data.size(),
153 configs_.audio_codec_delay_ns, 153 configs_.audio_codec_delay_ns,
154 configs_.audio_seek_preroll_ns, 154 configs_.audio_seek_preroll_ns,
155 true, 155 true,
156 media_crypto)) { 156 media_crypto)) {
157 DVLOG(0) << class_name() << "::" << __FUNCTION__ 157 DVLOG(0) << class_name() << "::" << __FUNCTION__
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if (audio_timestamp_helper_) 285 if (audio_timestamp_helper_)
286 base_timestamp_ = audio_timestamp_helper_->GetTimestamp(); 286 base_timestamp_ = audio_timestamp_helper_->GetTimestamp();
287 287
288 audio_timestamp_helper_.reset( 288 audio_timestamp_helper_.reset(
289 new AudioTimestampHelper(configs_.audio_sampling_rate)); 289 new AudioTimestampHelper(configs_.audio_sampling_rate));
290 290
291 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_); 291 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_);
292 } 292 }
293 293
294 } // namespace media 294 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698