libmix: refine error reporting to allow it to be enabled at any time.

BZ: 147912

The old logic only allow error reporting to be enabled in setupVA.

Change-Id: I7af6a0843a6d493e4830051938bc89e8910349c2
Signed-off-by: Dan Liang <dan.liang@intel.com>
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index 00e9d94..e231e11 100644
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -924,10 +924,6 @@
         return DECODE_MEMORY_FAIL;
     }
 
-    if (mConfigBuffer.flag & WANT_ERROR_REPORT) {
-        mErrReportEnabled = true;
-    }
-
     initSurfaceBuffer(true);
 
     if ((int32_t)profile == VAProfileSoftwareDecoding) {
diff --git a/videodecoder/VideoDecoderBase.h b/videodecoder/VideoDecoderBase.h
index 5c620d0..ae57546 100644
--- a/videodecoder/VideoDecoderBase.h
+++ b/videodecoder/VideoDecoderBase.h
@@ -64,6 +64,7 @@
     virtual Decode_Status signalRenderDone(void * graphichandler);
     virtual const VideoFormatInfo* getFormatInfo(void);
     virtual bool checkBufferAvail();
+    virtual void enableErrorReport(bool enabled = false) {mErrReportEnabled = enabled; };
 
 protected:
     // each acquireSurfaceBuffer must be followed by a corresponding outputSurfaceBuffer or releaseSurfaceBuffer.
diff --git a/videodecoder/VideoDecoderDefs.h b/videodecoder/VideoDecoderDefs.h
index ea1c9f9..d62ad15 100644
--- a/videodecoder/VideoDecoderDefs.h
+++ b/videodecoder/VideoDecoderDefs.h
@@ -104,10 +104,6 @@
 
     // indicate it's the last output frame of the sequence
     IS_EOS = 0x10000,
-
-    // indicate whether error reporting is needed
-    WANT_ERROR_REPORT = 0x20000,
-
 } VIDEO_BUFFER_FLAG;
 
 typedef enum
diff --git a/videodecoder/VideoDecoderInterface.h b/videodecoder/VideoDecoderInterface.h
index 79399c9..4c6a039 100644
--- a/videodecoder/VideoDecoderInterface.h
+++ b/videodecoder/VideoDecoderInterface.h
@@ -41,6 +41,7 @@
     virtual Decode_Status signalRenderDone(void * graphichandler) = 0;
     virtual bool checkBufferAvail() = 0;
     virtual Decode_Status getRawDataFromSurface(VideoRenderBuffer *renderBuffer = NULL, uint8_t *pRawData = NULL, uint32_t *pSize = NULL, bool internal = true) = 0;
+    virtual void enableErrorReport(bool enabled) = 0;
 };
 
 #endif /* VIDEO_DECODER_INTERFACE_H_ */