title: Accessing window video memory address
body: <p>I'm writing a program to forward desktop windows through ssh in C/C++ with some significant encoding to reduce bandwidth requirements with respect to X11 forwarding. Wondering if it was possible to find a platform independent way I looked for libxcb/X11 extension functionality that could have allowed me zero-copy encoding of per window video memory with <a href="https://ffmpeg.org/libavcodec.html" rel="nofollow noreferrer">libavcodec</a> from FFmpeg. Apparently, I had no luck.
  I found two partial solutions:</p>
  <ol>
  <li>Using <a href="https://xpra.org/" rel="nofollow noreferrer">xpra</a>: it could be useful but I need to access it directly in C/C++ code and, more importantly, it's not license-wise compatible with proprietary software;</li>
  <li>Forgetting zero-copy: at least on Linux I could use <a href="https://en.wikipedia.org/wiki/MIT-SHM" rel="nofollow noreferrer">MIT-shm X11 extension</a>;</li>
  </ol>
  <p>Both of this solutions are suboptimal and are not what I'm looking for.</p>
  <p>Is there another or some set of platform independent protocols/libraries that could help me?</p>