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

Various Changes to OpenGL intialization #21

Merged
merged 7 commits into from
Jan 6, 2014
Merged

Various Changes to OpenGL intialization #21

merged 7 commits into from
Jan 6, 2014

Conversation

computerquip
Copy link
Contributor

I removed all extension checking code to gl-subsystem.c as it needs to be called on all platforms and does not change given a platform.
I added a function and tables to handle OpenGL debug and error messages via the ARB_debug_output extension or via the GL 4.0 API if available.
I removed the hardcoded request for a 3.2 context on Linux and Windows. It will now give the latest context given it fits our requirements (which is just a core profile and debug context if _DEBUG is set currently).

Snuck in was a change to autoconf that allows autoconf to correctly find wxWidgets 2.9 (or greater) with wx-config (not just wx-config-2.9) without user interaction.

1. We no longer hardcode a 3.2 profile. It chooses the latest profile that fits out description.
2. I added three tables and macros to help with the offsets compared to the variables to help reading. Read comments for more info.
3. I added glewExperimental being set. What a dumb "feature". It doesn't help anything...
Fixed the location glewExperimental was being set to just before glewInit() (where it should be).
I also fixed autoconf to find wxWidgets 2.9 without user intervention
Removed unused code and added more organization
@jp9000
Copy link
Member

jp9000 commented Jan 6, 2014

very nice!

jp9000 added a commit that referenced this pull request Jan 6, 2014
Various Changes to OpenGL intialization
@jp9000 jp9000 merged commit a89a815 into obsproject:master Jan 6, 2014
@ThoNohT
Copy link
Contributor

ThoNohT commented Jan 7, 2014

glXQueryVersion(display, &major, &minor);
if (major < 1 || minor < 4) {

Wouldn't this break for, say version 2.3?

@computerquip
Copy link
Contributor Author

ThoNohT, this is only querying GLX version. The latest revision is 1.4 of the GLX specification. We require the latest because we use glXGetProcAddress.

Testing for GL version is done in a later function inside of gl-subsystem.c (almost immediately after the platform_create function is called).

I'll go ahead and add that I don't know of any system that doesn't support GLX 1.4 at this time (unless the system hasn't been touched for about 2 years).

@ThoNohT
Copy link
Contributor

ThoNohT commented Jan 8, 2014

Well, my comment was more general than really relating to any specific library, it just seems strange to use knowledge that you know might change in the future (like version numbers) and rely on that in the code.

Unless you're sure that either 1.4 will always be the latest version, or if version 2 comes out, the minor numbers will keep increasing rather than resetting to 2.0, this might break sometime.
What's the reason for not making this more robust by changing the guard to something that will always be correct, say

if (major < 1 || (major == 1 && minor < 4))

And even if you're sure it will always be correct, I'd personally still use guards that actually express the mathematical expression you're after, just for sanity's sake. Especially the sanity of other people trying to read the code 😄

I'm just thinking aloud here by the way, this might apply to other places too, and you guys might not agree with me at all, I just happened to notice it here. If I'm horribly mistaken, I'd love to know the reason why though.

@computerquip
Copy link
Contributor Author

Not that I'm reluctant against the change, but it still wouldn't matter. A GLX 2.3 would still be compatible with GLX 1.0, similar to how a GL 4.4 compatibility profile still supports GL 1.0.

@ThoNohT
Copy link
Contributor

ThoNohT commented Jan 8, 2014

Yes, that's why I suggested the change. The test as it is now will fail on 2.3, while like you just said, it would still be compatible. The change I proposed actually makes sure any version higher than 1.4 will pass the test.

@computerquip
Copy link
Contributor Author

Oh, I see your point. If you want, submit a merge request with said changes. If not, I'll probably do it sometime tomorrow. Obviously no rush.

I really wish GLXEW worked. Then I could have just done "if (GLXEW_VERSION_1_4)" and be done with the damn thing...

@computerquip
Copy link
Contributor Author

Actually, nah, I'm going to just get GLXEW working by going the long route... should be better in the long run.

Waik0 added a commit to Waik0/obs-studio that referenced this pull request May 1, 2020
# This is the 1st commit message:

rtmp-services: Modify showroom setting

Change recommend format and url.
Extend curl Timeout span.

# This is the commit message obsproject#2:

rtmp-services: remove unused code

# This is the commit message obsproject#3:

rtmp-services: showroom support autoconfig ui

# This is the commit message obsproject#4:

rtmp-services: clang format

# This is the commit message obsproject#5:

rtmp-services: Add WASDTV (obsproject#2697)


# This is the commit message obsproject#6:

CI: Add freetype dep on osx


# This is the commit message obsproject#7:

libobs: Fix plugin folder search path case on macOS

# This is the commit message obsproject#8:

linux-v4l2: Fix build with Clang 10.0

add_control_property() was previously static inline bool, but did not
return a value and failed to build on FreeBSD-CURRENT with Clang 10.0,
with:

error: non-void function 'add_control_property' should return a value

# This is the commit message obsproject#9:

CI: Add qt5-xml package for FreeBSD build task

# This is the commit message obsproject#10:

rtmp-services: Update ChathostessModels service (obsproject#2745)


# This is the commit message obsproject#11:

libobs: Don't save removed sources

# This is the commit message obsproject#12:

obs-ffmpeg: Fix media source not closing file when inactive

# This is the commit message obsproject#13:

obs-browser: Fix formatting

# This is the commit message obsproject#14:

obs-vst: Fix formatting

# This is the commit message obsproject#15:

obs-qsv11: Enable QSV texture-based encoding

Enables a pipeline for texture-based encoding with QSV. Utilizes OBS
NV12 output for encode to avoid offloading them from GPU, which will
increase performance. The option to select old QSV pipeline still
remains and will fallback if new pipeline fails.

# This is the commit message obsproject#16:

UI: Remove all scenes in ClearSceneData

# This is the commit message obsproject#17:

UI: Fix previewLabel styling

Label renders with default styling instead of using dynamic property
because it was already polished.

# This is the commit message obsproject#18:

docs/sphinx: Add Property Grouping

# This is the commit message obsproject#19:

plugins: Build ALSA plugin for FreeBSD

Signed-off-by: Hans Petter Selasky <hps@selasky.org>

# This is the commit message obsproject#20:

UI: Adjust a few margins

-Remove 9px margins around central widget. This saves 18px of vertical
space. This will be helpful when the source context menu is added,
which is 24px tall.

-Adjusts margins in transitions dock. The top of the transitions dock
wasn't lined up with the top of the controls dock, which made it look
bad.

# This is the commit message obsproject#21:

UI: Add status icons for recording and streaming

# This is the commit message obsproject#22:

CMake: Build Windows modules with file descriptors

# This is the commit message obsproject#23:

mac-capture: Use window id to identify windows on MacOS

Use a window's window id in init_window in the mac window capture plugin.

# This is the commit message obsproject#24:

mac-capture: Only find window by window id when owner name and pid match

# This is the commit message obsproject#25:

mac-capture: Use int in place of NSNumber for owner_pid

# This is the commit message obsproject#26:

mac-capture: update owner_pid in `update_window`

# This is the commit message obsproject#27:

CI: Add main Github Actions workflow for branch pushes and PRs

# This is the commit message obsproject#28:

UI: Remove unnecessary global variables

# This is the commit message obsproject#29:

Revert "UI: Remove unnecessary global variables"

This reverts commit f91d3ba.

From @pkv: the reason some of these vars were global is because Qt was not deleting them at all; as a result memory leaks have been reintroduced for: previewProjector, trayMenu, studioProgramProjector, multiviewProjectorMenu ;

# This is the commit message obsproject#30:

libobs-opengl: Fix viewport flip

Flip viewport in coordination with update_viewproj_matrix.

# This is the commit message obsproject#31:

UI: Add white icons for dock titles

- Add pop-out and close svg icons
- Update all dark themes qss with the new icons

# This is the commit message obsproject#32:

rtmp-services: Change Stripchat streaming service
Waik0 added a commit to Waik0/obs-studio that referenced this pull request May 1, 2020
# This is the 1st commit message:

rtmp-services: Modify showroom setting

Change recommend format and url.
Extend curl Timeout span.

# This is the commit message obsproject#2:

rtmp-services: remove unused code

# This is the commit message obsproject#3:

rtmp-services: showroom support autoconfig ui

# This is the commit message obsproject#4:

rtmp-services: clang format

# This is the commit message obsproject#5:

rtmp-services: Add WASDTV (obsproject#2697)


# This is the commit message obsproject#6:

CI: Add freetype dep on osx


# This is the commit message obsproject#7:

libobs: Fix plugin folder search path case on macOS

# This is the commit message obsproject#8:

linux-v4l2: Fix build with Clang 10.0

add_control_property() was previously static inline bool, but did not
return a value and failed to build on FreeBSD-CURRENT with Clang 10.0,
with:

error: non-void function 'add_control_property' should return a value

# This is the commit message obsproject#9:

CI: Add qt5-xml package for FreeBSD build task

# This is the commit message obsproject#10:

rtmp-services: Update ChathostessModels service (obsproject#2745)


# This is the commit message obsproject#11:

libobs: Don't save removed sources

# This is the commit message obsproject#12:

obs-ffmpeg: Fix media source not closing file when inactive

# This is the commit message obsproject#13:

obs-browser: Fix formatting

# This is the commit message obsproject#14:

obs-vst: Fix formatting

# This is the commit message obsproject#15:

obs-qsv11: Enable QSV texture-based encoding

Enables a pipeline for texture-based encoding with QSV. Utilizes OBS
NV12 output for encode to avoid offloading them from GPU, which will
increase performance. The option to select old QSV pipeline still
remains and will fallback if new pipeline fails.

# This is the commit message obsproject#16:

UI: Remove all scenes in ClearSceneData

# This is the commit message obsproject#17:

UI: Fix previewLabel styling

Label renders with default styling instead of using dynamic property
because it was already polished.

# This is the commit message obsproject#18:

docs/sphinx: Add Property Grouping

# This is the commit message obsproject#19:

plugins: Build ALSA plugin for FreeBSD

Signed-off-by: Hans Petter Selasky <hps@selasky.org>

# This is the commit message obsproject#20:

UI: Adjust a few margins

-Remove 9px margins around central widget. This saves 18px of vertical
space. This will be helpful when the source context menu is added,
which is 24px tall.

-Adjusts margins in transitions dock. The top of the transitions dock
wasn't lined up with the top of the controls dock, which made it look
bad.

# This is the commit message obsproject#21:

UI: Add status icons for recording and streaming

# This is the commit message obsproject#22:

CMake: Build Windows modules with file descriptors

# This is the commit message obsproject#23:

mac-capture: Use window id to identify windows on MacOS

Use a window's window id in init_window in the mac window capture plugin.

# This is the commit message obsproject#24:

mac-capture: Only find window by window id when owner name and pid match

# This is the commit message obsproject#25:

mac-capture: Use int in place of NSNumber for owner_pid

# This is the commit message obsproject#26:

mac-capture: update owner_pid in `update_window`

# This is the commit message obsproject#27:

CI: Add main Github Actions workflow for branch pushes and PRs

# This is the commit message obsproject#28:

UI: Remove unnecessary global variables

# This is the commit message obsproject#29:

Revert "UI: Remove unnecessary global variables"

This reverts commit f91d3ba.

From @pkv: the reason some of these vars were global is because Qt was not deleting them at all; as a result memory leaks have been reintroduced for: previewProjector, trayMenu, studioProgramProjector, multiviewProjectorMenu ;

# This is the commit message obsproject#30:

libobs-opengl: Fix viewport flip

Flip viewport in coordination with update_viewproj_matrix.

# This is the commit message obsproject#31:

UI: Add white icons for dock titles

- Add pop-out and close svg icons
- Update all dark themes qss with the new icons

# This is the commit message obsproject#32:

rtmp-services: Change Stripchat streaming service

# This is the commit message obsproject#33:

rtmp-services: Add VirtWish service

# This is the commit message obsproject#34:

UI: Update OSX to macOS in English translation

# This is the commit message obsproject#35:

obs-browser, obs-vst: Fix formatting

# This is the commit message obsproject#36:

CI: Fix Azure Pipelines macOS runs

# This is the commit message obsproject#37:

obs-filters: Add a user label to the LUT filter

While discussing the Flatpak RFC [1], it was spotted that the
LUT filter couldn't open the file selection dialog. It was
explained, then, that the proper formats were either composed
of "User Label (file extensions)", or "file extensions", and
the LUT filter was setting "(file extensions)" without the
actual user label.

While this works on a standard Qt file selection dialog, it
cannot be properly formatted as a set of D-Bus filters, thus
breaking the sandbox integration.

Add a simple user label to the LUT file filter.

[1] obsproject/rfcs#21 (comment)

# This is the commit message obsproject#38:

UI: Remove requirement for replay buffer hotkey

Fixes obsproject#2807

# This is the commit message obsproject#39:

obs-ffmpeg: Log why new NVENC might not be used

# This is the commit message obsproject#40:

obs-ffmpeg: Preserve error message from new NVENC

If we fallback to ffmpeg NVENC, the error from new NVENC might still be
present in the encoder structure. Given that this provides a lot more
actionable information to the user, let's use it if possible.

# This is the commit message obsproject#41:

libobs: Clear last error on encoder shutdown

This fixes an issue where an encoder may error out on a path that
doesn't use obs_encoder_set_last_error, resulting in a stale error being
used.

# This is the commit message obsproject#42:

obs-ffmpeg: Add localization for NVENC error messages

# This is the commit message obsproject#43:

obs-ffmpeg: Add error message for non-zero GPU

# This is the commit message obsproject#44:

CI: Update macOS deps to fix lua

# This is the commit message obsproject#45:

vlc-video: Enable building the plugin on FreeBSD
Waik0 added a commit to Waik0/obs-studio that referenced this pull request May 1, 2020
# This is the 1st commit message:

rtmp-services: add showroom setting

# This is the commit message obsproject#2:

rtmp-services: Modify showroom setting

Change recommend format and url.
Extend curl Timeout span.

# This is the commit message obsproject#3:

rtmp-services: remove unused code

# This is the commit message obsproject#4:

rtmp-services: showroom support autoconfig ui

# This is the commit message obsproject#5:

rtmp-services: clang format

# This is the commit message obsproject#6:

rtmp-services: Add WASDTV (obsproject#2697)


# This is the commit message obsproject#7:

CI: Add freetype dep on osx


# This is the commit message obsproject#8:

libobs: Fix plugin folder search path case on macOS

# This is the commit message obsproject#9:

linux-v4l2: Fix build with Clang 10.0

add_control_property() was previously static inline bool, but did not
return a value and failed to build on FreeBSD-CURRENT with Clang 10.0,
with:

error: non-void function 'add_control_property' should return a value

# This is the commit message obsproject#10:

CI: Add qt5-xml package for FreeBSD build task

# This is the commit message obsproject#11:

rtmp-services: Update ChathostessModels service (obsproject#2745)


# This is the commit message obsproject#12:

libobs: Don't save removed sources

# This is the commit message obsproject#13:

obs-ffmpeg: Fix media source not closing file when inactive

# This is the commit message obsproject#14:

obs-browser: Fix formatting

# This is the commit message obsproject#15:

obs-vst: Fix formatting

# This is the commit message obsproject#16:

obs-qsv11: Enable QSV texture-based encoding

Enables a pipeline for texture-based encoding with QSV. Utilizes OBS
NV12 output for encode to avoid offloading them from GPU, which will
increase performance. The option to select old QSV pipeline still
remains and will fallback if new pipeline fails.

# This is the commit message obsproject#17:

UI: Remove all scenes in ClearSceneData

# This is the commit message obsproject#18:

UI: Fix previewLabel styling

Label renders with default styling instead of using dynamic property
because it was already polished.

# This is the commit message obsproject#19:

docs/sphinx: Add Property Grouping

# This is the commit message obsproject#20:

plugins: Build ALSA plugin for FreeBSD

Signed-off-by: Hans Petter Selasky <hps@selasky.org>

# This is the commit message obsproject#21:

UI: Adjust a few margins

-Remove 9px margins around central widget. This saves 18px of vertical
space. This will be helpful when the source context menu is added,
which is 24px tall.

-Adjusts margins in transitions dock. The top of the transitions dock
wasn't lined up with the top of the controls dock, which made it look
bad.

# This is the commit message obsproject#22:

UI: Add status icons for recording and streaming

# This is the commit message obsproject#23:

CMake: Build Windows modules with file descriptors

# This is the commit message obsproject#24:

mac-capture: Use window id to identify windows on MacOS

Use a window's window id in init_window in the mac window capture plugin.

# This is the commit message obsproject#25:

mac-capture: Only find window by window id when owner name and pid match

# This is the commit message obsproject#26:

mac-capture: Use int in place of NSNumber for owner_pid

# This is the commit message obsproject#27:

mac-capture: update owner_pid in `update_window`

# This is the commit message obsproject#28:

CI: Add main Github Actions workflow for branch pushes and PRs

# This is the commit message obsproject#29:

UI: Remove unnecessary global variables

# This is the commit message obsproject#30:

Revert "UI: Remove unnecessary global variables"

This reverts commit f91d3ba.

From @pkv: the reason some of these vars were global is because Qt was not deleting them at all; as a result memory leaks have been reintroduced for: previewProjector, trayMenu, studioProgramProjector, multiviewProjectorMenu ;

# This is the commit message obsproject#31:

libobs-opengl: Fix viewport flip

Flip viewport in coordination with update_viewproj_matrix.

# This is the commit message obsproject#32:

UI: Add white icons for dock titles

- Add pop-out and close svg icons
- Update all dark themes qss with the new icons

# This is the commit message obsproject#33:

rtmp-services: Change Stripchat streaming service
Waik0 added a commit to Waik0/obs-studio that referenced this pull request May 1, 2020
# This is the 1st commit message:

rtmp-services: add showroom setting

# This is the commit message obsproject#2:

rtmp-services: Modify showroom setting

Change recommend format and url.
Extend curl Timeout span.

# This is the commit message obsproject#3:

rtmp-services: remove unused code

# This is the commit message obsproject#4:

rtmp-services: showroom support autoconfig ui

# This is the commit message obsproject#5:

rtmp-services: clang format

# This is the commit message obsproject#6:

rtmp-services: Add WASDTV (obsproject#2697)


# This is the commit message obsproject#7:

CI: Add freetype dep on osx


# This is the commit message obsproject#8:

libobs: Fix plugin folder search path case on macOS

# This is the commit message obsproject#9:

linux-v4l2: Fix build with Clang 10.0

add_control_property() was previously static inline bool, but did not
return a value and failed to build on FreeBSD-CURRENT with Clang 10.0,
with:

error: non-void function 'add_control_property' should return a value

# This is the commit message obsproject#10:

CI: Add qt5-xml package for FreeBSD build task

# This is the commit message obsproject#11:

rtmp-services: Update ChathostessModels service (obsproject#2745)


# This is the commit message obsproject#12:

libobs: Don't save removed sources

# This is the commit message obsproject#13:

obs-ffmpeg: Fix media source not closing file when inactive

# This is the commit message obsproject#14:

obs-browser: Fix formatting

# This is the commit message obsproject#15:

obs-vst: Fix formatting

# This is the commit message obsproject#16:

obs-qsv11: Enable QSV texture-based encoding

Enables a pipeline for texture-based encoding with QSV. Utilizes OBS
NV12 output for encode to avoid offloading them from GPU, which will
increase performance. The option to select old QSV pipeline still
remains and will fallback if new pipeline fails.

# This is the commit message obsproject#17:

UI: Remove all scenes in ClearSceneData

# This is the commit message obsproject#18:

UI: Fix previewLabel styling

Label renders with default styling instead of using dynamic property
because it was already polished.

# This is the commit message obsproject#19:

docs/sphinx: Add Property Grouping

# This is the commit message obsproject#20:

plugins: Build ALSA plugin for FreeBSD

Signed-off-by: Hans Petter Selasky <hps@selasky.org>

# This is the commit message obsproject#21:

UI: Adjust a few margins

-Remove 9px margins around central widget. This saves 18px of vertical
space. This will be helpful when the source context menu is added,
which is 24px tall.

-Adjusts margins in transitions dock. The top of the transitions dock
wasn't lined up with the top of the controls dock, which made it look
bad.

# This is the commit message obsproject#22:

UI: Add status icons for recording and streaming

# This is the commit message obsproject#23:

CMake: Build Windows modules with file descriptors

# This is the commit message obsproject#24:

mac-capture: Use window id to identify windows on MacOS

Use a window's window id in init_window in the mac window capture plugin.

# This is the commit message obsproject#25:

mac-capture: Only find window by window id when owner name and pid match

# This is the commit message obsproject#26:

mac-capture: Use int in place of NSNumber for owner_pid

# This is the commit message obsproject#27:

mac-capture: update owner_pid in `update_window`

# This is the commit message obsproject#28:

CI: Add main Github Actions workflow for branch pushes and PRs

# This is the commit message obsproject#29:

UI: Remove unnecessary global variables

# This is the commit message obsproject#30:

Revert "UI: Remove unnecessary global variables"

This reverts commit f91d3ba.

From @pkv: the reason some of these vars were global is because Qt was not deleting them at all; as a result memory leaks have been reintroduced for: previewProjector, trayMenu, studioProgramProjector, multiviewProjectorMenu ;

# This is the commit message obsproject#31:

libobs-opengl: Fix viewport flip

Flip viewport in coordination with update_viewproj_matrix.

# This is the commit message obsproject#32:

UI: Add white icons for dock titles

- Add pop-out and close svg icons
- Update all dark themes qss with the new icons

# This is the commit message obsproject#33:

rtmp-services: Change Stripchat streaming service

# This is the commit message obsproject#34:

rtmp-services: Add VirtWish service

# This is the commit message obsproject#35:

UI: Update OSX to macOS in English translation

# This is the commit message obsproject#36:

obs-browser, obs-vst: Fix formatting

# This is the commit message obsproject#37:

CI: Fix Azure Pipelines macOS runs

# This is the commit message obsproject#38:

obs-filters: Add a user label to the LUT filter

While discussing the Flatpak RFC [1], it was spotted that the
LUT filter couldn't open the file selection dialog. It was
explained, then, that the proper formats were either composed
of "User Label (file extensions)", or "file extensions", and
the LUT filter was setting "(file extensions)" without the
actual user label.

While this works on a standard Qt file selection dialog, it
cannot be properly formatted as a set of D-Bus filters, thus
breaking the sandbox integration.

Add a simple user label to the LUT file filter.

[1] obsproject/rfcs#21 (comment)

# This is the commit message obsproject#39:

UI: Remove requirement for replay buffer hotkey

Fixes obsproject#2807

# This is the commit message obsproject#40:

obs-ffmpeg: Log why new NVENC might not be used

# This is the commit message obsproject#41:

obs-ffmpeg: Preserve error message from new NVENC

If we fallback to ffmpeg NVENC, the error from new NVENC might still be
present in the encoder structure. Given that this provides a lot more
actionable information to the user, let's use it if possible.

# This is the commit message obsproject#42:

libobs: Clear last error on encoder shutdown

This fixes an issue where an encoder may error out on a path that
doesn't use obs_encoder_set_last_error, resulting in a stale error being
used.

# This is the commit message obsproject#43:

obs-ffmpeg: Add localization for NVENC error messages

# This is the commit message obsproject#44:

obs-ffmpeg: Add error message for non-zero GPU

# This is the commit message obsproject#45:

CI: Update macOS deps to fix lua

# This is the commit message obsproject#46:

vlc-video: Enable building the plugin on FreeBSD
5455945 added a commit to 5455945/obs-studio that referenced this pull request Feb 21, 2021
1 上报当前活动窗口日志信息,
2 开始工作监控,结束工作停止监控
WizardCM pushed a commit to WizardCM/obs-studio that referenced this pull request Feb 13, 2022
notr1ch pushed a commit to notr1ch/obs-studio that referenced this pull request Aug 16, 2022
kc5nra pushed a commit to amazon-contributing/upstreaming-to-obs-studio that referenced this pull request Jan 13, 2024
…tle-berryessa

Throttle Berryessa requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants