[英]MediaCodec as decoder to send decoded data to two surfaces. How can we avoid big trunk data copy?
To configure a decoder, we call 要配置解码器,我们称
decoder.configure(format,surface, crypto,flags)
. decoder.configure(format,surface, crypto,flags)
。
And then, in 然后,在
MediaCodec.Callback.onOutputBufferAvailable()
, MediaCodec.Callback.onOutputBufferAvailable()
,
we call 我们称之为
codec.releaseOutputBuffer(index,System.nanoTime())
to draw the decoded video on that surface which is passed in configure() function. 在该表面上绘制解码的视频,该视频在configure()函数中传递。 Do we have a way to send that output buffer to another surface which is created by an encoder from
我们是否有办法将输出缓冲区发送到另一个表面,该表面由编码器从
MediaCodec.createInputSurface()
to avoid big trunk data copy. 避免大量中继数据复制。
There is no way to do that. 没有办法做到这一点。 After taking look into Nvidia Android source code and omx decoder implement;
研究完Nvidia的Android源代码和omx解码器工具之后; if we need to send data into two surfaces, we have to use native DMA memory copy functions from manufacturer, or using native omx decoder directly.
如果需要将数据发送到两个表面,则必须使用制造商提供的本地DMA内存复制功能,或直接使用本地omx解码器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.