From 53159d85c59a112e91cc27e9760d552906230828 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Mon, 11 Sep 2017 20:02:57 +0900 Subject: [PATCH] Remove build warnning Change-Id: I0100f675c4b4a5920f1ad8d9957f0a0ebacca083 --- gst/videoconvert/gsttbmbufferpool.c | 62 +++++-------------------------------- gst/videoconvert/gsttbmbufferpool.h | 13 +++++++- packaging/gst-plugins-base.spec | 2 +- 3 files changed, 21 insertions(+), 56 deletions(-) diff --git a/gst/videoconvert/gsttbmbufferpool.c b/gst/videoconvert/gsttbmbufferpool.c index 254db32..f0d1955 100644 --- a/gst/videoconvert/gsttbmbufferpool.c +++ b/gst/videoconvert/gsttbmbufferpool.c @@ -16,61 +16,18 @@ int new_calc_plane(int width, int height) (mbY * S5P_FIMV_NUM_PIXELS_IN_MB_ROW)); } -int new_calc_yplane(int width, int height) -{ - return (ALIGN_TO_4KB(new_calc_plane(width, height) + - S5P_FIMV_D_ALIGN_PLANE_SIZE)); -} - -int new_calc_uvplane(int width, int height) -{ - return (ALIGN_TO_4KB((new_calc_plane(width, height) >> 1) + - S5P_FIMV_D_ALIGN_PLANE_SIZE)); -} - -int -calc_plane(int width, int height) -{ - int mbX, mbY; - - mbX = ALIGN(width, S5P_FIMV_NV12MT_HALIGN); - mbY = ALIGN(height, S5P_FIMV_NV12MT_VALIGN); - - return ALIGN(mbX * mbY, S5P_FIMV_DEC_BUF_ALIGN); -} - -int -calc_yplane(int width, int height) -{ - int mbX, mbY; - - mbX = ALIGN(width + 24, S5P_FIMV_NV12MT_HALIGN); - mbY = ALIGN(height + 16, S5P_FIMV_NV12MT_VALIGN); - - return ALIGN(mbX * mbY, S5P_FIMV_DEC_BUF_ALIGN); -} - -int -calc_uvplane(int width, int height) -{ - int mbX, mbY; - - mbX = ALIGN(width + 16, S5P_FIMV_NV12MT_HALIGN); - mbY = ALIGN(height + 4, S5P_FIMV_NV12MT_VALIGN); - - return ALIGN((mbX * mbY)>>1, S5P_FIMV_DEC_BUF_ALIGN); -} - int gst_calculate_y_size(int width, int height) { - return CHOOSE_MAX_SIZE(calc_yplane(width,height),new_calc_yplane(width,height)); + return (ALIGN_TO_4KB(new_calc_plane(width, height) + + S5P_FIMV_D_ALIGN_PLANE_SIZE)); } int gst_calculate_uv_size(int width, int height) { - return CHOOSE_MAX_SIZE(calc_uvplane(width,height),new_calc_uvplane(width,height)); + return (ALIGN_TO_4KB((new_calc_plane(width, height) >> 1) + + S5P_FIMV_D_ALIGN_PLANE_SIZE)); } static GstMemory * @@ -174,7 +131,6 @@ gst_mm_memory_allocator_alloc (GstAllocator * allocator, GstMemoryFlags flags, -GType gst_mm_buffer_pool_get_type (void); G_DEFINE_TYPE (GstMMBufferPool, gst_mm_buffer_pool, GST_TYPE_BUFFER_POOL); @@ -190,7 +146,7 @@ gst_mm_buffer_pool_stop (GstBufferPool * bpool) { GstMMBufferPool *pool = GST_MM_BUFFER_POOL (bpool); - if(gst_buffer_pool_is_active (pool) == TRUE) + if(gst_buffer_pool_is_active (bpool) == TRUE) return FALSE; /* Remove any buffers that are there */ if(pool->buffers != NULL){ @@ -210,8 +166,6 @@ gst_mm_buffer_pool_stop (GstBufferPool * bpool) static const gchar ** gst_mm_buffer_pool_get_options (GstBufferPool * bpool) { - static const gchar *raw_video_options[] = - { GST_BUFFER_POOL_OPTION_VIDEO_META, NULL }; static const gchar *options[] = { NULL }; return options; } @@ -271,7 +225,7 @@ gst_mm_buffer_pool_alloc_buffer (GstBufferPool * bpool, mm_buf = (GstMMBuffer*) malloc(sizeof(GstMMBuffer)); mem = gst_mm_memory_allocator_alloc (pool->allocator, 0, mm_buf); buf = gst_buffer_new (); - buf->pool = pool; + buf->pool = bpool; mem->size = sizeof(GstMMBuffer); mem->offset = 0; gst_buffer_append_memory (buf, mem); @@ -402,9 +356,9 @@ gst_mm_buffer_pool_acquire_buffer (GstBufferPool * bpool, pool->current_buffer_index = i; g_return_val_if_fail (pool->current_buffer_index != -1, GST_FLOW_ERROR); - GST_DEBUG(" Acquiring buffer at index:[%d]",pool->current_buffer_index); + GST_DEBUG(" Acquiring buffer at index:[%d]", pool->current_buffer_index); buf = g_ptr_array_index (pool->buffers, pool->current_buffer_index); - GST_DEBUG("\ buffer:[%p]",buf); + GST_DEBUG("buffer:[%p]", buf); g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR); *buffer = buf; ret = GST_FLOW_OK; diff --git a/gst/videoconvert/gsttbmbufferpool.h b/gst/videoconvert/gsttbmbufferpool.h index ee2f78d..f6f113a 100644 --- a/gst/videoconvert/gsttbmbufferpool.h +++ b/gst/videoconvert/gsttbmbufferpool.h @@ -50,7 +50,10 @@ struct _GstMMBuffer static GQuark gst_mm_buffer_data_quark = 0; -#define GST_MM_BUFFER_POOL(pool) ((GstMMBufferPool *) pool) +#define GST_TYPE_MM_BUFFER_POOL \ + (gst_mm_buffer_pool_get_type() +#define GST_MM_BUFFER_POOL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MM_POOL,GstMMBufferPool)) typedef struct _GstMMBufferPool GstMMBufferPool; typedef struct _GstMMBufferPoolClass GstMMBufferPoolClass; @@ -99,6 +102,12 @@ struct _GstMMBufferPoolClass GstBufferPool * gst_mm_buffer_pool_new (GstElement * element ); +GType gst_mm_buffer_pool_get_type (void); + +int new_calc_plane(int width, int height); +int gst_calculate_y_size(int width, int height); +int gst_calculate_uv_size(int width, int height); + #ifdef USE_TBM_BUFFER /*MFC Buffer alignment macros*/ @@ -475,4 +484,6 @@ gst_tbm_buffer_pool_new (GstElement * element, GstOMXComponent * component, return GST_BUFFER_POOL (pool); } + + #endif diff --git a/packaging/gst-plugins-base.spec b/packaging/gst-plugins-base.spec index ebd9388..5409802 100755 --- a/packaging/gst-plugins-base.spec +++ b/packaging/gst-plugins-base.spec @@ -5,7 +5,7 @@ Name: gst-plugins-base Version: 1.6.1 -Release: 12 +Release: 13 License: LGPL-2.0+ Summary: GStreamer Streaming-Media Framework Plug-Ins Url: http://gstreamer.freedesktop.org/ -- 2.7.4