OpenHarmony开发者论坛

标题: Xcomponent如何获取OHNativeWindow以便解码器输出送显? [打印本页]

作者: m0_63192735    时间: 2024-9-10 11:26
标题: Xcomponent如何获取OHNativeWindow以便解码器输出送显?
[md]### 【问题描述】

1. 介绍问题现象和发生的背景   Xcomponent如何获取OHNativeWindow以便解码器输出送显?
2. 相关的代码(请勿使用截图)
3. 运行结果、错误截图
4. 我尝试过的解决方法和结果
5. 我想要达到的结果

### 【运行环境】

硬件:
ROM版本:
DevEvoStudio版本:4.1
SDK版本:11
[/md]
作者: kuaile    时间: 7 天前
你好,可以从native侧的生命周期等回调中获取native window句柄
作者: m0_63192735    时间: 前天 09:43
回复 kuaile: 你好,我在native侧的回调获取native Window句柄的时候,遇到这个问题:        OHNativeWindowBuffer *buffer = nullptr;
        int fenceFd;
        // 通过 OH_NativeWindow_NativeWindowRequestBuffer 获取 OHNativeWindowBuffer 实例
        ret = OH_NativeWindow_NativeWindowRequestBuffer(nativeWindow, &buffer, &fenceFd);
这个操作会报错 OH_NativeWindow_NativeWindowRequestBuffer ret = 40601000。


这是具体的日志
作者: m0_63192735    时间: 前天 09:43
回复 kuaile: 这是具体的日志01-01 08:57:08.883   7308-7335    C03f00/MUSL-LDSO               pid-7308              E     do_dlsym failed: symbol not found. so=/vendor/lib/chipsetsdk/libEGL_impl.so s=glEndQuery v=
01-01 08:57:08.883   7272-7272    A01027/ScreenTag               pid-7272              I     test 1.5
01-01 08:57:08.883   7272-7272    A01027/ScreenTag               pid-7272              I     OnSurfaceCreatedCB start
01-01 08:57:08.883   7272-7272    A01027/ScreenTag               pid-7272              I     OH_NativeXComponent_GetXComponentId id = xcomponent_test_id
01-01 08:57:08.883   7308-7335    C03f00/MUSL-LDSO               pid-7308              E     do_dlsym failed: symbol not found. so=/vendor/lib/chipsetsdk/libEGL_impl.so s=glGetQueryiv v=
01-01 08:57:08.883   7272-7272    A01027/ScreenTag               pid-7272              I     OH_NativeXComponent_GetXComponentSize, width = 320, height = 240
01-01 08:57:08.883   7272-7272    A01027/ScreenTag               pid-7272              I     OH_NativeWindow_NativeWindowHandle Opt ret = 0 , code = 0
01-01 08:57:08.883   2369-2988    C01401/Bufferqueue             render_service        E     <516>CheckBufferConfig: width or height is greater than 0, now is w 320 h 0
01-01 08:57:08.883   2369-2988    C01401/Bufferqueue             render_service        E     (xcomponent_test_idSurface) AllocBuffer: Failure [71], Reason: Alloc failed, then <400 invalid arguments>
01-01 08:57:08.883   2369-2988    C01401/Bufferqueue             render_service        E     (xcomponent_test_idSurface) RequestBuffer: Fail to alloc or map Buffer[320 0] ret: 40001000, id: 10174777524281
01-01 08:57:08.884   7308-7335    C03f00/MUSL-LDSO               pid-7308              E     do_dlsym failed: symbol not found. so=/vendor/lib/chipsetsdk/libEGL_impl.so s=glGetQueryObjectuiv v=
01-01 08:57:08.884   7272-7272    C01401/Bufferqueue             pid-7272              E     <115>NativeWindowRequestBuffer: API failed, please check RequestBuffer function ret:40001000, Queue Id:10174777524281
01-01 08:57:08.884   7272-7272    A01027/ScreenTag               pid-7272              I     OH_NativeWindow_NativeWindowRequestBuffer ret = 40601000
01-01 08:57:08.884   7272-7272    A01027/ScreenTag               pid-7272              I     OnSurfaceCreatedCB finish
作者: kuaile    时间: 前天 17:53
回复 m0_63192735: 01-01 08:57:08.883   2369-2988    C01401/Bufferqueue             render_service        E     <516>CheckBufferConfig: width or height is greater than 0, now is w 320 h 0                   高度不合法
作者: m0_63192735    时间: 昨天 09:15
回复 kuaile: 具体可能是什么原因造成的勒?我最开始设置的是320*240,用api接口获取size也是正常的




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5