Gralloc: add a usage bit for video encoding

This change adds a new Gralloc usage bit to indicate that a buffer will
be passed to the HW video encoder.

Change-Id: I75c3fc514906e5b18fb60345a2d9c5a606403633
This commit is contained in:
Jamie Gennis
2011-11-21 16:50:49 -08:00
parent fb410365ca
commit 29ead941b3

View File

@@ -47,40 +47,42 @@ __BEGIN_DECLS
enum { enum {
/* buffer is never read in software */ /* buffer is never read in software */
GRALLOC_USAGE_SW_READ_NEVER = 0x00000000, GRALLOC_USAGE_SW_READ_NEVER = 0x00000000,
/* buffer is rarely read in software */ /* buffer is rarely read in software */
GRALLOC_USAGE_SW_READ_RARELY = 0x00000002, GRALLOC_USAGE_SW_READ_RARELY = 0x00000002,
/* buffer is often read in software */ /* buffer is often read in software */
GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003, GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003,
/* mask for the software read values */ /* mask for the software read values */
GRALLOC_USAGE_SW_READ_MASK = 0x0000000F, GRALLOC_USAGE_SW_READ_MASK = 0x0000000F,
/* buffer is never written in software */ /* buffer is never written in software */
GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000, GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000,
/* buffer is never written in software */ /* buffer is never written in software */
GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020, GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020,
/* buffer is never written in software */ /* buffer is never written in software */
GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030, GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030,
/* mask for the software write values */ /* mask for the software write values */
GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0, GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0,
/* buffer will be used as an OpenGL ES texture */ /* buffer will be used as an OpenGL ES texture */
GRALLOC_USAGE_HW_TEXTURE = 0x00000100, GRALLOC_USAGE_HW_TEXTURE = 0x00000100,
/* buffer will be used as an OpenGL ES render target */ /* buffer will be used as an OpenGL ES render target */
GRALLOC_USAGE_HW_RENDER = 0x00000200, GRALLOC_USAGE_HW_RENDER = 0x00000200,
/* buffer will be used by the 2D hardware blitter */ /* buffer will be used by the 2D hardware blitter */
GRALLOC_USAGE_HW_2D = 0x00000400, GRALLOC_USAGE_HW_2D = 0x00000400,
/* buffer will be used by the HWComposer HAL module */ /* buffer will be used by the HWComposer HAL module */
GRALLOC_USAGE_HW_COMPOSER = 0x00000800, GRALLOC_USAGE_HW_COMPOSER = 0x00000800,
/* buffer will be used with the framebuffer device */ /* buffer will be used with the framebuffer device */
GRALLOC_USAGE_HW_FB = 0x00001000, GRALLOC_USAGE_HW_FB = 0x00001000,
/* buffer will be used with the HW video encoder */
GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000,
/* mask for the software usage bit-mask */ /* mask for the software usage bit-mask */
GRALLOC_USAGE_HW_MASK = 0x00001F00, GRALLOC_USAGE_HW_MASK = 0x00011F00,
/* buffer should be displayed full-screen on an external display when /* buffer should be displayed full-screen on an external display when
* possible * possible
*/ */
GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000, GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000,
/* Must have a hardware-protected path to external display sink for /* Must have a hardware-protected path to external display sink for
* this buffer. If a hardware-protected path is not available, then * this buffer. If a hardware-protected path is not available, then
@@ -88,14 +90,14 @@ enum {
* external sink, or (less desirable) do not route the entire * external sink, or (less desirable) do not route the entire
* composition to the external sink. * composition to the external sink.
*/ */
GRALLOC_USAGE_PROTECTED = 0x00004000, GRALLOC_USAGE_PROTECTED = 0x00004000,
/* implementation-specific private usage flags */ /* implementation-specific private usage flags */
GRALLOC_USAGE_PRIVATE_0 = 0x10000000, GRALLOC_USAGE_PRIVATE_0 = 0x10000000,
GRALLOC_USAGE_PRIVATE_1 = 0x20000000, GRALLOC_USAGE_PRIVATE_1 = 0x20000000,
GRALLOC_USAGE_PRIVATE_2 = 0x40000000, GRALLOC_USAGE_PRIVATE_2 = 0x40000000,
GRALLOC_USAGE_PRIVATE_3 = 0x80000000, GRALLOC_USAGE_PRIVATE_3 = 0x80000000,
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000,
}; };
/*****************************************************************************/ /*****************************************************************************/