title: AVFrame: How to get/replace plane data buffer(s) and size?
body: <p>I'm working on gstreamer1.0-libav (1.6.3), trying to port custom FPGA based H264 video acceleration from gstreamer 0.10. </p>
  
  <p>The data planes (YUV) used to be allocated by a simple malloc back in gstreamer 0.10, so we simply replaced the AVFrame.data[i] pointers by pointers to memory in our video acceleration core. It seems to be MUCH more complicated in gstreamer 1.12. </p>
  
  <p>For starters, I tried copying the YUV planes from AVFrame.data[i] to a separate buffer - which worked fine! Since I haven't seen an immediate way to obtain the size of AVFrame.data[i] and I recognized that data[0], data[1], data[2] seem to be in a single continuous buffer, I simply used (data[1] - data [0]) for the size of the Y plane and (data[2] - data[1]) for the sizes of the U/V planes respectively. This works fine, expect for one scenario:</p>
  
  <ul>
  <li>Input H264 stream with resolution of 800x600 or greater</li>
  <li>The camera is covered (jacket, hand, ...)</li>
  </ul>
  
  <p>This causes a SEGFAULT in the memcpy of the V plane (data[2]) using the sizes determined as described above. Before covering the camera, the stream is displayed completely fine ... so for some reason the dark screen changes the plane sizes?</p>
  
  <p>My ultimate goal is replacing the data[i] pointers allocated by gstreamer by my custom memory allocation (for futher processing) ... where exactly are these buffers assigned, can I change them and how can I obtain the size of each plane (data[0], data[1], data[2])?</p>