libmix: fix GEN vaCreateSurfaces not workable issue on BYT
BZ: 145088
set flag for attribute and switch pixel_format to VA_FOURCC_NV12
Need pass VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC as flag.
Also need set pixel format as FOURCC, not HAL format.
Change-Id: Ib6cd1d7c77cf3483a367b4e6d9ba6312ae181d65
Signed-off-by: Fei Jiang <fei.jiang@intel.com>
Reviewed-on: http://android.intel.com:8080/138145
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
diff --git a/videodecoder/VideoDecoderBase.cpp b/videodecoder/VideoDecoderBase.cpp
index 79e33b7..06fa57a 100755
--- a/videodecoder/VideoDecoderBase.cpp
+++ b/videodecoder/VideoDecoderBase.cpp
@@ -819,7 +819,7 @@
return DECODE_MEMORY_FAIL;
}
mVASurfaceAttrib->num_buffers = mNumSurfaces;
- mVASurfaceAttrib->pixel_format = mConfigBuffer.graphicBufferColorFormat;
+ mVASurfaceAttrib->pixel_format = VA_FOURCC_NV12;
mVASurfaceAttrib->width = mVideoFormatInfo.width;
mVASurfaceAttrib->height = mVideoFormatInfo.height;
mVASurfaceAttrib->data_size = mConfigBuffer.graphicBufferStride * mVideoFormatInfo.height * 1.5;
@@ -833,7 +833,7 @@
mVASurfaceAttrib->offsets[2] = 0;
mVASurfaceAttrib->offsets[3] = 0;
mVASurfaceAttrib->private_data = (void *)mConfigBuffer.nativeWindow;
- mVASurfaceAttrib->flags = 0;
+ mVASurfaceAttrib->flags = VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC;
for (int i = 0; i < mNumSurfaces; i++) {
mVASurfaceAttrib->buffers[i] = (unsigned int )mConfigBuffer.graphicBufferHandler[i];