From 73767606ec481a683bf10d8a736554f055eb456a Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Tue, 12 Sep 2017 13:16:09 +0900 Subject: [PATCH] Removed build warnnings Change-Id: Ie78eac3c7521930968dd5ad2800265e3a9987a38 --- configure.ac | 2 +- omx/gstomx.c | 12 +++--------- omx/gstomxvideodec.c | 6 +++--- omx/gstomxvideoenc.c | 30 +++++++----------------------- 4 files changed, 14 insertions(+), 36 deletions(-) diff --git a/configure.ac b/configure.ac index a275b91..11108c9 100644 --- a/configure.ac +++ b/configure.ac @@ -356,7 +356,7 @@ dnl define an ERROR_CFLAGS Makefile variable AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [ -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wformat-nonliteral - -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return + -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs ]) dnl define correct level for debugging messages diff --git a/omx/gstomx.c b/omx/gstomx.c index b4b7054..5b11aaf 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -1800,8 +1800,6 @@ gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufmgr, gbo guint n = 0; gint num = 0; gint i = 0 , j = 0; - gint nRight = 0; - gint nBottom = 0; gint planes[MAX_BUFFER_PLANE] = {0, }; gint stride[MAX_BUFFER_PLANE] = {0, }; GList *buffers = NULL; @@ -1812,6 +1810,7 @@ gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufmgr, gbo OMX_CONFIG_RECTTYPE rect; tbm_surface_h surface; tbm_surface_info_s info; + int ret; g_return_val_if_fail (port != NULL, OMX_ErrorUndefined); @@ -1829,11 +1828,6 @@ gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufmgr, gbo rect.nWidth = port->port_def.format.video.nFrameWidth; rect.nHeight = port->port_def.format.video.nFrameHeight; } - nRight = port->port_def.format.video.nFrameWidth - rect.nLeft - rect.nWidth; - nBottom = port->port_def.format.video.nFrameHeight - rect.nTop - rect.nHeight; - - GST_INFO_OBJECT (comp->parent, "crop info: nLeft %d, nRight %d, nTop %d, nBottom %d", - rect.nLeft, nRight, rect.nTop, nBottom); g_mutex_lock (&port->comp->lock); @@ -1846,8 +1840,8 @@ gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufmgr, gbo if (port->index == 1) { surface = tbm_surface_create (rect.nWidth, rect.nHeight, TBM_FORMAT_NV12); - err = tbm_surface_get_info (surface, &info); - if (err != TBM_SURFACE_ERROR_NONE) { + ret = tbm_surface_get_info (surface, &info); + if (ret != TBM_SURFACE_ERROR_NONE) { tbm_surface_destroy (surface); g_mutex_unlock (&port->comp->lock); return OMX_ErrorUndefined; diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 12fca87..ff435bd 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1971,9 +1971,9 @@ gst_omx_video_dec_negotiate (GstOMXVideoDec * self) GstCaps *templ_caps, *intersection; GstVideoFormat format; GstStructure *s; - gchar *format_str = NULL; + const gchar *format_str = NULL; #ifdef TIZEN_FEATURE_OMX - gchar *format_tmp; + const gchar *format_tmp; int i; #endif @@ -2014,7 +2014,7 @@ gst_omx_video_dec_negotiate (GstOMXVideoDec * self) for(i = 0; i < gst_caps_get_size (intersection); i++) { s = gst_caps_get_structure (intersection, i); - if (format_tmp = gst_structure_get_string (s, "format")) { + if ((format_tmp = gst_structure_get_string (s, "format"))) { if (!strncmp (format_tmp, "S", 1)) { format_str = format_tmp; diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 41ddaaf..617eb21 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1567,11 +1567,11 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf, break; } case GST_VIDEO_FORMAT_ST12: - case GST_VIDEO_FORMAT_SN12:{ + case GST_VIDEO_FORMAT_SN12: + { GstMemory* ext_memory = gst_buffer_peek_memory(inbuf, 1); GstMapInfo ext_info = GST_MAP_INFO_INIT; MMVideoBuffer *mm_vbuffer = NULL; - tbm_bo_handle handle_bo; if (!ext_memory) { GST_WARNING_OBJECT (self, "null MMVideoBuffer pointer in hw color format. skip this."); @@ -1583,32 +1583,16 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf, gst_memory_unmap(ext_memory, &ext_info); if (mm_vbuffer != NULL && mm_vbuffer->type == MM_VIDEO_BUFFER_TYPE_TBM_BO) { - - if (mm_vbuffer->handle.dmabuf_fd[0] == 0) { - handle_bo = tbm_bo_get_handle (mm_vbuffer->handle.bo[0], TBM_DEVICE_MM); - mm_vbuffer->handle.dmabuf_fd[0] = handle_bo.u32; - } - - if (mm_vbuffer->handle.dmabuf_fd[1] == 0) { - handle_bo = tbm_bo_get_handle (mm_vbuffer->handle.bo[1], TBM_DEVICE_MM); - mm_vbuffer->handle.dmabuf_fd[1] = handle_bo.u32; - } - - if (mm_vbuffer->data[0] == NULL) { - handle_bo = tbm_bo_get_handle (mm_vbuffer->handle.bo[0], TBM_DEVICE_CPU); - mm_vbuffer->data[0] = handle_bo.ptr; - } - - if (mm_vbuffer->data[1] == NULL){ - handle_bo = tbm_bo_get_handle (mm_vbuffer->handle.bo[1], TBM_DEVICE_CPU); - mm_vbuffer->data[1] = handle_bo.ptr; - } + mm_vbuffer->handle.dmabuf_fd[0] = tbm_bo_get_handle (mm_vbuffer->handle.bo[0], TBM_DEVICE_MM).u32; + mm_vbuffer->handle.dmabuf_fd[1] = tbm_bo_get_handle (mm_vbuffer->handle.bo[1], TBM_DEVICE_MM).u32; + mm_vbuffer->data[0] = tbm_bo_get_handle (mm_vbuffer->handle.bo[0], TBM_DEVICE_CPU).ptr; + mm_vbuffer->data[1] = tbm_bo_get_handle (mm_vbuffer->handle.bo[1], TBM_DEVICE_CPU).ptr; GST_LOG_OBJECT (self, "enc. fd[0]:%d fd[1]:%d a[0]:%p, a[1]:%p, w[0]:%d h[0]:%d %d, %d, buf_share_method:%d", mm_vbuffer->handle.dmabuf_fd[0], mm_vbuffer->handle.dmabuf_fd[1], mm_vbuffer->data[0], mm_vbuffer->data[1], mm_vbuffer->width[0], mm_vbuffer->height[0], mm_vbuffer->width[1], mm_vbuffer->height[1], mm_vbuffer->type); } else { - GST_WARNING_OBJECT (self, "enc input has wrong buf"); + GST_WARNING_OBJECT (self, "enc input has wrong buf"); } outbuf->omx_buf->nAllocLen = sizeof (MMVideoBuffer); -- 2.7.4