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

Unified Diff: media/base/android/media_codec_util.cc

Issue 1918623002: Use the MediaCodec flush workaround in more cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TargetApi annotation Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | media/base/android/ndk_media_codec_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_codec_util.cc
diff --git a/media/base/android/media_codec_util.cc b/media/base/android/media_codec_util.cc
index 189c0ef5b4b21c445df23dc63b22130a6e62e459..c61a8aa470f5421cfe3ba9ff7a2e23bae51446a6 100644
--- a/media/base/android/media_codec_util.cc
+++ b/media/base/android/media_codec_util.cc
@@ -15,6 +15,7 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "jni/MediaCodecUtil_jni.h"
+#include "media/base/android/media_codec_bridge.h"
#include "url/gurl.h"
using base::android::AttachCurrentThread;
@@ -240,4 +241,18 @@ bool MediaCodecUtil::IsSurfaceViewOutputSupported() {
return true;
}
+// static
+bool MediaCodecUtil::CodecNeedsFlushWorkaround(MediaCodecBridge* codec) {
+ int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int();
+ std::string codec_name = codec->GetName();
+ return sdk_int < 18 ||
+ (sdk_int == 18 && ("OMX.SEC.avc.dec" == codec_name ||
+ "OMX.SEC.avc.dec.secure" == codec_name)) ||
+ (sdk_int == 19 &&
+ base::StartsWith(base::android::BuildInfo::GetInstance()->model(),
+ "SM-G800", base::CompareCase::INSENSITIVE_ASCII) &&
+ ("OMX.Exynos.avc.dec" == codec_name ||
+ "OMX.Exynos.avc.dec.secure" == codec_name));
+}
+
} // namespace media
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | media/base/android/ndk_media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698