<div>On Sat, Nov 15, 2008 at 8:32 PM, jayasena s <jaisena@ya...> wrote:<br>> Hi,<br>><br>> I am able to play m4v and .h264 files with gst-openmax and bellagio openmax<br>> IL, but having problem playing h264 mp4 file. I found that gst-openmax<br>
> passes demuxed raw video and audio frame streams to the bellagio openmax IL,<br>> but not the header data required for decoding. Also I found that config data<br>> is passed to the gst-openmax from qtdemux, but gst-openmax somehow is not<br>
> passing the header data to the bellagio openmax IL. I would like to know<br>> why header data is not passed to the bellagio openmax IL. Whether<br>> gst-openmax is going to fix this problem in future release.</div>
<div> </div>
<div>Hi Jayasena,</div>
<div> </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 "sink_setcaps" function in gstomx_base_videodec.c file to update extradata in omx library.</div>
<div> </div>
<div>Check the following function it may help you. If you want to integrate this code then you should accordingly update the enum and structure in gstomx header file.</div>
<div> </div>
<div>static gboolean<br>sink_setcaps (GstPad *pad,<br> GstCaps *caps)<br>{<br> GstStructure *structure;<br> GstOmxBaseVideoDec *self;<br> GstOmxBaseFilter *omx_base;<br> GOmxCore *gomx;<br> OMX_PARAM_PORTDEFINITIONTYPE *param;<br>
gint width = 0;<br> gint height = 0;</div>
<div> self = GST_OMX_BASE_VIDEODEC (GST_PAD_PARENT (pad));<br> omx_base = GST_OMX_BASE_FILTER (self);</div>
<div> gomx = (GOmxCore *) omx_base->gomx;</div>
<div> GST_INFO_OBJECT (self, "setcaps (sink): %" GST_PTR_FORMAT, caps);</div>
<div> g_return_val_if_fail (gst_caps_get_size (caps) == 1, FALSE);</div>
<div> structure = gst_caps_get_structure (caps, 0);</div>
<div> gst_structure_get_int (structure, "width", &width);<br> gst_structure_get_int (structure, "height", &height);</div>
<div> param = calloc (1, sizeof (OMX_PARAM_PORTDEFINITIONTYPE));<br> param->nSize = sizeof (OMX_PARAM_PORTDEFINITIONTYPE);<br> param->nVersion.s.nVersionMajor = 1;<br> param->nVersion.s.nVersionMinor = 1;</div>
<div> {<br> const GValue *codec_data;<br> GstBuffer *buffer;</div>
<div> codec_data = gst_structure_get_value (structure, "codec_data");<br> if (codec_data) {<br> gint size,err;<br> OMX_INDEXTYPE eIndexExtraData;</div>
<div> buffer = gst_value_get_buffer (codec_data);</div>
<div> buffer = GST_BUFFER_CAST (gst_value_get_mini_object (codec_data));<br> size = GST_BUFFER_SIZE (buffer);</div>
<div> printf("In %s extradata_size=%d (line=%d)\n",__func__,size,__LINE__);</div>
<div> err = OMX_GetExtensionIndex(gomx->omx_handle,"OMX.ST.index.config.videoextradata",&eIndexExtraData);<br> if(err != OMX_ErrorNone) {<br> printf("Error in get video extension index\n");<br>
} else {<br> OMX_VENDOR_EXTRADATATYPE sExtraData;<br> sExtraData.nPortIndex = 0;<br> sExtraData.pData = malloc(size);<br> sExtraData.nDataSize = size;</div>
<div> memcpy(sExtraData.pData,GST_BUFFER_DATA (buffer),size);<br> printf("Setting ExtraData\n");<br> err = OMX_SetConfig(gomx->omx_handle, eIndexExtraData, &sExtraData);<br>
if(err != OMX_ErrorNone) {<br> printf("\n Video decoder Set Config Failed error=%08x\n",err);<br> }<br> free(sExtraData.pData);<br> }</div>
<div> fflush(stdout);</div>
<div> omx_base->codec_data = buffer;<br> gst_buffer_ref (buffer);<br> }<br> }</div>
<div> /* Input port configuration. */<br> {<br> param->nPortIndex = 0;<br> OMX_GetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, param);</div>
<div> param->format.video.nFrameWidth = width;<br> param->format.video.nFrameHeight = height;</div>
<div> OMX_SetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, param);<br> }</div>
<div> free (param);</div>
<div> return gst_pad_set_caps (pad, caps);<br>}</div>