#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <binder/IPCThreadState.h>
#include <android/native_window.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/ISurfaceComposer.h>
#include <ui/DisplayStatInfo.h>
int main (int argc, char *argv[]) {
long tOSDWidth = 0;
long tOSDHeight = 0;
sp<IServiceManager> sm = defaultServiceManager();
sp<ISurfaceComposer> composer = interface_cast<ISurfaceComposer>(sm->checkService(String16("SurfaceFlinger")));
//FIXME
tOSDWidth = 1920;
tOSDHeight = 1080;
if (composer != NULL){
DisplayStatInfo stats;
status_t res = composer->getDisplayStats(NULL , &stats);
if (res == NO_ERROR){
ALOGI("OSD width=%d height=%d", stats.displayWidth, stats.displayHeight);
tOSDWidth = stats.displayWidth;
tOSDHeight
Display by SurfaceComposerClient
最新推荐文章于 2025-09-04 17:24:16 发布
本文档展示了如何通过SurfaceComposerClient获取DisplayStatInfo,并创建SurfaceControl进行图形数据操作。主要涉及SurfaceFlinger服务、显示宽度和高度的获取、Surface层次设置以及缓冲区配置。

最低0.47元/天 解锁文章
1014

被折叠的 条评论
为什么被折叠?



