mm-video-v4l2: vdec: disable timestamp reorder

Timestamp reorder is used for arbitrary bytes mode, which
has been moved to parser side, so also disable timestamp
reorder in HAL.

CRs-Fixed: 2584798
Change-Id: Iad9bef4310974bc637c4730c6429bf95246213e2
Signed-off-by: Chandrakant I Viraktamath <civirakt@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
index f07537f..539ce60 100644
--- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
@@ -1091,7 +1091,6 @@
         };
         meta_buffer meta_buff;
         OMX_PARAM_PORTDEFINITIONTYPE m_port_def;
-        omx_time_stamp_reorder time_stamp_dts;
         desc_buffer_hdr *m_desc_buffer_ptr;
         bool secure_mode;
         bool allocate_native_handle;
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
index 8e33739..1b972c2 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -1050,13 +1050,6 @@
                         DEBUG_PRINT_ERROR("OMX_COMPONENT_GENERATE_EBD failure");
                         pThis->omx_report_error ();
                     } else {
-                        if (p2 == VDEC_S_INPUT_BITSTREAM_ERR && p1) {
-                            pThis->time_stamp_dts.remove_time_stamp(
-                                    ((OMX_BUFFERHEADERTYPE *)(intptr_t)p1)->nTimeStamp,
-                                    (pThis->drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
-                                    ?true:false);
-                        }
-
                         if ( pThis->empty_buffer_done(&pThis->m_cmp,
                                     (OMX_BUFFERHEADERTYPE *)(intptr_t)p1) != OMX_ErrorNone) {
                             DEBUG_PRINT_ERROR("empty_buffer_done failure");
@@ -1064,16 +1057,6 @@
                         }
                     }
                     break;
-                case OMX_COMPONENT_GENERATE_INFO_FIELD_DROPPED: {
-                                            int64_t *timestamp = (int64_t *)(intptr_t)p1;
-                                            if (p1) {
-                                                pThis->time_stamp_dts.remove_time_stamp(*timestamp,
-                                                        (pThis->drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
-                                                        ?true:false);
-                                                free(timestamp);
-                                            }
-                                        }
-                                        break;
                 case OMX_COMPONENT_GENERATE_FBD:
                                         if (p2 != VDEC_S_SUCCESS) {
                                             DEBUG_PRINT_ERROR("OMX_COMPONENT_GENERATE_FBD failure");
@@ -2746,7 +2729,6 @@
             empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p1);
         }
     }
-    time_stamp_dts.flush_timestamp();
     /*Check if Heap Buffers are to be flushed*/
     pthread_mutex_unlock(&m_lock);
     input_flush_progress = false;
@@ -5017,7 +4999,6 @@
     buffer->pMarkData = (OMX_PTR)(unsigned long)m_etb_count;
     post_event ((unsigned long)hComp,(unsigned long)buffer,OMX_COMPONENT_GENERATE_ETB);
 
-    time_stamp_dts.insert_timestamp(buffer);
     return OMX_ErrorNone;
 }
 
@@ -6110,21 +6091,6 @@
     }
 #endif
 
-    /* For use buffer we need to copy the data */
-    if (!output_flush_progress) {
-        /* This is the error check for non-recoverable errros */
-        bool is_duplicate_ts_valid = true;
-        bool is_interlaced = (drv_ctx.interlace != VDEC_InterlaceFrameProgressive);
-
-        if (output_capability == V4L2_PIX_FMT_MPEG4 ||
-                output_capability == V4L2_PIX_FMT_MPEG2)
-            is_duplicate_ts_valid = false;
-
-        if (buffer->nFilledLen > 0) {
-            time_stamp_dts.get_next_timestamp(buffer,
-                    is_interlaced && is_duplicate_ts_valid && !is_mbaff);
-        }
-    }
     VIDC_TRACE_INT_LOW("FBD-TS", buffer->nTimeStamp / 1000);
 
     if (m_cb.FillBufferDone) {
@@ -6382,17 +6348,6 @@
             omx->post_event ((unsigned long)omxhdr,vdec_msg->status_code,
                     OMX_COMPONENT_GENERATE_EBD);
             break;
-        case VDEC_MSG_EVT_INFO_FIELD_DROPPED:
-            int64_t *timestamp;
-            timestamp = (int64_t *) malloc(sizeof(int64_t));
-            if (timestamp) {
-                *timestamp = vdec_msg->msgdata.output_frame.time_stamp;
-                omx->post_event ((unsigned long)timestamp, vdec_msg->status_code,
-                        OMX_COMPONENT_GENERATE_INFO_FIELD_DROPPED);
-                DEBUG_PRINT_HIGH("Field dropped time stamp is %lld",
-                        (long long)vdec_msg->msgdata.output_frame.time_stamp);
-            }
-            break;
         case VDEC_MSG_RESP_OUTPUT_FLUSHED:
         case VDEC_MSG_RESP_OUTPUT_BUFFER_DONE: {
            v4l2_buf_ptr = (v4l2_buffer*)vdec_msg->msgdata.output_frame.client_data;
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
index 0266d62..e9e49a1 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
@@ -923,7 +923,6 @@
                                          pic_order = V4L2_MPEG_MSM_VIDC_DISABLE;
                                      } else if (pictureOrder->eOutputPictureOrder == QOMX_VIDEO_DECODE_ORDER) {
                                          pic_order = V4L2_MPEG_MSM_VIDC_ENABLE;
-                                         time_stamp_dts.set_timestamp_reorder_mode(false);
                                      } else
                                          eRet = OMX_ErrorBadParameter;
                                      if (eRet == OMX_ErrorNone) {
@@ -1045,22 +1044,9 @@
 #endif //ALLOCATE_OUTPUT_NATIVEHANDLE
 #endif
         case OMX_QcomIndexParamEnableTimeStampReorder: {
-                                       VALIDATE_OMX_PARAM_DATA(paramData, QOMX_INDEXTIMESTAMPREORDER);
-                                       QOMX_INDEXTIMESTAMPREORDER *reorder = (QOMX_INDEXTIMESTAMPREORDER *)paramData;
-                                       if (drv_ctx.picture_order == (vdec_output_order)QOMX_VIDEO_DISPLAY_ORDER) {
-                                           if (reorder->bEnable == OMX_TRUE) {
-                                               frm_int =0;
-                                               time_stamp_dts.set_timestamp_reorder_mode(true);
-                                           } else
-                                               time_stamp_dts.set_timestamp_reorder_mode(false);
-                                       } else {
-                                           time_stamp_dts.set_timestamp_reorder_mode(false);
-                                           if (reorder->bEnable == OMX_TRUE) {
-                                               eRet = OMX_ErrorUnsupportedSetting;
-                                           }
-                                       }
-                                   }
-                                   break;
+            DEBUG_PRINT_HIGH("timestamp reorder not supported anymore, arbitrary bytes mode has been moved to parser.");
+            break;
+        }
         case OMX_IndexParamVideoProfileLevelCurrent: {
             VALIDATE_OMX_PARAM_DATA(paramData, OMX_VIDEO_PARAM_PROFILELEVELTYPE);
             OMX_VIDEO_PARAM_PROFILELEVELTYPE *pParam = (OMX_VIDEO_PARAM_PROFILELEVELTYPE*)paramData;