Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05c18634 authored by Andreas Schneider's avatar Andreas Schneider Committed by Gerrit Code Review
Browse files

libstagefright: Add support for NV21 color format



This adds the native color format 'OMX_SEC_COLOR_FormatNV21Linear' of
exynos5 which is NV21 and needed for the camera. You can turn it on
with:

BOARD_USE_SAMSUNG_COLORFORMAT_NV21 := true

It requires

const char CameraParameters::PIXEL_FORMAT_YUV420SP_NV21[] = "nv21";

to be specified in CameraExtraParameters.h.

Change-Id: I64ca86d074468b1e7a2958a73c3c0380e64a9fc0
Signed-off-by: default avatarAndreas Schneider <asn@cryptomilk.org>
parent a5bd4cd7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -240,6 +240,14 @@ LOCAL_C_INCLUDES += \
	$(TOP)/hardware/samsung/exynos4/include
endif

ifeq ($(BOARD_USE_SAMSUNG_CAMERAFORMAT_NV21), true)
# This needs flag requires the following string constant in
# CameraParametersExtra.h:
#
# const char CameraParameters::PIXEL_FORMAT_YUV420SP_NV21[] = "nv21";
LOCAL_CFLAGS += -DUSE_SAMSUNG_CAMERAFORMAT_NV21
endif

# FFMPEG plugin
LOCAL_C_INCLUDES += \
	$(TOP)/external/stagefright-plugins/include
+7 −0
Original line number Diff line number Diff line
@@ -116,6 +116,13 @@ static int32_t getColorFormat(const char* colorFormat) {
#endif
    }

#ifdef USE_SAMSUNG_CAMERAFORMAT_NV21
    if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV420SP_NV21)) {
        static const int OMX_SEC_COLOR_FormatNV21Linear = 0x7F000011;
        return OMX_SEC_COLOR_FormatNV21Linear;
    }
#endif /* USE_SAMSUNG_CAMERAFORMAT_NV21 */

    if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV422I)) {
        return OMX_COLOR_FormatYCbYCr;
    }