| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |