ifdef undefined stuff
authorStricted <info@stricted.net>
Mon, 24 Sep 2018 17:59:41 +0000 (19:59 +0200)
committerJan Altensen <info@stricted.net>
Sun, 5 Apr 2020 10:24:52 +0000 (12:24 +0200)
Change-Id: Ib74b27c2c80e91bcfc09bb72539618a11255af3e

libexynosutils/exynos_format_v4l2.c
libscaler/libscalerblend-v4l2.cpp
libvideocodec/enc/ExynosVideoEncoder.c

index 0590b420d7d3ecf06e967f2fd7b21847e7426ed1..680f070d8756f80af4adeea20d675a7a8e0b1a90 100644 (file)
@@ -80,11 +80,11 @@ int HAL_PIXEL_FORMAT_2_V4L2_PIX(
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P:
         v4l2_pixel_format = V4L2_PIX_FMT_YUV420;
         break;
-
+#ifdef V4L2_PIX_FMT_YUV420N
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_PN:
         v4l2_pixel_format = V4L2_PIX_FMT_YUV420N;
         break;
-
+#endif
     case HAL_PIXEL_FORMAT_YCbCr_422_SP:
         v4l2_pixel_format = V4L2_PIX_FMT_NV16;
         break;
@@ -92,11 +92,11 @@ int HAL_PIXEL_FORMAT_2_V4L2_PIX(
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP:
         v4l2_pixel_format = V4L2_PIX_FMT_NV12;
         break;
-
+#ifdef V4L2_PIX_FMT_NV12N
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN:
         v4l2_pixel_format = V4L2_PIX_FMT_NV12N;
         break;
-
+#endif
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M:
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV:
     case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B:
@@ -137,11 +137,11 @@ int HAL_PIXEL_FORMAT_2_V4L2_PIX(
        v4l2_pixel_format = V4L2_PIX_FMT_NV12MT_16X16;
 #endif
        break;
-
+#ifdef V4L2_PIX_FMT_NV12NT
    case HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_TILED:
         v4l2_pixel_format = V4L2_PIX_FMT_NV12NT;
         break;
-
+#endif
    case HAL_PIXEL_FORMAT_EXYNOS_YCrCb_422_I:
         v4l2_pixel_format = V4L2_PIX_FMT_YVYU;
         break;
@@ -184,11 +184,11 @@ int V4L2_PIX_2_HAL_PIXEL_FORMAT(
     case V4L2_PIX_FMT_YUV420:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P;
        break;
-
+#ifdef V4L2_PIX_FMT_YUV420N
     case V4L2_PIX_FMT_YUV420N:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_PN;
        break;
-
+#endif
     case V4L2_PIX_FMT_YUV420M:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P_M;
         break;
@@ -208,11 +208,11 @@ int V4L2_PIX_2_HAL_PIXEL_FORMAT(
     case V4L2_PIX_FMT_NV12:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP;
         break;
-
+#ifdef V4L2_PIX_FMT_NV12N
     case V4L2_PIX_FMT_NV12N:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN;
         break;
-
+#endif
     case V4L2_PIX_FMT_NV12M:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M;
         break;
@@ -237,11 +237,11 @@ int V4L2_PIX_2_HAL_PIXEL_FORMAT(
     case V4L2_PIX_FMT_NV12MT_16X16:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED;
         break;
-
+#ifdef V4L2_PIX_FMT_NV12NT
     case V4L2_PIX_FMT_NV12NT:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_TILED;
         break;
-
+#endif
     case V4L2_PIX_FMT_NV61:
         hal_pixel_format = HAL_PIXEL_FORMAT_EXYNOS_YCrCb_422_SP;
         break;
@@ -377,11 +377,17 @@ int V4L2_PIX_2_YUV_INFO(unsigned int v4l2_pixel_format, unsigned int * bpp, unsi
     switch (v4l2_pixel_format) {
     case V4L2_PIX_FMT_NV12:
     case V4L2_PIX_FMT_NV21:
+#ifdef V4L2_PIX_FMT_NV12N
     case V4L2_PIX_FMT_NV12N:
+#endif
+#ifdef V4L2_PIX_FMT_NV12NT
     case V4L2_PIX_FMT_NV12NT:
+#endif
     case V4L2_PIX_FMT_YUV420:
     case V4L2_PIX_FMT_YVU420:
+#ifdef V4L2_PIX_FMT_YUV420N
     case V4L2_PIX_FMT_YUV420N:
+#endif
         *bpp    = 12;
         *planes = 1;
         break;
index 4747e72bc57c245dd5cf54bf6179d2640c9e38a0..6e3a40302ebc121a51cf07f8d546a6d81eb35bcf 100644 (file)
@@ -116,9 +116,11 @@ void CScalerBlendV4L2::GetCustomAlphaBlendFmt(int32_t &src_color_space,
     } else if (src_color_space == V4L2_PIX_FMT_NV12) {
             if ((srcblendfmt == V4L2_PIX_FMT_RGB32))
             src_color_space = V4L2_PIX_FMT_NV12_RGB32;
+#ifdef V4L2_PIX_FMT_NV12N
     } else if (src_color_space == V4L2_PIX_FMT_NV12N) {
             if ((srcblendfmt == V4L2_PIX_FMT_RGB32))
             src_color_space = V4L2_PIX_FMT_NV12N_RGB32;
+#endif
     } else if (src_color_space == V4L2_PIX_FMT_NV12MT_16X16) {
             if ((srcblendfmt == V4L2_PIX_FMT_RGB32))
             src_color_space = V4L2_PIX_FMT_NV12MT_16X16_RGB32;
index 0bd0b6767f002b5de8ce6ec1c4fa4760dfe0e595..7623029e3f8ae180c6b1be8c6d0b372349f99c14 100644 (file)
@@ -861,6 +861,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
             ext_ctrls.count += 1;
         }
 #endif
+#ifdef V4L2_CID_MPEG_VIDEO_H264_MIN_QP_P
         /* optional : if these are not set, set value are same as I frame */
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             i = ext_ctrls.count;
@@ -875,6 +876,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
 
             ext_ctrls.count += 4;
         }
+#endif
         break;
     }
 
@@ -961,7 +963,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
             break;
         }
         ext_ctrls.count = MPEG4_CTRL_NUM;
-
+#ifdef V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP_P
         /* optional : if these are not set, set value are same as I frame */
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             i = ext_ctrls.count;
@@ -976,6 +978,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
 
             ext_ctrls.count += 4;
         }
+#endif
         break;
     }
 
@@ -1022,7 +1025,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
             break;
         }
         ext_ctrls.count = H263_CTRL_NUM;
-
+#ifdef V4L2_CID_MPEG_VIDEO_H263_MIN_QP_P
         /* optional : if these are not set, set value are same as I frame */
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             i = ext_ctrls.count;
@@ -1033,6 +1036,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
 
             ext_ctrls.count += 2;
         }
+#endif
         break;
     }
 
