[Xcb] Can XCB return an image with an NVIDIA GPU memory address?

Suhail Doshi suhail at mightycomputing.com
Tue Aug 6 05:39:11 UTC 2019


I am in touch with Nvidia & while it builds, it doesn’t run correctly for
some reason. Difficult to debug because they use a closed source per-built
lib.

That’s why I am trying to figure out how they used xcb (which it sounds
like they did).

They’re trying to figure out why. Its docs are from 2015.

On Mon, Aug 5, 2019 at 10:21 PM James Jones <jajones at nvidia.com> wrote:

> If you want to do this specifically on NVIDIA cards with NVENC, you'll
> more than likely want to be using this:
>
>    https://developer.nvidia.com/capture-sdk
>
> This will be much faster and lower latency than grabbing desktop content
> using shared memory via XCB commands.
>
> Thanks,
> -James
>
> On 8/5/19 9:49 AM, Suhail Doshi wrote:
> > Thanks so much Peter. I'll look at this stuff today.
> >
> > Question: Do you have any guidance on how to extract/use the OBS library
> > that's cross-platform? I wouldn't want to include everything that OBS
> > has to offer to keep the footprint of our application low. Any docs on
> > their API as well?
> >
> > Suhail
> >
> > --
> >
> > Founder
> >
> >
> > On Mon, Aug 5, 2019 at 9:20 AM Peter Harris <peter at harr.ca
> > <mailto:peter at harr.ca>> wrote:
> >
> >     On 2019-08-05 11:07 a.m., Suhail Doshi wrote:
> >      > My question is: Is there a way to get an image of the desktop that
> >      > returns a pointer that's GPU memory? For example, in Windows 10,
> >     there's
> >      > an API called the Desktop Duplication API which will allows you
> to do
> >      > this. Then, it lets you copy the data in that GPU memory block to
> >      > another one such that you can encode the frame with H264, for
> >     example. I
> >      > am using NVIDIA GPUs and utilizing their NVENC SDK.
> >      >
> >      > I am looking for an equivalent.
> >
> >     XCB is very low-level. For most things, you probably want to use a
> >     higher level library (such as, for example, OBS:
> >     https://github.com/obsproject/obs-studio , which includes a
> >     cross-platform library with an API that is probably closer to the
> >     Desktop Duplication API than anything in XCB).
> >
> >     With that said, if you want to implement the details yourself, you
> can
> >     take a peek inside OBS and see that the capture method that copies
> >     uncompressed pixels back to main memory uses xcb_shm_get_image (and
> >     xcb_xfixes_get_cursor_image, and xcb_xinerama_query_screens, among
> other
> >     things).
> >
> https://github.com/obsproject/obs-studio/blob/master/plugins/linux-capture/xshm-input.c
> >
> >     Peter Harris
> >
> >
> > _______________________________________________
> > Xcb mailing list
> > Xcb at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/xcb
> >
>
-- 

Suhail

--

Founder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xcb/attachments/20190805/1c9e37ba/attachment.html>


More information about the Xcb mailing list