简体   繁体   English

MediaCodec作为解码器,用于将解码后的数据发送到两个表面。 如何避免大量中继数据复制?

[英]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.

相关问题 从Mediacodec同步解码的音频和视频数据 - Synchronise Decoded Audio and Video data from Mediacodec MediaCodec编码数据太大 - MediaCodec encode data too big 如何在Android上将MediaCodec解码的图像数据(YUV420SP)实时渲染到SurfaceView? - How to real-timely render Image Data(YUV420SP) decoded by MediaCodec to SurfaceView on Android? Android MediaCodec,可以解码原始大小两倍的数据吗? - Android MediaCodec, is it ok to have decoded data of double size of the original? MediaCodec-如何同步同步混合来自两个Decoder MediaCodec对象的音频样本? - MediaCodec - How do I mix audio samples from two Decoder MediaCodec objects in sync? MediaCodec - 编码器的输入 Surface 可以从两个解码器的输出 Surface 接收 SurfaceTextures 吗? - MediaCodec - can an encoder's input Surface receive SurfaceTextures from two decoders' output Surfaces? 是否可以/如何将MediaCodec解码帧直接馈送到MediaCodec编码器? - Is it possible/how to feed MediaCodec decoded frames to MediaCodec encoder directly? 如何不按顺序显示解码的MediaCodec帧 - How to display decoded MediaCodec frames out of order Android MediaCodec如何创建解码器? - How does Android MediaCodec create a decoder? 我们可以通过推送通知发送多少数据? - How much data we can send through push notifications?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM