编码器的bufferQueue报错?

04-19 18:15:58.074  1611  5120 E C01401/Bufferqueue: [nodict]<514>CheckBufferConfig: width or height is greater than 0, now is w 0 h 0
04-19 18:15:58.074  1611  5120 E C01401/Bufferqueue: [nodict](HEncoderSurface) AllocBuffer: Failure [1669], Reason: Alloc failed, then <400 invalid arguments>
04-19 18:15:58.074  1611  5120 E C01401/Bufferqueue: [nodict](HEncoderSurface) RequestBuffer: Fail to alloc or map Buffer[0 0] ret: 40001000, id: 6919192313868
04-19 18:15:58.074 19365 19554 E C01401/Bufferqueue: [nodict]<115>NativeWindowRequestBuffer: API failed, please check RequestBuffer function ret:40001000, Queue Id:6919192313868
04-19 18:15:58.074 19365 19554 E A0FF00/Xhey:C:EglRenderContext: EglRenderContext::SwapBuffers: Failed to SwapBuffers on EGLSurface 1, error is EGL_SUCCESS.

代码按照:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/video-encoding-0000001822162721\#ZH-CN\_TOPIC\_0000001811157774\_\_buffer%E6%A8%A1%E5%BC%8F描述的走Surface模式,通过opengl 走buffer模式,通过OH\_VideoEncoder\_GetSurface获得nativeWindow, 通过eglCreateWindowSurface创建surface ,之后和camera的纹理进行swap, 但是bufferQueue报错。

阅读 763
1 个回答

Fail to alloc or map Buffer[0 0] 需要初始化一下窗口的宽和高

(void)oH_NativeWindow_NativeWindowHandleOpt(nativeWindOW_, SET_BUFFER _GEOMETRY,static castint>(width),static_cast<int>(height));
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进