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.

Using VIDENC1_control

Hello,

I am having issues changing the size of my encoder on the fly.  I followed the steps from this post:

http://processors.wiki.ti.com/index.php/DM36x_H.264_encoder_FAQ

However, I can't get the encoder to accept the XDM_RESET (or the SET_PARAMS for that matter).  CE_DEBUG=3 does not really give me any information about what might be wrong. 

 [DEBUG] [2010-03-03 05:04:17.490] [1655] [void* encodeThrFxn(void*)] Change Size Code goes here.                                                           
@62,490,836us: [+0 T:0x45bd0490 S:0x45bcfb54] ti.sdo.ce.video1.VIDENC1 - VIDENC1_control> Enter (handle=0x51c58, id=2, dynParams=0xbecaf990 (size=0x30), st)
@62,490,981us: [+0 T:0x45bd0490 S:0x45bcfb54] ti.sdo.ce.video1.VIDENC1 - VIDENC1_control> Exit (handle=0x51c58, retVal=0xffffffff)                         
[ERROR] [2010-03-03 05:04:17.491] [1655] [void* encodeThrFxn(void*)] Unable able to reset encoder.  Cannot attempt to change sizes. Error Code: -1 

Here is my code:

            Venc1_Handle           hVe1       = NULL; 

            VIDENC1_Status          encStatus;
            hVe1 = Venc1_create(hEngine, locArgs->cmdLineArgs.codecName, &(locArgs->encParams),&(locArgs->encDynParams));
    
        LOG_DEBUG("Change Size Code goes here.");
            

            ret = VIDENC1_control(Venc1_getVisaHandle(hVe1), XDM_RESET, &locArgs->encDynParams, &encStatus);
            if ( ret != VIDENC1_EOK )
            {
                LOG_ERROR("Unable able to reset encoder.  Cannot attempt to change sizes. Error Code: %i", ret);
            }
            else

Here is the background info:

dm6467T, dvsdk 3.10.0.19, H264enc, using dmai 2.10.0.12 for buffers, and video codec setup. 

There are 10 threads running 10 different encoder instances.  I need to be able to change the size of a single instance dynamically.  As I understand that is what the control function and the dynamic parameters are supposed to be able to do.

Please advise or point me to an example DMAI program.  I was unable to find one sufficent.

Thanks,

Brandy

  • Ha - just kidding.  I figured it out.  You need to set some variables in the status struct.  I added the following code and now it works:

                VIDENC1_Status          encStatus;

                encStatus.size = sizeof(VIDENC1_Status);
                encStatus.data.buf = NULL;
                ret = VIDENC1_control(Venc1_getVisaHandle(hVe1), XDM_RESET, &locArgs->encDynParams, &encStatus);