@@ -1127,7 +1131,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
 
             ext_ctrls.count += 3;
         }
-
+#ifdef V4L2_CID_MPEG_VIDEO_VP8_MIN_QP_P
         /* optional : if these are not set, set value are same as I frame */
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             i = ext_ctrls.count;
@@ -1138,6 +1142,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
 
             ext_ctrls.count += 2;
         }
+#endif
         break;
     }
 #ifdef USE_HEVCENC_SUPPORT
@@ -1277,7 +1282,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
         ext_ctrl[52].value = (2 << 16 | 29);
         ext_ctrls.count = HEVC_CTRL_NUM;
 
-#ifdef CID_SUPPORT
+#if defined(CID_SUPPORT) && defined(V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_BIT0)
         if (pCtx->videoInstInfo.specificInfo.enc.bTemporalSvcSupport == VIDEO_TRUE) {
             i = ext_ctrls.count;
             ext_ctrl[i].id         = V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_BIT0;
@@ -1306,7 +1311,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
             ext_ctrls.count += 1;
         }
 #endif
-
+#ifdef V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP_P
         /* optional : if these are not set, set value are same as I frame */
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             i = ext_ctrls.count;
@@ -1321,6 +1326,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_EncParam (
 
             ext_ctrls.count += 4;
         }
+#endif
         break;
     }
 #endif
@@ -1630,7 +1636,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
 
         values[0][0] = GET_H264_QP_VALUE(qpRange.QpMin_I);
         values[0][1] = GET_H264_QP_VALUE(qpRange.QpMax_I);
-
+#ifdef V4L2_CID_MPEG_VIDEO_H264_MIN_QP_P
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             cids[1][0] = V4L2_CID_MPEG_VIDEO_H264_MIN_QP_P;
             cids[1][1] = V4L2_CID_MPEG_VIDEO_H264_MAX_QP_P;
@@ -1642,6 +1648,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
             values[2][0] = GET_H264_QP_VALUE(qpRange.QpMin_B);
             values[2][1] = GET_H264_QP_VALUE(qpRange.QpMax_B);
         }
