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

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

Issue 1525003002: Revert of Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rebase errors 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"
9 #include "media/base/android/media_statistics.h" 10 #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 ->ConfigureAndStart( 147 ->Start(
148 configs_.audio_codec, configs_.audio_sampling_rate, 148 configs_.audio_codec,
149 configs_.audio_channels, &configs_.audio_extra_data[0], 149 configs_.audio_sampling_rate,
150 configs_.audio_extra_data.size(), configs_.audio_codec_delay_ns, 150 configs_.audio_channels,
151 configs_.audio_seek_preroll_ns, true, media_crypto)) { 151 &configs_.audio_extra_data[0],
152 configs_.audio_extra_data.size(),
153 configs_.audio_codec_delay_ns,
154 configs_.audio_seek_preroll_ns,
155 true,
156 media_crypto)) {
152 DVLOG(0) << class_name() << "::" << __FUNCTION__ 157 DVLOG(0) << class_name() << "::" << __FUNCTION__
153 << " failed: cannot start audio codec"; 158 << " failed: cannot start audio codec";
154 159
155 media_codec_bridge_.reset(); 160 media_codec_bridge_.reset();
156 return kConfigFailure; 161 return kConfigFailure;
157 } 162 }
158 163
159 DVLOG(0) << class_name() << "::" << __FUNCTION__ << " succeeded"; 164 DVLOG(0) << class_name() << "::" << __FUNCTION__ << " succeeded";
160 165
161 SetVolumeInternal(); 166 SetVolumeInternal();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 if (audio_timestamp_helper_) 285 if (audio_timestamp_helper_)
281 base_timestamp_ = audio_timestamp_helper_->GetTimestamp(); 286 base_timestamp_ = audio_timestamp_helper_->GetTimestamp();
282 287
283 audio_timestamp_helper_.reset( 288 audio_timestamp_helper_.reset(
284 new AudioTimestampHelper(configs_.audio_sampling_rate)); 289 new AudioTimestampHelper(configs_.audio_sampling_rate));
285 290
286 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_); 291 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_);
287 } 292 }
288 293
289 } // namespace media 294 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/java/src/org/chromium/media/MediaCodecUtil.java ('k') | media/base/android/media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698