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.

IpcBitsOutLink_getEmptyVideoBitStreamBufs获取的emptyBufList.numBufs==0问题

在用Chains_ipcBitsOutSendReadFileFxn发送数据时出现“Can not get an empty buffer”,代码如下,大家觉得问题可能出在哪儿?

Chains_IpcBitsOutCtrlThrObj *thrObj = (Chains_IpcBitsOutCtrlThrObj *) prm;
Bitstream_Buf *pEmptyBuf;
UInt32 bitBufSize;
Int32 stamp = 0;
static volatile int lastIndex = 0;
int tmpIndex;

bitBufSize = BITS_OUT_JPG_GET_BITBUF_SIZE(BITS_OUT_JPG_DEFAULT_WIDTH,
BITS_OUT_JPG_DEFAULT_HEIGHT);


Bitstream_BufList emptyBufList;
IpcBitsOutLinkHLOS_BitstreamBufReqInfo reqInfo;

//OSA_waitMsecs(2000);

while (FALSE == thrObj->exitBitsOutThread)
{

printf("while (FALSE == thrObj->exitBitsOutThread):enter\n");
drs_frame* pdrs_frame = NULL;



pdrs_frame = drs_grap_one_frame();
if(NULL==pdrs_frame)
{
printf("BITS_OUT_JPG: not free drs frame found!");
continue;
}

emptyBufList.numBufs = 0;
reqInfo.numBufs = 1;
reqInfo.u[0].minBufSize = bitBufSize;
reqInfo.reqType = IPC_BITSOUTHLOS_BITBUFREQTYPE_BUFSIZE;
IpcBitsOutLink_getEmptyVideoBitStreamBufs(SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0,
&emptyBufList,
&reqInfo);

if (emptyBufList.numBufs == 0) {
printf("Can not get an empty buffer\n");
drs_putback_one_frame(pdrs_frame);
continue;
}