Git Product home page Git Product logo

Comments (4)

ra1nty avatar ra1nty commented on September 28, 2024

Hi ianespana, thanks for trying the library out. For fullscreen applications you don't need to do anything special, just normally specify the output and device in dxcam.

The logic for alt+tab is here:

DXcam/dxcam/dxcam.py

Lines 91 to 109 in cd1c367

def _on_output_change(self):
time.sleep(0.1) # Wait for Display mode change (Access Lost)
self._duplicator.release()
self._stagesurf.release()
self._output.update_desc()
self.width, self.height = self._output.resolution
if self.region is None or not self._region_set_by_user:
self.region = (0, 0, self.width, self.height)
self._validate_region(self.region)
if self.is_capturing:
self._rebuild_frame_buffer(self.region)
self.rotation_angle = self._output.rotation_angle
while True:
try:
self._stagesurf.rebuild(output=self._output, device=self._device)
self._duplicator = Duplicator(output=self._output, device=self._device)
except comtypes.COMError as ce:
continue
break

Alt + Tab will yield a DXGI_ERROR_ACCESS_LOST error and the error is handled by releasing and recreating the IDXGIOutputDuplication interface.

from dxcam.

ra1nty avatar ra1nty commented on September 28, 2024

Also, it's worth noting that in certain applications disabling fullscreen optimizations (properties->compatibility tab) will yield a higher framerate.

from dxcam.

ianespana avatar ianespana commented on September 28, 2024

Ah, I see. So you can't exactly target a full screen application only, but it will handle the error that occurs when you alt+tab from said application

from dxcam.

ra1nty avatar ra1nty commented on September 28, 2024

What do you mean by "target"? For capturing a full-screen application you can just specify the screen that the app is on and do the capture.

from dxcam.

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.