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.

Resetting decode codec state?

All-

First the particulars:

  • DM814x
  • DVRRDK 03.00.01.03
  • Custom multi-channel encode / single-channel decode application based directly on Links APIs.
  • Encode channels (H.264, SD) are muxed into MPEG-2 transport streams and transferred via PCIe to a host system for storage.
  • MPEG-2 transport stream transferred via PCIe from host system for playback.
  • Decode chain is as follows:   (IpcBitsOutLink --> IpcBitsInLink --> DecLink --> IpcLink (m3video out) --> IpcLink (m3vpss in) --> SclrLink --> DisplayLink).

We have multiple encoded streams stored on the host system, and are attempting to implement a "preview" mode where we decode and display I-frame #1 of stream #1 for a period of time, then I-frame #1 of stream #2, etc.

Individually, each of these I-frames (including SPS/PPS) will decode and display correctly if it's the first frame fed to the H.264 codec.

When we attempt to feed multiple frames, the first renders correctly, but then subsequent frames return a codec error code of 0x00001409.

I've tried setting Bitstream_Buf.inputFileChanged = true for each frame (as they're from different captures). This has no effect.

I've tried issuing a System_linkStop(declink_id) and System_linkStart(declink_id), but this also seems to have no effect.

I've verified that we're submitting exactly one I-frame worth of data, and that the codec reports that same amount as being consumed (IH264VDEC_OutArgs.bytesConsumed == Bitstream_Buf.fillLength).  This is true even when the codec reports an error.

What is the recommended method to flush and/or reset the codec state between separate decode operations?

Would the PTS associated with each I-frame have anything to do with whether or not the decode operation is successful?

Thanks!

