How to connect Android MediaCodec Surface to Vulkan

I have a pretty good understanding of decoding using Android MediaCodec and loading YUV through the surface into an OpenGL texture. I would like to do something similar with Vulcan. However, I could not find the documentation or sample code.

My question is: how to connect the next pipeline?

MediaCodec Video Decoder ⇨ Surface ⇨ texture ⇨ Vulkan

More details

OpenGL Comparison

For comparison, in the case of OpenGL, Android Surface is built and used.

 textureId = glGenTextures( &textureId )
 surface = new Surface( new SurfaceTexture( textureId ) )
 mediaCodec.configure( surface )
+4
source share
2 answers

FYI: Android.

Vulkan vkCreateImage. OpenGL ES ( vkAllocateMemory vkBindImageMemory).

. -, SurfaceTexture ().

, Vulkan, . VK_KHX_external_memory Vulkan. , , Android SurfaceTexture Vulkan .

, SurfaceTexture . , , "" Vulkan OpenGL ES. :

  • UPDATE:
  • , , ()
  • , , , API linux Android.

, , .
:

1) , MediaCodec ByteBuffer Surface. ByteBuffer raw bytes[].

2) VkImages VkBuffer. ( , ). ( ).

3) (vkMapMemory) ByteBuffer, MediaCodec.

4) , vkCmdCopyBufferToImage Vulkan.

( ), , , .

+2

, Vulkan Vulkan SDK, Surface. VK_KHX_external_memory , .

+2

Source: https://habr.com/ru/post/1675220/


All Articles