| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 std::unique_ptr<AudioCodecBridge> audio_codec_bridge( | 107 std::unique_ptr<AudioCodecBridge> audio_codec_bridge( |
| 108 AudioCodecBridge::Create(config_.codec())); | 108 AudioCodecBridge::Create(config_.codec())); |
| 109 if (!audio_codec_bridge) { | 109 if (!audio_codec_bridge) { |
| 110 DLOG(ERROR) << __FUNCTION__ << " failed: cannot create AudioCodecBridge"; | 110 DLOG(ERROR) << __FUNCTION__ << " failed: cannot create AudioCodecBridge"; |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr; | 114 jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr; |
| 115 | 115 |
| 116 if (!audio_codec_bridge->ConfigureAndStart(config_, false /* no AudioTrack */, | 116 if (!audio_codec_bridge->ConfigureAndStart(config_, media_crypto_obj)) { |
| 117 media_crypto_obj)) { | |
| 118 DLOG(ERROR) << __FUNCTION__ << " failed: cannot configure audio codec for " | 117 DLOG(ERROR) << __FUNCTION__ << " failed: cannot configure audio codec for " |
| 119 << config_.AsHumanReadableString(); | 118 << config_.AsHumanReadableString(); |
| 120 return false; | 119 return false; |
| 121 } | 120 } |
| 122 | 121 |
| 123 codec_loop_.reset( | 122 codec_loop_.reset( |
| 124 new MediaCodecLoop(base::android::BuildInfo::GetInstance()->sdk_int(), | 123 new MediaCodecLoop(base::android::BuildInfo::GetInstance()->sdk_int(), |
| 125 this, std::move(audio_codec_bridge))); | 124 this, std::move(audio_codec_bridge))); |
| 126 | 125 |
| 127 return true; | 126 return true; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 RETURN_STRING(STATE_READY); | 462 RETURN_STRING(STATE_READY); |
| 464 RETURN_STRING(STATE_ERROR); | 463 RETURN_STRING(STATE_ERROR); |
| 465 } | 464 } |
| 466 NOTREACHED() << "Unknown state " << state; | 465 NOTREACHED() << "Unknown state " << state; |
| 467 return nullptr; | 466 return nullptr; |
| 468 } | 467 } |
| 469 | 468 |
| 470 #undef RETURN_STRING | 469 #undef RETURN_STRING |
| 471 | 470 |
| 472 } // namespace media | 471 } // namespace media |
| OLD | NEW |