(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 *
-GType gst_mm_buffer_pool_get_type (void);
G_DEFINE_TYPE (GstMMBufferPool, gst_mm_buffer_pool, GST_TYPE_BUFFER_POOL);
{
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){
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;
}
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);
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;
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;
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*/
return GST_BUFFER_POOL (pool);
}
+
+
#endif