<div>On Sat, Nov 15, 2008 at 8:32 PM, jayasena s &lt;jaisena@ya...&gt; wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I am able to play m4v and .h264 files with gst-openmax and bellagio openmax<br>&gt; IL, but having problem playing h264 mp4 file. I found that gst-openmax<br>
&gt; passes demuxed raw video and audio frame streams to the bellagio openmax IL,<br>&gt; but not the header data required for decoding. Also I found that config data<br>&gt; is passed to the gst-openmax from qtdemux, but gst-openmax somehow is not<br>
&gt; passing the header data to the bellagio openmax IL. I would like to know<br>&gt; why header data is not passed to the bellagio openmax IL. Whether<br>&gt; gst-openmax is going to fix this problem in future release.</div>

<div>&nbsp;</div>
<div>Hi Jayasena,</div>
<div>&nbsp;</div>
<div>We are using gst-openmax <a href="http://0.10.0.4">0.10.0.4</a> and libomxil-bellagio <a href="http://0.3.4.">0.3.4.</a> We have also faced this issue with .mp4 files and modified the &quot;sink_setcaps&quot; function&nbsp;in gstomx_base_videodec.c file to&nbsp;update extradata in omx library.</div>

<div>&nbsp;</div>
<div>Check the following function&nbsp;it&nbsp;may help you. If you want to integrate this code then you should accordingly&nbsp;update the&nbsp;enum and structure in gstomx header file.</div>
<div>&nbsp;</div>
<div>static gboolean<br>sink_setcaps (GstPad *pad,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstCaps *caps)<br>{<br>&nbsp;&nbsp;&nbsp; GstStructure *structure;<br>&nbsp;&nbsp;&nbsp; GstOmxBaseVideoDec *self;<br>&nbsp;&nbsp;&nbsp; GstOmxBaseFilter *omx_base;<br>&nbsp;&nbsp;&nbsp; GOmxCore *gomx;<br>&nbsp;&nbsp;&nbsp; OMX_PARAM_PORTDEFINITIONTYPE *param;<br>
&nbsp;&nbsp;&nbsp; gint width = 0;<br>&nbsp;&nbsp;&nbsp; gint height = 0;</div>
<div>&nbsp;&nbsp;&nbsp; self = GST_OMX_BASE_VIDEODEC (GST_PAD_PARENT (pad));<br>&nbsp;&nbsp;&nbsp; omx_base = GST_OMX_BASE_FILTER (self);</div>
<div>&nbsp;&nbsp;&nbsp; gomx = (GOmxCore *) omx_base-&gt;gomx;</div>
<div>&nbsp;&nbsp;&nbsp; GST_INFO_OBJECT (self, &quot;setcaps (sink): %&quot; GST_PTR_FORMAT, caps);</div>
<div>&nbsp;&nbsp;&nbsp; g_return_val_if_fail (gst_caps_get_size (caps) == 1, FALSE);</div>
<div>&nbsp;&nbsp;&nbsp; structure = gst_caps_get_structure (caps, 0);</div>
<div>&nbsp;&nbsp;&nbsp; gst_structure_get_int (structure, &quot;width&quot;, &amp;width);<br>&nbsp;&nbsp;&nbsp; gst_structure_get_int (structure, &quot;height&quot;, &amp;height);</div>
<div>&nbsp;&nbsp;&nbsp; param = calloc (1, sizeof (OMX_PARAM_PORTDEFINITIONTYPE));<br>&nbsp;&nbsp;&nbsp; param-&gt;nSize = sizeof (OMX_PARAM_PORTDEFINITIONTYPE);<br>&nbsp;&nbsp;&nbsp; param-&gt;nVersion.s.nVersionMajor = 1;<br>&nbsp;&nbsp;&nbsp; param-&gt;nVersion.s.nVersionMinor = 1;</div>

<div>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const GValue *codec_data;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstBuffer *buffer;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; codec_data = gst_structure_get_value (structure, &quot;codec_data&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (codec_data) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gint size,err;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OMX_INDEXTYPE eIndexExtraData;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer = gst_value_get_buffer (codec_data);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer = GST_BUFFER_CAST (gst_value_get_mini_object (codec_data));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size = GST_BUFFER_SIZE (buffer);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;In %s extradata_size=%d (line=%d)\n&quot;,__func__,size,__LINE__);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err = OMX_GetExtensionIndex(gomx-&gt;omx_handle,&quot;OMX.ST.index.config.videoextradata&quot;,&amp;eIndexExtraData);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(err != OMX_ErrorNone) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;Error in get video extension index\n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OMX_VENDOR_EXTRADATATYPE sExtraData;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sExtraData.nPortIndex = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sExtraData.pData&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = malloc(size);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sExtraData.nDataSize&nbsp; = size;</div>

<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memcpy(sExtraData.pData,GST_BUFFER_DATA (buffer),size);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;Setting ExtraData\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err = OMX_SetConfig(gomx-&gt;omx_handle, eIndexExtraData, &amp;sExtraData);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(err != OMX_ErrorNone) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;\n Video decoder Set Config Failed error=%08x\n&quot;,err);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; free(sExtraData.pData);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fflush(stdout);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; omx_base-&gt;codec_data = buffer;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_buffer_ref (buffer);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;&nbsp;&nbsp; /* Input port configuration. */<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; param-&gt;nPortIndex = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OMX_GetParameter (gomx-&gt;omx_handle, OMX_IndexParamPortDefinition, param);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; param-&gt;format.video.nFrameWidth = width;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; param-&gt;format.video.nFrameHeight = height;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OMX_SetParameter (gomx-&gt;omx_handle, OMX_IndexParamPortDefinition, param);<br>&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;&nbsp;&nbsp; free (param);</div>
<div>&nbsp;&nbsp;&nbsp; return gst_pad_set_caps (pad, caps);<br>}</div>