title: Decode video in Raspberry Pi without using OpenMAX?
body: <p>I am looking for an example of decoding video on Raspberry Pi <em>directly</em>, without using OpenMAX.  </p>
  
  <p>This explains the different layers of multimedia software:</p>
  
  <p><img src="https://i.stack.imgur.com/MzvWI.png" alt="Raspberry Pi Architecture"></p>
  
  <p>There is an additional layer which is not shown in here, the "<a href="https://github.com/raspberrypi/userland/blob/master/interface/mmal/mmal.h" rel="nofollow noreferrer">MMAL</a>" layer which is (I believe) a Broadcom wrapper around OpenMAX.  (If not, it would be an OpenMAX alternative, sitting on top of the kernel driver)  raspivid and raspistill for example are written using MMAL.</p>
  
  <p>I want an example of video decode where the input is raw H.264, and the output is either video in memory or video on screen.  I want to do this <strong>using VCHIQ directly</strong>, not using OpenMAX.  (Mainly for performance and flexibility reasons)</p>
  
  <p>This github repository: <a href="https://github.com/raspberrypi/userland/" rel="nofollow noreferrer">https://github.com/raspberrypi/userland/</a> contains the source for everything shown above (the orange and green boxes; source for VCHIQ itself, OpenMAX IL implementation on top of VCHIQ, also OpenGL and EGL implementations, ...).  So in theory it should be enough to get started.  The problem is that it is highly non-obvious how to use it, even if one is very familiar with OpenMAX and with multimedia frameworks in general.</p>
  
  <p>For example: <a href="https://github.com/raspberrypi/userland/blob/master/interface/vchiq_arm/vchiq_if.h" rel="nofollow noreferrer">vchiq_bulk_transmit</a>() seems to be the function that one would use to send video to the decoder.  But how to initialize the first argument of type <code>VCHIQ_SERVICE_HANDLE_T</code>?  Where do the results go, in the framebuffer, or in a result handle, or... ?</p>
  
  <p><em>EDIT</em> The bounty can be collected by either providing a working example of video decode using vchiq, an API walkthrough that shows the calling sequence (even though not a working example) or a pointer to sufficient documentation to write this.  A working example will get a hefty extra bounty :)</p>