<div dir="ltr"><div>Deepak,</div><div> </div><div>Why do you need to call Pause/Resume on ports? In my understanding, the out_loop is a separate thread. Just disable, reconfigure, enable ports and port reconfiguration should work.</div>
<div> </div><div>I have tried this before.</div><div> </div><div>Thanks</div><div>Deepesh</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 9:15 AM, Deepak Thumathajira <span dir="ltr"><<a href="mailto:deepak.thumathajira@gmail.com" target="_blank">deepak.thumathajira@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div>
<div> I think the reason for the hang is because of g_sem_down (core->port_sem) for the output port.</div>
<div>On OMX_EventPortSettingsChanged the OpenMax component calls the EventHandler() -> settings_changed_cb()-> g_omx_port_disable() -> g_sem_down (core->port_sem).</div>
<div> </div>
<div>In g_omx_port_disable(), OMX_CommandPortDisable command is issued. </div>
<div>Hence, OMX_SendCommand() -> omx_videodec_component_MessageHandler() -> omx_base_component_MessageHandler() -> base_port_FlushProcessingBuffers().</div>
<div>In base_port_FlushProcessingBuffers(), the core is waiting at tsem_down(omx_base_component_Private->flush_all_condition).</div>
<div> </div>
<div>As the component is waiting at g_sem_down (core->port_sem), it can't return to omx_base_filter_BufferMgmtFunction(). </div>
<div>As a result, the tsem_up(omx_base_filter_Private->flush_all_condition) in omx_base_filter_BufferMgmtFunction(), line 138 cannot be done.</div>
<div> </div>
<div>Hence, the gstreamer pipeline is hanging. Please let me know if my understanding is correct.</div>
<div> </div>
<div>To achieve the dynmaic resolution change, I did the following</div>
<div>> In settings_changed_cb(),</div>
<div> - OMX_SendCommand(OMX_CommandPortDisable) for Output_Port</div>
<div> - g_omx_port_pause(Output_Port)</div>
<div> - g_omx_port_flush(Output_Port)</div>
<div> - port_free_buffers(Output_Port), Note: I did not call the g_sem_down (core->port_sem)</div>
<div>> In EventHandler(), for OMX_CommandPortDisable</div>
<div> - Update the output port setting in IL client with the new buffersize and number of buffers.</div>
<div> - OMX_SendCommand( OMX_CommandPortEnable )</div>
<div> - port_allocate_buffers() for output port.</div>
<div> </div>
<div>> In EventHandler(), for OMX_CommandPortEnable</div>
<div> - port_start_buffers() for output ports</div>
<div> - g_omx_port_resume() </div>
<div> </div>
<div> This change makes the dynamic resolution change work sometimes. But sometimes, the omx_buffers</div>
<div>corresponding to the old resolution is coming in output_loop() -> g_omx_port_request_buffer(). </div>
<div>Due to this the gst-open crashs. Please let me know how to resolve this issue.</div>
<div> </div>
<div>Any Input / Suggestion is welcome.</div>
<div> </div>
<div>Thanking you,</div>
<div>Deepak</div><div class="HOEnZb"><div class="h5">
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><br> </div>
<div class="gmail_quote">On 1 February 2013 20:26, Deepak Thumathajira <span dir="ltr"><<a href="mailto:deepak.thumathajira@gmail.com" target="_blank">deepak.thumathajira@gmail.com</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<div>Hi All,</div>
<div> This is regarding dynamic resolution change while decoding a stream. For Example CIF to D1.</div>
<div>I am using the following:</div>
<div>IL client : gst-openmax.10.1 </div>
<div>Openmax Core : libomxil-bellagio-0.9.3</div>
<div>Video decoder component : libomxffmpegdist-0.1</div>
<div>In my setup, the IL client is allocating the openmax buffers(i.e port->omx_allocate = false) and this is my requirement.</div>
<div> </div>
<div> </div>
<div>Dynamic resolution change is currrently not working. Hence, I tried the following:</div>
<div>Step 1 : In Video Decoder component, returning the Output buffer. Changing the inPort and outPort settings.</div>
<div> Changed the WxH in both the ports and the outPort's buffer size. </div>
<div>Step 2: Send the "OMX_EventPortSettingsChanged" using the event handler callback.</div>
<div>Step 3: As a result, the IL client(gst-openmax) settings_changed_cb() is called. In this function,</div>
<div> I am doing the following, before gst_pad_set_caps (omx_base->srcpad, new_caps) :</div>
<div> {</div>
<div> port = get_port (core, 1);</div>
<div> GST_INFO_OBJECT (omx_base, "Calling g_omx_port_disable(port) in %s\n",__func__);<br> g_omx_port_disable(port);<br> GST_INFO_OBJECT (omx_base, "g_omx_port_disable(port) completed in %s\n",__func__);</div>
<div> port->buffer_size = 352*288*1.5;</div>
<div> GST_INFO_OBJECT (omx_base, "Calling g_omx_port_enable(port) in %s\n",__func__);<br> g_omx_port_enable(port);<br> GST_INFO_OBJECT (omx_base, "g_omx_port_enable(port) completed in %s\n",__func__);</div>
<div> }</div>
<div> </div>
<div>The result of this change is, after g_omx_port_disable(port), gstreamer is hanging. The ending logs is as shown below:</div>
<div> </div>
<div>0:00:00.163039163 [331m24012 [00m 0xb3d73400 [36mDEBUG [00m [00m omx gstomx_util.c:848:EventHandler:<omxh264dec0> [00m OMX_EventPortSettingsChanged<br>0:00:00.163082596 [331m24012 [00m 0xb3d73400 [36mDEBUG [00m [00m omx gstomx_base_videodec.c:119:settings_changed_cb:<omxh264dec0> [00m settings changed<br>
0:00:00.163098457 [331m24012 [00m 0xb3d73400 [32;01mINFO [00m [00m omx gstomx_base_videodec.c:153:settings_changed_cb:<omxh264dec0> [00m Calling g_omx_port_disable(port) in settings_changed_cb<br>
0:00:00.163165246 [331m24012 [00m 0x949c8c0 [37mLOG [00m [00m omx gstomx_base_filter.c:347:output_loop:<omxh264dec0> [00m omx_buffer: (nil)<br>0:00:00.163267648 [331m24012 [00m 0x949c8c0 [33;01mWARN [00m [00m omx gstomx_base_filter.c:350:output_loop:<omxh264dec0> [00m null buffer: leaving<br>
0:00:00.163283411 [331m24012 [00m 0x949c8c0 [32;01mINFO [00m [00m omx gstomx_base_filter.c:504:output_loop:<omxh264dec0> [00m pause task, reason: wrong-state<br>0:00:00.163299207 [331m24012 [00m 0x949c8c0 [37mLOG [00m [00m omx gstomx_base_filter.c:508:output_loop:<omxh264dec0> [00m end<br>
</div>
<div> </div>
<div>Please let me know, how to get the dynamic resolution change work. Let me know if you need additional details.</div>
<div> </div>
<div>Thanking you,</div>
<div>Deepak T Y</div>
<div> </div>
<div> </div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
gstreamer-openmax mailing list<br>
<a href="mailto:gstreamer-openmax@lists.freedesktop.org">gstreamer-openmax@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-openmax" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-openmax</a><br>
<br></blockquote></div><br></div>