mm_vbuffer[i]->size[0] = y_size;
mm_vbuffer[i]->width[0] = port->port_def.format.video.nFrameWidth;
mm_vbuffer[i]->height[0] = port->port_def.format.video.nFrameHeight;
- mm_vbuffer[i]->stride_width[0] = port->port_def.format.video.nStride;
- mm_vbuffer[i]->stride_height[0] = port->port_def.format.video.nSliceHeight;
+ mm_vbuffer[i]->stride_width[0] = ALIGN (port->port_def.format.video.nFrameWidth, 16);
+ mm_vbuffer[i]->stride_height[0] = ALIGN (port->port_def.format.video.nSliceHeight, 16);
uv_size = gst_omx_calculate_uv_size (eCompressionFormat,
port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight >> 1);
mm_vbuffer[i]->size[1] = uv_size;
mm_vbuffer[i]->width[1] = port->port_def.format.video.nFrameWidth;
mm_vbuffer[i]->height[1] = port->port_def.format.video.nFrameHeight>>1;
- mm_vbuffer[i]->stride_width[1] = port->port_def.format.video.nStride;
- mm_vbuffer[i]->stride_height[1] = port->port_def.format.video.nSliceHeight>>1;
+ mm_vbuffer[i]->stride_width[1] = ALIGN (port->port_def.format.video.nFrameWidth, 16);
+ mm_vbuffer[i]->stride_height[1] = ALIGN (port->port_def.format.video.nSliceHeight>>1, 16);
mm_vbuffer[i]->plane_num = 2;
mm_vbuffer[i]->type = MM_VIDEO_BUFFER_TYPE_TBM_BO;
}
GST_ERROR_OBJECT (self, "codec dec output dump start. w = %d, h = %d", outbuf->width[0], outbuf->height[0]);
- sprintf(filename, "/tmp/dec_output_dump_%d_%d.yuv", outbuf->stride_width[0], outbuf->height[0]);
+ sprintf(filename, "/tmp/dec_output_dump_%d_%d.yuv", outbuf->width[0], outbuf->height[0]);
fp = fopen(filename, "ab");
for (i = 0; i < outbuf->height[0]; i++) {
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 TIZEN_FEATURE_OMX
+ case GST_VIDEO_FORMAT_SN12:
+ case GST_VIDEO_FORMAT_ST12: {
+ GstMemory *mem = NULL;
+ void *data = NULL;
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: bo[0] :%p, bo[1] : %p, fd[0]:%d fd[1]:%d fd[2]:%d w[0]:%d h[0]:%d buf_share_method:%d",
#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);
+ if (gst_buffer_n_memory (outbuf) < 2) {
+ data = g_malloc0 (sizeof (MMVideoBuffer));
+ mem = gst_memory_new_wrapped(0, data, sizeof (MMVideoBuffer), 0, sizeof (MMVideoBuffer), data, g_free);
+ gst_buffer_append_memory (outbuf, mem);
} 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);
+ GstMapInfo info = GST_MAP_INFO_INIT;
+
+ mem = gst_buffer_peek_memory (outbuf, 1);
+ gst_memory_map (mem, &info, GST_MAP_WRITE);
+ data = info.data;
+ gst_memory_unmap (mem, &info);
}
-#ifdef TIZEN_FEATURE_OMX
- memcpy(imgb_data, mm_vbuffer, sizeof(MMVideoBuffer));
-#endif
- ret = TRUE;
- break;
+ memcpy (data, mm_vbuffer, sizeof (MMVideoBuffer));
+
+ ret = TRUE;
+ break;
}
+#endif
default:
g_assert_not_reached ();
copy_frame (&GST_OMX_BUFFER_POOL (self->out_port_pool)->video_info,
outbuf);
- buf = NULL;
} else {
outbuf =
gst_video_decoder_allocate_output_buffer (GST_VIDEO_DECODER (self));
goto invalid_buffer;
}
}
-
+#ifdef TIZEN_FEATURE_OMX
+ MMVideoBuffer *mm_vbuffer = NULL;
+ GstMemory *mem = NULL;
+ guint8 *data = NULL;
+ mm_vbuffer = (MMVideoBuffer*)(buf->omx_buf->pBuffer);
+
+ if (gst_buffer_n_memory (outbuf) < 2) {
+ data = g_malloc0 (sizeof (MMVideoBuffer));
+ mem = gst_memory_new_wrapped (0, data, sizeof(MMVideoBuffer), 0, sizeof(MMVideoBuffer), data, g_free);
+ gst_buffer_append_memory (outbuf, mem);
+ } else {
+ GstMapInfo info = GST_MAP_INFO_INIT;
+ mem = gst_buffer_peek_memory (outbuf, 1);
+ gst_memory_map (mem, &info, GST_MAP_WRITE);
+ data = info.data;
+ gst_memory_unmap (mem, &info);
+ }
+ memcpy(data, mm_vbuffer, sizeof(MMVideoBuffer));
+ buf = NULL;
+
+ if (mm_vbuffer->type == MM_VIDEO_BUFFER_TYPE_TBM_BO) {
+ GST_LOG_OBJECT (self, "frame not found: bo[0] :%p, bo[1] : %p, fd[0]:%d fd[1]:%d fd[2]:%d w[0]:%d h[0]:%d buf_share_method:%d",
+ mm_vbuffer->handle.bo[0], mm_vbuffer->handle.bo[1], 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");
+ }
+#endif
flow_ret = gst_pad_push (GST_VIDEO_DECODER_SRC_PAD (self), outbuf);
} else if (buf->omx_buf->nFilledLen > 0 || buf->eglimage) {
if (self->out_port_pool) {
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;
- }
+ if (!gst_omx_video_dec_fill_buffer (self, buf, frame->output_buffer)) {
+ gst_buffer_replace (&frame->output_buffer, NULL);
+
flow_ret =
- gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame);
+ gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
frame = NULL;
- buf = 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 =