rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
+src-template-caps=video/x-raw,width=(int)[1,1920],height=(int)[1,1080],framerate=(fraction)[ 0/1, MAX ],stream-format=(string)SN12
[omxdec_mpeg4]
type-name=GstOMXMPEG4VideoDec
rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
+src-template-caps=video/x-raw,width=(int)[1,1920],height=(int)[1,1080],framerate=(fraction)[ 0/1, MAX ],stream-format=(string)SN12
[omxdec_h263]
type-name=GstOMXH263Dec
rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
+src-template-caps=video/x-raw,width=(int)[1,1920],height=(int)[1,1080],framerate=(fraction)[ 0/1, MAX ],stream-format=(string)SN12
[omxdec_h264]
type-name=GstOMXH264Dec
rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
+src-template-caps=video/x-raw,width=(int)[1,1920],height=(int)[1,1080],framerate=(fraction)[ 0/1, MAX ],stream-format=(string)SN12
[omxdec_vc1]
type-name=GstOMXWMVDec
rank=256
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
sink-template-caps=video/x-wmv,wmvversion=(int)3,format=(string){WMV3,WVC1},width=(int)[1,MAX],height=(int)[1,MAX]
[omxenc_h264]
rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-disable-outport;no-component-role
+sink-template-caps=video/x-raw, format=(string)SN12, width=(int) [1,1920], height=(int) [1,1080], framerate=(fraction)[0/1, MAX]
+src-template-caps=video/x-h264, width=(int) [1,1920], height=(int) [1,1080], framerate=(fraction) [0/1, MAX], alignment=(string) au, stream-format = (string){ avc, byte-stream }
[omxenc_mpeg4]
type-name=GstOMXMPEG4VideoEnc
rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
[omxenc_h263]
type-name=GstOMXH263Enc
rank=258
in-port-index=0
out-port-index=1
-hacks=no-component-role
+hacks=no-component-role;no-disable-outport
LDFLAGS="${SAVED_LDFLAGS}"])
AC_ARG_WITH([omx-target],
- AS_HELP_STRING([--with-omx-target],[Use this OpenMAX IL target (generic, bellagio, rpi)]),
- [ac_cv_omx_target="$withval"], [ac_cv_omx_target="none"])
+ AS_HELP_STRING([--with-omx-target],[Use this OpenMAX IL target (generic, bellagio, rpi, exynos, exynos64)]),
+ [ac_cv_omx_target="$withval"], [ac_cv_omx_target="generic"])
ac_cv_omx_target_struct_packing="none"
AC_MSG_NOTICE([Using $ac_cv_omx_target as OpenMAX IL target])
bellagio)
AC_DEFINE(USE_OMX_TARGET_BELLAGIO, 1, [Use Bellagio OpenMAX IL target])
;;
- none|*)
- AC_ERROR([invalid OpenMAX IL target, you must specify one of --with-omx-target={generic,rpi,bellagio}])
+ exynos)
+ AC_DEFINE(USE_OMX_TARGET_EXYNOS, 1, [Use Exynos OpenMAX IL target])
+ ;;
+ exynos64)
+ AC_DEFINE(USE_OMX_TARGET_EXYNOS64, 1, [Use Exynos64 OpenMAX IL target])
+ ;;
+ *)
+ AC_ERROR([invalid OpenMAX IL target])
;;
esac
AM_CONDITIONAL(USE_OMX_TARGET_GENERIC, test "x$ac_cv_omx_target" = "xgeneric")
config/Makefile
config/bellagio/Makefile
config/rpi/Makefile
+config/exynos/Makefile
+config/exynos64/Makefile
examples/Makefile
examples/egl/Makefile
m4/Makefile
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
- $(GMODULE_NO_EXPORT_CFLAGS)
+ $(TBM_CFLAGS) \
+ $(GMODULE_NO_EXPORT_CFLAGS) \
+ $(MM_COMMON_CFLAGS)
+
libgstomx_la_LIBADD = \
$(GST_GL_LIBS) \
$(GST_PLUGINS_BASE_LIBS) \
-lgstvideo-@GST_API_VERSION@ \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
- $(GMODULE_NO_EXPORT_LIBS)
-libgstomx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+ $(TBM_LIBS) \
+ $(GMODULE_NO_EXPORT_LIBS) \
+ $(MM_COMMON_LIBS)
+libgstomx_la_LDFLAGS = \
+ $(GST_PLUGIN_LDFLAGS) \
+ $(TBM_LDFLAGS) \
+ $(MM_COMMON_LDFLAGS)
EXTRA_DIST = \
openmax \
G_LOCK_DEFINE_STATIC (core_handles);
static GHashTable *core_handles;
-
-
GstOMXCore *
gst_omx_core_acquire (const gchar * filename)
{
buf->used = FALSE;
buf->settings_cookie = port->settings_cookie;
-#ifdef USE_TBM
-#ifdef USE_MM_VIDEO_BUFFER
- buf->scmn_buffer = (MMVideoBuffer*) l->data;
-#else
- buf->scmn_buffer = (SCMN_IMGB*) l->data;
-#endif
+#ifdef GST_TIZEN_MODIFICATION
+ buf->mm_vbuffer = (MMVideoBuffer*) l->data;
#endif
g_ptr_array_add (port->buffers, buf);
if (buffers) {
-
err =
OMX_UseBuffer (comp->handle, &buf->omx_buf, port->index, buf,
port->port_def.nBufferSize, l->data);
return err;
}
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
/* NOTE: Uses comp->lock and comp->messages_lock */
OMX_ERRORTYPE
-gst_omx_port_tbm_allocate_dec_buffers (tbm_bufmgr bufMgr, GstOMXPort * port, int eCompressionFormat)
+gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufMgr, int eCompressionFormat)
{
- OMX_ERRORTYPE err = OMX_ErrorNone;
guint n = 0;
- GList *buffers = NULL;
-#ifdef USE_MM_VIDEO_BUFFER
- MMVideoBuffer *ptr = NULL;
-#else
- SCMN_IMGB *ptr = NULL;
-#endif
int y_size = 0;
int uv_size = 0;
+ GList *buffers = NULL;
+ MMVideoBuffer *ptr = NULL;
+ GstOMXComponent *comp;
+ OMX_ERRORTYPE err = OMX_ErrorNone;
g_return_val_if_fail (port != NULL, OMX_ErrorUndefined);
+ comp = port->comp;
+
g_mutex_lock (&port->comp->lock);
/* deallocate previous allocated buffers... */
n = port->port_def.nBufferCountActual;
for(int i = 0; i < n; i++) {
-
-#ifdef USE_MM_VIDEO_BUFFER
ptr = (MMVideoBuffer*) malloc(sizeof(MMVideoBuffer));
memset(ptr,0,sizeof(MMVideoBuffer));
- if(port->index == 0) {
+ if(port->index == 0) {
ptr->handle.bo[0] = gst_omx_tbm_allocate_bo(bufMgr, port->port_def.nBufferSize);
ptr->handle.dmabuf_fd[0] = gst_omx_tbm_get_bo_fd(ptr->handle.bo[0]);
ptr->data[0] = gst_omx_tbm_get_bo_ptr(ptr->handle.bo[0]);
ptr->size[0] = port->port_def.nBufferSize;
ptr->type = MM_VIDEO_BUFFER_TYPE_TBM_BO;
+
+ GST_INFO_OBJECT (comp->parent,
+ "Allocating %d buffer[%p] for %s port %u", i,
+ ptr->handle.bo[0], comp->name, (guint) port->index);
}
else { /* output port */
-
y_size = gst_omx_calculate_y_size(eCompressionFormat,
- port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight);
+ port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight);
ptr->handle.bo[0] = gst_omx_tbm_allocate_bo(bufMgr, y_size);
ptr->handle.dmabuf_fd[0] = gst_omx_tbm_get_bo_fd(ptr->handle.bo[0]);
ptr->data[0] = gst_omx_tbm_get_bo_ptr(ptr->handle.bo[0]);
ptr->handle.paddr[0] = ptr->data[0];
ptr->size[0] = y_size;
- GST_LOG("%s size:[%d]",__FUNCTION__, y_size);
-
uv_size = gst_omx_calculate_uv_size(eCompressionFormat,
- port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight >> 1);
+ port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight >> 1);
ptr->handle.bo[1] = gst_omx_tbm_allocate_bo(bufMgr, uv_size);
ptr->handle.dmabuf_fd[1] = gst_omx_tbm_get_bo_fd(ptr->handle.bo[1]);
ptr->data[1] = gst_omx_tbm_get_bo_ptr(ptr->handle.bo[1]);
ptr->size[1] = uv_size;
ptr->type = MM_VIDEO_BUFFER_TYPE_DMABUF_FD;
- GST_ERROR(" fd[0]:%d, bo[0]:%p fd[1]:%d, bo[1]:%p, a[0]:%p",ptr->handle.dmabuf_fd[0],ptr->handle.bo[0],ptr->handle.dmabuf_fd[1],ptr->handle.bo[1], ptr->data[0]);
ptr->plane_num = 2;
+ GST_INFO_OBJECT (comp->parent,
+ "Allocating %d buffer bo[0]:%p bo[1]:%p fd[0]:%d fd[1]:%d size[0]:%d size[1]:%d for %s port %u", i,
+ ptr->handle.bo[0], ptr->handle.bo[0], ptr->handle.dmabuf_fd[0], ptr->handle.dmabuf_fd[1],
+ ptr->size[0], ptr->size[1], comp->name, (guint) port->index);
}
-#else
- ptr = (SCMN_IMGB*) malloc(sizeof(SCMN_IMGB));
- memset(ptr,0,sizeof(SCMN_IMGB));
- if(port->index == 0) {
-
- ptr->bo[0] = gst_omx_tbm_allocate_bo(bufMgr, port->port_def.nBufferSize);
- ptr->fd[0] = gst_omx_tbm_get_bo_fd(ptr->bo[0]);
- ptr->a[0] = gst_omx_tbm_get_bo_ptr(ptr->bo[0]);
- }
- else { /* output port */
-
- y_size = gst_omx_calculate_y_size(eCompressionFormat,
- port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight);
- ptr->bo[0] = gst_omx_tbm_allocate_bo(bufMgr, y_size);
- ptr->fd[0] = gst_omx_tbm_get_bo_fd(ptr->bo[0]);
- ptr->a[0] = gst_omx_tbm_get_bo_ptr(ptr->bo[0]);
-
- uv_size = gst_omx_calculate_uv_size(eCompressionFormat,
- port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight >> 1);
- ptr->bo[1] = gst_omx_tbm_allocate_bo(bufMgr, uv_size);
- ptr->fd[1] = gst_omx_tbm_get_bo_fd(ptr->bo[1]);
- ptr->a[1] = gst_omx_tbm_get_bo_ptr(ptr->bo[1]);
-
- ptr->y_size = y_size;
- ptr->uv_size = uv_size;
- ptr->buf_share_method = BUF_SHARE_METHOD_FD;
-
- }
-#endif
buffers = g_list_append(buffers,(gpointer)ptr);
}
/* NOTE: Uses comp->lock and comp->messages_lock */
OMX_ERRORTYPE
-gst_omx_port_tbm_allocate_enc_buffers (tbm_bufmgr bufMgr, GstOMXPort * port, int eCompressionFormat)
+gst_omx_port_tbm_allocate_enc_buffers (GstOMXPort * port, tbm_bufmgr bufMgr, int eCompressionFormat)
{
+ int y_size = 0;
+ int uv_size = 0;
OMX_ERRORTYPE err = OMX_ErrorNone;
guint n = 0;
GList *buffers = NULL;
-#ifdef USE_MM_VIDEO_BUFFER
MMVideoBuffer *ptr = NULL;
-#else
- SCMN_IMGB *ptr = NULL;
-#endif
- int y_size = 0;
- int uv_size = 0;
g_return_val_if_fail (port != NULL, OMX_ErrorUndefined);
n = port->port_def.nBufferCountActual;
for(int i = 0; i < n; i++) {
-#ifdef USE_MM_VIDEO_BUFFER
ptr = (MMVideoBuffer*) malloc(sizeof(MMVideoBuffer));
memset(ptr,0,sizeof(MMVideoBuffer));
if(port->index == 1) {
ptr->size[0] = port->port_def.nBufferSize;
ptr->handle_num = 1;
}
-#else
- ptr = (SCMN_IMGB*) malloc(sizeof(SCMN_IMGB));
- memset(ptr,0,sizeof(SCMN_IMGB));
- if(port->index == 1) {
-
- ptr->bo[0] = gst_omx_tbm_allocate_bo(bufMgr, port->port_def.nBufferSize);
- ptr->fd[0] = gst_omx_tbm_get_bo_fd(ptr->bo[0]);
- ptr->a[0] = gst_omx_tbm_get_bo_ptr(ptr->bo[0]);
- }
-#endif
buffers = g_list_append(buffers,(gpointer)ptr);
}
"port %u", buf, comp->name, port->index);
}
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
/* deallocate tbm buffers */
- if(buf->scmn_buffer != NULL) {
-#ifdef USE_MM_VIDEO_BUFFER
- gst_omx_tbm_deallocate_bo(buf->scmn_buffer->handle.bo[0]);
+ if(buf->mm_vbuffer != NULL) {
+ gst_omx_tbm_deallocate_bo(buf->mm_vbuffer->handle.bo[0]);
if(port->index == 1) /* output port */
- gst_omx_tbm_deallocate_bo(buf->scmn_buffer->handle.bo[1]);
-#else
- gst_omx_tbm_deallocate_bo(buf->scmn_buffer->bo[0]);
- if(port->index == 1) /* output port */
- gst_omx_tbm_deallocate_bo(buf->scmn_buffer->bo[1]);
-#endif
- free(buf->scmn_buffer);
- buf->scmn_buffer = NULL;
+ gst_omx_tbm_deallocate_bo(buf->mm_vbuffer->handle.bo[1]);
+ free(buf->mm_vbuffer);
+ buf->mm_vbuffer = NULL;
}
#endif
/* omx_buf can be NULL if allocation failed earlier
* valid anymore after the buffer was consumed
*/
buf->omx_buf->nFlags = 0;
- GST_ERROR_OBJECT(comp->parent,"Calling OMX_FillThisBuffer. buffer[%p]. function:[%s]",buf->omx_buf,__func__);
+ GST_DEBUG_OBJECT(comp->parent,"Calling OMX_FillThisBuffer. buffer[%p]. function:[%s]",buf->omx_buf,__func__);
err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
if (err != OMX_ErrorNone) {
class_data->component_role = default_role;
}
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
int new_calc_plane(int width, int height)
{
{
case OMX_VIDEO_CodingH263: /* FALL THROUGH */
case OMX_VIDEO_CodingMPEG4:
- /*size = calc_yplane(width,height);*/
size = CHOOSE_MAX_SIZE(calc_yplane(width,height),new_calc_yplane(width,height));
break;
case OMX_VIDEO_CodingMPEG2:
- /*size = calc_yplane(width,height);*/
size = CHOOSE_MAX_SIZE(calc_yplane(width,height),new_calc_yplane(width,height));
size = size << 1; /* MFC FIX. double the calculated buffer size */
GST_LOG("calculating Y size of mpeg2: height:[%d], width:[%d], size:[%d]",height,width,size);
break;
case OMX_VIDEO_CodingAVC: /* FALL THROUGH */
default:
- /*size = calc_plane(width,height);*/
size = CHOOSE_MAX_SIZE(calc_yplane(width,height),new_calc_yplane(width,height));
GST_LOG("calculating Y size of DEFAULT: height:[%d], width:[%d], size:[%d]",height,width,size);
}
{
case OMX_VIDEO_CodingH263: /* FALL THROUGH */
case OMX_VIDEO_CodingMPEG4:
- /*size = calc_uvplane(width,height);*/
size = CHOOSE_MAX_SIZE(calc_uvplane(width,height),new_calc_uvplane(width,height));
break;
case OMX_VIDEO_CodingMPEG2:
- /*size = calc_uvplane(width,height);*/
size = CHOOSE_MAX_SIZE(calc_uvplane(width,height),new_calc_uvplane(width,height));
size = size << 1; /* MFC FIX. double the calculated buffer size */
break;
case OMX_VIDEO_CodingAVC: /* FALL THROUGH */
default:
- /*size = calc_plane(width,height);*/
size = CHOOSE_MAX_SIZE(calc_uvplane(width,height),new_calc_uvplane(width,height));
GST_LOG("calculating UV size of DEFAULT: height:[%d], width:[%d], size:[%d]",height,width,size);
}
#include <OMX_Core.h>
#include <OMX_Component.h>
+#ifdef USE_OMX_TARGET_EXYNOS
+#include <tbm_type.h>
+#include <tbm_surface.h>
+#include <tbm_bufmgr.h>
+#endif
+
#ifdef USE_OMX_TARGET_RPI
#include <OMX_Broadcom.h>
#endif
/* MODIFICATION */
typedef enum GOmxVendor GOmxVendor; /* check omx vender */
-/* using common scmn_imgb format */
-#define SCMN_IMGB_MAX_PLANE (4) /* max channel count */
-
-/* image buffer definition
- +------------------------------------------+ ---
- | | ^
- | a[], p[] | |
- | +---------------------------+ --- | |
- | | | ^ | |
- | |<---------- w[] ---------->| | | |
- | | | | | |
- | | | |
- | | | h[] | e[]
- | | | |
- | | | | | |
- | | | | | |
- | | | v | |
- | +---------------------------+ --- | |
- | | v
- +------------------------------------------+ ---
-
- |<----------------- s[] ------------------>|
-*/
-
-typedef struct
-{
- int w[SCMN_IMGB_MAX_PLANE]; /* width of each image plane */
- int h[SCMN_IMGB_MAX_PLANE]; /* height of each image plane */
- int s[SCMN_IMGB_MAX_PLANE]; /* stride of each image plane */
- int e[SCMN_IMGB_MAX_PLANE]; /* elevation of each image plane */
- void * a[SCMN_IMGB_MAX_PLANE]; /* user space address of each image plane */
- void * p[SCMN_IMGB_MAX_PLANE]; /* physical address of each image plane, if needs */
- int cs; /* color space type of image */
- int x; /* left postion, if needs */
- int y; /* top position, if needs */
- int __dummy2; /* to align memory */
- int data[16]; /* arbitrary data */
-
- int fd[SCMN_IMGB_MAX_PLANE]; /* DMABUF fd of each image plane */
- int buf_share_method;
-
- int y_size; /* Y plane size in case of ST12 */
- int uv_size; /* UV plane size in case of ST12 */
- //void *bo[SCMN_IMGB_MAX_PLANE]; /* Tizen buffer object of each image plane */
- tbm_bo bo[SCMN_IMGB_MAX_PLANE];
-
- void *jpeg_data; /* JPEG data */
- int jpeg_size; /* JPEG size */
-
- int tz_enable; /* tzmem buffer */
-} SCMN_IMGB;
-
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
#define MFC_INPUT_BUFFER_PLANE 1
#define MFC_OUTPUT_BUFFER_PLANE 2
struct _TBMOutputBuffer
{
-#ifdef USE_MM_VIDEO_BUFFER
MMVideoBuffer *tbmBuffer[MAX_OUTPUT_BUFFER];
-#else
- SCMN_IMGB *tbmBuffer[MAX_OUTPUT_BUFFER];
-#endif
OMX_U32 allocatedCount;
GList *buffers;
};
OMX_EXT_COLOR_FormatNV12LFdValue = 0x7F000013
};
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
/* Extended port settings. */
enum {
OMX_IndexParamEnablePlatformSpecificBuffers = 0x7F000011
/* TRUE if this is an EGLImage */
gboolean eglimage;
-#ifdef USE_TBM
-#ifdef USE_MM_VIDEO_BUFFER
+#ifdef GST_TIZEN_MODIFICATION
/* MMVideoBuffer array to use TBM buffers */
- MMVideoBuffer *scmn_buffer;
-#else
- /* SCMN_IMGB array to use TBM buffers */
- SCMN_IMGB *scmn_buffer;
-#endif
+ MMVideoBuffer *mm_vbuffer;
#endif
};
gboolean gst_omx_port_is_flushing (GstOMXPort *port);
OMX_ERRORTYPE gst_omx_port_allocate_buffers (GstOMXPort *port);
-#ifdef USE_TBM
-OMX_ERRORTYPE gst_omx_port_tbm_allocate_dec_buffers (tbm_bufmgr bufMgr, GstOMXPort * port, int eCompressionFormat);
-OMX_ERRORTYPE gst_omx_port_tbm_allocate_enc_buffers (tbm_bufmgr bufMgr, GstOMXPort * port, int eCompressionFormat);
+#ifdef GST_TIZEN_MODIFICATION
+OMX_ERRORTYPE gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufMgr, int eCompressionFormat);
+OMX_ERRORTYPE gst_omx_port_tbm_allocate_enc_buffers (GstOMXPort * port, tbm_bufmgr bufMgr, int eCompressionFormat);
#endif
OMX_ERRORTYPE gst_omx_port_use_buffers (GstOMXPort *port, const GList *buffers);
OMX_ERRORTYPE gst_omx_port_use_eglimages (GstOMXPort *port, const GList *images);
void gst_omx_set_default_role (GstOMXClassData *class_data, const gchar *default_role);
+#ifdef GST_TIZEN_MODIFICATION
+
+/*MFC Buffer alignment macros*/
+#define S5P_FIMV_DEC_BUF_ALIGN (8 * 1024)
+#define S5P_FIMV_ENC_BUF_ALIGN (8 * 1024)
+#define S5P_FIMV_NV12M_HALIGN 16
+#define S5P_FIMV_NV12M_LVALIGN 16
+#define S5P_FIMV_NV12M_CVALIGN 8
+#define S5P_FIMV_NV12MT_HALIGN 128
+#define S5P_FIMV_NV12MT_VALIGN 64
+#define S5P_FIMV_NV12M_SALIGN 2048
+#define S5P_FIMV_NV12MT_SALIGN 8192
+
+#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
+
+/* Buffer alignment defines */
+#define SZ_1M 0x00100000
+#define S5P_FIMV_D_ALIGN_PLANE_SIZE 64
+
+#define S5P_FIMV_MAX_FRAME_SIZE (2 * SZ_1M)
+#define S5P_FIMV_NUM_PIXELS_IN_MB_ROW 16
+#define S5P_FIMV_NUM_PIXELS_IN_MB_COL 16
+
+/* Macro */
+#define ALIGN_TO_4KB(x) ((((x) + (1 << 12) - 1) >> 12) << 12)
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define CHOOSE_MAX_SIZE(a,b) ((a) > (b) ? (a) : (b))
+
+int new_calc_plane(int width, int height);
+int new_calc_yplane(int width, int height);
+int new_calc_uvplane(int width, int height);
+
+int calc_plane(int width, int height);
+int calc_yplane(int width, int height);
+int calc_uvplane(int width, int height);
+int gst_omx_calculate_y_size(int compressionFormat, int width, int height);
+int gst_omx_calculate_uv_size(int compressionFormat, int width, int height);
+
+tbm_bo gst_omx_tbm_allocate_bo(tbm_bufmgr hBufmgr, int size);
+void gst_omx_tbm_deallocate_bo(tbm_bo bo);
+OMX_U32 gst_omx_tbm_get_bo_fd(tbm_bo bo);
+OMX_PTR gst_omx_tbm_get_bo_ptr(tbm_bo bo);
+
+#endif
/* refered by plugin_init */
GST_DEBUG_CATEGORY_EXTERN (gst_omx_video_debug_category);
stride[1] = nstride;
offset[1] = offset[0] + stride[0] * nslice;
break;
+ case GST_VIDEO_FORMAT_SN12:
+ case GST_VIDEO_FORMAT_ST12:
+ offset[0] = 0;
+ stride[0] = pool->port->port_def.format.video.nStride;
+ offset[1] = stride[0] * pool->port->port_def.format.video.nSliceHeight;
+ stride[1] = pool->port->port_def.format.video.nStride;
+ break;
default:
g_assert_not_reached ();
break;
}
}
- pool->need_copy = need_copy;
+ /*pool->need_copy = need_copy;*/
}
if (pool->need_copy || pool->add_videometa) {
case OMX_COLOR_Format16bitBGR565:
format = GST_VIDEO_FORMAT_BGR16;
break;
+#ifdef GST_TIZEN_MODIFICATION
+ case OMX_EXT_COLOR_FormatNV12TPhysicalAddress:
+ format = GST_VIDEO_FORMAT_SN12;
+ break;
+#endif
default:
format = GST_VIDEO_FORMAT_UNKNOWN;
break;
m->type = param.eColorFormat;
negotiation_map = g_list_append (negotiation_map, m);
GST_DEBUG_OBJECT (comp->parent,
- "Component supports %s (%d) at index %u",
+ "Component supports %s (%x) at index %u",
gst_video_format_to_string (f), param.eColorFormat,
(guint) param.nIndex);
} else {
GST_DEBUG_OBJECT (comp->parent,
- "Component supports unsupported color format %d at index %u",
+ "Component supports unsupported color format %x at index %u",
param.eColorFormat, (guint) param.nIndex);
}
}
#include "config.h"
#endif
-//#define CODEC_DEC_OUTPUT_DUMP
#include <gst/gst.h>
#if defined (USE_OMX_TARGET_RPI) && defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
+//#define CODEC_DEC_OUTPUT_DUMP
+#include <stdio.h>
#include <string.h>
#include "gstomxbufferpool.h"
g_mutex_init (&self->drain_lock);
g_cond_init (&self->drain_cond);
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
self->hTBMBufMgr = NULL;
self->drm_fd = -1;
#endif
if (!self->dec_in_port || !self->dec_out_port)
return FALSE;
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
self->hTBMBufMgr = tbm_bufmgr_init(self->drm_fd);
if(self->hTBMBufMgr == NULL){
gst_omx_component_get_state (self->dec, 5 * GST_SECOND);
}
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
/* uninitialize tbm buffer manager */
if(self->hTBMBufMgr != NULL){
tbm_bufmgr_deinit(self->hTBMBufMgr);
GST_ERROR_OBJECT (self, "codec dec output dump start. w = %d, h = %d", outbuf->width[0], outbuf->height[0]);
- sprintf(filename, "/opt/usr/dec_output_dump_%d_%d.yuv", outbuf->stride_width[0], outbuf->height[0]);
+ sprintf(filename, "/tmp/dec_output_dump_%d_%d.yuv", outbuf->stride_width[0], outbuf->height[0]);
fp = fopen(filename, "ab");
for (i = 0; i < outbuf->height[0]; i++) {
#endif //ENS:a
/* Different strides */
+#ifndef GST_TIZEN_MODIFICATION
if (gst_video_frame_map (&frame, vinfo, outbuf, GST_MAP_WRITE)) {
- const guint nstride = port_def->format.video.nStride;
- const guint nslice = port_def->format.video.nSliceHeight;
- guint src_stride[GST_VIDEO_MAX_PLANES] = { nstride, 0, };
- guint src_size[GST_VIDEO_MAX_PLANES] = { nstride * nslice, 0, };
- gint dst_width[GST_VIDEO_MAX_PLANES] = { 0, };
- gint dst_height[GST_VIDEO_MAX_PLANES] =
- { GST_VIDEO_INFO_HEIGHT (vinfo), 0, };
- const guint8 *src;
- guint p;
-
- switch (GST_VIDEO_INFO_FORMAT (vinfo)) {
- case GST_VIDEO_FORMAT_ABGR:
- case GST_VIDEO_FORMAT_ARGB:
- dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo) * 4;
- break;
- case GST_VIDEO_FORMAT_RGB16:
- case GST_VIDEO_FORMAT_BGR16:
- case GST_VIDEO_FORMAT_YUY2:
- case GST_VIDEO_FORMAT_UYVY:
- case GST_VIDEO_FORMAT_YVYU:
- dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo) * 2;
- break;
- case GST_VIDEO_FORMAT_GRAY8:
- dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
- break;
- case GST_VIDEO_FORMAT_I420:
- dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
- src_stride[1] = nstride / 2;
- src_size[1] = (src_stride[1] * nslice) / 2;
- dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo) / 2;
- dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2;
- src_stride[2] = nstride / 2;
- src_size[2] = (src_stride[1] * nslice) / 2;
- dst_width[2] = GST_VIDEO_INFO_WIDTH (vinfo) / 2;
- dst_height[2] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2;
- break;
- case GST_VIDEO_FORMAT_NV12:
- dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
- src_stride[1] = nstride;
- src_size[1] = src_stride[1] * nslice / 2;
- dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo);
- dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2;
- break;
- case GST_VIDEO_FORMAT_NV16:
- dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
- src_stride[1] = nstride;
- src_size[1] = src_stride[1] * nslice;
- dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo);
- dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo);
+#endif
+ const guint nstride = port_def->format.video.nStride;
+ const guint nslice = port_def->format.video.nSliceHeight;
+ guint src_stride[GST_VIDEO_MAX_PLANES] = { nstride, 0, };
+ guint src_size[GST_VIDEO_MAX_PLANES] = { nstride * nslice, 0, };
+ gint dst_width[GST_VIDEO_MAX_PLANES] = { 0, };
+ gint dst_height[GST_VIDEO_MAX_PLANES] =
+ { GST_VIDEO_INFO_HEIGHT (vinfo), 0, };
+ const guint8 *src;
+ guint p;
+
+ switch (GST_VIDEO_INFO_FORMAT (vinfo)) {
+ case GST_VIDEO_FORMAT_ABGR:
+ case GST_VIDEO_FORMAT_ARGB:
+ dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo) * 4;
+ break;
+ case GST_VIDEO_FORMAT_RGB16:
+ case GST_VIDEO_FORMAT_BGR16:
+ case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_UYVY:
+ case GST_VIDEO_FORMAT_YVYU:
+ dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo) * 2;
+ break;
+ case GST_VIDEO_FORMAT_GRAY8:
+ dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
+ break;
+ case GST_VIDEO_FORMAT_I420:
+ dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
+ src_stride[1] = nstride / 2;
+ src_size[1] = (src_stride[1] * nslice) / 2;
+ dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo) / 2;
+ dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2;
+ src_stride[2] = nstride / 2;
+ src_size[2] = (src_stride[1] * nslice) / 2;
+ dst_width[2] = GST_VIDEO_INFO_WIDTH (vinfo) / 2;
+ dst_height[2] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2;
+ break;
+ case GST_VIDEO_FORMAT_NV12:
+ dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
+ src_stride[1] = nstride;
+ src_size[1] = src_stride[1] * nslice / 2;
+ dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo);
+ dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2;
+ break;
+ case GST_VIDEO_FORMAT_NV16:
+ dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo);
+ src_stride[1] = nstride;
+ src_size[1] = src_stride[1] * nslice;
+ dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo);
+ dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo);
+ break;
+ case GST_VIDEO_FORMAT_SN12:
+ case GST_VIDEO_FORMAT_ST12:{
+ GstMemory *mem_imgb = NULL;
+ void *imgb_data = NULL;
+#ifdef GST_TIZEN_MODIFICATION
+ MMVideoBuffer *mm_vbuffer = NULL;
+ mm_vbuffer = (MMVideoBuffer*)(inbuf->omx_buf->pBuffer);
+ mm_vbuffer->type = MM_VIDEO_BUFFER_TYPE_TBM_BO;
+
+ if (mm_vbuffer->type == MM_VIDEO_BUFFER_TYPE_TBM_BO) {
+ GST_LOG_OBJECT (self, "dec output buf: fd[0]:%d fd[1]:%d fd[2]:%d w[0]:%d h[0]:%d buf_share_method:%d",
+ mm_vbuffer->handle.dmabuf_fd[0], mm_vbuffer->handle.dmabuf_fd[1], mm_vbuffer->handle.dmabuf_fd[2],
+ mm_vbuffer->width[0], mm_vbuffer->height[0], mm_vbuffer->type);
+ } else if (mm_vbuffer->type == MM_VIDEO_BUFFER_TYPE_PHYSICAL_ADDRESS) {
+ GST_LOG_OBJECT (self, "dec output uses hw addr");
+ } else {
+ GST_WARNING_OBJECT (self, "dec output buf has TBM_BO buf_share_method");
+ }
+#ifdef CODEC_DEC_OUTPUT_DUMP
+ decoder_output_dump(self, mm_vbuffer);
+#endif
+#endif
+ if (gst_buffer_n_memory(outbuf) < 2) {
+ imgb_data = g_malloc0(sizeof(*mm_vbuffer));
+ mem_imgb = gst_memory_new_wrapped(0, imgb_data, sizeof(*mm_vbuffer), 0, sizeof(*mm_vbuffer), imgb_data, g_free);
+ gst_buffer_append_memory(outbuf, mem_imgb);
+ } else {
+ GstMapInfo imgb_info = GST_MAP_INFO_INIT;
+ mem_imgb = gst_buffer_peek_memory(outbuf, 1);
+ gst_memory_map(mem_imgb, &imgb_info, GST_MAP_WRITE);
+ imgb_data = imgb_info.data;
+ gst_memory_unmap(mem_imgb, &imgb_info);
+ }
+#ifdef GST_TIZEN_MODIFICATION
+ memcpy(imgb_data, mm_vbuffer, sizeof(MMVideoBuffer));
+#endif
+ ret = TRUE;
break;
+ }
+
default:
g_assert_not_reached ();
break;
src += src_size[p];
}
+#ifndef GST_TIZEN_MODIFICATION
gst_video_frame_unmap (&frame);
ret = TRUE;
} else {
GST_ERROR_OBJECT (self, "Can't map output buffer to frame");
goto done;
}
+#endif
done:
if (ret) {
if (caps)
self->out_port_pool =
gst_omx_buffer_pool_new (GST_ELEMENT_CAST (self), self->dec, port);
- }
#if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
if (eglimage) {
}
was_enabled = FALSE;
}
-#ifdef USE_TBM
- err = gst_omx_port_tbm_allocate_dec_buffers(self->hTBMBufMgr,port,
- self->dec_in_port->port_def.format.video.eCompressionFormat);
+#ifdef GST_TIZEN_MODIFICATION
+ err = gst_omx_port_tbm_allocate_dec_buffers(port, self->hTBMBufMgr,
+ self->dec_in_port->port_def.format.video.eCompressionFormat);
#else
err = gst_omx_port_allocate_buffers (port);
#endif
goto done;
}
}
-#ifdef USE_TBM
- err = gst_omx_port_tbm_allocate_dec_buffers(self->hTBMBufMgr,port,
+#ifdef GST_TIZEN_MODIFICATION
+ err = gst_omx_port_tbm_allocate_dec_buffers(port, self->hTBMBufMgr,
self->dec_in_port->port_def.format.video.eCompressionFormat);
#else
err = gst_omx_port_allocate_buffers (port);
#endif
/* Can't provide buffers downstream in this case */
- //gst_caps_replace (&caps, NULL);
+ gst_caps_replace (&caps, NULL);
}
if (err != OMX_ErrorNone) {
GST_OMX_BUFFER_POOL (self->out_port_pool)->current_buffer_index = i;
flow_ret =
gst_buffer_pool_acquire_buffer (self->out_port_pool,
- &outbuf, ¶ms);
+ &frame->output_buffer, ¶ms);
if (flow_ret != GST_FLOW_OK) {
flow_ret =
gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
goto invalid_buffer;
}
- if (GST_OMX_BUFFER_POOL (self->out_port_pool)->need_copy)
+ if (GST_OMX_BUFFER_POOL (self->out_port_pool)->need_copy){
outbuf =
copy_frame (&GST_OMX_BUFFER_POOL (self->out_port_pool)->video_info,
outbuf);
-
frame->output_buffer = outbuf;
flow_ret =
gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame);
frame = NULL;
buf = NULL;
+ } else {
+ if(!gst_omx_video_dec_fill_buffer (self, buf, frame->output_buffer)) {
+ gst_buffer_replace (&frame->output_buffer, NULL);
+ flow_ret =
+ gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
+ frame = NULL;
+ gst_omx_port_release_buffer (port, buf);
+ goto invalid_buffer;
+ }
+ flow_ret =
+ gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame);
+ frame = NULL;
+ buf = NULL;
+ }
} else {
if ((flow_ret =
gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER
GstVideoFormat format;
GstStructure *s;
const gchar *format_str;
+#ifdef GST_TIZEN_MODIFICATION
gchar *format_tmp;
int i;
-#ifdef USE_TBM
EnableGemBuffersParams gemBuffers;
#endif
gst_omx_error_to_string (err), err);
}
+ /* set plateform specific gem buffer settings. */
+
+ /* Set platform specific buffer settings. to avoid plane support error.. */
+#ifdef GST_TIZEN_MODIFICATION
+ OMX_INIT_STRUCTURE(gemBuffers);
+ gemBuffers.enable = OMX_TRUE;
+ gemBuffers.nPortIndex = 1;
+ err =
+ gst_omx_component_set_parameter (self->dec,
+ OMX_IndexParamEnablePlatformSpecificBuffers,&gemBuffers);
+ if (err != OMX_ErrorNone) {
+ GST_ERROR_OBJECT (self, "Failed to set video port format: %s (0x%08x)",
+ gst_omx_error_to_string (err), err);
+ }
+#endif
gst_caps_unref (intersection);
return (err == OMX_ErrorNone);
}
if (needs_disable) {
if (gst_omx_port_set_enabled (self->dec_in_port, TRUE) != OMX_ErrorNone)
return FALSE;
-#ifdef USE_TBM
- if(gst_omx_port_tbm_allocate_dec_buffers(self->hTBMBufMgr,self->dec_in_port, 0) != OMX_ErrorNone)
+#ifdef GST_TIZEN_MODIFICATION
+ if(gst_omx_port_tbm_allocate_dec_buffers(self->dec_in_port, self->hTBMBufMgr, 0) != OMX_ErrorNone)
return FALSE;
#else
if (gst_omx_port_allocate_buffers (self->dec_in_port) != OMX_ErrorNone)
return FALSE;
+#endif
if ((klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) {
if (gst_omx_port_set_enabled (self->dec_out_port, TRUE) != OMX_ErrorNone)
return FALSE;
/* Need to allocate buffers to reach Idle state */
+#ifdef GST_TIZEN_MODIFICATION
+ if(gst_omx_port_tbm_allocate_dec_buffers(self->dec_in_port, self->hTBMBufMgr, 0) != OMX_ErrorNone)
+ return FALSE;
+ if(gst_omx_port_tbm_allocate_dec_buffers(self->dec_out_port, self->hTBMBufMgr,
+ self->dec_in_port->port_def.format.video.eCompressionFormat) != OMX_ErrorNone)
+ return FALSE;
+#else
if (gst_omx_port_allocate_buffers (self->dec_in_port) != OMX_ErrorNone)
return FALSE;
+ if (gst_omx_port_allocate_buffers (self->dec_out_port) != OMX_ErrorNone)
+ return FALSE;
+#endif
} else {
+
if (gst_omx_component_set_state (self->dec,
OMX_StateIdle) != OMX_ErrorNone)
return FALSE;
/* Need to allocate buffers to reach Idle state */
+#ifdef GST_TIZEN_MODIFICATION
+ if(gst_omx_port_tbm_allocate_dec_buffers(self->dec_in_port, self->hTBMBufMgr, 0) != OMX_ErrorNone)
+ return FALSE;
+ if(gst_omx_port_tbm_allocate_dec_buffers(self->dec_out_port, self->hTBMBufMgr,
+ self->dec_in_port->port_def.format.video.eCompressionFormat) != OMX_ErrorNone)
+ return FALSE;
+#else
if (gst_omx_port_allocate_buffers (self->dec_in_port) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_allocate_buffers (self->dec_out_port) != OMX_ErrorNone)
return FALSE;
- }
+#endif
+ }
if (gst_omx_component_get_state (self->dec,
GST_CLOCK_TIME_NONE) != OMX_StateIdle)
return FALSE;
+
if (gst_omx_component_set_state (self->dec,
OMX_StateExecuting) != OMX_ErrorNone)
return FALSE;
- GST_ERROR_OBJECT (self, "\n9. GET COMPONENT STATE\n");
+
if (gst_omx_component_get_state (self->dec,
GST_CLOCK_TIME_NONE) != OMX_StateExecuting)
return FALSE;
GST_VIDEO_DECODER_STREAM_LOCK (self);
goto reconfigure_error;
}
-#ifdef USE_TBM
- err = gst_omx_port_tbm_allocate_dec_buffers(self->hTBMBufMgr,port,
+#ifdef GST_TIZEN_MODIFICATION
+ err = gst_omx_port_tbm_allocate_dec_buffers(port, self->hTBMBufMgr,
self->dec_in_port->port_def.format.video.eCompressionFormat);
#else
err = gst_omx_port_allocate_buffers (port);
buf->omx_buf->nFlags |= OMX_BUFFERFLAG_CODECCONFIG;
buf->omx_buf->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;
buf->omx_buf->nFilledLen = gst_buffer_get_size (codec_data);;
-#ifdef USE_TBM
-#ifdef USE_MM_VIDEO_BUFFER
- gst_buffer_extract (codec_data, 0,
- buf->scmn_buffer->data[0] + buf->omx_buf->nOffset,
- buf->omx_buf->nFilledLen);
-#else
+
+#ifdef GST_TIZEN_MODIFICATION
gst_buffer_extract (codec_data, 0,
- buf->scmn_buffer->a[0] + buf->omx_buf->nOffset,
+ buf->mm_vbuffer->data[0] + buf->omx_buf->nOffset,
buf->omx_buf->nFilledLen);
-#endif
#else
gst_buffer_extract (codec_data, 0,
buf->omx_buf->pBuffer + buf->omx_buf->nOffset,
buf->omx_buf->nFilledLen);
#endif
+
if (GST_CLOCK_TIME_IS_VALID (timestamp))
buf->omx_buf->nTimeStamp =
gst_util_uint64_scale (timestamp, OMX_TICKS_PER_SECOND, GST_SECOND);
MIN (size - offset, buf->omx_buf->nAllocLen - buf->omx_buf->nOffset);
GST_DEBUG_OBJECT (self, "nFilledLen %d, %p", buf->omx_buf->nFilledLen, buf->omx_buf->pBuffer);
-#ifdef USE_TBM
-#ifdef USE_MM_VIDEO_BUFFER
+#ifdef GST_TIZEN_MODIFICATION
gst_buffer_extract (frame->input_buffer, offset,
- buf->scmn_buffer->data[0] + buf->omx_buf->nOffset,
+ buf->mm_vbuffer->data[0] + buf->omx_buf->nOffset,
buf->omx_buf->nFilledLen);
#else
- gst_buffer_extract (frame->input_buffer, offset,
- buf->scmn_buffer->a[0] + buf->omx_buf->nOffset,
- buf->omx_buf->nFilledLen);
-#endif
-#else
gst_buffer_extract (frame->input_buffer, offset,
buf->omx_buf->pBuffer + buf->omx_buf->nOffset,
buf->omx_buf->nFilledLen);
gboolean draining;
GstFlowReturn downstream_flow_ret;
+#ifdef GST_TIZEN_MODIFICATION
+ gint drm_fd;
+ tbm_bufmgr hTBMBufMgr;
+#endif
#ifdef USE_OMX_TARGET_RPI
GstOMXComponent *egl_render;
GstOMXPort *egl_in_port, *egl_out_port;
g_mutex_init (&self->drain_lock);
g_cond_init (&self->drain_cond);
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
self->hTBMBufMgr = NULL;
self->drm_fd = -1;
#endif
}
}
}
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
self->hTBMBufMgr = tbm_bufmgr_init(self->drm_fd);
if(self->hTBMBufMgr == NULL){
GST_ERROR_OBJECT (self, "TBM initialization failed.");
err = gst_omx_port_set_enabled (port, TRUE);
if (err != OMX_ErrorNone)
goto reconfigure_error;
-#ifdef USE_TBM
- err = gst_omx_port_tbm_allocate_enc_buffers(self->hTBMBufMgr,port,
+#ifdef GST_TIZEN_MODIFICATION
+ err = gst_omx_port_tbm_allocate_enc_buffers(port, self->hTBMBufMgr,
self->enc_in_port->port_def.format.video.eCompressionFormat);
#else
err = gst_omx_port_allocate_buffers (port);
case OMX_EXT_COLOR_FormatNV12LPhysicalAddress: /* FALL THROUGH */
case OMX_EXT_COLOR_FormatNV12TPhysicalAddress:
-#ifdef USE_MM_VIDEO_BUFFER
+#ifdef GST_TIZEN_MODIFICATION
port_def.nBufferSize = sizeof(MMVideoBuffer);
-#else
- port_def.nBufferSize = sizeof(SCMN_IMGB);
#endif
break;
if (needs_disable) {
if (gst_omx_port_set_enabled (self->enc_in_port, TRUE) != OMX_ErrorNone)
return FALSE;
-#ifdef USE_TBM
- if(gst_omx_port_tbm_allocate_enc_buffers(self->hTBMBufMgr,self->enc_in_port,
+#ifdef GST_TIZEN_MODIFICATION
+ if(gst_omx_port_tbm_allocate_enc_buffers(self->enc_in_port, self->hTBMBufMgr,
self->enc_in_port->port_def.format.video.eCompressionFormat) != OMX_ErrorNone)
return FALSE;
#else
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
return FALSE;
-
+#endif
if ((klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) {
if (gst_omx_port_set_enabled (self->enc_out_port, TRUE) != OMX_ErrorNone)
return FALSE;
return FALSE;
/* Need to allocate buffers to reach Idle state */
+
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
return FALSE;
} else {
return FALSE;
/* Need to allocate buffers to reach Idle state */
+#ifdef GST_TIZEN_MODIFICATION
+ if(gst_omx_port_tbm_allocate_enc_buffers(self->enc_in_port, self->hTBMBufMgr,
+ self->enc_in_port->port_def.format.video.eCompressionFormat) != OMX_ErrorNone)
+ return FALSE;
+#else
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
return FALSE;
+#endif
+
+#ifdef GST_TIZEN_MODIFICATION
+ if(gst_omx_port_tbm_allocate_enc_buffers(self->enc_out_port, self->hTBMBufMgr,
+ self->enc_out_port->port_def.format.video.eCompressionFormat) != OMX_ErrorNone)
+#else
if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
+#endif
return FALSE;
}
case GST_VIDEO_FORMAT_SN12:{
GstMemory* ext_memory = gst_buffer_peek_memory(inbuf, 1);
GstMapInfo ext_info = GST_MAP_INFO_INIT;
-#ifdef USE_MM_VIDEO_BUFFER
MMVideoBuffer *ext_buf = NULL;
- if (!ext_memory) {
- GST_WARNING_OBJECT (self, "null MMVideoBuffer pointer in hw color format. skip this.");
- goto done;
+
+ if (!ext_memory) {
+ GST_WARNING_OBJECT (self, "null MMVideoBuffer pointer in hw color format. skip this.");
+ goto done;
}
gst_memory_map(ext_memory, &ext_info, GST_MAP_READ);
ext_buf = (MMVideoBuffer*)ext_info.data;
gst_memory_unmap(ext_memory, &ext_info);
- if (ext_buf != NULL && ext_buf->type == 1) {
+
+ if (ext_buf != NULL && ext_buf->type == MM_VIDEO_BUFFER_TYPE_TBM_BO) {
+
+ if (ext_buf->handle.dmabuf_fd[0] == NULL)
+ gst_omx_tbm_get_bo_fd(ext_buf->handle.bo[0]);
+
+ if (ext_buf->handle.dmabuf_fd[1] == NULL)
+ gst_omx_tbm_get_bo_fd(ext_buf->handle.bo[1]);
+
GST_LOG_OBJECT (self, "enc. fd[0]:%d fd[1]:%d fd[2]:%d w[0]:%d h[0]:%d buf_share_method:%d",
ext_buf->handle.dmabuf_fd[0], ext_buf->handle.dmabuf_fd[1], ext_buf->handle.dmabuf_fd[2], ext_buf->width[0], ext_buf->height[0], ext_buf->type);
- } else if (ext_buf != NULL && ext_buf->type == 0) {
- GST_LOG_OBJECT (self, "enc input buf uses hw addr");
} else {
- GST_WARNING_OBJECT (self, "enc input buf has wrong buf_share_method");
+ GST_WARNING_OBJECT (self, "enc input buf has wrong buf_share_method[%d]", ext_buf->type);
}
outbuf->omx_buf->nAllocLen = sizeof(MMVideoBuffer);
outbuf->omx_buf->nFilledLen = sizeof(MMVideoBuffer);
memcpy (outbuf->omx_buf->pBuffer, ext_buf, sizeof(MMVideoBuffer));
-#else
- SCMN_IMGB *ext_buf = NULL;
- if (!ext_memory) {
- GST_WARNING_OBJECT (self, "null SCMN_IMGB in hw color format. skip this.");
- goto done;
- }
-
- gst_memory_map(ext_memory, &ext_info, GST_MAP_READ);
- ext_buf = (SCMN_IMGB*)ext_info.data;
- gst_memory_unmap(ext_memory, &ext_info);
- if (ext_buf != NULL && ext_buf->buf_share_method == 1) {
- GST_LOG_OBJECT (self, "enc. fd[0]:%d fd[1]:%d fd[2]:%d w[0]:%d h[0]:%d buf_share_method:%d",
- ext_buf->fd[0], ext_buf->fd[1], ext_buf->fd[2], ext_buf->w[0], ext_buf->h[0], ext_buf->buf_share_method);
- } else if (ext_buf != NULL && ext_buf->buf_share_method == 0) {
- GST_LOG_OBJECT (self, "enc input buf uses hw addr");
- } else {
- GST_WARNING_OBJECT (self, "enc input buf has wrong buf_share_method");
- }
#ifdef CODEC_ENC_INPUT_DUMP
gst_omx_video_enc_input_dump(ext_buf);
#endif
- outbuf->omx_buf->nAllocLen = sizeof(SCMN_IMGB);
- outbuf->omx_buf->nFilledLen = sizeof(SCMN_IMGB);
- memcpy (outbuf->omx_buf->pBuffer, ext_buf, sizeof(SCMN_IMGB));
-#endif
+
ret = TRUE;
break;
}
GST_VIDEO_ENCODER_STREAM_LOCK (self);
goto reconfigure_error;
}
-#ifdef USE_TBM
- err = gst_omx_port_tbm_allocate_enc_buffers(self->hTBMBufMgr,port,
+#ifdef GST_TIZEN_MODIFICATION
+ err = gst_omx_port_tbm_allocate_enc_buffers(port, self->hTBMBufMgr,
self->enc_in_port->port_def.format.video.eCompressionFormat);
#else
err = gst_omx_port_allocate_buffers (port);
guint32 quant_b_frames;
GstFlowReturn downstream_flow_ret;
-#ifdef USE_TBM
+#ifdef GST_TIZEN_MODIFICATION
gint drm_fd;
tbm_bufmgr hTBMBufMgr;
#endif
Name: gst-omx
Summary: GStreamer plug-in that allows communication with OpenMAX IL components
-Version: 1.0.0
-Release: 6
+Version: 1.2.0
+Release: 0
License: LGPL-2.1+
Group: Multimedia/Framework
Source0: %{name}-%{version}.tar.gz
./autogen.sh --noconfigure
export CFLAGS+=" -DEXYNOS_SPECIFIC"
-export CFLAGS+=" -DUSE_TBM"
+export CFLAGS+=" -DGST_TIZEN_MODIFICATION"
%ifarch aarch64
%configure --disable-static --prefix=/usr --with-omx-target=exynos64