SurfaceMediaSource: use the HW_TEXTURE usage bit

This change makes SurfaceMediaSource request Gralloc buffers with the
HW_TEXTURE usage bit rather than the VIDEO_ENCODER bit.  It is a
temporary workaround for what is likely a Gralloc bug.

Bug: 5771063
Change-Id: I9cce615e80fc14a1644fae27ba06970c262dd179
This commit is contained in:
Jamie Gennis
2011-12-15 18:14:05 -08:00
parent 481cd5a893
commit 09fc76664a

View File

@@ -336,7 +336,9 @@ status_t SurfaceMediaSource::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
(uint32_t(buffer->height) != h) ||
(uint32_t(buffer->format) != format) ||
((uint32_t(buffer->usage) & usage) != usage)) {
usage |= GraphicBuffer::USAGE_HW_VIDEO_ENCODER;
// XXX: This will be changed to USAGE_HW_VIDEO_ENCODER once driver
// issues with that flag get fixed.
usage |= GraphicBuffer::USAGE_HW_TEXTURE;
status_t error;
sp<GraphicBuffer> graphicBuffer(
mGraphicBufferAlloc->createGraphicBuffer(