Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScreenGear: Added support for DXcam backend on Windows (Fixes #316) #365

Merged
merged 7 commits into from
Jul 6, 2023

Conversation

abhiTronix
Copy link
Owner

@abhiTronix abhiTronix commented Jul 4, 2023

Brief Description

This PR will implement dxcam backend support in ScreenGear API for Windows machines.

Requirements / Checklist

Related Issue

#316
#359

Context

This PR aimed at supporting DXcam backend so that framerate can be greatly improved on Windows machine. This PR will also remove Threaded Queue mode for ScreenGear API.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

- 🎉 Added initial `dxcam` support for Windows machines. (Fixes #316)
  - ✨ Implemented complete workflow for dxcam backend.
  - 🏗️ `dxcam` is now the default backend for Windows machine.
  - ✨ Added support for tuple value in monitor to specify device and output indexes as `(int[device_idx], int[output_idx])` in dxcam backend only.
    - 🧑‍💻 `int` index is also allowed as value for selecting device index.
  - ⚡️ Added support for variable screen dimensions, to capture an area from screen.
  - 🚩 Added `dxcam_target_fps` optional flag to control target fps in dxcam. Defaults to `0`(disabled).
  - ⚡️ RGB frames from dxcam is converted into BGR automatically.
  - ⚡️ For better performance, `video_mode` is enabled by default.
  - ➕ Added necessary imports.
  - ♻️ Refactored code blocks to ensure backward compatibility.
- 💥 Enforced threaded queue mode is now removed completely, there might be boost in performance.
  - 💬 Reason: The IO is automatically blocked by screen refresh rate, so adding overhead of maintaining separate queue is pointless.
  - 💥 Removed `THREAD_TIMEOUT` optional flag.
  - 🔥 Cleaned related unused imports and code blocks.
  - 🍻 Note: Multi-Threading is still there.
- 🎨 Implemented short-circuiting.
- 🔊 Improved logging.
- ✏️ Fixed comment typos.
- ⚡️ Updated docs for Screengear with respect to recent changes.
- 🧑‍💻 Updated usage example docs, added new relevant information, updated requirements.
- ✨ Added `dxcam` API Specific Prerequisites for Screengear API, when installing on Windows via pip.
- ♻️ Refactored `monitor` and `backend` parameters docs of Screengear API.
- 📝 Added new description for Screengear API.
- 🗑️ Removed Screengear from Threaded Queue Mode docs.
- 🎨 Updated Screengear FAQs.
- ✨ Added new hyperlinks.
- 🔥 Cleaned redundant code.

Screengear API:
- 🏗️ Enforced `dxcam` backend(if installed) when `monitor` is defined, on Windows machines.
- 💡 Updated comments.

Setup.py:
- ⬆️ Added `dxcam` dependency in `core` and `asyncio` extra requires.
- 💬 Updated keywords.
@abhiTronix abhiTronix added ENHANCEMENT ⚡ New Feature/Addition/Improvement WORK IN PROGRESS 🚧 currently been worked on. DOCS 📜 Issue/PR is related to vidgear docs. PENDING TESTS 🧪 Waiting for CI tests to complete successfully. labels Jul 4, 2023
@abhiTronix abhiTronix added this to the v0.3.1 milestone Jul 4, 2023
@abhiTronix abhiTronix self-assigned this Jul 4, 2023
@abhiTronix abhiTronix added this to In progress in VidGear v0.3.1 via automation Jul 4, 2023
@abhiTronix abhiTronix linked an issue Jul 4, 2023 that may be closed by this pull request
- 🚑️ Starting from version `8.0.0`, python-mss library dropped support for python `3.7`, so as a temporary measure, it has been pinned to version `7.0.1`.
…mgear tests.

- 🚑️ Fixed path bug by replacing absolute file path with decoded file content as string to its `loads()` function.
- 🗑️ Removed unused imports.
- 🎨 Fixed context and added separated methods for controlling Chunks size in HLS and DASH stream

- 🐛 Screengear: Fixed `backend` not defined while logging.

- 🗑️ Manintaince: Removed unused imports.
@abhiTronix abhiTronix linked an issue Jul 5, 2023 that may be closed by this pull request
4 tasks
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Patch coverage: 77.27% and project coverage change: -0.28 ⚠️

Comparison is base (326baf7) 94.43% compared to head (fc93f29) 94.16%.

Additional details and impacted files
@@             Coverage Diff             @@
##           testing     #365      +/-   ##
===========================================
- Coverage    94.43%   94.16%   -0.28%     
===========================================
  Files           16       16              
  Lines         3129     3136       +7     
===========================================
- Hits          2955     2953       -2     
- Misses         174      183       +9     
Impacted Files Coverage Δ
vidgear/gears/screengear.py 79.56% <68.85%> (-6.05%) ⬇️
vidgear/gears/asyncio/helper.py 98.46% <96.29%> (-0.72%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

- 🧑‍💻 Added GitHub server to `generate_webdata` method to make it more robust for rate limits and other shortcomings.
  - 🩹 Now, `generate_webdata` method will retry different server when one fails.
- 💡 Fixed code comments
@abhiTronix abhiTronix removed the PENDING TESTS 🧪 Waiting for CI tests to complete successfully. label Jul 6, 2023
@abhiTronix abhiTronix merged commit 612dee0 into testing Jul 6, 2023
10 checks passed
VidGear v0.3.1 automation moved this from In progress to Done Jul 6, 2023
@abhiTronix abhiTronix deleted the development branch July 6, 2023 12:29
@abhiTronix abhiTronix added SOLVED 🏁 This issue/PR is resolved now. Goal Achieved! and removed WORK IN PROGRESS 🚧 currently been worked on. labels Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOCS 📜 Issue/PR is related to vidgear docs. ENHANCEMENT ⚡ New Feature/Addition/Improvement SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!
Projects
No open projects
1 participant