HowTo :: Dynamic resolution change while decoding

Deepesh Bhargava deepesh.gstreamer at gmail.com
Mon Jun 17 11:43:43 PDT 2013


Deepak,

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.

I have tried this before.

Thanks
Deepesh


On Mon, Feb 11, 2013 at 9:15 AM, Deepak Thumathajira <
deepak.thumathajira at gmail.com> wrote:

> Hi,
>      I think the reason for the hang is because of g_sem_down
> (core->port_sem) for the output port.
> On OMX_EventPortSettingsChanged the OpenMax component calls the
> EventHandler() -> settings_changed_cb()-> g_omx_port_disable() ->
> g_sem_down (core->port_sem).
>
> In g_omx_port_disable(), OMX_CommandPortDisable command is issued.
> Hence, OMX_SendCommand() -> omx_videodec_component_MessageHandler() ->
> omx_base_component_MessageHandler() -> base_port_FlushProcessingBuffers().
> In base_port_FlushProcessingBuffers(), the core is waiting at
> tsem_down(omx_base_component_Private->flush_all_condition).
>
> As the component is waiting at g_sem_down (core->port_sem), it can't
> return to omx_base_filter_BufferMgmtFunction().
> As a result, the  tsem_up(omx_base_filter_Private->flush_all_condition)
> in omx_base_filter_BufferMgmtFunction(), line 138 cannot be done.
>
> Hence, the gstreamer pipeline is hanging. Please let me know if my
> understanding is correct.
>
> To achieve the dynmaic resolution change, I did the following
> > In settings_changed_cb(),
>           - OMX_SendCommand(OMX_CommandPortDisable) for Output_Port
>           - g_omx_port_pause(Output_Port)
>           - g_omx_port_flush(Output_Port)
>           -  port_free_buffers(Output_Port),  Note: I did not call the
> g_sem_down (core->port_sem)
> > In EventHandler(), for OMX_CommandPortDisable
>           - Update the output port setting in IL client with the
> new buffersize and number of buffers.
>           -  OMX_SendCommand( OMX_CommandPortEnable )
>           - port_allocate_buffers() for output port.
>
> >  In EventHandler(), for OMX_CommandPortEnable
>          - port_start_buffers() for output ports
>          - g_omx_port_resume()
>
>  This change makes the dynamic resolution change work sometimes. But
> sometimes, the omx_buffers
> corresponding to the old resolution is coming in output_loop() ->
> g_omx_port_request_buffer().
> Due to this the gst-open crashs.   Please let me know how to resolve this
> issue.
>
> Any Input / Suggestion is welcome.
>
> Thanking you,
> Deepak
>
>
>
>
>
>
>
>
> On 1 February 2013 20:26, Deepak Thumathajira <
> deepak.thumathajira at gmail.com> wrote:
>
>> Hi All,
>>           This is regarding dynamic resolution change while decoding a
>> stream. For Example CIF to D1.
>> I am using the following:
>> IL client                : gst-openmax.10.1
>> Openmax Core   : libomxil-bellagio-0.9.3
>> Video decoder component : libomxffmpegdist-0.1
>> In my setup, the IL client is allocating the openmax buffers(i.e
>> port->omx_allocate = false) and this is my requirement.
>>
>>
>> Dynamic resolution change is currrently not working.  Hence, I tried the
>> following:
>> Step 1 : In Video Decoder component, returning the Output buffer.
>> Changing the inPort and outPort settings.
>>                Changed the WxH in both the ports and the outPort's buffer
>> size.
>> Step 2:  Send the "OMX_EventPortSettingsChanged" using the event handler
>> callback.
>> Step 3:  As a result, the IL client(gst-openmax)  settings_changed_cb()
>> is called. In this function,
>>               I am doing the following, before gst_pad_set_caps
>> (omx_base->srcpad, new_caps) :
>>           {
>>              port = get_port (core, 1);
>>              GST_INFO_OBJECT (omx_base, "Calling
>> g_omx_port_disable(port) in %s\n",__func__);
>>              g_omx_port_disable(port);
>>              GST_INFO_OBJECT (omx_base, "g_omx_port_disable(port)
>> completed in %s\n",__func__);
>>              port->buffer_size = 352*288*1.5;
>>              GST_INFO_OBJECT (omx_base, "Calling  g_omx_port_enable(port)
>> in %s\n",__func__);
>>              g_omx_port_enable(port);
>>              GST_INFO_OBJECT (omx_base, "g_omx_port_enable(port)
>> completed in %s\n",__func__);
>>          }
>>
>> The result of this change is, after  g_omx_port_disable(port),  gstreamer
>> is hanging.  The ending logs is as shown below:
>>
>> 0:00:00.163039163 [331m24012 [00m 0xb3d73400 [36mDEBUG  [00m
>> [00m                 omx gstomx_util.c:848:EventHandler:<omxh264dec0> [00m
>> OMX_EventPortSettingsChanged
>> 0:00:00.163082596 [331m24012 [00m 0xb3d73400 [36mDEBUG  [00m
>> [00m                 omx
>> gstomx_base_videodec.c:119:settings_changed_cb:<omxh264dec0> [00m settings
>> changed
>> 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
>> 0:00:00.163165246 [331m24012 [00m  0x949c8c0 [37mLOG    [00m
>> [00m                 omx gstomx_base_filter.c:347:output_loop:<omxh264dec0>
>> [00m omx_buffer: (nil)
>> 0:00:00.163267648 [331m24012 [00m  0x949c8c0 [33;01mWARN   [00m
>> [00m                 omx gstomx_base_filter.c:350:output_loop:<omxh264dec0>
>> [00m null buffer: leaving
>> 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
>> 0:00:00.163299207 [331m24012 [00m  0x949c8c0 [37mLOG    [00m
>> [00m                 omx gstomx_base_filter.c:508:output_loop:<omxh264dec0>
>> [00m end
>>
>> Please let me know, how to get the dynamic resolution change work. Let me
>> know if you need additional details.
>>
>> Thanking you,
>> Deepak T Y
>>
>>
>>
>
>
> _______________________________________________
> gstreamer-openmax mailing list
> gstreamer-openmax at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-openmax
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-openmax/attachments/20130617/ce352c60/attachment.html>


More information about the gstreamer-openmax mailing list