简体   繁体   English

Android Kitkat 4.4.2:自适应播放对SurfaceFlinger的影响

[英]Android Kitkat 4.4.2: Adaptive Playback impact on SurfaceFlinger

I came across this generic question on Adaptive Playback in Android Kitkat in SO. 我在Android Kitkat的SO中遇到了有关自适应播放的通用问题 However, I have some specific queries as below: 但是,我有一些特定的查询,如下所示:

I am able to understand the implications on the codec and the related framework. 我能够理解对codec和相关框架的影响。 However, there is one specific point which I am unable to understand completely. 但是,有一点我无法完全理解。

In case of adaptive playback, the codec employs a metadata on it's output port which basically abstracts and packages an underlying buffer handle (in all probability a gralloc handle). 在自适应播放的情况下,编解码器会在其输出端口上使用metadata ,该metadata基本上会抽象并打包基础缓冲区句柄(很可能是gralloc句柄)。 If a resolution changes, I presume the codec updates the gralloc handle attributes directly and sends the buffer back to the OMX Client without a port settings change. 如果分辨率发生变化,我认为codec将直接更新gralloc句柄属性,并将缓冲区发送回OMX客户端,而无需更改端口设置。

My first question is: Is my understanding and assumption correct? 我的第一个问题是:我的理解和假设正确吗?

If so, how does the Surfaceflinger / SurfaceTexture know that the incoming payload is in metadata format and how does it retrieve the width and height from the underlying gralloc implementation? 如果是这样, Surfaceflinger / SurfaceTexture如何知道传入的有效载荷是metadata格式,以及它如何从底层gralloc实现中检索widthheight

Can you please point me to the relevant sources which will help me to understand this issue better? 您能否指出我相关的资源,以帮助我更好地理解这个问题?

Many thanks in advance. 提前谢谢了。

sendFormatChange=>kWhatOutputFormatChange=>MEDIA_SET_VIDEO_SIZE=> ... =>native_window_set_buffers_dimensions sendFormatChange => kWhatOutputFormatChange => MEDIA_SET_VIDEO_SIZE => ... =>本机窗口集_缓冲区大小

Just a clarification, lets use QC example, component recognize crop change - look for OMX_IndexConfigCommonOutputCrop here omx_vdec , then ACodec clears mSentFormat this makes ACodec to call sendFormatChange which sends kWhatOutputFormatChange event to NuPlayer which sends MEDIA_SET_VIDEO_SIZE to media player. 只是澄清一下,让我们使用QC示例,组件识别作物变化-在此处查找OMX_IndexConfigCommonOutputCrop omx_vdec ,然后ACodec清除mSentFormat这使ACodec调用sendFormatChange ,后者将kWhatOutputFormatChange事件发送到NuPlayer,后者将MEDIA_SET_VIDEO_SIZE发送到媒体播放器。 At the second side of stick you will get native_window_set_buffers_geometry which forces Surface::setBuffersDimensions . 在摇杆的第二侧,您将获得native_window_set_buffers_geometry ,该值强制Surface::setBuffersDimensions

While OMXCodec is used OMX_IndexConfigCommonOutputCrop received sets mOutputPortSettingsHaveChanged , nearest call of OMXCodec::read will return INFO_FORMAT_CHANGED this in AwesomePlayer will make notifyVideoSize_l to be called and this one sends to listener MEDIA_SET_VIDEO_SIZE 当使用OMX_IndexConfigCommonOutputCrop接收到的集合mOutputPortSettingsHaveChanged ,最接近的OMXCodec::read调用将返回INFO_FORMAT_CHANGED这在AwesomePlayer中将使notifyVideoSize_l被调用,并且该消息将发送到侦听器MEDIA_SET_VIDEO_SIZE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM