Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color_FormatSurface implementation

Is there any available documentation about Color_FormatSurface (AndroidOpaque) color format? My video encoder currently does not support this format, and I am supposed to add that feature, but I cannot find anything about it.

Any help would be appreciated.

like image 663
Rajko Avatar asked Mar 18 '23 08:03

Rajko


1 Answers

There is no documentation on it, because it is opaque. That's "opaque" in the programming sense, not the alpha-blending sense.

The idea behind the "opaque" format is that it's whatever the device manufacturer decides is most appropriate for the device. YV12, NV21, RGBA, BGRA, whatever... on qcom devices it's probably one of their wacky formats. The video encoder and the GPU need to agree on what the format is, so that they can pass surfaces to each other, but applications are expected to use the GPU to read or write the data.

The surface's format is specified in the gralloc buffer meta-data. To read an "opaque" surface you might need to reverse-engineer a proprietary format. To write an "opaque" surface you can allocate a gralloc buffer and set the color format manually... since "opaque" just means "whatever the encoder feels like", you have some freedom of choice, but bear in mind that GPUs may not handle all formats, and some formats may be handled significantly more efficiently than others.

like image 116
fadden Avatar answered Apr 02 '23 21:04

fadden