summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorSimon Shields <keepcalm444@gmail.com>2015-12-07 17:40:13 +1100
committerSimon Shields <keepcalm444@gmail.com>2015-12-08 10:43:17 +1100
commit3c0409bf981f7ae224b4843741770ad4ee341207 (patch)
tree782f9cf6158c0baf96b6b5ba16b774dada12c808 /media/libstagefright/ACodec.cpp
parent89fdc5b26a76c89af6b46665510b184cefd5ab0b (diff)
downloadframeworks_av-3c0409bf981f7ae224b4843741770ad4ee341207.zip
frameworks_av-3c0409bf981f7ae224b4843741770ad4ee341207.tar.gz
frameworks_av-3c0409bf981f7ae224b4843741770ad4ee341207.tar.bz2
libstagefright: squash exynos4 support
commit e41cc838b6212f8711c550522e8cefc95f003a67 Author: rINanDO <drjisakh@gmail.com> Date: Mon Aug 10 13:56:56 2015 +0200 stagefright: Exynos4 MPEG4 decoder should set native color format. Change-Id: I41bee77d48fc0b35691b94585de10269579ae789 commit a50263c53a1ecd0f75688f7042dd5e5d9badbc39 Author: Caio Schnepper <caioschnepper@gmail.com> Date: Wed Jun 10 22:26:07 2015 -0300 libstagefright: back off exynos4_enhancements HWC_HWOVERLAY usage The open source hwc doesn't support the GRALLOC_USAGE_HW_FIMC1 | GRALLOC_USAGE_HWC_HWOVERLAY combination. Removing HWC_HWOVERLAY allows FIMC1 to do decode/color conversion. Change-Id: Ibdfa9e5dd170e99e0d994540979e88e519931641 commit 63286a333bde1aa047de4e2fde8da1b59e42a16d Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org> Date: Sun Nov 3 02:45:19 2013 +0000 exynos4: libstragefright: add support for samsung colorformat/omx/mfc Source: http://git.insignal.co.kr/samsung/exynos/android/platform/frameworks/av/commit/?h=exynos-jb&id=1614612f7ca2a00473d202dbedcb135fadc608ad Conflicts: media/libstagefright/ACodec.cpp media/libstagefright/OMXCodec.cpp cherry pick from 906eba9f Change-Id: I1c174f8e9fa9bd3ed16a0399f070b6680f6a331c Change-Id: I47f5b09b37ea5376a45c80c9dd91a7fbd0c3361a
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index b87423f..9ab53fa 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -55,6 +55,10 @@
#include <OMX_IndexExt.h>
#include <OMX_AsString.h>
+#ifdef USE_SAMSUNG_COLORFORMAT
+#include <sec_format.h>
+#endif
+
#include "include/avc_utils.h"
#include <stagefright/AVExtensions.h>
@@ -913,12 +917,21 @@ status_t ACodec::setupNativeWindowSizeFormatAndUsage(
usage |= kVideoGrallocUsage;
*finalUsage = usage;
+#ifdef USE_SAMSUNG_COLORFORMAT
+ OMX_COLOR_FORMATTYPE eNativeColorFormat = def.format.video.eColorFormat;
+ setNativeWindowColorFormat(eNativeColorFormat);
+#endif
+
ALOGV("gralloc usage: %#x(OMX) => %#x(ACodec)", omxUsage, usage);
return setNativeWindowSizeFormatAndUsage(
nativeWindow,
def.format.video.nFrameWidth,
def.format.video.nFrameHeight,
+#ifdef USE_SAMSUNG_COLORFORMAT
+ eNativeColorFormat,
+#else
def.format.video.eColorFormat,
+#endif
mRotationDegrees,
usage);
}
@@ -1258,6 +1271,27 @@ void ACodec::dumpBuffers(OMX_U32 portIndex) {
}
}
+#ifdef USE_SAMSUNG_COLORFORMAT
+void ACodec::setNativeWindowColorFormat(OMX_COLOR_FORMATTYPE &eNativeColorFormat)
+{
+ // In case of Samsung decoders, we set proper native color format for the Native Window
+ if (!strcasecmp(mComponentName.c_str(), "OMX.SEC.AVC.Decoder")
+ || !strcasecmp(mComponentName.c_str(), "OMX.SEC.FP.AVC.Decoder")
+ || !strcasecmp(mComponentName.c_str(), "OMX.SEC.MPEG4.Decoder")
+ || !strcasecmp(mComponentName.c_str(), "OMX.Exynos.AVC.Decoder")) {
+ switch (eNativeColorFormat) {
+ case OMX_COLOR_FormatYUV420SemiPlanar:
+ eNativeColorFormat = (OMX_COLOR_FORMATTYPE)HAL_PIXEL_FORMAT_YCbCr_420_SP;
+ break;
+ case OMX_COLOR_FormatYUV420Planar:
+ default:
+ eNativeColorFormat = (OMX_COLOR_FORMATTYPE)HAL_PIXEL_FORMAT_YCbCr_420_P;
+ break;
+ }
+ }
+}
+#endif
+
status_t ACodec::cancelBufferToNativeWindow(BufferInfo *info) {
CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_US);