diff options
5 files changed, 16 insertions, 15 deletions
diff --git a/tools/depends/target/libandroidjni/LIBANDROIDJNI-VERSION b/tools/depends/target/libandroidjni/LIBANDROIDJNI-VERSION index 9478585f5d..7ed61169f2 100644 --- a/tools/depends/target/libandroidjni/LIBANDROIDJNI-VERSION +++ b/tools/depends/target/libandroidjni/LIBANDROIDJNI-VERSION @@ -1,6 +1,6 @@ LIBNAME=libandroidjni -VERSION=e0b02a846ba68d856d47812bf606022207def9cb +VERSION=c1f17cc0e88ce84c182eded19e5f0d64adb6aed7 BASE_URL=https://github.com/xbmc/libandroidjni/archive ARCHIVE=$(VERSION).tar.gz -SHA512=851efa5fadd70c5d6388b593836f7312394b9aac3c929dafaff894938b7eb8a26d7b04887ef63c148ed03d1cb65751696e417b242dddd24e25cbdfde5de76b49 +SHA512=75b17f748c77b06c13e29389fa6088aa6483766e9b851ebd49bef6df8f1701d82631e4eae97b05d8ed1f62c1960d6c76427a861c52d114cbf980d04155af69f4 BYPRODUCT=libandroidjni.a diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp index 04bb72b9a7..9112c77b84 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp @@ -200,12 +200,12 @@ bool CDVDAudioCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio { //StereoDownmixAllowed is true if the user has selected 2.0 Audio channels in settings bool stereoDownmixAllowed = CServiceBroker::GetActiveAE()->HasStereoAudioChannelCount(); - int num_codecs = CJNIMediaCodecList::getCodecCount(); + const std::vector<CJNIMediaCodecInfo> codecInfos = + CJNIMediaCodecList(CJNIMediaCodecList::REGULAR_CODECS).getCodecInfos(); std::vector<std::string> mimeTypes; - for (int i = 0; i < num_codecs; i++) + for (const CJNIMediaCodecInfo& codec_info : codecInfos) { - CJNIMediaCodecInfo codec_info = CJNIMediaCodecList::getCodecInfoAt(i); if (codec_info.isEncoder()) continue; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index cdf7c2a6da..ffcfc839a4 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -366,7 +366,7 @@ std::atomic<bool> CDVDVideoCodecAndroidMediaCodec::m_InstanceGuard(false); bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) { - int num_codecs; + std::vector<CJNIMediaCodecInfo> codecInfos; int profile(0); CJNIUUID uuid(0, 0); @@ -661,11 +661,10 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio m_codec = nullptr; m_colorFormat = -1; - num_codecs = CJNIMediaCodecList::getCodecCount(); + codecInfos = CJNIMediaCodecList(CJNIMediaCodecList::REGULAR_CODECS).getCodecInfos(); - for (int i = 0; i < num_codecs; i++) + for (const CJNIMediaCodecInfo& codec_info : codecInfos) { - CJNIMediaCodecInfo codec_info = CJNIMediaCodecList::getCodecInfoAt(i); if (codec_info.isEncoder()) continue; diff --git a/xbmc/platform/android/media/decoderfilter/MediaCodecDecoderFilterManager.cpp b/xbmc/platform/android/media/decoderfilter/MediaCodecDecoderFilterManager.cpp index bd6b3e20d1..3f9ce2ee24 100644 --- a/xbmc/platform/android/media/decoderfilter/MediaCodecDecoderFilterManager.cpp +++ b/xbmc/platform/android/media/decoderfilter/MediaCodecDecoderFilterManager.cpp @@ -39,10 +39,11 @@ CMediaCodecDecoderFilterManager::CMediaCodecDecoderFilterManager() NULL }; - int num_codecs = CJNIMediaCodecList::getCodecCount(); - for (int i = 0; i < num_codecs; i++) + const std::vector<CJNIMediaCodecInfo> codecInfos = + CJNIMediaCodecList(CJNIMediaCodecList::REGULAR_CODECS).getCodecInfos(); + + for (const CJNIMediaCodecInfo& codec_info : codecInfos) { - CJNIMediaCodecInfo codec_info = CJNIMediaCodecList::getCodecInfoAt(i); if (codec_info.isEncoder()) continue; diff --git a/xbmc/windowing/android/AndroidUtils.cpp b/xbmc/windowing/android/AndroidUtils.cpp index 4586d0fc3d..81996ad46c 100644 --- a/xbmc/windowing/android/AndroidUtils.cpp +++ b/xbmc/windowing/android/AndroidUtils.cpp @@ -429,10 +429,11 @@ CHDRCapabilities CAndroidUtils::GetDisplayHDRCapabilities() bool CAndroidUtils::SupportsMediaCodecMimeType(const std::string& mimeType) { - int num_codecs = CJNIMediaCodecList::getCodecCount(); - for (int i = 0; i < num_codecs; i++) + const std::vector<CJNIMediaCodecInfo> codecInfos = + CJNIMediaCodecList(CJNIMediaCodecList::REGULAR_CODECS).getCodecInfos(); + + for (const CJNIMediaCodecInfo& codec_info : codecInfos) { - CJNIMediaCodecInfo codec_info = CJNIMediaCodecList::getCodecInfoAt(i); if (codec_info.isEncoder()) continue; |