[Gstreamer-openmax] Repeat Mode of Totem Player

Mickey Kim jihun.kim at samsung.com
Sun Aug 15 21:02:10 PDT 2010


I'm using Totem Player on Ubuntu.
When I check repeat mode option in totem, player stops after only two time repeatation.
 
I could find that totem doesn't change the state, when it meet the end of stream.
But I also could find gst-openmax code doesn't consider this case.
When gst-openmax meet EOS, it throw output buffer of queue (in output_loop()).
So there is one buffer loss during one time repeatation.


To resolve this issue, I have modified two function as below.
 
output_loop ()
{
...
        if (G_UNLIKELY (omx_buffer->nFlags & OMX_BUFFERFLAG_EOS))
        {
            GST_DEBUG_OBJECT (self, "got eos");
            gst_pad_push_event (self->srcpad, gst_event_new_eos ());
            ret = GST_FLOW_UNEXPECTED;
            // by Mickey
            // for repeat mode of totem player
            // In original code,
            // When gst-omx detect EOS buffer, this buffer are popped from queue and not pushed to queue.
            // This lead to empty queue in repeat mode.
#if 1
            g_omx_port_push_buffer (out_port, omx_buffer);
#endif
            goto leave;
        }
...
}
 
g_omx_port_flush()
{
    if (port->type == GOMX_PORT_OUTPUT)
    {
        OMX_BUFFERHEADERTYPE *omx_buffer;
        while ((omx_buffer = async_queue_pop_forced (port->queue)))
        {
            // by Mickey
            // for repeat mode of totem player
            // When gst-omx detect EOS, output_loop push buffer with EOS (to queue).
            // Then, g_omx_port_flush() push this buffer with no EOS flag (to queue).
#if 1
            if(omx_buffer->nFlags & OMX_BUFFERFLAG_EOS)
            {
                omx_buffer->nFlags = 0;
                g_omx_port_push_buffer (port, omx_buffer);
                break;
            }
            else
            {
                omx_buffer->nFilledLen = 0;
                g_omx_port_release_buffer (port, omx_buffer);
            }
#else
            omx_buffer->nFilledLen = 0;
            g_omx_port_release_buffer (port, omx_buffer);
#endif
        }
    }
....
}
 
 
Please give your opinion.
 
Regards,
Mickey

 







More information about the Gstreamer-openmax mailing list