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;
OMX_CONFIG_RECTTYPE rect;
tbm_surface_h surface;
tbm_surface_info_s info;
+ int ret;
g_return_val_if_fail (port != NULL, OMX_ErrorUndefined);
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);
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;
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
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;
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.");
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);