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 question on changing connected component

I want to cature video on the OMX_VIDEO_CaptureHWPortVIP1_PORTA and OMX_VIDEO_CaptureHWPortVIP2_PORTA at the same time,

but with only one connecting to the DEI component and then display, while the other capture component is unconnected to any other component.

I want to change which capture port is connected to DEI during run time, but I am confused what need to be modified.

From my understanding,

1.. IL_ClientConnectComponents need to change to the new port

2. OMX_UseBuffer of DEI component need to change too because it is using the previous capture component's buffer, but do i need to call FreeBuffer first and call UseBuffer afterward? or how to do it?

3. Do it need to change the state of some component using OMX_CommandStateSet? If yes, which components and what states need to be set?

Is there anything else need to be modified too?

Please provide me some ideas, thanks.

 

  • Hi,

    If you want to keep both the captures active, allocate say X buffers for capture1 and Y for capture 2. do use buffer call on connc ted component for X+Y buffers, and then you can give any buffer from X+Y pool to conncted component, It would accept it. For non-concted capture, you can keep returning the buffers as EmptyBufferDone, so it keeps running. when you want to use it, pass that buffer to other component as EmptythisBuffer.

    Regards

    Vimal

  • Hi Vimal,

    Thanks for the answer, so it means

    for capture1, nBufferCountActual = X

    for capture2, nBufferCountActual = Y

    for dei input, nBufferCountActual  = X + Y

    for connected capture component, just follow normal flow

    for non-connected capture component, simply call OMX_FillThisBuffer when fillBufferDone callback is received as in the case one DEI out port is not connected

    when I want to change the active capture port, just change the pipe connection in IL_ClientConnectComponents

     is this right?

     

    Besides that, does both capture handle use nPortIndex = OMX_VFPC_INPUT_PORT_START_INDEX? or the second capture handle need to use OMX_VFPC_INPUT_PORT_START_INDEX+1?

    Thanks

    Thomas

  • Hi Vimal,

    I have tried making some modification but not successful yet.

    if I change the pipe connection from capture 1 to capture 2 using IL_ClientConnectComponents, the DEI component input may still have a buffer from EBD of capture 1, how should I work on it? write it back to its own local pipe until capture 1 is connected to DEI again?

    and what does the following mean when running /usr/share/ti/ti-uia/loggerSMDump.out 0x9E400000 0x100000 vpss?

    :VIP-1 PORT-A Dropped Frame Count :X Total Capture Frame Count Y

    Thanks

    Thomas

  • Hi Vimal,

    It seems I am able to change the capture connected to DEI now.

    But from /usr/share/ti/ti-uia/loggerSMDump.out 0x9E400000 0x100000 vpss, I keep getting messages like this

    N:VPSS  P:2 #:08669 T:00000030ac4c934f S:VIP-0 PORT-A Dropped Frame Count :4881 Total Capture Frame Count 16950
    N:VPSS  P:2 #:08670 T:00000030ac899001 S:VIP-1 PORT-A Dropped Frame Count :2336 Total Capture Frame Count 19479
    N:VPSS  P:2 #:08671 T:00000030ae34d97b S:VIP-0 PORT-A Dropped Frame Count :4882 Total Capture Frame Count 16953
    N:VPSS  P:2 #:08672 T:00000030af28fac9 S:VIP-1 PORT-A Dropped Frame Count :2337 Total Capture Frame Count 19483
    N:VPSS  P:2 #:08673 T:00000030b05a5865 S:VIP-0 PORT-A Dropped Frame Count :4883 Total Capture Frame Count 16956
    N:VPSS  P:2 #:08674 T:00000030b18b4d63 S:VIP-1 PORT-A Dropped Frame Count :2338 Total Capture Frame Count 19487
    N:VPSS  P:2 #:08675 T:00000030b243ae2f S:VIP-0 PORT-A Dropped Frame Count :4884 Total Capture Frame Count 16959
    N:VPSS  P:2 #:08676 T:00000030b3edba0f S:VIP-1 PORT-A Dropped Frame Count :2339 Total Capture Frame Count 19491
    N:VPSS  P:2 #:08677 T:00000030b42ab5cf S:VIP-0 PORT-A Dropped Frame Count :4885 Total Capture Frame Count 16962
    N:VPSS  P:2 #:08678 T:00000030b612ff5d S:VIP-0 PORT-A Dropped Frame Count :4886 Total Capture Frame Count 16965
    N:VPSS  P:2 #:08679 T:00000030b64fff49 S:VIP-1 PORT-A Dropped Frame Count :2340 Total Capture Frame Count 19495
    N:VPSS  P:2 #:08680 T:00000030b838f803 S:VIP-0 PORT-A Dropped Frame Count :4887 Total Capture Frame Count 16968
    N:VPSS  P:2 #:08681 T:00000030b8ef651d S:VIP-1 PORT-A Dropped Frame Count :2341 Total Capture Frame Count 19499

    What could be a possible cause of this? thanks

    Thomas

  • Thomas,

    It means Capture is dropping frames, as it is not getting buffers on time from applications. 

    Regards

    Vimal

  • Hi Vimal,

    I can capture video from both VIP0 and VIP1 now, but I have got another problem.

    Now if I remove the video source of VIP1 while running, then connecting it really quickly, the video capture recover and things back to normal,
    and from /usr/share/ti/ti-uia/loggerSMDump.out 0x9E400000 0x100000 all, I see something like this
    N:VPSS  P:2 #:07066 T:0000003f1ea15cc5 S:VFCC Capture_drvOverflowDetectAndReset::Line 3601::VIP Reset Happend, reset count:: 10 portId : 2
    N:VPSS  P:2 #:07067 T:0000003f1ecd8b63 S:RESET Count:: 10 , curTime:: 541190
    N:VPSS  P:2 #:07068 T:0000003f1f568697 S:VIP-1 PORT-A Dropped Frame Count :55 Total Capture Frame Count 8989

    but if I reconnect the video source slower (actually just about 1 second or so), VIP1 seems not capturing any frames anymore, and I see this message
    N:VPSS  P:2 #:07069 T:0000003feba9d597 S:VFCC Capture_drvOverflowDetectAndReset::Line 3601::VIP Reset Happend, reset count:: 11 portId : 0

    The video source I remove is the one connected to VIP1, but it seems in this case:
    VIP Reset Happend, reset count:: 11 portId : 0, means VIP0 is reset, instead of VIP1, causing the failure? Do I understand it correctly?

    There is no problem if I remove and reconnect the video source in VIP0, it seems to just happening to VIP1,
    but I have tried running the original capture_encode demo and capture on VIP1, that works fine though.

    What could have caused this problem? or is that I have set something wrongly?

    The nPortIndex of the two capture handles from OMX_GetHandle are both set to OMX_VFCC_OUTPUT_PORT_START_INDEX, right? or one need to set to OMX_VFCC_OUTPUT_PORT_START_INDEX + 1?

    Thanks

    Thomas

     

  • Besides that, another question to ask.

    If I want to change the DEI output size, the Mosaic input size and output layout during run time,
    what have to be done before calling OMX_SetParameter to change the new parameters?

    Thanks.

    Thomas

  • Can anyone give me some idea on the questions on the above 2 posts?

    Thanks

  • Do you want to change the size as it's starting up, such as if it's a small resolution, to scale it? To do that you have to compare the nwidth and nheight of what you're getting in and see if scaling it will still fit within your screen size. E.g. if I have 1080p screen, doubling a 720p video will go offscreen. then you can increase the nbuffersize and resolution size. Scaling should be done with a scale or dei component. These changes should be done in your setdeiparams.

  • What I want to do is, e.g. with 2 1080p video, 1 1080p display, at first scaling down the 2 video and pass them to masaic component to display both video on screen, then later change it to just display video 1 in full size without scaling down, later change it again

  • Thomas,

    It is not clear if you are seeing problems with VIP1 capture or connecting/disconnecting the components ? Also instead of connecting the component, you can try implementing logic where based on some command you stop giving buffers to particular chain.

    regards

    Vimal

  • Thanks Vimal, I will try your suggestion.

    How about the other question about changing scaler output inage szie and mosaic input size during processing? What is the proper way to do this?

    Thanks

  • I'm not sure how the scalar initilization looks like  but I believe it's similar to the DEI. Based off this you'd do something like this:

      if(pAppData->nWidth <= 960 && pAppData->nHeight <= 540)
      {
        paramPort.format.video.nFrameWidth = pAppData->nWidth*2;
        paramPort.format.video.nFrameHeight = pAppData->nHeight*2;
      }
      else{
        paramPort.format.video.nFrameWidth = pAppData->nWidth;
        paramPort.format.video.nFrameHeight = pAppData->nHeight;
      }

    In this case, I put in nWidth and nHeight variables into the stuct ILCLIENT in ilclient.h  This way I can put in this logic to change the output of the DEI/scalar and hand it to the display which has the same thing but for it's input.

    For your case of changing everything while it's running; it is much more difficult because this stuff of scaling is done on initialization. To manipulate the size of the buffer while running you may have to manually change the buffer or use another Scalar/dei to do the other kind of scale for you. I have not found a way to change the frame size while running, but I haven't tried it really.

  • Hi,

    For runtime change SCWB supports runtime change; You can use Setconfig of vidchanresolution for doing the change on the fly in EZSDK 5.05.01.04. ( It is available for download) 

    Regards

    Vimal