vpu_DecGetInitialInfo function cause decoder and system to hang.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vpu_DecGetInitialInfo function cause decoder and system to hang.

1,050 Views
MichaelLin
Contributor I

Hi, I have met a strange problem when I tried to decode a H.264 bitstream using i.MX51 VPU. My OS is WinCE 6.0, BSP is V1004 and VPU lib is V3.9. I traced the decode operation and found that vpu_DecGetInitialInfo function cause decoder and OS to hang.

1. Open a decoder instance using vpu_DecOpen()

2. To provide the proper amount of bitstream, get the bitstream buffer address using vpu_DecGetBitstreamBuffer()

3. After transferring the decoder input stream, inform the amount of bits transferred into the bitstream buffer using vpu_DecUpdateBitstreamBuffer()

4. Before starting a picture decoder operation, get the crucial parameters for decoder operations such as picture size, frame rate, required frame buffer size using vpu_DecGetInitialInfo()

5. Using the returned frame buffer requirement, allocate the proper size of the frame buffers and convey this data to the i.MX51 VPU using vpu_DecRegisterFrameBuffer()

6. Start a picture decoder operation picture-by-picture using vpu_DecStartOneFrame()

7. Wait for the completion of the picture decoder operation interrupt event

8. Check the results of the decoder operation using vpu_DecGetOutputInfo()

9. After displaying nth frame buffer, clear the buffer display flag using vpu_DecClrDispFlag()

10. If there is more bitstream to decode, go to Step 6, otherwise e go to the next step

11. Terminate the sequence operation by closing the instance using vpu_DecClose()

Since the bitstream is so critical that stream error or lack of available stream may exist which cause decoder to hang.

Can somebody tell me how to avoid decoder hanging after calling vpu_DecGetInitialInfo function?

Labels (2)
0 Kudos
2 Replies

527 Views
zhangzhaolong
Contributor I

hi,

Have you tried this:

    vpu_DecSetEscSeqInit(handle, 1);

    ret = vpu_DecGetInitialInfo(handle, &initinfo);

    vpu_DecSetEscSeqInit(handle, 0);

According to "i.MX 6Dual/6Quad VPU Application Programming Interface Linux Reference Manual",

This function is useful to avoid VPU hanging because of crucial errors in the header syntax.

0 Kudos

527 Views
MichaelLin
Contributor I

Of course I have used the vpu_DecSetEscSeqInit(handle, 1); and vpu_DecSetEscSeqInit(handle, 0); like this. But the app still hanged after calling "ret = vpu_DecGetInitialInfo(handle, &initinfo);", I doubt whether there is something wrong with the VPU decoder.

0 Kudos