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.

Dereferencing Pointer error while accessing hOutBuf members

Hi,

I have to access the decoded data buffer from the video thread before it is sent to Display thread in DM6467 demo application.

I guess, in the following structure, hBufs holds the decoded data

typedef struct BufTab_Object {
    Buffer_Handle *hBufs;       /* Array of buffers in the BufTab. */
    Int            numBufs;     /* The number of buffers in the BufTab. */
    Buffer_Handle *hOrigBufs;
    Int            origNumBufs;
} BufTab_Object;

In video.c, handleCodecBufs(), I tried to access the numBufs variables\ like this : hOutBuf->hBufTab->numBufs. But it is giving “Deferencing pointer to incompatible type” error.

Please let me know if my assumptions regarding the decoded data buffer is right or not. Kindly help me out in solving this error.

The final idea is access the decoded data buffer and apply Moving Average Filter algorithm on that data and send the processed data to the display thread for displaying it on the display device.

Kindly help me out.
Thanks and Regards,

Uma

  • Actually you can not get hBufTab from hOutbuf which is just a buffer.

  • Thanks Jaiwei Dong.

     I want to check for the decoded data buffer. How can i access the buffer?

    Thanks and Regards,

    Uma

  • Uma

            I guess you can't  get the bufTab for decoded buffer, But I don't know why. Do you want to check the decoded data buffer in the display thread or the decode thread?

    If you are in the decode thread, the BufTab is what you provide for the codec. If you want to check it in the display thread, then why don't you try it in the decode thread?

     

    Dong


  • Hi Dong,

    Thanks for your reply. I am trying the access the decoded data buffer (bufTab) from the decode thread only.  I am still getting the deferencing pointer error. I am referring to the below structure to access the decoded data, which i want to pass it to display thread after some manipulation (our algorithm)on that data.

     struct BufTab_Object {
        Buffer_Handle *hBufs;       /* Array of buffers in the BufTab. */
        Int            numBufs;     /* The number of buffers in the BufTab. */
        Buffer_Handle *hOrigBufs;
        Int            origNumBufs;
    } BufTab_Object;

    Request you to check if i am referring to the correct buffer. If not, please let me know which buffer i have to access to get the decoded data.

    Thanks & Regards,

    Uma

     

  •  

     You can use DMAI. Through  function BufTab_getBuf(), you can access any buffer from the BufTab.

    declaration:

        Buffer_Handle  BufTab_getBuf (BufTab_Handle hBufTab, Int bufIdx)

     

    I hope this would help.

  • hi,have you solved your problem?i want to use the buffer data too,but i don't know how

  • Hi,

       I was trying with the virtual buffer, hence i was not able to access the same. Resolved the same with DMAI buffers

    Regards,

    Uma

  • yeah,i want to do the same thing.just like this

    int fgdetect_buffer(Buffer_Handle hInBuf,Buffer_Handle hOutBuf)
    {
     Int8 *inbuf;
     //Int8 *outbuf;


     inbuf = Buffer_getUserPtr( hInBuf);
     //outbuf = Buffer_getUserPtr( hOntBuf);
     Buffer_setUserPtr( hOutBuf,inbuf);
           
     return 0;
           
    }

    but the outbuf has nothing there.how to retrieve the data?