MMFMWK-8203 [Dovi] Add support in VPU decoder for draining buffers during input format change

Drain video buffer when set_caps().
Use addaptive mode to avoid unnessary resolution change.

Signed-off-by: Song Bing <bing.song@nxp.com>
diff --git a/plugins/vpu/gstvpudecobject.c b/plugins/vpu/gstvpudecobject.c
index 2fe10d0..edeca24 100755
--- a/plugins/vpu/gstvpudecobject.c
+++ b/plugins/vpu/gstvpudecobject.c
@@ -567,6 +567,7 @@
     open_param->nChromaInterleave = 1;
     vpu_dec_object->chroma_interleaved = TRUE;
   }
+  open_param->nAdaptiveMode = 1;
   open_param->nReorderEnable = 1;
   open_param->nEnableFileMode = 0;
   open_param->nPicWidth = GST_VIDEO_INFO_WIDTH(info);
@@ -643,6 +644,8 @@
 
   if (vpu_dec_object->vpu_report_resolution_change == FALSE \
       && vpu_dec_object->state >= STATE_REGISTRIED_FRAME_BUFFER) {
+    /* drain output */
+    gst_vpu_dec_object_decode (vpu_dec_object, bdec, NULL);
     dec_ret = VPU_DecClose(vpu_dec_object->handle);
     if (dec_ret != VPU_DEC_RET_SUCCESS) {
       GST_ERROR_OBJECT(vpu_dec_object, "closing decoder failed: %s", \