Hi All,
Currently I am using DVR RDK 00.07.00.02.
I want to receive a RTSP video stream, replacing one of the analog channel and save into hard disk drive along with others analog camera input.
So far I manage to get a video stream and feed into the existing playback openmax structure as below, I am able to see a video output at sub-window.
RTSP Video Stream -> DMUX -> VDEC -> VFPC_SC -> VFDC (Sub-window).
But I get stuck when I try to send the RTSP Video Stream into the main window flow as shown below.
Analog Camera -> VFCC -> VFPC_DEIM -> VFDC (Main-window)
|---->VENC --> CMUX
Is the following workable? If not, please advice what would be the workable way?
RTSP Video Stream -> DMUX -> VDEC -> VFPC_DEIM -> VFDC (Main-window)
|-------------->VENC -> CMUX
I had tried the above but is not working, my tunnel code connecting VDEC_VFPC_DEIM is as below:
OMX_ERRORTYPE omx_ilclient_connect_VDEC_VFPCDEIM(TunnelTestCtxt* pContext, OMX_U16 numStartChannelVdec, OMX_U16 numStartChannelVfpc, OMX_U16 nChannel)
{
int i;
char channelName [OMX_MAX_STRINGNAME_SIZE + 1];
OMX_CONFIG_CHANNELNAME sChannelName;
OMX_PARAM_COMPPORT_NOTIFYTYPE sNotifyType = {NULL};
OMX_PARAM_PORTDEFINITIONTYPE sLocalPortDef = {NULL};
OMX_PARAM_BUFFER_MEMORYTYPE sMemTypeCfg = {NULL};
OMX_ERRORTYPE eError = OMX_ErrorNone;
int portDiff = (numStartChannelVfpc - numStartChannelVdec);
for ( i = numStartChannelVdec; i < (numStartChannelVdec + nChannel); i++ )
{
memset ( channelName, 0x0, sizeof ( channelName ) );
/*------------------------------------------------------------------------*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* Create Channel Name */
/* */
/*------------------------------------------------------------------------*/
OMX_TEST_INIT_STRUCT ( sChannelName);
snprintf ( channelName, OMX_MAX_STRINGNAME_SIZE, "C_FQ_DECOUT_%d", i );
channelName[OMX_MAX_STRINGNAME_SIZE - 1] = '\0';
/*------------------------------------------------------------------------*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* Configure the Channel Name */
/* */
/*------------------------------------------------------------------------*/
sChannelName.nPortIndex = OMX_VIDDEC_OUTPUT_PORT;
strncpy((char *)sChannelName.cChannelName, channelName, sizeof(sChannelName.cChannelName));
OMX_SetConfig ( pContext->pnDecHandle[i], (OMX_INDEXTYPE)OMX_TI_IndexConfigChannelName, &sChannelName );
OMX_TEST_INIT_STRUCT(sLocalPortDef);
OMX_TEST_INIT_STRUCT(sMemTypeCfg);
sLocalPortDef.nPortIndex = ( OMX_VFPC_INPUT_PORT_START_INDEX + (i + portDiff) );
eError = OMX_GetParameter (pContext->hVFPCDE[IDX_VFPC_DEIM], OMX_IndexParamPortDefinition, &sLocalPortDef);
sLocalPortDef.format.video.eColorFormat = OMX_COLOR_FormatYCbYCr;
if(sLocalPortDef.format.video.nFrameHeight < gCAPTURE_ctrl.CaptureHeight)
sLocalPortDef.format.video.nFrameHeight = gCAPTURE_ctrl.CaptureHeight;
eError = OMX_SetParameter (pContext->hVFPCDE[IDX_VFPC_DEIM], OMX_IndexParamPortDefinition, &sLocalPortDef);
/* If using as bitstream sink dont use tiled memory */
sMemTypeCfg.nPortIndex = ( OMX_VFPC_INPUT_PORT_START_INDEX + (i + portDiff) );
sMemTypeCfg.eBufMemoryType = OMX_BUFFER_MEMORY_DEFAULT;
eError = OMX_SetParameter (pContext->hVFPCDE[IDX_VFPC_DEIM],
(OMX_INDEXTYPE)OMX_TI_IndexParamBuffMemType,
&sMemTypeCfg);
OMX_TEST_BAIL_IF_ERROR ( eError );
OMX_TEST_INIT_STRUCT(sLocalPortDef);
sLocalPortDef.nPortIndex = (OMX_VIDDEC_OUTPUT_PORT);
eError = OMX_GetParameter (pContext->pnDecHandle[i], OMX_IndexParamPortDefinition, &sLocalPortDef);
if( (sLocalPortDef.format.video.nFrameHeight) <= gENCODE_ctrl.EncodeStreamHeight )
sLocalPortDef.format.video.nFrameHeight = gENCODE_ctrl.EncodeStreamHeight;
eError = OMX_SetParameter (pContext->pnDecHandle[i], OMX_IndexParamPortDefinition, &sLocalPortDef);
OMX_TEST_BAIL_IF_ERROR ( eError );
eError = OMX_SetupTunnel (pContext->pnDecHandle[i], (OMX_VIDDEC_OUTPUT_PORT),
pContext->hVFPCDE[IDX_VFPC_DEIM],
( OMX_VFPC_INPUT_PORT_START_INDEX + (i + portDiff) ) );
eError = OMX_SendCommand ( pContext->pnDecHandle[i], OMX_CommandPortEnable,
(OMX_VIDDEC_OUTPUT_PORT), NULL );
OMX_TEST_BAIL_IF_ERROR ( eError );
TIMM_OSAL_SemaphoreObtain ( pContext->hPortConfigEvent, TIMM_OSAL_SUSPEND );
OMX_SendCommand ( pContext->hVFPCDE[IDX_VFPC_DEIM], OMX_CommandPortEnable,
( OMX_VFPC_INPUT_PORT_START_INDEX + (i + portDiff) ),
NULL );
TIMM_OSAL_SemaphoreObtain ( pContext->hPortConfigEvent, TIMM_OSAL_SUSPEND );
}
return eError;
}