Color_FormatSurface实现 [英] Color_FormatSurface implementation

查看:465
本文介绍了Color_FormatSurface实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有关于Color_FormatSurface(AndroidOpaque)颜色格式的可用文档?我的视频编码器当前不支持此格式,应该添加该功能,但找不到任何内容.

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.

任何帮助将不胜感激.

推荐答案

由于不透明,因此没有文档.从编程的角度来看,这是不透明的",而不是在alpha融合的意义上.

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

不透明"格式背后的思想是,设备制造商认为最适合该设备的任何内容.在qcom设备上,YV12,NV21,RGBA,BGRA等...可能是它们古怪的格式之一.视频编码器和GPU需要在格式上达成共识,以便它们可以彼此传递表面,但是应用程序应该使用GPU来读取或写入数据.

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.

表面的格式在gralloc缓冲区元数据中指定.要读取不透明"表面,您可能需要对专有格式进行反向工程.要编写不透明"表面,您可以分配gralloc缓冲区并手动设置颜色格式...由于不透明"仅表示编码器的感觉",因此您可以自由选择,但是请记住,GPU可能会不能处理所有格式,某些格式可能比其他格式有效得多.

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.

这篇关于Color_FormatSurface实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