+#endif
         break;
     }
     case VIDEO_CODING_MPEG4:
@@ -1657,7 +1664,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
 
         values[0][0] = GET_MPEG4_QP_VALUE(qpRange.QpMin_I);
         values[0][1] = GET_MPEG4_QP_VALUE(qpRange.QpMax_I);
-
+#ifdef V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP_P
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             cids[1][0] = V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP_P;
             cids[1][1] = V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP_P;
@@ -1669,6 +1676,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
             values[2][0] = GET_MPEG4_QP_VALUE(qpRange.QpMin_B);
             values[2][1] = GET_MPEG4_QP_VALUE(qpRange.QpMax_B);
         }
+#endif
         break;
     }
     case VIDEO_CODING_H263:
@@ -1678,7 +1686,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
 
         values[0][0] = GET_H263_QP_VALUE(qpRange.QpMin_I);
         values[0][1] = GET_H263_QP_VALUE(qpRange.QpMax_I);
-
+#ifdef V4L2_CID_MPEG_VIDEO_H263_MIN_QP_P
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             cids[1][0] = V4L2_CID_MPEG_VIDEO_H263_MIN_QP_P;
             cids[1][1] = V4L2_CID_MPEG_VIDEO_H263_MAX_QP_P;
@@ -1686,6 +1694,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
             values[1][0] = GET_H263_QP_VALUE(qpRange.QpMin_P);
             values[1][1] = GET_H263_QP_VALUE(qpRange.QpMax_P);
         }
+#endif
         break;
     }
     case VIDEO_CODING_VP8:
@@ -1695,7 +1704,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
 
         values[0][0] = GET_VP8_QP_VALUE(qpRange.QpMin_I);
         values[0][1] = GET_VP8_QP_VALUE(qpRange.QpMax_I);
-
+#ifdef V4L2_CID_MPEG_VIDEO_VP8_MIN_QP_P
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             cids[1][0] = V4L2_CID_MPEG_VIDEO_VP8_MIN_QP_P;
             cids[1][1] = V4L2_CID_MPEG_VIDEO_VP8_MAX_QP_P;
@@ -1703,6 +1712,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
             values[1][0] = GET_VP8_QP_VALUE(qpRange.QpMin_P);
             values[1][1] = GET_VP8_QP_VALUE(qpRange.QpMax_P);
         }
+#endif
         break;
     }
 #ifdef USE_HEVCENC_SUPPORT
@@ -1719,7 +1729,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
 
         values[0][0] = GET_HEVC_QP_VALUE(qpRange.QpMin_I);
         values[0][1] = GET_HEVC_QP_VALUE(qpRange.QpMax_I);
-
+#ifdef V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP_P
         if (pCtx->videoInstInfo.specificInfo.enc.bQpRangePBSupport == VIDEO_TRUE) {
             cids[1][0] = V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP_P;
             cids[1][1] = V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP_P;
@@ -1731,6 +1741,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_QuantizationRange(
             values[2][0] = GET_HEVC_QP_VALUE(qpRange.QpMin_B);
             values[2][1] = GET_HEVC_QP_VALUE(qpRange.QpMax_B);
         }
+#endif
         break;
     }
 #endif
@@ -1860,7 +1871,7 @@ static ExynosVideoErrorType MFC_Encoder_Enable_PrependSpsPpsToIdr(void *pHandle)
             goto EXIT;
         }
         break;
-#if defined(USE_HEVCENC_SUPPORT) && defined(CID_SUPPORT)
+#if defined(USE_HEVCENC_SUPPORT) && defined(CID_SUPPORT) && defined(V4L2_CID_MPEG_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR)
     case VIDEO_CODING_HEVC:
         if (exynos_v4l2_s_ctrl(pCtx->hEnc, V4L2_CID_MPEG_VIDEO_HEVC_PREPEND_SPSPPS_TO_IDR, 1) != 0) {
             ALOGE("%s: Failed to s_ctrl", __func__);
@@ -1934,7 +1945,7 @@ static ExynosVideoErrorType MFC_Encoder_Set_LayerChange(
     case VIDEO_CODING_AVC:
         CID = V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_CH;
         break;
-#if defined(USE_HEVCENC_SUPPORT) && defined(CID_SUPPORT)
+#if defined(USE_HEVCENC_SUPPORT) && defined(CID_SUPPORT) && defined(V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_CH)
     case VIDEO_CODING_HEVC:
         CID = V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_CH;
         break;