Revert "mm-video-v4l2: vidc: venc: Update color conversion decision"

This reverts commit d265a5dd03b00d726dfad5ccaa0e95939ef7ab91.

ColorConversion flag is accessing concurrently in both forward and
backward threads which is causing stability issues.
Gralloc handle in ETB is valid only when the filled Len is non zero.
Hence, verifying color format and updating color conversion variable
only buffer has valid handle.

Change-Id: Ib7e097c45503dc01dd65283950b3dc0c187f1b96
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 479c981..c92ee25 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -4505,11 +4505,14 @@
         return empty_this_buffer_proxy(hComp, buffer);
     }
 
-    /*Enable following code once private handle color format is
-      updated correctly*/
-    mUsesColorConversion = true;
-
     if (buffer->nFilledLen > 0 && handle) {
+        /*Enable following code once private handle color format is
+            updated correctly*/
+        if (handle->format == HAL_PIXEL_FORMAT_RGBA_8888)
+            mUsesColorConversion = true;
+        else
+            mUsesColorConversion = false;
+
         if (c2d_opened && handle->format != c2d_conv.get_src_format()) {
             c2d_conv.close();
             c2d_opened = false;
@@ -4531,12 +4534,10 @@
                 if (!dev_set_format(handle->format))
                     DEBUG_PRINT_ERROR("cannot set color format for RGBA8888");
 #endif
-            } else if (handle->format == HAL_PIXEL_FORMAT_NV12_ENCODEABLE &&
-                    handle->format != QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m) {
-                mUsesColorConversion = false;
-            } else {
+            } else if (handle->format != HAL_PIXEL_FORMAT_NV12_ENCODEABLE &&
+                    handle->format != QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m &&
+                    handle->format != QOMX_COLOR_FormatYVU420SemiPlanar) {
                 DEBUG_PRINT_ERROR("Incorrect color format");
-                mUsesColorConversion = false;
                 m_pCallbacks.EmptyBufferDone(hComp,m_app_data,buffer);
                 return OMX_ErrorBadParameter;
             }