diff options
author | Yuanjun Huang <yuanjun.huang@intel.com> | 2014-12-10 01:38:52 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-12-12 08:09:25 -0800 |
commit | 5f7a214b9c178d289f0f0dacbe35e6f58e2835a0 (patch) | |
tree | 8bdcff07f0d6672b8571b014014b7e2b7fde5113 | |
parent | 2c6fb3e28229a8b90c4a719caeb0e30b44dc0510 (diff) | |
download | psb_video-5f7a214b9c178d289f0f0dacbe35e6f58e2835a0.tar.gz |
clear video buffer that from gralloc to be black.
Bug: 18156738
BZ: 227732
Change-Id: Id2f135e3cf27a15300e19ccadd18ef257f13109f
Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
-rw-r--r-- | src/android/psb_surface_gralloc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/android/psb_surface_gralloc.c b/src/android/psb_surface_gralloc.c index 86d61c8..0d63d5e 100644 --- a/src/android/psb_surface_gralloc.c +++ b/src/android/psb_surface_gralloc.c @@ -262,6 +262,7 @@ VAStatus psb_CreateSurfacesFromGralloc( unsigned long handle; int size = num_surfaces * sizeof(unsigned int); void *vaddr[GRALLOC_SUB_BUFFER_MAX]; + unsigned char * surface_data = NULL; /* follow are gralloc-buffers */ @@ -429,6 +430,16 @@ VAStatus psb_CreateSurfacesFromGralloc( } gralloc_unlock((buffer_handle_t)handle); psb_surface->buf.user_ptr = NULL; + + if (psb_buffer_map(&psb_surface->buf, &surface_data)) { + drv_debug_msg(VIDEO_DEBUG_ERROR, "Failed to map rotation buffer before clear it"); + } + else { + size = psb_surface->chroma_offset; + memset(surface_data, 0, size); + memset(surface_data + size, 0x80, psb_surface->size - size); + psb_buffer_unmap(&psb_surface->buf); + } } pthread_mutex_unlock(&gralloc_mutex); |