开发平台:DM8127+ipnc3.5
现在想把h264压缩后的bits在arm侧保存,然后上传到上位机进行解码。为了实现此想法,首先是在 ipcBitsInLink中配置如下
ipcBitsInHostPrm->cbCtx = &gVencModuleContext;
ipcBitsInHostPrm->cbFxn = App_ipcBitsInCbFxn;
然后在
/opt/ipnc/Source/ipnc_rdk/ipnc_mcfw/demos/mcfw_api_demos/multich_usecase/ti_mcfw_ipcbits.c
中的App_ipcBitsInit()打开文件保存。
Int32 App_ipcBitsInit()
{
//modified by qiu
//gApp_ipcBitsCtrl.fObj.enableFWrite = FALSE;
gApp_ipcBitsCtrl.fObj.enableFWrite = TRUE;
}
运行软件,可以看到在文件系统中有以下文件,但是文件大小为0
drwxr-sr-x 2 root 3355 4096 8月 7 17:35 ./
drwxrwsrwx 4 qiu 3355 4096 8月 7 16:48 ../
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_DATA_0.bin
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_DATA_0.bin.mv
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_DATA_1.bin
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_DATA_1.bin.mv
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_DATA_2.bin
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_DATA_2.bin.mv
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_HDR_0.bin
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_HDR_1.bin
-rw-r--r-- 1 root 3355 0 8月 9 09:19 VBITS_HDR_2.bin
这是为什么呢?
跟踪ti_mcfw_ipcbits.c中的函数App_streamSysVidWrite()发现
Int App_streamSysVidWrite(UInt32 chId, UInt32 codecType, Void * pEncodeBuffer,
Int32 frameSize, Int32 frameType, UInt32 timestamp,
UInt32 temporalId)
{
if (writeEnable == TRUE)
{
stream_write(pEncodeBuffer, // pAddr
frameSize, // size
frameType, // frame_type
streamType, // stream_type
AUDIO_GetTimeStamp(), // timestamp
temporalId, // temporalId
stream_get_handle()); // pParm
}
}
这里面stream_get_handle()获取的文件指针不是前面App_ipcBitsOpenFileHandles()打开的文件指针。
那么,bits文件流保存到哪里去了呢?
谢谢指教!