-Cory

  • If all are IDR frames and you have created decoder for max resolution there is no need to reset the decoder. Attach the h264 elementary stream you are trying to playback .We will try it with latest DVRRDK release decode display usecase .There was a bug in H264 decoder reporting bytes consumed which could cause this INSUFFICIENT DATA error.

  • Badri-

    Attached should be 4 files, each of which consists of 2 GOPs of captured data.  (The content may look the same as they're captured from two common sources.)  Captures are 720x480 @ 30 FPS, and the DecLink is created for a single channel of this resolution:

    [m3video] 38361: DECODE: Creating CH0 of 720 x 480 [PROGRESSIVE] [NON-TILED ],target bitrate = 4000 Kbps ...
    [m3video] 38362: DECODE: All CH Create ... DONE !!!

    We're attempting to feed the SPS + PPS + first I-frame for each file, in order.  The relevant sizes are as follows:

    1.h264  65255 bytes
    2.h264  58608 bytes
    3.h264  65691 bytes
    4.h264  45262 bytes

    I've verified that these values are what's being supplied to the DecLink, and also that the data buffers themselves look sane (i.e. first and last 16 bytes of each frame match on the A8 and M3Video).

    The very first frame (I-frame #1 from 1.h264) will decode and render correctly, all subsequent frames (I-frame #1 of 2.h264, I-frame #1 of 3.h264, etc.) will result in extended error code 0x00001409.  This includes if I re-submit frame #1 of 1.h264.

    If I change the order the files' first frames are sent (i.e. 4.h264 - 1.h264), the result is the same - the very first I-frame is rendered correctly, all others fail.

    Oddly enough, I-frame only trick modes (our implementation) work just fine - I can skip forward and backward through the files with no errors at all...

    Any insight you can offer would be most appreciated!

    Best regards,

    -Cory

    6786.1.h264.gz
    1616.2.h264.gz
    5164.3.h264.gz
    7318.4.h264.gz

  • Hi Cory,

    Following is the analysis from the codec team regarding why the decoder returns errors when decoding I frames from different streams.

    “First I frame decodes without errors. For second frame, POC calculation is same as first frame.(For three out of four given streams, first I frames have same POC). So here due to the matching of the present frame POC and previous frame POC  decoder returns error. The same is true for the following I frames too. “

    Trick play works fine as I frames are from the same stream and hence POC calculations will be proper.

    We could observe, with decoder flush being called before feeding I frame from a different stream, the decode works fine and doesn’t  throw any errors. Flush call can be forced by feeding a 5 bytes EOS sequence (00 00 00 01 0b)  to the decoder, for which decoder returns EOS received error. As a part of EOS handling, decoder link calls decoder flush. 

    For these changes to work, it is required to migrate to the latest version of decoder.

    We have tested this using rdk decode display demo. Attached is the stream and its corresponding ini file. Stream has I frames from the streams shared in the previous post , with EOS sequence inserted in between two I frames. Ini file has frame sizes.

    Regards,

    Reshma

    1234_EOS.tar.gz
  • Reshma-

    Thanks for the analysis and reply.

    We wound up extending the DecLink interface to support a hard-flush and reset (XDM_FLUSH & XDM_RESET), which works with the current version of DVRRDK we're using.  This yields acceptable results without having to worry about injecting the EOS sequence after each frame has been decoded.

    I'm attaching the patch against our (modified) DVRRDK 03.00.01.03 in case it's useful to someone else.

    Best regards,

    -Cory


    diff --git a/dvr_rdk/mcfw/interfaces/link_api/decLink.h b/dvr_rdk/mcfw/interfaces/link_api/decLink.h
    index d55fc03..dcc3282 100644
    --- a/dvr_rdk/mcfw/interfaces/link_api/decLink.h
    +++ b/dvr_rdk/mcfw/interfaces/link_api/decLink.h
    @@ -154,6 +154,8 @@
         \param NONE
     */
     #define DEC_LINK_CMD_RESET_DEC_ERR_REPORTING (0x200A)
    +
    +#define DEC_LINK_CMD_FLUSH_CHANNEL (0x200B)
     /* @} */
     
     /**
    diff --git a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    index 836d538..35981f9 100644
    --- a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    +++ b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    @@ -36,6 +36,7 @@ static Int32 DecLink_codecSubmitData(DecLink_Obj * pObj);
     static Int32 DecLink_codecGetProcessedData(DecLink_Obj * pObj);
     static Int32 decLink_map_displayDelay2CodecParam(Int32 displayDelay);
     static Int32 DecLink_codecFlushNDeleteChannel(DecLink_Obj * pObj, UInt32 chId);
    +static Int32 DecLink_codecFlush(DecLink_Obj * pObj, UInt32 chId);
     static Int32 DecLink_dupFrame(DecLink_Obj * pObj, FVID2_Frame * pOrgFrame,
                                   FVID2_Frame ** ppDupFrame);
     static Int32 DecLink_PrepareBatch (DecLink_Obj *pObj, UInt32 tskId, 
    @@ -1022,6 +1023,10 @@ static Int32 DecLink_codecHandleDummyReqObj(DecLink_Obj  *pObj,
                 DECLINK_INFO_LOG(pObj->linkId,pReqObj->InBuf->channelNum,"Flush Frame Received in ProcessQue");
                 break;
             }
    +        case DEC_LINK_REQ_OBJECT_TYPE_DUMMY_CHFLUSH:
    +            DecLink_codecFlush(pObj, pReqObj->InBuf->channelNum);
    +            UTILS_assert(pReqObj->ivaSwitchSerializer == NULL);
    +            break;
             default:
                 /* Unsupported reqObjType.*/
                 UTILS_assert(0);
    @@ -2001,6 +2006,105 @@ Int32 DecLink_codecFreeInQueuedBufs(DecLink_Obj * pObj)
         return DEC_LINK_S_SUCCESS;
     }
     
    +static
    +Int32 DecLink_codecFlush(DecLink_Obj * pObj, UInt32 chId)
    +{
    +    Int32 status = DEC_LINK_S_SUCCESS;
    +    FVID2_FrameList freeFrameList;
    +
    +    UTILS_assert(chId <= pObj->inQueInfo.numCh);
    +
    +    freeFrameList.numFrames = 0;
    +    if (pObj->createArgs.chCreateParams[chId].algCreateStatus ==
    +                         DEC_LINK_ALG_CREATE_STATUS_CREATE_DONE)
    +    {
    +        DecLink_ChObj * pChObj = &pObj->chObj[chId];
    +
    +        switch (pChObj->algObj.algCreateParams.format)
    +        {
    +            case IVIDEO_H264BP:
    +            case IVIDEO_H264MP:
    +            case IVIDEO_H264HP:
    +                DecLinkH264_codecFlush(pChObj,
    +                                       &pChObj->algObj.u.h264AlgIfObj.inArgs,
    +                                       &pChObj->algObj.u.h264AlgIfObj.outArgs,
    +                                       &pChObj->algObj.u.h264AlgIfObj.inBufs,
    +                                       &pChObj->algObj.u.h264AlgIfObj.outBufs,
    +                                       pChObj->algObj.u.h264AlgIfObj.algHandle,
    +                                       &freeFrameList, TRUE, TRUE);
    +                break;
    +
    +            case IVIDEO_MPEG4SP:
    +            case IVIDEO_MPEG4ASP:
    +                DecLinkMPEG4_codecFlush(pChObj,
    +                                        &pChObj->algObj.u.mpeg4AlgIfObj.inArgs,
    +                                        &pChObj->algObj.u.mpeg4AlgIfObj.outArgs,
    +                                        &pChObj->algObj.u.mpeg4AlgIfObj.inBufs,
    +                                        &pChObj->algObj.u.mpeg4AlgIfObj.outBufs,
    +                                        pChObj->algObj.u.mpeg4AlgIfObj.algHandle,
    +                                        &freeFrameList, TRUE, TRUE);
    +                break;
    +
    +#ifdef CODEC_ENABLE_MJPEG_DECODE
    +            case IVIDEO_MJPEG:
    +                break;
    +#endif
    +
    +#ifdef CODEC_ENABLE_V_MPEG2_DECODE
    +            case IVIDEO_MPEG2:
    +                DecLinkMPEG2_codecFlush(pChObj,
    +                                        &pChObj->algObj.u.mpeg2AlgIfObj.inArgs,
    +                                        &pChObj->algObj.u.mpeg2AlgIfObj.outArgs,
    +                                        &pChObj->algObj.u.mpeg2AlgIfObj.inBufs,
    +                                        &pChObj->algObj.u.mpeg2AlgIfObj.outBufs,
    +                                        pChObj->algObj.u.mpeg2AlgIfObj.algHandle,
    +                                        &freeFrameList, TRUE, TRUE);
    +                break;
    +#endif
    +
    +            default:
    +                status = DEC_LINK_E_UNSUPPORTEDCODEC;
    +                break;
    +        }
    +        UTILS_assert(status == DEC_LINK_S_SUCCESS);
    +    }
    +
    +    if (freeFrameList.numFrames)
    +    {
    +        DecLink_codecFreeProcessedFrames(pObj, &freeFrameList);
    +    }
    +
    +    return (status);
    +}
    +
    +Int32 DecLink_codecFlushChannelHandler(DecLink_Obj * pObj,
    +                                       DecLink_ChannelInfo * params)
    +{
    +    Int32 status = DEC_LINK_S_SUCCESS;
    +    Uint32 chId, tskId;
    +    DecLink_ChObj * pChObj;
    +    DecLink_ReqObj * pReqObj;
    +
    +    chId = params->chId;
    +    UTILS_assert(chId <= pObj->inQueInfo.numCh);
    +    pChObj = &pObj->chObj[chId];
    +    tskId = pObj->ch2ProcessTskId[chId];
    +
    +    status = Utils_queGet(&pObj->decDummyReqObj.reqQueDummy, (Ptr *)&pReqObj, 1, BIOS_NO_WAIT);
    +    UTILS_assert(status == FVID2_SOK);
    +
    +    UTILS_assert(UTILS_ARRAYISVALIDENTRY(pReqObj, pObj->decDummyReqObj.reqObjDummy));
    +    pChObj->dummyBitBuf.channelNum = chId;
    +    pReqObj->InBuf = &pChObj->dummyBitBuf;
    +    pReqObj->type = DEC_LINK_REQ_OBJECT_TYPE_DUMMY_CHFLUSH;
    +    pReqObj->ivaSwitchSerializer = NULL;
    +    status = Utils_quePut(&pObj->decProcessTsk[tskId].processQue,
    +                           pReqObj, BIOS_NO_WAIT);
    +    UTILS_assert(status == FVID2_SOK);
    +
    +    return status;
    +}
    +
     Int32 DecLink_codecStop(DecLink_Obj * pObj)
     {
         Int32 rtnValue = FVID2_SOK;
    @@ -2930,7 +3034,7 @@ static Int32 DecLink_codecFlushNDeleteChannel(DecLink_Obj * pObj, UInt32 chId)
                                            &pChObj->algObj.u.h264AlgIfObj.inBufs, 
                                            &pChObj->algObj.u.h264AlgIfObj.outBufs, 
                                            pChObj->algObj.u.h264AlgIfObj.algHandle, 
    -                                       &freeFrameList, TRUE);
    +                                       &freeFrameList, TRUE, FALSE);
                     break;
     
                 case IVIDEO_MPEG4SP:
    @@ -2941,7 +3045,7 @@ static Int32 DecLink_codecFlushNDeleteChannel(DecLink_Obj * pObj, UInt32 chId)
                                             &pChObj->algObj.u.mpeg4AlgIfObj.inBufs, 
                                             &pChObj->algObj.u.mpeg4AlgIfObj.outBufs, 
                                             pChObj->algObj.u.mpeg4AlgIfObj.algHandle, 
    -                                        &freeFrameList, TRUE);
    +                                        &freeFrameList, TRUE, FALSE);
                     break;
     
     #ifdef CODEC_ENABLE_MJPEG_DECODE
    @@ -2957,7 +3061,7 @@ static Int32 DecLink_codecFlushNDeleteChannel(DecLink_Obj * pObj, UInt32 chId)
                                             &pChObj->algObj.u.mpeg2AlgIfObj.inBufs,
                                             &pChObj->algObj.u.mpeg2AlgIfObj.outBufs,
                                             pChObj->algObj.u.mpeg2AlgIfObj.algHandle,
    -                                        &freeFrameList, TRUE);
    +                                        &freeFrameList, TRUE, FALSE);
                     break;
     #endif
     
    diff --git a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
    index 28cea8e..9016126 100644
    --- a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
    +++ b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
    @@ -121,7 +121,8 @@ Int32 DecLinkH264_codecFlush(DecLink_ChObj *pChObj,
                                  XDM2_BufDesc *outputBufDesc,
                                  IH264VDEC_Handle handle,
                                  FVID2_FrameList *freeFrameList,
    -                             Bool hardFlush)
    +                             Bool hardFlush,
    +                             Bool hardReset)
     {
         Int32 freeBufIdx;
         DecLink_H264Obj *hObj;
    @@ -133,7 +134,7 @@ Int32 DecLinkH264_codecFlush(DecLink_ChObj *pChObj,
         hObj = &(pChObj->algObj.u.h264AlgIfObj);
         fxns = (IALG_Fxns *) handle->fxns;
     
    -    needReset = 
    +    needReset = hardReset ||
           DecLink_h264DecoderResetCheck(outArgs->viddec3OutArgs.
                                         extendedError);
         status = DecLink_h264DecoderFlush(hObj, hardFlush);
    @@ -442,7 +443,7 @@ Int32 Declink_h264DecodeFrameBatch(DecLink_Obj * pObj,
                     needReset = DecLinkH264_codecFlush(pChObj, inArgs, 
                                                        outArgs, inputBufDesc,
                                                        outputBufDesc, handle, 
    -                                                   freeFrameList, FALSE);
    +                                                   freeFrameList, FALSE, FALSE);
                     pReqObj->OutFrameList.frames[prosIdx] = NULL;
     
                     if (DecLink_h264Decoder_checkErr(extendedError,
    @@ -967,11 +968,14 @@ static Int32 DecLink_h264DecoderFlush(DecLink_H264Obj * hObj, Bool hardFlush)
         if(doFlush || hardFlush)
         {
             #ifdef SYSTEM_DEBUG_DEC
    -        Vps_printf(" %d: DECODE: CH%d: Decoder flush needed (%d)!!!\n",
    -            Utils_getCurTimeInMsec(),
    -            hObj->channelID,
    -            outArgs->viddec3OutArgs.extendedError
    -        );
    +        if (!hardFlush)
    +        {
    +            Vps_printf(" %d: DECODE: CH%d: Decoder flush needed (0x%08x)!!!\n",
    +                Utils_getCurTimeInMsec(),
    +                hObj->channelID,
    +                outArgs->viddec3OutArgs.extendedError
    +            );
    +        }
             #endif
     
            fxns->algActivate((IALG_Handle) handle);
    diff --git a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg2.c b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg2.c
    index 267fdee..abc136e 100644
    --- a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg2.c
    +++ b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg2.c
    @@ -824,7 +824,7 @@ Int32 Declink_mpeg2DecodeFrameBatch(
     #ifndef DEC_LINK_SUPRESS_ERROR_AND_RESET
                     needReset = DecLinkMPEG2_codecFlush(pChObj, inArgs, outArgs,
                             inputBufDesc, outputBufDesc, handle, freeFrameList,
    -                        FALSE);
    +                        FALSE, FALSE);
                     pReqObj->OutFrameList.frames[prosIdx] = NULL;
     
                     if (DecLink_mpeg2Decoder_checkErr(
    @@ -985,9 +985,12 @@ static Int32 DecLink_mpeg2DecoderFlush(
         if(doFlush || hardFlush)
         {
     #ifdef SYSTEM_DEBUG_DEC
    -        Vps_printf(" %d: DECODE: CH%d: Decoder flush needed (%d)!!!\n",
    -            Utils_getCurTimeInMsec(), hObj->channelID,
    -            outArgs->viddecOutArgs.extendedError);
    +        if (!hardFlush)
    +        {
    +            Vps_printf(" %d: DECODE: CH%d: Decoder flush needed (0x%08x)!!!\n",
    +                Utils_getCurTimeInMsec(), hObj->channelID,
    +                outArgs->viddecOutArgs.extendedError);
    +        }
     #endif
     
             err = decLink_mpeg2_control(
    @@ -1045,7 +1048,8 @@ Int32 DecLinkMPEG2_codecFlush(
             XDM2_BufDesc * outputBufDesc,
             IMPEG2VDEC_Handle handle,
             FVID2_FrameList * freeFrameList,
    -        Bool hardFlush)
    +        Bool hardFlush,
    +        Bool hardReset)
     {
         Int32 freeBufIdx;
         DecLink_MPEG2Obj *hObj;
    @@ -1055,8 +1059,8 @@ Int32 DecLinkMPEG2_codecFlush(
     
         hObj = &pChObj->algObj.u.mpeg2AlgIfObj;
     
    -    needReset = DecLink_mpeg2DecoderResetCheck(
    -            outArgs->viddecOutArgs.extendedError);
    +    needReset = hardReset ||
    +        DecLink_mpeg2DecoderResetCheck(outArgs->viddecOutArgs.extendedError);
         status = DecLink_mpeg2DecoderFlush(hObj, hardFlush);
     
         if (status == XDM_EOK)
    diff --git a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c
    index ef6a594..c0f4dd6 100644
    --- a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c
    +++ b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_mpeg4.c
    @@ -105,7 +105,8 @@ Int32 DecLinkMPEG4_codecFlush(DecLink_ChObj *pChObj,
                                   XDM2_BufDesc *outputBufDesc,
                                   IMPEG4VDEC_Handle handle,
                                   FVID2_FrameList *freeFrameList,
    -                              Bool hardFlush)
    +                              Bool hardFlush,
    +                              Bool hardReset)
     {
         Int32 freeBufIdx;
         DecLink_MPEG4Obj *hObj;
    @@ -117,7 +118,7 @@ Int32 DecLinkMPEG4_codecFlush(DecLink_ChObj *pChObj,
         hObj = &(pChObj->algObj.u.mpeg4AlgIfObj);
         fxns = (IALG_Fxns *) handle->fxns;
     
    -    needReset = 
    +    needReset = hardReset ||
           DecLink_mpeg4DecoderResetCheck(outArgs->viddec3OutArgs.
                                          extendedError);
         status = DecLink_mpeg4DecoderFlush(hObj, hardFlush);
    @@ -320,7 +321,7 @@ Int32 Declink_mpeg4DecodeFrameBatch(DecLink_Obj * pObj,
                     needReset = DecLinkMPEG4_codecFlush(pChObj, inArgs, 
                                                         outArgs, inputBufDesc,
                                                         outputBufDesc, handle, 
    -                                                    freeFrameList, FALSE);
    +                                                    freeFrameList, FALSE, FALSE);
                     pReqObj->OutFrameList.frames[prosIdx] = NULL;
     
                     if (DecLink_mpeg4Decoder_checkErr(extendedError,
    @@ -782,11 +783,14 @@ static Int32 DecLink_mpeg4DecoderFlush(DecLink_MPEG4Obj * hObj, Bool hardFlush)
         if(doFlush || hardFlush)
         {
             #ifdef SYSTEM_DEBUG_DEC
    -        Vps_printf(" %d: DECODE: CH%d: Decoder flush needed (%d)!!!\n",
    -            Utils_getCurTimeInMsec(),
    -            hObj->channelID,
    -            outArgs->viddec3OutArgs.extendedError
    -        );
    +        if (!hardFlush)
    +        {
    +            Vps_printf(" %d: DECODE: CH%d: Decoder flush needed (0x%08x)!!!\n",
    +                Utils_getCurTimeInMsec(),
    +                hObj->channelID,
    +                outArgs->viddec3OutArgs.extendedError
    +            );
    +        }
             #endif
     
            fxns->algActivate((IALG_Handle) handle);
    diff --git a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
    index 80ca1c8..5026b94 100644
    --- a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
    +++ b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
    @@ -107,7 +107,8 @@ typedef enum DecLink_ReqObjType_e
         DEC_LINK_REQ_OBJECT_TYPE_DUMMY_CHDELETE,
         DEC_LINK_REQ_OBJECT_TYPE_DUMMY_IVAMAPCHANGE_PREVIVALAST,
         DEC_LINK_REQ_OBJECT_TYPE_DUMMY_IVAMAPCHANGE_NEXTIVAFIRST,
    -    DEC_LINK_REQ_OBJECT_TYPE_DUMMY_FLUSHFRAME
    +    DEC_LINK_REQ_OBJECT_TYPE_DUMMY_FLUSHFRAME,
    +    DEC_LINK_REQ_OBJECT_TYPE_DUMMY_CHFLUSH,
     } DecLink_ReqObjType_e;
     
     //#define SYSTEM_DEBUG_MULTI_CHANNEL_DEC
    @@ -308,6 +309,8 @@ Int32 DecLink_codecCreate(DecLink_Obj * pObj, DecLink_CreateParams * pPrm);
     Int32 DecLink_codecProcessData(DecLink_Obj * pObj);
     Int32 DecLink_codecGetProcessedDataMsgHandler(DecLink_Obj * pObj);
     Int32 DecLink_codecStop(DecLink_Obj * pObj);
    +Int32 DecLink_codecFlushChannelHandler(DecLink_Obj * pObj,
    +                              DecLink_ChannelInfo * params);
     Int32 DecLink_codecDelete(DecLink_Obj * pObj);
     Int32 DecLink_codecDisableChannel(DecLink_Obj * pObj,
                                   DecLink_ChannelInfo* params);
    @@ -358,7 +361,8 @@ Int32 DecLinkH264_codecFlush(DecLink_ChObj *pChObj,
                                  XDM2_BufDesc *outputBufDesc,
                                  IH264VDEC_Handle handle,
                                  FVID2_FrameList *freeFrameList,
    -                             Bool hardFlush);
    +                             Bool hardFlush,
    +                             Bool hardReset);
     
     Int32 DecLinkMPEG4_codecFlush(DecLink_ChObj *pChObj,
                                   IMPEG4VDEC_InArgs *inArgs,
    @@ -367,7 +371,8 @@ Int32 DecLinkMPEG4_codecFlush(DecLink_ChObj *pChObj,
                                   XDM2_BufDesc *outputBufDesc,
                                   IMPEG4VDEC_Handle handle,
                                   FVID2_FrameList *freeFrameList,
    -                              Bool hardFlush);
    +                              Bool hardFlush,
    +                              Bool hardReset);
     
     
     #ifdef CODEC_ENABLE_V_MPEG2_DECODE
    @@ -378,7 +383,8 @@ Int32 DecLinkMPEG2_codecFlush(DecLink_ChObj *pChObj,
                                   XDM2_BufDesc *outputBufDesc,
                                   IMPEG2VDEC_Handle handle,
                                   FVID2_FrameList *freeFrameList,
    -                              Bool hardFlush);
    +                              Bool hardFlush,
    +                              Bool hardReset);
     #endif
     
     #ifdef SYSTEM_DEBUG_DEC
    diff --git a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_tsk.c b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_tsk.c
    index e8af469..163db61 100644
    --- a/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_tsk.c
    +++ b/dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_tsk.c
    @@ -175,6 +175,16 @@ Void DecLink_tskMain(struct Utils_TskHndl *pTsk, Utils_MsgHndl * pMsg)
                         Utils_tskAckOrFreeMsg(pMsg, status);
                     }
                     break;
    +
    +            case DEC_LINK_CMD_FLUSH_CHANNEL:
    +                {
    +                    DecLink_ChannelInfo *params = (DecLink_ChannelInfo *)Utils_msgGetPrm(pMsg);
    +
    +                    DecLink_codecFlushChannelHandler(pObj, params);
    +                    Utils_tskAckOrFreeMsg(pMsg, status);
    +                }
    +                break;
    +
                 case SYSTEM_CMD_STOP:
                     DecLink_codecStop(pObj);
                     Utils_tskAckOrFreeMsg(pMsg, status);
    -- 
    1.8.3.2