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

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

Issue 2132653002: MediaCodecLoop unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « media/base/subsample_entry.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/filters/android/media_codec_audio_decoder.h" 5 #include "media/filters/android/media_codec_audio_decoder.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr; 152 jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr;
153 153
154 if (!audio_codec_bridge->ConfigureAndStart(config_, false /* no AudioTrack */, 154 if (!audio_codec_bridge->ConfigureAndStart(config_, false /* no AudioTrack */,
155 media_crypto_obj)) { 155 media_crypto_obj)) {
156 DLOG(ERROR) << __FUNCTION__ << " failed: cannot configure audio codec for " 156 DLOG(ERROR) << __FUNCTION__ << " failed: cannot configure audio codec for "
157 << config_.AsHumanReadableString(); 157 << config_.AsHumanReadableString();
158 return false; 158 return false;
159 } 159 }
160 160
161 codec_loop_.reset(new MediaCodecLoop(this, std::move(audio_codec_bridge))); 161 codec_loop_.reset(
162 new MediaCodecLoop(base::android::BuildInfo::GetInstance()->sdk_int(),
163 this, std::move(audio_codec_bridge)));
162 164
163 return true; 165 return true;
164 } 166 }
165 167
166 void MediaCodecAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer, 168 void MediaCodecAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer,
167 const DecodeCB& decode_cb) { 169 const DecodeCB& decode_cb) {
168 DecodeCB bound_decode_cb = BindToCurrentLoop(decode_cb); 170 DecodeCB bound_decode_cb = BindToCurrentLoop(decode_cb);
169 171
170 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp) { 172 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp) {
171 DVLOG(2) << __FUNCTION__ << " " << buffer->AsHumanReadableString() 173 DVLOG(2) << __FUNCTION__ << " " << buffer->AsHumanReadableString()
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 RETURN_STRING(STATE_READY); 512 RETURN_STRING(STATE_READY);
511 RETURN_STRING(STATE_ERROR); 513 RETURN_STRING(STATE_ERROR);
512 } 514 }
513 NOTREACHED() << "Unknown state " << state; 515 NOTREACHED() << "Unknown state " << state;
514 return nullptr; 516 return nullptr;
515 } 517 }
516 518
517 #undef RETURN_STRING 519 #undef RETURN_STRING
518 520
519 } // namespace media 521 } // namespace media
OLDNEW
« no previous file with comments | « media/base/subsample_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698