这是一个创建于 1329 天前的主题,其中的信息可能已经有所发展或是发生改变。
如何解决着急!!!!!!!
// 调用第三方美颜算法( mMHBeautyManager.render ) 返回新的 textureId
// textureId 生成 VideoFrame
// s.onFrame()
// 报错
11-24 16:01:59.673: E/org.webrtc.Logging(25509): MediaCodecVideoEncoder: encodeTexture failed
11-24 16:01:59.673: E/org.webrtc.Logging(25509): MediaCodecVideoEncoder: java.lang.RuntimeException: glUseProgram: GLES20 error: 1282
11-24 16:01:59.676: E/org.webrtc.Logging(25509): MediaCodecVideoEncoder: java.lang.RuntimeException: glUseProgram: GLES20 error: 1282
11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlUtil.checkNoGLES2Error(GlUtil.java:29)
11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlShader.useProgram(GlShader.java:110)
11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlRectDrawer.prepareShader(GlRectDrawer.java:195)
11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlRectDrawer.drawOes(GlRectDrawer.java:118)
11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.MediaCodecVideoEncoder.encodeTexture(MediaCodecVideoEncoder.java:592)
// 关键代码如下
val buffer = p0.buffer as TextureBuffer
val textureId = mMHBeautyManager.render(
buffer.textureId,
buffer.width,
buffer.height,1,1
)
val textureBufferImpl= TextureBufferImpl(
buffer.width,
buffer.height,
buffer.type,
textureId,
buffer.transformMatrix,
surfaceTextureHelper?.handler,
yuvConverter,
null
)
val new = VideoFrame(textureBufferImpl, 270, System.nanoTime())
s.onFrame(new)