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

UI: Remove QFuture usage #10957

Merged

Conversation

palana
Copy link
Contributor

@palana palana commented Jul 8, 2024

Description

Unbreak OBS builds using older Qt versions, since QFutures are broken on older Qt versions, even with the deadlock workaround (see #10929)

Motivation and Context

This is meant to fix #10929

Originally the workaround for bouncing continuations between threads seemed sufficient, but there are Qt versions where even creating a ready future and trying to observe it breaks/causes deadlocks

How Has This Been Tested?

Tested "Start Streaming" works and error conditions (e.g. invalid configs) are still handled appropriately

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@RytoEX RytoEX added the Bug Fix Non-breaking change which fixes an issue label Jul 8, 2024
@RytoEX RytoEX self-assigned this Jul 8, 2024
@RytoEX RytoEX requested review from RytoEX, derrod and tt2468 July 8, 2024 15:53
@RytoEX RytoEX added this to the OBS Studio 30.2 milestone Jul 8, 2024
@PatTheMav
Copy link
Member

In general I'm in favour of using more C++ standard functionality instead of Qt variants if possible (and only rely on Qt variants when interacting with UI code) as this allows us to more easily decouple core functionality from the presentation layer.

@palana palana force-pushed the ruwen/multitrack-video-without-qfuture branch from 6572dc6 to daf88c6 Compare July 9, 2024 11:33
@palana
Copy link
Contributor Author

palana commented Jul 9, 2024

Split out the first commit to make code motion more visible vs actual changes

@palana palana force-pushed the ruwen/multitrack-video-without-qfuture branch from daf88c6 to d081349 Compare July 9, 2024 11:56
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parts that I understand look okay. This is mostly shuffling code and changing types. The user who reported #10929 said that this PR fixes that Issue. I would still welcome additional review.

UI/window-basic-main.cpp Show resolved Hide resolved
palana added 2 commits July 10, 2024 14:00
This is in preparation of the next change, to hopefully minimize
the resulting diff
`QFuture`s are broken on older Qt versions, even with the deadlock
workaround (see <obsproject#10929>)
@palana palana force-pushed the ruwen/multitrack-video-without-qfuture branch from d081349 to 2fa46c6 Compare July 10, 2024 12:01
@RytoEX RytoEX merged commit 7327663 into obsproject:master Jul 10, 2024
15 checks passed
@Chiitoo
Copy link
Contributor

Chiitoo commented Jul 11, 2024

This seems to break legacy CMake configuration:

CMake Error at UI/cmake/legacy.cmake:285 (target_sources):
  Cannot find source file:

    qt-helpers.cpp
Call Stack (most recent call first):
  cmake/Modules/ObsHelpers.cmake:473 (include)
  UI/CMakeLists.txt:3 (legacy_check)

Is that to be expected and intentional?

Thank you!

palana added a commit to palana/obs-studio that referenced this pull request Jul 11, 2024
@palana
Copy link
Contributor Author

palana commented Jul 11, 2024

This seems to break legacy CMake configuration:

CMake Error at UI/cmake/legacy.cmake:285 (target_sources):
  Cannot find source file:

    qt-helpers.cpp
Call Stack (most recent call first):
  cmake/Modules/ObsHelpers.cmake:473 (include)
  UI/CMakeLists.txt:3 (legacy_check)

Is that to be expected and intentional?

Thank you!

@Chiitoo: not intentional, and not expected necessarily 😅

filed a follow-up PR to fix this at #10967

@RytoEX
Copy link
Member

RytoEX commented Jul 11, 2024

This seems to break legacy CMake configuration:

CMake Error at UI/cmake/legacy.cmake:285 (target_sources):
  Cannot find source file:

    qt-helpers.cpp
Call Stack (most recent call first):
  cmake/Modules/ObsHelpers.cmake:473 (include)
  UI/CMakeLists.txt:3 (legacy_check)

Is that to be expected and intentional?

Thank you!

While we'll fix this, please note that legacy CMake will be removed in the near future.

@Chiitoo
Copy link
Contributor

Chiitoo commented Jul 11, 2024

While we'll fix this, please note that legacy CMake will be removed in the near future.

Yep, already getting into the new way of things.

Thanks!

RytoEX pushed a commit that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start streaming freezes on beta.
5 participants