hwang
hwang

Reputation: 1

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).

And then, in

MediaCodec.Callback.onOutputBufferAvailable(),

we call

codec.releaseOutputBuffer(index,System.nanoTime())

to draw the decoded video on that surface which is passed in configure() function. 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.

Upvotes: 0

Views: 376

Answers (1)

hwang
hwang

Reputation: 1

There is no way to do that. After taking look into Nvidia Android source code and omx decoder implement; 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.

Upvotes: 0

Related Questions