Projects
home:darix:branches:Multimedia
obs-studio
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
obs-studio.changes
Changed
@@ -1,4 +1,35 @@ ------------------------------------------------------------------- +Mon Oct 21 19:14:48 UTC 2024 - packman@nordisch.org + +- Update to version 31.0.0~beta2: + * obs-nvenc: Force at least 4 b-frames when using UHQ tune + * UI: Use custom property on QAction to retain profile or collection name + * UI: Update order of profiles and scene collections in their menus + * UI: Restore XDG config path update for FreeBSD + * libobs: Remove non-USE_XDG code + * obs-browser: Update version to 2.24.4 + * obs-browser: Update version to 2.24.3 + * UI: Remove toolButton styling + * UI: Replace toolButton property with style class + * CONTRIBUTING.rst: Update for 120 column limit + * CI: Bump FreeBSD image to 14.1 + * libobs: Fix items in groups using wrong scale reference + * libobs: Fix ungrouped transfom calculation in relative mode + * obs-outputs: Add cast to fix build with Clang 19 + * UI: Catch error from copy in MigrateGlobalSettings + * obs-qsv11: Update minimum VPL version to 2.9 + * UI: Fix initialization bug when launching without existing profile + * UI: Set minimum version for nlohmann_json to 3.11 + * UI/themes: Consistently select indicator-mute instead of MuteCheckBox + * libobs: Add source profiler to public headers + * UI: Fix crash when providing scene collection or profile via CLI + * UI: Fix deletion of scene collection backup on collection deletion + * UI: Fix activation order of profile and scene collections after delete + * UI/themes: Fix selectors in Yami Light + * UI: Correctly set Yami border radius for buttons in tables + * CI: Fix rclone env var formatting in Windows Patches action + +------------------------------------------------------------------- Wed Oct 9 10:15:12 UTC 2024 - packman@nordisch.org - reenable websockets
View file
obs-studio.spec
Changed
@@ -28,7 +28,7 @@ %endif Name: obs-studio -Version: 31.0.0~beta1 +Version: 31.0.0~beta2 Release: 0 Summary: A recording/broadcasting program Group: Productivity/Multimedia/Video/Editors and Convertors
View file
_service
Changed
@@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="versionformat">@PARENT_TAG@</param> - <param name="revision">31.0.0-beta1</param> + <param name="revision">31.0.0-beta2</param> <param name="url">https://github.com/obsproject/obs-studio.git</param> <param name="versionrewrite-pattern">(\.\d+)-(a-z.*)</param> <param name="versionrewrite-replacement">\1~\2</param>
View file
_servicedata
Changed
@@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/obsproject/obs-studio.git</param> - <param name="changesrevision">9f425af189c48300c4ca6d02420a1c10d888717a</param> + <param name="changesrevision">e8968ba7152120129eddb8f78850819a01530a1b</param> </service> </servicedata> \ No newline at end of file
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/.github/workflows/clang-format.yml
Deleted
@@ -1,21 +0,0 @@ -name: Clang Format Check - -on: push, pull_request - -jobs: - ubuntu64: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Install clang format - run: | - sudo apt-get install -y clang-format-13 - - - name: Check the Formatting - run: | - ./formatcode.sh - ./CI/check-format.sh
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/CI
Deleted
-(directory)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/CI/check-format.sh
Deleted
@@ -1,11 +0,0 @@ -#!/bin/bash -dirty=$(git ls-files --modified) - -set +x -if $dirty ; then - echo "=================================" - echo "Files were not formatted properly" - echo "$dirty" - echo "=================================" - exit 1 -fi \ No newline at end of file
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/deps/obs-websocket-api
Deleted
-(directory)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/deps/obs-websocket-api/.clang-format
Deleted
@@ -1,3 +0,0 @@ -Language: Cpp -SortIncludes: false -DisableFormat: true
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/deps/obs-websocket-api/obs-websocket-api.h
Deleted
@@ -1,135 +0,0 @@ -/* -obs-websocket -Copyright (C) 2016-2021 Stephane Lepin <stephane.lepin@gmail.com> -Copyright (C) 2020-2021 Kyle Manning <tt2468@gmail.com> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <https://www.gnu.org/licenses/> -*/ - -#ifndef _OBS_WEBSOCKET_API_H -#define _OBS_WEBSOCKET_API_H - -#include <obs.h> - -#define OBS_WEBSOCKET_API_VERSION 1 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* obs_websocket_vendor; -typedef void (*obs_websocket_request_callback_function)(obs_data_t*, obs_data_t*, void*); - -struct obs_websocket_request_callback { - obs_websocket_request_callback_function callback; - void *priv_data; -}; - -inline proc_handler_t *ph; - -static inline proc_handler_t *obs_websocket_get_ph(void) -{ - proc_handler_t *global_ph = obs_get_proc_handler(); - assert(global_ph != NULL); - - calldata_t cd = {0}; - if (!proc_handler_call(global_ph, "obs_websocket_api_get_ph", &cd)) - blog(LOG_DEBUG, "Unable to fetch obs-websocket proc handler object. obs-websocket not installed?"); - proc_handler_t *ret = (proc_handler_t*)calldata_ptr(&cd, "ph"); - calldata_free(&cd); - - return ret; -} - -static inline bool obs_websocket_run_simple_proc(obs_websocket_vendor vendor, const char *proc_name, calldata_t *cd) -{ - if (!ph || !vendor || !proc_name || !strlen(proc_name) || !cd) - return false; - - calldata_set_ptr(cd, "vendor", vendor); - - proc_handler_call(ph, proc_name, cd); - return calldata_bool(cd, "success"); -} - -// ALWAYS CALL VIA `obs_module_post_load()` CALLBACK! -// Registers a new "vendor" (Example: obs-ndi) -static inline obs_websocket_vendor obs_websocket_register_vendor(const char *vendor_name) -{ - ph = obs_websocket_get_ph(); - if (!ph) - return NULL; - - calldata_t cd = {0}; - - calldata_set_string(&cd, "name", vendor_name); - - proc_handler_call(ph, "vendor_register", &cd); - obs_websocket_vendor ret = calldata_ptr(&cd, "vendor"); - calldata_free(&cd); - - return ret; -} - -// Registers a new request for a vendor -static inline bool obs_websocket_vendor_register_request(obs_websocket_vendor vendor, const char *request_type, obs_websocket_request_callback_function request_callback, void* priv_data) -{ - calldata_t cd = {0}; - - struct obs_websocket_request_callback cb = {}; - cb.callback = request_callback; - cb.priv_data = priv_data; - - calldata_set_string(&cd, "type", request_type); - calldata_set_ptr(&cd, "callback", &cb); - - bool success = obs_websocket_run_simple_proc(vendor, "vendor_request_register", &cd); - calldata_free(&cd); - - return success; -} - -// Unregisters an existing vendor request -static inline bool obs_websocket_vendor_unregister_request(obs_websocket_vendor vendor, const char *request_type) -{ - calldata_t cd = {0}; - - calldata_set_string(&cd, "type", request_type); - - bool success = obs_websocket_run_simple_proc(vendor, "vendor_request_unregister", &cd); - calldata_free(&cd); - - return success; -} - -// Does not affect event_data refcount. -// Emits an event under the vendor's name -static inline bool obs_websocket_vendor_emit_event(obs_websocket_vendor vendor, const char *event_name, obs_data_t *event_data) -{ - calldata_t cd = {0}; - - calldata_set_string(&cd, "type", event_name); - calldata_set_ptr(&cd, "data", (void*)event_data); - - bool success = obs_websocket_run_simple_proc(vendor, "vendor_event_emit", &cd); - calldata_free(&cd); - - return success; -} - -#ifdef __cplusplus -} -#endif - -#endif
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/formatcode.sh
Deleted
@@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# Original source https://github.com/Project-OSRM/osrm-backend/blob/master/scripts/format.sh - -set +x -set -o errexit -set -o pipefail -set -o nounset - -# Runs the Clang Formatter in parallel on the code base. -# Return codes: -# - 1 there are files to be formatted -# - 0 everything looks fine - -# Get CPU count -OS=$(uname) -NPROC=1 -if $OS = "Linux" || $OS = "Darwin" ; then - NPROC=$(getconf _NPROCESSORS_ONLN) -fi - -# Discover clang-format -if type clang-format-13 2> /dev/null ; then - CLANG_FORMAT=clang-format-13 -elif type clang-format-10 2> /dev/null ; then - CLANG_FORMAT=clang-format-10 -elif type clang-format-8 2> /dev/null ; then - CLANG_FORMAT=clang-format-8 -else - CLANG_FORMAT=clang-format -fi - -find . -type d -type f -o -name '*.h' -or -name '*.hpp' -or -name '*.m' -or -name '*.mm' -or -name '*.c' -or -name '*.cpp' \ -| xargs -I{} -P ${NPROC} ${CLANG_FORMAT} -i -style=file -fallback-style=none {}
View file
obs-studio-31.0.0~beta1.tar.xz/.cirrus.yml -> obs-studio-31.0.0~beta2.tar.xz/.cirrus.yml
Changed
@@ -1,7 +1,7 @@ # $FreeBSD$ freebsd_instance: - image: freebsd-13-2-release-amd64 + image: freebsd-14-1-release-amd64-ufs env: CIRRUS_CLONE_DEPTH: 1
View file
obs-studio-31.0.0~beta1.tar.xz/.github/actions/windows-patches/action.yaml -> obs-studio-31.0.0~beta2.tar.xz/.github/actions/windows-patches/action.yaml
Changed
@@ -74,7 +74,7 @@ env: RCLONE_TRANSFERS: '100' RCLONE_FAST_LIST: 'true' - RCLONE_EXCLUDE: '{pdbs/**,**/${{ inputs.tagName }}/**}' + RCLONE_EXCLUDE: '"{pdbs/**,**/${{ inputs.tagName }}/**}"' RCLONE_S3_PROVIDER: 'GCS' RCLONE_S3_ACCESS_KEY_ID: '${{ inputs.gcsAccessKeyId }}' RCLONE_S3_SECRET_ACCESS_KEY: '${{ inputs.gcsAccessKeySecret }}'
View file
obs-studio-31.0.0~beta1.tar.xz/CONTRIBUTING.rst -> obs-studio-31.0.0~beta2.tar.xz/CONTRIBUTING.rst
Changed
@@ -54,7 +54,7 @@ - Tabs for indentation, spaces for alignment. Tabs are treated as 8 columns wide. -- 80 columns max +- 120 columns max - Comments and names of variables/functions/etc. must be in English
View file
obs-studio-31.0.0~beta1.tar.xz/UI/cmake/feature-macos-update.cmake -> obs-studio-31.0.0~beta2.tar.xz/UI/cmake/feature-macos-update.cmake
Changed
@@ -1,6 +1,6 @@ include_guard(DIRECTORY) -find_package(nlohmann_json REQUIRED) +find_package(nlohmann_json 3.11 REQUIRED) if(NOT TARGET OBS::blake2) add_subdirectory("${CMAKE_SOURCE_DIR}/deps/blake2" "${CMAKE_BINARY_DIR}/deps/blake2")
View file
obs-studio-31.0.0~beta1.tar.xz/UI/cmake/feature-whatsnew.cmake -> obs-studio-31.0.0~beta2.tar.xz/UI/cmake/feature-whatsnew.cmake
Changed
@@ -9,7 +9,7 @@ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) find_package(MbedTLS REQUIRED) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE) - find_package(nlohmann_json REQUIRED) + find_package(nlohmann_json 3.11 REQUIRED) if(NOT TARGET OBS::blake2) add_subdirectory("${CMAKE_SOURCE_DIR}/deps/blake2" "${CMAKE_BINARY_DIR}/deps/blake2")
View file
obs-studio-31.0.0~beta1.tar.xz/UI/cmake/os-linux.cmake -> obs-studio-31.0.0~beta2.tar.xz/UI/cmake/os-linux.cmake
Changed
@@ -1,7 +1,7 @@ target_sources(obs-studio PRIVATE platform-x11.cpp) target_compile_definitions( obs-studio - PRIVATE USE_XDG OBS_INSTALL_PREFIX="${OBS_INSTALL_PREFIX}" $<$<BOOL:${ENABLE_PORTABLE_CONFIG}>:ENABLE_PORTABLE_CONFIG> + PRIVATE OBS_INSTALL_PREFIX="${OBS_INSTALL_PREFIX}" $<$<BOOL:${ENABLE_PORTABLE_CONFIG}>:ENABLE_PORTABLE_CONFIG> ) target_link_libraries(obs-studio PRIVATE Qt::GuiPrivate Qt::DBus)
View file
obs-studio-31.0.0~beta1.tar.xz/UI/cmake/os-windows.cmake -> obs-studio-31.0.0~beta2.tar.xz/UI/cmake/os-windows.cmake
Changed
@@ -10,7 +10,7 @@ find_package(MbedTLS REQUIRED) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE) find_package(Detours REQUIRED) -find_package(nlohmann_json REQUIRED) +find_package(nlohmann_json 3.11 REQUIRED) configure_file(cmake/windows/obs.rc.in obs.rc)
View file
obs-studio-31.0.0~beta1.tar.xz/UI/data/themes/System.obt -> obs-studio-31.0.0~beta2.tar.xz/UI/data/themes/System.obt
Changed
@@ -84,7 +84,7 @@ qproperty-icon: url(:res/images/revert.svg); } -MuteCheckBox { +.indicator-mute { outline: none; }
View file
obs-studio-31.0.0~beta1.tar.xz/UI/data/themes/Yami.obt -> obs-studio-31.0.0~beta2.tar.xz/UI/data/themes/Yami.obt
Changed
@@ -1413,7 +1413,7 @@ margin-right: var(--padding_xlarge); } -#vMixerScrollArea VolControl MuteCheckBox { +#vMixerScrollArea VolControl .indicator-mute { margin-left: var(--padding_xlarge); } @@ -1465,7 +1465,7 @@ QTableView QToolButton { padding: 0px; margin: -1px; - border_radius: 0px; + border-radius: 0px; } QHeaderView::section { @@ -1624,7 +1624,7 @@ /* Mute CheckBox */ -MuteCheckBox { +.indicator-mute { outline: none; } @@ -1992,4 +1992,4 @@ #previewYScrollBar { width: 16px; -} \ No newline at end of file +}
View file
obs-studio-31.0.0~beta1.tar.xz/UI/data/themes/Yami_Acri.ovt -> obs-studio-31.0.0~beta2.tar.xz/UI/data/themes/Yami_Acri.ovt
Changed
@@ -103,21 +103,21 @@ border-color: var(--toolbutton_bg_down); } -MuteCheckBox::indicator, -MuteCheckBox::indicator:unchecked, -MuteCheckBox::indicator:focus { +.indicator-mute::indicator, +.indicator-mute::indicator:unchecked, +.indicator-mute::indicator:focus { background-color: var(--toolbutton_bg); border: 1px solid var(--toolbutton_bg); } -MuteCheckBox::indicator:hover, -MuteCheckBox::indicator:unchecked:hover { +.indicator-mute::indicator:hover, +.indicator-mute::indicator:unchecked:hover { background-color: var(--toolbutton_bg_hover); border: 1px solid var(--toolbutton_bg_hover); } -MuteCheckBox::indicator:pressed, -MuteCheckBox::indicator:pressed:hover { +.indicator-mute::indicator:pressed, +.indicator-mute::indicator:pressed:hover { background-color: var(--toolbutton_bg_down); border-color: var(--toolbutton_bg_down); }
View file
obs-studio-31.0.0~beta1.tar.xz/UI/data/themes/Yami_Classic.ovt -> obs-studio-31.0.0~beta2.tar.xz/UI/data/themes/Yami_Classic.ovt
Changed
@@ -270,8 +270,8 @@ font-size: var(--font_base); } -MuteCheckBox::indicator, -MuteCheckBox::indicator:unchecked { +.indicator-mute::indicator, +.indicator-mute::indicator:unchecked { background-color: var(--bg_base); border: none; width: var(--icon_base_mixer); @@ -279,17 +279,17 @@ icon-size: var(--icon_base_mixer); } -MuteCheckBox::indicator:checked { +.indicator-mute::indicator:checked { background-color: var(--bg_base); } -MuteCheckBox::indicator:checked:hover, -MuteCheckBox::indicator:unchecked:hover { +.indicator-mute::indicator:checked:hover, +.indicator-mute::indicator:unchecked:hover { background-color: var(--bg_base); } -MuteCheckBox::indicator:hover, -MuteCheckBox::indicator:unchecked:hover { +.indicator-mute::indicator:hover, +.indicator-mute::indicator:unchecked:hover { icon-size: var(--icon_base_mixer); border: none; }
View file
obs-studio-31.0.0~beta1.tar.xz/UI/data/themes/Yami_Light.ovt -> obs-studio-31.0.0~beta2.tar.xz/UI/data/themes/Yami_Light.ovt
Changed
@@ -186,55 +186,55 @@ image: url(theme:Light/checkbox_unchecked_disabled.svg); } -QCheckBoxlockCheckBox=true::indicator:checked, -QCheckBoxlockCheckBox=true::indicator:checked:hover { +.indicator-lock::indicator:checked, +.indicator-lock::indicator:checked:hover { image: url(theme:Light/locked.svg); } -QCheckBoxvisibilityCheckBox=true::indicator:checked, -QCheckBoxvisibilityCheckBox=true::indicator:checked:hover { +.indicator-visibility::indicator:checked, +.indicator-visibility::indicator:checked:hover { image: url(theme:Light/visible.svg); } -MuteCheckBox::indicator:checked { +.indicator-mute::indicator:checked { image: url(theme:Light/mute.svg); } -MuteCheckBox::indicator:unchecked { +.indicator-mute::indicator:unchecked { image: url(theme:Light/settings/audio.svg); } -MuteCheckBox::indicator:unchecked:hover { +.indicator-mute::indicator:unchecked:hover { image: url(theme:Light/settings/audio.svg); } -MuteCheckBox::indicator:unchecked:focus { +.indicator-mute::indicator:unchecked:focus { image: url(theme:Light/settings/audio.svg); } -MuteCheckBox::indicator:checked:hover { +.indicator-mute::indicator:checked:hover { image: url(theme:Light/mute.svg); } -MuteCheckBox::indicator:checked:focus { +.indicator-mute::indicator:checked:focus { image: url(theme:Light/mute.svg); } -MuteCheckBox::indicator:checked:disabled { +.indicator-mute::indicator:checked:disabled { image: url(theme:Light/mute.svg); } -MuteCheckBox::indicator:unchecked:disabled { +.indicator-mute::indicator:unchecked:disabled { image: url(theme:Light/settings/audio.svg); } -QCheckBoxsourceTreeSubItem=true::indicator:checked, -QCheckBoxsourceTreeSubItem=true::indicator:checked:hover { +.indicator-expand::indicator:checked, +.indicator-expand::indicator:checked:hover { image: url(theme:Light/expand.svg); } -QCheckBoxsourceTreeSubItem=true::indicator:unchecked, -QCheckBoxsourceTreeSubItem=true::indicator:unchecked:hover { +.indicator-expand::indicator:unchecked, +.indicator-expand::indicator:unchecked:hover { image: url(theme:Light/collapse.svg); }
View file
obs-studio-31.0.0~beta1.tar.xz/UI/data/themes/Yami_Rachni.ovt -> obs-studio-31.0.0~beta2.tar.xz/UI/data/themes/Yami_Rachni.ovt
Changed
@@ -141,21 +141,21 @@ border-color: var(--toolbutton_bg_down); } -MuteCheckBox::indicator, -MuteCheckBox::indicator:unchecked, -MuteCheckBox::indicator:focus { +.indicator-mute::indicator, +.indicator-mute::indicator:unchecked, +.indicator-mute::indicator:focus { background-color: var(--toolbutton_bg); border: 1px solid var(--toolbutton_bg); } -MuteCheckBox::indicator:hover, -MuteCheckBox::indicator:unchecked:hover { +.indicator-mute::indicator:hover, +.indicator-mute::indicator:unchecked:hover { background-color: var(--toolbutton_bg_hover); border: 1px solid var(--toolbutton_bg_hover); } -MuteCheckBox::indicator:pressed, -MuteCheckBox::indicator:pressed:hover { +.indicator-mute::indicator:pressed, +.indicator-mute::indicator:pressed:hover { background-color: var(--toolbutton_bg_down); border-color: var(--toolbutton_bg_down); }
View file
obs-studio-31.0.0~beta1.tar.xz/UI/forms/OBSBasic.ui -> obs-studio-31.0.0~beta2.tar.xz/UI/forms/OBSBasic.ui
Changed
@@ -1415,10 +1415,7 @@ <bool>false</bool> </property> <property name="class" stdset="0"> - <string notr="true">icon-plus</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-plus</string> </property> </widget> </item> @@ -1447,10 +1444,7 @@ <bool>false</bool> </property> <property name="class" stdset="0"> - <string notr="true">icon-trash</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-trash</string> </property> </widget> </item> @@ -1479,10 +1473,7 @@ <bool>false</bool> </property> <property name="class" stdset="0"> - <string notr="true">icon-dots-vert</string> - </property> - <property name="toolButton" stdset="0"> - <string notr="true">true</string> + <string notr="true">btn-tool icon-dots-vert</string> </property> </widget> </item>
View file
obs-studio-31.0.0~beta1.tar.xz/UI/forms/OBSBasicFilters.ui -> obs-studio-31.0.0~beta2.tar.xz/UI/forms/OBSBasicFilters.ui
Changed
@@ -126,10 +126,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-plus</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-plus</string> </property> </widget> </item> @@ -158,10 +155,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-trash</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-trash</string> </property> </widget> </item> @@ -190,10 +184,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-up</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-up</string> </property> </widget> </item> @@ -222,10 +213,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-down</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-down</string> </property> </widget> </item> @@ -360,10 +348,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-plus</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-plus</string> </property> </widget> </item> @@ -392,10 +377,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-trash</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-trash</string> </property> </widget> </item> @@ -424,10 +406,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-up</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-up</string> </property> </widget> </item> @@ -456,10 +435,7 @@ <bool>true</bool> </property> <property name="class" stdset="0"> - <string>icon-down</string> - </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> + <string notr="true">btn-tool icon-down</string> </property> </widget> </item>
View file
obs-studio-31.0.0~beta1.tar.xz/UI/frontend-plugins/frontend-tools/forms/auto-scene-switcher.ui -> obs-studio-31.0.0~beta2.tar.xz/UI/frontend-plugins/frontend-tools/forms/auto-scene-switcher.ui
Changed
@@ -79,9 +79,6 @@ <property name="class" stdset="0"> <string notr="true">icon-plus</string> </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> - </property> </widget> </item> <item> @@ -98,9 +95,6 @@ <property name="class" stdset="0"> <string notr="true">icon-trash</string> </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> - </property> </widget> </item> <item>
View file
obs-studio-31.0.0~beta1.tar.xz/UI/frontend-plugins/frontend-tools/forms/scripts.ui -> obs-studio-31.0.0~beta2.tar.xz/UI/frontend-plugins/frontend-tools/forms/scripts.ui
Changed
@@ -86,9 +86,6 @@ <property name="class" stdset="0"> <string notr="true">icon-plus</string> </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> - </property> </widget> </item> <item> @@ -120,9 +117,6 @@ <property name="class" stdset="0"> <string notr="true">icon-trash</string> </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> - </property> </widget> </item> <item> @@ -154,9 +148,6 @@ <property name="class" stdset="0"> <string notr="true">icon-refresh</string> </property> - <property name="toolButton" stdset="0"> - <bool>true</bool> - </property> </widget> </item> <item>
View file
obs-studio-31.0.0~beta1.tar.xz/UI/obs-app.cpp -> obs-studio-31.0.0~beta2.tar.xz/UI/obs-app.cpp
Changed
@@ -677,8 +677,6 @@ bool OBSApp::InitUserConfig(std::filesystem::path &userConfigLocation, uint32_t lastVersion) { - bool hasChanges = false; - const std::string userConfigFile = userConfigLocation.u8string() + "/obs-studio/user.ini"; int errorCode = userConfig.Open(userConfigFile.c_str(), CONFIG_OPEN_ALWAYS); @@ -688,45 +686,13 @@ return false; } - hasChanges = MigrateLegacySettings(lastVersion); - - if (!opt_starting_collection.empty()) { - const OBSBasic *basic = reinterpret_cast<OBSBasic *>(GetMainWindow()); - const std::optional<OBSSceneCollection> foundCollection = - basic->GetSceneCollectionByName(opt_starting_collection); - - if (foundCollection) { - config_set_string(userConfig, "Basic", "SceneCollection", foundCollection.value().name.c_str()); - config_set_string(userConfig, "Basic", "SceneCollectionFile", - foundCollection.value().fileName.c_str()); - hasChanges = true; - } - } - - if (!opt_starting_profile.empty()) { - const OBSBasic *basic = reinterpret_cast<OBSBasic *>(GetMainWindow()); - - const std::optional<OBSProfile> foundProfile = basic->GetProfileByName(opt_starting_profile); - - if (foundProfile) { - config_set_string(userConfig, "Basic", "Profile", foundProfile.value().name.c_str()); - config_set_string(userConfig, "Basic", "ProfileDir", - foundProfile.value().directoryName.c_str()); - - hasChanges = true; - } - } - - if (hasChanges) { - config_save_safe(userConfig, "tmp", nullptr); - } - + MigrateLegacySettings(lastVersion); InitUserConfigDefaults(); return true; } -bool OBSApp::MigrateLegacySettings(const uint32_t lastVersion) +void OBSApp::MigrateLegacySettings(const uint32_t lastVersion) { bool hasChanges = false; @@ -766,7 +732,9 @@ hasChanges = true; } - return hasChanges; + if (hasChanges) { + userConfig.SaveSafe("tmp"); + } } static constexpr string_view OBSGlobalIniPath = "/obs-studio/global.ini"; @@ -800,7 +768,12 @@ return false; } - std::filesystem::copy(legacyGlobalConfigFile, userConfigFile); + try { + std::filesystem::copy(legacyGlobalConfigFile, userConfigFile); + } catch (const std::filesystem::filesystem_error &) { + OBSErrorBox(nullptr, "Unable to migrate global configuration - copy failed."); + return false; + } return true; } @@ -1537,6 +1510,35 @@ return std::stoull(timestring.str()); } +/* If upgrading from an older (non-XDG) build of OBS, move config files to XDG directory. */ +/* TODO: Remove after version 32.0. */ +#if defined(__FreeBSD__) +static void move_to_xdg(void) +{ + char old_path512; + char new_path512; + char *home = getenv("HOME"); + if (!home) + return; + + if (snprintf(old_path, sizeof(old_path), "%s/.obs-studio", home) <= 0) + return; + + /* make base xdg path if it doesn't already exist */ + if (GetAppConfigPath(new_path, sizeof(new_path), "") <= 0) + return; + if (os_mkdirs(new_path) == MKDIR_ERROR) + return; + + if (GetAppConfigPath(new_path, sizeof(new_path), "obs-studio") <= 0) + return; + + if (os_file_exists(old_path) && !os_file_exists(new_path)) { + rename(old_path, new_path); + } +} +#endif + static void delete_oldest_file(bool has_prefix, const char *location) { BPtr<char> logDir(GetAppConfigPathPtr(location)); @@ -2494,6 +2496,10 @@ base_get_log_handler(&def_log_handler, nullptr); +#if defined(__FreeBSD__) + move_to_xdg(); +#endif + obs_set_cmdline_args(argc, argv); for (int i = 1; i < argc; i++) {
View file
obs-studio-31.0.0~beta1.tar.xz/UI/obs-app.hpp -> obs-studio-31.0.0~beta2.tar.xz/UI/obs-app.hpp
Changed
@@ -113,7 +113,7 @@ bool InitGlobalLocationDefaults(); bool MigrateGlobalSettings(); - bool MigrateLegacySettings(uint32_t lastVersion); + void MigrateLegacySettings(uint32_t lastVersion); bool InitUserConfig(std::filesystem::path &userConfigLocation, uint32_t lastVersion); void InitUserConfigDefaults();
View file
obs-studio-31.0.0~beta1.tar.xz/UI/win-update/updater/CMakeLists.txt -> obs-studio-31.0.0~beta2.tar.xz/UI/win-update/updater/CMakeLists.txt
Changed
@@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.28...3.30) find_package(zstd) -find_package(nlohmann_json 3 REQUIRED) +find_package(nlohmann_json 3.11 REQUIRED) add_executable(updater WIN32)
View file
obs-studio-31.0.0~beta1.tar.xz/UI/window-basic-main-profiles.cpp -> obs-studio-31.0.0~beta2.tar.xz/UI/window-basic-main-profiles.cpp
Changed
@@ -43,6 +43,30 @@ extern void CheckExistingCookieId(); extern void DeleteCookies(); +// MARK: - Anonymous Namespace +namespace { +QList<QString> sortedProfiles{}; + +void updateSortedProfiles(const OBSProfileCache &profiles) +{ + const QLocale locale = QLocale::system(); + QList<QString> newList{}; + + for (auto profileName, _ : profiles) { + QString entry = QString::fromStdString(profileName); + newList.append(entry); + } + + std::sort(newList.begin(), newList.end(), &locale(const QString &lhs, const QString &rhs) -> bool { + int result = QString::localeAwareCompare(locale.toLower(lhs), locale.toLower(rhs)); + + return (result < 0); + }); + + sortedProfiles.swap(newList); +} +} // namespace + // MARK: - Main Profile Management Functions void OBSBasic::SetupNewProfile(const std::string &profileName, bool useWizard) @@ -234,7 +258,8 @@ } const std::string_view currentProfileName{config_get_string(App()->GetUserConfig(), "Basic", "Profile")}; - const std::string selectedProfileName{action->text().toStdString()}; + const QVariant qProfileName = action->property("profile_name"); + const std::string selectedProfileName{qProfileName.toString().toStdString()}; if (currentProfileName == selectedProfileName) { action->setChecked(true); @@ -246,7 +271,7 @@ if (!foundProfile) { const std::string errorMessage{"Selected profile not found: "}; - throw std::invalid_argument(errorMessage + currentProfileName.data()); + throw std::invalid_argument(errorMessage + selectedProfileName.data()); } const OBSProfile &selectedProfile = foundProfile.value(); @@ -277,18 +302,29 @@ if (refreshCache) { RefreshProfileCache(); } + updateSortedProfiles(profiles); size_t numAddedProfiles = 0; - for (auto &profileName, profile : profiles) { - QAction *action = new QAction(QString().fromStdString(profileName), this); - action->setProperty("file_name", QString().fromStdString(profile.directoryName)); - connect(action, &QAction::triggered, this, &OBSBasic::ChangeProfile); - action->setCheckable(true); - action->setChecked(profileName == currentProfileName); + for (auto &name : sortedProfiles) { + const std::string profileName = name.toStdString(); + try { + const OBSProfile &profile = profiles.at(profileName); + const QString qProfileName = QString().fromStdString(profileName); - ui->profileMenu->addAction(action); + QAction *action = new QAction(qProfileName, this); + action->setProperty("profile_name", qProfileName); + action->setProperty("file_name", QString().fromStdString(profile.directoryName)); + connect(action, &QAction::triggered, this, &OBSBasic::ChangeProfile); + action->setCheckable(true); + action->setChecked(profileName == currentProfileName); - numAddedProfiles += 1; + ui->profileMenu->addAction(action); + + numAddedProfiles += 1; + } catch (const std::out_of_range &error) { + blog(LOG_ERROR, "No profile with name %s found in profile cache.\n%s", profileName.c_str(), + error.what()); + } } ui->actionRemoveProfile->setEnabled(numAddedProfiles > 1); @@ -498,7 +534,7 @@ blog(LOG_ERROR, "%s", error.what()); } - const OBSProfile &newProfile = profiles.rbegin()->second; + const OBSProfile &newProfile = profiles.begin()->second; ActivateProfile(newProfile, true); RemoveProfile(currentProfile);
View file
obs-studio-31.0.0~beta1.tar.xz/UI/window-basic-main-scene-collections.cpp -> obs-studio-31.0.0~beta2.tar.xz/UI/window-basic-main-scene-collections.cpp
Changed
@@ -34,6 +34,30 @@ constexpr std::string_view OBSSceneCollectionPath = "/obs-studio/basic/scenes/"; +// MARK: - Anonymous Namespace +namespace { +QList<QString> sortedSceneCollections{}; + +void updateSortedSceneCollections(const OBSSceneCollectionCache &collections) +{ + const QLocale locale = QLocale::system(); + QList<QString> newList{}; + + for (auto collectionName, _ : collections) { + QString entry = QString::fromStdString(collectionName); + newList.append(entry); + } + + std::sort(newList.begin(), newList.end(), &locale(const QString &lhs, const QString &rhs) -> bool { + int result = QString::localeAwareCompare(locale.toLower(lhs), locale.toLower(rhs)); + + return (result < 0); + }); + + sortedSceneCollections.swap(newList); +} +} // namespace + // MARK: - Main Scene Collection Management Functions void OBSBasic::SetupNewSceneCollection(const std::string &collectionName) @@ -165,12 +189,8 @@ void OBSBasic::RemoveSceneCollection(OBSSceneCollection collection) { - std::filesystem::path collectionBackupFile{collection.collectionFile}; - collectionBackupFile.replace_extension("json.bak"); - try { std::filesystem::remove(collection.collectionFile); - std::filesystem::remove(collectionBackupFile); } catch (const std::filesystem::filesystem_error &error) { blog(LOG_DEBUG, "%s", error.what()); throw std::logic_error("Failed to remove scene collection file: " + collection.fileName); @@ -241,7 +261,8 @@ const std::string_view currentCollectionName{ config_get_string(App()->GetUserConfig(), "Basic", "SceneCollection")}; - const std::string selectedCollectionName{action->text().toStdString()}; + const QVariant qCollectionName = action->property("collection_name"); + const std::string selectedCollectionName{qCollectionName.toString().toStdString()}; if (currentCollectionName == selectedCollectionName) { action->setChecked(true); @@ -284,17 +305,29 @@ RefreshSceneCollectionCache(); } - size_t numAddedCollections = 0; - for (auto &collectionName, collection : collections) { - QAction *action = new QAction(QString().fromStdString(collectionName), this); - action->setProperty("file_name", QString().fromStdString(collection.fileName)); - connect(action, &QAction::triggered, this, &OBSBasic::ChangeSceneCollection); - action->setCheckable(true); - action->setChecked(collectionName == currentCollectionName); + updateSortedSceneCollections(collections); - ui->sceneCollectionMenu->addAction(action); - - numAddedCollections += 1; + size_t numAddedCollections = 0; + for (auto &name : sortedSceneCollections) { + const std::string collectionName = name.toStdString(); + try { + const OBSSceneCollection &collection = collections.at(collectionName); + const QString qCollectionName = QString().fromStdString(collectionName); + + QAction *action = new QAction(qCollectionName, this); + action->setProperty("collection_name", qCollectionName); + action->setProperty("file_name", QString().fromStdString(collection.fileName)); + connect(action, &QAction::triggered, this, &OBSBasic::ChangeSceneCollection); + action->setCheckable(true); + action->setChecked(collectionName == currentCollectionName); + + ui->sceneCollectionMenu->addAction(action); + + numAddedCollections += 1; + } catch (const std::out_of_range &error) { + blog(LOG_ERROR, "No scene collection with name %s found in scene collection cache.\n%s", + collectionName.c_str(), error.what()); + } } ui->actionRemoveSceneCollection->setEnabled(numAddedCollections > 1); @@ -507,7 +540,7 @@ blog(LOG_ERROR, "%s", error.what()); } - const OBSSceneCollection &newCollection = collections.rbegin()->second; + const OBSSceneCollection &newCollection = collections.begin()->second; ActivateSceneCollection(newCollection); RemoveSceneCollection(currentCollection);
View file
obs-studio-31.0.0~beta1.tar.xz/UI/window-basic-main.cpp -> obs-studio-31.0.0~beta2.tar.xz/UI/window-basic-main.cpp
Changed
@@ -121,6 +121,9 @@ QCefCookieManager *panel_cookies = nullptr; bool cef_js_avail = false; +extern std::string opt_starting_profile; +extern std::string opt_starting_collection; + void DestroyPanelCookieManager(); namespace { @@ -1876,22 +1879,22 @@ RefreshProfiles(true); - std::string currentProfileName{config_get_string(App()->GetUserConfig(), "Basic", "Profile")}; - - auto foundProfile = GetProfileByName(currentProfileName); - - if (!foundProfile) { - const OBSProfile &newProfile = CreateProfile(currentProfileName); + const std::string currentProfileName{config_get_string(App()->GetUserConfig(), "Basic", "Profile")}; + const std::optional<OBSProfile> currentProfile = GetProfileByName(currentProfileName); + const std::optional<OBSProfile> foundProfile = GetProfileByName(opt_starting_profile); - ActivateProfile(newProfile); - } else { - // TODO: Remove duplicate code from OBS initialization and just use ActivateProfile here instead - int code = activeConfiguration.Open(foundProfile.value().profileFile.u8string().c_str(), - CONFIG_OPEN_ALWAYS); - if (code != CONFIG_SUCCESS) { - OBSErrorBox(NULL, "Failed to open basic.ini: %d", code); - return false; + try { + if (foundProfile) { + ActivateProfile(foundProfile.value()); + } else if (currentProfile) { + ActivateProfile(currentProfile.value()); + } else { + const OBSProfile &newProfile = CreateProfile(currentProfileName); + ActivateProfile(newProfile); } + } catch (const std::logic_error &) { + OBSErrorBox(NULL, "Failed to open basic.ini: %d", -1); + return false; } return InitBasicConfigDefaults(); @@ -2170,19 +2173,22 @@ { ProfileScope("OBSBasic::Load"); - disableSaving--; - - try { - const OBSSceneCollection ¤tCollection = GetCurrentSceneCollection(); - ActivateSceneCollection(currentCollection); - } catch (const std::invalid_argument &) { - const std::string collectionName = - config_get_string(App()->GetUserConfig(), "Basic", "SceneCollection"); - - SetupNewSceneCollection(collectionName); + const std::string sceneCollectionName{ + config_get_string(App()->GetUserConfig(), "Basic", "SceneCollection")}; + const std::optional<OBSSceneCollection> configuredCollection = + GetSceneCollectionByName(sceneCollectionName); + const std::optional<OBSSceneCollection> foundCollection = + GetSceneCollectionByName(opt_starting_collection); + + if (foundCollection) { + ActivateSceneCollection(foundCollection.value()); + } else if (configuredCollection) { + ActivateSceneCollection(configuredCollection.value()); + } else { + disableSaving--; + SetupNewSceneCollection(sceneCollectionName); + disableSaving++; } - - disableSaving++; } loaded = true;
View file
obs-studio-31.0.0~beta1.tar.xz/libobs/CMakeLists.txt -> obs-studio-31.0.0~beta2.tar.xz/libobs/CMakeLists.txt
Changed
@@ -371,6 +371,7 @@ util/simde/x86/mmx.h util/simde/x86/sse.h util/simde/x86/sse2.h + util/source-profiler.h util/sse-intrin.h util/task.h util/text-lookup.h
View file
obs-studio-31.0.0~beta1.tar.xz/libobs/cmake/os-linux.cmake -> obs-studio-31.0.0~beta2.tar.xz/libobs/cmake/os-linux.cmake
Changed
@@ -20,7 +20,6 @@ target_compile_definitions( libobs PRIVATE - USE_XDG OBS_INSTALL_PREFIX="${OBS_INSTALL_PREFIX}" $<$<COMPILE_LANG_AND_ID:C,GNU>:ENABLE_DARRAY_TYPE_TEST> $<$<COMPILE_LANG_AND_ID:CXX,GNU>:ENABLE_DARRAY_TYPE_TEST>
View file
obs-studio-31.0.0~beta1.tar.xz/libobs/obs-scene.c -> obs-studio-31.0.0~beta2.tar.xz/libobs/obs-scene.c
Changed
@@ -27,7 +27,8 @@ static void resize_group(obs_sceneitem_t *group, bool scene_resize); static void resize_scene(obs_scene_t *scene); static void signal_parent(obs_scene_t *parent, const char *name, calldata_t *params); -static void get_ungrouped_transform(obs_sceneitem_t *group, struct vec2 *pos, struct vec2 *scale, float *rot); +static void get_ungrouped_transform(obs_sceneitem_t *group, obs_sceneitem_t *item, struct vec2 *pos, struct vec2 *scale, + float *rot); static inline bool crop_enabled(const struct obs_sceneitem_crop *crop); static inline bool item_texture_enabled(const struct obs_scene_item *item); static void init_hotkeys(obs_scene_t *scene, obs_sceneitem_t *item, const char *name); @@ -1313,7 +1314,7 @@ float rot = item->rot; if (backup_group) { - get_ungrouped_transform(backup_group, &pos, &scale, &rot); + get_ungrouped_transform(backup_group, item, &pos, &scale, &rot); } obs_data_set_string(item_data, "name", name); @@ -2363,7 +2364,7 @@ item->absolute_coordinates = scene->absolute_coordinates; os_atomic_set_long(&item->active_refs, 1); vec2_set(&item->scale, 1.0f, 1.0f); - vec2_set(&item->scale_ref, (float)scene_getwidth(scene), (float)scene_getheight(scene)); + get_scene_dimensions(item, &item->scale_ref.x, &item->scale_ref.y); matrix4_identity(&item->draw_transform); matrix4_identity(&item->box_transform); @@ -3483,27 +3484,46 @@ v2->y = v.y; } -static void get_ungrouped_transform(obs_sceneitem_t *group, struct vec2 *pos, struct vec2 *scale, float *rot) +static void get_ungrouped_transform(obs_sceneitem_t *group, obs_sceneitem_t *item, struct vec2 *pos, struct vec2 *scale, + float *rot) { struct matrix4 transform; struct matrix4 mat; struct vec4 x_base; + struct vec2 scale_abs, pos_abs; + + if (item->absolute_coordinates) { + vec2_copy(&scale_abs, scale); + vec2_copy(&pos_abs, pos); + } else { + size_to_absolute(&scale_abs, scale, item); + pos_to_absolute(&pos_abs, pos, item); + } vec4_set(&x_base, 1.0f, 0.0f, 0.0f, 0.0f); matrix4_copy(&transform, &group->draw_transform); - transform_val(pos, &transform); + transform_val(&pos_abs, &transform); vec4_set(&transform.t, 0.0f, 0.0f, 0.0f, 1.0f); - vec4_set(&mat.x, scale->x, 0.0f, 0.0f, 0.0f); - vec4_set(&mat.y, 0.0f, scale->y, 0.0f, 0.0f); + vec4_set(&mat.x, scale_abs.x, 0.0f, 0.0f, 0.0f); + vec4_set(&mat.y, 0.0f, scale_abs.y, 0.0f, 0.0f); vec4_set(&mat.z, 0.0f, 0.0f, 1.0f, 0.0f); vec4_set(&mat.t, 0.0f, 0.0f, 0.0f, 1.0f); matrix4_mul(&mat, &mat, &transform); - scale->x = vec4_len(&mat.x) * (scale->x > 0.0f ? 1.0f : -1.0f); - scale->y = vec4_len(&mat.y) * (scale->y > 0.0f ? 1.0f : -1.0f); + scale_abs.x = vec4_len(&mat.x) * (scale_abs.x > 0.0f ? 1.0f : -1.0f); + scale_abs.y = vec4_len(&mat.y) * (scale_abs.y > 0.0f ? 1.0f : -1.0f); + + if (item->absolute_coordinates) { + vec2_copy(scale, &scale_abs); + vec2_copy(pos, &pos_abs); + } else { + size_from_absolute(scale, &scale_abs, item); + pos_from_absolute(pos, &pos_abs, item); + } + *rot += group->rot; } @@ -3513,7 +3533,7 @@ if (!parent || !group) return; - get_ungrouped_transform(group, &item->pos, &item->scale, &item->rot); + get_ungrouped_transform(group, item, &item->pos, &item->scale, &item->rot); update_item_transform(item, false); } @@ -3524,21 +3544,37 @@ struct matrix4 mat; struct vec4 x_base; + struct vec2 scale_abs, pos_abs; + + if (item->absolute_coordinates) { + vec2_copy(&scale_abs, &item->scale); + vec2_copy(&pos_abs, &item->pos); + } else { + size_to_absolute(&scale_abs, &item->scale, item); + pos_to_absolute(&pos_abs, &item->pos, item); + } + vec4_set(&x_base, 1.0f, 0.0f, 0.0f, 0.0f); matrix4_inv(&transform, &group->draw_transform); - transform_val(&item->pos, &transform); + transform_val(&pos_abs, &transform); vec4_set(&transform.t, 0.0f, 0.0f, 0.0f, 1.0f); - vec4_set(&mat.x, item->scale.x, 0.0f, 0.0f, 0.0f); - vec4_set(&mat.y, 0.0f, item->scale.y, 0.0f, 0.0f); + vec4_set(&mat.x, scale_abs.x, 0.0f, 0.0f, 0.0f); + vec4_set(&mat.y, 0.0f, scale_abs.y, 0.0f, 0.0f); vec4_set(&mat.z, 0.0f, 0.0f, 1.0f, 0.0f); vec4_set(&mat.t, 0.0f, 0.0f, 0.0f, 1.0f); matrix4_mul(&mat, &mat, &transform); - item->scale.x = vec4_len(&mat.x) * (item->scale.x > 0.0f ? 1.0f : -1.0f); - item->scale.y = vec4_len(&mat.y) * (item->scale.y > 0.0f ? 1.0f : -1.0f); + if (item->absolute_coordinates) { + vec2_copy(&item->scale, &scale_abs); + vec2_copy(&item->pos, &pos_abs); + } else { + size_from_absolute(&item->scale, &scale_abs, item); + pos_from_absolute(&item->pos, &pos_abs, item); + } + item->rot -= group->rot; update_item_transform(item, false);
View file
obs-studio-31.0.0~beta1.tar.xz/libobs/util/platform-nix.c -> obs-studio-31.0.0~beta2.tar.xz/libobs/util/platform-nix.c
Changed
@@ -271,11 +271,9 @@ return ((uint64_t)ts.tv_sec * 1000000000ULL + (uint64_t)ts.tv_nsec); } -/* should return $HOME/.name, or when using XDG, - * should return $HOME/.config/name as default */ +/* should return $HOME/.config/name as default */ int os_get_config_path(char *dst, size_t size, const char *name) { -#ifdef USE_XDG char *xdg_ptr = getenv("XDG_CONFIG_HOME"); // If XDG_CONFIG_HOME is unset, @@ -296,23 +294,11 @@ else return snprintf(dst, size, "%s/%s", xdg_ptr, name); } -#else - char *path_ptr = getenv("HOME"); - if (path_ptr == NULL) - bcrash("Could not get $HOME\n"); - - if (!name || !*name) - return snprintf(dst, size, "%s", path_ptr); - else - return snprintf(dst, size, "%s/.%s", path_ptr, name); -#endif } -/* should return $HOME/.name, or when using XDG, - * should return $HOME/.config/name as default */ +/* should return $HOME/.config/name as default */ char *os_get_config_path_ptr(const char *name) { -#ifdef USE_XDG struct dstr path; char *xdg_ptr = getenv("XDG_CONFIG_HOME"); @@ -332,17 +318,6 @@ dstr_cat(&path, name); } return path.array; -#else - char *path_ptr = getenv("HOME"); - if (path_ptr == NULL) - bcrash("Could not get $HOME\n"); - - struct dstr path; - dstr_init_copy(&path, path_ptr); - dstr_cat(&path, "/."); - dstr_cat(&path, name); - return path.array; -#endif } int os_get_program_data_path(char *dst, size_t size, const char *name)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/.clang-format -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.clang-format
Changed
@@ -1,7 +1,6 @@ +# please use clang-format version 16 or later -# please use clang-format version 8 or later - -Standard: Cpp11 +Standard: c++17 AccessModifierOffset: -8 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false @@ -9,14 +8,14 @@ AlignEscapedNewlines: Left AlignOperands: true AlignTrailingComments: true -#AllowAllArgumentsOnNextLine: false # requires clang-format 9 -#AllowAllConstructorInitializersOnNextLine: false # requires clang-format 9 +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: false -#AllowShortLambdasOnASingleLine: Inline # requires clang-format 9 +AllowShortLambdasOnASingleLine: Inline AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None @@ -45,7 +44,7 @@ BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon BreakStringLiterals: false # apparently unpredictable -ColumnLimit: 80 +ColumnLimit: 120 CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 8 @@ -53,11 +52,12 @@ Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false -FixNamespaceComments: false -ForEachMacros: +FixNamespaceComments: true +ForEachMacros: - 'json_object_foreach' - 'json_object_foreach_safe' - 'json_array_foreach' + - 'HASH_ITER' IncludeBlocks: Preserve IndentCaseLabels: false IndentPPDirectives: None @@ -66,7 +66,7 @@ KeepEmptyLinesAtTheStartOfBlocks: true MaxEmptyLinesToKeep: 1 NamespaceIndentation: None -#ObjCBinPackProtocolList: Auto # requires clang-format 7 +ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 8 ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: true @@ -84,13 +84,13 @@ SortIncludes: false SortUsingDeclarations: false SpaceAfterCStyleCast: false -#SpaceAfterLogicalNot: false # requires clang-format 9 +SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true -#SpaceBeforeCtorInitializerColon: true # requires clang-format 7 -#SpaceBeforeInheritanceColon: true # requires clang-format 7 +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements -#SpaceBeforeRangeBasedForLoopColon: true # requires clang-format 7 +SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false @@ -98,11 +98,111 @@ SpacesInContainerLiterals: false SpacesInParentheses: false SpacesInSquareBrackets: false -#StatementMacros: # requires clang-format 8 -# - 'Q_OBJECT' +StatementMacros: + - 'Q_OBJECT' TabWidth: 8 -#TypenameMacros: # requires clang-format 9 -# - 'DARRAY' +TypenameMacros: + - 'DARRAY' UseTab: ForContinuationAndIndentation --- -Language: ObjC \ No newline at end of file +Language: ObjC +AccessModifierOffset: 2 +AlignArrayOfStructures: Right +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: + Enabled: true + AcrossEmptyLines: false + AcrossComments: true +AllowShortBlocksOnASingleLine: Never +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: None +AttributeMacros: '__unused', '__autoreleasing', '_Nonnull', '__bridge' +BitFieldColonSpacing: Both +#BreakBeforeBraces: Webkit +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: Never + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: true +BreakAfterAttributes: Never +BreakArrays: false +BreakBeforeConceptDeclarations: Allowed +BreakBeforeInlineASMColon: OnlyMultiline +BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterComma +ColumnLimit: 120 +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +IndentAccessModifiers: false +IndentCaseBlocks: false +IndentCaseLabels: true +IndentExternBlock: Indent +IndentGotoLabels: false +IndentRequiresClause: true +IndentWidth: 4 +IndentWrappedFunctionNames: true +InsertBraces: false +InsertNewlineAtEOF: true +KeepEmptyLinesAtTheStartOfBlocks: false +LambdaBodyIndentation: Signature +NamespaceIndentation: All +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 4 +ObjCBreakBeforeNestedBlockParam: false +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PPIndentWidth: -1 +PackConstructorInitializers: NextLine +QualifierAlignment: Leave +ReferenceAlignment: Right +RemoveSemicolon: false +RequiresClausePosition: WithPreceding +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SortIncludes: false +#SortUsingDeclarations: LexicographicNumeric +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAroundPointerQualifiers: Default +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInConditionalStatement: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +Standard: c++17 +TabWidth: 4 +UseTab: Never
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/actions
Added
+(directory)
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/actions/check-changes
Added
+(directory)
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/actions/check-changes/action.yaml
Added
@@ -0,0 +1,82 @@ +name: Check For Changed Files +description: Checks for changed files compared to specific git reference and glob expression +inputs: + baseRef: + description: Git reference to check against + required: false + ref: + description: Git reference to check with + required: false + default: HEAD + checkGlob: + description: Glob expression to limit check to specific files + required: false + useFallback: + description: Use fallback compare against prior commit + required: false + default: 'true' + diffFilter: + description: git diff-filter string to use + required: false + default: '' +outputs: + hasChangedFiles: + value: ${{ steps.checks.outputs.hasChangedFiles }} + description: True if specified files were changed in comparison to specified git reference + changedFiles: + value: ${{ steps.checks.outputs.changedFiles }} + description: List of changed files +runs: + using: composite + steps: + - name: Check For Changed Files ✅ + shell: bash + id: checks + env: + GIT_BASE_REF: ${{ inputs.baseRef }} + GIT_REF: ${{ inputs.ref }} + GITHUB_EVENT_FORCED: ${{ github.event.forced }} + GITHUB_REF_BEFORE: ${{ github.event.before }} + USE_FALLBACK: ${{ inputs.useFallback }} + DIFF_FILTER: ${{ inputs.diffFilter }} + run: | + : Check for Changed Files ✅ + if "${RUNNER_DEBUG}" ; then set -x; fi + shopt -s extglob + shopt -s dotglob + + # 4b825dc642cb6eb9a060e54bf8d69288fbee4904 is a "hidden" sha1 hash of + # the "empty tree", retrived via 'git hash-object -t tree /dev/null', + # and used here as a last-resort fallback to always provide a valid + # git ref. + + if "${GIT_BASE_REF}" ; then + if ! git cat-file -e "${GIT_BASE_REF}" &> /dev/null; then + echo "::warning::Provided base reference ${GIT_BASE_REF} is invalid" + if "${USE_FALLBACK}" == 'true' ; then + GIT_BASE_REF='HEAD~1' + fi + fi + else + if ! git cat-file -e ${GITHUB_REF_BEFORE} &> /dev/null; then + GITHUB_REF_BEFORE='4b825dc642cb6eb9a060e54bf8d69288fbee4904' + fi + + GIT_BASE_REF='HEAD~1' + case "${GITHUB_EVENT_NAME}" in + pull_request) GIT_BASE_REF="origin/${GITHUB_BASE_REF}" ;; + push) if "${GITHUB_EVENT_FORCED}" != 'true' ; then GIT_BASE_REF="${GITHUB_REF_BEFORE}"; fi ;; + *) ;; + esac + fi + + changes=($(git diff --name-only --diff-filter="${DIFF_FILTER}" ${GIT_BASE_REF} ${GIT_REF} -- ${{ inputs.checkGlob }})) + + if (( ${#changes@} )); then + file_string="${changes*}" + echo "hasChangedFiles=true" >> $GITHUB_OUTPUT + echo "changedFiles=\"${file_string// /\",\"}\"" >> $GITHUB_OUTPUT + else + echo "hasChangedFiles=false" >> $GITHUB_OUTPUT + echo "changedFiles=" >> GITHUB_OUTPUT + fi
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/actions/run-clang-format
Added
+(directory)
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/actions/run-clang-format/action.yaml
Added
@@ -0,0 +1,60 @@ +name: Run clang-format +description: Runs clang-format and checks for any changes introduced by it +inputs: + failCondition: + description: Controls whether failed checks also fail the workflow run + required: false + default: never + workingDirectory: + description: Working directory for checks + required: false + default: ${{ github.workspace }} +runs: + using: composite + steps: + - name: Check Runner Operating System 🏃♂️ + if: runner.os == 'Windows' + shell: bash + run: | + : Check Runner Operating System 🏃♂️ + echo "::notice::run-clang-format action requires a macOS-based or Linux-based runner." + exit 2 + + - name: Check for Changed Files ✅ + uses: ./.github/actions/check-changes + id: checks + with: + checkGlob: "'*.c' '*.h' '*.cpp' '*.hpp' '*.m' '*.mm'" + diffFilter: 'ACM' + + - name: Install Dependencies 🛍️ + if: runner.os == 'Linux' && fromJSON(steps.checks.outputs.hasChangedFiles) + shell: bash + run: | + : Install Dependencies 🛍️ + echo ::group::Install Dependencies + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH + echo "/home/linuxbrew/.linuxbrew/opt/clang-format@17/bin" >> $GITHUB_PATH + brew install --quiet zsh + echo ::endgroup:: + + - name: Run clang-format 🐉 + if: fromJSON(steps.checks.outputs.hasChangedFiles) + id: result + shell: zsh --no-rcs --errexit --pipefail {0} + working-directory: ${{ inputs.workingDirectory }} + env: + CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }} + run: | + : Run clang-format 🐉 + if (( ${+RUNNER_DEBUG} )) setopt XTRACE + + print ::group::Install clang-format-17 + brew install --quiet obsproject/tools/clang-format@17 + print ::endgroup:: + + print ::group::Run clang-format-17 + local -a changes=(${(s:,:)CHANGED_FILES//\\\'\"/}) + ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes} + print ::endgroup::
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/workflows/check-format.yaml
Added
@@ -0,0 +1,15 @@ +name: Check Code Formatting 🛠️ +on: + workflow_call: +jobs: + clang-format: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: clang-format Check 🐉 + id: clang-format + uses: ./.github/actions/run-clang-format + with: + failCondition: error
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/workflows/pr-pull.yaml
Added
@@ -0,0 +1,20 @@ +name: Pull +run-name: ${{ github.event.pull_request.title }} pull request run 🚀 +on: + workflow_dispatch: + pull_request: + paths-ignore: + - '**.md' + branches: master + types: opened, synchronize, reopened +permissions: + contents: read +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true +jobs: + check-format: + name: Format 🔍 + uses: ./.github/workflows/check-format.yaml + permissions: + contents: read
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/.github/workflows/push.yaml
Added
@@ -0,0 +1,20 @@ +name: Push +run-name: ${{ github.ref_name }} push run 🚀 +on: + push: + paths-ignore: + - '**.md' + branches: + - master + - 'release/**' + tags: + - '*' +permissions: + contents: write +jobs: + check-format: + name: Format 🔍 + if: github.ref_name == 'master' + uses: ./.github/workflows/check-format.yaml + permissions: + contents: read
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/CMakeLists.txt -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/CMakeLists.txt
Changed
@@ -9,8 +9,8 @@ return() endif() -find_package(CEF REQUIRED 95) -find_package(nlohmann_json REQUIRED) +find_package(CEF 95 REQUIRED) +find_package(nlohmann_json 3.11 REQUIRED) add_library(obs-browser MODULE) add_library(OBS::browser ALIAS obs-browser) @@ -31,7 +31,6 @@ cef-headers.hpp deps/base64/base64.cpp deps/base64/base64.hpp - deps/obs-websocket-api/obs-websocket-api.h deps/signal-restore.cpp deps/signal-restore.hpp deps/wide-string.cpp @@ -44,7 +43,7 @@ target_include_directories(obs-browser PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/deps") target_compile_features(obs-browser PRIVATE cxx_std_17) -target_link_libraries(obs-browser PRIVATE OBS::libobs OBS::frontend-api nlohmann_json::nlohmann_json) +target_link_libraries(obs-browser PRIVATE OBS::libobs OBS::frontend-api OBS::websocket-api nlohmann_json::nlohmann_json) if(OS_WINDOWS) include(cmake/os-windows.cmake)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-app.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-app.cpp
Changed
@@ -50,13 +50,10 @@ void BrowserApp::OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) { - registrar->AddCustomScheme("http", - CEF_SCHEME_OPTION_STANDARD | - CEF_SCHEME_OPTION_CORS_ENABLED); + registrar->AddCustomScheme("http", CEF_SCHEME_OPTION_STANDARD | CEF_SCHEME_OPTION_CORS_ENABLED); } -void BrowserApp::OnBeforeChildProcessLaunch( - CefRefPtr<CefCommandLine> command_line) +void BrowserApp::OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line) { #ifdef _WIN32 std::string pid = std::to_string(GetCurrentProcessId()); @@ -66,8 +63,7 @@ #endif } -void BrowserApp::OnBeforeCommandLineProcessing( - const CefString &, CefRefPtr<CefCommandLine> command_line) +void BrowserApp::OnBeforeCommandLineProcessing(const CefString &, CefRefPtr<CefCommandLine> command_line) { if (!shared_texture_available) { bool enableGPU = command_line->HasSwitch("enable-gpu"); @@ -80,56 +76,43 @@ if (command_line->HasSwitch("disable-features")) { // Don't override existing, as this can break OSR - std::string disableFeatures = - command_line->GetSwitchValue("disable-features"); + std::string disableFeatures = command_line->GetSwitchValue("disable-features"); disableFeatures += ",HardwareMediaKeyHandling"; disableFeatures += ",WebBluetooth"; - command_line->AppendSwitchWithValue("disable-features", - disableFeatures); + command_line->AppendSwitchWithValue("disable-features", disableFeatures); } else { - command_line->AppendSwitchWithValue("disable-features", - "WebBluetooth," - "HardwareMediaKeyHandling"); + command_line->AppendSwitchWithValue("disable-features", "WebBluetooth," + "HardwareMediaKeyHandling"); } - command_line->AppendSwitchWithValue("autoplay-policy", - "no-user-gesture-required"); + command_line->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required"); #ifdef __APPLE__ command_line->AppendSwitch("use-mock-keychain"); #elif !defined(_WIN32) - command_line->AppendSwitchWithValue("ozone-platform", - wayland ? "wayland" : "x11"); + command_line->AppendSwitchWithValue("ozone-platform", wayland ? "wayland" : "x11"); #endif } -std::vector<std::string> exposedFunctions = { - "getControlLevel", "getCurrentScene", "getStatus", - "startRecording", "stopRecording", "startStreaming", - "stopStreaming", "pauseRecording", "unpauseRecording", - "startReplayBuffer", "stopReplayBuffer", "saveReplayBuffer", - "startVirtualcam", "stopVirtualcam", "getScenes", - "setCurrentScene", "getTransitions", "getCurrentTransition", - "setCurrentTransition"}; - -void BrowserApp::OnContextCreated(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame>, - CefRefPtr<CefV8Context> context) +std::vector<std::string> exposedFunctions = {"getControlLevel", "getCurrentScene", "getStatus", + "startRecording", "stopRecording", "startStreaming", + "stopStreaming", "pauseRecording", "unpauseRecording", + "startReplayBuffer", "stopReplayBuffer", "saveReplayBuffer", + "startVirtualcam", "stopVirtualcam", "getScenes", + "setCurrentScene", "getTransitions", "getCurrentTransition", + "setCurrentTransition"}; + +void BrowserApp::OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, CefRefPtr<CefV8Context> context) { CefRefPtr<CefV8Value> globalObj = context->GetGlobal(); - CefRefPtr<CefV8Value> obsStudioObj = - CefV8Value::CreateObject(nullptr, nullptr); - globalObj->SetValue("obsstudio", obsStudioObj, - V8_PROPERTY_ATTRIBUTE_NONE); + CefRefPtr<CefV8Value> obsStudioObj = CefV8Value::CreateObject(nullptr, nullptr); + globalObj->SetValue("obsstudio", obsStudioObj, V8_PROPERTY_ATTRIBUTE_NONE); - CefRefPtr<CefV8Value> pluginVersion = - CefV8Value::CreateString(OBS_BROWSER_VERSION_STRING); - obsStudioObj->SetValue("pluginVersion", pluginVersion, - V8_PROPERTY_ATTRIBUTE_NONE); + CefRefPtr<CefV8Value> pluginVersion = CefV8Value::CreateString(OBS_BROWSER_VERSION_STRING); + obsStudioObj->SetValue("pluginVersion", pluginVersion, V8_PROPERTY_ATTRIBUTE_NONE); for (std::string name : exposedFunctions) { - CefRefPtr<CefV8Value> func = - CefV8Value::CreateFunction(name, this); + CefRefPtr<CefV8Value> func = CefV8Value::CreateFunction(name, this); obsStudioObj->SetValue(name, func, V8_PROPERTY_ATTRIBUTE_NONE); } @@ -143,9 +126,7 @@ #endif } -void BrowserApp::ExecuteJSFunction(CefRefPtr<CefBrowser> browser, - const char *functionName, - CefV8ValueList arguments) +void BrowserApp::ExecuteJSFunction(CefRefPtr<CefBrowser> browser, const char *functionName, CefV8ValueList arguments) { std::vector<CefString> names; browser->GetFrameNames(names); @@ -161,10 +142,8 @@ context->Enter(); CefRefPtr<CefV8Value> globalObj = context->GetGlobal(); - CefRefPtr<CefV8Value> obsStudioObj = - globalObj->GetValue("obsstudio"); - CefRefPtr<CefV8Value> jsFunction = - obsStudioObj->GetValue(functionName); + CefRefPtr<CefV8Value> obsStudioObj = globalObj->GetValue("obsstudio"); + CefRefPtr<CefV8Value> jsFunction = obsStudioObj->GetValue(functionName); if (jsFunction && jsFunction->IsFunction()) jsFunction->ExecuteFunction(nullptr, arguments); @@ -174,9 +153,7 @@ } #if !ENABLE_WASHIDDEN -void BrowserApp::SetFrameDocumentVisibility(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - bool isVisible) +void BrowserApp::SetFrameDocumentVisibility(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, bool isVisible) { UNUSED_PARAMETER(browser); @@ -189,15 +166,10 @@ CefRefPtr<CefV8Value> documentObject = globalObj->GetValue("document"); if (!!documentObject) { - documentObject->SetValue("hidden", - CefV8Value::CreateBool(!isVisible), - V8_PROPERTY_ATTRIBUTE_READONLY); + documentObject->SetValue("hidden", CefV8Value::CreateBool(!isVisible), V8_PROPERTY_ATTRIBUTE_READONLY); - documentObject->SetValue( - "visibilityState", - CefV8Value::CreateString(isVisible ? "visible" - : "hidden"), - V8_PROPERTY_ATTRIBUTE_READONLY); + documentObject->SetValue("visibilityState", CefV8Value::CreateString(isVisible ? "visible" : "hidden"), + V8_PROPERTY_ATTRIBUTE_READONLY); std::string script = "new CustomEvent('visibilitychange', {});"; @@ -206,28 +178,24 @@ /* Create the CustomEvent object * We have to use eval to invoke the new operator */ - bool success = context->Eval(script, frame->GetURL(), 0, - returnValue, exception); + bool success = context->Eval(script, frame->GetURL(), 0, returnValue, exception); if (success) { CefV8ValueList arguments; arguments.push_back(returnValue); - CefRefPtr<CefV8Value> dispatchEvent = - documentObject->GetValue("dispatchEvent"); + CefRefPtr<CefV8Value> dispatchEvent = documentObject->GetValue("dispatchEvent"); /* Dispatch visibilitychange event on the document * object */ - dispatchEvent->ExecuteFunction(documentObject, - arguments); + dispatchEvent->ExecuteFunction(documentObject, arguments); } } context->Exit(); } -void BrowserApp::SetDocumentVisibility(CefRefPtr<CefBrowser> browser, - bool isVisible) +void BrowserApp::SetDocumentVisibility(CefRefPtr<CefBrowser> browser, bool isVisible) { /* This method might be called before OnContextCreated * call is made. We'll save the requested visibility @@ -291,9 +259,7 @@ dict->GetKeys(keys); for (unsigned int i = 0; i < keys.size(); i++) { CefString key = keysi; - result->SetValue( - key, CefValueToCefV8Value(dict->GetValue(key)), - V8_PROPERTY_ATTRIBUTE_NONE); + result->SetValue(key, CefValueToCefV8Value(dict->GetValue(key)), V8_PROPERTY_ATTRIBUTE_NONE); } } break; case VTYPE_LIST: { @@ -301,18 +267,15 @@ size_t size = list->GetSize(); result = CefV8Value::CreateArray((int)size); for (size_t i = 0; i < size; i++) { - result->SetValue((int)i, CefValueToCefV8Value( - list->GetValue(i))); + result->SetValue((int)i, CefValueToCefV8Value(list->GetValue(i))); } } break; } return result; } -bool BrowserApp::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefProcessId source_process, - CefRefPtr<CefProcessMessage> message) +bool BrowserApp::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefProcessId source_process, CefRefPtr<CefProcessMessage> message) { UNUSED_PARAMETER(frame); DCHECK(source_process == PID_BROWSER); @@ -336,8 +299,7 @@ ExecuteJSFunction(browser, "onActiveChange", arguments); } else if (message->GetName() == "DispatchJSEvent") { - nlohmann::json payloadJson = nlohmann::json::parse( - args->GetString(1).ToString(), nullptr, false); + nlohmann::json payloadJson = nlohmann::json::parse(args->GetString(1).ToString(), nullptr, false); nlohmann::json wrapperJson; if (args->GetSize() > 1) @@ -371,22 +333,19 @@ /* Create the CustomEvent object * We have to use eval to invoke the new operator */ - context->Eval(script, browser->GetMainFrame()->GetURL(), - 0, returnValue, exception); + context->Eval(script, browser->GetMainFrame()->GetURL(), 0, returnValue, exception); CefV8ValueList arguments; arguments.push_back(returnValue); - CefRefPtr<CefV8Value> dispatchEvent = - globalObj->GetValue("dispatchEvent"); + CefRefPtr<CefV8Value> dispatchEvent = globalObj->GetValue("dispatchEvent"); dispatchEvent->ExecuteFunction(nullptr, arguments); context->Exit(); } } else if (message->GetName() == "executeCallback") { - CefRefPtr<CefV8Context> context = - browser->GetMainFrame()->GetV8Context(); + CefRefPtr<CefV8Context> context = browser->GetMainFrame()->GetV8Context(); context->Enter(); @@ -394,8 +353,7 @@ int callbackID = arguments->GetInt(0); CefString jsonString = arguments->GetString(1); - CefRefPtr<CefValue> json = - CefParseJSON(arguments->GetString(1).ToString(), {}); + CefRefPtr<CefValue> json = CefParseJSON(arguments->GetString(1).ToString(), {}); CefRefPtr<CefV8Value> callback = callbackMapcallbackID; CefV8ValueList args; @@ -421,13 +379,11 @@ bool IsValidFunction(std::string function) { std::vector<std::string>::iterator iterator; - iterator = std::find(exposedFunctions.begin(), exposedFunctions.end(), - function); + iterator = std::find(exposedFunctions.begin(), exposedFunctions.end(), function); return iterator != exposedFunctions.end(); } -bool BrowserApp::Execute(const CefString &name, CefRefPtr<CefV8Value>, - const CefV8ValueList &arguments, +bool BrowserApp::Execute(const CefString &name, CefRefPtr<CefV8Value>, const CefV8ValueList &arguments, CefRefPtr<CefV8Value> &, CefString &) { if (IsValidFunction(name.ToString())) { @@ -436,8 +392,7 @@ callbackMapcallbackId = arguments0; } - CefRefPtr<CefProcessMessage> msg = - CefProcessMessage::Create(name); + CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create(name); CefRefPtr<CefListValue> args = msg->GetArgumentList(); args->SetInt(0, callbackId); @@ -450,20 +405,16 @@ pos = l + 1; if (argumentsl->IsString()) - args->SetString(pos, - argumentsl->GetStringValue()); + args->SetString(pos, argumentsl->GetStringValue()); else if (argumentsl->IsInt()) args->SetInt(pos, argumentsl->GetIntValue()); else if (argumentsl->IsBool()) - args->SetBool(pos, - argumentsl->GetBoolValue()); + args->SetBool(pos, argumentsl->GetBoolValue()); else if (argumentsl->IsDouble()) - args->SetDouble(pos, - argumentsl->GetDoubleValue()); + args->SetDouble(pos, argumentsl->GetDoubleValue()); } - CefRefPtr<CefBrowser> browser = - CefV8Context::GetCurrentContext()->GetBrowser(); + CefRefPtr<CefBrowser> browser = CefV8Context::GetCurrentContext()->GetBrowser(); SendBrowserProcessMessage(browser, PID_BROWSER, msg); } else { @@ -483,8 +434,7 @@ std::lock_guard<std::mutex> lock(messageObject.browserTaskMutex); messageObject.browserTasks.emplace_back(browser, func); - QMetaObject::invokeMethod(&messageObject, "ExecuteNextBrowserTask", - Qt::QueuedConnection); + QMetaObject::invokeMethod(&messageObject, "ExecuteNextBrowserTask", Qt::QueuedConnection); } bool MessageObject::ExecuteNextBrowserTask() @@ -511,8 +461,7 @@ void MessageObject::DoCefMessageLoop(int ms) { if (ms) - QTimer::singleShot((int)ms + 2, - () { CefDoMessageLoopWork(); }); + QTimer::singleShot((int)ms + 2, () { CefDoMessageLoopWork(); }); else CefDoMessageLoopWork(); } @@ -524,8 +473,7 @@ void ProcessCef() { - QMetaObject::invokeMethod(&messageObject, "DoCefMessageLoop", - Qt::QueuedConnection, Q_ARG(int, (int)0)); + QMetaObject::invokeMethod(&messageObject, "DoCefMessageLoop", Qt::QueuedConnection, Q_ARG(int, (int)0)); } #define MAX_DELAY (1000 / 30) @@ -542,14 +490,11 @@ delay_ms = MAX_DELAY; if (!frameTimer.isActive()) { - QObject::connect(&frameTimer, &QTimer::timeout, &messageObject, - &MessageObject::Process); + QObject::connect(&frameTimer, &QTimer::timeout, &messageObject, &MessageObject::Process); frameTimer.setSingleShot(false); frameTimer.start(33); } - QMetaObject::invokeMethod(&messageObject, "DoCefMessageLoop", - Qt::QueuedConnection, - Q_ARG(int, (int)delay_ms)); + QMetaObject::invokeMethod(&messageObject, "DoCefMessageLoop", Qt::QueuedConnection, Q_ARG(int, (int)delay_ms)); } #endif
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-app.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-app.hpp
Changed
@@ -36,18 +36,14 @@ class MessageObject : public QObject { Q_OBJECT - friend void QueueBrowserTask(CefRefPtr<CefBrowser> browser, - BrowserFunc func); + friend void QueueBrowserTask(CefRefPtr<CefBrowser> browser, BrowserFunc func); struct Task { CefRefPtr<CefBrowser> browser; BrowserFunc func; inline Task() {} - inline Task(CefRefPtr<CefBrowser> browser_, BrowserFunc func_) - : browser(browser_), func(func_) - { - } + inline Task(CefRefPtr<CefBrowser> browser_, BrowserFunc func_) : browser(browser_), func(func_) {} }; std::mutex browserTaskMutex; @@ -63,14 +59,9 @@ extern void QueueBrowserTask(CefRefPtr<CefBrowser> browser, BrowserFunc func); #endif -class BrowserApp : public CefApp, - public CefRenderProcessHandler, - public CefBrowserProcessHandler, - public CefV8Handler { +class BrowserApp : public CefApp, public CefRenderProcessHandler, public CefBrowserProcessHandler, public CefV8Handler { - void ExecuteJSFunction(CefRefPtr<CefBrowser> browser, - const char *functionName, - CefV8ValueList arguments); + void ExecuteJSFunction(CefRefPtr<CefBrowser> browser, const char *functionName, CefV8ValueList arguments); typedef std::map<int, CefRefPtr<CefV8Value>> CallbackMap; @@ -83,41 +74,28 @@ public: #if defined(__APPLE__) || defined(_WIN32) - inline BrowserApp(bool shared_texture_available_ = false) - : shared_texture_available(shared_texture_available_) + inline BrowserApp(bool shared_texture_available_ = false) : shared_texture_available(shared_texture_available_) #else - inline BrowserApp(bool shared_texture_available_ = false, - bool wayland_ = false) + inline BrowserApp(bool shared_texture_available_ = false, bool wayland_ = false) : shared_texture_available(shared_texture_available_), wayland(wayland_) #endif { } - virtual CefRefPtr<CefRenderProcessHandler> - GetRenderProcessHandler() override; - virtual CefRefPtr<CefBrowserProcessHandler> - GetBrowserProcessHandler() override; - virtual void OnBeforeChildProcessLaunch( - CefRefPtr<CefCommandLine> command_line) override; - virtual void OnRegisterCustomSchemes( - CefRawPtr<CefSchemeRegistrar> registrar) override; - virtual void OnBeforeCommandLineProcessing( - const CefString &process_type, - CefRefPtr<CefCommandLine> command_line) override; - virtual void OnContextCreated(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, + virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override; + virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override; + virtual void OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line) override; + virtual void OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) override; + virtual void OnBeforeCommandLineProcessing(const CefString &process_type, + CefRefPtr<CefCommandLine> command_line) override; + virtual void OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override; - virtual bool - OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefProcessId source_process, - CefRefPtr<CefProcessMessage> message) override; - virtual bool Execute(const CefString &name, - CefRefPtr<CefV8Value> object, - const CefV8ValueList &arguments, - CefRefPtr<CefV8Value> &retval, - CefString &exception) override; + virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefProcessId source_process, + CefRefPtr<CefProcessMessage> message) override; + virtual bool Execute(const CefString &name, CefRefPtr<CefV8Value> object, const CefV8ValueList &arguments, + CefRefPtr<CefV8Value> &retval, CefString &exception) override; #ifdef ENABLE_BROWSER_QT_LOOP #if CHROME_VERSION_BUILD < 5938 @@ -131,11 +109,8 @@ #if !ENABLE_WASHIDDEN std::unordered_map<int, bool> browserVis; - void SetFrameDocumentVisibility(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - bool isVisible); - void SetDocumentVisibility(CefRefPtr<CefBrowser> browser, - bool isVisible); + void SetFrameDocumentVisibility(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, bool isVisible); + void SetDocumentVisibility(CefRefPtr<CefBrowser> browser, bool isVisible); #endif IMPLEMENT_REFCOUNTING(BrowserApp);
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-client.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-client.cpp
Changed
@@ -71,9 +71,10 @@ return this; } -CefRefPtr<CefResourceRequestHandler> BrowserClient::GetResourceRequestHandler( - CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, - CefRefPtr<CefRequest> request, bool, bool, const CefString &, bool &) +CefRefPtr<CefResourceRequestHandler> BrowserClient::GetResourceRequestHandler(CefRefPtr<CefBrowser>, + CefRefPtr<CefFrame>, + CefRefPtr<CefRequest> request, bool, bool, + const CefString &, bool &) { if (request->GetHeaderByName("origin") == "null") { return this; @@ -82,38 +83,31 @@ return nullptr; } -CefResourceRequestHandler::ReturnValue -BrowserClient::OnBeforeResourceLoad(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, - CefRefPtr<CefRequest>, - CefRefPtr<CefCallback>) +CefResourceRequestHandler::ReturnValue BrowserClient::OnBeforeResourceLoad(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, + CefRefPtr<CefRequest>, + CefRefPtr<CefCallback>) { return RV_CONTINUE; } #endif -bool BrowserClient::OnBeforePopup(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, - const CefString &, const CefString &, - cef_window_open_disposition_t, bool, - const CefPopupFeatures &, CefWindowInfo &, - CefRefPtr<CefClient> &, CefBrowserSettings &, - CefRefPtr<CefDictionaryValue> &, bool *) +bool BrowserClient::OnBeforePopup(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, const CefString &, const CefString &, + cef_window_open_disposition_t, bool, const CefPopupFeatures &, CefWindowInfo &, + CefRefPtr<CefClient> &, CefBrowserSettings &, CefRefPtr<CefDictionaryValue> &, bool *) { /* block popups */ return true; } -void BrowserClient::OnBeforeContextMenu(CefRefPtr<CefBrowser>, - CefRefPtr<CefFrame>, - CefRefPtr<CefContextMenuParams>, +void BrowserClient::OnBeforeContextMenu(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefContextMenuParams>, CefRefPtr<CefMenuModel> model) { /* remove all context menu contributions */ model->Clear(); } -bool BrowserClient::OnProcessMessageReceived( - CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, CefProcessId, - CefRefPtr<CefProcessMessage> message) +bool BrowserClient::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, CefProcessId, + CefRefPtr<CefProcessMessage> message) { const std::string &name = message->GetName(); CefRefPtr<CefListValue> input_args = message->GetArgumentList(); @@ -150,35 +144,27 @@ } else if (name == "stopReplayBuffer") { obs_frontend_replay_buffer_stop(); } else if (name == "setCurrentScene") { - const std::string scene_name = - input_args->GetString(1).ToString(); - OBSSourceAutoRelease source = - obs_get_source_by_name(scene_name.c_str()); + const std::string scene_name = input_args->GetString(1).ToString(); + OBSSourceAutoRelease source = obs_get_source_by_name(scene_name.c_str()); if (!source) { blog(LOG_WARNING, "Browser source '%s' tried to switch to scene '%s' which doesn't exist", - obs_source_get_name(bs->source), - scene_name.c_str()); + obs_source_get_name(bs->source), scene_name.c_str()); } else if (!obs_source_is_scene(source)) { - blog(LOG_WARNING, - "Browser source '%s' tried to switch to '%s' which isn't a scene", - obs_source_get_name(bs->source), - scene_name.c_str()); + blog(LOG_WARNING, "Browser source '%s' tried to switch to '%s' which isn't a scene", + obs_source_get_name(bs->source), scene_name.c_str()); } else { obs_frontend_set_current_scene(source); } } else if (name == "setCurrentTransition") { - const std::string transition_name = - input_args->GetString(1).ToString(); + const std::string transition_name = input_args->GetString(1).ToString(); obs_frontend_source_list transitions = {}; obs_frontend_get_transitions(&transitions); OBSSourceAutoRelease transition; for (size_t i = 0; i < transitions.sources.num; i++) { - obs_source_t *source = - transitions.sources.arrayi; - if (obs_source_get_name(source) == - transition_name) { + obs_source_t *source = transitions.sources.arrayi; + if (obs_source_get_name(source) == transition_name) { transition = obs_source_get_ref(source); break; } @@ -191,8 +177,7 @@ else blog(LOG_WARNING, "Browser source '%s' tried to change the current transition to '%s' which doesn't exist", - obs_source_get_name(bs->source), - transition_name.c_str()); + obs_source_get_name(bs->source), transition_name.c_str()); } fallthrough; case ControlLevel::Basic: @@ -207,14 +192,12 @@ std::vector<nlohmann::json> scenes_vector; for (size_t i = 0; i < list.sources.num; i++) { obs_source_t *source = list.sources.arrayi; - scenes_vector.push_back( - obs_source_get_name(source)); + scenes_vector.push_back(obs_source_get_name(source)); } json = scenes_vector; obs_frontend_source_list_free(&list); } else if (name == "getCurrentScene") { - OBSSourceAutoRelease current_scene = - obs_frontend_get_current_scene(); + OBSSourceAutoRelease current_scene = obs_frontend_get_current_scene(); if (!current_scene) return false; @@ -225,22 +208,19 @@ json = {{"name", name}, {"width", obs_source_get_width(current_scene)}, - {"height", - obs_source_get_height(current_scene)}}; + {"height", obs_source_get_height(current_scene)}}; } else if (name == "getTransitions") { struct obs_frontend_source_list list = {}; obs_frontend_get_transitions(&list); std::vector<nlohmann::json> transitions_vector; for (size_t i = 0; i < list.sources.num; i++) { obs_source_t *source = list.sources.arrayi; - transitions_vector.push_back( - obs_source_get_name(source)); + transitions_vector.push_back(obs_source_get_name(source)); } json = transitions_vector; obs_frontend_source_list_free(&list); } else if (name == "getCurrentTransition") { - OBSSourceAutoRelease source = - obs_frontend_get_current_transition(); + OBSSourceAutoRelease source = obs_frontend_get_current_transition(); json = obs_source_get_name(source); } fallthrough; @@ -248,12 +228,9 @@ if (name == "getStatus") { json = {{"recording", obs_frontend_recording_active()}, {"streaming", obs_frontend_streaming_active()}, - {"recordingPaused", - obs_frontend_recording_paused()}, - {"replaybuffer", - obs_frontend_replay_buffer_active()}, - {"virtualcam", - obs_frontend_virtualcam_active()}}; + {"recordingPaused", obs_frontend_recording_paused()}, + {"replaybuffer", obs_frontend_replay_buffer_active()}, + {"virtualcam", obs_frontend_virtualcam_active()}}; } fallthrough; case ControlLevel::None: @@ -262,8 +239,7 @@ } } - CefRefPtr<CefProcessMessage> msg = - CefProcessMessage::Create("executeCallback"); + CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("executeCallback"); CefRefPtr<CefListValue> execute_args = msg->GetArgumentList(); execute_args->SetInt(0, input_args->GetInt(0)); @@ -281,23 +257,19 @@ return; } - rect.Set(0, 0, bs->width < 1 ? 1 : bs->width, - bs->height < 1 ? 1 : bs->height); + rect.Set(0, 0, bs->width < 1 ? 1 : bs->width, bs->height < 1 ? 1 : bs->height); } bool BrowserClient::OnTooltip(CefRefPtr<CefBrowser>, CefString &text) { std::string str_text = text; - QMetaObject::invokeMethod( - QCoreApplication::instance()->thread(), str_text() { - QToolTip::showText(QCursor::pos(), str_text.c_str()); - }); + QMetaObject::invokeMethod(QCoreApplication::instance()->thread(), + str_text() { QToolTip::showText(QCursor::pos(), str_text.c_str()); }); return true; } -void BrowserClient::OnPaint(CefRefPtr<CefBrowser>, PaintElementType type, - const RectList &, const void *buffer, int width, - int height) +void BrowserClient::OnPaint(CefRefPtr<CefBrowser>, PaintElementType type, const RectList &, const void *buffer, + int width, int height) { if (type != PET_VIEW) { // TODO Overlay texture on top of bs->texture @@ -322,16 +294,13 @@ if (!bs->texture && width && height) { obs_enter_graphics(); - bs->texture = gs_texture_create(width, height, GS_BGRA, 1, - (const uint8_t **)&buffer, - GS_DYNAMIC); + bs->texture = gs_texture_create(width, height, GS_BGRA, 1, (const uint8_t **)&buffer, GS_DYNAMIC); bs->width = width; bs->height = height; obs_leave_graphics(); } else { obs_enter_graphics(); - gs_texture_set_image(bs->texture, (const uint8_t *)buffer, - width * 4, false); + gs_texture_set_image(bs->texture, (const uint8_t *)buffer, width * 4, false); obs_leave_graphics(); } } @@ -342,21 +311,17 @@ if (bs->texture) { const uint32_t cx = gs_texture_get_width(bs->texture); const uint32_t cy = gs_texture_get_height(bs->texture); - const gs_color_format format = - gs_texture_get_color_format(bs->texture); - const gs_color_format linear_format = - gs_generalize_format(format); + const gs_color_format format = gs_texture_get_color_format(bs->texture); + const gs_color_format linear_format = gs_generalize_format(format); if (linear_format != format) { - if (!bs->extra_texture || - bs->last_format != linear_format || - bs->last_cx != cx || bs->last_cy != cy) { + if (!bs->extra_texture || bs->last_format != linear_format || bs->last_cx != cx || + bs->last_cy != cy) { if (bs->extra_texture) { gs_texture_destroy(bs->extra_texture); bs->extra_texture = nullptr; } - bs->extra_texture = gs_texture_create( - cx, cy, linear_format, 1, nullptr, 0); + bs->extra_texture = gs_texture_create(cx, cy, linear_format, 1, nullptr, 0); bs->last_cx = cx; bs->last_cy = cy; bs->last_format = linear_format; @@ -371,8 +336,7 @@ } } -void BrowserClient::OnAcceleratedPaint(CefRefPtr<CefBrowser>, - PaintElementType type, const RectList &, +void BrowserClient::OnAcceleratedPaint(CefRefPtr<CefBrowser>, PaintElementType type, const RectList &, #if CHROME_VERSION_BUILD >= 6367 const CefAcceleratedPaintInfo &info) #else @@ -404,16 +368,13 @@ } #if defined(__APPLE__) && CHROME_VERSION_BUILD > 6367 - bs->texture = gs_texture_create_from_iosurface( - (IOSurfaceRef)(uintptr_t)info.shared_texture_io_surface); + bs->texture = gs_texture_create_from_iosurface((IOSurfaceRef)(uintptr_t)info.shared_texture_io_surface); #elif defined(__APPLE__) && CHROME_VERSION_BUILD > 4183 - bs->texture = gs_texture_create_from_iosurface( - (IOSurfaceRef)(uintptr_t)shared_handle); + bs->texture = gs_texture_create_from_iosurface((IOSurfaceRef)(uintptr_t)shared_handle); #elif defined(_WIN32) && CHROME_VERSION_BUILD > 4183 bs->texture = #if CHROME_VERSION_BUILD >= 6367 - gs_texture_open_nt_shared( - (uint32_t)(uintptr_t)info.shared_texture_handle); + gs_texture_open_nt_shared((uint32_t)(uintptr_t)info.shared_texture_handle); #else gs_texture_open_nt_shared((uint32_t)(uintptr_t)shared_handle); #endif @@ -421,8 +382,7 @@ // gs_texture_acquire_sync(bs->texture, 1, INFINITE); #else - bs->texture = - gs_texture_open_shared((uint32_t)(uintptr_t)shared_handle); + bs->texture = gs_texture_open_shared((uint32_t)(uintptr_t)shared_handle); #endif UpdateExtraTexture(); obs_leave_graphics(); @@ -437,8 +397,7 @@ } #ifdef CEF_ON_ACCELERATED_PAINT2 -void BrowserClient::OnAcceleratedPaint2(CefRefPtr<CefBrowser>, - PaintElementType type, const RectList &, +void BrowserClient::OnAcceleratedPaint2(CefRefPtr<CefBrowser>, PaintElementType type, const RectList &, void *shared_handle, bool new_texture) { if (type != PET_VIEW) { @@ -462,15 +421,12 @@ } #if defined(__APPLE__) && CHROME_VERSION_BUILD > 4183 - bs->texture = gs_texture_create_from_iosurface( - (IOSurfaceRef)(uintptr_t)shared_handle); + bs->texture = gs_texture_create_from_iosurface((IOSurfaceRef)(uintptr_t)shared_handle); #elif defined(_WIN32) && CHROME_VERSION_BUILD > 4183 - bs->texture = - gs_texture_open_nt_shared((uint32_t)(uintptr_t)shared_handle); + bs->texture = gs_texture_open_nt_shared((uint32_t)(uintptr_t)shared_handle); #else - bs->texture = - gs_texture_open_shared((uint32_t)(uintptr_t)shared_handle); + bs->texture = gs_texture_open_shared((uint32_t)(uintptr_t)shared_handle); #endif UpdateExtraTexture(); obs_leave_graphics(); @@ -510,8 +466,7 @@ } #if CHROME_VERSION_BUILD >= 4103 -void BrowserClient::OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, - const CefAudioParameters ¶ms_, +void BrowserClient::OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, const CefAudioParameters ¶ms_, int channels_) { UNUSED_PARAMETER(browser); @@ -521,9 +476,7 @@ frames_per_buffer = params_.frames_per_buffer; } -void BrowserClient::OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, - const float **data, int frames, - int64_t pts) +void BrowserClient::OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, const float **data, int frames, int64_t pts) { UNUSED_PARAMETER(browser); if (!valid()) { @@ -548,8 +501,7 @@ UNUSED_PARAMETER(browser); } -void BrowserClient::OnAudioStreamError(CefRefPtr<CefBrowser> browser, - const CefString &message) +void BrowserClient::OnAudioStreamError(CefRefPtr<CefBrowser> browser, const CefString &message) { UNUSED_PARAMETER(browser); UNUSED_PARAMETER(message); @@ -577,8 +529,7 @@ } } -bool BrowserClient::GetAudioParameters(CefRefPtr<CefBrowser> browser, - CefAudioParameters ¶ms) +bool BrowserClient::GetAudioParameters(CefRefPtr<CefBrowser> browser, CefAudioParameters ¶ms) { UNUSED_PARAMETER(browser); int channels = (int)audio_output_get_channels(obs_get_audio()); @@ -588,8 +539,7 @@ return true; } #elif CHROME_VERSION_BUILD < 4103 -void BrowserClient::OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, int id, - int, ChannelLayout channel_layout, +void BrowserClient::OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, int id, int, ChannelLayout channel_layout, int sample_rate, int) { UNUSED_PARAMETER(browser); @@ -599,8 +549,7 @@ AudioStream &stream = bs->audio_streamsid; if (!stream.source) { - stream.source = obs_source_create_private("audio_line", nullptr, - nullptr); + stream.source = obs_source_create_private("audio_line", nullptr, nullptr); obs_source_add_active_child(bs->source, stream.source); @@ -613,8 +562,7 @@ stream.sample_rate = sample_rate; } -void BrowserClient::OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, int id, - const float **data, int frames, +void BrowserClient::OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, int id, const float **data, int frames, int64_t pts) { UNUSED_PARAMETER(browser); @@ -656,8 +604,7 @@ for (size_t i = 0; i < bs->audio_sources.size(); i++) { obs_source_t *source = bs->audio_sourcesi; if (source == stream.source) { - bs->audio_sources.erase( - bs->audio_sources.begin() + i); + bs->audio_sources.erase(bs->audio_sources.begin() + i); break; } } @@ -666,16 +613,14 @@ } #endif -void BrowserClient::OnLoadEnd(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame> frame, - int) +void BrowserClient::OnLoadEnd(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame> frame, int) { if (!valid()) { return; } if (frame->IsMain() && bs->css.length()) { - std::string uriEncodedCSS = - CefURIEncode(bs->css, false).ToString(); + std::string uriEncodedCSS = CefURIEncode(bs->css, false).ToString(); std::string script; script += "const obsCSS = document.createElement('style');"; @@ -688,9 +633,7 @@ } } -bool BrowserClient::OnConsoleMessage(CefRefPtr<CefBrowser>, - cef_log_severity_t level, - const CefString &message, +bool BrowserClient::OnConsoleMessage(CefRefPtr<CefBrowser>, cef_log_severity_t level, const CefString &message, const CefString &source, int line) { int errorLevel = LOG_INFO; @@ -713,7 +656,7 @@ if (bs && bs->source) sourceName = obs_source_get_name(bs->source); - blog(errorLevel, "obs-browser: '%s' %s: %s (%s:%d)", sourceName, code, - message.ToString().c_str(), source.ToString().c_str(), line); + blog(errorLevel, "obs-browser: '%s' %s: %s (%s:%d)", sourceName, code, message.ToString().c_str(), + source.ToString().c_str(), line); return false; }
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-client.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-client.hpp
Changed
@@ -56,8 +56,7 @@ ChannelLayout channel_layout; int frames_per_buffer; #endif - inline BrowserClient(BrowserSource *bs_, bool sharing_avail, - bool reroute_audio_, + inline BrowserClient(BrowserSource *bs_, bool sharing_avail, bool reroute_audio_, ControlLevel webpage_control_level_) : sharing_available(sharing_avail), reroute_audio(reroute_audio_), @@ -74,118 +73,84 @@ #if CHROME_VERSION_BUILD >= 4638 virtual CefRefPtr<CefRequestHandler> GetRequestHandler() override; #endif - virtual CefRefPtr<CefContextMenuHandler> - GetContextMenuHandler() override; + virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() override; virtual CefRefPtr<CefAudioHandler> GetAudioHandler() override; - virtual bool - OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefProcessId source_process, - CefRefPtr<CefProcessMessage> message) override; + virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefProcessId source_process, + CefRefPtr<CefProcessMessage> message) override; /* CefDisplayHandler */ - virtual bool OnConsoleMessage(CefRefPtr<CefBrowser> browser, - cef_log_severity_t level, - const CefString &message, - const CefString &source, - int line) override; - virtual bool OnTooltip(CefRefPtr<CefBrowser> browser, - CefString &text) override; + virtual bool OnConsoleMessage(CefRefPtr<CefBrowser> browser, cef_log_severity_t level, const CefString &message, + const CefString &source, int line) override; + virtual bool OnTooltip(CefRefPtr<CefBrowser> browser, CefString &text) override; /* CefLifeSpanHandler */ - virtual bool - OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, - const CefString &target_url, - const CefString &target_frame_name, - cef_window_open_disposition_t target_disposition, - bool user_gesture, const CefPopupFeatures &popupFeatures, - CefWindowInfo &windowInfo, CefRefPtr<CefClient> &client, - CefBrowserSettings &settings, - CefRefPtr<CefDictionaryValue> &extra_info, - bool *no_javascript_access) override; + virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + const CefString &target_url, const CefString &target_frame_name, + cef_window_open_disposition_t target_disposition, bool user_gesture, + const CefPopupFeatures &popupFeatures, CefWindowInfo &windowInfo, + CefRefPtr<CefClient> &client, CefBrowserSettings &settings, + CefRefPtr<CefDictionaryValue> &extra_info, bool *no_javascript_access) override; #if CHROME_VERSION_BUILD >= 4638 /* CefRequestHandler */ - virtual CefRefPtr<CefResourceRequestHandler> GetResourceRequestHandler( - CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, - CefRefPtr<CefRequest> request, bool is_navigation, - bool is_download, const CefString &request_initiator, - bool &disable_default_handling) override; + virtual CefRefPtr<CefResourceRequestHandler> + GetResourceRequestHandler(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefRefPtr<CefRequest> request, bool is_navigation, bool is_download, + const CefString &request_initiator, bool &disable_default_handling) override; /* CefResourceRequestHandler */ - virtual CefResourceRequestHandler::ReturnValue - OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefRefPtr<CefRequest> request, - CefRefPtr<CefCallback> callback) override; + virtual CefResourceRequestHandler::ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, + CefRefPtr<CefFrame> frame, + CefRefPtr<CefRequest> request, + CefRefPtr<CefCallback> callback) override; #endif /* CefContextMenuHandler */ - virtual void - OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefRefPtr<CefContextMenuParams> params, - CefRefPtr<CefMenuModel> model) override; + virtual void OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefRefPtr<CefContextMenuParams> params, + CefRefPtr<CefMenuModel> model) override; /* CefRenderHandler */ - virtual void GetViewRect(CefRefPtr<CefBrowser> browser, - CefRect &rect) override; - virtual void OnPaint(CefRefPtr<CefBrowser> browser, - PaintElementType type, const RectList &dirtyRects, - const void *buffer, int width, - int height) override; + virtual void GetViewRect(CefRefPtr<CefBrowser> browser, CefRect &rect) override; + virtual void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList &dirtyRects, + const void *buffer, int width, int height) override; #ifdef ENABLE_BROWSER_SHARED_TEXTURE - virtual void - OnAcceleratedPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, - const RectList &dirtyRects, + virtual void OnAcceleratedPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, + const RectList &dirtyRects, #if CHROME_VERSION_BUILD >= 6367 - const CefAcceleratedPaintInfo &info) override; + const CefAcceleratedPaintInfo &info) override; #else - void *shared_handle) override; + void *shared_handle) override; #endif #ifdef CEF_ON_ACCELERATED_PAINT2 - virtual void OnAcceleratedPaint2(CefRefPtr<CefBrowser> browser, - PaintElementType type, - const RectList &dirtyRects, - void *shared_handle, - bool new_texture) override; + virtual void OnAcceleratedPaint2(CefRefPtr<CefBrowser> browser, PaintElementType type, + const RectList &dirtyRects, void *shared_handle, bool new_texture) override; #endif #endif #if CHROME_VERSION_BUILD >= 4103 - virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, - const float **data, int frames, + virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, const float **data, int frames, int64_t pts) override; - virtual void - OnAudioStreamStopped(CefRefPtr<CefBrowser> browser) override; + virtual void OnAudioStreamStopped(CefRefPtr<CefBrowser> browser) override; - virtual void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, - const CefAudioParameters ¶ms, + virtual void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, const CefAudioParameters ¶ms, int channels) override; - virtual void OnAudioStreamError(CefRefPtr<CefBrowser> browser, - const CefString &message) override; + virtual void OnAudioStreamError(CefRefPtr<CefBrowser> browser, const CefString &message) override; const int kFramesPerBuffer = 1024; - virtual bool GetAudioParameters(CefRefPtr<CefBrowser> browser, - CefAudioParameters ¶ms) override; + virtual bool GetAudioParameters(CefRefPtr<CefBrowser> browser, CefAudioParameters ¶ms) override; #else - virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, - int audio_stream_id, - const float **data, int frames, - int64_t pts) override; + virtual void OnAudioStreamPacket(CefRefPtr<CefBrowser> browser, int audio_stream_id, const float **data, + int frames, int64_t pts) override; - virtual void OnAudioStreamStopped(CefRefPtr<CefBrowser> browser, - int audio_stream_id); + virtual void OnAudioStreamStopped(CefRefPtr<CefBrowser> browser, int audio_stream_id); - virtual void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, - int audio_stream_id, int channels, - ChannelLayout channel_layout, - int sample_rate, + virtual void OnAudioStreamStarted(CefRefPtr<CefBrowser> browser, int audio_stream_id, int channels, + ChannelLayout channel_layout, int sample_rate, int frames_per_buffer) override; #endif /* CefLoadHandler */ - virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - int httpStatusCode) override; + virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int httpStatusCode) override; IMPLEMENT_REFCOUNTING(BrowserClient); };
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-scheme.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-scheme.cpp
Changed
@@ -21,10 +21,8 @@ #include <include/wrapper/cef_stream_resource_handler.h> #if !ENABLE_LOCAL_FILE_URL_SCHEME -CefRefPtr<CefResourceHandler> -BrowserSchemeHandlerFactory::Create(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame>, const CefString &, - CefRefPtr<CefRequest> request) +CefRefPtr<CefResourceHandler> BrowserSchemeHandlerFactory::Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, + const CefString &, CefRefPtr<CefRequest> request) { if (!browser || !request) return nullptr; @@ -35,10 +33,7 @@ std::string path = CefString(&parts.path); path = CefURIDecode(path, true, cef_uri_unescape_rule_t::UU_SPACES); - path = CefURIDecode( - path, true, - cef_uri_unescape_rule_t:: - UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS); + path = CefURIDecode(path, true, cef_uri_unescape_rule_t::UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS); std::string fileExtension = path.substr(path.find_last_of(".") + 1); @@ -48,11 +43,9 @@ fileExtension = "woff"; #ifdef _WIN32 - CefRefPtr<CefStreamReader> stream = - CefStreamReader::CreateForFile(path.substr(1)); + CefRefPtr<CefStreamReader> stream = CefStreamReader::CreateForFile(path.substr(1)); #else - CefRefPtr<CefStreamReader> stream = - CefStreamReader::CreateForFile(path); + CefRefPtr<CefStreamReader> stream = CefStreamReader::CreateForFile(path); #endif if (stream) {
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-scheme.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-scheme.hpp
Changed
@@ -31,9 +31,8 @@ #if !ENABLE_LOCAL_FILE_URL_SCHEME class BrowserSchemeHandlerFactory : public CefSchemeHandlerFactory { public: - virtual CefRefPtr<CefResourceHandler> - Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, - const CefString &, CefRefPtr<CefRequest> request) override; + virtual CefRefPtr<CefResourceHandler> Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, + const CefString &, CefRefPtr<CefRequest> request) override; IMPLEMENT_REFCOUNTING(BrowserSchemeHandlerFactory); };
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/browser-version.h -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/browser-version.h
Changed
@@ -2,22 +2,18 @@ #define OBS_BROWSER_VERSION_MAJOR 2 #define OBS_BROWSER_VERSION_MINOR 24 -#define OBS_BROWSER_VERSION_PATCH 2 +#define OBS_BROWSER_VERSION_PATCH 4 #ifndef MAKE_SEMANTIC_VERSION -#define MAKE_SEMANTIC_VERSION(major, minor, patch) \ - ((major << 24) | (minor << 16) | patch) +#define MAKE_SEMANTIC_VERSION(major, minor, patch) ((major << 24) | (minor << 16) | patch) #endif -#define OBS_BROWSER_VERSION_INT \ - MAKE_SEMANTIC_VERSION(OBS_BROWSER_VERSION_MAJOR, \ - OBS_BROWSER_VERSION_MINOR, \ - OBS_BROWSER_VERSION_PATCH) +#define OBS_BROWSER_VERSION_INT \ + MAKE_SEMANTIC_VERSION(OBS_BROWSER_VERSION_MAJOR, OBS_BROWSER_VERSION_MINOR, OBS_BROWSER_VERSION_PATCH) #define OBS_BROWSER_MACRO_STR_(x) #x #define OBS_BROWSER_MACRO_STR(x) OBS_BROWSER_MACRO_STR_(x) -#define OBS_BROWSER_VERSION_STRING \ - OBS_BROWSER_MACRO_STR(OBS_BROWSER_VERSION_MAJOR) \ - "." OBS_BROWSER_MACRO_STR(OBS_BROWSER_VERSION_MINOR) "." OBS_BROWSER_MACRO_STR( \ - OBS_BROWSER_VERSION_PATCH) +#define OBS_BROWSER_VERSION_STRING \ + OBS_BROWSER_MACRO_STR(OBS_BROWSER_VERSION_MAJOR) \ + "." OBS_BROWSER_MACRO_STR(OBS_BROWSER_VERSION_MINOR) "." OBS_BROWSER_MACRO_STR(OBS_BROWSER_VERSION_PATCH)
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux
Added
+(directory)
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions
Added
+(directory)
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_debug
Added
@@ -0,0 +1,3 @@ +if (( ! ${+_loglevel} )) typeset -g _loglevel=1 + +if (( _loglevel > 2 )) print -PR -e -- "${CI:+::debug::}%F{220}DEBUG: ${@}%f"
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_error
Added
@@ -0,0 +1,3 @@ +local icon=' ✖︎ ' + +print -u2 -PR "${CI:+::error::}%F{1} ${icon} %f ${@}"
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_group
Added
@@ -0,0 +1,16 @@ +autoload -Uz log_info + +if (( ! ${+_log_group} )) typeset -g _log_group=0 + +if (( ${+CI} )) { + if (( _log_group )) { + print "::endgroup::" + typeset -g _log_group=0 + } + if (( # )) { + print "::group::${@}" + typeset -g _log_group=1 + } +} else { + if (( # )) log_info ${@} +}
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_info
Added
@@ -0,0 +1,7 @@ +if (( ! ${+_loglevel} )) typeset -g _loglevel=1 + +if (( _loglevel > 0 )) { + local icon=' =>' + + print -PR "%F{4} ${(r:5:)icon}%f %B${@}%b" +}
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_output
Added
@@ -0,0 +1,7 @@ +if (( ! ${+_loglevel} )) typeset -g _loglevel=1 + +if (( _loglevel > 0 )) { + local icon='' + + print -PR " ${(r:5:)icon} ${@}" +}
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_status
Added
@@ -0,0 +1,7 @@ +if (( ! ${+_loglevel} )) typeset -g _loglevel=1 + +if (( _loglevel > 0 )) { + local icon=' >' + + print -PR "%F{2} ${(r:5:)icon}%f ${@}" +}
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/log_warning
Added
@@ -0,0 +1,7 @@ +if (( ! ${+_loglevel} )) typeset -g _loglevel=1 + +if (( _loglevel > 0 )) { + local icon=' =>' + + print -PR "${CI:+::warning::}%F{3} ${(r:5:)icon} ${@}%f" +}
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.functions/set_loglevel
Added
@@ -0,0 +1,17 @@ +autoload -Uz log_debug log_error + +local -r _usage="Usage: %B${0}%b <loglevel> + +Set log level, following levels are supported: 0 (quiet), 1 (normal), 2 (verbose), 3 (debug)" + +if (( ! # )); then + log_error 'Called without arguments.' + log_output ${_usage} + return 2 +elif (( ${1} >= 4 )); then + log_error 'Called with loglevel > 3.' + log_output ${_usage} +fi + +typeset -g -i -r _loglevel=${1} +log_debug "Log level set to '${1}'"
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/.run-format.zsh
Added
@@ -0,0 +1,271 @@ +#!/usr/bin/env zsh + +builtin emulate -L zsh +setopt EXTENDED_GLOB +setopt PUSHD_SILENT +setopt ERR_EXIT +setopt ERR_RETURN +setopt NO_UNSET +setopt PIPE_FAIL +setopt NO_AUTO_PUSHD +setopt NO_PUSHD_IGNORE_DUPS +setopt FUNCTION_ARGZERO + +## Enable for script debugging +# setopt WARN_CREATE_GLOBAL +# setopt WARN_NESTED_VAR +# setopt XTRACE + +autoload -Uz is-at-least && if ! is-at-least 5.2; then + print -u2 -PR "%F{1}${funcstack1##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade zsh to fix this issue." + exit 1 +fi + +invoke_formatter() { + if (( # < 1 )) { + log_error "Usage invoke_formatter formatter_name" + exit 2 + } + + local formatter="${1}" + shift + local -a source_files=(${@}) + + case ${formatter} { + clang) + if (( ${+commandsclang-format-17} )) { + local formatter=clang-format-17 + } elif (( ${+commandsclang-format} )) { + local formatter=clang-format + } else { + log_error "No viable clang-format version found (required 17.0.3)" + exit 2 + } + + local -a formatter_version=($(${formatter} --version)) + + if ! is-at-least 17.0.3 ${formatter_version-1}; then + log_error "clang-format is not version 17.0.3 or above (found ${formatter_version-1}." + exit 2 + fi + + if ! is-at-least ${formatter_version-1} 17.0.3; then + log_error "clang-format is more recent than version 17.0.3 (found ${formatter_version-1})." + exit 2 + fi + + if (( ! #source_files )) source_files=((libobs|libobs-*|UI|plugins|deps|shared)/**/*.(c|cpp|h|hpp|m|mm)(.N)) + + source_files=(${source_files:#*/(obs-websocket/deps|decklink/*/decklink-sdk|mac-syphon/syphon-framework|libdshowcapture)/*}) + + local -a format_args=(-style=file -fallback-style=none) + if (( _loglevel > 2 )) format_args+=(--verbose) + + check_files() { + local -i num_failures=0 + local -a source_files=($@) + local file + local -a format_args=(-style=file -fallback-style=none) + if (( _loglevel > 2 )) format_args+=(--verbose) + + local -a command=(${formatter} ${format_args}) + + for file (${source_files}) { + if ! ${command} "${file}" | diff -q "${file}" - &> /dev/null; then + log_error "${file} requires formatting changes." + if (( fail_on_error == 2 )) return 2; + num_failures=$(( num_failures + 1 )) + fi + } + if (( num_failures && fail_on_error == 1 )) return 2 + } + + format_files() { + local -a source_files=($@) + + if (( ${#source_files} )) { + local -a format_args=(-style=file -fallback-style=none -i) + if (( _loglevel > 2 )) format_args+=(--verbose) + + "${formatter}" ${format_args} ${source_files} + } + } + ;; + gersemi) + local formatter=gersemi + if (( ${+commandsgersemi} )) { + local gersemi_version=($(gersemi --version)) + + if ! is-at-least 0.12.0 ${gersemi_version2}; then + log_error "gersemi is not version 0.12.0 or above (found ${gersemi_version2}." + exit 2 + fi + } + + if (( ! #source_files )) source_files=(CMakeLists.txt (libobs|libobs-*|UI|plugins|deps|shared|cmake|test)/**/(CMakeLists.txt|*.cmake)(.N)) + + source_files=(${source_files:#*/(jansson|decklink/*/decklink-sdk|obs-websocket|obs-browser|libdshowcapture)/*}) + source_files=(${source_files:#(cmake/Modules/*|*/legacy.cmake)}) + + check_files() { + local -i num_failures=0 + local -a source_files=($@) + local file + local -a command=(${formatter} -c --no-cache ${source_files}) + + if (( ${#source_files} )) { + while read -r line; do + local -a line_tokens=(${(z)line}) + file=${line_tokens1//*obs-studio\//} + + log_error "${file} requires formatting changes." + + if (( fail_on_error == 2 )) return 2 + num_failures=$(( num_failures + 1 )) + done < <(${command} 2>&1) + + if (( num_failures && fail_on_error == 1 )) return 2 + } + } + + format_files() { + local -a source_files=($@) + + if (( ${#source_files} )) { + "${formatter}" -i ${source_files} + } + } + ;; + swift) + local formatter=swift-format + if (( ${+commandsswift-format} )) { + local swift_format_version=$(swift-format --version) + + if ! is-at-least 508.0.0 ${swift_format_version}; then + log_error "swift-format is not version 508.0.0 or above (found ${swift_format_version})." + exit 2 + fi + } else { + log_error "No viable swift-format version found (required 508.0.0)" + exit 2 + } + + if (( ! #source_files )) source_files=((libobs|libobs-*|UI|plugins)/**/*.swift(.N)) + + check_files() { + local -i num_failures=0 + local -a source_files=($@) + local file + local -a format_args=() + + local -a command=(${formatter} ${format_args}) + + for file (${source_files}) { + if ! "${command}" "${file}" | diff -q "${file}" - &> /dev/null; then + log_error "${file} requires formatting changes." + if (( fail_on_error == 2 )) return 2; + num_failures=$(( num_failures + 1 )) + fi + } + if (( num_failures && fail_on_error == 1 )) return 2 + } + + format_files() { + local -a source_files=($@) + + if (( ${#source_files} )) { + local -a format_args=(-i) + + "${formatter}" ${format_args} ${source_files} + } + } + ;; + *) log_error "Invalid formatter specified: ${1}. Valid options are clang-format, gersemi, and swift-format."; exit 2 ;; + } + + local file + local -i num_failures=0 + if (( check_only )) { + if (( ${+functionscheck_files} )) { + check_files ${source_files} + } else { + log_error "No format check function defined for formatter '${formatter}'" + exit 2 + } + } else { + if (( ${+functionsformat_files} )) { + format_files ${source_files} + } else { + log_error "No format function defined for formatter '${formatter}'" + exit 2 + } + } +} + +run_format() { + if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h} + if (( ! ${+FORMATTER_NAME} )) typeset -g FORMATTER_NAME=${${(s:-:)ZSH_ARGZERO:t:r}2} + + typeset -g host_os=${${(L)$(uname -s)}//darwin/macos} + local -i fail_on_error=0 + local -i check_only=0 + local -i verbosity=1 + local -r _version='1.0.0' + + fpath=("${SCRIPT_HOME}/.functions" ${fpath}) + autoload -Uz set_loglevel log_info log_error log_output log_status log_warning + + local -r _usage=" +Usage: %B${functrace1%:*}%b <option> + +%BOptions%b: + +%F{yellow} Formatting options%f + ----------------------------------------------------------------------------- + %B-c | --check%b Check only, no actual formatting takes place + +%F{yellow} Output options%f + ----------------------------------------------------------------------------- + %B-v | --verbose%b Verbose (more detailed output) + %B--fail-never|error Fail script never/on formatting change - default: %B%F{green}never%f%b + %B--debug%b Debug (very detailed and added output) + +%F{yellow} General options%f + ----------------------------------------------------------------------------- + %B-h | --help%b Print this usage help + %B-V | --version%b Print script version information" + + local -a args + while (( # )) { + case ${1} { + -c|--check) check_only=1; shift ;; + -v|--verbose) (( verbosity += 1 )); shift ;; + -h|--help) log_output ${_usage}; exit 0 ;; + -V|--version) print -Pr "${_version}"; exit 0 ;; + --debug) verbosity=3; shift ;; + --fail-never) + fail_on_error=0 + shift + ;; + --fail-error) + fail_on_error=1 + shift + ;; + --fail-fast) + fail_on_error=2 + shift + ;; + *) + args+=($@) + break + ;; + } + } + + set -- ${(@)args} + set_loglevel ${verbosity} + + invoke_formatter ${FORMATTER_NAME} ${args} +} + +run_format ${@}
View file
obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/build-aux/run-clang-format
Added
+(symlink to .run-format.zsh)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/deps/signal-restore.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/deps/signal-restore.cpp
Changed
@@ -26,9 +26,8 @@ template<typename T, size_t N> char (&ArraySizeHelper(T (&array)N))N; #define arraysize(array) (sizeof(ArraySizeHelper(array))) -const int signals_to_restore = {SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, - SIGFPE, SIGSEGV, SIGALRM, SIGTERM, SIGCHLD, - SIGBUS, SIGTRAP, SIGPIPE}; +const int signals_to_restore = {SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, + SIGALRM, SIGTERM, SIGCHLD, SIGBUS, SIGTRAP, SIGPIPE}; struct sigaction signal_handlersarraysize(signals_to_restore); void BackupSignalHandlers()
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/linux-keyboard-helpers.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/linux-keyboard-helpers.hpp
Changed
@@ -250,26 +250,24 @@ #define VKEY_LMENU 0xA4 #define VKEY_RMENU 0xA5 -#define VKEY_BROWSER_BACK 0xA6 // Windows 2000/XP: Browser Back key -#define VKEY_BROWSER_FORWARD 0xA7 // Windows 2000/XP: Browser Forward key -#define VKEY_BROWSER_REFRESH 0xA8 // Windows 2000/XP: Browser Refresh key -#define VKEY_BROWSER_STOP 0xA9 // Windows 2000/XP: Browser Stop key -#define VKEY_BROWSER_SEARCH 0xAA // Windows 2000/XP: Browser Search key -#define VKEY_BROWSER_FAVORITES 0xAB // Windows 2000/XP: Browser Favorites key -#define VKEY_BROWSER_HOME 0xAC // Windows 2000/XP: Browser Start and Home key -#define VKEY_VOLUME_MUTE 0xAD // Windows 2000/XP: Volume Mute key -#define VKEY_VOLUME_DOWN 0xAE // Windows 2000/XP: Volume Down key -#define VKEY_VOLUME_UP 0xAF // Windows 2000/XP: Volume Up key -#define VKEY_MEDIA_NEXT_TRACK 0xB0 // Windows 2000/XP: Next Track key -#define VKEY_MEDIA_PREV_TRACK 0xB1 // Windows 2000/XP: Previous Track key -#define VKEY_MEDIA_STOP 0xB2 // Windows 2000/XP: Stop Media key -#define VKEY_MEDIA_PLAY_PAUSE 0xB3 // Windows 2000/XP: Play/Pause Media key -#define VKEY_MEDIA_LAUNCH_MAIL 0xB4 // Windows 2000/XP: Start Mail key +#define VKEY_BROWSER_BACK 0xA6 // Windows 2000/XP: Browser Back key +#define VKEY_BROWSER_FORWARD 0xA7 // Windows 2000/XP: Browser Forward key +#define VKEY_BROWSER_REFRESH 0xA8 // Windows 2000/XP: Browser Refresh key +#define VKEY_BROWSER_STOP 0xA9 // Windows 2000/XP: Browser Stop key +#define VKEY_BROWSER_SEARCH 0xAA // Windows 2000/XP: Browser Search key +#define VKEY_BROWSER_FAVORITES 0xAB // Windows 2000/XP: Browser Favorites key +#define VKEY_BROWSER_HOME 0xAC // Windows 2000/XP: Browser Start and Home key +#define VKEY_VOLUME_MUTE 0xAD // Windows 2000/XP: Volume Mute key +#define VKEY_VOLUME_DOWN 0xAE // Windows 2000/XP: Volume Down key +#define VKEY_VOLUME_UP 0xAF // Windows 2000/XP: Volume Up key +#define VKEY_MEDIA_NEXT_TRACK 0xB0 // Windows 2000/XP: Next Track key +#define VKEY_MEDIA_PREV_TRACK 0xB1 // Windows 2000/XP: Previous Track key +#define VKEY_MEDIA_STOP 0xB2 // Windows 2000/XP: Stop Media key +#define VKEY_MEDIA_PLAY_PAUSE 0xB3 // Windows 2000/XP: Play/Pause Media key +#define VKEY_MEDIA_LAUNCH_MAIL 0xB4 // Windows 2000/XP: Start Mail key #define VKEY_MEDIA_LAUNCH_MEDIA_SELECT 0xB5 // Windows 2000/XP: Select Media key -#define VKEY_MEDIA_LAUNCH_APP1 \ - 0xB6 // VKEY_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key -#define VKEY_MEDIA_LAUNCH_APP2 \ - 0xB7 // VKEY_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key +#define VKEY_MEDIA_LAUNCH_APP1 0xB6 // VKEY_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key +#define VKEY_MEDIA_LAUNCH_APP2 0xB7 // VKEY_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key // VKEY_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. // Windows 2000/XP: For the US standard keyboard, the ';:' key @@ -534,8 +532,7 @@ case XK_KP_7: case XK_KP_8: case XK_KP_9: - return static_cast<unsigned int>(VKEY_NUMPAD0 + - (keysym - XK_KP_0)); + return static_cast<unsigned int>(VKEY_NUMPAD0 + (keysym - XK_KP_0)); case XK_multiply: case XK_KP_Multiply:
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/obs-browser-page/obs-browser-page-main.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/obs-browser-page/obs-browser-page-main.cpp
Changed
@@ -36,16 +36,14 @@ DECLARE_HANDLE(OBS_DPI_AWARENESS_CONTEXT); #define OBS_DPI_AWARENESS_CONTEXT_UNAWARE ((OBS_DPI_AWARENESS_CONTEXT)-1) #define OBS_DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((OBS_DPI_AWARENESS_CONTEXT)-2) -#define OBS_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE \ - ((OBS_DPI_AWARENESS_CONTEXT)-3) -#define OBS_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 \ - ((OBS_DPI_AWARENESS_CONTEXT)-4) +#define OBS_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((OBS_DPI_AWARENESS_CONTEXT)-3) +#define OBS_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((OBS_DPI_AWARENESS_CONTEXT)-4) static bool SetHighDPIv2Scaling() { static BOOL(WINAPI * func)(OBS_DPI_AWARENESS_CONTEXT) = nullptr; - func = reinterpret_cast<decltype(func)>(GetProcAddress( - GetModuleHandleW(L"USER32"), "SetProcessDpiAwarenessContext")); + func = reinterpret_cast<decltype(func)>( + GetProcAddress(GetModuleHandleW(L"USER32"), "SetProcessDpiAwarenessContext")); if (!func) { return false; } @@ -84,8 +82,7 @@ CefEnableHighDPISupport(); #endif - CefRefPtr<CefCommandLine> command_line = - CefCommandLine::CreateCommandLine(); + CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine(); command_line->InitFromString(::GetCommandLineW()); std::string parent_pid_str = command_line->GetSwitchValue("parent_pid"); @@ -93,8 +90,7 @@ if (!parent_pid_str.empty()) { shutdown_event = CreateEvent(nullptr, true, false, nullptr); DWORD parent_pid = (DWORD)std::stoi(parent_pid_str); - shutdown_check = std::thread(shutdown_check_thread, parent_pid, - GetCurrentThreadId()); + shutdown_check = std::thread(shutdown_check_thread, parent_pid, GetCurrentThreadId()); thread_initialized = true; }
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/obs-browser-plugin.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/obs-browser-plugin.cpp
Changed
@@ -28,13 +28,13 @@ #include <thread> #include <mutex> #include <nlohmann/json.hpp> +#include <obs-websocket-api.h> #include "obs-browser-source.hpp" #include "browser-scheme.hpp" #include "browser-app.hpp" #include "browser-version.h" -#include "obs-websocket-api/obs-websocket-api.h" #include "cef-headers.hpp" #ifdef _WIN32 @@ -92,8 +92,7 @@ /* you have to put the tasks on the Qt event queue after this * call otherwise the CEF message pump may stop functioning * correctly, it's only supposed to take 10ms max */ - QMetaObject::invokeMethod(&messageObject, "ExecuteTask", - Qt::QueuedConnection, + QMetaObject::invokeMethod(&messageObject, "ExecuteTask", Qt::QueuedConnection, Q_ARG(MessageTask, task)); #else task(); @@ -105,8 +104,7 @@ bool QueueCEFTask(std::function<void()> task) { - return CefPostTask(TID_UI, - CefRefPtr<BrowserTask>(new BrowserTask(task))); + return CefPostTask(TID_UI, CefRefPtr<BrowserTask>(new BrowserTask(task))); } /* ========================================================================= */ @@ -120,8 +118,7 @@ static void browser_source_get_defaults(obs_data_t *settings) { - obs_data_set_default_string(settings, "url", - "https://obsproject.com/browser-source"); + obs_data_set_default_string(settings, "url", "https://obsproject.com/browser-source"); obs_data_set_default_int(settings, "width", 800); obs_data_set_default_int(settings, "height", 600); obs_data_set_default_int(settings, "fps", 30); @@ -132,14 +129,12 @@ #endif obs_data_set_default_bool(settings, "shutdown", false); obs_data_set_default_bool(settings, "restart_when_active", false); - obs_data_set_default_int(settings, "webpage_control_level", - (int)DEFAULT_CONTROL_LEVEL); + obs_data_set_default_int(settings, "webpage_control_level", (int)DEFAULT_CONTROL_LEVEL); obs_data_set_default_string(settings, "css", default_css); obs_data_set_default_bool(settings, "reroute_audio", false); } -static bool is_local_file_modified(obs_properties_t *props, obs_property_t *, - obs_data_t *settings) +static bool is_local_file_modified(obs_properties_t *props, obs_property_t *, obs_data_t *settings) { bool enabled = obs_data_get_bool(settings, "is_local_file"); obs_property_t *url = obs_properties_get(props, "url"); @@ -150,8 +145,7 @@ return true; } -static bool is_fps_custom(obs_properties_t *props, obs_property_t *, - obs_data_t *settings) +static bool is_fps_custom(obs_properties_t *props, obs_property_t *, obs_data_t *settings) { bool enabled = obs_data_get_bool(settings, "fps_custom"); obs_property_t *fps = obs_properties_get(props, "fps"); @@ -167,8 +161,7 @@ DStr path; obs_properties_set_flags(props, OBS_PROPERTIES_DEFER_UPDATE); - obs_property_t *prop = obs_properties_add_bool( - props, "is_local_file", obs_module_text("LocalFile")); + obs_property_t *prop = obs_properties_add_bool(props, "is_local_file", obs_module_text("LocalFile")); if (bs && !bs->url.empty()) { const char *slash; @@ -181,22 +174,15 @@ } obs_property_set_modified_callback(prop, is_local_file_modified); - obs_properties_add_path(props, "local_file", - obs_module_text("LocalFile"), OBS_PATH_FILE, - "*.*", path->array); - obs_properties_add_text(props, "url", obs_module_text("URL"), - OBS_TEXT_DEFAULT); - - obs_properties_add_int(props, "width", obs_module_text("Width"), 1, - 8192, 1); - obs_properties_add_int(props, "height", obs_module_text("Height"), 1, - 8192, 1); - - obs_properties_add_bool(props, "reroute_audio", - obs_module_text("RerouteAudio")); - - obs_property_t *fps_set = obs_properties_add_bool( - props, "fps_custom", obs_module_text("CustomFrameRate")); + obs_properties_add_path(props, "local_file", obs_module_text("LocalFile"), OBS_PATH_FILE, "*.*", path->array); + obs_properties_add_text(props, "url", obs_module_text("URL"), OBS_TEXT_DEFAULT); + + obs_properties_add_int(props, "width", obs_module_text("Width"), 1, 8192, 1); + obs_properties_add_int(props, "height", obs_module_text("Height"), 1, 8192, 1); + + obs_properties_add_bool(props, "reroute_audio", obs_module_text("RerouteAudio")); + + obs_property_t *fps_set = obs_properties_add_bool(props, "fps_custom", obs_module_text("CustomFrameRate")); obs_property_set_modified_callback(fps_set, is_fps_custom); #ifndef ENABLE_BROWSER_SHARED_TEXTURE @@ -205,48 +191,33 @@ obs_properties_add_int(props, "fps", obs_module_text("FPS"), 1, 60, 1); - obs_property_t *p = obs_properties_add_text( - props, "css", obs_module_text("CSS"), OBS_TEXT_MULTILINE); + obs_property_t *p = obs_properties_add_text(props, "css", obs_module_text("CSS"), OBS_TEXT_MULTILINE); obs_property_text_set_monospace(p, true); - obs_properties_add_bool(props, "shutdown", - obs_module_text("ShutdownSourceNotVisible")); - obs_properties_add_bool(props, "restart_when_active", - obs_module_text("RefreshBrowserActive")); - - obs_property_t *controlLevel = obs_properties_add_list( - props, "webpage_control_level", - obs_module_text("WebpageControlLevel"), OBS_COMBO_TYPE_LIST, - OBS_COMBO_FORMAT_INT); - - obs_property_list_add_int( - controlLevel, obs_module_text("WebpageControlLevel.Level.None"), - (int)ControlLevel::None); - obs_property_list_add_int( - controlLevel, - obs_module_text("WebpageControlLevel.Level.ReadObs"), - (int)ControlLevel::ReadObs); - obs_property_list_add_int( - controlLevel, - obs_module_text("WebpageControlLevel.Level.ReadUser"), - (int)ControlLevel::ReadUser); - obs_property_list_add_int( - controlLevel, - obs_module_text("WebpageControlLevel.Level.Basic"), - (int)ControlLevel::Basic); - obs_property_list_add_int( - controlLevel, - obs_module_text("WebpageControlLevel.Level.Advanced"), - (int)ControlLevel::Advanced); - obs_property_list_add_int( - controlLevel, obs_module_text("WebpageControlLevel.Level.All"), - (int)ControlLevel::All); - - obs_properties_add_button( - props, "refreshnocache", obs_module_text("RefreshNoCache"), - (obs_properties_t *, obs_property_t *, void *data) { - static_cast<BrowserSource *>(data)->Refresh(); - return false; - }); + obs_properties_add_bool(props, "shutdown", obs_module_text("ShutdownSourceNotVisible")); + obs_properties_add_bool(props, "restart_when_active", obs_module_text("RefreshBrowserActive")); + + obs_property_t *controlLevel = obs_properties_add_list(props, "webpage_control_level", + obs_module_text("WebpageControlLevel"), + OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); + + obs_property_list_add_int(controlLevel, obs_module_text("WebpageControlLevel.Level.None"), + (int)ControlLevel::None); + obs_property_list_add_int(controlLevel, obs_module_text("WebpageControlLevel.Level.ReadObs"), + (int)ControlLevel::ReadObs); + obs_property_list_add_int(controlLevel, obs_module_text("WebpageControlLevel.Level.ReadUser"), + (int)ControlLevel::ReadUser); + obs_property_list_add_int(controlLevel, obs_module_text("WebpageControlLevel.Level.Basic"), + (int)ControlLevel::Basic); + obs_property_list_add_int(controlLevel, obs_module_text("WebpageControlLevel.Level.Advanced"), + (int)ControlLevel::Advanced); + obs_property_list_add_int(controlLevel, obs_module_text("WebpageControlLevel.Level.All"), + (int)ControlLevel::All); + + obs_properties_add_button(props, "refreshnocache", obs_module_text("RefreshNoCache"), + (obs_properties_t *, obs_property_t *, void *data) { + static_cast<BrowserSource *>(data)->Refresh(); + return false; + }); return props; } @@ -278,11 +249,8 @@ if (enabled && strcmp(path, "") != 0) { if (!os_file_exists(path)) { - obs_missing_file_t *file = - obs_missing_file_create( - path, missing_file_callback, - OBS_MISSING_FILE_SOURCE, - bs->source, NULL); + obs_missing_file_t *file = obs_missing_file_create( + path, missing_file_callback, OBS_MISSING_FILE_SOURCE, bs->source, NULL); obs_missing_files_add_file(files, file); } @@ -329,13 +297,10 @@ * browser sources are coming from OBS. */ std::stringstream prod_ver; prod_ver << "Chrome/"; - prod_ver << std::to_string(cef_version_info(4)) << "." - << std::to_string(cef_version_info(5)) << "." - << std::to_string(cef_version_info(6)) << "." - << std::to_string(cef_version_info(7)); + prod_ver << std::to_string(cef_version_info(4)) << "." << std::to_string(cef_version_info(5)) << "." + << std::to_string(cef_version_info(6)) << "." << std::to_string(cef_version_info(7)); prod_ver << " OBS/"; - prod_ver << std::to_string(obs_maj) << "." << std::to_string(obs_min) - << "." << std::to_string(obs_pat); + prod_ver << std::to_string(obs_maj) << "." << std::to_string(obs_min) << "." << std::to_string(obs_pat); #if CHROME_VERSION_BUILD >= 4472 CefString(&settings.user_agent_product) = prod_ver.str(); @@ -393,9 +358,7 @@ #if defined(__APPLE__) || defined(_WIN32) || !defined(ENABLE_WAYLAND) app = new BrowserApp(tex_sharing_avail); #else - app = new BrowserApp(tex_sharing_avail, - obs_get_nix_platform() == - OBS_NIX_PLATFORM_WAYLAND); + app = new BrowserApp(tex_sharing_avail, obs_get_nix_platform() == OBS_NIX_PLATFORM_WAYLAND); #endif #ifdef _WIN32 @@ -422,8 +385,7 @@ #if !ENABLE_LOCAL_FILE_URL_SCHEME /* Register http://absolute/ scheme handler for older * CEF builds which do not support file:// URLs */ - CefRegisterSchemeHandlerFactory("http", "absolute", - new BrowserSchemeHandlerFactory()); + CefRegisterSchemeHandlerFactory("http", "absolute", new BrowserSchemeHandlerFactory()); #endif os_event_signal(cef_started_event); } @@ -467,14 +429,15 @@ struct obs_source_info info = {}; info.id = "browser_source"; info.type = OBS_SOURCE_TYPE_INPUT; - info.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_AUDIO | - OBS_SOURCE_CUSTOM_DRAW | OBS_SOURCE_INTERACTION | + info.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_AUDIO | OBS_SOURCE_CUSTOM_DRAW | OBS_SOURCE_INTERACTION | OBS_SOURCE_DO_NOT_DUPLICATE | OBS_SOURCE_SRGB; info.get_properties = browser_source_get_properties; info.get_defaults = browser_source_get_defaults; info.icon_type = OBS_ICON_TYPE_BROWSER; - info.get_name = (void *) { return obs_module_text("BrowserSource"); }; + info.get_name = (void *) { + return obs_module_text("BrowserSource"); + }; info.create = (obs_data_t *settings, obs_source_t *source) -> void * { obs_browser_initialize(); return new BrowserSource(settings, source); @@ -499,38 +462,28 @@ static_cast<BrowserSource *>(data)->Render(); }; #if CHROME_VERSION_BUILD < 4103 - info.audio_mix = (void *data, uint64_t *ts_out, - struct audio_output_data *audio_output, - size_t channels, size_t sample_rate) { - return static_cast<BrowserSource *>(data)->AudioMix( - ts_out, audio_output, channels, sample_rate); + info.audio_mix = (void *data, uint64_t *ts_out, struct audio_output_data *audio_output, size_t channels, + size_t sample_rate) { + return static_cast<BrowserSource *>(data)->AudioMix(ts_out, audio_output, channels, sample_rate); }; - info.enum_active_sources = (void *data, obs_source_enum_proc_t cb, - void *param) { + info.enum_active_sources = (void *data, obs_source_enum_proc_t cb, void *param) { static_cast<BrowserSource *>(data)->EnumAudioStreams(cb, param); }; #endif - info.mouse_click = (void *data, const struct obs_mouse_event *event, - int32_t type, bool mouse_up, + info.mouse_click = (void *data, const struct obs_mouse_event *event, int32_t type, bool mouse_up, uint32_t click_count) { - static_cast<BrowserSource *>(data)->SendMouseClick( - event, type, mouse_up, click_count); + static_cast<BrowserSource *>(data)->SendMouseClick(event, type, mouse_up, click_count); }; - info.mouse_move = (void *data, const struct obs_mouse_event *event, - bool mouse_leave) { - static_cast<BrowserSource *>(data)->SendMouseMove(event, - mouse_leave); + info.mouse_move = (void *data, const struct obs_mouse_event *event, bool mouse_leave) { + static_cast<BrowserSource *>(data)->SendMouseMove(event, mouse_leave); }; - info.mouse_wheel = (void *data, const struct obs_mouse_event *event, - int x_delta, int y_delta) { - static_cast<BrowserSource *>(data)->SendMouseWheel( - event, x_delta, y_delta); + info.mouse_wheel = (void *data, const struct obs_mouse_event *event, int x_delta, int y_delta) { + static_cast<BrowserSource *>(data)->SendMouseWheel(event, x_delta, y_delta); }; info.focus = (void *data, bool focus) { static_cast<BrowserSource *>(data)->SendFocus(focus); }; - info.key_click = (void *data, const struct obs_key_event *event, - bool key_up) { + info.key_click = (void *data, const struct obs_key_event *event, bool key_up) { static_cast<BrowserSource *>(data)->SendKeyClick(event, key_up); }; info.show = (void *data) { @@ -554,8 +507,7 @@ /* ========================================================================= */ -extern void DispatchJSEvent(std::string eventName, std::string jsonString, - BrowserSource *browser = nullptr); +extern void DispatchJSEvent(std::string eventName, std::string jsonString, BrowserSource *browser = nullptr); static void handle_obs_frontend_event(enum obs_frontend_event event, void *) { @@ -623,8 +575,7 @@ nlohmann::json json = {{"name", name}, {"width", obs_source_get_width(source)}, - {"height", - obs_source_get_height(source)}}; + {"height", obs_source_get_height(source)}}; DispatchJSEvent("obsSceneChanged", json.dump()); break; @@ -644,8 +595,7 @@ break; } case OBS_FRONTEND_EVENT_TRANSITION_CHANGED: { - OBSSourceAutoRelease source = - obs_frontend_get_current_transition(); + OBSSourceAutoRelease source = obs_frontend_get_current_transition(); if (!source) break; @@ -665,8 +615,7 @@ std::vector<const char *> transitions_vector; for (size_t i = 0; i < list.sources.num; i++) { obs_source_t *source = list.sources.arrayi; - transitions_vector.push_back( - obs_source_get_name(source)); + transitions_vector.push_back(obs_source_get_name(source)); } nlohmann::json json = transitions_vector; obs_frontend_source_list_free(&list); @@ -714,8 +663,7 @@ #ifdef ENABLE_BROWSER_SHARED_TEXTURE #ifdef _WIN32 -static const wchar_t *blacklisted_devices = { - L"Intel", L"Microsoft", L"Radeon HD 8850M", L"Radeon HD 7660", nullptr}; +static const wchar_t *blacklisted_devices = {L"Intel", L"Microsoft", L"Radeon HD 8850M", L"Radeon HD 7660", nullptr}; static inline bool is_intel(const std::wstring &str) { @@ -776,10 +724,8 @@ #endif #endif blog(LOG_INFO, "obs-browser: Version %s", OBS_BROWSER_VERSION_STRING); - blog(LOG_INFO, - "obs-browser: CEF Version %i.%i.%i.%i (runtime), %s (compiled)", - cef_version_info(4), cef_version_info(5), cef_version_info(6), - cef_version_info(7), CEF_VERSION); + blog(LOG_INFO, "obs-browser: CEF Version %i.%i.%i.%i (runtime), %s (compiled)", cef_version_info(4), + cef_version_info(5), cef_version_info(6), cef_version_info(7), CEF_VERSION); RegisterBrowserSource(); obs_frontend_add_event_callback(handle_obs_frontend_event, nullptr); @@ -807,25 +753,19 @@ if (!vendor) return; - auto emit_event_request_cb = (obs_data_t *request_data, obs_data_t *, - void *) { - const char *event_name = - obs_data_get_string(request_data, "event_name"); + auto emit_event_request_cb = (obs_data_t *request_data, obs_data_t *, void *) { + const char *event_name = obs_data_get_string(request_data, "event_name"); if (!event_name) return; - OBSDataAutoRelease event_data = - obs_data_get_obj(request_data, "event_data"); - const char *event_data_string = - event_data ? obs_data_get_json(event_data) : "{}"; + OBSDataAutoRelease event_data = obs_data_get_obj(request_data, "event_data"); + const char *event_data_string = event_data ? obs_data_get_json(event_data) : "{}"; DispatchJSEvent(event_name, event_data_string, nullptr); }; - if (!obs_websocket_vendor_register_request( - vendor, "emit_event", emit_event_request_cb, nullptr)) - blog(LOG_WARNING, - "obs-browser: Failed to register obs-websocket request emit_event"); + if (!obs_websocket_vendor_register_request(vendor, "emit_event", emit_event_request_cb, nullptr)) + blog(LOG_WARNING, "obs-browser: Failed to register obs-websocket request emit_event"); } void obs_module_unload(void)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/obs-browser-source-audio.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/obs-browser-source-audio.cpp
Changed
@@ -25,9 +25,7 @@ } } -static inline void mix_audio(float *__restrict p_out, - const float *__restrict p_in, size_t pos, - size_t count) +static inline void mix_audio(float *__restrict p_out, const float *__restrict p_in, size_t pos, size_t count) { float *__restrict out = p_out; const float *__restrict in = p_in + pos; @@ -37,9 +35,8 @@ *out++ += *in++; } -bool BrowserSource::AudioMix(uint64_t *ts_out, - struct audio_output_data *audio_output, - size_t channels, size_t sample_rate) +bool BrowserSource::AudioMix(uint64_t *ts_out, struct audio_output_data *audio_output, size_t channels, + size_t sample_rate) { uint64_t timestamp = 0; struct obs_source_audio_mix child_audio; @@ -70,8 +67,7 @@ continue; } - pos = (size_t)ns_to_audio_frames(sample_rate, - source_ts - timestamp); + pos = (size_t)ns_to_audio_frames(sample_rate, source_ts - timestamp); count = AUDIO_OUTPUT_FRAMES - pos; obs_source_get_audio_mix(s, &child_audio);
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/obs-browser-source.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/obs-browser-source.cpp
Changed
@@ -59,32 +59,27 @@ } #endif - CefRefPtr<CefProcessMessage> msg = - CefProcessMessage::Create("Visibility"); + CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("Visibility"); CefRefPtr<CefListValue> args = msg->GetArgumentList(); args->SetBool(0, isVisible); SendBrowserProcessMessage(browser, PID_RENDERER, msg); } -void DispatchJSEvent(std::string eventName, std::string jsonString, - BrowserSource *browser = nullptr); +void DispatchJSEvent(std::string eventName, std::string jsonString, BrowserSource *browser = nullptr); -BrowserSource::BrowserSource(obs_data_t *, obs_source_t *source_) - : source(source_) +BrowserSource::BrowserSource(obs_data_t *, obs_source_t *source_) : source(source_) { /* Register Refresh hotkey */ - auto refreshFunction = (void *data, obs_hotkey_id, obs_hotkey_t *, - bool pressed) { + auto refreshFunction = (void *data, obs_hotkey_id, obs_hotkey_t *, bool pressed) { if (pressed) { BrowserSource *bs = (BrowserSource *)data; bs->Refresh(); } }; - obs_hotkey_register_source(source, "ObsBrowser.Refresh", - obs_module_text("RefreshNoCache"), - refreshFunction, (void *)this); + obs_hotkey_register_source(source, "ObsBrowser.Refresh", obs_module_text("RefreshNoCache"), refreshFunction, + (void *)this); auto jsEventFunction = (void *p, calldata_t *calldata) { const auto eventName = calldata_string(calldata, "eventName"); @@ -97,10 +92,8 @@ }; proc_handler_t *ph = obs_source_get_proc_handler(source); - proc_handler_add( - ph, - "void javascript_event(string eventName, string jsonString)", - jsEventFunction, (void *)this); + proc_handler_add(ph, "void javascript_event(string eventName, string jsonString)", jsEventFunction, + (void *)this); /* defer update */ obs_source_update(source, nullptr); @@ -196,8 +189,7 @@ #endif CefRefPtr<BrowserClient> browserClient = - new BrowserClient(this, hwaccel && tex_sharing_avail, - reroute_audio, webpage_control_level); + new BrowserClient(this, hwaccel && tex_sharing_avail, reroute_audio, webpage_control_level); CefWindowInfo windowInfo; #if CHROME_VERSION_BUILD < 4430 @@ -227,8 +219,7 @@ struct obs_video_info ovi; obs_get_video_info(&ovi); canvas_fps = (double)ovi.fps_num / (double)ovi.fps_den; - cefBrowserSettings.windowless_frame_rate = - (fps_custom) ? fps : canvas_fps; + cefBrowserSettings.windowless_frame_rate = (fps_custom) ? fps : canvas_fps; #endif #else cefBrowserSettings.windowless_frame_rate = fps; @@ -244,9 +235,8 @@ cefBrowserSettings.web_security = STATE_DISABLED; } #endif - auto browser = CefBrowserHost::CreateBrowserSync( - windowInfo, browserClient, url, cefBrowserSettings, - CefRefPtr<CefDictionaryValue>(), nullptr); + auto browser = CefBrowserHost::CreateBrowserSync(windowInfo, browserClient, url, cefBrowserSettings, + CefRefPtr<CefDictionaryValue>(), nullptr); SetBrowser(browser); @@ -274,8 +264,7 @@ }); } #endif -void BrowserSource::SendMouseClick(const struct obs_mouse_event *event, - int32_t type, bool mouse_up, +void BrowserSource::SendMouseClick(const struct obs_mouse_event *event, int32_t type, bool mouse_up, uint32_t click_count) { uint32_t modifiers = event->modifiers; @@ -288,16 +277,13 @@ e.modifiers = modifiers; e.x = x; e.y = y; - CefBrowserHost::MouseButtonType buttonType = - (CefBrowserHost::MouseButtonType)type; - cefBrowser->GetHost()->SendMouseClickEvent( - e, buttonType, mouse_up, click_count); + CefBrowserHost::MouseButtonType buttonType = (CefBrowserHost::MouseButtonType)type; + cefBrowser->GetHost()->SendMouseClickEvent(e, buttonType, mouse_up, click_count); }, true); } -void BrowserSource::SendMouseMove(const struct obs_mouse_event *event, - bool mouse_leave) +void BrowserSource::SendMouseMove(const struct obs_mouse_event *event, bool mouse_leave) { uint32_t modifiers = event->modifiers; int32_t x = event->x; @@ -309,14 +295,12 @@ e.modifiers = modifiers; e.x = x; e.y = y; - cefBrowser->GetHost()->SendMouseMoveEvent(e, - mouse_leave); + cefBrowser->GetHost()->SendMouseMoveEvent(e, mouse_leave); }, true); } -void BrowserSource::SendMouseWheel(const struct obs_mouse_event *event, - int x_delta, int y_delta) +void BrowserSource::SendMouseWheel(const struct obs_mouse_event *event, int x_delta, int y_delta) { uint32_t modifiers = event->modifiers; int32_t x = event->x; @@ -328,8 +312,7 @@ e.modifiers = modifiers; e.x = x; e.y = y; - cefBrowser->GetHost()->SendMouseWheelEvent(e, x_delta, - y_delta); + cefBrowser->GetHost()->SendMouseWheelEvent(e, x_delta, y_delta); }, true); } @@ -388,8 +371,7 @@ if (!text.empty() && !key_up) { e.type = KEYEVENT_CHAR; #ifdef __linux__ - e.windows_key_code = - KeyboardCodeFromXKeysym(e.character); + e.windows_key_code = KeyboardCodeFromXKeysym(e.character); #elif defined(_WIN32) e.windows_key_code = e.character; #elif !defined(__APPLE__) @@ -417,20 +399,16 @@ } else { ExecuteOnBrowser( =(CefRefPtr<CefBrowser> cefBrowser) { - CefRefPtr<CefProcessMessage> msg = - CefProcessMessage::Create("Visibility"); - CefRefPtr<CefListValue> args = - msg->GetArgumentList(); + CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("Visibility"); + CefRefPtr<CefListValue> args = msg->GetArgumentList(); args->SetBool(0, showing); - SendBrowserProcessMessage(cefBrowser, - PID_RENDERER, msg); + SendBrowserProcessMessage(cefBrowser, PID_RENDERER, msg); }, true); nlohmann::json json; json"visible" = showing; DispatchJSEvent("obsSourceVisibleChanged", json.dump(), this); -#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && \ - defined(ENABLE_BROWSER_SHARED_TEXTURE) +#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && defined(ENABLE_BROWSER_SHARED_TEXTURE) if (showing && !fps_custom) { reset_frame = false; } @@ -455,12 +433,10 @@ { ExecuteOnBrowser( =(CefRefPtr<CefBrowser> cefBrowser) { - CefRefPtr<CefProcessMessage> msg = - CefProcessMessage::Create("Active"); + CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("Active"); CefRefPtr<CefListValue> args = msg->GetArgumentList(); args->SetBool(0, active); - SendBrowserProcessMessage(cefBrowser, PID_RENDERER, - msg); + SendBrowserProcessMessage(cefBrowser, PID_RENDERER, msg); }, true); nlohmann::json json; @@ -470,11 +446,7 @@ void BrowserSource::Refresh() { - ExecuteOnBrowser( - (CefRefPtr<CefBrowser> cefBrowser) { - cefBrowser->ReloadIgnoreCache(); - }, - true); + ExecuteOnBrowser((CefRefPtr<CefBrowser> cefBrowser) { cefBrowser->ReloadIgnoreCache(); }, true); } void BrowserSource::SetBrowser(CefRefPtr<CefBrowser> b) @@ -495,9 +467,7 @@ { if (reset_frame) { ExecuteOnBrowser( - (CefRefPtr<CefBrowser> cefBrowser) { - cefBrowser->GetHost()->SendExternalBeginFrame(); - }, + (CefRefPtr<CefBrowser> cefBrowser) { cefBrowser->GetHost()->SendExternalBeginFrame(); }, true); reset_frame = false; @@ -529,11 +499,10 @@ n_shutdown = obs_data_get_bool(settings, "shutdown"); n_restart = obs_data_get_bool(settings, "restart_when_active"); n_css = obs_data_get_string(settings, "css"); - n_url = obs_data_get_string(settings, - n_is_local ? "local_file" : "url"); + n_url = obs_data_get_string(settings, n_is_local ? "local_file" : "url"); n_reroute = obs_data_get_bool(settings, "reroute_audio"); - n_webpage_control_level = static_cast<ControlLevel>( - obs_data_get_int(settings, "webpage_control_level")); + n_webpage_control_level = + static_cast<ControlLevel>(obs_data_get_int(settings, "webpage_control_level")); if (n_is_local && !n_url.empty()) { n_url = CefURIEncode(n_url, false); @@ -542,8 +511,7 @@ size_t slash = n_url.find("%2F"); size_t colon = n_url.find("%3A"); - if (slash != std::string::npos && - colon != std::string::npos && colon < slash) + if (slash != std::string::npos && colon != std::string::npos && colon < slash) n_url.replace(colon, 3, ":"); #endif @@ -576,11 +544,9 @@ } #endif - if (n_is_local == is_local && n_fps_custom == fps_custom && - n_fps == fps && n_shutdown == shutdown_on_invisible && - n_restart == restart && n_css == css && n_url == url && - n_reroute == reroute_audio && - n_webpage_control_level == webpage_control_level) { + if (n_is_local == is_local && n_fps_custom == fps_custom && n_fps == fps && + n_shutdown == shutdown_on_invisible && n_restart == restart && n_css == css && n_url == url && + n_reroute == reroute_audio && n_webpage_control_level == webpage_control_level) { if (n_width == width && n_height == height) return; @@ -590,14 +556,10 @@ ExecuteOnBrowser( =(CefRefPtr<CefBrowser> cefBrowser) { const CefSize cefSize(width, height); - cefBrowser->GetHost() - ->GetClient() - ->GetDisplayHandler() - ->OnAutoResize(cefBrowser, - cefSize); + cefBrowser->GetHost()->GetClient()->GetDisplayHandler()->OnAutoResize( + cefBrowser, cefSize); cefBrowser->GetHost()->WasResized(); - cefBrowser->GetHost()->Invalidate( - PET_VIEW); + cefBrowser->GetHost()->Invalidate(PET_VIEW); }, true); return; @@ -644,8 +606,7 @@ if (!fps_custom) { if (!!cefBrowser && canvas_fps != video_fps) { - cefBrowser->GetHost()->SetWindowlessFrameRate( - video_fps); + cefBrowser->GetHost()->SetWindowlessFrameRate(video_fps); canvas_fps = video_fps; } } @@ -664,17 +625,14 @@ if (texture) { #ifdef __APPLE__ - gs_effect_t *effect = - obs_get_base_effect((hwaccel) ? OBS_EFFECT_DEFAULT_RECT - : OBS_EFFECT_DEFAULT); + gs_effect_t *effect = obs_get_base_effect((hwaccel) ? OBS_EFFECT_DEFAULT_RECT : OBS_EFFECT_DEFAULT); #else gs_effect_t *effect = obs_get_base_effect(OBS_EFFECT_DEFAULT); #endif bool linear_sample = extra_texture == NULL; gs_texture_t *draw_texture = texture; - if (!linear_sample && - !obs_source_get_texcoords_centered(source)) { + if (!linear_sample && !obs_source_get_texcoords_centered(source)) { gs_copy_texture(extra_texture, texture); draw_texture = extra_texture; @@ -687,8 +645,7 @@ gs_blend_state_push(); gs_blend_function(GS_BLEND_ONE, GS_BLEND_INVSRCALPHA); - gs_eparam_t *const image = - gs_effect_get_param_by_name(effect, "image"); + gs_eparam_t *const image = gs_effect_get_param_by_name(effect, "image"); const char *tech; if (linear_sample) { @@ -708,8 +665,7 @@ gs_enable_framebuffer_srgb(previous); } -#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && \ - defined(ENABLE_BROWSER_SHARED_TEXTURE) +#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && defined(ENABLE_BROWSER_SHARED_TEXTURE) SignalBeginFrame(); #elif defined(ENABLE_BROWSER_QT_LOOP) ProcessCef(); @@ -738,12 +694,10 @@ } } -void DispatchJSEvent(std::string eventName, std::string jsonString, - BrowserSource *browser) +void DispatchJSEvent(std::string eventName, std::string jsonString, BrowserSource *browser) { const auto jsEvent = =(CefRefPtr<CefBrowser> cefBrowser) { - CefRefPtr<CefProcessMessage> msg = - CefProcessMessage::Create("DispatchJSEvent"); + CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("DispatchJSEvent"); CefRefPtr<CefListValue> args = msg->GetArgumentList(); args->SetString(0, eventName);
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/obs-browser-source.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/obs-browser-source.hpp
Changed
@@ -91,8 +91,7 @@ bool reroute_audio = true; std::atomic<bool> destroying = false; ControlLevel webpage_control_level = DEFAULT_CONTROL_LEVEL; -#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && \ - defined(ENABLE_BROWSER_SHARED_TEXTURE) +#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && defined(ENABLE_BROWSER_SHARED_TEXTURE) bool reset_frame = false; #endif bool is_showing = false; @@ -133,26 +132,21 @@ #if CHROME_VERSION_BUILD < 4103 void ClearAudioStreams(); void EnumAudioStreams(obs_source_enum_proc_t cb, void *param); - bool AudioMix(uint64_t *ts_out, struct audio_output_data *audio_output, - size_t channels, size_t sample_rate); + bool AudioMix(uint64_t *ts_out, struct audio_output_data *audio_output, size_t channels, size_t sample_rate); std::mutex audio_sources_mutex; std::vector<obs_source_t *> audio_sources; std::unordered_map<int, AudioStream> audio_streams; #endif - void SendMouseClick(const struct obs_mouse_event *event, int32_t type, - bool mouse_up, uint32_t click_count); - void SendMouseMove(const struct obs_mouse_event *event, - bool mouse_leave); - void SendMouseWheel(const struct obs_mouse_event *event, int x_delta, - int y_delta); + void SendMouseClick(const struct obs_mouse_event *event, int32_t type, bool mouse_up, uint32_t click_count); + void SendMouseMove(const struct obs_mouse_event *event, bool mouse_leave); + void SendMouseWheel(const struct obs_mouse_event *event, int x_delta, int y_delta); void SendFocus(bool focus); void SendKeyClick(const struct obs_key_event *event, bool key_up); void SetShowing(bool showing); void SetActive(bool active); void Refresh(); -#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && \ - defined(ENABLE_BROWSER_SHARED_TEXTURE) +#if defined(BROWSER_EXTERNAL_BEGIN_FRAME_ENABLED) && defined(ENABLE_BROWSER_SHARED_TEXTURE) inline void SignalBeginFrame(); #endif
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/panel/browser-panel-client.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/panel/browser-panel-client.cpp
Changed
@@ -69,34 +69,34 @@ } /* CefDisplayHandler */ -void QCefBrowserClient::OnTitleChange(CefRefPtr<CefBrowser> browser, - const CefString &title) +void QCefBrowserClient::OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString &title) { if (widget && widget->cefBrowser->IsSame(browser)) { std::string str_title = title; QString qt_title = QString::fromUtf8(str_title.c_str()); - QMetaObject::invokeMethod(widget, "titleChanged", - Q_ARG(QString, qt_title)); + QMetaObject::invokeMethod(widget, "titleChanged", Q_ARG(QString, qt_title)); } else { /* handle popup title */ - if (title.compare("DevTools") == 0) - return; + CefString newTitle = title; + if (title.compare("DevTools") == 0 && widget) + newTitle = QString(obs_module_text("DevTools")) + .arg(widget->parentWidget()->windowTitle()) + .toUtf8() + .constData(); #if defined(_WIN32) CefWindowHandle handl = browser->GetHost()->GetWindowHandle(); - std::wstring str_title = title; + std::wstring str_title = newTitle; SetWindowTextW((HWND)handl, str_title.c_str()); #elif defined(__linux__) CefWindowHandle handl = browser->GetHost()->GetWindowHandle(); - XStoreName(cef_get_xdisplay(), handl, title.ToString().c_str()); + XStoreName(cef_get_xdisplay(), handl, newTitle.ToString().c_str()); #endif } } /* CefRequestHandler */ -bool QCefBrowserClient::OnBeforeBrowse(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame>, - CefRefPtr<CefRequest> request, bool, - bool) +bool QCefBrowserClient::OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, + CefRefPtr<CefRequest> request, bool, bool) { std::string str_url = request->GetURL(); @@ -120,15 +120,13 @@ if (widget) { QString qt_url = QString::fromUtf8(str_url.c_str()); - QMetaObject::invokeMethod(widget, "urlChanged", - Q_ARG(QString, qt_url)); + QMetaObject::invokeMethod(widget, "urlChanged", Q_ARG(QString, qt_url)); } return false; } -bool QCefBrowserClient::OnOpenURLFromTab( - CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, const CefString &target_url, - CefRequestHandler::WindowOpenDisposition, bool) +bool QCefBrowserClient::OnOpenURLFromTab(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, const CefString &target_url, + CefRequestHandler::WindowOpenDisposition, bool) { std::string str_url = target_url; @@ -138,10 +136,8 @@ return true; } -void QCefBrowserClient::OnLoadError(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefLoadHandler::ErrorCode errorCode, - const CefString &errorText, +void QCefBrowserClient::OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefLoadHandler::ErrorCode errorCode, const CefString &errorText, const CefString &failedUrl) { UNUSED_PARAMETER(browser); @@ -157,23 +153,18 @@ dstr_replace(&html, "%%ERROR_URL%%", failedUrl.ToString().c_str()); dstr_replace(&html, "Error.Title", obs_module_text("Error.Title")); - dstr_replace(&html, "Error.Description", - obs_module_text("Error.Description")); + dstr_replace(&html, "Error.Description", obs_module_text("Error.Description")); dstr_replace(&html, "Error.Retry", obs_module_text("Error.Retry")); const char *translError; std::string errorKey = "ErrorCode." + errorText.ToString(); - if (obs_module_get_string(errorKey.c_str(), - (const char **)&translError)) { + if (obs_module_get_string(errorKey.c_str(), (const char **)&translError)) { dstr_replace(&html, "%%ERROR_CODE%%", translError); } else { - dstr_replace(&html, "%%ERROR_CODE%%", - errorText.ToString().c_str()); + dstr_replace(&html, "%%ERROR_CODE%%", errorText.ToString().c_str()); } - frame->LoadURL( - "data:text/html;base64," + - CefURIEncode(CefBase64Encode(html.array, html.len), false) - .ToString()); + frame->LoadURL("data:text/html;base64," + + CefURIEncode(CefBase64Encode(html.array, html.len), false).ToString()); dstr_free(&html); bfree(path); @@ -181,12 +172,10 @@ } /* CefLifeSpanHandler */ -bool QCefBrowserClient::OnBeforePopup( - CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, const CefString &target_url, - const CefString &, CefLifeSpanHandler::WindowOpenDisposition, bool, - const CefPopupFeatures &, CefWindowInfo &windowInfo, - CefRefPtr<CefClient> &, CefBrowserSettings &, - CefRefPtr<CefDictionaryValue> &, bool *) +bool QCefBrowserClient::OnBeforePopup(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, const CefString &target_url, + const CefString &, CefLifeSpanHandler::WindowOpenDisposition, bool, + const CefPopupFeatures &, CefWindowInfo &windowInfo, CefRefPtr<CefClient> &, + CefBrowserSettings &, CefRefPtr<CefDictionaryValue> &, bool *) { if (allowAllPopups) { #ifdef _WIN32 @@ -205,8 +194,7 @@ PopupWhitelistInfo &info = popup_whitelisti - 1; if (!info.obj) { - popup_whitelist.erase(popup_whitelist.begin() + - (i - 1)); + popup_whitelist.erase(popup_whitelist.begin() + (i - 1)); continue; } @@ -225,8 +213,14 @@ return true; } -bool QCefBrowserClient::OnSetFocus(CefRefPtr<CefBrowser>, - CefFocusHandler::FocusSource source) +void QCefBrowserClient::OnBeforeClose(CefRefPtr<CefBrowser>) +{ + if (widget) { + emit widget->CloseSafely(); + } +} + +bool QCefBrowserClient::OnSetFocus(CefRefPtr<CefBrowser>, CefFocusHandler::FocusSource source) { /* Don't steal focus when the webpage navigates. This is especially obvious on startup when the user has many browser docks defined, @@ -240,17 +234,12 @@ } } -void QCefBrowserClient::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame>, - CefRefPtr<CefContextMenuParams>, - CefRefPtr<CefMenuModel> model) +void QCefBrowserClient::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, + CefRefPtr<CefContextMenuParams>, CefRefPtr<CefMenuModel> model) { if (model->IsVisible(MENU_ID_BACK) && - (!model->IsVisible(MENU_ID_RELOAD) && - !model->IsVisible(MENU_ID_RELOAD_NOCACHE))) { - model->InsertItemAt( - 2, MENU_ID_RELOAD_NOCACHE, - QObject::tr("RefreshBrowser").toUtf8().constData()); + (!model->IsVisible(MENU_ID_RELOAD) && !model->IsVisible(MENU_ID_RELOAD_NOCACHE))) { + model->InsertItemAt(2, MENU_ID_RELOAD_NOCACHE, QObject::tr("RefreshBrowser").toUtf8().constData()); } if (model->IsVisible(MENU_ID_PRINT)) { model->Remove(MENU_ID_PRINT); @@ -260,108 +249,88 @@ } model->AddItem(MENU_ITEM_ZOOM_IN, obs_module_text("Zoom.In")); if (browser->GetHost()->GetZoomLevel() != 0) { - model->AddItem(MENU_ITEM_ZOOM_RESET, - obs_module_text("Zoom.Reset")); + model->AddItem(MENU_ITEM_ZOOM_RESET, obs_module_text("Zoom.Reset")); } model->AddItem(MENU_ITEM_ZOOM_OUT, obs_module_text("Zoom.Out")); model->AddSeparator(); - model->InsertItemAt(model->GetCount(), MENU_ITEM_COPY_URL, - obs_module_text("CopyUrl")); - model->InsertItemAt(model->GetCount(), MENU_ITEM_DEVTOOLS, - obs_module_text("Inspect")); - model->InsertCheckItemAt(model->GetCount(), MENU_ITEM_MUTE, - QObject::tr("Mute").toUtf8().constData()); + model->InsertItemAt(model->GetCount(), MENU_ITEM_COPY_URL, obs_module_text("CopyUrl")); + model->InsertItemAt(model->GetCount(), MENU_ITEM_DEVTOOLS, obs_module_text("Inspect")); + model->InsertCheckItemAt(model->GetCount(), MENU_ITEM_MUTE, QObject::tr("Mute").toUtf8().constData()); model->SetChecked(MENU_ITEM_MUTE, browser->GetHost()->IsAudioMuted()); } #if defined(_WIN32) -bool QCefBrowserClient::RunContextMenu( - CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, - CefRefPtr<CefContextMenuParams>, CefRefPtr<CefMenuModel> model, - CefRefPtr<CefRunContextMenuCallback> callback) +bool QCefBrowserClient::RunContextMenu(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefContextMenuParams>, + CefRefPtr<CefMenuModel> model, CefRefPtr<CefRunContextMenuCallback> callback) { std::vector<std::tuple<std::string, int, bool, int, bool>> menu_items; menu_items.reserve(model->GetCount()); for (int i = 0; i < model->GetCount(); i++) { - menu_items.push_back( - {model->GetLabelAt(i), model->GetCommandIdAt(i), - model->IsEnabledAt(i), model->GetTypeAt(i), - model->IsCheckedAt(i)}); + menu_items.push_back({model->GetLabelAt(i), model->GetCommandIdAt(i), model->IsEnabledAt(i), + model->GetTypeAt(i), model->IsCheckedAt(i)}); } - QMetaObject::invokeMethod( - QCoreApplication::instance()->thread(), - menu_items, callback() { - QMenu contextMenu; - std::string name; - int command_id; - bool enabled; - int type_id; - bool check; - - for (const std::tuple<std::string, int, bool, int, bool> - &menu_item : menu_items) { - std::tie(name, command_id, enabled, type_id, - check) = menu_item; - switch (type_id) { - case MENUITEMTYPE_CHECK: - case MENUITEMTYPE_COMMAND: { - QAction *item = - new QAction(name.c_str()); - item->setEnabled(enabled); - if (type_id == MENUITEMTYPE_CHECK) { - item->setCheckable(true); - item->setChecked(check); - } - item->setProperty("cmd_id", command_id); - contextMenu.addAction(item); - } break; - case MENUITEMTYPE_SEPARATOR: - contextMenu.addSeparator(); - break; + QMetaObject::invokeMethod(QCoreApplication::instance()->thread(), menu_items, callback() { + QMenu contextMenu; + std::string name; + int command_id; + bool enabled; + int type_id; + bool check; + + for (const std::tuple<std::string, int, bool, int, bool> &menu_item : menu_items) { + std::tie(name, command_id, enabled, type_id, check) = menu_item; + switch (type_id) { + case MENUITEMTYPE_CHECK: + case MENUITEMTYPE_COMMAND: { + QAction *item = new QAction(name.c_str()); + item->setEnabled(enabled); + if (type_id == MENUITEMTYPE_CHECK) { + item->setCheckable(true); + item->setChecked(check); } + item->setProperty("cmd_id", command_id); + contextMenu.addAction(item); + } break; + case MENUITEMTYPE_SEPARATOR: + contextMenu.addSeparator(); + break; } + } - QAction *action = contextMenu.exec(QCursor::pos()); - if (action) { - QVariant cmdId = action->property("cmd_id"); - callback.get()->Continue(cmdId.toInt(), - EVENTFLAG_NONE); - } else { - callback.get()->Cancel(); - } - }); + QAction *action = contextMenu.exec(QCursor::pos()); + if (action) { + QVariant cmdId = action->property("cmd_id"); + callback.get()->Continue(cmdId.toInt(), EVENTFLAG_NONE); + } else { + callback.get()->Cancel(); + } + }); return true; } #endif -bool QCefBrowserClient::OnContextMenuCommand( - CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, - CefRefPtr<CefContextMenuParams> params, int command_id, - CefContextMenuHandler::EventFlags) +bool QCefBrowserClient::OnContextMenuCommand(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame>, + CefRefPtr<CefContextMenuParams> params, int command_id, + CefContextMenuHandler::EventFlags) { if (command_id < MENU_ID_CUSTOM_FIRST) return false; CefRefPtr<CefBrowserHost> host = browser->GetHost(); CefWindowInfo windowInfo; QPoint pos; - QString title; switch (command_id) { case MENU_ITEM_DEVTOOLS: #if defined(_WIN32) && CHROME_VERSION_BUILD < 6533 - title = QString(obs_module_text("DevTools")) - .arg(widget->parentWidget()->windowTitle()); - windowInfo.SetAsPopup(host->GetWindowHandle(), - title.toUtf8().constData()); + windowInfo.SetAsPopup(host->GetWindowHandle(), ""); #endif pos = widget->mapToGlobal(QPoint(0, 0)); windowInfo.bounds.x = pos.x(); windowInfo.bounds.y = pos.y() + 30; windowInfo.bounds.width = 900; windowInfo.bounds.height = 700; - host->ShowDevTools( - windowInfo, host->GetClient(), CefBrowserSettings(), - {params.get()->GetXCoord(), params.get()->GetYCoord()}); + host->ShowDevTools(windowInfo, host->GetClient(), CefBrowserSettings(), + {params.get()->GetXCoord(), params.get()->GetYCoord()}); return true; case MENU_ITEM_MUTE: host->SetAudioMuted(!host->IsAudioMuted()); @@ -383,20 +352,17 @@ clipboard->setText(url.c_str(), QClipboard::Clipboard); if (clipboard->supportsSelection()) { - clipboard->setText(url.c_str(), - QClipboard::Selection); + clipboard->setText(url.c_str(), QClipboard::Selection); } }; - QMetaObject::invokeMethod( - QCoreApplication::instance()->thread(), saveClipboard); + QMetaObject::invokeMethod(QCoreApplication::instance()->thread(), saveClipboard); return true; break; } return false; } -void QCefBrowserClient::OnLoadStart(CefRefPtr<CefBrowser>, - CefRefPtr<CefFrame> frame, TransitionType) +void QCefBrowserClient::OnLoadStart(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame> frame, TransitionType) { if (!frame->IsMain()) return; @@ -408,8 +374,7 @@ frame->ExecuteJavaScript(script, "", 0); } -void QCefBrowserClient::OnLoadEnd(CefRefPtr<CefBrowser>, - CefRefPtr<CefFrame> frame, int) +void QCefBrowserClient::OnLoadEnd(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame> frame, int) { if (!frame->IsMain()) return; @@ -421,10 +386,8 @@ } bool QCefBrowserClient::OnJSDialog(CefRefPtr<CefBrowser>, const CefString &, - CefJSDialogHandler::JSDialogType dialog_type, - const CefString &message_text, - const CefString &default_prompt_text, - CefRefPtr<CefJSDialogCallback> callback, + CefJSDialogHandler::JSDialogType dialog_type, const CefString &message_text, + const CefString &default_prompt_text, CefRefPtr<CefJSDialogCallback> callback, bool &) { QString parentTitle = widget->parentWidget()->windowTitle(); @@ -432,31 +395,26 @@ QString msg_raw(message_text.ToString().c_str()); // Replace <br> with standard newline as we will render in plaintext msg_raw.replace(QRegularExpression("<br\\s{0,1}\\/{0,1}>"), "\n"); - QString submsg = - QString(obs_module_text("Dialog.ReceivedFrom")).arg(parentTitle); + QString submsg = QString(obs_module_text("Dialog.ReceivedFrom")).arg(parentTitle); QString msg = QString("%1\n\n\n%2").arg(msg_raw).arg(submsg); if (dialog_type == JSDIALOGTYPE_PROMPT) { auto msgbox = msg, default_value, callback() { QInputDialog *dlg = new QInputDialog(nullptr); dlg->setWindowFlag(Qt::WindowStaysOnTopHint, true); - dlg->setWindowFlag(Qt::WindowContextHelpButtonHint, - false); + dlg->setWindowFlag(Qt::WindowContextHelpButtonHint, false); std::stringstream title; - title << obs_module_text("Dialog.Prompt") << ": " - << obs_module_text("Dialog.BrowserDock"); + title << obs_module_text("Dialog.Prompt") << ": " << obs_module_text("Dialog.BrowserDock"); dlg->setWindowTitle(title.str().c_str()); if (!default_value.empty()) dlg->setTextValue(default_value.c_str()); auto finished = callback, dlg(int result) { - callback.get()->Continue( - result == QDialog::Accepted, - dlg->textValue().toUtf8().constData()); + callback.get()->Continue(result == QDialog::Accepted, + dlg->textValue().toUtf8().constData()); }; - QWidget::connect(dlg, &QInputDialog::finished, - finished); + QWidget::connect(dlg, &QInputDialog::finished, finished); dlg->open(); if (QLabel *lbl = dlg->findChild<QLabel *>()) { // Force plaintext manually @@ -464,8 +422,7 @@ } dlg->setLabelText(msg); }; - QMetaObject::invokeMethod( - QCoreApplication::instance()->thread(), msgbox); + QMetaObject::invokeMethod(QCoreApplication::instance()->thread(), msgbox); return true; } auto msgbox = msg, dialog_type, callback() { @@ -498,14 +455,11 @@ dlg->open(); }; - QMetaObject::invokeMethod(QCoreApplication::instance()->thread(), - msgbox); + QMetaObject::invokeMethod(QCoreApplication::instance()->thread(), msgbox); return true; } -bool QCefBrowserClient::OnPreKeyEvent(CefRefPtr<CefBrowser> browser, - const CefKeyEvent &event, CefEventHandle, - bool *) +bool QCefBrowserClient::OnPreKeyEvent(CefRefPtr<CefBrowser> browser, const CefKeyEvent &event, CefEventHandle, bool *) { if (event.type != KEYEVENT_RAWKEYDOWN) return false; @@ -518,18 +472,15 @@ #endif browser->ReloadIgnoreCache(); return true; - } else if ((event.windows_key_code == 189 || - event.windows_key_code == 109) && + } else if ((event.windows_key_code == 189 || event.windows_key_code == 109) && (event.modifiers & EVENTFLAG_CONTROL_DOWN) != 0) { // Zoom out return widget->zoomPage(-1); - } else if ((event.windows_key_code == 187 || - event.windows_key_code == 107) && + } else if ((event.windows_key_code == 187 || event.windows_key_code == 107) && (event.modifiers & EVENTFLAG_CONTROL_DOWN) != 0) { // Zoom in return widget->zoomPage(1); - } else if ((event.windows_key_code == 48 || - event.windows_key_code == 96) && + } else if ((event.windows_key_code == 48 || event.windows_key_code == 96) && (event.modifiers & EVENTFLAG_CONTROL_DOWN) != 0) { // Reset zoom return widget->zoomPage(0);
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/panel/browser-panel-client.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/panel/browser-panel-client.hpp
Changed
@@ -16,9 +16,7 @@ public CefJSDialogHandler { public: - inline QCefBrowserClient(QCefWidgetInternal *widget_, - const std::string &script_, - bool allowAllPopups_) + inline QCefBrowserClient(QCefWidgetInternal *widget_, const std::string &script_, bool allowAllPopups_) : widget(widget_), script(script_), allowAllPopups(allowAllPopups_) @@ -32,90 +30,67 @@ virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() override; virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() override; virtual CefRefPtr<CefFocusHandler> GetFocusHandler() override; - virtual CefRefPtr<CefContextMenuHandler> - GetContextMenuHandler() override; + virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() override; virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() override; /* CefDisplayHandler */ - virtual void OnTitleChange(CefRefPtr<CefBrowser> browser, - const CefString &title) override; + virtual void OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString &title) override; /* CefRequestHandler */ - virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefRefPtr<CefRequest> request, - bool user_gesture, - bool is_redirect) override; - - virtual void OnLoadError(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefLoadHandler::ErrorCode errorCode, - const CefString &errorText, + virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefRefPtr<CefRequest> request, bool user_gesture, bool is_redirect) override; + + virtual void OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefLoadHandler::ErrorCode errorCode, const CefString &errorText, const CefString &failedUrl) override; - virtual bool OnOpenURLFromTab( - CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, - const CefString &target_url, - CefRequestHandler::WindowOpenDisposition target_disposition, - bool user_gesture) override; + virtual bool OnOpenURLFromTab(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + const CefString &target_url, + CefRequestHandler::WindowOpenDisposition target_disposition, + bool user_gesture) override; /* CefLifeSpanHandler */ - virtual bool OnBeforePopup( - CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, - const CefString &target_url, const CefString &target_frame_name, - CefLifeSpanHandler::WindowOpenDisposition target_disposition, - bool user_gesture, const CefPopupFeatures &popupFeatures, - CefWindowInfo &windowInfo, CefRefPtr<CefClient> &client, - CefBrowserSettings &settings, - CefRefPtr<CefDictionaryValue> &extra_info, - bool *no_javascript_access) override; + virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + const CefString &target_url, const CefString &target_frame_name, + CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, + const CefPopupFeatures &popupFeatures, CefWindowInfo &windowInfo, + CefRefPtr<CefClient> &client, CefBrowserSettings &settings, + CefRefPtr<CefDictionaryValue> &extra_info, bool *no_javascript_access) override; + + virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) override; /* CefFocusHandler */ - virtual bool OnSetFocus(CefRefPtr<CefBrowser> browser, - CefFocusHandler::FocusSource source) override; + virtual bool OnSetFocus(CefRefPtr<CefBrowser> browser, CefFocusHandler::FocusSource source) override; /* CefContextMenuHandler */ - virtual void - OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - CefRefPtr<CefContextMenuParams> params, - CefRefPtr<CefMenuModel> model) override; + virtual void OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefRefPtr<CefContextMenuParams> params, + CefRefPtr<CefMenuModel> model) override; #if defined(_WIN32) - virtual bool - RunContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, - CefRefPtr<CefContextMenuParams> params, - CefRefPtr<CefMenuModel> model, - CefRefPtr<CefRunContextMenuCallback> callback) override; + virtual bool RunContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefRefPtr<CefContextMenuParams> params, CefRefPtr<CefMenuModel> model, + CefRefPtr<CefRunContextMenuCallback> callback) override; #endif - virtual bool OnContextMenuCommand( - CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, - CefRefPtr<CefContextMenuParams> params, int command_id, - CefContextMenuHandler::EventFlags event_flags) override; + virtual bool OnContextMenuCommand(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, + CefRefPtr<CefContextMenuParams> params, int command_id, + CefContextMenuHandler::EventFlags event_flags) override; /* CefLoadHandler */ - virtual void OnLoadStart(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, + virtual void OnLoadStart(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, TransitionType transition_type) override; - virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser, - CefRefPtr<CefFrame> frame, - int httpStatusCode) override; + virtual void OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int httpStatusCode) override; /* CefKeyboardHandler */ - virtual bool OnPreKeyEvent(CefRefPtr<CefBrowser> browser, - const CefKeyEvent &event, - CefEventHandle os_event, + virtual bool OnPreKeyEvent(CefRefPtr<CefBrowser> browser, const CefKeyEvent &event, CefEventHandle os_event, bool *is_keyboard_shortcut) override; /* CefJSDialogHandler */ - virtual bool OnJSDialog(CefRefPtr<CefBrowser> browser, - const CefString &origin_url, - CefJSDialogHandler::JSDialogType dialog_type, - const CefString &message_text, - const CefString &default_prompt_text, - CefRefPtr<CefJSDialogCallback> callback, + virtual bool OnJSDialog(CefRefPtr<CefBrowser> browser, const CefString &origin_url, + CefJSDialogHandler::JSDialogType dialog_type, const CefString &message_text, + const CefString &default_prompt_text, CefRefPtr<CefJSDialogCallback> callback, bool &suppress_message) override; QCefWidgetInternal *widget = nullptr;
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/panel/browser-panel-internal.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/panel/browser-panel-internal.hpp
Changed
@@ -12,10 +12,7 @@ std::string url; QPointer<QObject> obj; - inline PopupWhitelistInfo(const std::string &url_, QObject *obj_) - : url(url_), obj(obj_) - { - } + inline PopupWhitelistInfo(const std::string &url_, QObject *obj_) : url(url_), obj(obj_) {} }; extern std::mutex popup_whitelist_mutex; @@ -28,8 +25,7 @@ Q_OBJECT public: - QCefWidgetInternal(QWidget *parent, const std::string &url, - CefRefPtr<CefRequestContext> rqc); + QCefWidgetInternal(QWidget *parent, const std::string &url, CefRefPtr<CefRequestContext> rqc); ~QCefWidgetInternal(); CefRefPtr<CefBrowser> cefBrowser; @@ -55,6 +51,7 @@ virtual bool zoomPage(int direction) override; virtual void executeJavaScript(const std::string &script) override; + void CloseSafely(); void Resize(); #ifdef __linux__ @@ -65,4 +62,7 @@ public slots: void Init(); + +signals: + void readyToClose(); };
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/panel/browser-panel.cpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/panel/browser-panel.cpp
Changed
@@ -33,8 +33,7 @@ std::vector<PopupWhitelistInfo> popup_whitelist; std::vector<PopupWhitelistInfo> forced_popups; -static int zoomLvls = {25, 33, 50, 67, 75, 80, 90, 100, - 110, 125, 150, 175, 200, 250, 300, 400}; +static int zoomLvls = {25, 33, 50, 67, 75, 80, 90, 100, 110, 125, 150, 175, 200, 250, 300, 400}; /* ------------------------------------------------------------------------- */ @@ -44,9 +43,9 @@ std::string target; bool cookie_found = false; - inline CookieCheck(QCefCookieManager::cookie_exists_cb callback_, - const std::string target_) - : callback(callback_), target(target_) + inline CookieCheck(QCefCookieManager::cookie_exists_cb callback_, const std::string target_) + : callback(callback_), + target(target_) { } @@ -71,8 +70,7 @@ CefRefPtr<CefCookieManager> cm; CefRefPtr<CefRequestContext> rc; - QCefCookieManagerInternal(const std::string &storage_path, - bool persist_session_cookies) + QCefCookieManagerInternal(const std::string &storage_path, bool persist_session_cookies) { if (os_event_try(cef_started_event) != 0) throw "Browser thread not initialized"; @@ -88,22 +86,19 @@ settings.persist_user_preferences = 1; #endif CefString(&settings.cache_path) = path.Get(); - rc = CefRequestContext::CreateContext( - settings, CefRefPtr<CefRequestContextHandler>()); + rc = CefRequestContext::CreateContext(settings, CefRefPtr<CefRequestContextHandler>()); if (rc) cm = rc->GetCookieManager(nullptr); UNUSED_PARAMETER(persist_session_cookies); } - virtual bool DeleteCookies(const std::string &url, - const std::string &name) override + virtual bool DeleteCookies(const std::string &url, const std::string &name) override { return !!cm ? cm->DeleteCookies(url, name, nullptr) : false; } - virtual bool SetStoragePath(const std::string &storage_path, - bool persist_session_cookies) override + virtual bool SetStoragePath(const std::string &storage_path, bool persist_session_cookies) override { BPtr<char> rpath = obs_module_config_path(storage_path.c_str()); BPtr<char> path = os_get_abs_path_ptr(rpath.Get()); @@ -113,8 +108,7 @@ settings.persist_user_preferences = 1; #endif CefString(&settings.cache_path) = storage_path; - rc = CefRequestContext::CreateContext( - settings, CefRefPtr<CefRequestContextHandler>()); + rc = CefRequestContext::CreateContext(settings, CefRefPtr<CefRequestContextHandler>()); if (rc) cm = rc->GetCookieManager(nullptr); @@ -122,13 +116,9 @@ return true; } - virtual bool FlushStore() override - { - return !!cm ? cm->FlushStore(nullptr) : false; - } + virtual bool FlushStore() override { return !!cm ? cm->FlushStore(nullptr) : false; } - virtual void CheckForCookie(const std::string &site, - const std::string &cookie, + virtual void CheckForCookie(const std::string &site, const std::string &cookie, cookie_exists_cb callback) override { if (!cm) @@ -141,9 +131,10 @@ /* ------------------------------------------------------------------------- */ -QCefWidgetInternal::QCefWidgetInternal(QWidget *parent, const std::string &url_, - CefRefPtr<CefRequestContext> rqc_) - : QCefWidget(parent), url(url_), rqc(rqc_) +QCefWidgetInternal::QCefWidgetInternal(QWidget *parent, const std::string &url_, CefRefPtr<CefRequestContext> rqc_) + : QCefWidget(parent), + url(url_), + rqc(rqc_) { setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_StaticContents); @@ -169,24 +160,24 @@ { CefRefPtr<CefBrowser> browser = cefBrowser; if (!!browser) { - auto destroyBrowser = (CefRefPtr<CefBrowser> cefBrowser) { - CefRefPtr<CefClient> client = - cefBrowser->GetHost()->GetClient(); - QCefBrowserClient *bc = - reinterpret_cast<QCefBrowserClient *>( - client.get()); - - if (bc) { - bc->widget = nullptr; - } + auto destroyBrowser = =(CefRefPtr<CefBrowser> cefBrowser) { + CefRefPtr<CefClient> client = cefBrowser->GetHost()->GetClient(); + QCefBrowserClient *bc = reinterpret_cast<QCefBrowserClient *>(client.get()); cefBrowser->GetHost()->CloseBrowser(true); #if !defined(_WIN32) && !defined(__APPLE__) && CHROME_VERSION_BUILD >= 6533 - while (cefBrowser && cefBrowser->IsValid()) { - os_sleep_ms(10); - } + QEventLoop loop; + + connect(this, &QCefWidgetInternal::readyToClose, &loop, &QEventLoop::quit); + + QTimer::singleShot(1000, &loop, &QEventLoop::quit); + + loop.exec(); #endif + if (bc) { + bc->widget = nullptr; + } }; /* So you're probably wondering what's going on here. If you @@ -215,8 +206,7 @@ // felt hacky, might delete later void *view = (id)cefBrowser->GetHost()->GetWindowHandle(); if (*((bool *)view)) - ((void (*)(id, SEL))objc_msgSend)( - (id)view, sel_getUid("removeFromSuperview")); + ((void (*)(id, SEL))objc_msgSend)((id)view, sel_getUid("removeFromSuperview")); #endif destroyBrowser(browser); @@ -234,9 +224,8 @@ unsigned long bytesAfter; unsigned char *data = NULL; - if (XGetWindowProperty(display, w, a, 0, LONG_MAX, False, - AnyPropertyType, &type, &format, &nItems, - &bytesAfter, &data) != Success) + if (XGetWindowProperty(display, w, a, 0, LONG_MAX, False, AnyPropertyType, &type, &format, &nItems, &bytesAfter, + &data) != Success) return false; if (data) @@ -257,8 +246,7 @@ if (!cefBrowser) return; - CefWindowHandle browserHandle = - cefBrowser->GetHost()->GetWindowHandle(); + CefWindowHandle browserHandle = cefBrowser->GetHost()->GetWindowHandle(); Display *xDisplay = cef_get_xdisplay(); Window toplevel, root, parent, *children; unsigned int nChildren; @@ -269,15 +257,13 @@ // Find the toplevel Atom netWmPidAtom = XInternAtom(xDisplay, "_NET_WM_PID", False); do { - if (XQueryTree(xDisplay, toplevel, &root, &parent, &children, - &nChildren) == 0) + if (XQueryTree(xDisplay, toplevel, &root, &parent, &children, &nChildren) == 0) return; if (children) XFree(children); - if (root == parent || - !XWindowHasAtom(xDisplay, parent, netWmPidAtom)) { + if (root == parent || !XWindowHasAtom(xDisplay, parent, netWmPidAtom)) { found = true; break; } @@ -289,8 +275,7 @@ // Check if the XdndProxy property is set Atom xDndProxyAtom = XInternAtom(xDisplay, "XdndProxy", False); - if (needsDeleteXdndProxy && - !XWindowHasAtom(xDisplay, toplevel, xDndProxyAtom)) { + if (needsDeleteXdndProxy && !XWindowHasAtom(xDisplay, toplevel, xDndProxyAtom)) { QueueCEFTask(this() { unsetToplevelXdndProxy(); }); return; } @@ -330,8 +315,7 @@ #if CHROME_VERSION_BUILD < 4430 #ifdef __APPLE__ - windowInfo.SetAsChild((CefWindowHandle)handle, 0, 0, - size.width(), size.height()); + windowInfo.SetAsChild((CefWindowHandle)handle, 0, 0, size.width(), size.height()); #else #ifdef _WIN32 RECT rc = {0, 0, size.width(), size.height()}; @@ -341,20 +325,16 @@ windowInfo.SetAsChild((CefWindowHandle)handle, rc); #endif #else - windowInfo.SetAsChild((CefWindowHandle)handle, - CefRect(0, 0, size.width(), - size.height())); + windowInfo.SetAsChild((CefWindowHandle)handle, CefRect(0, 0, size.width(), size.height())); #endif CefRefPtr<QCefBrowserClient> browserClient = - new QCefBrowserClient(this, script, - allowAllPopups_); + new QCefBrowserClient(this, script, allowAllPopups_); CefBrowserSettings cefBrowserSettings; - cefBrowser = CefBrowserHost::CreateBrowserSync( - windowInfo, browserClient, url, - cefBrowserSettings, - CefRefPtr<CefDictionaryValue>(), rqc); + cefBrowser = CefBrowserHost::CreateBrowserSync(windowInfo, browserClient, url, + cefBrowserSettings, + CefRefPtr<CefDictionaryValue>(), rqc); #ifdef __linux__ QueueCEFTask(this() { unsetToplevelXdndProxy(); }); @@ -365,8 +345,7 @@ timer.stop(); #ifndef __APPLE__ if (!container) { - container = - QWidget::createWindowContainer(window, this); + container = QWidget::createWindowContainer(window, this); container->show(); } @@ -390,18 +369,15 @@ if (!cefBrowser) return; - CefWindowHandle handle = - cefBrowser->GetHost()->GetWindowHandle(); + CefWindowHandle handle = cefBrowser->GetHost()->GetWindowHandle(); if (!handle) return; #ifdef _WIN32 - SetWindowPos((HWND)handle, nullptr, 0, 0, size.width(), - size.height(), + SetWindowPos((HWND)handle, nullptr, 0, 0, size.width(), size.height(), SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER); - SendMessage((HWND)handle, WM_SIZE, 0, - MAKELPARAM(size.width(), size.height())); + SendMessage((HWND)handle, WM_SIZE, 0, MAKELPARAM(size.width(), size.height())); #else Display *xDisplay = cef_get_xdisplay(); @@ -413,8 +389,7 @@ changes.y = 0; changes.width = size.width(); changes.height = size.height(); - XConfigureWindow(xDisplay, (Window)handle, - CWX | CWY | CWHeight | CWWidth, &changes); + XConfigureWindow(xDisplay, (Window)handle, CWX | CWY | CWHeight | CWWidth, &changes); #if CHROME_VERSION_BUILD >= 4638 XSync(xDisplay, false); #endif @@ -426,14 +401,18 @@ #endif } +void QCefWidgetInternal::CloseSafely() +{ + emit readyToClose(); +} + void QCefWidgetInternal::showEvent(QShowEvent *event) { QWidget::showEvent(event); if (!cefBrowser) { obs_browser_initialize(); - connect(&timer, &QTimer::timeout, this, - &QCefWidgetInternal::Init); + connect(&timer, &QTimer::timeout, this, &QCefWidgetInternal::Init); timer.start(500); Init(); } @@ -528,21 +507,16 @@ virtual bool initialized(void) override; virtual bool wait_for_browser_init(void) override; - virtual QCefWidget * - create_widget(QWidget *parent, const std::string &url, - QCefCookieManager *cookie_manager) override; + virtual QCefWidget *create_widget(QWidget *parent, const std::string &url, + QCefCookieManager *cookie_manager) override; - virtual QCefCookieManager * - create_cookie_manager(const std::string &storage_path, - bool persist_session_cookies) override; + virtual QCefCookieManager *create_cookie_manager(const std::string &storage_path, + bool persist_session_cookies) override; - virtual BPtr<char> - get_cookie_path(const std::string &storage_path) override; + virtual BPtr<char> get_cookie_path(const std::string &storage_path) override; - virtual void add_popup_whitelist_url(const std::string &url, - QObject *obj) override; - virtual void add_force_popup_url(const std::string &url, - QObject *obj) override; + virtual void add_popup_whitelist_url(const std::string &url, QObject *obj) override; + virtual void add_force_popup_url(const std::string &url, QObject *obj) override; }; bool QCefInternal::init_browser(void) @@ -564,22 +538,17 @@ return os_event_wait(cef_started_event) == 0; } -QCefWidget *QCefInternal::create_widget(QWidget *parent, const std::string &url, - QCefCookieManager *cm) +QCefWidget *QCefInternal::create_widget(QWidget *parent, const std::string &url, QCefCookieManager *cm) { - QCefCookieManagerInternal *cmi = - reinterpret_cast<QCefCookieManagerInternal *>(cm); + QCefCookieManagerInternal *cmi = reinterpret_cast<QCefCookieManagerInternal *>(cm); return new QCefWidgetInternal(parent, url, cmi ? cmi->rc : nullptr); } -QCefCookieManager * -QCefInternal::create_cookie_manager(const std::string &storage_path, - bool persist_session_cookies) +QCefCookieManager *QCefInternal::create_cookie_manager(const std::string &storage_path, bool persist_session_cookies) { try { - return new QCefCookieManagerInternal(storage_path, - persist_session_cookies); + return new QCefCookieManagerInternal(storage_path, persist_session_cookies); } catch (const char *error) { blog(LOG_ERROR, "Failed to create cookie manager: %s", error); return nullptr;
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-browser/panel/browser-panel.hpp -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-browser/panel/browser-panel.hpp
Changed
@@ -19,17 +19,13 @@ struct QCefCookieManager { virtual ~QCefCookieManager() {} - virtual bool DeleteCookies(const std::string &url, - const std::string &name) = 0; - virtual bool SetStoragePath(const std::string &storage_path, - bool persist_session_cookies = false) = 0; + virtual bool DeleteCookies(const std::string &url, const std::string &name) = 0; + virtual bool SetStoragePath(const std::string &storage_path, bool persist_session_cookies = false) = 0; virtual bool FlushStore() = 0; typedef std::function<void(bool)> cookie_exists_cb; - virtual void CheckForCookie(const std::string &site, - const std::string &cookie, - cookie_exists_cb callback) = 0; + virtual void CheckForCookie(const std::string &site, const std::string &cookie, cookie_exists_cb callback) = 0; }; /* ------------------------------------------------------------------------- */ @@ -63,20 +59,16 @@ virtual bool initialized(void) = 0; virtual bool wait_for_browser_init(void) = 0; - virtual QCefWidget * - create_widget(QWidget *parent, const std::string &url, - QCefCookieManager *cookie_manager = nullptr) = 0; + virtual QCefWidget *create_widget(QWidget *parent, const std::string &url, + QCefCookieManager *cookie_manager = nullptr) = 0; - virtual QCefCookieManager * - create_cookie_manager(const std::string &storage_path, - bool persist_session_cookies = false) = 0; + virtual QCefCookieManager *create_cookie_manager(const std::string &storage_path, + bool persist_session_cookies = false) = 0; virtual BPtr<char> get_cookie_path(const std::string &storage_path) = 0; - virtual void add_popup_whitelist_url(const std::string &url, - QObject *obj) = 0; - virtual void add_force_popup_url(const std::string &url, - QObject *obj) = 0; + virtual void add_popup_whitelist_url(const std::string &url, QObject *obj) = 0; + virtual void add_force_popup_url(const std::string &url, QObject *obj) = 0; }; static inline void *get_browser_lib() @@ -105,8 +97,7 @@ if (!lib) return nullptr; - create_qcef = - (decltype(create_qcef))os_dlsym(lib, "obs_browser_create_qcef"); + create_qcef = (decltype(create_qcef))os_dlsym(lib, "obs_browser_create_qcef"); if (!create_qcef) return nullptr; @@ -122,8 +113,7 @@ if (!lib) return 0; - qcef_version = (decltype(qcef_version))os_dlsym( - lib, "obs_browser_qcef_version_export"); + qcef_version = (decltype(qcef_version))os_dlsym(lib, "obs_browser_qcef_version_export"); if (!qcef_version) return 0;
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-nvenc/nvenc.c -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-nvenc/nvenc.c
Changed
@@ -274,6 +274,14 @@ initialize_params(enc, &nv_preset, nv_tuning, voi->width, voi->height, voi->fps_num, voi->fps_den); +#ifdef NVENC_12_2_OR_LATER + /* Force at least 4 b-frames when using the UHQ tune */ + if (nv_tuning == NV_ENC_TUNING_INFO_ULTRA_HIGH_QUALITY && enc->props.bf < 4) { + warn("Forcing number of b-frames to 4 for UHQ tune."); + enc->props.bf = 4; + } +#endif + config->gopLength = gop_size; config->frameIntervalP = gop_size == 1 ? 0 : (int32_t)enc->props.bf + 1;
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-outputs/flv-mux.c -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-outputs/flv-mux.c
Changed
@@ -626,7 +626,7 @@ * The default trackId is 0. */ if (is_multitrack) { - s_w8(&s, MULTITRACKTYPE_ONE_TRACK | PACKETTYPE_METADATA); + s_w8(&s, (uint8_t)MULTITRACKTYPE_ONE_TRACK | (uint8_t)PACKETTYPE_METADATA); s_w4cc(&s, codec_id); // trackId s_w8(&s, (uint8_t)idx);
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-qsv11/CMakeLists.txt -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-qsv11/CMakeLists.txt
Changed
@@ -10,7 +10,7 @@ add_library(obs-qsv11 MODULE) add_library(OBS::qsv11 ALIAS obs-qsv11) -find_package(VPL 2.6 REQUIRED) +find_package(VPL 2.9 REQUIRED) if(OS_LINUX) find_package(Libva REQUIRED)
View file
obs-studio-31.0.0~beta1.tar.xz/plugins/obs-qsv11/obs-qsv-test/CMakeLists.txt -> obs-studio-31.0.0~beta2.tar.xz/plugins/obs-qsv11/obs-qsv-test/CMakeLists.txt
Changed
@@ -2,7 +2,7 @@ add_executable(obs-qsv-test) -find_package(VPL 2.6 REQUIRED) +find_package(VPL 2.9 REQUIRED) target_sources(obs-qsv-test PRIVATE obs-qsv-test.cpp)
View file
obs-studio-31.0.0~beta1.tar.xz/shared/properties-view/properties-view.cpp -> obs-studio-31.0.0~beta2.tar.xz/shared/properties-view/properties-view.cpp
Changed
@@ -691,9 +691,8 @@ static void NewButton(QLayout *layout, WidgetInfo *info, const char *themeIcon, void (WidgetInfo::*method)()) { QPushButton *button = new QPushButton(); - button->setProperty("class", themeIcon); + button->setProperty("class", "btn-tool " + QString(themeIcon)); button->setFlat(true); - button->setProperty("toolButton", true); QObject::connect(button, &QPushButton::clicked, info, method);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.