In our use case we need to dynamically enable/disable bframes, so we call Venc_setDynamicParam(.. VENC_BFRAME_RATE) to change the interFrameInterval as needed while the encoder channel is enabled.
After calling Venc_setDynamicParam a number of times (usually 3 when interFrameInterval==3), it looks like all the input frames are tied up in the encoder.
EncLink_h264EncoderFlush() is being called in encLink_h264.c when the interFrameInterval is changed, but it doesn't look like it is actually flushing the buffers from the encoder.
If I #undef ENC_LINK_ENABLE_APP_BUFFER_TRACKING_FOR_H264 in encLink_priv.h, then I no longer have the problem.
Index: dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_priv.h =================================================================== --- dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_priv.h (revision 474) +++ dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_priv.h (working copy) @@ -198,7 +198,7 @@ /** @brief Internal - This macro should be enabled always to have input buffer tracking logic in application
* for H.264 B frame data flow. There is a random hang observed (HDVICP code corruption) with FLUSH.
* XDM_FLUSH following by process calls is required to unlock buffers which doesnt seem to work reliably.
* App tracks input buffers to / from codec to avoid buffer locking & does not invoke FLUSH on parameter changes
*/ -#define ENC_LINK_ENABLE_APP_BUFFER_TRACKING_FOR_H264 +//#define ENC_LINK_ENABLE_APP_BUFFER_TRACKING_FOR_H264 /* *****************************************************************************
From the comments above the define, I imagine #undef this will cause other problems though.