From: <fe...@ke...> - 2008-01-22 11:25:09
|
CVS Root: /cvs/gstreamer Module: gst-openmax Changes by: felipec Date: Tue Jan 22 2008 11:25:15 UTC Log message: Copy H.264 decoder changes to MPEG-4. Modified files: omx : gstomx_mpeg4dec.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_mpeg4dec.c.diff?r1=1.10&r2=1.11 ====Begin Diffs==== Index: gstomx_mpeg4dec.c =================================================================== RCS file: /cvs/gstreamer/gst-openmax/omx/gstomx_mpeg4dec.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gstomx_mpeg4dec.c 7 Dec 2007 12:57:11 -0000 1.10 +++ gstomx_mpeg4dec.c 22 Jan 2008 11:25:00 -0000 1.11 @@ -274,6 +274,7 @@ param->format.video.nFrameWidth = width; param->format.video.nFrameHeight = height; +#if 0 /* This is against the standard. nBufferSize is read-only. */ /** @todo Keep it for now as it's needed for TI. */ { @@ -294,6 +295,7 @@ break; } } +#endif OMX_SetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, param); } @@ -304,6 +306,62 @@ } static void +omx_setup (GstOmxBaseFilter *omx_base) +{ + GOmxCore *gomx; + + gomx = (GOmxCore *) omx_base->gomx; + GST_INFO_OBJECT (omx_base, "begin"); +#if 1 + { + OMX_PARAM_PORTDEFINITIONTYPE *param; + param = calloc (1, sizeof (OMX_PARAM_PORTDEFINITIONTYPE)); + param->nSize = sizeof (OMX_PARAM_PORTDEFINITIONTYPE); + param->nVersion.s.nVersionMajor = 1; + param->nVersion.s.nVersionMinor = 1; + param->nPortIndex = 1; + OMX_GetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, param); + param->format.video.eColorFormat = OMX_COLOR_FormatCbYCrY; + /* This is against the standard. nBufferSize is read-only. */ + /** @todo Keep it for now as it's needed for TI. */ + { + OMX_COLOR_FORMATTYPE color_format; + gint width, height; + color_format = param->format.video.eColorFormat; + width = param->format.video.nFrameWidth; + height = param->format.video.nFrameHeight; + switch (color_format) + { + case OMX_COLOR_FormatYCbYCr: + case OMX_COLOR_FormatCbYCrY: + param->nBufferSize = (width * height) * 2; + break; + case OMX_COLOR_FormatYUV420Planar: + param->nBufferSize = (width * height) * 1.5; + default: + } + } + OMX_SetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, param); + free (param); + } + GST_INFO_OBJECT (omx_base, "end"); +} +static void type_instance_init (GTypeInstance *instance, gpointer g_class) { @@ -312,6 +370,7 @@ omx_base = GST_OMX_BASE_FILTER (instance); omx_base->omx_component = g_strdup (OMX_COMPONENT_NAME); + omx_base->omx_setup = omx_setup; omx_base->gomx->settings_changed_cb = settings_changed_cb; |