diff options
author | Youngjae Shin <yj99.shin@samsung.com> | 2017-09-25 18:18:53 +0900 |
---|---|---|
committer | Sejun Park <sejun79.park@samsung.com> | 2017-09-26 17:28:09 +0900 |
commit | 9c52feff76e50675ca475124c2df37d19c5177f8 (patch) | |
tree | 707d8844005fd818919375e383d88461f35d12f0 | |
parent | 917e7d0b5a3c75db81f1b38ce031013f4eee2efb (diff) | |
download | libomxil-e3250-v4l2-9c52feff76e50675ca475124c2df37d19c5177f8.tar.gz libomxil-e3250-v4l2-9c52feff76e50675ca475124c2df37d19c5177f8.tar.bz2 libomxil-e3250-v4l2-9c52feff76e50675ca475124c2df37d19c5177f8.zip |
fix build warningsubmit/tizen/20170926.084427accepted/tizen/unified/20170926.165810
Change-Id: Ica8ab613ae3aa6a3b851e8e6219b5dab149c0d53
21 files changed, 110 insertions, 90 deletions
diff --git a/exynos/libcsc/csc.c b/exynos/libcsc/csc.c index df7a09d..a55a011 100644 --- a/exynos/libcsc/csc.c +++ b/exynos/libcsc/csc.c @@ -34,6 +34,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #ifndef TIZEN_FEATURE_E3250 /* build env */ #include <utils/Log.h> #include <system/graphics.h> @@ -235,6 +236,12 @@ static CSC_ERRORCODE conv_sw_src_nv12t( return ret; } +void csc_interleave_memcpy_neon( + unsigned char *dest, + unsigned char *src1, + unsigned char *src2, + unsigned int src_size); + /* source is YUV420P */ static CSC_ERRORCODE conv_sw_src_yuv420p( CSC_HANDLE *handle) @@ -422,7 +429,7 @@ static CSC_ERRORCODE csc_init_hw( #endif default: ALOGE("%s:: unsupported csc_hw_type, csc use sw", __func__); - csc_handle->csc_hw_handle == NULL; + csc_handle->csc_hw_handle = NULL; break; } } @@ -495,20 +502,24 @@ static CSC_ERRORCODE csc_set_buffer( { CSC_HANDLE *csc_handle; CSC_ERRORCODE ret = CSC_ErrorNone; +#ifdef ENABLE_GSCALER void *src_addr[3] = {NULL, }; void *dst_addr[3] = {NULL, }; +#endif if (handle == NULL) return CSC_ErrorNotInit; csc_handle = (CSC_HANDLE *)handle; if (csc_handle->csc_method == CSC_METHOD_HW) { +#ifdef ENABLE_GSCALER src_addr[0] = csc_handle->src_buffer.planes[CSC_Y_PLANE]; src_addr[1] = csc_handle->src_buffer.planes[CSC_U_PLANE]; src_addr[2] = csc_handle->src_buffer.planes[CSC_V_PLANE]; dst_addr[0] = csc_handle->dst_buffer.planes[CSC_Y_PLANE]; dst_addr[1] = csc_handle->dst_buffer.planes[CSC_U_PLANE]; dst_addr[2] = csc_handle->dst_buffer.planes[CSC_V_PLANE]; +#endif switch (csc_handle->csc_hw_type) { case CSC_HW_TYPE_FIMC: @@ -749,7 +760,6 @@ CSC_ERRORCODE csc_set_src_buffer( { CSC_HANDLE *csc_handle; CSC_ERRORCODE ret = CSC_ErrorNone; - void *addr[3] = {NULL, }; if (handle == NULL) return CSC_ErrorNotInit; @@ -771,7 +781,6 @@ CSC_ERRORCODE csc_set_dst_buffer( { CSC_HANDLE *csc_handle; CSC_ERRORCODE ret = CSC_ErrorNone; - void *addr[3] = {NULL, }; if (handle == NULL) return CSC_ErrorNotInit; diff --git a/exynos/libcsc/csc_helper.c b/exynos/libcsc/csc_helper.c index c333fa4..142086d 100644 --- a/exynos/libcsc/csc_helper.c +++ b/exynos/libcsc/csc_helper.c @@ -64,7 +64,7 @@ unsigned int omx_2_hal_pixel_format( OMX_COLOR_FORMATTYPE omx_format) { unsigned int hal_format; - switch (omx_format) { + switch ((int)omx_format) { #ifndef TIZEN_FEATURE_E3250 /* build env */ /* useless */ case OMX_COLOR_FormatYCbYCr: hal_format = HAL_PIXEL_FORMAT_YCbCr_422_I; diff --git a/exynos/libv4l2/exynos_mc.c b/exynos/libv4l2/exynos_mc.c index 66ec719..cca6cff 100755 --- a/exynos/libv4l2/exynos_mc.c +++ b/exynos/libv4l2/exynos_mc.c @@ -34,6 +34,7 @@ #include <errno.h> #include <ctype.h> #include <string.h> +#include <unistd.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/stat.h> @@ -179,11 +180,11 @@ static int __media_get_devname_sysfs(struct media_entity *entity) char *p; int ret; - sprintf(sysname, "/sys/dev/char/%u:%u", entity->info.v4l.major, + snprintf(sysname, sizeof(sysname), "/sys/dev/char/%u:%u", entity->info.v4l.major, entity->info.v4l.minor); ret = readlink(sysname, target, sizeof(target)); - if (ret < 0) + if (ret < 0 || ret >= (int)sizeof(target)) return -errno; target[ret] = '\0'; @@ -191,21 +192,16 @@ static int __media_get_devname_sysfs(struct media_entity *entity) if (p == NULL) return -EINVAL; - sprintf(devname, "/tmp/%s", p + 1); + snprintf(devname, sizeof(devname), "/tmp/%s", p + 1); ret = mknod(devname, 0666 | S_IFCHR, MKDEV(81, entity->info.v4l.minor)); - strcpy(entity->devname, devname); + strncpy(entity->devname, devname, sizeof(devname) - 1); return 0; } static int __media_get_media_fd(const char *filename, struct media_device *media) { - ssize_t num; - int media_node; - char *ptr; - char media_buf[6]; - ALOGD("%s: %s", __func__, filename); media->fd = open(filename, O_RDWR, 0); @@ -231,6 +227,10 @@ static int __media_enum_entities(struct media_device *media) for (id = 0, ret = 0; ; id = entity->info.id) { size = (media->entities_count + 1) * sizeof(*media->entities); media->entities = (struct media_entity*)realloc(media->entities, size); + if (media->entities == NULL) { + ret = -ENOMEM; + break; + } entity = &media->entities[media->entities_count]; memset(entity, 0, sizeof(*entity)); diff --git a/exynos/libv4l2/exynos_subdev.c b/exynos/libv4l2/exynos_subdev.c index 6c1b099..8919d2d 100755 --- a/exynos/libv4l2/exynos_subdev.c +++ b/exynos/libv4l2/exynos_subdev.c @@ -30,6 +30,7 @@ #include <stdio.h> #include <stdarg.h> #include <fcntl.h> +#include <string.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/stat.h> @@ -44,7 +45,7 @@ #include "Exynos_OSAL_Log.h" #endif -#define SUBDEV_MINOR_MAX 191 +#define SUBDEV_MAX 191 static int __subdev_open(const char *filename, int oflag, va_list ap) { @@ -79,22 +80,25 @@ int exynos_subdev_open_devname(const char *devname, int oflag, ...) va_list ap; FILE *stream_fd; char filename[64], name[64]; - int minor, size, i = 0; + int i = 0; do { - if (i > (SUBDEV_MINOR_MAX - 128)) + if (i > (SUBDEV_MAX - 128)) break; /* video device node */ - sprintf(filename, "/dev/v4l-subdev%d", i++); + snprintf(filename, sizeof(filename), "/dev/v4l-subdev%d", i); /* if the node is video device */ if ((lstat(filename, &s) == 0) && S_ISCHR(s.st_mode) && ((int)((unsigned short)(s.st_rdev) >> 8) == 81)) { - minor = (int)((unsigned short)(s.st_rdev & 0x3f)); - ALOGD("try node: %s, minor: %d", filename, minor); + ALOGD("try node: %s", filename); /* open sysfs entry */ - sprintf(filename, "/sys/class/video4linux/v4l-subdev%d/name", minor); + snprintf(filename, sizeof(filename), "/sys/class/video4linux/v4l-subdev%d/name", i); + if (S_ISLNK(s.st_mode)) { + ALOGE("symbolic link detected"); + return -1; + } stream_fd = fopen(filename, "r"); if (stream_fd == NULL) { ALOGE("failed to open sysfs entry for subdev"); @@ -102,24 +106,26 @@ int exynos_subdev_open_devname(const char *devname, int oflag, ...) } /* read sysfs entry for device name */ - size = (int)fgets(name, sizeof(name), stream_fd); + char *p = fgets(name, sizeof(name), stream_fd); fclose(stream_fd); /* check read size */ - if (size == 0) { + if (p == NULL) { ALOGE("failed to read sysfs entry for subdev"); } else { /* matched */ if (strncmp(name, devname, strlen(devname)) == 0) { - ALOGI("node found for device %s: /dev/v4l-subdev%d", devname, minor); + ALOGI("node found for device %s: /dev/v4l-subdev%d", devname, i); found = true; + break; } } } + i++; } while (found == false); if (found) { - sprintf(filename, "/dev/v4l-subdev%d", minor); + snprintf(filename, sizeof(filename), "/dev/v4l-subdev%d", i); va_start(ap, oflag); fd = __subdev_open(filename, oflag, ap); va_end(ap); diff --git a/exynos/libv4l2/exynos_v4l2.c b/exynos/libv4l2/exynos_v4l2.c index e050fba..3441529 100755 --- a/exynos/libv4l2/exynos_v4l2.c +++ b/exynos/libv4l2/exynos_v4l2.c @@ -32,6 +32,7 @@ #include <stdarg.h> #include <fcntl.h> #include <string.h> +#include <unistd.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/stat.h> @@ -187,7 +188,7 @@ bool exynos_v4l2_enuminput(int fd, int index, char *input_name_buf) } input.index = index; - ret = ioctl(fd, VIDIOC_ENUMINPUT, &input); + ret = ioctl(fd, VIDIOC_ENUMINPUT, &input, 32); if (ret) { ALOGE("%s: no matching index founds", __func__); return false; @@ -195,7 +196,7 @@ bool exynos_v4l2_enuminput(int fd, int index, char *input_name_buf) ALOGI("Name of input channel[%d] is %s", input.index, input.name); - strcpy(input_name_buf, (const char *)input.name); + strncpy(input_name_buf, (const char *)input.name, 32); return true; } diff --git a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c index 31217df..24be448 100755 --- a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c +++ b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c @@ -107,10 +107,10 @@ static unsigned int __ColorFormatType_To_V4L2PixelFormat(ExynosVideoColorFormatT pixelformat = V4L2_PIX_FMT_NV21M; break; case VIDEO_COLORFORMAT_NV12: +#endif default: pixelformat = V4L2_PIX_FMT_NV12M; break; -#endif } return pixelformat; @@ -492,7 +492,7 @@ static ExynosVideoErrorType MFC_Decoder_Get_FramePackingInfo( struct v4l2_ext_control ext_ctrl[FRAME_PACK_SEI_INFO_NUM]; struct v4l2_ext_controls ext_ctrls; - int seiAvailable, seiInfo, seiGridPos, i; + int seiAvailable, seiInfo, seiGridPos; unsigned int seiArgmtId; @@ -571,8 +571,6 @@ EXIT: } /* - -/* * [Decoder Buffer OPS] Enable Cacheable (Input) */ static ExynosVideoErrorType MFC_Decoder_Enable_Cacheable_Inbuf(void *pHandle) @@ -1225,6 +1223,7 @@ EXIT: return ret; } +#if 0 /* * [Decoder Buffer OPS] Wait (Input) */ @@ -1266,6 +1265,7 @@ static ExynosVideoErrorType MFC_Decoder_Wait_Inbuf(void *pHandle) EXIT: return ret; } +#endif static ExynosVideoErrorType MFC_Decoder_Register_Inbuf( void *pHandle, @@ -1742,7 +1742,7 @@ static ExynosVideoBuffer *MFC_Decoder_Dequeue_Outbuf(void *pHandle) } #endif switch (buf.flags & (0x7 << 3)) { - ALOGV("%s: frameType: %d", __func__, buf.flags & (0x7 << 3)); + case V4L2_BUF_FLAG_KEYFRAME: pOutbuf->frameType = VIDEO_FRAME_I; break; diff --git a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c index a3b1a74..2851560 100755 --- a/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c +++ b/exynos4/libcodec/video/v4l2/enc/ExynosVideoEncoder.c @@ -701,7 +701,6 @@ EXIT: static int MFC_Encoder_Get_FrameTag(void *pHandle) { ExynosVideoEncContext *pCtx = (ExynosVideoEncContext *)pHandle; - ExynosVideoErrorType ret = VIDEO_ERROR_NONE; int frameTag = -1; @@ -712,7 +711,6 @@ static int MFC_Encoder_Get_FrameTag(void *pHandle) #ifdef V4L2_CID_MPEG_MFC51_VIDEO_FRAME_TAG if (exynos_v4l2_g_ctrl(pCtx->hEnc, V4L2_CID_MPEG_MFC51_VIDEO_FRAME_TAG, &frameTag) != 0) { ALOGE("%s: Failed to g_ctrl", __func__); - ret = VIDEO_ERROR_APIFAIL; goto EXIT; } #endif @@ -1556,6 +1554,7 @@ EXIT: return ret; } +#if 0 /* * [Encoder Buffer OPS] Wait (Src) */ @@ -1642,6 +1641,7 @@ static ExynosVideoErrorType MFC_Encoder_Wait_Outbuf(void *pHandle) EXIT: return ret; } +#endif static ExynosVideoErrorType MFC_Encoder_Register_Inbuf( void *pHandle, @@ -1986,6 +1986,7 @@ EXIT: return ret; } +#if 0 /* * [Encoder Buffer OPS] Enqueue All (Output) */ @@ -2014,6 +2015,7 @@ static ExynosVideoErrorType MFC_Encoder_Enqueue_All_Outbuf(void *pHandle) EXIT: return ret; } +#endif /* * [Encoder Buffer OPS] Dequeue (Input) @@ -2066,7 +2068,6 @@ static ExynosVideoBuffer *MFC_Encoder_Dequeue_Outbuf(void *pHandle) struct v4l2_buffer buf; struct v4l2_plane planes[VIDEO_ENCODER_OUTBUF_PLANES]; - int value; if (pCtx == NULL) { ALOGE("%s: Video context info must be supplied", __func__); diff --git a/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h b/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h index b89adcc..6638349 100755 --- a/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h +++ b/exynos4/libcodec/video/v4l2/include/ExynosVideoApi.h @@ -234,8 +234,8 @@ typedef struct _ExynosVideoDecOps { ExynosVideoErrorType (*Enable_SliceMode)(void *pHandle); ExynosVideoErrorType (*Enable_SEIParsing)(void *pHandle); ExynosVideoErrorType (*Get_FramePackingInfo)(void *pHandle, ExynosVideoFramePacking *pFramepacking); - ExynosVideoErrorType (*Set_ImmediateDisplay)(void *pHandle); - ExynosVideoErrorType (*Enable_DecodeWait)(void *pHandle); + ExynosVideoErrorType (*Set_ImmediateDisplay)(void *pHandle); + ExynosVideoErrorType (*Enable_DecodeWait)(void *pHandle); } ExynosVideoDecOps; typedef struct _ExynosVideoEncOps { @@ -247,7 +247,7 @@ typedef struct _ExynosVideoEncOps { ExynosVideoErrorType (*Set_EncParam)(void *pHandle, ExynosVideoEncParam*encParam); ExynosVideoErrorType (*Set_FrameTag)(void *pHandle, int frameTag); int (*Get_FrameTag)(void *pHandle); - ExynosVideoErrorType (*Set_FrameType)(void *pHandle, int frameType); + ExynosVideoErrorType (*Set_FrameType)(void *pHandle, ExynosVideoFrameType frameType); ExynosVideoErrorType (*Set_FrameRate)(void *pHandle, int frameRate); ExynosVideoErrorType (*Set_BitRate)(void *pHandle, int bitRate); ExynosVideoErrorType (*Set_FrameSkip)(void *pHandle, int frameSkip); diff --git a/exynos4/libswconverter/swconvertor.c b/exynos4/libswconverter/swconvertor.c index 756fb13..115795e 100755 --- a/exynos4/libswconverter/swconvertor.c +++ b/exynos4/libswconverter/swconvertor.c @@ -28,8 +28,10 @@ * 2012.02.01 : Create */ -#include "stdio.h" -#include "stdlib.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "swconverter.h" /* @@ -53,7 +55,7 @@ static int tile_4x2_read(int x_size, int y_size, int x_pos, int y_pos) { int pixel_x_m1, pixel_y_m1; - int roundup_x, roundup_y; + int roundup_x; int linear_addr0, linear_addr1, bank_addr ; int x_addr; int trans_addr; @@ -62,7 +64,6 @@ static int tile_4x2_read(int x_size, int y_size, int x_pos, int y_pos) pixel_y_m1 = y_size -1; roundup_x = ((pixel_x_m1 >> 7) + 1); - roundup_y = ((pixel_x_m1 >> 6) + 1); x_addr = x_pos >> 2; @@ -1565,9 +1566,6 @@ void csc_RGB565_to_YUV420P( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset1 = width * height; - unsigned int offset2 = width/2 * height/2; - unsigned short int *pSrc = (unsigned short int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1639,8 +1637,6 @@ void csc_RGB565_to_YUV420SP( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset = width * height; - unsigned short int *pSrc = (unsigned short int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1716,9 +1712,6 @@ void csc_ARGB8888_to_YUV420P( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset1 = width * height; - unsigned int offset2 = width/2 * height/2; - unsigned int *pSrc = (unsigned int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1790,8 +1783,6 @@ void csc_ARGB8888_to_YUV420SP( unsigned int R, G, B; unsigned int Y, U, V; - unsigned int offset = width * height; - unsigned int *pSrc = (unsigned int *)rgb_src; unsigned char *pDstY = (unsigned char *)y_dst; @@ -1827,4 +1818,4 @@ void csc_ARGB8888_to_YUV420SP( } } } -}
\ No newline at end of file +} diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.c b/openmax/component/video/dec/Exynos_OMX_Vdec.c index 3fa4f06..e42b4c5 100755 --- a/openmax/component/video/dec/Exynos_OMX_Vdec.c +++ b/openmax/component/video/dec/Exynos_OMX_Vdec.c @@ -106,7 +106,7 @@ void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent) height = exynosOutputPort->portDefinition.format.video.nSliceHeight = exynosInputPort->portDefinition.format.video.nSliceHeight; - switch(exynosOutputPort->portDefinition.format.video.eColorFormat) { + switch((int)exynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: if (width && height) @@ -251,28 +251,33 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL; #ifdef TIZEN_FEATURE_E3250 MMVideoBuffer *pSlpOutBuf = NULL; -#endif +#endif //TIZEN_FEATURE_E3250 FunctionIn(); OMX_U32 width = 0, height = 0; + +#ifndef TIZEN_FEATURE_E3250 int imageSize = 0; OMX_COLOR_FORMATTYPE colorFormat; +#endif void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer; +#ifndef TIZEN_FEATURE_E3250 void *pSrcBuf[MAX_BUFFER_PLANE] = {NULL, }; void *pYUVBuf[MAX_BUFFER_PLANE] = {NULL, }; CSC_ERRORCODE cscRet = CSC_ErrorNone; - CSC_METHOD csc_method = CSC_METHOD_SW; - unsigned int cacheable = 1; +#endif pBufferInfo = (DECODE_CODEC_EXTRA_BUFFERINFO *)dstOutputData->extInfo; width = pBufferInfo->imageWidth; height = pBufferInfo->imageHeight; +#ifndef TIZEN_FEATURE_E3250 imageSize = width * height; colorFormat = pBufferInfo->ColorFormat; +#endif #ifdef TIZEN_FEATURE_E3250 pSlpOutBuf = (MMVideoBuffer *)pOutputBuf; @@ -311,7 +316,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pSlpOutBuf->handle.dmabuf_fd[2]); ret = OMX_TRUE; -#else +#else //TIZEN_FEATURE_E3250 pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[0]; pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[1]; @@ -321,14 +326,15 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = (unsigned char *)pOutputBuf + imageSize; pYUVBuf[2] = (unsigned char *)pOutputBuf + imageSize + imageSize / 4; - csc_get_method(pVideoDec->csc_handle, &csc_method); #ifdef USE_DMA_BUF + CSC_METHOD csc_method = CSC_METHOD_SW; + csc_get_method(pVideoDec->csc_handle, &csc_method); if (csc_method == CSC_METHOD_HW) { pSrcBuf[0] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[0]); pSrcBuf[1] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[1]); pSrcBuf[2] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[2]); } -#endif +#endif //USE_DMA_BUF #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { @@ -347,9 +353,9 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = (unsigned char *)planes[1].fd; pYUVBuf[2] = (unsigned char *)planes[2].fd; } -#endif +#endif //USE_DMA_BUF } -#endif +#endif //USE_PB #ifdef USE_DMA_BUF if ((exynosOutputPort->bIsPBEnabled == OMX_FALSE) && (csc_method == CSC_METHOD_HW)) { @@ -357,8 +363,9 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = NULL; pYUVBuf[2] = NULL; } -#endif +#endif //USE_DMA_BUF + unsigned int cacheable = 1; if (pVideoDec->csc_set_format == OMX_FALSE) { csc_set_src_format( pVideoDec->csc_handle, /* handle */ @@ -399,18 +406,18 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA ret = OMX_FALSE; else ret = OMX_TRUE; -#endif +#endif //TIZEN_FEATURE_E3250 #ifdef USE_PB if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) { #ifdef TIZEN_FEATURE_E3250 Exynos_OSAL_UnlockPB(pOutputBuf, dstOutputData, exynosOutputPort, exynosInputPort); -#else +#else //TIZEN_FEATURE_E3250 Exynos_OSAL_UnlockPB(pOutputBuf, dstOutputData); -#endif +#endif //TIZEN_FEATURE_E3250 } -#endif +#endif //USE_PB -EXIT: +//EXIT: FunctionOut(); return ret; @@ -524,7 +531,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ OMX_BOOL ret = OMX_FALSE; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; EXYNOS_OMX_BASEPORT *exynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; + EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer; OMX_U32 copySize = 0; @@ -565,7 +572,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_ pExynosComponent->checkTimeStamp.nStartFlags = 0x0; pExynosComponent->checkTimeStamp.needSetStartTimeStamp = OMX_FALSE; pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE; - pExynosComponent->checkTimeStamp.bImmediateDisplay = OMX_FALSE; + pExynosComponent->checkTimeStamp.bImmediateDisplay = OMX_FALSE; } else { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "drop frame after seeking", pExynosComponent); if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.c b/openmax/component/video/dec/Exynos_OMX_VdecControl.c index 3a23044..130bf11 100755 --- a/openmax/component/video/dec/Exynos_OMX_VdecControl.c +++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.c @@ -1103,7 +1103,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter( goto EXIT; } - switch (nParamIndex) { + switch ((int)nParamIndex) { case OMX_IndexParamVideoInit: { OMX_PORT_PARAM_TYPE *portParam = (OMX_PORT_PARAM_TYPE *)ComponentParameterStructure; @@ -1244,7 +1244,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter( goto EXIT; } - switch (nIndex) { + switch ((int)nIndex) { case OMX_IndexParamVideoPortFormat: { OMX_VIDEO_PARAM_PORTFORMATTYPE *portFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure; @@ -1384,7 +1384,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetConfig( goto EXIT; } - switch (nIndex) { + switch ((EXYNOS_OMX_INDEXTYPE)nIndex) { case OMX_IndexVendorThumbnailMode: { EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index dd203ab..bf88e02 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -610,7 +610,7 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) /* IL Client assigns FD value in pBuffer */ plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer; #else - plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); + plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, (int)pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer); #endif #if 0 } else { @@ -1592,7 +1592,7 @@ OMX_ERRORTYPE Exynos_H264Dec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index e5ecb8c..4e7acf7 100755 --- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -1031,7 +1031,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: // case OMX_SEC_COLOR_FormatNV12TPhysicalAddress: diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index acb4037..15bb2e8 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -1713,7 +1713,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index b809ed9..57c82f1 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -379,7 +379,7 @@ OMX_ERRORTYPE Process_Wmv_CodecConfigData(OMX_COMPONENTTYPE *pOMXComponent, void EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle; #ifdef TIZEN_FEATURE_E3250 - EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATA *)pConfig; + EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATABUFFER*)pConfig; OMX_U8 *pInputStream = pSrcInputData->bufferHeader->pBuffer; #endif @@ -1641,7 +1641,7 @@ OMX_ERRORTYPE Exynos_WmvDec_SetParameter( pExynosOutputPort->portDefinition.format.video.nStride = width; pExynosOutputPort->portDefinition.format.video.nSliceHeight = height; - switch (pExynosOutputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosOutputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: pExynosOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.c b/openmax/component/video/enc/Exynos_OMX_Venc.c index 1b1b0ed..266448b 100644 --- a/openmax/component/video/enc/Exynos_OMX_Venc.c +++ b/openmax/component/video/enc/Exynos_OMX_Venc.c @@ -233,13 +233,13 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA { #ifdef USE_DMA_BUF if (csc_method == CSC_METHOD_HW) { - pSrcBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream); + pSrcBuf[0] = (unsigned char *)Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream); pSrcBuf[1] = NULL; pSrcBuf[2] = NULL; } #endif - switch (eColorFormat) { + switch ((int)eColorFormat) { case OMX_COLOR_FormatYUV420Planar: /* YUV420Planar converted to YUV420Semiplanar (interleaved UV plane) as per MFC spec.*/ csc_src_color_format = omx_2_hal_pixel_format((unsigned int)OMX_COLOR_FormatYUV420Planar); diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c index 974bc0c..e3eb799 100755 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -252,7 +252,7 @@ static void Set_H264Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pCommonParam->CbPadVal = 0; pCommonParam->CrPadVal = 0; - switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ case OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd: @@ -1275,7 +1275,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SetParameter( goto EXIT; } - switch (nIndex) { + switch ((int)nIndex) { case OMX_IndexParamVideoAvc: { OMX_VIDEO_PARAM_AVCTYPE *pDstAVCComponent = NULL; @@ -1505,7 +1505,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SetConfig( pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle; pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; - switch (nIndex) { + switch ((int)nIndex) { case OMX_IndexConfigVideoIntraPeriod: { OMX_U32 nPFrames = (*((OMX_U32 *)pComponentConfigStructure)) - 1; diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c index 9b2f920..d775ad4 100755 --- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c +++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c @@ -243,7 +243,7 @@ static void Set_Mpeg4Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pCommonParam->CbPadVal = 0; pCommonParam->CrPadVal = 0; - switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ #ifdef TIZEN_FEATURE_E3250 @@ -343,7 +343,7 @@ static void Set_H263Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent) pCommonParam->CbPadVal = 0; pCommonParam->CrPadVal = 0; - switch ((EXYNOS_OMX_COLOR_FORMATTYPE)pExynosInputPort->portDefinition.format.video.eColorFormat) { + switch ((int)pExynosInputPort->portDefinition.format.video.eColorFormat) { case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_COLOR_FormatYUV420Planar: /* Converted to NV12 in Exynos_Preprocessor_InputData */ #ifdef TIZEN_FEATURE_E3250 diff --git a/openmax/osal/Exynos_OSAL_Log.h b/openmax/osal/Exynos_OSAL_Log.h index 66657cb..32d90aa 100755 --- a/openmax/osal/Exynos_OSAL_Log.h +++ b/openmax/osal/Exynos_OSAL_Log.h @@ -81,10 +81,15 @@ typedef enum _LOG_LEVEL #define OMX_DEBUG_LEVEL 2 /* EXYNOS_LOG_INFO */ +#undef ALOGV #define ALOGV(...) Exynos_OSAL_Log(EXYNOS_LOG_VERVOSE, __VA_ARGS__) +#undef ALOGD #define ALOGD(...) Exynos_OSAL_Log(EXYNOS_LOG_TRACE, __VA_ARGS__) +#undef ALOGI #define ALOGI(...) Exynos_OSAL_Log(EXYNOS_LOG_INFO, __VA_ARGS__) +#undef ALOGW #define ALOGW(...) Exynos_OSAL_Log(EXYNOS_LOG_WARNING, __VA_ARGS__) +#undef ALOGE #define ALOGE(...) Exynos_OSAL_Log(EXYNOS_LOG_ERROR, __VA_ARGS__) #ifndef EXYNOS_LOG_TAG diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index 9ae846c..796b145 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -170,7 +170,7 @@ OMX_ERRORTYPE Exynos_OSAL_LockPB( vplanes[1].addr = buffer->data[1]; //vaddr[1]; vplanes[2].addr = NULL; //vaddr[2]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Exynos_OSAL_LockPB:fd[0](%d) fd[1](%d) a[0](%p) a[1](%p)", + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Exynos_OSAL_LockPB:fd[0](%d) fd[1](%d) a[0](%p) a[1](%p)", buffer->handle.dmabuf_fd[0], buffer->handle.dmabuf_fd[1], buffer->data[0], buffer->data[1]); #else android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer; @@ -492,7 +492,7 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter( goto EXIT; } - switch (nIndex) { + switch ((int)nIndex) { #ifdef TIZEN_FEATURE_E3250 case OMX_IndexParamEnablePlatformSpecificBuffers: #else diff --git a/openmax/osal/Exynos_OSAL_SharedMemory.c b/openmax/osal/Exynos_OSAL_SharedMemory.c index dff3cfa..0514f9a 100755 --- a/openmax/osal/Exynos_OSAL_SharedMemory.c +++ b/openmax/osal/Exynos_OSAL_SharedMemory.c @@ -76,7 +76,7 @@ OMX_HANDLETYPE Exynos_OSAL_SharedMemory_Open() if (pHandle == NULL) goto EXIT; - IONClient = (OMX_HANDLETYPE)ion_client_create(); + IONClient = ion_client_create(); if (IONClient <= 0) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "ion_client_create Error: %d", IONClient); Exynos_OSAL_Free((void *)pHandle); @@ -84,7 +84,7 @@ OMX_HANDLETYPE Exynos_OSAL_SharedMemory_Open() goto EXIT; } - pHandle->hIONHandle = IONClient; + pHandle->hIONHandle = (OMX_HANDLETYPE)IONClient; Exynos_OSAL_MutexCreate(&pHandle->hSMMutex); @@ -301,7 +301,7 @@ OMX_PTR Exynos_OSAL_SharedMemory_Map(OMX_HANDLETYPE handle, OMX_U32 size, unsign pElement = (EXYNOS_SHAREDMEM_LIST *)Exynos_OSAL_Malloc(sizeof(EXYNOS_SHAREDMEM_LIST)); Exynos_OSAL_Memset(pElement, 0, sizeof(EXYNOS_SHAREDMEM_LIST)); - IONBuffer = (OMX_PTR)ionfd; + IONBuffer = (ion_buffer)ionfd; if (IONBuffer <= 0) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "ion_alloc Error: %d", IONBuffer); |