Code Monkey home page Code Monkey logo

Comments (8)

robmikh avatar robmikh commented on July 18, 2024

Yea it should work. Can you share which build of Windows you're trying this on as well as the error code inside the hresult_error object?

from windows.ui.composition-win32-samples.

rjx-ray avatar rjx-ray commented on July 18, 2024

I'm running on Windows 11 Pro 22H2 SDK 10.0.19041.685

I'm having trouble getting the error code- this isn't working
image
CreateForWindow doesn't return, I just see
image
Its complicated by the fact that I'm running the capture in a DLL as the main project can't use WinRT. The call stack is
image

from windows.ui.composition-win32-samples.

robmikh avatar robmikh commented on July 18, 2024

Usually this happens because the window you're trying to capture is deemed non-capturable by the shell. Is it always the same window? Does it work if you attempt to capture that window first?

Does this sample work for you for successive window captures?

from windows.ui.composition-win32-samples.

rjx-ray avatar rjx-ray commented on July 18, 2024

So if I try and capture the second window first I get the exception straight away.
I'll investigate the differences between the windows tomorrow.

What could make a window non-capturable?

from windows.ui.composition-win32-samples.

robmikh avatar robmikh commented on July 18, 2024

The general rule of thumb is anything that shows up in the Alt+Tab view is considered capturable.

from windows.ui.composition-win32-samples.

rjx-ray avatar rjx-ray commented on July 18, 2024

Thanks for your help. I can now do the successive captures.
But its pretty slow, averaging ~10fps and I'm having to wait up to 100ms for the new frame. I guess that's to be expected.
Is it possible to run multiple simultaneous capture instances?

from windows.ui.composition-win32-samples.

robmikh avatar robmikh commented on July 18, 2024

I'm a little surprised you're seeing that kind of performance. What hardware are you running on?

Yes, you should be able to run more than one capture at once. There is a bug in Windows 10 when running multiple captures from the same GraphicsCaptureItem object though.

from windows.ui.composition-win32-samples.

rjx-ray avatar rjx-ray commented on July 18, 2024

Just to say that our main app can now use WinRT and I don't need to run the capture in a DLL any more. All these issues have now gone away and I can do multiple simultaneous captures at full speed

from windows.ui.composition-win32-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.