This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

omx_h264enc blocked in the request_buffer

Hi,all!

      I  work on the ics 4.0.3  and omap4 .I  use the gstreamer and gst-openmax to encode the h264 file. the command is "gst-launch -v filesrc location=/mnt/ext_sdcard/nv12.yuv ! videoparse width=1280 height=720 ! omx_h264enc ! avimux ! filesink location=/mnt/sdcard/test10.avi  sync=false --gst-debug=omx:5".

1)    Now  the encoder will be blocked when the request_buffer  function (in gstomx_port.c) be called. I  find that  the port queue length = 0.so Is the number of buffer  which from the filesrc put into the omx_h264enc  is zero case the blocked or the omx_h264enc  encoder  get the buffer but can not return them to queue case the state?

static OMX_BUFFERHEADERTYPE *
request_buffer (GOmxPort *port)
{
    ERROR (port, "===>  queue len=%d", port->queue->length);
    return async_queue_pop (port->queue);
}

external/gst-openmax/omx/gstomx_base_filter.c:627:pad_chain:<omxh264enc0>[00m begin: size=4423680, state=3, CoreState=0
0:00:08.218475342 [333m 1454[00m   0x1f84c8 [36mDEBUG  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:1243:g_omx_port_send:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(1243)-g_omx_port_send BUFFERMMMM check it
0:00:08.218536377 [333m 1454[00m   0x1f84c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:663:request_buffer:[00m <omxh264enc0:in:0> ===>  queue len=0

2)  I  find  the async_queue_push/async_queue_pop   function .  Are they  the function  to push buffer into queue  and pop  buffer from queue? so the request_buffer was called by g_omx_port_send  and call  async_queue_pop get the buffer from  the queue of port.I  think the g_omx_port _send  which call by the openmax sinkpad  and will  send the buffer to  openmax compent  and  the g_omx_port_recv  gets  the bufer  from openmax .Is it right?

Thank you very much.

BR.

Aaron

 

  • Hi Aaron,

    Could you let me know which TI software release are you using for this?

    Regards, Satheesh

  • Hi  Satheesh

         I  use  the  gst-openmax  download  from  the ti  and  the openmax IL  on the ics hardware. I  find  the in port  buffer number is 4  and the queue length  from  4  to 0, then  blocked. The pad_chain(gstomx_base_filter.c  )   function  stop after some time  and  the request_buffer stoped. so  which  software  will case  this  issue,gst-openmax  or openmax(contrl the hardware)  ,  i  mean  that  if  the pad_chain do not  put  the buffer to the queue of in port so the queue is 0  or   the  sink pad can  not  return the buffer to queue  so  the pad_chain  can  not put  the buffer into it?

    Regards

    Aaron.

  • Hi Satheesh !

          I  find  that  the  when  the  in_port  queue  len  became  zero  but  the gst-openmax  does  not block  immediately, it  will  run  a time. the log about  in_port queue len  is below:


        Line 159: 0:00:02.820007325 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=1 buffer number = 4
        Line 164: 0:00:03.158386232 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=2 buffer number = 4
        Line 169: 0:00:03.159301759 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=3 buffer number = 4
        Line 174: 0:00:03.160186769 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=4 buffer number = 4
        Line 214: 0:00:04.183898927 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=4 buffer number = 4
        Line 242: 0:00:04.706268312 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=3 buffer number = 4
        Line 253: 0:00:04.907684327 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=2 buffer number = 4
        Line 264: 0:00:05.453033448 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=1 buffer number = 4
        Line 275: 0:00:05.635437013 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=0 buffer number = 4
        Line 279: 0:00:05.637786867 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=1 buffer number = 4
        Line 319: 0:00:06.502563478 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=0 buffer number = 4
        Line 323: 0:00:06.505737306 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=1 buffer number = 4
        Line 353: 0:00:07.384429933 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=0 buffer number = 4
        Line 357: 0:00:07.386718752 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = in:0,queue len=1 buffer number = 4
        Line 387: 0:00:08.098968507 [333m 3716[00m   0xcc44c8 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:in:0> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = in:0,queue len=0 buffer number = 4

    and  the out_port  queue len  is  zero  most  of the time  except  the begin of start of encode.The  log  is :

        Line 150: 0:00:02.817016603 [333m 3716[00m   0xccca10 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = out:1,queue len=0 buffer number = 4
        Line 224: 0:00:04.365783693 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = out:1,queue len=1 buffer number = 4
        Line 237: 0:00:04.705261232 [333m 3716[00m   0xccca10 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = out:1,queue len=0 buffer number = 4
        Line 283: 0:00:05.976226808 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = out:1,queue len=1 buffer number = 4
        Line 310: 0:00:06.324737550 [333m 3716[00m   0xccca10 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = out:1,queue len=0 buffer number = 4
        Line 327: 0:00:06.843261720 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = out:1,queue len=1 buffer number = 4
        Line 344: 0:00:07.190948488 [333m 3716[00m   0xccca10 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = out:1,queue len=0 buffer number = 4
        Line 380: 0:00:07.724670412 [333m 3716[00m   0xccc918 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:659:g_omx_port_push_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(659)--g_omx_port_push_buffer  port name = out:1,queue len=1 buffer number = 4
        Line 382: 0:00:08.066284181 [333m 3716[00m   0xccca10 [31;01mERROR  [00m [00m                 omx external/gst-openmax/omx/gstomx_port.c:665:request_buffer:[00m <omxh264enc0:out:1> external/gst-openmax/omx/gstomx_port.c(665)--request_buffer  port name = out:1,queue len=0 buffer number = 4

    BR

    Aaron

  • Aaron,

    There is no software release from TI that supports running gstreamer on top of Android ICS, so it's hard to support such a custom combination on this forum. Is there a reason why you don't want to use the Android multimedia framework?

    Regards,

    Magdalena

  • Magdalena ,

       Because  the gstreamer can support  many  format  not only video  but alse audio. and the gstreamer work well in android 2.3. I am not familiar with the android multimedia framework.

      Regards

    Aaron