Compare commits

...

1228 Commits

Author SHA1 Message Date
b7b1885308 CI: Attempt to fix codesign identity for macOS 2022-09-01 05:12:36 -07:00
8823ecd209 buildspec: Update OBS master commit
Should fix builds on macOS
2022-08-20 16:06:48 -07:00
f7451d82a6 Update secret names again and fix windows CI version 2022-08-11 21:23:48 -07:00
d188e968c6 CI: Update again with fixed secret names and a few new commits 2022-08-11 20:54:50 -07:00
f432af5bfe Fixes 2022-08-05 00:15:33 -07:00
caf96212d0 Fix CI name 2022-08-04 23:48:39 -07:00
22b2640e1a Use newer crypto because it doesn't break 2022-08-04 23:38:36 -07:00
78837a4a2b More ifdefs!!! 2022-08-04 23:25:06 -07:00
f2ee7c922b I think this makes qt6 work better 2022-08-04 23:13:38 -07:00
f8b42cc35b Build on this branch 2022-08-04 22:54:56 -07:00
71df55c815 CI, CMakeLists: Upgrade to new CMake 2022-08-04 22:53:29 -07:00
af1399e005 CI: Update package name to not collide with 5.0.0 2022-07-25 08:17:58 -07:00
f6de26f7ac Merge pull request #945 from norihiro/4.x-compat-fix-memory-leak
Events: Fix memory leak
2022-06-08 01:08:42 -07:00
7ea9b16b37 Events: Fix memory leak
`bfree` was missing after calling `obs_frontend_get_current_profile()`.
2022-05-31 01:03:05 +09:00
ff6b774687 CMakeLists: Don't include imageformats plugins 2022-03-01 17:20:20 -08:00
9bdaefded9 CI: Update packages version 2022-03-01 17:10:39 -08:00
4a88612693 CI: Use focal 2022-03-01 16:59:05 -08:00
f8a88c54ce CI: force use obs 27.1.3 on linux 2022-03-01 16:53:41 -08:00
df2049b751 Locale: Update start failure message 2022-01-28 15:55:30 -08:00
dc9afeb213 Config: Reuse 4.x configs directly
Since compat is not meant to run alongside real 4.x, we shouldn't
care about reusing the original settings.
2022-01-28 15:43:50 -08:00
13c1c108ea Config: Set default port back to 4444 2022-01-28 15:43:14 -08:00
16ee66e6dc Base: Add logging for compile time ASIO version 2022-01-07 23:02:05 -08:00
d563dd3146 deps: Downgrade asio to 1.12.1
Even though we statically link ASIO, it has issues with the
kqueue_reactor() on macos segfaulting when other plugins using
different ASIO versions are installed. So that means we're stuck using
1.12.1 until we can find some kind of fix for the crash issue.
2022-01-04 00:39:52 -08:00
65a17071d2 deps: Upgrade to versions used by master 2022-01-03 23:35:02 -08:00
d993ce8b1a CI: Attempt fix of directory name 2022-01-03 18:39:45 -08:00
9c4a114c94 CI: Use specific branch instead of checkout
Azure is a dumb platform, meaning `git` is randomly not found.
So we'll just use something else then.
2022-01-03 17:34:11 -08:00
7062062ec5 CI: Fix sln file location on windows 2022-01-03 17:26:51 -08:00
be7c334a72 CI: Fix binary name on macos 2022-01-03 17:20:26 -08:00
b5f267d3bb RPC: Remove usage of std::optional
Stupid 10.13 doesnt support C++17. No idea how we built 4.9.0
2022-01-03 17:06:13 -08:00
d0d89dd133 CI: Use specifically 27.1.3 for build 2022-01-03 16:48:34 -08:00
a0e8cb6b4c CI: Set target to 10.13
This was accidentally removed in 4.9.1
2022-01-03 16:44:52 -08:00
348e875969 CI: Update more versions 2022-01-03 16:30:08 -08:00
be0fb682e0 CI: Build on 4.x-compat 2022-01-03 16:28:22 -08:00
ea8f14e41b Base: Update files for compat release 2022-01-03 16:26:42 -08:00
a8a3f3aafe WSServer: Add debug logging to stop()
Some users have been having issues with OBS hanging on server stop,
so this will help troubleshoot.
2021-11-18 15:58:33 -08:00
387376e5e0 .github: Remove logo 2021-11-16 22:59:15 -08:00
80cefdcfda README: Remove logo 2021-11-16 22:58:22 -08:00
6a14110720 Merge pull request #833 from you-win/feature/add-obs-websocket-gd-to-readme
Readme: Add obs-websocket-gd to readme
2021-10-07 12:37:08 -07:00
8bfe2bf04c Readme: Add obs-websocket-gd to readme
Add the obs-websocket-gd project to the readme as an available
language API.
2021-10-07 11:11:05 -04:00
bbf4b321d7 Merge pull request #780 from Palakis/fix/obsdata-double-release
Protocol: Fix double free of obs_data_t*
2021-07-18 21:11:07 +02:00
310c297a36 docs(ci): Update protocol.md - 5d14cb7 [skip ci] 2021-07-18 19:01:49 +00:00
5d14cb7af8 Merge pull request #791 from dvangennip/4.x-current
WSRequestHandler_Sources: fix comment name for Set/GetAudioTrack
2021-07-18 12:01:08 -07:00
48291506f5 Merge pull request #792 from andreykaipov/docs/go
Docs: Add another Go client library
2021-07-08 19:20:22 -07:00
b0badd0630 Docs: Add another Go client library 2021-07-08 21:21:25 -04:00
c5ef671e0c WSRequestHandler_Sources: fix comment name for Set/GetAudioTrack
Functions were named SetTracks and GetTracks rather than SetAudioTracks and GetAudioTracks as in the actual code, so this mismatch gets picked up by the protocol docs (but not anymore).
2021-07-03 21:04:49 +10:00
ffb97aaabc Protocol: Fix double free of obs_data_t* 2021-06-20 16:26:45 -07:00
d05ff26930 docs(ci): Update protocol.md - 5350832 [skip ci] 2021-06-10 05:56:15 +00:00
535083205a Merge pull request #765 from Palakis/4.9.1-prep
4.9.1 Prep
2021-06-10 07:55:38 +02:00
9a8d283d27 base: Update plugin version to 4.9.1 2021-06-09 21:03:59 -07:00
1eb02e77e0 Docs: Mark unreleased requests with 4.9.1 2021-06-09 19:11:02 -07:00
b271cf9d32 Merge pull request #692 from Palakis/fix/obs-shutdown-crash
Events: Fix multiple shutdown crashes
2021-06-10 02:39:26 +02:00
0a084122d3 Merge pull request #764 from dnaka91/fix-leak-tbar
Requests: Fix leak in ReleaseTBar, SetTBarPosition
2021-06-08 18:31:35 -07:00
a29e0325dd Merge pull request #761 from dnaka91/fix-release-transition
Requests: Fix leak in SetSceneTransitionOverride
2021-06-08 18:30:03 -07:00
4ea010f168 Requests: Fix leak in ReleaseTBar, SetTBarPosition 2021-06-09 10:24:09 +09:00
b03ab12e45 Requests: Fix leak in SetSceneTransitionOveride 2021-06-09 09:41:46 +09:00
9311b38747 Merge pull request #760 from bobvandevijver/patch-1
Fix small pipeline typo
2021-06-07 09:30:36 -07:00
2380ba4612 Fix small pipeline typo 2021-06-07 11:39:41 +02:00
60e2f0183e Merge branch '4.x-current' into fix/obs-shutdown-crash 2021-06-06 16:25:38 -07:00
8009f65ed0 Merge pull request #758 from Palakis/fix/ci-patches
CI: Fix some various stuff getting in the way of doing 4.9.1 dev
2021-06-06 17:53:59 +02:00
393fca6aed CI: Update dirty hack to OBS 27 2021-06-01 18:34:52 -07:00
f8abe91b83 CI: Version our OBS build cache
When new OBS tags are released, we need to wipe the old cache
to get them to work properly.
2021-06-01 18:22:34 -07:00
27ab3e0ea8 CI: Allow usage of RC's for objects 2021-06-01 18:12:15 -07:00
1ca10f3e34 CI: Remove github workflows for now
It's super broken on this branch and getting in the way. Removing
it for now and I'll move everything back to gh workflows after 4.9.1
2021-06-01 18:11:13 -07:00
c1cd1adb08 WSServer: Run asio loop in std::thread and join on stop 2021-06-01 18:00:24 -07:00
1266b3f3fe Events: Various crash fixes 2021-06-01 18:00:14 -07:00
5505e0d7b5 docs(ci): Update protocol.md - a469fc5 [skip ci] 2021-06-02 00:20:15 +00:00
a469fc539a Merge pull request #708 from Meetsch/feature/virtualcam
Requests: support for new virtualcam related obs-frontend-api in upcoming OBS-Studio 27.0
2021-06-01 17:19:32 -07:00
ef36585319 Requests, Events: Mark as unreleased 2021-06-01 17:01:20 -07:00
46214eef44 docs(ci): Update protocol.md - 5f0b152 [skip ci] 2021-06-01 00:14:07 +00:00
5f0b152427 Merge pull request #751 from hanazuki/doc-ReorderSceneItems
docs: Fix type of ReorderSceneItems request parameter
2021-05-31 17:13:33 -07:00
cbc7664b78 Merge pull request #740 from Palakis/fix/createscene-release-source
Requests: Release created scene in CreateScene
2021-06-01 01:52:39 +02:00
39bc97a51c Merge pull request #745 from Palakis/add-dart-library
README: Add Dart client library
2021-06-01 01:47:10 +02:00
017e551a91 docs(ci): Update protocol.md - 19dad77 [skip ci] 2021-05-31 23:46:42 +00:00
19dad7775c Merge pull request #746 from BarRaider/docs-fix-readme-link
docs: fixed url to refer to the correct part of the readme
2021-05-31 16:45:56 -07:00
de15118872 docs: Fix type of ReorderSceneItems request parameter
The parameter `items` accepts a list of SceneItem ids/names but not Scenes.
2021-05-21 13:03:10 +00:00
bb81e1e0ab docs: fixed url to refer to the correct part of the readme 2021-05-17 16:17:07 -07:00
58b49fed85 README: Add Dart client library 2021-05-17 14:28:13 -07:00
6740e5fec7 Requests: Autorelease created scene in CreateScene
Creating the scene increments the referenced scene by one,
but we do not decrement it. This produces a memory leak which
leads to the scene never being deleted after being removed from
the UI.
2021-05-14 01:52:37 -07:00
fe9419fb8a Merge branch 'bugfix/cmake-frontend-lib' into 4.x-current 2021-04-18 23:30:03 +02:00
ba93b05efa cmake: fix frontend api message + nitpicks 2021-04-18 23:29:20 +02:00
d154e77299 Merge branch '4.x-current' into bugfix/cmake-frontend-lib 2021-04-18 23:25:44 +02:00
2f8073d548 Merge pull request #702 from Palakis/fix/imageformats
CMake: Copy other imageformats plugins too.
2021-04-18 23:15:33 +02:00
1f0c1691be cmake: simplify package step 2021-04-18 23:00:26 +02:00
50eedd11e0 cmake: fix target directory path of QImage plugins 2021-04-18 22:56:09 +02:00
6f50628172 Merge pull request #727 from ZyanKLee/feature/ZyanKLee-inline-build
allow inline build with obs-studio
2021-04-18 22:47:08 +02:00
4256f2df8b Merge branch '4.x-current' into feature/ZyanKLee-inline-build 2021-04-18 22:20:13 +02:00
344f7c33e4 Merge branch '4.x-current' into fix/imageformats 2021-04-18 21:54:05 +02:00
39454bc13e docs(ci): Update protocol.md - fcffa55 [skip ci] 2021-04-18 19:53:39 +00:00
fcffa55af1 Merge pull request #705 from Palakis/fix/addsceneitem-docs
Docs: Properly mark `setVisible` as optional
2021-04-18 21:53:01 +02:00
b74afd1033 Merge pull request #701 from Palakis/ci-qt-upgrade
CI: Various CI improvements
2021-04-18 21:50:52 +02:00
ff548589bc docs(ci): Update protocol.md - f2f80c4 [skip ci] 2021-04-13 14:04:38 +00:00
f2f80c4e7e Merge pull request #706 from dnaka91/from-scene-optional
docs: Mark from-scene as optional
2021-04-13 07:03:54 -07:00
381745dbf6 CI: Various improvements 2021-04-13 06:58:28 -07:00
1b61bd9551 Remove unnecessary files and changes 2021-04-13 22:24:20 +09:00
415fb73245 CI: Update and improve Ubuntu build 2021-04-13 05:48:50 -07:00
458d59b401 CI: Refactor much of the MacOS CI 2021-04-13 05:04:08 -07:00
ffb24da135 CI: Update MacOS Qt version to 5.15.2 2021-04-13 04:19:41 -07:00
436cec69c2 Merge https://github.com/Palakis/obs-websocket into feature/virtualcam 2021-04-13 02:27:57 -07:00
30e2a5428f CI: Update Qt windows installer download 2021-04-11 20:21:18 -07:00
1154ba5b14 docs(ci): Update protocol.md - ffd89db [skip ci] 2021-04-09 17:59:19 +00:00
ffd89dbdeb Merge pull request #718 from flut1/bugfix/docs-output-settings
Docs: fix typo in output properties
2021-04-09 10:58:21 -07:00
b61211b4cb Docs: fix typo in output properties 2021-04-08 17:42:01 +02:00
30af0cbd9a allow inline build with obs-studio
when replacing CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR in the CMakeLists.txt this should allow for building the plugin directly inside of obs-studio as well as separately
2021-03-29 10:06:08 +02:00
349ef5be97 [fix] getVirtualCamTime 2021-03-22 11:45:00 +01:00
7e0bc1fd10 docs: Mark from-scene as optional 2021-03-21 14:53:45 +09:00
b7bd95dcc4 CI: Use new source for Packages.pkg 2021-03-20 11:50:34 -07:00
fde1ada699 Docs: Properly mark setVisible as optional 2021-03-20 07:44:26 -07:00
7556c5f855 CMake: Copy other imageformats plugins too. 2021-03-19 01:45:52 -07:00
4505612f75 CI: Update Qt and OBS deps on Windows
- Update Qt to 5.15
- Update OBS dependencies to 2019
2021-03-19 01:21:23 -07:00
035767bbbb docs(ci): Update protocol.md - 8e43958 [skip ci] 2021-03-19 05:05:52 +00:00
8e43958f3d Merge pull request #694 from ruggi99/feature/get-source-active
Requests: Add GetSourceActive
2021-03-18 22:05:06 -07:00
2be20a9179 docs(ci): Update protocol.md - 77f6335 [skip ci] 2021-03-19 05:03:26 +00:00
77f63359f6 Merge pull request #697 from ruggi99/feature/add-volumedb
Requests: Add volumeDb field to SourceVolumeChanged Event
2021-03-18 22:03:11 -07:00
b13822db8d Requests: Add SetAudioTracks and GetAudioTracks (#690)
* Requests: Add SetAudioTracks and GetAudioTracks

* Renamed mixer to track.

* Fix: Prevent pushing track out of range

* Fix: Changed result values back to track.

* Fix: Changed source parameter to sourceName.

* Fix: Updated @param.

* Revert "Fix: Updated @param."

This reverts commit 24a5eb6fab.
2021-03-18 22:02:30 -07:00
35c524c604 [fix] obs-frontend-api calls 2021-03-18 18:15:13 +01:00
8c4374825d [fix] Missing events for virtualcam 2021-03-18 17:43:17 +01:00
687d08afa2 [fix] Missing headers for new virtualcam methods 2021-03-18 17:02:40 +01:00
8616d36204 Merge branch 'feature/virtualcam' of https://github.com/Meetsch/obs-websocket into feature/virtualcam 2021-03-18 16:51:46 +01:00
c22199b8eb [feature] support for VirtualCam 2021-03-18 16:51:27 +01:00
1deaedb7da [feature] support for VirtualCam 2021-03-18 16:06:54 +01:00
452a307b33 Requests: Add volumedb field to SourceVolumeChanged Event 2021-03-10 12:01:09 +01:00
0db1abcd2e Requests: Add GetSourceActive 2021-03-05 21:38:22 +01:00
01c898b104 docs(ci): Update protocol.md - 2344842 [skip ci] 2021-03-04 00:19:45 +00:00
2344842163 Requests: Edit PlayPauseMedia (#685)
* Request: Edit PlayPauseMedia

Removed requirement for boolean paramater from PlayPauseMedia. Changed
PlayPauseMedia to toggle play state if there is no boolean paramater.

* Docs: Edit PlayPauseMedia 

This commit also fixes some syntax

* will reset

* Add missing star to L48

Co-authored-by: tt2468 <tt2468@gmail.com>
2021-03-03 16:18:57 -08:00
b8e693c97d docs(ci): Update protocol.md - 99e66cc [skip ci] 2021-03-03 14:50:01 +00:00
99e66cc317 Merge pull request #691 from VodBox/feature/set-scale-filtering
Requests: Add scale.filter to Scene Item Properties
2021-03-03 06:48:59 -08:00
18468c17f2 Requests: Add scale.filter to Scene Item Properties 2021-03-03 20:02:01 +13:00
6f0d056059 docs(ci): Update protocol.md - 6b05d03 [skip ci] 2021-02-28 02:17:20 +00:00
6b05d0381e Merge pull request #687 from Palakis/feature/batch-delay
Requests: Add Sleep
2021-02-28 03:16:37 +01:00
e8c4d2b550 Merge pull request #674 from Palakis/fix/ubuntu-tag-releases
CI: Fix tag detection
2021-02-28 03:06:09 +01:00
7e14032d2b requests(Sleep): update parameter name 2021-02-28 03:05:42 +01:00
bb0a0acbda Requests: Add Sleep
New request to induce delay in the processing of `ExecuteBatch`
2021-02-27 09:35:37 -08:00
9bbfb73622 chore: safety-checks before accessing the result of GetConfig() 2021-02-24 19:06:08 +01:00
d45d98d536 CI: Fix tag detection 2021-02-10 16:34:37 -08:00
9e554ce527 ci(macos): update InstallAppleCertificate action to version 2 2021-02-10 13:32:13 +01:00
6217f009fd docs(ci): Update protocol.md - 4647312 [skip ci] 2021-02-04 21:53:47 +00:00
46473126d2 Merge pull request #668 from Palakis/cleanup-for-v4.9.0
Cleanup for v4.9.0
2021-02-04 22:53:01 +01:00
b6ee6e9e22 docs(ci): Update protocol.md - 1891f62 [skip ci] 2021-02-04 15:53:51 +00:00
1891f62c22 Merge pull request #657 from Palakis/feature/authentication-enabled-by-default
Config: authentication enabled by default
2021-02-04 07:53:07 -08:00
212d1cbfc2 Merge https://github.com/Palakis/obs-websocket into cleanup-for-v4.9.0 2021-02-04 07:51:47 -08:00
73d93e476f docs(ci): Update protocol.md - 80d8286 [skip ci] 2021-02-04 15:51:04 +00:00
80d82861ae Merge pull request #665 from Palakis/feature/batch-requests
Batch Requests
2021-02-04 07:50:22 -08:00
8d034f53a4 Chore: Bump version to 4.9.0 2021-02-04 07:47:36 -08:00
6d3aa3a828 Requests: Add abortOnFail to ExecuteBatch request
We do not currently have atomicy in this request, as it would be
incredibly difficult to add, but this is at least useful for avoiding
further data corruption in the case that there is a malformed request
and multiple requests depend on the success of the previous one.
2021-02-04 07:37:27 -08:00
ed23aba0ac Requests: Improve documentation of ExecuteBatch 2021-02-04 07:15:37 -08:00
3847e5d6af Revert "Remove deprecated requests"
This reverts commit e95d8d36aa.
2021-02-04 05:40:01 -08:00
f4465e2e9b requests(ExecuteBatch): documentation 2021-02-03 05:47:53 +01:00
fe2e87074a requests(ExecuteBatch): handle message-id in sub-requests 2021-02-03 05:33:08 +01:00
5b100d15d7 OBSRemoteProtocol: fix missing message id 2021-02-03 05:31:53 +01:00
87cd36673e OBSRemoteProtocol: fix memory leak 2021-02-03 04:16:04 +01:00
47b84f7316 Merge https://github.com/Palakis/obs-websocket into cleanup-for-v4.9.0 2021-02-02 08:28:41 -08:00
a18da3e6cd WSRequestHandler: Organize requests
Organize requests into their categories aphabetically, and how they appear in their appriate source files.
2021-02-02 08:26:47 -08:00
6bb33fa18b docs(ci): Update protocol.md - 59e6695 [skip ci] 2021-02-02 16:10:24 +00:00
59e6695a5d Merge pull request #666 from Palakis/feature/RefreshBrowserSource
Requests: Add RefreshBrowserSource
2021-02-02 17:09:30 +01:00
861cde7e61 Requests/Events: Use Note: for all notes
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
my ocdddddddddddddddddddddddddddddddddddddd
2021-02-02 07:39:52 -08:00
e95d8d36aa Remove deprecated requests 2021-02-02 07:29:11 -08:00
04304ecf94 Requests/Events: Change all unreleased tags to 4.9.0 2021-02-02 07:23:45 -08:00
3989ea0780 Requests: Add RefreshBrowserSource 2021-02-02 06:16:49 -08:00
e39585befc Password Dialog: Only change form options and not underlying config 2021-02-02 03:04:03 -08:00
20fa14563c Settings Dialog: Don't need ShowSettingsDialog() 2021-02-02 03:03:37 -08:00
10910aa06d requests(general): ExecuteBatch WIP 2021-02-02 11:26:22 +01:00
e6c2c90677 Password Prompt: Improve english strings 2021-02-01 05:33:01 -08:00
98712c7b71 Password Prompt: Enable authRequired toggle and highlight password 2021-02-01 05:16:47 -08:00
2015d40186 docs(introduction): update authentication section 2021-01-31 01:58:22 +01:00
a8aa34529e config: simplify initial password setup 2021-01-31 01:51:19 +01:00
38cf0270b1 settings: add auth disabled warning 2021-01-31 01:26:38 +01:00
c8ca79f00b config: add locale texts for initial password setup 2021-01-31 00:58:56 +01:00
c02382b6e5 config: initial password setup prompt wip 2021-01-29 19:16:53 +01:00
cb7c77d29e docs(ci): Update protocol.md - 83e23c9 [skip ci] 2021-01-28 23:26:40 +00:00
83e23c9c41 Merge pull request #638 from Palakis/feature/getsourcedefaultsettings
Requests: Add GetSourceDefaultSettings
2021-01-29 00:25:35 +01:00
c6db90ae07 request(GetSourceDefaultSettings): add sourceKind return value + fix param spec 2021-01-29 00:08:20 +01:00
c2aa7263bd docs(ci): Update protocol.md - 25be7ee [skip ci] 2021-01-28 22:57:37 +00:00
25be7ee14e Merge pull request #628 from gdhgdhgdh/sceneitems-by-id
Request: add ID support for SetSceneItemRender
2021-01-28 23:56:53 +01:00
332876495d Utils: remove unused struct 2021-01-28 23:04:02 +01:00
6cbe50e3e7 request(SetSceneItemRender): refactor conditional 2021-01-28 22:56:01 +01:00
599eaf85ce requests(SceneItems): remove unused variables 2021-01-28 22:55:40 +01:00
c03ca47e37 Merge branch 'opencollective' into 4.x-current 2021-01-28 22:48:52 +01:00
2246ce5142 Merge branch '4.x-current' into opencollective 2021-01-28 22:48:34 +01:00
79774921e4 Merge pull request #659 from harm27/harm27-obs-java-client
readme: Added obs-java-client to the available API's
2021-01-21 13:30:43 -08:00
ab453a0322 readme: Added obs-java-client to the available API's 2021-01-21 11:06:59 +01:00
3725e400ce Merge branch 'feature/getsourcedefaultsettings' of https://github.com/Palakis/obs-websocket into feature/getsourcedefaultsettings 2021-01-20 04:22:38 -08:00
9859c7b25f Utils: Use obs_data_item_get_name in OBSDataGetDefaults 2021-01-20 04:21:43 -08:00
056c1ef1fc Merge pull request #641 from VMinute/bugfix/fix-list-scenes-collections
General: Add ScenesCollection object
2021-01-20 10:37:31 +01:00
41fbfb159a Merge branch '4.x-current' into feature/getsourcedefaultsettings 2021-01-20 10:26:34 +01:00
740a8a8d06 General: Add ScenesCollection object
Adds a ScenesCollection object in the protocol definition,
replacing the current Array<String> return  with
Array<ScenesCollection>, keeping it more coherent with
other requests that return objects in the same format.
This will help automated code generation from comment.json
that otherwise would require ad-hoc handling for that specific
request.

Signed-off-by: Valter Minute <valter.minute@gmail.com>
2021-01-20 10:22:33 +01:00
59ab9548c2 docs(ci): Update protocol.md - a1cf7f8 [skip ci] 2021-01-20 09:22:17 +00:00
a1cf7f8d32 Merge pull request #658 from Palakis/fix/tab-formatting
Misc: Fix indentation of src files
2021-01-20 10:21:24 +01:00
0d59983d1a Misc: Fix indentation of src files
Replace 4-space code with tabs to conform with the way its supposed to be.
2021-01-19 18:30:18 -08:00
488a57e2de Requests: Fix GetSourceDefaultSettings indentation and docs 2021-01-19 18:23:54 -08:00
dd9ad67e6b Config: authentication enabled by default 2021-01-20 00:44:34 +01:00
492e9d8df7 editorconfig: set indent_size for C/C++ files 2021-01-20 00:28:50 +01:00
bc3b09dce4 WSServer(stop): wait for all connections to close 2021-01-20 00:08:24 +01:00
5fd95ce374 Merge pull request #649 from dnaka91/homebrew-instructions
readme: Add Homebrew installation instructions
2021-01-19 19:08:50 +01:00
77380a098e docs(ci): Update protocol.md - afc9c54 [skip ci] 2021-01-19 18:07:43 +00:00
afc9c549d6 Merge pull request #643 from Palakis/fix/createscene-sinceversion
Requests: Fix wrong docs version for CreateScene
2021-01-19 19:06:40 +01:00
77f38bbf63 docs(ci): Update protocol.md - 853eeb2 [skip ci] 2021-01-18 10:52:53 +00:00
853eeb2e6b Merge pull request #636 from Palakis/enhancement/latest-translations
Translations: Update translations with latest from crowdin
2021-01-18 11:51:50 +01:00
6ed6b4a679 Merge pull request #637 from Palakis/fix/getstreamingstatus-docs
Docs: Add recording-paused to documentation
2021-01-18 11:51:17 +01:00
99987f9373 Merge pull request #644 from eric/stop-ws-server-on-exit
Stop WSServer on OBS exit
2021-01-18 11:49:00 +01:00
b02239f3e3 Merge pull request #650 from dnaka91/rust-api
readme: Add Rust client library
2021-01-08 04:59:14 -08:00
bc436e9ec4 Reorder library list 2021-01-08 04:58:07 -08:00
7e0874abb4 Translations: Remove dutch StartFailed message and update other translations
For some reason crowdin included it even though it is not approved.
The current unapproved translation uses the old string.
2021-01-08 04:57:03 -08:00
3d704702ba readme: Add Rust client library
I created a client library in Rust to remote control OBS with
obs-websocket. Adding my library to the list of available
language APIs.
2021-01-07 21:58:29 +09:00
2735f80637 readme: Add Homebrew installation instructions
Give a short hint that the project can be installed with Homebrew on
MacOS as alternative to installing manually.
2021-01-07 21:49:41 +09:00
9275f7c2a9 Server: Stop WSServer on OBS exit
This should fix issues with race conditions and crashes on OBS exit.
2020-12-29 11:41:47 -08:00
229641aba0 Requests: Fix wrong docs version for CreateScene 2020-12-24 13:38:58 -08:00
ba143f2636 Translations: Update translations with latest from crowdin 2020-12-24 13:28:01 -08:00
ffb34c3fd4 Requests: Add GetSourceDefaultSettings
Adds a request, mainly for development purposes, which returns an
object of default settings for a given sourceKind (eg. `vlc_source`)
2020-12-21 00:06:50 -08:00
31c717eb40 Docs: Add recording-paused to documentation [skip ci]
It wasn't included for some reason.
2020-12-20 00:29:24 -08:00
7ae016bd3b Merge pull request #627 from Palakis/bugfix/deb-file-permissions
ci(linux): fix deb package file permissions
2020-12-20 00:02:44 -08:00
501e0f63f5 ci(linux): fix deb package file permissions 2020-12-19 22:54:46 -08:00
a42398c457 Merge pull request #635 from Palakis/enhancement/codefactor-badge
README: Add codefactor badge
2020-12-20 07:20:59 +01:00
d77e4ab10d docs(ci): Update protocol.md - 8a8ea92 [skip ci] 2020-12-20 06:20:47 +00:00
8a8ea92140 Merge pull request #629 from marcan/volumes
Requests: SetVolume: allow volumes > 1.0
2020-12-19 22:20:12 -08:00
adc46a80f9 Requests: SetVolume: allow volumes > 1.0
Allow volumes > 1.0 / > 0dB, which is legal in OBS (you can do this in
Advanced Audio Properties). OBS allows up to +26dB gain, so we do the
same. This corresponds to approximately 20x linear gain (actually
19.9526231497, but 20 is easier to explain and OBS doesn't care).
2020-12-19 22:16:47 -08:00
3203f50a43 Merge pull request #609 from Palakis/remove-captions-flag
CI: Remove BUILD_CAPTIONS flag
2020-12-20 06:55:19 +01:00
3dea5fd4f4 README: Add codefactor badge
They give us an A and I think that's pretty cool so might as well display it
2020-12-19 21:51:25 -08:00
1024a2198a Merge pull request #631 from leafac/patch-1
Add link to obs-cli
2020-12-16 14:11:02 -08:00
c8f0d5a3e4 Add link to obs-cli 2020-12-16 21:57:23 +00:00
3e55b3d7bc Request: add ID support for SetSceneItemRender 2020-12-08 17:23:53 +00:00
a93c4dfbbd docs(ci): Update protocol.md - aceb437 [skip ci] 2020-11-29 11:40:39 +00:00
aceb437c5f Merge pull request #621 from Palakis/feature/current-recording-filename
Feature/current recording filename
2020-11-29 12:39:49 +01:00
a137ccd8ba requests(GetRecordingStatus): add recordingFilename property 2020-11-29 12:24:49 +01:00
96bd4141fd events: add recordingFilename property to RecordingStarted, RecordingStopping and RecordingStopped 2020-11-29 12:22:26 +01:00
e794762f72 docs(ci): Update protocol.md - 9999b30 [skip ci] 2020-11-28 04:50:08 +00:00
9999b30d1a docs(scene items): fix documentation for GetSceneItemProperties
Fixes #607
2020-11-28 05:49:09 +01:00
569e9681e5 docs(ci): Update protocol.md - 9edc3ea [skip ci] 2020-11-27 23:39:48 +00:00
9edc3eafa3 Merge pull request #589 from Palakis/feature/createsource
Requests: Add CreateSource and clean up code
2020-11-28 00:39:09 +01:00
a1fcc35fd6 requests(CreateSource): pass settings on source creation 2020-11-28 00:19:27 +01:00
80d21ce80d WSRequestHandler: fix indent 2020-11-27 23:53:39 +01:00
08178b9354 requests(CreateSource): use the OBSSourceAutoRelease container instead of manipulating refs manually 2020-11-27 19:40:02 +01:00
60ce25c689 requests(CreateSource): fix docs 2020-11-27 19:38:55 +01:00
eaf34f3c3a requests(CreateSource): simplified settings apply
obs_source_update already does that internally
2020-11-27 19:38:01 +01:00
ef0e907014 docs(ci): Update protocol.md - 9fb0f56 [skip ci] 2020-11-27 16:24:32 +00:00
9fb0f56aa0 Merge pull request #619 from Palakis/feature/events-add-target-new-state
Events: provide new state of entity (in events that don't do it already)
2020-11-27 17:23:51 +01:00
ae9ea8510c events: fix docs 2020-11-27 17:10:27 +01:00
14409dec4f events(TransitionListChanged): provide transitions list property 2020-11-27 17:09:07 +01:00
0cdea68567 events(ScenesChanged): provide scenes list property 2020-11-27 17:07:28 +01:00
542761e411 events(ProfileListChanged): add profile list property 2020-11-27 17:00:10 +01:00
0dc8e070ff events(SceneCollectionListChanged): add scene collections list property 2020-11-27 17:00:05 +01:00
fe52cd8db1 events(ProfileChanged): add new profile name 2020-11-27 16:59:57 +01:00
d87a7e896b events(SceneCollectionChanged): add new scene collection name 2020-11-27 16:59:52 +01:00
f7616ade1f docs(ci): Update protocol.md - f14379a [skip ci] 2020-11-27 15:41:27 +00:00
f14379af68 Merge pull request #439 from Palakis/feature/t-bar
T-Bar control
2020-11-27 16:39:56 +01:00
a53df39e46 requests(transitions): yet another doc fix 2020-11-27 16:15:03 +01:00
98187e2bd7 requests(transitions): documentation fixes cont. 2020-11-27 16:10:38 +01:00
3ab7de99f3 requests(transitions): documentation fixes 2020-11-27 16:03:21 +01:00
1fef0691ed Merge pull request #618 from Palakis/bugfix/output-commands-crash
requests(outputs): fix corrupted parameters object on MSVC when using findOutputOrFail
2020-11-27 15:49:43 +01:00
6b03efed42 requests(outputs): fix corrupted parameters object on MSVC when using findOutputOrFail 2020-11-27 15:33:40 +01:00
eddd4abe76 ci(linux): update frontend api headers to v26 2020-11-27 12:45:57 +01:00
e30dce8b21 Merge branch '4.x-current' into feature/createsource 2020-11-27 12:24:13 +01:00
6d12af3858 Merge branch '4.x-current' into feature/t-bar 2020-11-27 12:23:47 +01:00
b9cbd0ecd1 docs(ci): Update protocol.md - 3d7511c [skip ci] 2020-11-27 11:19:36 +00:00
3d7511ca75 Merge pull request #605 from Palakis/feature/get-set-transition-settings
Get/Set Transition Settings
2020-11-27 12:18:50 +01:00
fabf68b635 CI: Remove BUILD_CAPTIONS flag
OBS has removed the `BUILD_CAPTIONS` flag from their repo. No reason to keep it
2020-11-02 23:20:40 -08:00
11326274e0 docs(ci): Update protocol.md - acd3940 [skip ci] 2020-10-25 18:34:53 +00:00
acd3940a7b Merge pull request #593 from Palakis/feature/getsceneitemlist-default-scene
requests(GetSceneItemList): fallback to current scene if sceneName is not specified
2020-10-25 19:34:11 +01:00
8ba441da7f requests(transitions): remove TODO 2020-10-25 19:33:42 +01:00
5d9d5e0746 request(SetSourceSettings): remove redundant obs_data_apply step 2020-10-25 19:25:48 +01:00
7a31e88ed6 requests: add GetTransitionSettings and SetTransitionSettings 2020-10-25 19:25:26 +01:00
d9f35a855d docs(ci): Update protocol.md - 9678d59 [skip ci] 2020-10-01 07:56:26 +00:00
9678d59bbe Merge pull request #598 from Palakis/fix/hotkey-docs-typo
Docs: Fix typo
2020-10-01 09:55:34 +02:00
0be5564ce7 Docs: Fix typo 2020-09-30 15:57:13 -07:00
8a90051ab5 docs(ci): Update protocol.md - 02c7a7f [skip ci] 2020-09-30 22:22:57 +00:00
02c7a7f7c7 Merge pull request #595 from LorenaGdL/feature/hotkey-requests
Requests: Add hotkeys press events
2020-09-30 15:22:22 -07:00
e7c8c1d6b6 Requests: Update hotkey docs and rename some variables 2020-09-30 15:02:59 -07:00
449ad6d13c PR review changes: Modify requests names
Changes requests names to "TriggerHotkeyByName" and "TriggerHotkeyBySequence"
2020-09-30 19:15:23 +00:00
ae4ee0332c Fix macOS CI (#597)
* ci(macos): fix attempt #1

* Revert "ci(macos): fix attempt #1"

This reverts commit b846490136.

* ci(macos): provide QTDIR when building OBS

* Revert "ci(macos): provide QTDIR when building OBS"

This reverts commit 74a882fcf4.

* ci(macos): use local qt formula

* ci(macos): update qt.rb
2020-09-30 12:19:37 +02:00
4a4c97aac4 request(GetSceneItemList): provide scene name in response 2020-09-29 23:48:35 +02:00
4491da0350 requests(GetSceneItemList): fix empty/non-present parameter detection 2020-09-29 23:48:17 +02:00
32960afc1b requests(GetSceneItemList): update docs 2020-09-29 19:45:07 +02:00
46f624e3b9 requests(GetSceneItemList): fallback to current scene if sceneName is not specified 2020-09-29 19:37:28 +02:00
9daae857de Requests: Add ProcessHotkeyByCombination
Adds a new request called `ProcessHotkeyByCombination` which calls the
routine associated with a given hotkey. The hotkey is identified by the
combination of keys set by the user to trigger it. Multiple routines
are called if the same combination is bound to different hotkeys.
2020-09-29 13:43:00 +00:00
bac5b1551b Requests: Add ProcessHotkeyByName
Adds a new request called `ProcessHotkeyByName` which calls the routine
associated with a given hotkey. The hotkey is identified by the unique
name set while registering it. Works with both OBS default hotkeys and
hotkeys added by plugins/scripts.
2020-09-29 13:38:32 +00:00
f61f45fa23 Merge pull request #592 from rodrigograca31/improve-docs
docs: 📝 list multiple available web clients
2020-09-24 12:54:52 -07:00
fbc6e02ff6 docs: 📝 list multiple available web clients 2020-09-24 13:16:57 +01:00
56a17a9131 Merge pull request #560 from Palakis/enhancement/various-todos
Requests: Scene collection and profile name checking
2020-09-16 21:51:08 +02:00
a148f7fd7c requests(Profiles + SceneCollections): fix crash on change 2020-09-16 21:45:31 +02:00
0dd0d01e8f requests(Profiles + SceneCollections): don't use QString where it is not needed 2020-09-15 18:17:45 +02:00
bcd16d791c Merge pull request #559 from Palakis/enhancement/ipv4-option
Settings: Add option to lock binding to IPv4
2020-09-15 17:19:27 +02:00
539e636939 requests(SceneCollections): fix typo (profiles instead of scene collections) 2020-09-15 17:14:53 +02:00
7f1c4a1c4c Utils: simplified string list lookup 2020-09-15 17:12:34 +02:00
6b254e0ad5 Requests: Add CreateSource and clean up code 2020-09-15 02:51:03 -07:00
f36185a964 Merge pull request #583 from Palakis/fix/no
Installer: Don't show warning when obs directory is not empty
2020-09-15 11:36:54 +02:00
588487f860 docs(ci): Update protocol.md - f3ab210 [skip ci] 2020-09-15 09:36:27 +00:00
f3ab2100f0 Merge pull request #578 from Palakis/fix/request-versions
Docs: Fix requests marked as "unreleased"
2020-09-15 11:35:46 +02:00
f96b40bbf8 Merge pull request #573 from Palakis/fix/sfr-enabled
Docs: Add `enabled` field to `SourceFiltersReordered`
2020-09-15 11:35:23 +02:00
9679de097f Installer: Don't show warning when obs directory is not empty
More info here: https://jrsoftware.org/ishelp/index.php?topic=setup_direxistswarning
2020-08-21 22:43:42 -07:00
a51ad1383b Docs: Fix requests marked as "unreleased" 2020-08-12 16:54:03 -07:00
1dd96fa714 Docs: Add enabled field to SourceFiltersReordered
Was noticed in Discord that this was missing from the docs
2020-07-31 22:08:07 -07:00
8285805108 Merge pull request #571 from Palakis/bugfix/569-tray-icon-crash
Utils(GetTrayIcon): refactor with frontend API function
2020-07-29 17:06:01 +02:00
d91b3f8dd9 Utils(GetTrayIcon): refactor with frontend API function 2020-07-28 02:23:31 +02:00
6734c928a2 Merge pull request #563 from venepe/raspberry-pi
CMakeLists: Compile for arm targets
2020-07-19 12:22:15 +02:00
58448f363b CMakeLists: Compile for arm targets 2020-07-18 13:48:52 -05:00
2e32b7e299 Merge branch '4.x-current' into enhancement/various-todos 2020-07-15 15:02:00 +02:00
a651a1a69f docs(ci): Update protocol.md - c368696 [skip ci] 2020-07-15 13:01:23 +00:00
c368696ddc docs(ci): Update protocol.md - 94269c0 [skip ci] 2020-07-15 13:00:59 +00:00
94269c0640 Merge pull request #557 from julijane/feature-screenshot-default
TakeSourceScreenshot: default to current scene
2020-07-15 15:00:43 +02:00
5da6588ee6 Merge pull request #555 from Palakis/fix/docs-updates
Docs: Various docs improvements
2020-07-15 14:59:52 +02:00
ac9c6b4a1f Docs: Fix GDIPlus requests documentation
`bk-color` and `bk-opacity` are actually `bk_color` and `bk_opacity`
respectively. Issue reported in #561
2020-07-12 02:22:26 -07:00
aa8fa00811 Docs: More updates
Changes the media stuff's `@since 4.9.0` to `@since unreleased`
to reduce potential confusion on the docs. As a part of the final
4.9.0 commits, I will be changing it back to 4.9.0. We also fix the
contributing document since it was all messed up.
2020-07-11 05:26:49 -07:00
9c4bd7a487 Requests: Scene collection and profile name checking
For `SetCurrentProfile` and `SetCurrentSceneCollection`, check if it
exists before attempting to switch to it, and return an error if it
does not exist.
2020-07-11 05:00:10 -07:00
eb00294bbb Settings: Add option to lock binding to IPv4
WebsocketPP defaults to binding to an IPv6 interface. Since IPv6
is broken on so many networks, this adds an option to force WebsocketPP
to use the default IPv4 interface to bind to.
2020-07-09 22:21:48 -07:00
04c60fd1ac docs(ci): Update protocol.md - 80de8ad [skip ci] 2020-07-09 10:40:21 +00:00
80de8ada57 ci: fix Azure Pipelines not running on 4.x-current 2020-07-09 12:39:40 +02:00
9cdb32d56a Docs: Various docs improvements
I noticed that some parts of the docs were inconsistent/lacking.
Decided to go through all of them and update them.
2020-07-09 03:27:44 -07:00
31a505f4a4 Do it when sourceName is omitted 2020-07-09 00:50:29 +02:00
bfa6cd0e19 TakeSourceScreenshot: default to current scene 2020-07-09 00:43:54 +02:00
c51ecda6b4 Merge pull request #527 from Palakis/feature/component-management
Requests: Sceneitem manipulation requests
2020-07-03 18:21:01 +02:00
471d44ae11 Merge pull request #551 from Palakis/fix/mediafixes
Requests/Events: Use sourceKind instead of sourceTypeId
2020-07-03 16:22:20 +02:00
513bd1372b Docs, Requests: Fix GetSceneItemList code revisions
Replace the `sourceId` term with `sourceKind` to match everything else.
2020-07-03 07:12:28 -07:00
355cee0db9 Merge branch '4.x-current' into feature/component-management 2020-07-03 07:07:52 -07:00
38936173d1 Requests/Events: Use sourceKind instead of sourceTypeId
Left in some old terms accidentally. This fixes it.
2020-07-03 07:03:25 -07:00
eea56b4c71 Merge pull request #497 from Palakis/category-mediacontrol
Requests/Events: Media Source/VLC
2020-07-03 15:56:21 +02:00
802cc3a48f Apply suggestions from code review 2020-07-03 15:48:56 +02:00
ba4720012d Merge pull request #550 from Palakis/enhancement/readme-fix
Docs: Move ssl tunnelling guide to its own page
2020-07-03 15:30:34 +02:00
4f83b73732 Docs: Move ssl tunnelling guide to its own page [skip ci]
Having the SSL tunneling instructions on the README caused clutter and was
unnecessary.
2020-07-03 06:23:48 -07:00
68db13fc24 Merge pull request #549 from Palakis/feature/more-output-statuses
Requests: Add Replay Buffer and Recording Statuses
2020-07-03 14:29:25 +02:00
2d4dd580b4 Merge pull request #547 from WizardCM/audio-active
Requests, Events: Add support for Audio Active
2020-07-03 03:42:36 -07:00
d03e94ada8 events: Add support for audio_active, fix docs version 2020-07-03 03:30:58 -07:00
91126a59c2 Merge pull request #505 from Palakis/docs-updates
Docs: Update and split up main documentation
2020-07-03 11:47:54 +02:00
bd18aee43c Docs: Update issue template to be **better** 2020-07-03 02:42:29 -07:00
4ead1c3de5 Requests: Add Replay Buffer and Recording Statuses
Adds `GetReplayBufferStatus` and `GetRecordingStatus`.

v5.0 Will remove the recording status functionality from
`GetStreamingStatus`
2020-07-03 02:26:38 -07:00
f3b2a6eba2 Merge pull request #471 from PatTheMav/github-actions-tag
CI: Add Github Actions workflow for release tags
2020-07-03 10:22:39 +02:00
c4d9a27d2f Merge pull request #470 from PatTheMav/github-actions-pr
CI: Add Github Actions workflow for PRs and pushes to main branch
2020-07-03 10:22:09 +02:00
fdcba2734d Events, Docs: Refactor media events and improve docs
Move duplicated functionality to a helper function and added some docs
clarifying the behavior of the events, and fixed a few typos in
the request handlers.
2020-07-02 13:13:19 -07:00
981ba7b28f Merge pull request #529 from Palakis/fix/getvolumedecibel
Requests: Fix useDecibel response when volume is -infinity
2020-07-02 21:08:45 +02:00
822a1751a2 requests: Add support for audio_active 2020-07-01 22:23:22 +10:00
a4279d09a6 Merge pull request #546 from curtgrimes/bugfix/reenable-macos-captions
[Bug Fix] Reenable building with captions on MacOS
2020-07-01 04:24:40 -07:00
14d43ac05b [Bug Fix] Reenable building with captions on MacOS
OBS on MacOS supports closed caption encoding. The Windows-only dependencies [here](https://github.com/obsproject/obs-studio/blob/master/UI/frontend-plugins/frontend-tools/CMakeLists.txt#L73) are only related to audio capture, not closed caption encoding.
2020-06-29 20:24:11 -05:00
5e6c92ab16 Merge branch '4.x-current' into category-mediacontrol 2020-06-08 01:04:16 -07:00
9ced745258 Merge pull request #533 from Twasi/bugfix/Correct-position-data-type
Bugfix/correct position data type
2020-06-04 14:30:58 -07:00
948f6ccd95 Also change all other occurrences and documentation where int was used for transform position 2020-06-04 15:42:27 +02:00
1c58727ca9 Change position datatype from int to double (as it is in OBS) 2020-06-04 15:28:47 +02:00
612bd9960c readme: add TLS tunneling section 2020-06-04 10:14:58 +02:00
1474499886 Requests: Add GetSceneItemList
Adds a new `GetSceneItemList` request to get all scene items in a
specified scene.
2020-05-29 00:00:16 -07:00
cf99c68843 Requests: Fix useDecibel response when volume is -infinity
When the volume in OBS is -infinity, `GetVolume` returns a decibel value of
either 0, or in some cases no `volume` property at all. This makes `GetVolume`
return a decibel value of -100.0 if the real volume is -infinity.
2020-05-28 22:45:08 -07:00
d2865b9f4f Requests: Add AddSceneItem
New request `AddSceneItem` which allows you to add a
source to a scene. Returns an itemId which can be used
to manipulate the item further if necessary.
2020-05-28 22:20:25 -07:00
865c0c79db Docs: Rework some more of the readme 2020-05-28 16:45:05 -07:00
3462e7f50e Docs: Add new logo and update header 2020-05-28 16:35:21 -07:00
37e412e710 Docs: Add discord shield to readme 2020-05-28 16:16:31 -07:00
5822992b44 Merge pull request #524 from ProstoSanja/create-scene
Add request `CreateScene` to `scenes`
category
2020-05-27 21:21:14 -07:00
eb7787fb7d Docs: Fix param name 2020-05-27 11:18:39 +03:00
f1371034f7 Request: Add CreateScene 2020-05-27 01:03:01 +03:00
5d12dfa368 docs(ci): Update protocol.md - c428201 [skip ci] 2020-05-26 21:49:10 +00:00
c4282011fa Merge pull request #516 from Palakis/feature/SetSceneTransitionOverride
Requests: Add scene transition override requests
2020-05-26 23:48:33 +02:00
9ddc22fa94 request(SetSceneTransitionOverride): override duration only if it is explicity set so or not already defined 2020-05-26 23:36:18 +02:00
517788e86a request(scenes): refactor Set/Get/RemoveSceneTransitionOverride + use current transition duration 2020-05-26 23:26:37 +02:00
ed29ec528d docs(ci): Update protocol.md - 481b26d [skip ci] 2020-05-26 11:58:51 +00:00
481b26d09d Merge pull request #508 from Palakis/feature/setsourcename
Requests: Add SetSourceName (renaming sources)
2020-05-26 13:58:10 +02:00
da66ad6d41 Merge branch '4.x-current' into feature/setsourcename 2020-05-26 01:41:11 -07:00
1f75b305c3 docs(ci): Update protocol.md - 0802d03 [skip ci] 2020-05-26 07:42:47 +00:00
0802d03d74 Merge pull request #509 from Palakis/enhancement/sourcerenamed-isscene
Events: Add sourceType string to SourceRenamed
2020-05-26 09:42:03 +02:00
3970674003 Merge pull request #510 from Palakis/fix/fixwarnings
General: Fix a few warnings
2020-05-22 09:11:27 +02:00
b00a93dd6b Requests: Add GetMediaSourcesList and minor refactor
Adds `GetMediaSourcesList` which returns a list of all media sources,
along with their individual media playback states. In the process I
refactored a switch which coverts the enum to a QString into its own
helper function.
2020-05-19 20:20:35 -07:00
19b33a8558 Requests: Add scene transition override requests
Adds these requests:
- `SetSceneTransitionOverride`
- `RemoveSceneTransitionOverride`
- `GetSceneTransitionOverride`
2020-05-18 14:44:25 -07:00
7918438747 Events: Add media events
Adds the following events:

- `MediaPlaying`
- `MediaPaused`
- `MediaRestarted`
- `MediaStopped`
- `MediaNext`
- `MediaPrevious`
- `MediaStarted`
- `MediaEnded`
2020-05-16 12:56:42 -07:00
31a085db73 Docs: Update @since items 2020-05-16 12:11:26 -07:00
72997eaa85 Merge branch '4.x-current' into category-mediacontrol 2020-05-16 12:08:28 -07:00
7bb91da1d0 Events: Add sourceType string to SourceRenamed
Since sources in OBS are also scenes, provide the user a string
so that they can differentiate.
2020-05-15 16:54:30 -07:00
e3e62c3903 General: Fix a few warnings
Fix a few build warnings on windows because im ocd
2020-05-15 16:52:08 -07:00
631ed022ed Requests: Add SetSourceName (renaming sources)
Adds the `SetSourceName` request which can be used to rename sources.

Also works on scenes since scenes in OBS are also sources.
2020-05-15 16:13:24 -07:00
590943ed95 docs(ci): Update protocol.md - e9c17c9 [skip ci] 2020-05-15 02:20:46 +00:00
e9c17c9a1d Merge pull request #496 from Palakis/request-setsourcemonitortype
Requests: Add audio monitoring requests
2020-05-15 04:20:07 +02:00
f8c8e42ae9 requests: rename Get/SetAudioMonitor to Get/SetAudioMonitorType 2020-05-15 04:10:40 +02:00
0b0560019a requests(Get/SetAudioMonitor): change values to camelCase for consistency 2020-05-15 04:08:40 +02:00
133d3fdda7 docs(ci): Update protocol.md - 53e98db [skip ci] 2020-05-15 00:48:51 +00:00
53e98dbe15 Merge pull request #484 from Palakis/add-screenshot-params
Requests: Add new parameters to TakeSourceScreenshot
2020-05-15 02:48:08 +02:00
0eaa9187ea requests(TakeSourceScreenshot): improved docs 2020-05-15 02:35:53 +02:00
344f5bda69 docs(ci): Update protocol.md - 33b080b [skip ci] 2020-05-14 20:48:16 +00:00
33b080b3b8 Merge pull request #495 from Palakis/volume-decibel-support
Requests: Add useDecibel bool to GetVolume and SetVolume
2020-05-14 22:47:33 +02:00
1c85894472 request(SetVolume): simplified params check 2020-05-14 22:31:10 +02:00
ba4e5959b1 requests(Get/SetVolume): code nitpicks 2020-05-14 22:24:58 +02:00
5534f9a248 docs(ci): Update protocol.md - eb20654 [skip ci] 2020-05-14 20:15:44 +00:00
eb206549ff Merge pull request #503 from Palakis/feature/get-tr-pos
Requests: Add GetTransitionPosition
2020-05-14 22:14:59 +02:00
0852f32b05 Merge branch '4.x-current' into request-setsourcemonitortype 2020-05-14 05:13:29 -07:00
a1ea84b286 Docs: Its finally complaining less 2020-05-14 04:46:12 -07:00
baba8790bc testing 2020-05-14 04:28:57 -07:00
1da7f47af9 Docs: Add pr template 2020-05-14 03:43:18 -07:00
60d9b72fea Docs: Maybe it will complain less now 2020-05-14 03:25:34 -07:00
7a7a8b7ed1 Docs: Even more changes 2020-05-14 03:19:14 -07:00
100565081c Docs: More changes 2020-05-14 03:11:17 -07:00
27f82434b6 Docs: More work on various things 2020-05-14 03:01:28 -07:00
353a9aa671 Update docs - initial pr draft commit 2020-05-14 02:13:50 -07:00
00da210365 Merge pull request #504 from Palakis/bugfix/windows-ci-prepare-obs
ci(windows): simplified OBS Preparation script + shorter build times
2020-05-14 11:11:08 +02:00
bce6c86e60 Merge pull request #481 from Palakis/tt2468-ubuntu-fix
Fix install dir on Ubuntu by using new cmake flag
2020-05-14 11:04:36 +02:00
bed6a1b1e2 ci(windows): simplified OBS Preparation script + shorter build times 2020-05-14 11:02:51 +02:00
497443f012 Update CI scripts to use ubuntu fix 2020-05-14 01:47:55 -07:00
75a06afab0 Merge pull request #493 from Palakis/studio-mode-errors
Add error system to EnableStudioMode and DisableStudioMode
2020-05-14 10:34:05 +02:00
121d9f4920 Remove GetTransitionPosition
Moving it to its own PR since this PR will not make it into 4.8
2020-05-14 01:14:46 -07:00
56371a7d80 Add GetTransitionPosition
Gets the current position of the active transition. Works on manual and also auto transition modes
2020-05-14 01:11:47 -07:00
2810787156 docs(ci): Update protocol.md - 6b53cb5 [skip ci] 2020-05-14 08:04:35 +00:00
6b53cb59a5 Merge pull request #501 from Palakis/tt2468-bump-docs
[Docs] Bump version to 4.8
2020-05-14 10:03:51 +02:00
64062cc879 Merge branch '4.x-current' into feature/t-bar 2020-05-13 20:51:23 -07:00
7ca902e39a A few formatting fixes 2020-05-13 20:48:54 -07:00
10ed2738f5 Add ReleaseTBar request and update SetTBarPosition to depend on OBS pr 2927 2020-05-13 00:10:57 -07:00
71392613b2 [Docs] Bump version to 4.8 2020-05-12 17:46:49 -07:00
4eb7bed2ff Lots of changes
- Move `SetTBarPosition` to transitions category
- Add another check to `SetTBarPosition` so that we dont break the fabric of time with the wrong values
- Create `GetTransitionPosition` request in transitions category
2020-05-12 15:44:57 -07:00
ff21f5b357 docs(ci): Update protocol.md - 98db248 [skip ci] 2020-05-12 09:37:41 +00:00
98db248776 Merge pull request #491 from Palakis/depricate-browserrequests
Deprecate SetBrowserSourceProperties and GetBrowserSourceProperties
2020-05-12 11:37:00 +02:00
ed4872b94c Merge pull request #483 from tt2468/add-http-request-script
Add obs-websocket-http
2020-05-12 11:33:04 +02:00
8c5c6958cf Merge pull request #476 from tt2468/patch-2
[Bug Fix] Fix FreeType2 source type recognition
2020-05-12 11:30:20 +02:00
f9c81f99f2 Install into both dirs on Ubuntu instead of only one 2020-05-12 02:24:27 -07:00
acfdb26135 A lot more requests. 2020-05-10 23:21:24 -07:00
37cf8e9d29 Rename MediaPlayPause to PlayPauseMedia
Works better with the other upcoming media control request names
2020-05-10 21:13:48 -07:00
1c6670c9b0 Create new category and add MediaPlayPause request 2020-05-10 21:03:38 -07:00
88c72cd80a Add audio monitoring request items. 2020-05-10 20:07:57 -07:00
728ea16701 Introduce useDecibel bool to GetVolume and SetVolume to give a better, built-in option for people to use decibels of attenuation instead of amplitude. 2020-05-10 18:39:24 -07:00
a3bc9f768a Add error system to EnableStudioMode and DisableStudioMode
As talked about in #144 this adds a check to `EnableStudioMode` and `DisableStudioMode` in order to be consistent with `StartRecording`/`StopRecording`
2020-05-08 15:30:40 -07:00
8d88bc19ed Deprecate SetBrowserSourceProperties and GetBrowserSourceProperties
Both of these requests are doing essentially the same thing as `GetSourceSettings` and `SetSourceSettings`, so there is no reason to have the extra bloat.
2020-05-08 13:15:24 -07:00
333ffa0e89 compressionQuality should be for embed and file saving 2020-04-30 20:17:11 -07:00
4ded810ba9 Add optional fileFormat and fileCompressionRatio parameters to TakeSourceScreenshot 2020-04-30 20:09:13 -07:00
b2aa54f3f8 Add obs-websocket-http
obs-websocket-http is a simple python script which allows users to run obs-websocket requests using an http-based api system. It is very simple and is a useful converter.
2020-04-30 16:25:31 -07:00
97836cc5eb Remove extra source type strings 2020-04-30 10:58:10 -07:00
b1df0dca97 Merge pull request #474 from tt2468/patch-1
Suppress websocketpp logging entries
2020-04-30 19:40:22 +02:00
4a6816575a Merge pull request #482 from Palakis/tt2468-start-error
Add websocketpp error message to error dialog box
2020-04-30 19:39:50 +02:00
31e2937b8d Merge pull request #477 from tt2468/patch-3
[Bug Fix] Don't build with captions on MacOS
2020-04-30 19:38:56 +02:00
0f434004a8 Add websocketpp error message to error dialog box 2020-04-30 10:08:56 -07:00
ba75c45cee Update build docs to add Ubuntu fix flag 2020-04-30 09:58:10 -07:00
47492c3fa2 Implement fix for Ubuntu users
#478 Broke building on linux. This implements a new variable to apply the fix.
2020-04-30 09:46:22 -07:00
819917c4bf Merge pull request #478 from Palakis/bugfix/ubuntu-packaging-fixes
Ubuntu packaging fixes
2020-04-28 11:40:20 +02:00
1ce0fd643c Revert "ci(linux): set package summary"
This reverts commit a7d02a79a9.
2020-04-28 11:18:22 +02:00
a7d02a79a9 ci(linux): set package summary 2020-04-28 10:29:48 +02:00
645cbf9888 ci(linux): fix debian package requires 2020-04-28 10:18:54 +02:00
b2d39ab2d7 cmake(linux): include GNUInstallDirs 2020-04-28 09:52:11 +02:00
5843521cf1 cmake(linux): use the standard LIBDIR and DATAROOTDIR install locations 2020-04-28 09:46:45 +02:00
4fbc45b40b ci(linux): make the deb package require OBS 25.0.7 2020-04-28 09:34:41 +02:00
2719da3685 [Bug Fix] Don't build with captions on MacOS
According to [this](https://github.com/obsproject/obs-studio/blob/master/UI/frontend-plugins/frontend-tools/CMakeLists.txt#L73), captions support is not active on MacOS, so we should not build it here.
2020-04-27 10:55:16 -07:00
f61bc809dd [Bug Fix] Fix FreeType2 source type recognition
OBS appears to be using a new format for the FreeType2 source, so we add the new kinds.

One thing I'm unsure on is if anything still uses the old naming stuff `text_ft2`/`text_ft2_v2`, since if not then we should not check
2020-04-27 08:30:39 -07:00
19f9593ac1 Supress websocketpp logging entries 2020-04-21 19:55:43 -07:00
a479f529af CI: Add Github Actions workflow for release tags 2020-04-21 17:42:07 +02:00
76635ff31b CI: Add Github Actions workflow for PRs and pushes to main branch 2020-04-21 17:29:59 +02:00
e277cae799 Merge pull request #469 from tt2468/patch-1
Add simpleobsws to list of language APIs
2020-04-21 15:40:51 +02:00
05baf6b8ac Add simpleobsws to list of language APIs
I've created a simple async Python library for people who just want the simple stuff.
2020-04-21 05:30:21 -07:00
758441d65d readme: fix CI badges 2020-04-17 15:00:51 +02:00
631a008fa0 readme: fixes 2020-04-15 10:36:12 +02:00
71391914ae Added financial contributors to the README 2020-04-14 11:21:57 -07:00
54e79936e5 ci(macos): add automated codesigning + notarization (#464) 2020-04-10 21:41:45 +02:00
a833822eae docs(ci): Update protocol.md - cfa8d8d [skip ci] 2020-04-10 16:27:48 +00:00
cfa8d8d180 Merge pull request #463 from tt2468/patch-1
[Docs] Fix link to GetCurrentScene
2020-04-10 18:27:18 +02:00
b692756260 The actual fix 2020-04-10 08:14:25 -07:00
dbc62ad63a [Docs] Fix link to GetCurrentScene
For some reason the link to the `GetCurrentScene` section of the docs was put into a codeblock
2020-04-10 08:08:02 -07:00
2ac97dea35 installers: bump version 2020-04-07 17:35:49 +02:00
9451814299 ci(windows): fix installer suffix 2020-04-07 17:34:28 +02:00
5e01283018 Merge pull request #461 from Palakis/bugfix/disable-msvc-fh4
cmake(msvc): disable FH4
2020-04-06 20:00:27 +02:00
f7512c3cc0 cmake(msvc): disable FH4 2020-04-06 19:40:04 +02:00
f4997375e9 cmake: add version + fix /MP msvc flag 2020-04-06 19:09:01 +02:00
fbad54795e Merge pull request #453 from Palakis/bugfix/macos-qt-path
ci(macos): fix install_name_tool packaging step
2020-04-03 10:13:52 +02:00
2ca85d05f0 ci(macos): fix install_name_tool packaging step 2020-04-01 08:51:48 +02:00
67e89e79be docs(ci): Update protocol.md - e467666 [skip ci] 2020-03-29 22:20:01 +00:00
e4676668bb Merge pull request #449 from Palakis/bugfix/get-set-sceneitemproperties-item-id
Target Scene Items per ID, in addition to scene name and source name
2020-03-30 00:19:27 +02:00
3604995c2f requests(DeleteSceneItem + DuplicateSceneItem): backport dual "item" behaviour to existing functions 2020-03-30 00:02:36 +02:00
8b731f3ba4 fixes 2020-03-29 23:55:45 +02:00
83f702fbab requests(GetSceneItemProperties): add itemId response field 2020-03-29 23:28:07 +02:00
fbebf1c7d3 requests(scene item): fix docs 2020-03-29 23:04:20 +02:00
be14947668 oops 2020-03-29 22:12:54 +02:00
0fcf770043 requests(scene items): implement object mode on "item" request field 2020-03-29 22:07:55 +02:00
51ec3ede1f utils: add GetSceneItemFromRequestField 2020-03-29 21:42:10 +02:00
4e2302936f refactor bits 2020-03-29 21:41:38 +02:00
a6c6a42669 requests(scene items): doc fixes again 2020-03-29 19:39:57 +02:00
c486bc64c4 requests(scene items): refactor docs 2020-03-29 19:39:57 +02:00
3709ea1a95 docs(clarity): move scene items events into a proper "Scene Items" category
Namely:
- SourceOrderChanged
- SceneItemAdded
- SceneItemRemoved
- SceneItemVisibilityChanged
- SceneItemLockChanged
- SceneItemTransformChanged
- SceneItemSelected
- SceneItemDeselected
2020-03-29 19:39:57 +02:00
be7fa79327 docs(ci): Update protocol.md - c1660f8 [skip ci] 2020-03-29 17:39:56 +00:00
c1660f8ca2 chore: bump unreleased requests/events to 4.8.0 2020-03-29 19:39:19 +02:00
5e41eaf3dd Merge pull request #448 from Palakis/bugfix/text-gdiplus-v2
Allow Get/Set text gdiplus/ft2 properties functions to operate on v2 sources
2020-03-29 16:23:13 +02:00
898e761988 requests(freetype2 source): allow functions to operate on v2 sources 2020-03-29 16:13:28 +02:00
846d52ebe5 requests(gdiplus source): allow functions to operate on v2 sources 2020-03-29 16:09:16 +02:00
77ac6a7a26 Merge pull request #420 from Palakis/bugfix/crash-get-streaming-time
Fix crash when sending an event on exit
2020-03-29 15:57:07 +02:00
93c2dab634 Merge branch '4.x-current' into feature/t-bar 2020-03-28 19:23:52 +01:00
f23ba0c513 Merge branch '4.x-current' into bugfix/crash-get-streaming-time 2020-03-28 19:17:53 +01:00
824cfd4871 Merge branch '4.x-current' into bugfix/cmake-frontend-lib 2020-03-28 19:17:19 +01:00
6a733bbb13 Migrate Windows & Linux builds to Azure Pipelines (#422) 2020-03-28 19:13:55 +01:00
297d920fdc fix 2020-03-18 01:19:02 +01:00
c741a73893 request(SetTBarPosition): wip 2020-03-18 01:18:20 +01:00
540e1f562f Merge pull request #434 from Palakis/bugfix/enablestudiomode-crash
Fix crash when calling EnableStudioMode/DisableStudioMode/ToggleStudioMode
2020-03-18 01:07:21 +01:00
bfcd16ea28 requests(studio mode): fix crash when calling frontend_set_preview_program_mode 2020-03-18 01:01:33 +01:00
3a8703de87 Merge pull request #438 from Palakis/feature/remove-dynamic-load-functions
Remove dynloaded functions
2020-03-17 23:57:45 +01:00
247ca71bf9 utils: remove dynloaded function for projector open 2020-03-17 23:46:24 +01:00
88d39ab47a utils: remove dynamic loaded functions for recording pause 2020-03-17 23:45:57 +01:00
a5af45fb31 ci(xenial): update frontend api to 25.0.0 2020-03-17 23:41:00 +01:00
dc04cb54ab chore: bump to 4.8.0 2020-03-17 23:37:49 +01:00
c9fa82f073 Merge pull request #437 from Palakis/bugfix/takesourcescreenshot-jpg
Fix JPEG support in TakeSourceScreenshot on Windows
2020-03-17 22:14:35 +01:00
c418cbf4ef cmake(windows): fix qjpeg path 2020-03-17 20:08:46 +01:00
3450c6b9a3 cmake(windows): copy qjpeg on RelWithDebInfo as well 2020-03-17 19:52:49 +01:00
1ada33a4f0 package(deb): fix ambiguous syntax 2020-03-17 19:41:43 +01:00
a669852694 cmake(windows): oops, fix copy command 2020-03-17 19:37:39 +01:00
a5b6ea6c4c cmake(windows): copy qt image format plugins 2020-03-17 19:34:53 +01:00
fe217ef5df package(deb): fix email address 2020-03-17 18:43:01 +01:00
e0a25dbf48 package(deb): add Qt image formats plugins dependency 2020-03-17 18:16:26 +01:00
86191aff7f docs(travis): Update protocol.md - 6bed39e [skip ci] 2020-03-15 22:22:42 +00:00
6bed39e4fa Merge pull request #410 from Lange/feat/transition-end-events
feat(events): add "TransitionEnd" and "TransitionVideoEnd" events
2020-03-15 23:21:53 +01:00
2a7aa432a9 events(TransitionEnd): remove from-scene because it's not available in transition_stop 2020-03-15 23:20:56 +01:00
4e19e41460 Merge branch 'bugfix/openprojector-build-error' into 4.x-current 2020-03-12 17:51:57 +01:00
061f5d5099 requests(OpenProjector): get function pointer from lib dynamically 2020-03-12 17:44:56 +01:00
796bdebd90 requests(OpenProjector): wrap version check with parentheses 2020-03-12 17:27:28 +01:00
010102da25 ci(linux): download frontend API headers from stable 2020-03-12 17:06:09 +01:00
d8f2aeb004 requests(OpenProjector): refactor libobs version check 2020-03-12 17:03:00 +01:00
5173338949 linux: add proper dependencies list in Deb package 2020-03-12 15:40:28 +01:00
a8b00b026e docs(travis): Update protocol.md - d4db0bd [skip ci] 2020-03-12 13:55:33 +00:00
d4db0bdfe5 Merge pull request #431 from Palakis/feature/list-supported-image-formats
request(GetVersion): add supported image export formats list
2020-03-12 14:54:41 +01:00
b26cd901ca request(GetVersion): add supported image export formats list 2020-03-12 10:58:30 +01:00
1e2fc783e5 Merge pull request #429 from Palakis/bugfix/negative-sync-offset
requests(SetSyncOffset): allow negative offsets
2020-03-11 14:18:59 +01:00
8667333416 ci(macos): switch to macOS 10.14 2020-03-11 14:13:22 +01:00
5088d7dd86 requests(SetSyncOffset): allow negative offsets 2020-03-11 14:10:38 +01:00
e78f26e9c0 Merge pull request #428 from Rosuav/add-muted-flag
Add a 'muted' flag to GetSceneItems
2020-03-11 14:06:12 +01:00
be10227829 Utils,GetSceneItemProperties: Document both muted and alignment 2020-03-11 23:02:23 +11:00
ef47c172c5 Utils: Add a 'muted' flag to GetSceneItems 2020-03-11 22:52:33 +11:00
053faa1661 docs(travis): Update protocol.md - 6d63779 [skip ci] 2020-03-11 11:12:19 +00:00
6d63779c70 Merge pull request #338 from Rosuav/open-projector
Create a command for opening a projector.
2020-03-11 12:11:23 +01:00
62ad1a483c docs(OpenProjector): add info on geometry encoding 2020-03-11 12:09:08 +01:00
f4f760a231 Punt on explaining what the geometry string actually means 2020-03-11 22:05:37 +11:00
0eaef1ac3b docs(travis): Update protocol.md - 27245cc [skip ci] 2020-03-05 09:24:10 +00:00
27245cca1a Merge pull request #426 from Palakis/bugfix/setstreamsettings-docs-typo
docs: replace stream service option use-auth with use_auth
2020-03-05 10:23:11 +01:00
afcc11af57 docs: replace stream service option use-auth with use_auth 2020-03-05 10:08:59 +01:00
9fc41e4245 Apply suggestions from code review
Fixes all the easy ones. I'll look into the more substantive changes in a bit.

Co-Authored-By: Stéphane Lepin <Palakis@users.noreply.github.com>
2020-03-05 05:14:46 +11:00
a0e0910117 docs(travis): Update protocol.md - 8a7d7a4 [skip ci] 2020-03-04 13:11:56 +00:00
8a7d7a41a4 Merge pull request #321 from Rosuav/item-locked-event
Fire an event whenever an item is locked/unlocked
2020-03-04 14:10:56 +01:00
45d5f4a760 events: rename SceneItemLockedChanged to SceneItemLockChanged 2020-03-04 14:04:26 +01:00
101b795c0a Merge pull request #324 from Rosuav/show-gravity
Show alignment (gravity) of scene elements when querying/switching scenes
2020-03-04 13:49:58 +01:00
8311bd3fd9 Merge pull request #416 from tt2468/4.x-current
Fix SetStreamSettings when switching type
2020-03-04 11:37:01 +01:00
ec1926f7a6 events: fix @since value for SceneItemLockedChanged 2020-03-04 11:26:48 +01:00
e1c92956f8 docs(travis): Update protocol.md - 9233d4f [skip ci] 2020-03-04 09:57:04 +00:00
9233d4f6dc Merge pull request #411 from Lange/fix/fixed-duration-transitions
fix(events): don't advertise a false duration for fixed transitions
2020-03-04 10:56:14 +01:00
f2f5661625 cmake: fix redundant c++ standard flag 2020-02-25 15:32:47 +01:00
4338cf57e6 OBSRemoteProtocol: rely only on event data when encoding an event 2020-02-25 15:24:26 +01:00
a0dce77a2f RpcEvent: streamTime and recordingTime are optional 2020-02-25 15:23:24 +01:00
ca93882870 Remove unnecessary utf8 string conversion 2020-02-15 14:51:59 -08:00
22fbb4262c Return check type instead of type provided in request 2020-02-15 14:47:46 -08:00
2845fd07a7 Final fixes before testing 2020-02-15 14:22:35 -08:00
c02f40beb6 Update WSRequestHandler_Streaming.cpp 2020-02-15 14:18:25 -08:00
79a7b444a2 Update WSRequestHandler_Streaming.cpp 2020-02-15 11:00:24 -08:00
9c11bbc7a1 Update WSRequestHandler_Streaming.cpp 2020-02-15 10:58:10 -08:00
e1cb57563a fix(events): don't advertise a false duration for fixed transitions
Some transitions, such as Stingers, have a fixed duration. There is currently no way to retrieve this value from the API, and `obs-websocket` will currently return an incorrect value when one of these transitions begins.

For now, I think it is better to explicitly return -1, which is a better indicator that we have no idea what the real duration is, instead of a misleading number which users might think looks correct at first glance.
2020-02-15 11:16:49 -06:00
1057d765f7 feat(events): add "TransitionEnd" and "TransitionVideoEnd" events
Adds events for `TransitionEnd` and `TransitionVideoEnd`.

`TransitionVideoEnd` is specific to Stinger transitions. It is fired when their video has actually completed playback. This is important, because `TransitionEnd` is fired at the cut point of the Stinger, which is nice to have but isn't always what the user might want.

This builds on #409, and should be merged after it.
2020-02-15 11:15:46 -06:00
30db1a8a63 Update WSRequestHandler_Streaming.cpp 2020-02-15 08:50:09 -08:00
c7b49b28c2 docs(travis): Update protocol.md - 40ea7cf [skip ci] 2020-02-15 16:29:59 +00:00
40ea7cfe15 Merge pull request #409 from Lange/feat/transition-type
feat(events): add "type" field to TransitionBegin
2020-02-15 17:29:08 +01:00
b3b2ae267a Update WSRequestHandler_Streaming.cpp 2020-02-15 07:39:01 -08:00
88176f4d2b Merge pull request #413 from Palakis/bugfix/event-recording-time-fix
WSEvents: fix recording time field after refactoring
2020-02-15 14:45:49 +01:00
6917ac48a3 WSEvents: fix recording time field 2020-02-15 13:00:58 +01:00
c326d65ad3 feat(events): add "type" field to TransitionBegin
This field reports the type of the transition (`obs_stinger_transition`, `fade_to_color_transition`, etc), which can be useful for code which needs to react differently depending on what type of transition is being played.

Of note is that OBS calls this an `id`, but I think that's kind of a misleading name. `type` seems like a more semantic name for this information to me, but I'm open to changing it if we want to stay consistent with the nomenclature that OBS itself uses.
2020-02-06 18:04:08 -06:00
e1a2f0c0f4 Merge pull request #405 from Palakis/utils-to-namespace
Utils: turn it into a namespace
2020-01-29 18:20:55 +01:00
6953bc6105 Utils: turn it into a namespace 2020-01-29 17:24:45 +01:00
209555d36d Merge branch '4.x-current' into open-projector 2020-01-29 14:23:47 +01:00
e65958f33e Merge pull request #390 from Palakis/handler-protocol-refactor
Request handler refactor
2020-01-29 14:06:46 +01:00
02fea8938a OBSRemoteProtocol(processMessage): fix field order 2020-01-29 13:16:47 +01:00
f5277e4931 Merge branch '4.x-current' into handler-protocol-refactor 2020-01-29 12:30:24 +01:00
d78ed32df5 Merge pull request #404 from Palakis/bugfix/memory-leaks
Fix memory leaks in GetCurrentProfile, GetCurrentSceneCollection and Heartbeat event
2020-01-29 12:28:48 +01:00
8447395482 requests(GetCurrentSceneCollection): fix memory leak 2020-01-29 12:20:23 +01:00
915a7b6e15 requests(GetCurrentProfile): fix memory leak 2020-01-29 12:18:11 +01:00
b70c39789e events(Heartbeat): fix memory leak 2020-01-29 12:17:15 +01:00
865cb4857b RpcEvent: refactor fields to additionalFields 2020-01-29 11:13:42 +01:00
774abd66fa RpcEvent + RpcRequest: move accessors into declaration 2020-01-28 18:59:35 +01:00
e52d86e6f9 Merge branch '4.x-current' into handler-protocol-refactor 2020-01-28 18:49:49 +01:00
3c0b5b0b43 Utils: fix memory leak in StartReplayBuffer 2020-01-28 18:49:37 +01:00
46068573c5 events: decouple events encoding from event emit 2020-01-28 18:37:25 +01:00
06c29b7810 Merge branch '4.x-current' into handler-protocol-refactor 2020-01-28 17:05:15 +01:00
631452567d OBSRemoteProtocol: correctly handling null message IDs 2020-01-28 17:02:25 +01:00
6c34f00cfe OBSRemoteProtocol(errorResponse): add missing additionalFields 2020-01-28 16:52:11 +01:00
208c7f18b2 OBSRemoteProtocol: refactor class + pass handler when calling processMessage 2020-01-28 16:49:35 +01:00
5e393ed3c4 OBSRemoteProtocol(buildResponse): fix release of obs_data_t 2020-01-28 16:41:42 +01:00
8b16abd370 OBSRemoteProtocol: fix mixed indents 2020-01-28 16:38:57 +01:00
94c232d78e docs(travis): Update protocol.md - 4b41c52 [skip ci] 2020-01-28 15:32:31 +00:00
4b41c52522 Merge pull request #397 from justweb1/patch-1
Fix SetSourceFilterVisibility filterEnabled type
2020-01-28 16:31:38 +01:00
6bfe533a20 chore: fix quality warnings 2020-01-28 16:16:19 +01:00
f0b8aad4b1 docs(SetSourceFilterVisibility): fix filterEnabled type 2020-01-28 16:07:19 +01:00
796cf36a7f Merge pull request #400 from dmerrick/patch-1
Update README to include MacOS
2020-01-28 15:54:26 +01:00
7706d66754 Merge pull request #401 from dmerrick/patch-2
Update README to add Golang package
2020-01-28 15:54:02 +01:00
d992536914 Update README.md 2019-12-29 13:05:16 -05:00
286b76672c Update README.md 2019-12-29 12:50:05 -05:00
f0d1b5a1e4 Fix SetSourceFilterVisibility filterEnabled type
Corrected from String to Boolean
2019-12-19 02:14:45 -06:00
71ad8930d8 Merge pull request #393 from talk2MeGooseman/4.x-current
Switch from using caption_text1 to caption_text2
2019-11-29 12:08:19 +01:00
0f6cbb0c5c Switch from using caption_text1 to caption_text2
- caption_text1 has a built in delay of 2 seconds for all captions that causes every increasing delays for captions
2019-11-28 12:59:36 -08:00
78584b3194 Fix version number in message 2019-11-26 00:59:57 +11:00
c0eb4d652b Mention the OBS version requirement in the docos 2019-11-26 00:58:28 +11:00
edbb28038f Guard open_projector() with a version check.
I can't find a way to probe for an actual feature here.
2019-11-25 22:36:17 +11:00
3b7e9b4eba Create a command for opening a projector.
Depends on obs-studio#1910 for back end functionality.
2019-11-25 16:21:28 +11:00
6d0d07abfe Fire an event whenever an item is locked/unlocked 2019-11-25 16:21:17 +11:00
e9f90b4990 OBSRemoteProtocol: fix params 2019-11-15 23:39:31 +01:00
d25b65c124 RpcResponse: fixes 2019-11-15 22:59:36 +01:00
5864864123 WSServer: reimplement protocol 2019-11-15 21:07:58 +01:00
2f244ae37e WSRequestHandler(SceneItems): fix error message 2019-11-15 20:54:06 +01:00
f83317f7c8 WSRequestHandler(SceneItems): fix DuplicateSceneItem 2019-11-15 20:39:39 +01:00
973b4b9f70 RpcRequest: fix forward declarations 2019-11-15 20:33:26 +01:00
9389ceaf4f WSRequestHandler(SceneItems): fixes 2019-11-15 20:33:13 +01:00
928dc30810 WSRequestHandler(Sources): fixes 2019-11-15 20:30:44 +01:00
c9d6d10995 WSRequesthandler(Scenes): fixes 2019-11-15 20:29:22 +01:00
9323e1cf59 WSRequestHandler(Streaming): fixes 2019-11-15 20:28:42 +01:00
93a456ca82 WSRequestHandler(StudioMode): fixes 2019-11-15 20:27:27 +01:00
f6693d5587 WSRequestHandler(Transitions): fixes 2019-11-15 20:26:44 +01:00
fd09a0ce54 WSRequestHandler(SceneCollections): fixes 2019-11-15 20:26:00 +01:00
50d3a2600e WSRequestHandler(ReplayBuffer): fixes 2019-11-15 20:25:28 +01:00
7e1b05933f WSRequestHandler(Recording): fixes 2019-11-15 20:25:00 +01:00
03c4fdc607 WSRequestHandler(Profiles): fixes 2019-11-15 20:21:40 +01:00
0485cf51ff WSRequestHandler(Outputs): fixes 2019-11-15 20:17:11 +01:00
ba9201831b WSRequestHandler(General): fix error returns 2019-11-15 20:12:38 +01:00
f660036a25 RpcRequest: rename okResponse to success 2019-11-15 20:09:43 +01:00
f09cbfddbc WSRequestHandler(General): fixes 2019-11-15 20:08:09 +01:00
a12f1dcb13 RpcRequest: create ok and error response builders 2019-11-15 20:05:07 +01:00
d2bb1ddc29 RpcRequest: fix accessors 2019-11-15 19:58:57 +01:00
528d81106e WSRequestHandler(processRequest): fix bind call 2019-11-15 19:52:05 +01:00
f0bed24742 WSRequestHandler: fix map 2019-11-15 19:49:06 +01:00
5b54d8135e WSRequestHandler: fixes 2019-11-15 19:41:19 +01:00
31559051f6 WSRequestHandler: request handler as object methods 2019-11-15 19:38:15 +01:00
e6dbc9bfdf WSRequestHandler(General): fixes 2019-11-15 19:30:30 +01:00
d1ee9d83b5 RpcResponse: allow additional fields in responses 2019-11-15 19:30:22 +01:00
ffa6371e3d WSRequestHandler: fix main 2019-11-15 19:29:34 +01:00
ee6e241144 RpcRequest: add has* methods 2019-11-15 19:26:49 +01:00
bdf1023b16 handler: request and response types 2019-11-15 19:26:42 +01:00
9a8f248a75 docs(travis): Update protocol.md - 6845cda [skip ci] 2019-11-12 10:41:34 +00:00
6845cda146 Update WSRequestHandler_Sources.cpp 2019-11-12 11:40:36 +01:00
4488b2b7a5 Merge pull request #385 from Palakis/bugfix/macos-deps-lookup
ci(macos): fix lookup path of Qt dependencies for new OBS bundle format
2019-11-11 15:38:34 +01:00
7dd8cb5d8d ci(macos): use framework rpath in package script 2019-11-11 15:27:27 +01:00
ebf631a15f ci(macos): fix lib paths in package script 2019-11-11 14:54:17 +01:00
3770b75a78 docs(travis): Update protocol.md - 5d81b61 [skip ci] 2019-11-11 13:41:29 +00:00
5d81b61325 Merge pull request #388 from Palakis/feature/enable-disable-filters
Get/set filter visibility (+ get single filter info)
2019-11-11 14:40:32 +01:00
a8e5171b40 utils(GetSourceFilterInfo): fix settings memory leak 2019-11-11 14:27:40 +01:00
a3e0abb6ce events: add SourceFilterVisibilityChanged 2019-11-11 14:12:37 +01:00
c51f20eb99 requests(SetSourceFilterVisibility): fix parameter value 2019-11-11 13:43:33 +01:00
be897c4df2 requests(sources): fix typo 2019-11-11 13:42:16 +01:00
11b948fb69 Revert "ci(macos): use @rpath in package script"
This reverts commit 070660848b.
2019-11-11 13:36:04 +01:00
070660848b ci(macos): use @rpath in package script 2019-11-11 13:27:33 +01:00
61af0ec9c6 requests(sources): add SetSourceFilterVisibility method 2019-11-11 12:58:36 +01:00
897f115363 requests(sources): add GetSourceFilterInfo method 2019-11-11 12:53:22 +01:00
b8fcf0355c requests(GetSourceFilters): add "enabled" status field 2019-11-11 12:44:13 +01:00
5bdff87e3f ci(macos): fix lookup path of Qt dependencies for new OBS bundle format 2019-11-04 13:07:15 +01:00
31991a3567 docs(travis): Update protocol.md - 25c369d [skip ci] 2019-10-17 14:19:25 +00:00
25c369d422 Merge pull request #384 from BarryCarlyon/TakeSourceScreenshotDocs
Take scene screenshot
2019-10-17 16:18:16 +02:00
8d396b1518 Adjust wording based on feedback 2019-10-17 11:53:32 +01:00
ba327b746a Wording Tweak 2019-10-15 20:13:00 +01:00
7d11f912c9 Revise Documentation to note that a Scene Name can be provided 2019-10-15 20:11:40 +01:00
919cdfb5a9 WSServer: remove remains of QWebSocket 2019-09-16 13:01:44 +02:00
da9dd6f775 docs(travis): Update protocol.md - 8b841f0 [skip ci] 2019-09-03 19:29:52 +00:00
8b841f026e Merge pull request #371 from Palakis/pause-recording
Recording Pause support
2019-09-03 21:28:55 +02:00
5342b39640 WSEvents: use frame count for streaming timecode 2019-09-03 21:04:45 +02:00
fc08add504 WSEvents: use stream time getter 2019-09-03 16:05:38 +02:00
20379ac61e WSEvents: recording time based on frame count and frame duration 2019-09-03 16:03:52 +02:00
af40aa59ab events + requests: fix dynamic runtime support for recording pauses 2019-09-03 13:50:44 +02:00
f9afc5597a requests(pause recording): fix memory leak 2019-09-03 13:22:08 +02:00
40178e4661 WSEvents(nsToTimestamp): fix sprintf compiler warning 2019-09-03 09:56:20 +02:00
ad56abd6f5 requests(Recording): refactor bits 2019-09-03 03:34:20 +02:00
9073a09d84 requests(pause recording): runtime feature detection 2019-09-03 03:30:06 +02:00
2a4e6fce3f WSEvents: fix constructor warning 2019-09-03 03:03:06 +02:00
0a3a407217 events: refactor timecode generation 2019-09-03 02:59:02 +02:00
9ca9cf80df Merge branch '4.x-current' into pause-recording 2019-09-03 02:41:42 +02:00
6c881a5da7 Merge pull request #372 from Palakis/frontend-events-ifelse-refactor
events: refactor the massive if else chain in the frontend event callback
2019-09-03 02:40:07 +02:00
5322acd58c events: add RecordingPaused and RecordingResumed 2019-09-03 02:35:54 +02:00
ce489e53c6 requests(GetStreamingStatus): add property "recording-paused" 2019-09-03 02:34:24 +02:00
0c95e509dc events(Heartbeat + StreamStatus): add property "recording-paused" 2019-09-03 02:34:24 +02:00
46a006ed54 requests(pause recording): only compile recording pause function bodies when supported 2019-09-03 02:34:24 +02:00
0cc9378d05 requests: add PauseRecording and ResumeRecording 2019-09-03 02:34:24 +02:00
f3edb2ee68 events: refactor the massive if else chain in the frontend event callback 2019-09-03 02:34:11 +02:00
a539f23194 Update README.md 2019-09-02 17:53:18 +02:00
6b6dec79c5 Merge pull request #369 from Palakis/bugfix/connection-onclose-broadcast-crash
WSServer: handle error codes to avoid throwing exceptions when sending a message
2019-09-02 12:52:58 +02:00
d7f5c042bf WSServer: handle error codes when sending a message 2019-09-01 00:16:09 +02:00
2fe9812b26 gitignore: .idea folder 2019-09-01 00:04:31 +02:00
1c15c3c7a3 Merge pull request #368 from Palakis/bugfix/timecode-sprintf-warning
WSEvents(nsToTimestamp): fix sprintf format warning
2019-08-31 21:50:46 +02:00
1ee5857139 WSEvents(nsToTimestamp): use unsigned long long constants 2019-08-31 21:35:58 +02:00
2f9c2b0d65 WSEvents(nsToTimestamp): fix sprintf format warning 2019-08-31 18:34:49 +02:00
6e5161f43b Merge pull request #367 from Palakis/bugfix/start-server-after-loading-finished
Start server after OBS finishes loading
2019-08-31 17:39:08 +02:00
d492d74a64 module: start server after OBS finishes loading 2019-08-31 16:03:32 +02:00
26506731c5 Merge pull request #366 from Palakis/bugfix/incorrect-recording-free-space
events(GetStats): fix recording path detection
2019-08-31 04:50:40 +02:00
b0c03d4f47 events(GetStats): fix recording path detection 2019-08-31 04:31:40 +02:00
3bc8348c32 Merge pull request #365 from Palakis/bugfix/reordersceneitems-crash
ReorderSceneItems: fix crash + refactor Utils
2019-08-31 03:29:21 +02:00
a034fbba83 utils(GetSceneItemFromItem): fix memory leaks with obs_data_item_t uses 2019-08-31 03:10:49 +02:00
73b5261c49 requests(ReorderSceneItems): atomic reorder + bring back GetSceneItemFromId 2019-08-31 03:03:32 +02:00
cee0cbebc2 Utils: use obs_scene_t* directly for scene-related helpers 2019-08-31 03:03:32 +02:00
9723147429 Utils: refactor GetSceneItemFromItem and get rid of GetSceneItemFromId 2019-08-31 03:03:32 +02:00
dca385ae87 requests(ReorderSceneItems): refactor 2019-08-31 03:03:32 +02:00
71f792944c request handler: fix obs_data_item_t memory leak 2019-08-31 02:52:08 +02:00
6041c4acd2 Merge pull request #364 from Palakis/bugfix/transitionbegin-cut-duration
event(TransitionBegin): set duration to 0 if it's a Cut transition
2019-08-30 14:10:46 +02:00
0c7529705e docs(travis): Update protocol.md - 63f1ea1 [skip ci] 2019-08-30 11:54:21 +00:00
63f1ea1cec docs: bump docs version to 4.7.0 2019-08-30 13:53:11 +02:00
4bbaa75f41 Merge pull request #358 from Palakis/request-helpers
Extend WSRequestHandler::hasField() to support field type checking
2019-08-30 13:50:25 +02:00
5fe9314b74 WSEvents: remove unused transitionIsCut helper 2019-08-30 13:41:50 +02:00
bfd26493ab Utils(GetTransitionDuration): return 0 if transition is a cut transition 2019-08-30 13:41:08 +02:00
5d74d5d03e WSEvents(OnTransitionBegin): refactor event code 2019-08-30 13:36:45 +02:00
3142e097a5 Merge pull request #360 from ZyanKLee/patch-1
allow for "linuxbrowser_source" to be controlled
2019-08-26 21:02:00 +02:00
b25d8d8201 requests(sources): fix linux browser source id 2019-08-26 21:01:05 +02:00
7e68cd016a ci(windows): exclude RCs when fetching the latest version of OBS 2019-08-24 12:39:46 +02:00
9e4fc9eb73 allow for "linuxbrowser_source" to be controlled
based on the request at https://github.com/bazukas/obs-linuxbrowser/issues/46 I did a quick search for the string "browser_source" and these seem to be the only two occurrences. Enhancing the conditional with the identifier of the obs-linuxbrowser plugin, this should solve the problem.

As I'm currently not at home, I can't verify this does what it should, but I will test it later tonight.

@mjc666 if you are still interested please give it a test run to verify if these two plugins work together now.
2019-08-22 19:44:12 +02:00
fb0d13a171 WSRequestHandler: add int and double type check methods 2019-08-02 21:52:50 +02:00
f097b36c2e WSRequestHandler: add type checks for field test methods 2019-08-02 21:40:42 +02:00
57ce3cf80b Merge pull request #320 from Palakis/feature/remove-hacks
utils: remove transition hacks
2019-07-31 17:38:40 +02:00
c1da62391f docs(travis): Update protocol.md - d8882ce [skip ci] 2019-07-31 15:37:41 +00:00
d8882ce979 Merge pull request #357 from julijane/fix-001
Fix spec of HandleBroadcastCustomMessage
2019-07-31 17:36:39 +02:00
9c1871494e Fix spec of HandleBroadcastCustomMessage 2019-07-26 14:40:54 +02:00
ac26c9114a docs(travis): Update protocol.md - fb0a570 [skip ci] 2019-07-26 07:31:42 +00:00
fb0a57003c BroadcastCustomMessage: fix command and event spec 2019-07-26 09:30:30 +02:00
cda22233a6 docs(travis): Update protocol.md - add3075 [skip ci] 2019-07-26 03:52:35 +00:00
add307577d Merge pull request #354 from julijane/4.x-current
Make it possible to broadcast messages (data) to other websocket clients
2019-07-26 05:51:42 +02:00
4af46ac2b9 use obs_data_t* in Event function 2019-07-25 17:20:31 +02:00
8d39752bda Move event emitting code 2019-07-25 17:00:32 +02:00
e3ff9c013e change function name, language 2019-07-25 14:47:47 +02:00
635870ba4b more comment fixes 2019-07-24 05:36:47 +02:00
a827afb05b Comment fix 2019-07-24 01:56:53 +02:00
0195e13bdc Implement proposed changes to Broadcast 2019-07-23 21:47:55 +02:00
76d8b688fd Add Code for BroadcastWebSocketMessage 2019-07-22 01:05:21 +02:00
b4857e2c79 docs(travis): Update protocol.md - ac2ae90 [skip ci] 2019-07-16 16:23:36 +00:00
ac2ae90e8a Merge pull request #343 from Palakis/feature/outputs-api
Outputs API
2019-07-16 18:22:40 +02:00
0b5cb76b5d outputs: remove TODOs 2019-07-16 18:22:07 +02:00
a5bc979c24 cmake: fix set of OBS_FRONTEND_LIB 2019-06-23 22:58:45 +02:00
6eed9606ae docs: remove Boost from BUILDING.md 2019-06-23 22:38:36 +02:00
29679ff94c docs(travis): Update protocol.md - 65a1f8b [skip ci] 2019-06-18 16:41:13 +00:00
65a1f8b746 GetSourceTypesList: fix docs
Fixes #348
2019-06-18 18:38:52 +02:00
48182d35bd docs(travis): Update protocol.md - b526ed4 [skip ci] 2019-06-16 14:20:37 +00:00
b526ed47be Merge branch '4.x-current' of github.com:Palakis/obs-websocket into 4.x-current 2019-06-16 16:19:32 +02:00
2225dec2a9 docs(SourceAudioMixersChanged): fix remaining discrepancy 2019-06-16 16:19:22 +02:00
011458d642 docs(travis): Update protocol.md - e32fff3 [skip ci] 2019-06-16 14:18:12 +00:00
e32fff3f61 docs(SourceAudioMixersChanged): fix discrepancy 2019-06-16 16:14:26 +02:00
0b42e3d0f3 outputs: add more info fields 2019-06-11 19:32:52 +02:00
2b746d1353 cmake: add output requests 2019-06-11 19:32:52 +02:00
6fed6f9f7d StartOutput: provide output error message when start fails 2019-06-11 19:32:52 +02:00
480945073a outputs: start or stop only when possible 2019-06-11 19:32:52 +02:00
ef6df94838 outputs: todos 2019-06-11 19:32:52 +02:00
fb05848426 requests: outputs API WIP 2019-06-11 19:32:52 +02:00
e5be6b96fb general: version bump to 4.7 2019-06-11 19:32:32 +02:00
2d706a245a Merge pull request #337 from DieserMerlin/patch-2
Update README.md (+ obs-websocket-java library)
2019-06-04 11:17:43 +02:00
1abc4f491b readme: minor fix 2019-06-04 10:46:19 +02:00
b21a45b43e Update README.md 2019-06-01 00:08:19 +02:00
585f8450e1 Merge pull request #330 from Palakis/transitionbegin-hotfix
Fix TransitionBegin event
2019-05-21 00:05:24 +02:00
d3401db5fe general: version bump to 4.6.1 2019-05-21 00:02:48 +02:00
45dc6447bf events: fix how and when TransitionBegin is hooked 2019-05-20 23:54:13 +02:00
409c270ba2 events: fix TransitionBegin event not triggering 2019-05-20 23:48:49 +02:00
aed0234d47 docs(travis): Update protocol.md - 07ebbe5 [skip ci] 2019-05-20 19:15:50 +00:00
07ebbe56e6 docs: fix typos
Fixes #328
Fixes #329
2019-05-20 21:14:14 +02:00
47b485819f Update property -> return as this isn't a typedef 2019-05-20 01:47:25 +10:00
fd32f7f435 Explain how OBS interprets alignment numbers 2019-05-20 00:44:11 +10:00
c4b07b1a7b Merge remote-tracking branch 'origin/4.x-current' into show-gravity 2019-05-20 00:37:22 +10:00
95bbeb103e locale: update translations from Crowdin 2019-05-19 16:05:05 +02:00
bfb5570b7a scene item requests: defer updates to avoid triggering several transform events at once 2019-05-19 15:50:44 +02:00
1e19cf7ccc server: don't reuse sockets on windows
Other, conflicts with Port In Use detection
2019-05-19 15:43:27 +02:00
0d8999d64f GetVersion: bring back retrocompat version field 2019-05-19 13:41:23 +02:00
91fde777cf docs(travis): Update protocol.md - 061ab12 [skip ci] 2019-05-19 08:07:31 +00:00
061ab12b10 Merge pull request #317 from Palakis/group-fixes
Groups fixes
2019-05-19 10:06:08 +02:00
c516e87180 text: rename settings dialog + dedup strings 2019-05-17 12:59:43 +02:00
de6bfdca0a SceneItems(docs): add comment about coordinates 2019-05-16 14:30:39 +02:00
788f70d5f3 Utils(GetSceneItemData): remove property isGroup 2019-05-16 13:57:38 +02:00
b0a35789f6 utils + sceneitem: fix docs again 2019-05-16 13:55:33 +02:00
eb7fbf011f utils + sceneitems: fix docs 2019-05-16 13:54:06 +02:00
50bb6e7204 Utils: add parent property to scene item info and transform data + refactor bits 2019-05-16 13:50:24 +02:00
15610bb296 Utils(GetSceneItemData): add children list 2019-05-16 13:37:04 +02:00
ae0ffdc4d5 docs: rename typedef Source to SceneItem 2019-05-16 13:12:18 +02:00
033a6929c3 Utils(GetSceneItemFromId): recurse into groups wip 2019-05-16 11:03:32 +02:00
7c8292a88d Utils(GetSceneItemFromName): recurse into groups wip 2019-05-16 11:00:29 +02:00
ab5dad7d91 Utils: oops 2019-05-15 13:11:15 +02:00
0744d215c6 utils(GetSceneItemData): add isGroup flag + move Source typedef here 2019-05-15 13:11:15 +02:00
2622eb4663 Add alignment to the documented definition of a Source 2019-05-14 04:09:18 +10:00
74b3dc2831 Show alignment (gravity) of scene elements when querying/switching scenes 2019-05-14 04:05:22 +10:00
149ddfa8f8 Merge pull request #323 from Palakis/gpl-prompt-fix
installer(windows): fix EULA prompt into something GPL-compliant
2019-05-12 01:22:37 +02:00
3830870a83 installer(windows): fix EULA prompt into something GPL-compliant 2019-05-12 00:59:51 +02:00
b94be080f6 Merge pull request #322 from Palakis/remove-boost
general: remove boost remains
2019-05-11 17:40:17 +02:00
83382d8dcf general: remove boost remains 2019-05-11 17:13:41 +02:00
f815228677 Merge pull request #319 from Rosuav/video-info
Create an endpoint to view basic video info eg canvas size
2019-05-10 18:30:06 +02:00
d7d8d23de7 Refactor enum-to-string conversions into functions 2019-05-11 01:42:52 +10:00
5834c6ed54 Switch doc type from Number to int for clarity and precision 2019-05-10 18:48:51 +10:00
b0512b3ba7 Provide info about color space and scaling 2019-05-10 04:33:37 +10:00
d3a7a6ef55 Make small tweaks to formatting and layout.
* Switch to camelCase for output properties
* Remove done TODO
* Properly document all of the information returned
2019-05-10 04:08:01 +10:00
99fad5bc83 docs(travis): Update protocol.md - a54171e [skip ci] 2019-05-09 13:54:08 +00:00
a54171e1cd SetSceneItemProperties: fix docs (optional parameters)
Fixes #318
2019-05-09 15:52:35 +02:00
84629f6e63 utils: remove transition hacks 2019-05-09 13:28:50 +02:00
b18d597bdc Utils: remove unused SceneListItemToScene 2019-05-09 07:53:22 +02:00
9125dc4cce Utils: remove unused GetSceneListControl() 2019-05-09 07:51:41 +02:00
b0e3ea8765 Update docs to include GetVideoInfo 2019-05-09 06:03:14 +10:00
7c457546f1 Create an endpoint to view basic video info eg canvas size 2019-05-09 05:58:55 +10:00
83bef1a840 main: force-destroy server, events and config when unloading the plugin 2019-05-08 00:48:43 +02:00
b4d89d5666 Config + WSServer: provide singletons from plugin entry point 2019-05-08 00:43:46 +02:00
3ba8a77d9a Utils: remove empty space 2019-05-08 00:30:53 +02:00
82c31dc47a Merge branch 'better-signals-handling' into 4.x-current 2019-05-07 23:47:21 +02:00
7fce694577 main: global settings dialog instance not required 2019-05-07 23:40:30 +02:00
e352d9750d WSEvents: remove singleton + refactor pointer handling in plugin entrypoint 2019-05-07 23:36:43 +02:00
3d9eac8e6d WSEvents: connect to signals at construct and disconnect at destroy 2019-05-07 22:58:20 +02:00
6c85b33539 WSEvents: source signal connect/disconnect methods 2019-05-07 22:53:07 +02:00
d979ada4fe WSEvents: fix OnSourceDestroyed not triggering 2019-05-07 22:44:01 +02:00
faeeae17d1 docs(travis): Update protocol.md - 82d1a2b [skip ci] 2019-05-07 11:38:16 +00:00
82d1a2b4f9 GetSceneItemProperties: fix docs 2019-05-07 13:36:25 +02:00
cac3496145 readme: replace twitter account 2019-05-04 14:23:55 +02:00
53bfa077ae docs(travis): Update protocol.md - 0b9366f [skip ci] 2019-05-04 10:30:17 +00:00
0b9366fa28 Merge pull request #313 from Palakis/source-screenshot
Source Image Snapshot
2019-05-04 12:29:12 +02:00
c95b709f39 TakeSourceScreenshot: fix docs 2019-05-04 12:19:15 +02:00
5745da5466 TakeSourceScreenshot: always provide an absolute path in imageFile response 2019-05-04 11:50:29 +02:00
ef853e34d6 Merge pull request #316 from Rosuav/no-tray-icon
Return nullptr if there are no tray icons
2019-05-03 22:18:54 +02:00
7177913d9b TakeSourceScreenshot: ability to choose between save to file and/or data uri 2019-05-03 22:01:40 +02:00
86b6ddb625 Return nullptr if there are no tray icons 2019-05-04 04:20:22 +10:00
53b9a46feb TakeSourceScreenshot: direct file save 2019-05-03 19:14:17 +02:00
d46c1f8687 TakeSourceScreenshot: fix off-screen sources rendering 2019-05-03 01:14:58 +02:00
c92477b457 TakeSourceScreenshot: fix tearing issue when scaling 2019-05-03 01:11:36 +02:00
059244bb32 TakeSourceScreenshot: fix heap corruption on windows 2019-05-03 00:49:55 +02:00
f10c0d2558 TakeSourceScreenshot: use default quality 2019-05-03 00:02:53 +02:00
f5ae89500f TakeSourceScreenshot: fix docs 2019-05-02 23:13:11 +02:00
2e3a24d32e TakeSourceScreenshot: add width and height optional parameters 2019-05-02 23:13:11 +02:00
f955d81c5e requests: rename GetSourceImage to TakeSourceScreenshot 2019-05-02 23:13:11 +02:00
4f1fa3bc32 requests(GetSourceImage): add picture format parameter 2019-05-02 23:13:11 +02:00
8305d907e3 request(GetSourceImage): fix mime type 2019-05-02 23:13:11 +02:00
ab73d61178 request(GetSourceImage): add todo 2019-05-02 23:13:11 +02:00
8f88d1b7c4 request(GetSourceImage): use PNG 2019-05-02 23:13:11 +02:00
c5cdbc48a9 requests(sources): fix includes 2019-05-02 23:13:11 +02:00
fe00f31147 sources: fix GetSourceImage method 2019-05-02 23:13:11 +02:00
79ddb43ac3 use QImage buf directly 2019-05-02 23:13:11 +02:00
89f95f6459 switch to WebP 2019-05-02 23:13:11 +02:00
87c13b6f26 Working PNG output 2019-05-02 23:13:11 +02:00
d16ea653fe GetSourceImage WIP 2019-05-02 23:13:11 +02:00
51dc7fceb0 Merge pull request #312 from Palakis/feature/async-handling
Call the request handler asynchronously
2019-05-02 23:11:24 +02:00
bc1c6f7b9a remove boost atomic uses 2019-05-02 13:29:23 +02:00
3fdf77d29b ConnProperties: use std atomic 2019-05-02 13:22:04 +02:00
0b97502029 ci(macos): fix oops 2019-05-02 13:17:38 +02:00
cba2bf5cb8 ci(macos): fix obs build issue 2019-05-02 13:16:39 +02:00
d8b37328a1 ConnProperties: atomic "authenticated" field 2019-05-02 13:11:34 +02:00
bb9cf83744 server: dedicated ConnectionProperties object 2019-05-02 13:06:10 +02:00
56fc6ae47c server: connection properties reference 2019-05-02 12:51:07 +02:00
0cf17cf3db server: use shared connection properties instance 2019-04-28 11:59:03 +02:00
1bd3297055 server: update comment 2019-04-26 13:55:21 +02:00
6a10662bc4 server: use a thread pool 2019-04-26 13:52:56 +02:00
2d84ad8963 server: handle requests in a separate thread 2019-04-26 13:39:18 +02:00
1ec69cbc0d docs(travis): Update protocol.md - 0057744 [skip ci] 2019-04-25 12:35:06 +00:00
0057744e57 Merge branch '4.x-current' of github.com:Palakis/obs-websocket into 4.x-current 2019-04-25 14:33:53 +02:00
45892b4347 events: fix docs 2019-04-25 14:02:04 +02:00
3d41e8882a docs(travis): Update protocol.md - 436b821 [skip ci] 2019-04-25 11:44:54 +00:00
436b8216ec requests(streaming): add @since property for SendCaptions 2019-04-25 13:43:24 +02:00
03ba2a680e SetSceneItemProperties: fix string comparison for bounds type parameter
Fixes #309
2019-04-23 11:32:04 +02:00
2821962d12 docs(travis): Update protocol.md - 43d38a2 [skip ci] 2019-04-22 17:57:20 +00:00
43d38a2e63 Merge pull request #308 from Palakis/bugfix/285-item-id
Provide scene item id in events data and request responses
2019-04-22 19:56:08 +02:00
ea28d217e0 requests: add "id" to scene item data and fix docs 2019-04-22 19:45:32 +02:00
89fe6d57c9 events: add "item-id" property to scene item events 2019-04-22 19:34:27 +02:00
1d0e1143bf docs(travis): Update protocol.md - 1a99353 [skip ci] 2019-04-22 17:00:15 +00:00
1a99353559 Merge pull request #307 from Palakis/feature/271-item-selected
Item Select/Deselect events
2019-04-22 18:58:50 +02:00
ad97d04e37 events: scene item select and deselect events 2019-04-22 18:47:46 +02:00
25c3abe873 docs(travis): Update protocol.md - 8eeea50 [skip ci] 2019-04-22 16:32:39 +00:00
8eeea50ede Merge pull request #305 from Rosuav/fix-docs-formatting
Fix docs formatting (loose combining character)
2019-04-22 18:31:16 +02:00
0ded11c6a2 Merge pull request #306 from Rosuav/set-scene-item-locked
Allow the manipulation of the locked flag of scene items.
2019-04-22 18:30:20 +02:00
b6c542212d events: fix typo 2019-04-22 18:29:59 +02:00
182bde4884 Allow the manipulation of the locked flag of scene items.
Lockedness can be seen when you query an item or see the scene
contents, and can be changed (only) with SetSceneItemProperties.
2019-04-23 00:32:28 +10:00
eb84f677cf Merge pull request #304 from Palakis/feature/269-settings-per-profile
Move settings to profile
2019-04-22 16:29:01 +02:00
3ecb637e70 Fix docs formatting (loose combining character) 2019-04-23 00:23:06 +10:00
bfc826b898 config: fix types 2019-04-22 16:18:54 +02:00
efc6d4c15a config: enable settings migration 2019-04-22 16:13:12 +02:00
a96da35f11 server: don't notify disconnections when stopping the server 2019-04-22 16:03:53 +02:00
2bff3798af config: slight change 2019-04-22 15:46:59 +02:00
0fb50a3273 config: put alerts text to locale data 2019-04-22 15:43:41 +02:00
1c17eee125 config(profile change): fix notifications 2019-04-22 15:26:26 +02:00
14a43a9cd2 server: call reset before starting (fixes restarts) 2019-04-22 15:06:36 +02:00
7bbc7366f2 server: allow address reuse 2019-04-22 13:33:39 +02:00
879bedd781 server(stop): close all connections and wait for proper stop 2019-04-22 13:29:53 +02:00
8b79bfab4f config: set default before reloading from profile 2019-04-22 13:12:01 +02:00
f022e09938 config: show message if server is stopped after profile change 2019-04-21 18:59:04 +02:00
a63b6a0e3d config: per profile settings 2019-04-21 18:52:47 +02:00
dd1facec06 docs(travis): Update protocol.md - a46b571 [skip ci] 2019-04-21 15:44:12 +00:00
a46b5716be Merge pull request #303 from Palakis/feature/115-streamstatus-more-info
Add more stats to StreamStatus and Heartbeat + add GetStats request type
2019-04-21 17:42:36 +02:00
e96b7bfd62 fix docs 2019-04-21 16:03:44 +02:00
a60c1c1365 stats: provide recording disk space 2019-04-21 16:03:05 +02:00
4c39fcd614 events(GetStats): missing field 2019-04-21 15:49:08 +02:00
e6b341f2a0 requests: add GetStats 2019-04-21 15:44:24 +02:00
bdf9e76a6b events: more stats info in StreamStatus and Heartbeat 2019-04-21 15:38:27 +02:00
e0fc395fbe events: remove unused variable 2019-04-21 14:48:15 +02:00
107c03653d docs(travis): Update protocol.md - a5058cf [skip ci] 2019-04-21 12:27:27 +00:00
a5058cf951 Merge pull request #302 from Palakis/bugfix/168-sourceorderchanged-items-list
event(SourceOrderChanged): include scene items list
2019-04-21 14:26:25 +02:00
ed2726c9d2 SourceOrderChanged: include scene items list 2019-04-21 14:17:50 +02:00
6b31ff7e79 docs(travis): Update protocol.md - 86d3925 [skip ci] 2019-04-21 08:14:30 +00:00
86d3925bf4 Merge pull request #301 from Palakis/bugfix/233-setrecordingfolder-not-working
SetRecordingFolder: fix docs + simplify helper function
2019-04-21 10:13:07 +02:00
8c2cde4c13 SetRecordingFolder: fix docs + simplify helper function 2019-04-21 09:59:52 +02:00
2d6e34ee6d docs(travis): Update protocol.md - adb5577 [skip ci] 2019-04-20 23:05:02 +00:00
adb5577b01 Merge pull request #294 from Palakis/global-scene-events
events refactor (transitions & scene signals) + new events
2019-04-21 01:04:01 +02:00
84ef3f223d events: fix docs 2019-04-20 23:56:15 +02:00
fa50008f3d wsevents(filter removed): fix crash on exit 2019-04-20 23:52:35 +02:00
6a5537f90f utils: comments 2019-04-20 23:20:21 +02:00
e0d33a9683 events: remove static_cast 2019-04-20 23:09:59 +02:00
4092c9a473 events: add "source kind" param to events + various fixes 2019-04-20 23:08:06 +02:00
fcaac3d515 events: fix filter events docs + refactor filters list getter 2019-04-20 22:57:52 +02:00
e86d1aad02 wsevents: fix SourceMuteStateChange 2019-04-20 19:13:21 +02:00
2c94b4c332 wsevents: fix docs 2019-04-20 19:09:46 +02:00
2b6933f6e2 WSEvents: implement SourceAudioMixersChanged 2019-04-20 18:34:25 +02:00
2e2a7f073e wsevents: fix constructor 2019-04-20 18:05:51 +02:00
515c7852ba events: remove OnSourcePropertiesChanged (can't implement) 2019-04-20 18:04:38 +02:00
5577277944 events: new events 2019-04-20 18:04:38 +02:00
ed9e4ff168 events: new events WIP 2019-04-20 18:04:38 +02:00
d10915c7a8 tidy: todos 2019-04-20 18:04:38 +02:00
40763fc15d events: new types SourceCreated and SourceDestroyed 2019-04-20 18:04:38 +02:00
88d3271c40 events: refactor signal connection to transitions 2019-04-20 18:04:38 +02:00
21940c922d utils: fix compilation warnings 2019-04-20 18:04:38 +02:00
93adc8587d general: refactor qt includes 2019-04-20 18:04:36 +02:00
1907f8d1d1 events: fix sprintf warnings + simplified qt connect 2019-04-20 18:03:43 +02:00
ca8848827e events: refactoring + setup scene signals on scene creation 2019-04-20 18:03:19 +02:00
3a7473ba91 Merge pull request #300 from Palakis/bugfix/290-port-used-crash
server: implement "port already in use" message + fix crash with StreamStatus
2019-04-19 23:21:13 +02:00
a99da27ff6 events: fix crash caused by early StreamStatus call 2019-04-19 23:09:25 +02:00
c476649f3e server(start): fix error message 2019-04-19 22:12:04 +02:00
062473d6f4 server: show error message if port is already in use 2019-04-19 21:57:08 +02:00
d0ed43a8e5 docs(travis): Update protocol.md - 701098d [skip ci] 2019-04-19 18:18:53 +00:00
701098d19d Merge pull request #299 from Palakis/feature/183-streamstatus-replay-buffer
events(StreamStatus): new property "replay-buffer-active"
2019-04-19 20:17:21 +02:00
c33a0ab439 events(StreamStatus): new property "replay-buffer-active" 2019-04-19 20:02:19 +02:00
b8af848d3a Merge pull request #298 from Palakis/bugfix/264-debug-logging
fix debug logging
2019-04-19 19:16:11 +02:00
3dd7fe5d4a requests + events: log message to INFO instead of DEBUG
and slightly refactor the request handler
2019-04-19 19:00:52 +02:00
81ab199308 docs(travis): Update protocol.md - 92938d2 [skip ci] 2019-04-19 16:08:42 +00:00
92938d2c35 Merge pull request #297 from Palakis/bugfix/242-getsceneitemproperties-item-size
GetSceneItemProperties: add width & height values
2019-04-19 18:07:34 +02:00
c914632663 GetSceneItemProperties: add width & height values 2019-04-19 17:44:11 +02:00
c95104fada Merge pull request #295 from Rosuav/docs-patch-fix-call-name
Fix call name GetSourcesTypesList -> GetSourceTypesList
2019-04-19 12:29:51 +02:00
2209fe30e2 Fix call name GetSourcesTypesList -> GetSourceTypesList
The API call listed in the documentation doesn't work (tested on 4.3.1),
but without the 's', it works fine. Update documentation to match code.
2019-04-19 20:14:31 +10:00
979e0ddc88 docs(travis): Update protocol.md - 9fab714 [skip ci] 2019-04-16 23:23:02 +00:00
9fab714674 Merge pull request #293 from Vainock/patch-1
Make "WebSocket" consistent
2019-04-17 01:22:30 +02:00
2eb6463ab0 Merge pull request #272 from BarryCarlyon/scene_item_transform
Support item_transform signal
2019-04-17 01:21:46 +02:00
5e4d6fbd3f utils: refactored docs and impl of scene item properties 2019-04-17 01:09:05 +02:00
30df5f3558 events: fix typo 2019-04-17 00:15:15 +02:00
252dd7e09f utils: indent fixes 2019-04-17 00:15:15 +02:00
2915690d22 utils: use obs_data_t for returned values 2019-04-17 00:15:15 +02:00
1993596232 Requested changes to move the common code to a utils function. 2019-04-17 00:15:15 +02:00
8946e8997f Update WSEvents.cpp
Requested changes.

I swapped "obs_data_set_string(data, "name", itemName.toUtf8());" for scene-item and item-name as otherwise you don't know what scene the item was changed on (studio mode if you change items on a non active scene)
2019-04-17 00:15:15 +02:00
dfeb156da9 Documentation/comment fix 2019-04-17 00:15:15 +02:00
c10c35e38e Forgot to declare the function 2019-04-17 00:15:15 +02:00
67bfdde113 Update WSEvents.cpp
Clone OnSceneItemAdd to a new function to support the `item_transform` signal. Emit as `SourceItemChanged`
2019-04-17 00:15:15 +02:00
c62178a7fe docs(travis): Update protocol.md - c12a432 [skip ci] 2019-04-16 21:14:32 +00:00
c12a4323e7 Merge pull request #279 from derrod/captions
Add caption handler
2019-04-16 23:12:20 +02:00
fd1c4abad7 requests(streaming): conditional compilation of SendCaptions 2019-04-16 22:51:49 +02:00
bd4fe5a1a7 Make "WebSocket" consistent 2019-04-16 15:48:09 +02:00
190f5ebfc4 chore: empty commit to trigger ci again 2019-04-16 14:03:30 +02:00
79493df32e requests(streaming): fix docs on SendCaptions 2019-04-16 13:11:46 +02:00
71d523437e Merge pull request #287 from Lange/4.5.1-types-cleanup
docs(jsdoc): clean up types for compatability with obs-websocket-js typedef generator
2019-03-30 22:08:09 +01:00
268f503875 docs(jsdoc): clean up types for compatability with obs-websocket-js typedef generator 2019-03-30 14:26:58 -05:00
5ac47b823f docs(travis): Update protocol.md - ec572da [skip ci] 2019-03-30 14:36:45 +00:00
ec572da822 docs: update release 2019-03-30 15:35:18 +01:00
37f96b8cf2 chore: bump to 4.6.0 2019-03-30 15:34:06 +01:00
545db60b98 ci: enable/build captions 2019-03-22 10:27:27 +01:00
f65fdcdbc1 handler: Add caption handler 2019-03-22 10:24:25 +01:00
579acabe5e Merge pull request #283 from Palakis/ubuntu-deb-fix
Fix package on Ubuntu
2019-03-22 01:46:22 +01:00
f2a9ff8551 ci(linux): fix Ubuntu package 2019-03-22 01:40:29 +01:00
2e40e07563 Merge pull request #282 from Palakis/azure-pipelines
ci(macos): setup Azure Pipelines
2019-03-21 23:14:16 +01:00
cb3af837c6 readme: fix building.md 2019-03-21 22:36:30 +01:00
3cce89ea3f ci(macos): fix artifacts publishing 2019-03-21 22:28:08 +01:00
5f2dfb24ca ci(macos): checkout submodules 2019-03-21 22:18:29 +01:00
4bc02a7389 ci(macos): install boost 2019-03-21 21:56:07 +01:00
eeeca8afd0 ci(macos): remove set -ev 2019-03-17 15:38:59 +01:00
4f607df5fc ci(macos): fix typo 2019-03-17 15:01:01 +01:00
e06b3e2052 readme: Azure Pipelines CI badge 2019-03-17 14:48:17 +01:00
b14b18e4be ci(macos): setup Azure Pipelines 2019-03-17 14:45:41 +01:00
fb616b4b53 docs: update README and BUILDING 2019-01-04 11:36:38 +01:00
a1c5bc00bc Merge branch 'pragma-once' into 4.x-current 2019-01-01 18:46:38 +01:00
0921632f87 general(headers): replace include guards with "#pragma once" 2019-01-01 18:46:23 +01:00
38ad465233 Merge pull request #266 from Palakis/response-return
Return response in request handlers
2019-01-01 18:23:22 +01:00
881de01073 minor fixes 2019-01-01 18:08:47 +01:00
2d973e0b90 handler: return obs_data_t objects 2019-01-01 17:54:29 +01:00
e9b43b9b2a handler: refactor response passing 2019-01-01 17:25:08 +01:00
b9193989b0 requests(sources): missing return statements 2019-01-01 17:23:58 +01:00
be6d9791f5 Merge pull request #265 from Palakis/websocketpp-4.x
Replace QWebSocketServer with websocket++ in 4.x
2019-01-01 16:35:08 +01:00
baac1b1d80 server: clarifying things 2019-01-01 15:57:29 +01:00
40e2d410dd server: use std::string in broadcast 2019-01-01 05:29:51 +01:00
11617eea99 server: remove useless base64 helper 2019-01-01 05:16:57 +01:00
5748c4d0ec general: fix crash on exit 2019-01-01 05:13:08 +01:00
2e5b903eae events: singleton shared pointer refactor 2019-01-01 05:07:55 +01:00
9405b17e14 config: singleton shared pointer refactor 2019-01-01 05:01:23 +01:00
7d1f0e2a69 server: refactored singleton with QSharedPointer 2019-01-01 04:55:15 +01:00
c245c24752 server: broadcast to authenticated only + use references in handler 2019-01-01 01:18:23 +01:00
5b0410a207 server: per-connection properties 2019-01-01 01:07:50 +01:00
62e4c42aa6 server: stop on unload 2018-12-31 21:29:34 +01:00
fe1b14ff57 server: return refactor 2018-12-31 20:49:15 +01:00
c074088f2f fix appveyor builds 2018-12-31 20:32:24 +01:00
0391280c13 fix build issues 2018-12-31 20:27:52 +01:00
4f98b9e41b general: submodules 2018-12-31 20:23:16 +01:00
a8de9ac472 server: remove validate handler 2018-12-31 17:23:20 +01:00
ec7f3fa057 ci(macos): revert version change 2018-12-31 17:21:29 +01:00
5cfefd8b15 ci(docs): revert change 2018-12-31 17:19:24 +01:00
7e6b53311d import more changes from master 2018-12-31 17:18:07 +01:00
16bc68f2f9 server: import websockets++ server from master 2018-12-31 17:05:23 +01:00
974d6b48b2 chore: 4.5.0 release 2018-12-30 21:02:56 +01:00
db2b1e2dc7 docs(travis): Update protocol.md - 98656b5 [skip ci] 2018-12-30 17:41:58 +00:00
98656b5d2f Merge pull request #263 from Palakis/sceneitem-order
add SetSceneItemOrder from master
2018-12-30 18:40:55 +01:00
3c7570d814 scenes: rename SetSceneItemOrder to ReorderSceneItems + fix item freeing 2018-12-30 14:47:59 +01:00
fc3e30a826 docs(travis): Update protocol.md - 2f0476b [skip ci] 2018-12-30 13:34:11 +00:00
2f0476b43c docs: fix version + plugin name 2018-12-30 14:32:38 +01:00
e310c7d744 move SetSceneItemOrder to Scenes 2018-12-24 18:34:18 +01:00
8a649b89c8 scene items: import reorder method from master 2018-12-24 02:43:58 +01:00
95f52987ef docs(travis): Update protocol.md - 82b8c66 [skip ci] 2018-12-24 01:09:18 +00:00
82b8c66d51 docs: fix branch name in generation script 2018-12-24 02:07:55 +01:00
83fb1843ee Merge pull request #262 from Palakis/sources-methods-without-scene-name
sources: get rid of unnecessary `scene-name` param on Source Request Types
2018-12-24 00:33:19 +01:00
58b10069ab sources: fix issues 2018-12-24 00:10:45 +01:00
9cda739672 sceneitems: fix docs 2018-12-24 00:02:21 +01:00
276bba050b sources: nitpicking 2018-12-23 23:59:30 +01:00
147e49b362 sources + scene items: refactor + get rid of scene-name params 2018-12-23 23:54:25 +01:00
bc338c1f4a Merge pull request #261 from Palakis/freetype2-source-properties
FreeType 2 Sources: Get/Set Properties
2018-12-23 23:04:52 +01:00
e8fbb18a71 sources(ft2): fix docs 2018-12-23 23:00:33 +01:00
682c349831 sources(ft2): simplified qstring compare 2018-12-23 18:30:27 +01:00
14b311f6ab sources(ft2): fix errors 2018-12-23 18:26:57 +01:00
8a40f355c8 sources: fix indents again 2018-12-23 18:21:31 +01:00
ae2f90c5c2 sources: fix indents 2018-12-23 18:20:45 +01:00
7aff773e2c sources: fix ft2 method indents 2018-12-23 18:19:29 +01:00
0cdfa6e7f6 sources: import ft2 methods + fix them 2018-12-23 18:16:44 +01:00
fc637eef6d Merge pull request #254 from Lange/typedefs
docs: improve consistency of array typings; introduce typedefs category
2018-12-07 20:45:30 +01:00
b4c3141170 wip: remove redundant "as object" descriptions 2018-12-05 14:02:25 -06:00
41257f7af5 Merge pull request #249 from PatTheMav/4.x-current
Fix compile error and added dependency check in build script
2018-12-04 14:29:53 -08:00
b204f3ec90 wip: remove extraneous dash 2018-11-28 14:57:59 -06:00
b4926b3535 docs: improve consistency of comment docs; introduce typedefs category 2018-11-27 17:49:54 -06:00
77d63e9848 Added check for already installed packagesbuild 2018-11-08 21:29:39 +01:00
94dcd58c2e Merge pull request #251 from Palakis/auth-without-mbedtls
auth: get rid of mbedtls
2018-11-08 19:01:13 +01:00
689ce16f1b config: use RNG compatible with QT < 5.10 2018-11-08 08:58:26 +01:00
edc64b8336 auth: get rid of mbedtls 2018-11-08 00:52:26 +01:00
03db5bfd8d bugfix(actual): TransitionBegin not triggered after switching scene collections (#250) 2018-11-07 21:13:13 +01:00
9ad340ab02 bugfix: TransitionBegin not emitted after scene collection change (#250) 2018-11-07 13:08:03 +01:00
962e26040d ci(windows): build OBS with VS2015 2018-11-07 00:02:34 +01:00
b07884c1da ci(win): use VS2015 to fix build errors
`constexpr function 'qCountLeadingZeroBits' cannot result in a constant expression`
2018-11-06 23:52:03 +01:00
bad0fb62ed ci(windows): remove hardcoded image 2018-11-06 23:42:06 +01:00
28e522ce97 WSRequestHandler: fix typo 2018-11-06 20:49:33 +01:00
c206cdfa4c chore(release): version bump 2018-11-01 13:22:26 +01:00
c31ec077f5 docs(travis): Update protocol.md - afc6a60 [skip ci] 2018-11-01 12:15:56 +00:00
afc6a60746 Merge pull request #248 from RytoEX/4.3-fix-typos
general: Fix several typos throughout
2018-11-01 13:13:24 +01:00
0a495b67e6 bugfix(requests): register DuplicateSceneItem and DeleteSceneItem 2018-11-01 13:00:07 +01:00
37ea7073d5 general: Fix several typos throughout 2018-11-01 00:42:02 -04:00
feaeef5a70 Merge pull request #246 from PatTheMav/4.4-macOS-build-update
4.4 macOS build system update
2018-10-30 14:58:17 +01:00
5586670d38 Utils: add missing scene item methods 2018-10-30 14:53:48 +01:00
65a9139ffe Fixes Travis builds for macOS
Switching to Xcode 9.4 achieves parity with obs-studio.
Also QT 5.10.1 is not available as a bottle for Sierra
anymore, which leads to Travis building qt from sources.

By enabling output of the qt install step, the "missing
output" timeout in Travis should be fixed as well, once
qt is not available for High Sieera anymore.
2018-10-24 19:39:32 +02:00
3d76f078cd Silenced Homebrew update 2018-10-24 18:57:44 +02:00
a1de1b11bc Fixed Codacy commit check 2018-10-24 18:17:54 +02:00
b5a3e3a4f0 Fixed dependency check for homebrew packages 2018-10-24 16:04:09 +02:00
d7b0ad4916 Removed duplicate code (thanks CodeFactor..) 2018-10-24 15:17:43 +02:00
2a80a6b217 More POSIX sh fixes. 2018-10-24 15:14:50 +02:00
9df72f54d5 Fixed OS check and POSIX sh compatibility 2018-10-24 15:12:54 +02:00
ef75ca36c9 Added missing OS check in packaging script 2018-10-24 14:59:12 +02:00
84c0b698f5 Updated build files for macOS build
* Checks for OS type before executing
* Checks for Homebrew
* Checks for git (obs-studio build phase)
* Checks for cmake (obs-studio build phase)
* Installs/Updates depdencies
* Installs QT 5.10.1 from bottle (just like obs-studio)
* Pins QT so homebrew does not forcefully update it
* Removed wget dependency, uses macOS' curl
* More output
2018-10-24 14:55:17 +02:00
3d9a4ef1e6 cpp: fix build errors 2018-10-23 13:12:51 +02:00
cf51fdceef ci(macos): fix wget install error 2018-10-23 12:56:37 +02:00
85a52ab01f general: convert indents to tabs 2018-10-19 18:22:34 +02:00
f2792c0b40 docs(travis): Update protocol.md - 9710908 [skip ci] 2018-10-19 16:06:06 +00:00
97109087a4 DuplicateSceneItem bug fix
Courtesy of @TStod
2018-10-19 18:04:34 +02:00
953f07f21f new request types for filter management 2018-10-19 18:01:14 +02:00
03f1035690 Merge pull request #241 from caseymrm/patch-1
Add wget to install-dependencies-macos.sh
2018-10-19 17:32:59 +02:00
a561c60f7e Merge pull request #245 from PatTheMav/macos-10.14-qt-fix
CI: Fix QT 5.10 not building under macOS 10.13+
2018-10-19 17:32:19 +02:00
7963b328f9 Applied patches to enable QT 5.10 building 10.13+
Issue: https://github.com/Homebrew/homebrew-core/issues/27095
Applied: https://github.com/Homebrew/formula-patches/pull/237
Applied: https://github.com/Homebrew/homebrew-core/pull/27139
2018-10-18 01:26:00 +02:00
3b7e216409 Merge branch 'macos-qt-fix' into 4.3-maintenance 2018-10-06 12:24:21 +02:00
9ae43a6f75 ci(macos): fix Qt 5.10.0 installation 2018-10-06 12:06:43 +02:00
6b86de1fb9 Add wget to install-dependencies-macos.sh
wget is not installed by default, so when doing the build on a fresh machine, brew install it first
2018-09-27 14:07:14 -07:00
4e6d4ac437 events: fix triggering of PreviewSceneChanged 2018-07-31 11:27:10 +02:00
3b197651cc general: step by one commit to have CI running 2018-07-30 19:17:35 +02:00
c675f1c20c docs(travis): Update protocol.md - e87955d [skip ci] 2018-07-30 17:04:19 +00:00
e87955d59a ci(docs): fix docs deployment 2018-07-30 19:02:29 +02:00
c718d8d803 general: version bump + minor CI fixes 2018-07-30 18:57:24 +02:00
454a68d1b7 Merge pull request #199 from Palakis/4.3-jimtree-studiomode-fix
[not ready] events: fix triggering of PreviewSceneChanged
2018-07-29 17:01:48 +02:00
45f6f74cbe cmake: remove copy operation 2018-07-21 23:05:38 +02:00
cb7412a457 events: fix triggering of PreviewSceneChanged 2018-07-08 12:58:06 +02:00
a9fc82365c TransitionBegin: add source and destination scene names 2018-06-24 22:33:07 +02:00
edc0fed9e2 Merge branch 'transition-override-begin-event' into 4.3-maintenance 2018-06-24 22:20:55 +02:00
1c718963ea TransitionBegin: support for transition overrides 2018-06-24 22:19:45 +02:00
cd40ccdb9d Merge pull request #211 from wherget/build-fixes
MacOS Build fixes
2018-05-27 18:38:39 +02:00
80e1dc2446 Merge pull request #210 from RytoEX/build-instruction-update
Build instruction update
2018-05-27 18:35:07 +02:00
d03c4cc4b9 Merge pull request #219 from christopher-dG/cdg/replaystopping
docs: Fix ReplayStopping description
2018-05-27 18:34:58 +02:00
7bd434e755 ci(macos): get rid of manual Packages versioning 2018-04-28 23:53:47 +02:00
640bcb90c6 CI(macOS): Split off obs-studio build task
Split off the obs-studio build task to help separate CI log sections.
2018-04-28 23:53:42 +02:00
08e86a1378 CI(macOS): Use latest Qt from Homebrew
OBS Studio CI currently uses the latest Qt version in Homebrew.
2018-04-28 23:53:36 +02:00
fefcc3937a CI(macOS): Update Packages version
Update Packages to version 1.2.3, which released on April 7, 2018.
2018-04-28 23:53:28 +02:00
25210dfa52 CI and CMake improvements (#205)
* CMake: Copy PDB file to OBS build directory on Debug build

All native OBS build objects also bundle the associated PDB file for
debugging and handling crash reports.

* CMake: Add post-build commands for RelWithDebInfo

Add post-build commands for the RelWithDebInfo build config. OBS
official builds use RelWithDebInfo, so we should be able to treat it as
a release config.

* CI: Disable building OBS native plugins

Use the OBS CMake flag DISABLE_PLUGINS to disable building plugins
included with OBS (including submodule plugins like obs-browser). This
should speed up builds on Windows when we have to rebuild OBS and on
Mac.

* CI: Don't clone/update OBS submodules

The only submodules presently in OBS are in its plugins, which we don't
need to build.

* CI: Use obsproject/obs-studio instead of jp9000/obs-studio

The OBS GitHub recently changed from jp9000/obs-studio to
obsproject/obs-studio, so use that instead.

* CI: Build as RelWithDebInfo instead of Release

OBS official builds are produced with RelWithDebInfo. This will produce
a PDB file for the plugin, similar to the native OBS plugins.

* CI(Windows): Build OBS if current build config doesn't exist

If OBS libs for the current build config do not exist, build OBS before
building obs-websocket.
2018-03-26 11:12:39 +02:00
56fbb7b9cf CI(Windows): Build OBS with Visual Studio 2017
We should also build OBS with Visual Studio 2017.
2018-03-26 11:12:19 +02:00
c55d33b956 CI(Windows): Use Visual Studio 2017
Official OBS releases have switched to Visual Studio 2017. There is no
32-bit Qt 5.10.1 package for Visual Studio 2017, but the Visual Studio
2015 package is compatible.
2018-03-26 11:11:18 +02:00
0c5bce101e CI(linux): forgot to install checkinstall 2018-03-20 14:27:04 +01:00
0a50e2a95c ci(linux): use OBS dev deps from PPA release 2018-03-20 14:11:33 +01:00
5ad940924b CI(windows): build installer
ci(windows): escape path


ci(windows): add inno setup compiler to PATH


ci(windows): fix installer.iss path
2018-03-19 02:36:24 +01:00
6eb49930bf general: version bump to 4.3.3 2018-03-19 01:11:35 +01:00
3a0d5fb190 CI: let's try with VS2015 instead 2018-03-18 23:25:38 +01:00
8c2eee2e25 CI: update Windows builds to VS2017 and Qt 5.10.1 2018-03-18 23:25:31 +01:00
2e19c5f08a docs: update version 2018-03-14 23:03:14 +01:00
548b53437f general: version bump to 4.3.2 2018-03-14 22:58:53 +01:00
e1ca9a8029 notifications: check if system tray is available before notifying 2018-03-14 22:26:08 +01:00
389ef2aea9 Config: remove flawed qstring_data_copy and add toUtf8() macro 2018-03-14 22:26:00 +01:00
357691bad5 CI: bump to latest OBS version 2018-01-22 23:24:09 +01:00
beadb56b05 general: update version to 4.3.1 2018-01-22 23:13:27 +01:00
745fb5ea29 Merge branch 'scenecol-crash-fix' 2018-01-22 23:11:24 +01:00
58434cac3b events: fix crash on exit 2018-01-22 23:10:33 +01:00
c34dff17ff events: fix crash when switching between scene collections 2018-01-22 23:03:20 +01:00
73f00ca195 CI: update Packages version 2018-01-12 11:13:16 +01:00
40503b4212 docs(travis): Update protocol.md - 4ada388 [skip ci] 2018-01-12 08:28:38 +00:00
4ada388828 general: version bump 2018-01-12 09:25:41 +01:00
e2d261259d docs(travis): Update protocol.md - 677e393 [skip ci] 2018-01-12 08:20:52 +00:00
677e393f47 Add support for filename formatting get/set (#162) 2018-01-12 09:18:58 +01:00
e5dae8f5a7 UI: update translations from Crowdin 2018-01-12 08:54:12 +01:00
650de119a4 general: New Crowdin translations (#171) 2018-01-04 08:31:45 +01:00
6d7975afeb requests: Create folder for 'SetRecordingFolder' if it does not exist (#163) 2017-12-16 16:49:38 +01:00
811e3f8cc8 Update Crowdin configuration file 2017-11-14 10:09:14 +01:00
4f3be34db1 ui: update translations from Crowdin 2017-11-14 10:01:04 +01:00
b160fd2320 docs: update README and BUILDING documents 2017-11-14 09:44:24 +01:00
002bf08b97 docs(travis): Update protocol.md - a6bab96 [skip ci] 2017-11-14 08:24:23 +00:00
a6bab968f5 requests: Get/Set local file path in BrowserSource settings 2017-11-14 09:21:58 +01:00
408b336057 docs(travis): Update protocol.md - 7e57161 [skip ci] 2017-11-14 08:15:34 +00:00
7e5716185e code: reorder and refactor WSRequestHandlers 2017-11-14 09:14:33 +01:00
6d47bd6477 Merge pull request #159 from haganbmj/docs-safety
docs: fail CI build if documentation is invalid
2017-11-14 07:17:44 +01:00
989c8b1857 docs: fail CI build if documentation is invalid 2017-11-13 23:25:54 -05:00
06e9e0afab docs(travis): Update protocol.md - d75523c [skip ci] 2017-11-13 19:37:48 +00:00
d75523c111 Merge pull request #157 from haganbmj/patch-2
docs: update glob to account for relocation to src
2017-11-13 20:36:47 +01:00
dacec803c6 docs: Fix documentation failure 2017-11-13 13:57:42 -05:00
0ae4416242 docs: mustache helper safety check 2017-11-13 13:50:56 -05:00
079d7eb6ca docs(travis): Update protocol.md - b764b4d [skip ci] 2017-11-13 16:58:21 +00:00
b764b4d0e5 code: split WSRequestHandler into several code/compile units 2017-11-13 17:56:58 +01:00
2c2d61d908 docs(travis): Update protocol.md - 6a323b9 [skip ci] 2017-11-13 16:18:44 +00:00
6a323b9371 code: move code units to src/ 2017-11-13 17:17:34 +01:00
d76ff16162 ui: show a warning message when server can't bind to configured port 2017-11-13 16:39:32 +01:00
952f3a586a server: refactor connect/disconnect popup messages localization 2017-11-13 15:56:46 +01:00
3ecb9702ef docs(travis): Update protocol.md - 563936e [skip ci] 2017-11-13 14:03:18 +00:00
563936ea08 requests: add GetSourceTypesList 2017-11-13 15:01:41 +01:00
13cd2704ae Revert "docs: bump to 4.2.1 release"
This reverts commit ae83d9dca1.
2017-11-13 08:59:54 +01:00
ae83d9dca1 docs: bump to 4.2.1 release 2017-11-13 08:58:00 +01:00
66a059ecdf Automatic function-scope OBS _release() + refactor to camelCase (#149)
- Refactor all internal variables to camelCase
- Use obs pointers with *AutoRelease classes for automatic refcounting
    - Important: some pointers require prior investigation to determine if refcounting is needed, or which 
      between OBSRef and *AutoRelease should be used.
2017-11-13 08:44:26 +01:00
53936a4f76 request handler: use static request QHash
Inspired by @yinzara's fork
2017-11-06 13:03:05 +01:00
488a095fdf ci(macos): fix broken Packages installation 2017-11-06 12:34:47 +01:00
1878de9f6b docs(travis): Update protocol.md - 2a2f344 [skip ci] 2017-11-06 09:55:25 +00:00
2a2f3441ef requests: don't persist stream settings in StartStreaming 2017-11-06 10:53:05 +01:00
53c939a97f Merge pull request #146 from RytoEX/fix-ci
Fix CI builds on Windows and Linux
2017-10-28 18:13:20 +02:00
8d7ed32fc2 Windows CI: Build with Qt 5.7.1 if Qt 5.7.0 is unavailable 2017-10-28 00:29:48 -04:00
a1fa5dc3cb Windows CI: Only build obs-studio if not cached
Run a series of checks to determine if CI needs to build obs-studio
before trying to build obs-websocket.
2017-10-28 00:28:47 -04:00
4b9a84ccee docs(travis): Update protocol.md - 650957b [skip ci] 2017-10-27 21:10:39 +00:00
650957b6d1 Merge pull request #151 from haganbmj/patch-1
docs: correct GetSceneItemProperties name
2017-10-27 23:09:32 +02:00
6e21d041fe docs: correct GetSceneItemProperties name
Fixes #150
2017-10-27 12:45:29 -04:00
e2b70fd795 docs: realign comments 2017-10-27 15:51:23 +02:00
2d49bcc437 docs(travis): Update protocol.md - 8b3dce3 [skip ci] 2017-10-27 12:32:25 +00:00
8b3dce3256 requests: add GetSourcesList 2017-10-27 14:29:58 +02:00
8cf6a1e72c SetSourceSettings: fix oops 2017-10-27 14:29:41 +02:00
a3ce7197ac docs(travis): Update protocol.md - 5da1e55 [skip ci] 2017-10-27 12:27:53 +00:00
5da1e55f8e docs: Fix new requests names 2017-10-27 14:27:00 +02:00
661fd4efa8 docs(travis): Update protocol.md - 047e6e1 [skip ci] 2017-10-27 12:21:14 +00:00
047e6e11bf Merge remote-tracking branch 'origin/master' 2017-10-27 14:19:33 +02:00
db8bc1af2d requests: add GetSourceSettings and SetSourceSettings 2017-10-27 14:18:45 +02:00
1386e4f91c docs(travis): Update protocol.md - 11e2717 [skip ci] 2017-10-27 08:39:02 +00:00
11e2717809 docs(travis): Update protocol.md - 57bc0a2 2017-10-27 10:37:30 +02:00
57bc0a2b95 Merge pull request #136 from TStod/tstod/SceneItemGetter
[Safe For Merge] Unified Setter and Getter for scene specific source properties
2017-10-27 10:31:50 +02:00
8efb30c4ee Merge pull request #148 from haganbmj/docs-deprecated
docs: Add deprecated attribute
2017-10-27 10:31:16 +02:00
969feefcc5 Merge remote-tracking branch 'origin/master' 2017-10-27 10:25:07 +02:00
db1527ab9b StartStreaming: add missing comment 2017-10-27 10:24:58 +02:00
e88a60fa50 docs(travis): Update protocol.md - 7ab3e38 [skip ci] 2017-10-27 08:21:09 +00:00
7ab3e38da7 StartStreaming: fix request docs + code clean 2017-10-27 10:19:27 +02:00
7b0b836809 requests: continued refactor of Get/Set/Save/Start stream settings 2017-10-27 10:03:22 +02:00
c8e7cfcd7b requests: Refactor Get/SetStreamSettings code 2017-10-27 09:10:04 +02:00
c516c89c97 docs: Add deprecated attribute 2017-10-25 11:59:14 -05:00
c2937d7857 replay buffer: start without "Save" hotkey set 2017-10-25 18:29:42 +02:00
fe644cfa82 Merge pull request #142 from RytoEX/save-replay-buffer
Fix saving replay buffer when no hotkey is set
2017-10-25 09:46:28 +02:00
e84e5388a5 fixing scale data get in setter 2017-10-24 11:54:21 -04:00
5e11d0ea13 general: style fixes + change request handler lookup 2017-10-24 17:16:06 +02:00
a3ecb6e0e9 adding missing scale setter in setter 2017-10-24 02:16:39 -04:00
1d30f13fd8 adding error response object method 2017-10-23 12:04:43 -04:00
b9ae28483c adding error messages 2017-10-23 11:34:29 -04:00
6a6d316e09 ci(linux + win): bump to latest OBS version 2017-10-22 00:01:44 +02:00
22d2ee6bbd Merge pull request #141 from PicoCentauri/master
macOS CI: Updated dependencies and namespaces
2017-10-21 23:57:41 +02:00
68e55613fc macOS CI: Updated dependencies and namespaces
Following the discussion of #105 the Qt version in the dependency
installation is now hardcoded to version 5.9.2, which is the same as the
main obs version for 20.1.0. Furthermore the names are changed from
osx to MacOS.
2017-10-19 17:32:58 +02:00
1d44d3a109 Fix saving replay buffer when no hotkey is set
This commit makes saving the replay buffer not rely on whether or not a
hotkey is set in OBS.
2017-10-19 05:34:39 -04:00
11a641cc0d replay buffer: update for Advanced output mode 2017-10-19 10:09:00 +02:00
7570fbf7a4 strings to ENUM strings 2017-10-17 19:07:40 -04:00
67f7e28867 fixing bounds type setter 2017-10-16 12:29:49 -04:00
9b2d30b4d5 switch string to ifelseif 2017-10-16 12:17:29 -04:00
399815525f wrapping up setter and getter 2017-10-16 12:01:41 -04:00
191cfa08d5 server: Refactor mutex lock handling 2017-10-16 15:29:23 +02:00
fcf1fa8aff studio mode: Remove parts of Qt UI hacks 2017-10-16 15:28:54 +02:00
73302cb060 docs(travis): Update protocol.md - 70a8533 [skip ci] 2017-10-16 11:13:41 +00:00
70a8533f5e docs(requests): fix SetStreamSettings 2017-10-16 13:12:49 +02:00
fe724db12d removing copy paste error 2017-10-15 17:28:07 -04:00
096a8ec6ba wip on setter and getter 2017-10-15 14:21:45 -04:00
cc5f9c9aa7 refining bounds and adding scale to setter 2017-10-15 11:57:21 -04:00
3e14b41600 ands to ors 2017-10-14 16:44:02 -04:00
ccc2bd8667 trying to fix duplicate case statment error 2017-10-14 16:35:36 -04:00
45f86b17f1 more WIP on setter 2017-10-14 15:18:06 -04:00
90aebecc5b small fixes 2017-10-14 14:36:23 -04:00
b0170ef671 more WIP on setter 2017-10-14 13:10:40 -04:00
d418b4e624 fixing methods for getting inner object keys 2017-10-11 12:07:33 -04:00
47505547af fixing some types 2017-10-11 11:51:05 -04:00
de2e73c9d4 WIP setter and fixing small typo 2017-10-10 21:14:27 -04:00
ab1a43163b early return on bad param 2017-10-04 13:26:15 -04:00
2556dd320f fixing bounds alignemnt getter 2017-10-04 13:05:01 -04:00
2120381c0e correnting method name 2017-10-04 12:48:40 -04:00
dc06900f7f another typo 2017-10-04 12:44:07 -04:00
7571dd5042 fixing typo 2017-10-04 12:13:52 -04:00
d6caa872b8 WIP some small fixes 2017-10-04 02:06:38 -04:00
2e9829ddd1 WIP questions to be answered 2017-10-04 00:51:16 -04:00
9621ea90f7 more WIP 2017-10-03 20:30:51 -04:00
f58da1254b wip 2017-10-03 20:23:55 -04:00
a6ba7f8feb docs(travis): Update protocol.md - 9c89f12 [skip ci] 2017-10-02 07:08:16 +00:00
9c89f12275 docs: fix spec version links 2017-10-02 09:07:17 +02:00
41181f7260 docs(travis): Update protocol.md - 7251862 [skip ci] 2017-09-26 09:21:30 +00:00
7251862ecf Merge pull request #124 from haganbmj/patch-2
docs: HandleSetHeartbeat -> SetHeartbeat
2017-09-26 11:19:15 +02:00
c0512d5b5f docs: HandleSetHeartbeat -> SetHeartbeat 2017-09-25 11:32:34 -05:00
b9731dff21 docs(travis): Update protocol.md - 3981abc [skip ci] 2017-09-25 14:50:02 +00:00
3981abc5ca General: code and docs cleanup 2017-09-25 16:48:46 +02:00
6aef437f58 UI: update French localization 2017-09-25 16:29:50 +02:00
9b7752896a Adding Heartbeat to obs-websocket. (#112)
* Added a Heartbeat in WSEvents (.cpp and .h updated)
Lines where the coded is added are marked with "//mod-0x =============" (x denotes a number).

* Updated the Heartbeat:
- Default it is off, and via JSON request can be switched on.
- The Heartbeat has configurable elements. Each individual element can be requested via a JSON request to be added to the Heartbeat.
- Maximum elements are in this example JSON update:
{
    "current-profile": "#2-PGH",
    "current-scene": "#2-HG",
    "pulse": true,
    "recording": false,
    "streaming": false,
    "total-record-time": 0,
    "total-stream-time": 0,
    "update-type": "Heartbeat"
}

* Cleaning

* Process all Palakis his comment/advice, and added 3 key/value pairs.

* Processed cleaning up comments as proposed by Stephane.

* Still found tabs in the comment header, and replaced by spaces.

* FUNCTIONAL MODIFICATION:
- Removed selective content of Heartbeat, and show all key/value parameters.
- Only request left is "on" or "off" selection of heartbeat.
FIX:
- Show streaming/recording related data only when streaming/recording is active, due to OBS showing wrong values when not active.

* Changed request type to start the Heartbeat to a boolean parameter.

* Delete ZERO_CHECK.log

* Delete obs-websocket_autogen.log

* Delete obs-websocket.log
2017-09-24 22:54:29 +02:00
d074027610 Merge pull request #121 from haganbmj/toggle-notifications
general(notifications): Toggle tray notifications/alerts (Closes #120)
2017-09-24 22:53:41 +02:00
b137148186 general(notifications): Toggle tray notifications/alerts
Closes #120
2017-09-12 10:41:35 -05:00
e1f6260034 docs(travis): Update protocol.md - b24cbaa [skip ci] 2017-09-08 20:14:45 +00:00
b24cbaa904 General: version bump to 4.2.1 2017-09-08 22:13:58 +02:00
cc0b110d61 Utils: style nitpick 2017-09-08 21:54:40 +02:00
82a1e7d253 docs(travis): Update protocol.md - 87b4768 [skip ci] 2017-09-08 19:43:16 +00:00
87b47689eb Docs: more specific version number + tag unreleased methods/events 2017-09-08 21:42:13 +02:00
c3346f9192 Notifications: correct IP address formatting 2017-09-08 00:23:17 +02:00
3b0cf02574 Server: QThread wasn't actually used... 2017-09-08 00:01:26 +02:00
4404889019 Merge pull request #117 from haganbmj/docs-since
docs: Add @since
2017-09-01 14:07:20 +02:00
4e642d97fc docs: Add @since 2017-08-26 16:25:17 -04:00
44bd25646d docs(travis): Update protocol.md - 09b0403 [skip ci] 2017-08-24 18:28:28 +00:00
09b04037a0 Merge pull request #114 from haganbmj/patch-1
Update api doc for SwitchScenes
2017-08-24 20:27:18 +02:00
3c50e1e4d8 Update api doc for SwitchScenes 2017-08-24 10:18:00 -05:00
179ba9a9e6 docs(travis): Update protocol.md - 9ce2b19 [skip ci] 2017-08-19 13:06:57 +00:00
9ce2b1983a Protocol: add Replay Buffer Events and Requests (#104) 2017-08-19 15:05:42 +02:00
37dde278cb CI: updated name hack 2017-08-19 12:29:12 +02:00
1cc57e7d1d CI: hack to show "build names" in Travis 2017-08-19 12:26:23 +02:00
60a5cdb154 docs(travis): Update protocol.md - f290cbc [skip ci] 2017-08-19 10:17:09 +00:00
f290cbc148 Docs: update introduction with other versions 2017-08-19 12:15:57 +02:00
2e2e9b1332 Code: small style fixes 2017-08-19 11:40:42 +02:00
7915e3815b CMake on Windows: copy debug binaries to obs dev folder for testing 2017-08-19 11:40:25 +02:00
beb34deed8 docs(travis): Update protocol.md - a263d8a [skip ci] 2017-08-13 15:42:56 +00:00
a263d8a364 Docs: Initial generation of docs from code comments (#106) 2017-08-13 17:41:42 +02:00
1eccf4c899 Readme: update libraries and contributors 2017-08-12 22:11:06 +02:00
d8d19d839a CI: add branch exclusion for gh-pages 2017-08-12 17:48:23 +02:00
17e573d67f Merge pull request #109 from dragonbane0/request-types-sync-offset
Add request types: SetSyncOffset and GetSyncOffset
2017-08-12 14:51:26 +02:00
59de83b45d Update Protocol.md with the new request types
Added SetSyncOffset and GetSyncOffset to the documentation
2017-08-07 16:02:09 +02:00
712bd6e8f3 Fix if statement
Add missing closing bracket and use !source_name instead of source_name == NULL
2017-08-07 15:34:43 +02:00
75b21d070a Fix spacing 2017-08-07 02:34:54 +02:00
e91c9e7bf4 Fixed spacing 2017-08-07 02:34:20 +02:00
2562272775 Added new request types: SetSyncOffset and GetSyncOffset 2017-08-07 02:19:09 +02:00
819621e307 macOS CI: fix dynlink paths 2017-08-06 22:59:44 +02:00
4b9229311c macOS CI: oops, forgot to update some lines 2017-08-06 22:46:30 +02:00
4c4c1de190 macOS CI: "brew versions" command doesn't work 2017-08-06 22:35:16 +02:00
6b6b7feff2 macOS CI: properly use Qt from Homebrew 2017-08-06 22:28:07 +02:00
9e3ce26ba0 Revert "macOS CI: install qt5 from Homebrew's index"
This reverts commit ee1486274d.
2017-08-06 22:12:36 +02:00
eac19a7c83 Logging: log Qt versions at startup 2017-08-06 21:50:25 +02:00
ee1486274d macOS CI: install qt5 from Homebrew's index 2017-08-06 21:45:24 +02:00
8692e2afda CI: OBS version bump 2017-08-06 07:12:04 +02:00
f995268444 macOS CI: symlink paths were wrong, again 2017-08-06 07:11:03 +02:00
bd2e974718 macOS CI: fix symlink paths 2017-08-06 06:56:00 +02:00
d1c64c7509 macOS CI: more debug statements 2017-08-06 06:30:00 +02:00
30a19cfe8a macOS CI: add debug statements for rpath fix 2017-08-06 06:22:24 +02:00
cc3097b09a GetVersion: add claryfying comment 2017-08-06 05:12:30 +02:00
c00681b52d Protocol: remove useless API version field 2017-08-06 05:10:14 +02:00
61931c179f Protocol: update GetVersion with list of available request types 2017-08-06 00:09:44 +02:00
c7190cb94a Events: add transition info to TransitionBegin 2017-08-05 22:17:13 +02:00
a1bd27dfde Server: fix refactoring mistake 2017-08-05 19:16:30 +02:00
6ac3a3de57 Protocol: add ResetSceneItem for resetting source items (#108)
Use case: Reset media sources for recovery of timed-out input streams.
2017-08-05 19:11:01 +02:00
e198ed7a9c GitHub: update issue template 2017-08-05 18:50:03 +02:00
4b89464349 General: refactor continued again 2017-08-05 18:26:14 +02:00
dba599c127 General: refactor continued 2017-08-05 03:21:28 +02:00
586f9076f0 General: code style refactor 2017-08-05 03:14:07 +02:00
add39cfc5f General: version bump 2017-07-10 14:23:13 +02:00
159 changed files with 32360 additions and 6315 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
[*]
insert_final_newline = true
[*.{c,cpp,h,hpp}]
indent_style = tab
indent_size = 4
[*.{yml,yaml}]
indent_style = space
indent_size = 2

View File

@ -1,22 +0,0 @@
## Contributing to obs-websocket
### Translating obs-websocket to your language
Localization happens on Crowdin: https://crowdin.com/project/obs-websocket
### Writing code for obs-websocket
#### Coding Guidelines
- Function and variable names: snake_case for C names, CamelCase for C++ names
- Tabs are 8 columns wide
- 80 columns max.
#### Commit Guidelines
- Commits follow the 50/72 standard:
- 50 characters max for the title
- One empty line after the title
- Description wrapped to 72 columns max per line.
- Commit titles:
- Use present tense
- Prefix the title with a "scope" name
- e.g: "CI: fix wrong behaviour when packaging for OS X"
- Typical scopes: CI, General, Request, Event, Server
- Look at existing commits for more examples

3
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,3 @@
open_collective: obs-websocket
github: Palakis
custom: https://www.paypal.me/stephanelepin

View File

@ -1,18 +1,20 @@
#### Issue type ##### Issue type
- [ ] Bug <!--- Uncomment one of the two options below. -->
- [ ] Feature request
- [ ] Other
#### Description <!--- - Bug report -->
*Replace this with a description of the bug encountered or feature requested.* <!--- - Feature request -->
#### Steps to reproduce ##### Description
*If it's a bug, please describe the steps to reproduce it. Otherwise, remove this section.* <!--- Describe the bug encountered or feature requested. -->
#### Technical information ##### Steps to reproduce and other useful info
<!--- If it's a bug, please describe the steps to reproduce it and PLEASE include an OBS log file. Otherwise, remove this section. -->
##### Technical information
- **Operating System** : - **Operating System** :
- **OBS Studio version** : - **OBS Studio version** :
- **obs-websocket version** :
#### Development Environment ##### Development Environment
*If you're trying to compile obs-websocket, please describe your compiler type and version (e.g: GCC 4.7, VC2013, ...), and the CMake settings used. <!--- If you're trying to compile obs-websocket, please describe your compiler type and version (e.g: GCC 4.7, VC2013, ...), and the CMake settings used. -->
Remove this section if it doesn't apply to your case.* <!--- Remove this section if it does not apply. -->

79
.github/actions/build-plugin/action.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: 'Setup and build plugin'
description: 'Builds the plugin for specified architecture and build config.'
inputs:
target:
description: 'Build target for dependencies'
required: true
config:
description: 'Build configuration'
required: false
default: 'Release'
codesign:
description: 'Enable codesigning (macOS only)'
required: false
default: 'false'
codesignIdent:
description: 'Developer ID for application codesigning (macOS only)'
required: false
default: '-'
visualStudio:
description: 'Visual Studio version (Windows only)'
required: false
default: 'Visual Studio 16 2019'
workingDirectory:
description: 'Working directory for packaging'
required: false
default: ${{ github.workspace }}
runs:
using: 'composite'
steps:
- name: Run macOS Build
if: ${{ runner.os == 'macOS' }}
shell: zsh {0}
env:
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
run: |
echo "CODESIGN_IDENT=$(echo $CODESIGN_IDENT)" >> $GITHUB_ENV
build_args=(
-c ${{ inputs.config }}
-t macos-${{ inputs.target }}
)
if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(-s)
if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
${{ inputs.workingDirectory }}/.github/scripts/build-macos.zsh ${build_args}
- name: Run Linux Build
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
build_args=(
-c ${{ inputs.config }}
-t linux-${{ inputs.target }}
)
if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
build_args+=(--debug)
fi
${{ inputs.workingDirectory }}/.github/scripts/build-linux.sh "${build_args[@]}"
- name: Run Windows Build
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
$BuildArgs = @{
Target = '${{ inputs.target }}'
Configuration = '${{ inputs.config }}'
CMakeGenerator = '${{ inputs.visualStudio }}'
}
if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
$BuildArgs += @{
Debug = $true
}
}
${{ inputs.workingDirectory }}/.github/scripts/Build-Windows.ps1 @BuildArgs

View File

@ -0,0 +1,99 @@
name: 'Package plugin'
description: 'Packages the plugin for specified architecture and build config.'
inputs:
target:
description: 'Build target for dependencies'
required: true
config:
description: 'Build configuration'
required: false
default: 'Release'
codesign:
description: 'Enable codesigning (macOS only)'
required: false
default: 'false'
notarize:
description: 'Enable notarization (macOS only)'
required: false
default: 'false'
codesignIdent:
description: 'Developer ID for application codesigning (macOS only)'
required: false
default: '-'
installerIdent:
description: 'Developer ID for installer package codesigning (macOS only)'
required: false
default: ''
codesignUser:
description: 'Apple ID username for notarization (macOS only)'
required: false
default: ''
codesignPass:
description: 'Apple ID password for notarization (macOS only)'
required: false
default: ''
createInstaller:
description: 'Create InnoSetup installer (Windows only)'
required: false
default: 'false'
workingDirectory:
description: 'Working directory for packaging'
required: false
default: ${{ github.workspace }}
runs:
using: 'composite'
steps:
- name: Run macOS packaging
if: ${{ runner.os == 'macOS' }}
shell: zsh {0}
env:
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
run: |
package_args=(
-c ${{ inputs.config }}
-t macos-${{ inputs.target }}
)
if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(-s)
if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(-n)
if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
${{ inputs.workingDirectory }}/.github/scripts/package-macos.zsh ${package_args}
- name: Run Linux packaging
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
package_args=(
-c ${{ inputs.config }}
-t linux-${{ inputs.target }}
)
if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
build_args+=(--debug)
fi
${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh "${package_args[@]}"
- name: Run Windows packaging
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
$PackageArgs = @{
Target = '${{ inputs.target }}'
Configuration = '${{ inputs.config }}'
}
if ( '${{ inputs.createInstaller }}' -eq 'true' ) {
$PackageArgs += @{BuildInstaller = $true}
}
if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
$BuildArgs += @{
Debug = $true
}
}
${{ inputs.workingDirectory }}/.github/scripts/Package-Windows.ps1 @PackageArgs

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

35
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,35 @@
<!--- Please fill out the following template, which will help other contributors review your Pull Request. -->
<!--- Make sure youve read the contribution guidelines here: https://github.com/Palakis/obs-websocket/blob/4.x-current/CONTRIBUTING.md -->
### Description
<!--- Describe your changes. -->
### Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes/closes an open issue or implements feature request, -->
<!--- please link to the issue here. -->
### How Has This Been Tested?
<!--- Please describe in detail how you tested your changes, along with the OS(s) you tested with. -->
Tested OS(s):
### Types of changes
<!--- What types of changes does your PR introduce? Uncomment all that apply -->
<!--- - Bug fix (non-breaking change which fixes an issue) -->
<!--- - New request/event (non-breaking) -->
<!--- - Documentation change (a change to documentation pages) -->
<!--- - Enhancement (modification to a current event/request which adds functionality) -->
<!--- - Performance enhancement (non-breaking change which improves efficiency) -->
<!--- - Code cleanup (non-breaking change which makes code smaller or more readable) -->
### Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have read the [**contributing** document](https://github.com/Palakis/obs-websocket/blob/4.x-current/CONTRIBUTING.md).
- [ ] My code is not on the master branch.
- [ ] The code has been tested.
- [ ] All commit messages are properly formatted and commits squashed where appropriate.
- [ ] I have included updates to all appropriate documentation.

9
.github/scripts/.Aptfile vendored Normal file
View File

@ -0,0 +1,9 @@
package 'cmake'
package 'ccache'
package 'curl'
package 'git'
package 'jq'
package 'ninja-build', bin: 'ninja'
package 'pkg-config'
package 'clang'
package 'clang-format-13'

6
.github/scripts/.Brewfile vendored Normal file
View File

@ -0,0 +1,6 @@
brew "ccache"
brew "coreutils"
brew "cmake"
brew "git"
brew "jq"
brew "ninja"

3
.github/scripts/.Wingetfile vendored Normal file
View File

@ -0,0 +1,3 @@
package '7zip.7zip', path: '7-zip', bin: '7z'
package 'cmake', path: 'Cmake\bin', bin: 'cmake'
package 'innosetup', path: 'Inno Setup 6', bin: 'iscc'

245
.github/scripts/.build.zsh vendored Executable file
View File

@ -0,0 +1,245 @@
#!/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}${funcstack[1]##*/}:%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
_trap_error() {
print -u2 -PR '%F{1} ✖︎ script execution error%f'
print -PR -e "
Callstack:
${(j:\n :)funcfiletrace}
"
exit 2
}
build() {
if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]}
local target="${host_os}-${CPUTYPE}"
local project_root=${SCRIPT_HOME:A:h:h}
local buildspec_file="${project_root}/buildspec.json"
trap '_trap_error' ZERR
fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
autoload -Uz log_info log_error log_output set_loglevel check_${host_os} setup_${host_os} setup_obs setup_ccache
if [[ ! -r ${buildspec_file} ]] {
log_error \
'No buildspec.json found. Please create a build specification for your project.' \
'A buildspec.json.template file is provided in the repository to get you started.'
return 2
}
typeset -g -a skips=()
local -i _verbosity=1
local -r _version='1.0.0'
local -r -a _valid_targets=(
macos-x86_64
macos-arm64
macos-universal
linux-x86_64
)
local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
if [[ ${host_os} == 'macos' ]] {
local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles')
} else {
local -r -a _valid_generators=(Ninja 'Unix Makefiles')
}
local generator='Ninja'
local -r _usage="
Usage: %B${functrace[1]%:*}%b <option> [<options>]
%BOptions%b:
%F{yellow} Build configuration options%f
-----------------------------------------------------------------------------
%B-t | --target%b Specify target - default: %B%F{green}${host_os}-${CPUTYPE}%f%b
%B-c | --config%b Build configuration - default: %B%F{green}RelWithDebInfo%f%b
%B-s | --codesign%b Enable codesigning (macOS only)
%B--generator%b Specify build system to generate - default: %B%F{green}Ninja%f%b
Available generators:
- Ninja
- Unix Makefiles
- Xcode (macOS only)
%F{yellow} Output options%f
-----------------------------------------------------------------------------
%B-q | --quiet%b Quiet (error output only)
%B-v | --verbose%b Verbose (more detailed output)
%B--skip-[all|build|deps|unpack]%b Skip all|building OBS|checking for dependencies|unpacking dependencies
%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} {
-t|--target|-c|--config|--generator)
if (( # == 1 )) || [[ ${2:0:1} == '-' ]] {
log_error "Missing value for option %B${1}%b"
log_output ${_usage}
exit 2
}
;;
}
case ${1} {
--)
shift
args+=($@)
break
;;
-t|--target)
if (( ! ${_valid_targets[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
target=${2}
shift 2
;;
-c|--config)
if (( ! ${_valid_configs[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
BUILD_CONFIG=${2}
shift 2
;;
-s|--codesign) CODESIGN=1; shift ;;
-q|--quiet) (( _verbosity -= 1 )) || true; shift ;;
-v|--verbose) (( _verbosity += 1 )); shift ;;
-h|--help) log_output ${_usage}; exit 0 ;;
-V|--version) print -Pr "${_version}"; exit 0 ;;
--debug) _verbosity=3; shift ;;
--generator)
if (( ! ${_valid_generators[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
generator=${2}
shift 2
;;
--skip-*)
local _skip="${${(s:-:)1}[-1]}"
local _check=(all deps unpack build)
(( ${_check[(Ie)${_skip}]} )) || log_warning "Invalid skip mode %B${_skip}%b supplied"
typeset -g -a skips=(${skips} ${_skip})
shift
;;
*) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
}
}
set -- ${(@)args}
set_loglevel ${_verbosity}
check_${host_os}
setup_ccache
typeset -g QT_VERSION
typeset -g DEPLOYMENT_TARGET
typeset -g OBS_DEPS_VERSION
setup_${host_os}
local product_name
local product_version
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
case ${host_os} {
macos)
sed -i '' \
"s/project(\(.*\) VERSION \(.*\))/project(${product_name} VERSION ${product_version})/" \
"${project_root}/CMakeLists.txt"
;;
linux)
sed -i'' \
"s/project(\(.*\) VERSION \(.*\))/project(${product_name} VERSION ${product_version})/"\
"${project_root}/CMakeLists.txt"
;;
}
setup_obs
pushd ${project_root}
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)build]}) )) {
log_info "Configuring ${product_name}..."
local _plugin_deps="${project_root:h}/obs-build-dependencies/plugin-deps-${OBS_DEPS_VERSION}-qt${QT_VERSION}-${target##*-}"
local -a cmake_args=(
-DCMAKE_BUILD_TYPE=${BUILD_CONFIG:-RelWithDebInfo}
-DQT_VERSION=${QT_VERSION}
-DCMAKE_PREFIX_PATH="${_plugin_deps}"
)
if (( _loglevel == 0 )) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR)
if (( _logLevel > 2 )) cmake_args+=(--debug-output)
local num_procs
case ${target} {
macos-*)
autoload -Uz read_codesign
if (( ${+CODESIGN} )) {
read_codesign
}
cmake_args+=(
-DCMAKE_FRAMEWORK_PATH="${_plugin_deps}/Frameworks"
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DOBS_CODESIGN_LINKER=ON
-DOBS_BUNDLE_CODESIGN_IDENTITY="${CODESIGN_IDENT:--}"
)
num_procs=$(( $(sysctl -n hw.ncpu) + 1 ))
;;
linux-*)
if (( ${+CI} )) {
cmake_args+=(-DCMAKE_INSTALL_PREFIX=/usr)
}
num_procs=$(( $(nproc) + 1 ))
;;
}
log_debug "Attempting to configure ${product_name} with CMake arguments: ${cmake_args}"
cmake -S . -B build_${target##*-} -G ${generator} ${cmake_args}
log_info "Building ${product_name}..."
local -a cmake_args=()
if (( _loglevel > 1 )) cmake_args+=(--verbose)
if [[ ${generator} == 'Unix Makefiles' ]] cmake_args+=(--parallel ${num_procs})
cmake --build build_${target##*-} --config ${BUILD_CONFIG:-RelWithDebInfo} ${cmake_args}
}
log_info "Installing ${product_name}..."
local -a cmake_args=()
if (( _loglevel > 1 )) cmake_args+=(--verbose)
cmake --install build_${target##*-} --config ${BUILD_CONFIG:-RelWithDebInfo} --prefix "${project_root}/release" ${cmake_args}
popd
}
build ${@}

192
.github/scripts/.package.zsh vendored Executable file
View File

@ -0,0 +1,192 @@
#!/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}${funcstack[1]##*/}:%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
_trap_error() {
print -u2 -PR '%F{1} ✖︎ script execution error%f'
print -PR -e "
Callstack:
${(j:\n :)funcfiletrace}
"
exit 2
}
package() {
if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
local host_os=${${(s:-:)ZSH_ARGZERO:t:r}[2]}
local target="${host_os}-${CPUTYPE}"
local project_root=${SCRIPT_HOME:A:h:h}
local buildspec_file="${project_root}/buildspec.json"
trap '_trap_error' ZERR
fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
autoload -Uz set_loglevel log_info log_error log_output check_${host_os}
local -i _verbosity=1
local -r _version='1.0.0'
local -r -a _valid_targets=(
macos-x86_64
macos-arm64
macos-universal
linux-x86_64
)
local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
local -r _usage="
Usage: %B${functrace[1]%:*}%b <option> [<options>]
%BOptions%b:
%F{yellow} Package configuration options%f
-----------------------------------------------------------------------------
%B-t | --target%b Specify target - default: %B%F{green}${host_os}-${CPUTYPE}%f%b
%B-c | --config%b Build configuration - default: %B%F{green}RelWithDebInfo%f%b
%B-s | --codesign%b Enable codesigning (macOS only)
%B-n | --notarize%b Enable notarization (macOS only)
%F{yellow} Output options%f
-----------------------------------------------------------------------------
%B-q | --quiet%b Quiet (error output only)
%B-v | --verbose%b Verbose (more detailed output)
%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} {
-t|--target|-c|--config)
if (( # == 1 )) || [[ ${2:0:1} == '-' ]] {
log_error "Missing value for option %B${1}%b"
log_output ${_usage}
exit 2
}
;;
}
case ${1} {
--)
shift
args+=($@)
break
;;
-t|--target)
if (( ! ${_valid_targets[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
target=${2}
shift 2
;;
-c|--config)
if (( ! ${_valid_configs[(Ie)${2}]} )) {
log_error "Invalid value %B${2}%b for option %B${1}%b"
log_output ${_usage}
exit 2
}
BUILD_CONFIG=${2}
shift 2
;;
-s|--codesign) typeset -g CODESIGN=1; shift ;;
-n|--notarize) typeset -g NOTARIZE=1; typeset -g CODESIGN=1; shift ;;
-q|--quiet) (( _verbosity -= 1 )) || true; shift ;;
-v|--verbose) (( _verbosity += 1 )); shift ;;
-h|--help) log_output ${_usage}; exit 0 ;;
-V|--version) print -Pr "${_version}"; exit 0 ;;
--debug) _verbosity=3; shift ;;
*) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
}
}
set -- ${(@)args}
set_loglevel ${_verbosity}
check_${host_os}
local product_name
local product_version
read -r product_name product_version <<< \
"$(jq -r '. | {name, version} | join(" ")' ${project_root}/buildspec.json)"
if [[ ${host_os} == 'macos' ]] {
autoload -Uz check_packages read_codesign read_codesign_installer read_codesign_pass
local output_name="${product_name}-${product_version}-${host_os}-${target##*-}.pkg"
if [[ ! -d ${project_root}/release/${product_name}.plugin ]] {
log_error 'No release artifact found. Run the build script or the CMake install procedure first.'
return 2
}
if [[ ! -f ${project_root}/build_${target##*-}/installer-macos.generated.pkgproj ]] {
log_error 'Packages project file not found. Run the build script or the CMake build and install procedures first.'
return 2
}
check_packages
log_info "Packaging ${product_name}..."
pushd ${project_root}
packagesbuild \
--build-folder ${project_root}/release \
${project_root}/build_${target##*-}/installer-macos.generated.pkgproj
if (( ${+CODESIGN} )) {
read_codesign_installer
productsign \
--sign "${CODESIGN_IDENT_INSTALLER}" \
"${project_root}/release/${product_name}.pkg" \
"${project_root}/release/${output_name}"
rm "${project_root}/release/${product_name}.pkg"
} else {
mv "${project_root}/release/${product_name}.pkg" \
"${project_root}/release/${output_name}"
}
if (( ${+CODESIGN} && ${+NOTARIZE} )) {
if [[ ! -f "${project_root}/release/${output_name}" ]] {
log_error "No package for notarization found."
return 2
}
read_codesign_installer
read_codesign_pass
xcrun notarytool submit "${project_root}/release/${output_name}" \
--keychain-profile "OBS-Codesign-Password" --wait
xcrun stapler staple "${project_root}/release/${output_name}"
}
popd
} elif [[ ${host_os} == 'linux' ]] {
local -a cmake_args=()
if (( _loglevel > 1 )) cmake_args+=(--verbose)
pushd ${project_root}
cmake --build build_${target##*-} --config ${BUILD_CONFIG:-RelWithDebInfo} -t package ${cmake_args}
popd
}
}
package ${@}

101
.github/scripts/Build-Windows.ps1 vendored Normal file
View File

@ -0,0 +1,101 @@
[CmdletBinding()]
param(
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[ValidateSet('x86', 'x64')]
[string] $Target,
[ValidateSet('Visual Studio 17 2022', 'Visual Studio 16 2019')]
[string] $CMakeGenerator,
[switch] $SkipAll,
[switch] $SkipBuild,
[switch] $SkipDeps,
[switch] $SkipUnpack
)
$ErrorActionPreference = 'Stop'
if ( $DebugPreference -eq 'Continue' ) {
$VerbosePreference = 'Continue'
$InformationPreference = 'Continue'
}
if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
exit 2
}
function Build {
trap {
Pop-Location -Stack BuildTemp
Write-Error $_
exit 2
}
$ScriptHome = $PSScriptRoot
$ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.."
$BuildSpecFile = "${ProjectRoot}/buildspec.json"
$UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse
foreach($Utility in $UtilityFunctions) {
Write-Debug "Loading $($Utility.FullName)"
. $Utility.FullName
}
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
$ProductName = $BuildSpec.name
$ProductVersion = $BuildSpec.version
$script:DepsVersion = ''
$script:QtVersion = '5'
$script:VisualStudioVersion = ''
$script:PlatformSDK = '10.0.18363.657'
Setup-Host
if ( $CmakeGenerator -eq '' ) {
$CmakeGenerator = $VisualStudioVersion
}
(Get-Content -Path ${ProjectRoot}/CMakeLists.txt -Raw) `
-replace "project\((.*) VERSION (.*)\)", "project(${ProductName} VERSION ${ProductVersion})" `
| Out-File -Path ${ProjectRoot}/CMakeLists.txt
Setup-Obs
Push-Location -Stack BuildTemp
if ( ! ( ( $SkipAll ) -or ( $SkipBuild ) ) ) {
Ensure-Location $ProjectRoot
$DepsPath = "plugin-deps-${script:DepsVersion}-qt${script:QtVersion}-${script:Target}"
$CmakeArgs = @(
'-G', $CmakeGenerator
"-DCMAKE_SYSTEM_VERSION=${script:PlatformSDK}"
"-DCMAKE_GENERATOR_PLATFORM=$(if (${script:Target} -eq "x86") { "Win32" } else { "x64" })"
"-DCMAKE_BUILD_TYPE=${Configuration}"
"-DCMAKE_PREFIX_PATH:PATH=$(Resolve-Path -Path "${ProjectRoot}/../obs-build-dependencies/${DepsPath}")"
"-DQT_VERSION=${script:QtVersion}"
)
Log-Debug "Attempting to configure OBS with CMake arguments: $($CmakeArgs | Out-String)"
Log-Information "Configuring ${ProductName}..."
Invoke-External cmake -S . -B build_${script:Target} @CmakeArgs
$CmakeArgs = @(
'--config', "${Configuration}"
)
if ( $VerbosePreference -eq 'Continue' ) {
$CmakeArgs+=('--verbose')
}
Log-Information "Building ${ProductName}..."
Invoke-External cmake --build "build_${script:Target}" @CmakeArgs
}
Log-Information "Install ${ProductName}..."
Invoke-External cmake --install "build_${script:Target}" --prefix "${ProjectRoot}/release" @CmakeArgs
Pop-Location -Stack BuildTemp
}
Build

92
.github/scripts/Package-Windows.ps1 vendored Normal file
View File

@ -0,0 +1,92 @@
[CmdletBinding()]
param(
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[ValidateSet('x86', 'x64', 'x86+x64')]
[string] $Target,
[switch] $BuildInstaller = $false
)
$ErrorActionPreference = 'Stop'
if ( $DebugPreference -eq 'Continue' ) {
$VerbosePreference = 'Continue'
$InformationPreference = 'Continue'
}
if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
exit 2
}
function Package {
trap {
Write-Error $_
exit 2
}
$ScriptHome = $PSScriptRoot
$ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.."
$BuildSpecFile = "${ProjectRoot}/buildspec.json"
$UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse
foreach( $Utility in $UtilityFunctions ) {
Write-Debug "Loading $($Utility.FullName)"
. $Utility.FullName
}
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
$ProductName = $BuildSpec.name
$ProductVersion = $BuildSpec.version
$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}"
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
Log-Information "Packaging ${ProductName}..."
$RemoveArgs = @{
ErrorAction = 'SilentlyContinue'
Path = @(
"${ProjectRoot}/release/${ProductName}-*-windows-*.zip"
"${ProjectRoot}/release/${ProductName}-*-windows-*.exe"
)
}
Remove-Item @RemoveArgs
if ( ( $BuildInstaller ) ) {
if ( $Target -eq 'x86+x64' ) {
$IsccCandidates = Get-ChildItem -Recurse -Path '*.iss'
if ( $IsccCandidates.length -gt 0 ) {
$IsccFile = $IsccCandidates[0].FullName
} else {
$IsccFile = ''
}
} else {
$IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
}
if ( ! ( Test-Path -Path $IsccFile ) ) {
throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
}
Log-Information 'Creating InnoSetup installer...'
Push-Location -Stack BuildTemp
Ensure-Location -Path "${ProjectRoot}/release"
Invoke-External iscc ${IsccFile} /O. /F"${OutputName}-Installer"
Pop-Location -Stack BuildTemp
}
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
}
Compress-Archive -Force @CompressArgs
}
Package

13
.github/scripts/build-linux.sh vendored Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
if ! type zsh > /dev/null 2>&1; then
echo ' => Installing script dependency Zsh.'
sudo apt-get -y update
sudo apt-get -y install zsh
fi
SCRIPT=$(readlink -f "${0}")
SCRIPT_DIR=$(dirname "${SCRIPT}")
zsh ${SCRIPT_DIR}/build-linux.zsh "${@}"

1
.github/scripts/build-linux.zsh vendored Symbolic link
View File

@ -0,0 +1 @@
.build.zsh

1
.github/scripts/build-macos.zsh vendored Symbolic link
View File

@ -0,0 +1 @@
.build.zsh

11
.github/scripts/check-changes.sh vendored Executable file
View File

@ -0,0 +1,11 @@
#!/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

45
.github/scripts/check-cmake.sh vendored Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
if [ ${#} -eq 1 -a "${1}" = "VERBOSE" ]; then
VERBOSITY="-l debug"
else
VERBOSITY=""
fi
if [ "${CI}" ]; then
MODE="--check"
else
MODE="-i"
fi
# Runs the 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" ]] ; then
NPROC=$(nproc)
elif [[ ${OS} = "Darwin" ]] ; then
NPROC=$(sysctl -n hw.physicalcpu)
fi
# Discover clang-format
if ! type cmake-format 2> /dev/null ; then
echo "Required cmake-format not found"
exit 1
fi
find . -type d \( \
-path ./\*build -o \
-path ./release -o \
-path ./deps \
\) -prune -false -type f -o \
-name 'CMakeLists.txt' -or \
-name '*.cmake' \
| xargs -L10 -P ${NPROC} cmake-format ${MODE} ${VERBOSITY}

56
.github/scripts/check-format.sh vendored Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Original source https://github.com/Project-OSRM/osrm-backend/blob/master/scripts/format.sh
set -o errexit
set -o pipefail
set -o nounset
if [ ${#} -eq 1 ]; then
VERBOSITY="--verbose"
else
VERBOSITY=""
fi
# 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" ]] ; then
NPROC=$(nproc)
elif [[ ${OS} = "Darwin" ]] ; then
NPROC=$(sysctl -n hw.physicalcpu)
fi
# Discover clang-format
if type clang-format-13 2> /dev/null ; then
CLANG_FORMAT=clang-format-13
elif type clang-format 2> /dev/null ; then
# Clang format found, but need to check version
CLANG_FORMAT=clang-format
V=$(clang-format --version)
if [[ $V != *"version 13.0"* ]]; then
echo "clang-format is not 13.0 (returned ${V})"
exit 1
fi
else
echo "No appropriate clang-format found (expected clang-format-13.0.0, or clang-format)"
exit 1
fi
find . -type d \( \
-path ./\*build -o \
-path ./release -o \
-path ./cmake -o \
-path ./deps \
\) -prune -false -type f -o \
-name '*.h' -or \
-name '*.hpp' -or \
-name '*.m' -or \
-name '*.mm' -or \
-name '*.c' -or \
-name '*.cpp' \
| xargs -L100 -P ${NPROC} "${CLANG_FORMAT}" ${VERBOSITY} -i -style=file -fallback-style=none

13
.github/scripts/package-linux.sh vendored Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
if ! type zsh > /dev/null 2>&1; then
echo ' => Installing script dependency Zsh.'
sudo apt-get update
sudo apt-get install zsh
fi
SCRIPT=$(readlink -f "${0}")
SCRIPT_DIR=$(dirname "${SCRIPT}")
zsh ${SCRIPT_DIR}/package-linux.zsh "${@}"

1
.github/scripts/package-linux.zsh vendored Symbolic link
View File

@ -0,0 +1 @@
.package.zsh

1
.github/scripts/package-macos.zsh vendored Symbolic link
View File

@ -0,0 +1 @@
.package.zsh

View File

@ -0,0 +1,25 @@
function Check-Git {
<#
.SYNOPSIS
Ensures available git executable on host system.
.DESCRIPTION
Checks whether a git command is available on the host system. If none is found,
Git is installed via winget.
.EXAMPLE
Check-Git
#>
if ( ! ( Test-Path function:Log-Info ) ) {
. $PSScriptRoot/Logger.ps1
}
Log-Information 'Checking for Git executable...'
if ( ! ( Get-Command git ) ) {
Log-Warning 'No Git executable found. Will try to install via winget.'
winget install git
} else {
Log-Debug "Git found at $(Get-Command git)."
Log-Status "Git found."
}
}

View File

@ -0,0 +1,29 @@
function Ensure-Location {
<#
.SYNOPSIS
Ensures current location to be set to specified directory.
.DESCRIPTION
If specified directory exists, switch to it. Otherwise create it,
then switch.
.EXAMPLE
Ensure-Location "My-Directory"
Ensure-Location -Path "Path-To-My-Directory"
#>
param(
[Parameter(Mandatory)]
[string] $Path
)
if ( ! ( Test-Path $Path ) ) {
$_Params = @{
ItemType = "Directory"
Path = ${Path}
ErrorAction = "SilentlyContinue"
}
New-Item @_Params | Set-Location
} else {
Set-Location -Path ${Path}
}
}

View File

@ -0,0 +1,70 @@
function Expand-ArchiveExt {
<#
.SYNOPSIS
Expands archive files.
.DESCRIPTION
Allows extraction of zip, 7z, gz, and xz archives.
Requires tar and 7-zip to be available on the system.
Archives ending with .zip but created using LZMA compression are
expanded using 7-zip as a fallback.
.EXAMPLE
Expand-ArchiveExt -Path <Path-To-Your-Archive>
Expand-ArchiveExt -Path <Path-To-Your-Archive> -DestinationPath <Expansion-Path>
#>
param(
[Parameter(Mandatory)]
[string] $Path,
[string] $DestinationPath = [System.IO.Path]::GetFileNameWithoutExtension($Path),
[switch] $Force
)
switch ( [System.IO.Path]::GetExtension($Path) ) {
.zip {
try {
Expand-Archive -Path $Path -DestinationPath $DestinationPath -Force:$Force
} catch {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Fallback utility 7-zip not found. Please install 7-zip first."
}
}
break
}
{ ( $_ -eq ".7z" ) -or ( $_ -eq ".exe" ) } {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Extraction utility 7-zip not found. Please install 7-zip first."
}
break
}
.gz {
try {
Invoke-External tar -x -o $DestinationPath -f $Path
} catch {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Fallback utility 7-zip not found. Please install 7-zip first."
}
}
break
}
.xz {
try {
Invoke-External tar -x -o $DestinationPath -f $Path
} catch {
if ( Get-Command 7z ) {
Invoke-External 7z x -y $Path "-o${DestinationPath}"
} else {
throw "Fallback utility 7-zip not found. Please install 7-zip first."
}
}
}
default {
throw "Unsupported archive extension provided."
}
}
}

View File

@ -0,0 +1,60 @@
function Install-BuildDependencies {
<#
.SYNOPSIS
Installs required build dependencies.
.DESCRIPTION
Additional packages might be needed for successful builds. This module contains additional
dependencies available for installation via winget and, if possible, adds their locations
to the environment path for future invocation.
.EXAMPLE
Install-BuildDependencies
#>
param(
[string] $WingetFile = "$PSScriptRoot/.Wingetfile"
)
if ( ! ( Test-Path function:Log-Warning ) ) {
. $PSScriptRoot/Logger.ps1
}
$Host64Bit = [System.Environment]::Is64BitOperatingSystem
$Paths = $Env:Path -split [System.IO.Path]::PathSeparator
$WingetOptions = @('install', '--accept-package-agreements', '--accept-source-agreements')
if ( $script:Quiet ) {
$WingetOptions += '--silent'
}
Get-Content $WingetFile | ForEach-Object {
$_, $Package, $_, $Path, $_, $Binary = ([regex]::Split($_, " (?=(?:[^']|'[^']*')*$)")) -replace ',', '' -replace "'",''
(${Env:ProgramFiles(x86)}, $Env:ProgramFiles) | ForEach-Object {
$Prefix = $_
$FullPath = "${Prefix}\${Path}"
if ( ( Test-Path $FullPath ) -and ! ( $Paths -contains $FullPath ) ) {
$Paths += $FullPath
$Env:Path = $Paths -join [System.IO.Path]::PathSeparator
}
}
Log-Debug "Checking for command ${Binary}"
$Found = Get-Command -ErrorAction SilentlyContinue $Binary
if ( $Found ) {
Log-Status "Found dependency ${Binary} as $($Found.Source)"
} else {
Log-Status "Installing package ${Package}"
try {
$Params = $WingetOptions + $Package
winget @Params
} catch {
throw "Error while installing winget package ${Package}: $_"
}
}
}
}

View File

@ -0,0 +1,40 @@
function Invoke-External {
<#
.SYNOPSIS
Invokes a non-PowerShell command.
.DESCRIPTION
Runs a non-PowerShell command, and captures its return code.
Throws an exception if the command returns non-zero.
.EXAMPLE
Invoke-External 7z x $MyArchive
#>
if ( $args.Count -eq 0 ) {
throw 'Invoke-External called without arguments.'
}
if ( ! ( Test-Path function:Log-Information ) ) {
. $PSScriptRoot/Logger.ps1
}
$Command = $args[0]
$CommandArgs = @()
if ( $args.Count -gt 1) {
$CommandArgs = $args[1..($args.Count - 1)]
}
$_EAP = $ErrorActionPreference
$ErrorActionPreference = "Continue"
Log-Debug "Invoke-External: ${Command} ${CommandArgs}"
& $command $commandArgs
$Result = $LASTEXITCODE
$ErrorActionPreference = $_EAP
if ( $Result -ne 0 ) {
throw "${Command} ${CommandArgs} exited with non-zero code ${Result}."
}
}

View File

@ -0,0 +1,117 @@
function Set-GitConfig {
<#
.SYNOPSIS
Sets a git config value.
.DESCRIPTION
Allows setting single or multiple config values in a PowerShell-friendly fashion.
.EXAMPLE
Set-GitConfig advice.detachedHead false
#>
if ( $args.Count -lt 2 ) {
throw 'Set-GitConfig called without required arguments <OPTION> <VALUE>.'
}
Invoke-External git config @args
}
function Invoke-GitCheckout {
<#
.SYNOPSIS
Checks out a specified git repository.
.DESCRIPTION
Wraps the git executable with PowerShell syntax to check out
a specified Git repository with a given commit hash and branch,
or a GitHub pull request ID.
.EXAMPLE
Invoke-GitCheckout -Uri "My-Repo-Uri" -Commit "My-Commit-Hash"
Invoke-GitCheckout -Uri "My-Repo-Uri" -Commit "My-Commit-Hash" -Branch "main"
Invoke-GitCheckout -Uri "My-Repo-Uri" -Commit "My-Commit-Hash" -PullRequest 250
#>
param(
[Parameter(Mandatory)]
[string] $Uri,
[Parameter(Mandatory)]
[string] $Commit,
[string] $Path,
[string] $Branch = "master",
[string] $PullRequest
)
if ( ! ( $Uri -like "*github.com*" ) -and ( $PullRequest -ne "" ) ) {
throw 'Fetching pull requests is only supported with GitHub-based repositories.'
}
if ( ! ( Test-Path function:Log-Information ) ) {
. $PSScriptRoot/Logger.ps1
}
if ( ! ( Test-Path function:Invoke-External ) ) {
. $PSScriptRoot/Invoke-External.ps1
}
$RepositoryName = [System.IO.Path]::GetFileNameWithoutExtension($Uri)
if ( $Path -eq "" ) {
$Path = "$(Get-Location | Convert-Path)\${RepositoryName}"
}
Push-Location -Stack GitCheckoutTemp
if ( Test-Path $Path/.git ) {
Write-Information "Repository ${RepositoryName} found in ${Path}"
Set-Location $Path
Set-GitConfig advice.detachedHead false
Set-GitConfig remote.origin.url $Uri
Set-GitConfig remote.origin.tapOpt --no-tags
$Ref = "+refs/heads/{0}:refs/remotes/origin/{0}" -f $Branch
Set-GitConfig --replace-all remote.origin.fetch $Ref
if ( $PullRequest -ne "" ) {
try {
Invoke-External git show-ref --quiet --verify refs/heads/pr-$PullRequest
} catch {
Invoke-External git fetch origin $("pull/{0}/head:pull-{0}" -f $PullRequest)
} finally {
Invoke-External git checkout -f "pull-${PullRequest}"
}
}
try {
$null = Invoke-External git rev-parse -q --verify "${Commit}^{commit}"
} catch {
Invoke-External git fetch origin
}
Invoke-External git checkout -f $Commit -- | Log-Information
} else {
Invoke-External git clone $Uri $Path
Set-Location $Path
Set-GitConfig advice.detachedHead false
if ( $PullRequest -ne "" ) {
$Ref = "pull/{0}/head:pull-{0}" -f $PullRequest
$Branch = "pull-${PullRequest}"
Invoke-External git fetch origin $Ref
Invoke-External git checkout $Branch
}
Invoke-External git checkout -f $Commit
}
Log-Information "Checked out commit ${Commit} on branch ${Branch}"
if ( Test-Path ${Path}/.gitmodules ) {
Invoke-External git submodule foreach --recursive git submodule sync
Invoke-External git submodule update --init --recursive
}
Pop-Location -Stack GitCheckoutTemp
}

123
.github/scripts/utils.pwsh/Logger.ps1 vendored Normal file
View File

@ -0,0 +1,123 @@
function Log-Debug {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Debug $m
}
}
}
function Log-Verbose {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Verbose $m
}
}
}
function Log-Warning {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Warning $m
}
}
}
function Log-Error {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
foreach($m in $Message) {
Write-Error $m
}
}
}
function Log-Information {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
if ( ! ( $script:Quiet ) ) {
$StageName = $( if ( $script:StageName -ne $null ) { $script:StageName } else { '' })
$Icon = ' =>'
foreach($m in $Message) {
Write-Host -NoNewLine -ForegroundColor Blue " ${StageName} $($Icon.PadRight(5)) "
Write-Host "${m}"
}
}
}
}
function Log-Status {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
if ( ! ( $script:Quiet ) ) {
$StageName = $( if ( $StageName -ne $null ) { $StageName } else { '' })
$Icon = ' >'
foreach($m in $Message) {
Write-Host -NoNewLine -ForegroundColor Green " ${StageName} $($Icon.PadRight(5)) "
Write-Host "${m}"
}
}
}
}
function Log-Output {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string[]] $Message
)
Process {
if ( ! ( $script:Quiet ) ) {
$StageName = $( if ( $script:StageName -ne $null ) { $script:StageName } else { '' })
$Icon = ''
foreach($m in $Message) {
Write-Output " ${StageName} $($Icon.PadRight(5)) ${m}"
}
}
}
}
$Columns = (Get-Host).UI.RawUI.WindowSize.Width - 5

View File

@ -0,0 +1,103 @@
function Setup-Host {
if ( ! ( Test-Path function:Log-Output ) ) {
. $PSScriptRoot/Logger.ps1
}
if ( ! ( Test-Path function:Ensure-Location ) ) {
. $PSScriptRoot/Ensure-Location.ps1
}
if ( ! ( Test-Path function:Install-BuildDependencies ) ) {
. $PSScriptRoot/Install-BuildDependencies.ps1
}
if ( ! ( Test-Path function:Expand-ArchiveExt ) ) {
. $PSScriptRoot/Expand-ArchiveExt.ps1
}
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
if ( $script:Target -eq '' ) { $script:Target = $script:HostArchitecture }
$script:QtVersion = $BuildSpec.platformConfig."windows-${script:Target}".qtVersion
$script:VisualStudioVersion = $BuildSpec.platformConfig."windows-${script:Target}".visualStudio
$script:PlatformSDK = $BuildSpec.platformConfig."windows-${script:Target}".platformSDK
if ( ! ( ( $script:SkipAll ) -or ( $script:SkipDeps ) ) ) {
('prebuilt', "qt${script:QtVersion}") | ForEach-Object {
$_Dependency = $_
$_Version = $BuildSpec.dependencies."${_Dependency}".version
$_BaseUrl = $BuildSpec.dependencies."${_Dependency}".baseUrl
$_Label = $BuildSpec.dependencies."${_Dependency}".label
$_Hash = $BuildSpec.dependencies."${_Dependency}".hashes."windows-${script:Target}"
if ( $BuildSpec.dependencies."${_Dependency}".PSobject.Properties.Name -contains "pdb-hashes" ) {
$_PdbHash = $BuildSpec.dependencies."${_Dependency}".'pdb-hashes'."$windows-${script:Target}"
}
if ( $_Version -eq '' ) {
throw "No ${_Dependency} spec found in ${script:BuildSpecFile}."
}
Log-Information "Setting up ${_Label}..."
Push-Location -Stack BuildTemp
Ensure-Location -Path "$(Resolve-Path -Path "${ProjectRoot}/..")/obs-build-dependencies"
switch -wildcard ( $_Dependency ) {
prebuilt {
$_Filename = "windows-deps-${_Version}-${script:Target}.zip"
$_Uri = "${_BaseUrl}/${_Version}/${_Filename}"
$_Target = "plugin-deps-${_Version}-qt${script:QtVersion}-${script:Target}"
$script:DepsVersion = ${_Version}
}
"qt*" {
$_Filename = "windows-deps-qt${script:QtVersion}-${_Version}-${script:Target}.zip"
$_Uri = "${_BaseUrl}/${_Version}/${_Filename}"
$_Target = "plugin-deps-${_Version}-qt${script:QtVersion}-${script:Target}"
}
}
if ( ! ( Test-Path -Path $_Filename ) ) {
$Params = @{
UserAgent = 'NativeHost'
Uri = $_Uri
OutFile = $_Filename
UseBasicParsing = $true
ErrorAction = 'Stop'
}
Invoke-WebRequest @Params
Log-Status "Downloaded ${_Label} for ${script:Target}."
} else {
Log-Status "Found downloaded ${_Label}."
}
$_FileHash = Get-FileHash -Path $_Filename -Algorithm SHA256
if ( $_FileHash.Hash.ToLower() -ne $_Hash ) {
throw "Checksum of downloaded ${_Label} does not match specification. Expected '${_Hash}', 'found $(${_FileHash}.Hash.ToLower())'"
}
Log-Status "Checksum of downloaded ${_Label} matches."
if ( ! ( ( $script:SkipAll ) -or ( $script:SkipUnpack ) ) ) {
Push-Location -Stack BuildTemp
Ensure-Location -Path $_Target
Expand-ArchiveExt -Path "../${_Filename}" -DestinationPath . -Force
Pop-Location -Stack BuildTemp
}
Pop-Location -Stack BuildTemp
}
}
}
function Get-HostArchitecture {
$Host64Bit = [System.Environment]::Is64BitOperatingSystem
$HostArchitecture = ('x86', 'x64')[$Host64Bit]
return $HostArchitecture
}
$script:HostArchitecture = Get-HostArchitecture

View File

@ -0,0 +1,84 @@
function Setup-Obs {
if ( ! ( Test-Path function:Log-Output ) ) {
. $PSScriptRoot/Logger.ps1
}
if ( ! ( Test-Path function:Check-Git ) ) {
. $PSScriptRoot/Check-Git.ps1
}
Check-Git
if ( ! ( Test-Path function:Ensure-Location ) ) {
. $PSScriptRoot/Ensure-Location.ps1
}
if ( ! ( Test-Path function:Invoke-GitCheckout ) ) {
. $PSScriptRoot/Invoke-GitCheckout.ps1
}
if ( ! ( Test-Path function:Invoke-External ) ) {
. $PSScriptRoot/Invoke-External.ps1
}
Log-Information 'Setting up OBS Studio...'
$ObsVersion = $BuildSpec.dependencies.'obs-studio'.version
$ObsRepository = $BuildSpec.dependencies.'obs-studio'.repository
$ObsBranch = $BuildSpec.dependencies.'obs-studio'.branch
$ObsHash = $BuildSpec.dependencies.'obs-studio'.hash
if ( $ObsVersion -eq '' ) {
throw 'No obs-studio version found in buildspec.json.'
}
Push-Location -Stack BuildTemp
Ensure-Location -Path "$(Resolve-Path -Path "${ProjectRoot}/../")/obs-studio"
if ( ! ( ( $script:SkipAll ) -or ( $script:SkipUnpack ) ) ) {
Invoke-GitCheckout -Uri $ObsRepository -Commit $ObsHash -Path . -Branch $ObsBranch
}
if ( ! ( ( $script:SkipAll ) -or ( $script:SkipBuild ) ) ) {
Log-Information 'Configuring OBS Studio...'
$NumProcessors = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
if ( $NumProcessors -gt 1 ) {
$env:UseMultiToolTask = $true
$env:EnforceProcessCountAcrossBuilds = $true
}
$DepsPath = "plugin-deps-${script:DepsVersion}-qt${script:QtVersion}-${script:Target}"
$CmakeArgs = @(
'-G', $script:CmakeGenerator
"-DCMAKE_SYSTEM_VERSION=${script:PlatformSDK}"
"-DCMAKE_GENERATOR_PLATFORM=$(if (${script:Target} -eq "x86") { "Win32" } else { "x64" })"
"-DCMAKE_BUILD_TYPE=${script:Configuration}"
"-DQT_VERSION=${script:QtVersion}"
'-DENABLE_PLUGINS=OFF'
'-DENABLE_UI=OFF'
'-DENABLE_SCRIPTING=OFF'
"-DCMAKE_INSTALL_PREFIX:PATH=$(Resolve-Path -Path "${ProjectRoot}/../obs-build-dependencies/${DepsPath}")"
"-DCMAKE_PREFIX_PATH:PATH=$(Resolve-Path -Path "${ProjectRoot}/../obs-build-dependencies/${DepsPath}")"
)
Log-Debug "Attempting to configure OBS with CMake arguments: $($CmakeArgs | Out-String)"
Log-Information "Configuring OBS..."
Invoke-External cmake -S . -B plugin_build_${script:Target} @CmakeArgs
Log-Information 'Building libobs and obs-frontend-api...'
$CmakeArgs = @(
'--config', "$( if ( $script:Configuration -eq '' ) { 'RelWithDebInfo' } else { $script:Configuration })"
)
if ( $VerbosePreference -eq 'Continue' ) {
$CmakeArgs+=('--verbose')
}
Invoke-External cmake --build plugin_build_${script:Target} @CmakeArgs -t obs-frontend-api
Invoke-External cmake --install plugin_build_${script:Target} @CmakeArgs --component obs_libraries
}
Pop-Location -Stack BuildTemp
}

36
.github/scripts/utils.zsh/check_linux vendored Normal file
View File

@ -0,0 +1,36 @@
autoload -Uz log_info log_status log_error log_debug log_warning
log_debug 'Checking for apt-get...'
if (( ! ${+commands[apt-get]} )) {
log_error 'No apt-get command found. Please install apt'
return 2
} else {
log_debug "Apt-get located at ${commands[apt-get]}"
}
local -a dependencies=("${(f)$(<${SCRIPT_HOME}/.Aptfile)}")
local -a install_list
local binary
for dependency (${dependencies}) {
local -a tokens=(${(s: :)dependency//(,|:|\')/})
if [[ ! ${tokens[1]} == 'package' ]] continue
if [[ ${#tokens} -gt 2 && ${tokens[3]} == 'bin' ]] {
binary=${tokens[4]}
} else {
binary=${tokens[2]}
}
if (( ! ${+commands[${binary}]} )) install_list+=(${tokens[2]})
}
local -a _quiet=('' '--quiet')
log_debug "List of dependencies to install: ${install_list}"
if (( ${#install_list} )) {
if (( ! ${+CI} )) log_warning 'Dependency installation via apt may require elevated privileges'
sudo apt-get -y install ${install_list} ${_quiet[(( (_loglevel == 0) + 1 ))]}
}

20
.github/scripts/utils.zsh/check_macos vendored Normal file
View File

@ -0,0 +1,20 @@
autoload -Uz is-at-least log_info log_error log_status read_codesign
local macos_version=$(sw_vers -productVersion)
log_info 'Checking macOS version...'
if ! is-at-least 11.0 "${macos_version}"; then
log_error "Minimum required macOS version is 11.0, but running on macOS ${macos_version}"
return 2
else
log_status "macOS ${macos_version} is recent"
fi
log_info 'Checking for Homebrew...'
if (( ! ${+commands[brew]} )) {
log_error 'No Homebrew command found. Please install Homebrew (https://brew.sh)'
return 2
}
brew bundle --file "${SCRIPT_HOME}/.Brewfile"
rehash

View File

@ -0,0 +1,52 @@
if (( ! ${+commands[packagesbuild]} )) {
autoload -Uz log_info log_status mkcd
if (( ! ${+commands[curl]} )) {
log_error 'curl not found. Please install curl.'
return 2
}
if (( ! ${+project_root} )) {
log_error "'project_root' not set. Please set before running ${0}."
return 2
}
local -a curl_opts=()
if (( ! ${+CI} )) {
curl_opts+=(--progress-bar)
} else {
curl_opts+=(--show-error --silent)
}
curl_opts+=(--location -O ${@})
log_info 'Installing Packages.app...'
pushd
mkcd ${project_root:h}/obs-build-dependencies
local packages_url='http://s.sudre.free.fr/Software/files/Packages.dmg'
local packages_hash='6afdd25386295974dad8f078b8f1e41cabebd08e72d970bf92f707c7e48b16c9'
if [[ ! -f Packages.dmg ]] {
log_status 'Download Packages.app'
curl ${curl_opts} ${packages_url}
}
local image_checksum
read -r image_checksum _ <<< "$(sha256sum Packages.dmg)"
if [[ ${packages_hash} != ${image_checksum} ]] {
log_error "Checksum mismatch of Packages.app download.
Expected : ${packages_hash}
Actual : ${image_checksum}"
return 2
}
hdiutil attach -noverify Packages.dmg &> /dev/null && log_status 'Packages.dmg image mounted.'
log_info 'Installing Packages.app...'
packages_volume=$(hdiutil info -plist | grep '<string>/Volumes/Packages' | sed 's/.*<string>\(\/Volumes\/[^<]*\)<\/string>/\1/')
sudo installer -pkg "${packages_volume}/packages/Packages.pkg" -target / && rehash
hdiutil detach ${packages_volume} &> /dev/null && log_status 'Packages.dmg image unmounted.'
}

View File

@ -0,0 +1,9 @@
autoload -Uz log_info log_error
log_info 'Checking for Homebrew...'
if (( ! ${+commands[brew]} )) {
log_error 'No Homebrew command found. Please install Homebrew (https://brew.sh)'
return 2
}
if (( ! ${+commands[xcnotary]} )) brew install akeru-inc/tap/xcnotary

3
.github/scripts/utils.zsh/log_debug vendored Normal file
View File

@ -0,0 +1,3 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 2 )) print -PR -e -- "%F{220}DEBUG: ${@}%f"

3
.github/scripts/utils.zsh/log_error vendored Normal file
View File

@ -0,0 +1,3 @@
local icon=' ✖︎ '
print -u2 -PR "%F{1} ${icon} %f ${@}"

7
.github/scripts/utils.zsh/log_info vendored Normal file
View File

@ -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"
}

7
.github/scripts/utils.zsh/log_output vendored Normal file
View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=''
print -PR " ${(r:5:)icon} ${@}"
}

7
.github/scripts/utils.zsh/log_status vendored Normal file
View File

@ -0,0 +1,7 @@
if (( ! ${+_loglevel} )) typeset -g _loglevel=1
if (( _loglevel > 0 )) {
local icon=' >'
print -PR "%F{2} ${(r:5:)icon}%f ${@}"
}

5
.github/scripts/utils.zsh/log_warning vendored Normal file
View File

@ -0,0 +1,5 @@
if (( _loglevel > 0 )) {
local icon=' =>'
print -PR "%F{3} ${(r:5:)icon} ${@}%f"
}

1
.github/scripts/utils.zsh/mkcd vendored Normal file
View File

@ -0,0 +1 @@
[[ -n ${1} ]] && mkdir -p ${1} && builtin cd ${1}

View File

@ -0,0 +1,7 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_IDENT} )) {
typeset -g CODESIGN_IDENT
log_info 'Setting up identity for application codesigning...'
read CODESIGN_IDENT'?Apple Developer Application ID: '
}

View File

@ -0,0 +1,7 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_IDENT_INSTALLER} )) {
typeset -g CODESIGN_IDENT_INSTALLER
log_info 'Setting up identity for installer package codesigning...'
read CODESIGN_IDENT_INSTALLER'?Apple Developer Installer ID: '
}

View File

@ -0,0 +1,33 @@
##############################################################################
# Apple Developer credentials necessary:
#
# + Signing for distribution and notarization require an active Apple
# Developer membership
# + An Apple Development identity is needed for code signing
# (i.e. 'Apple Development: YOUR APPLE ID (PROVIDER)')
# + Your Apple developer ID is needed for notarization
# + An app-specific password is necessary for notarization from CLI
# + This password will be stored in your macOS keychain under the identifier
# 'OBS-Codesign-Password'with access Apple's 'altool' only.
##############################################################################
autoload -Uz read_codesign read_codesign_user log_info
if (( ! ${+CODESIGN_IDENT} )) {
read_codesign
}
local codesign_ident_short=$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')
if (( ! ${+CODESIGN_IDENT_USER} )) {
read_codesign_user
}
log_info 'Setting up password for notarization keychain...'
if (( ! ${+CODESIGN_IDENT_PASS} )) {
read -s CODESIGN_IDENT_PASS'?Apple Developer ID password: '
}
print ''
log_info 'Setting up notarization keychain...'
xcrun notarytool store-credentials 'OBS-Codesign-Password' --apple-id "${CODESIGN_IDENT_USER}" --team-id "${codesign_ident_short}" --password "${CODESIGN_IDENT_PASS}"

View File

@ -0,0 +1,7 @@
autoload -Uz log_info
if (( ! ${+CODESIGN_IDENT_USER} )) {
typeset -g CODESIGN_IDENT_USER
log_info 'Setting up developer id for codesigning...'
read CODESIGN_IDENT_USER'?Apple Developer ID: '
}

17
.github/scripts/utils.zsh/set_loglevel vendored Normal file
View File

@ -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}'"

14
.github/scripts/utils.zsh/setup_ccache vendored Normal file
View File

@ -0,0 +1,14 @@
autoload -Uz log_debug log_warning
if (( ${+commands[ccache]} )) {
log_debug "Found ccache at ${commands[ccache]}"
if (( ${+CI} )) {
ccache --set-config=cache_dir="${GITHUB_WORKSPACE:-${HOME}}/.ccache"
ccache --set-config=max_size="${CCACHE_SIZE:-500M}"
ccache --set-config=compression=true
ccache -z > /dev/null
}
} else {
log_warning "No ccache found on the system"
}

62
.github/scripts/utils.zsh/setup_linux vendored Normal file
View File

@ -0,0 +1,62 @@
autoload -Uz log_error log_status log_info mkcd
if (( ! ${+project_root} )) {
log_error "'project_root' not set. Please set before running ${0}."
return 2
}
if (( ! ${+target} )) {
log_error "'target' not set. Please set before running ${0}."
return 2
}
pushd ${project_root}
typeset -g QT_VERSION
read -r QT_VERSION <<< \
"$(jq -r --arg target "${target}" \
'.platformConfig[$target] | { qtVersion } | join(" ")' \
${project_root}/buildspec.json)"
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
log_info 'Installing obs build dependencies...'
sudo apt-get install -y \
build-essential \
libcurl4-openssl-dev \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev \
libswresample-dev libswscale-dev \
libjansson-dev \
libx11-xcb-dev \
libgles2-mesa-dev \
libwayland-dev \
libpulse-dev
local -a _qt_packages=()
if (( QT_VERSION == 5 )) {
_qt_packages+=(
qtbase5-dev
libqt5svg5-dev
qtbase5-private-dev
libqt5x11extras5-dev
)
} elif (( QT_VERSION == 6 )) {
_qt_packages+=(
qt6-base-dev
libqt6svg6-dev
qt6-base-private-dev
)
} else {
log_error "Unsupported Qt version '${QT_VERSION}' specified."
return 2
}
sudo apt-get install -y ${_qt_packages}
}
local deps_version
read -r deps_version <<< \
"$(jq -r '.dependencies.prebuilt.version' ${buildspec_file})"
typeset -g OBS_DEPS_VERSION=${deps_version}

127
.github/scripts/utils.zsh/setup_macos vendored Normal file
View File

@ -0,0 +1,127 @@
autoload -Uz log_error log_status log_info mkcd
if (( ! ${+commands[curl]} )) {
log_error 'curl not found. Please install curl.'
return 2
}
if (( ! ${+commands[jq]} )) {
log_error 'jq not found. Please install jq.'
return 2
}
if (( ! ${+project_root} )) {
log_error "'project_root' not set. Please set before running ${0}."
return 2
}
if (( ! ${+target} )) {
log_error "'target' not set. Please set before running ${0}."
return 2
}
local -a curl_opts=()
if (( ! ${+CI} )) {
curl_opts+=(--progress-bar)
} else {
curl_opts+=(--show-error --silent)
}
curl_opts+=(--location -O ${@})
pushd ${project_root}
local _qt_version
local _deployment_target
read -r _qt_version _deployment_target <<< \
"$(jq -r --arg target "${target}" \
'.platformConfig[$target] | { qtVersion, deploymentTarget } | join (" ")' \
${buildspec_file})"
typeset -g QT_VERSION=${_qt_version}
typeset -g DEPLOYMENT_TARGET=${_deployment_target}
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
mkdir -p ${project_root:h}/obs-build-dependencies
local dependency
local deps_version
local deps_baseurl
local deps_label
local deps_hash
local _filename
local _url
local _target
local artifact_checksum
for dependency ('prebuilt' "qt${QT_VERSION}") {
IFS=';' read -r deps_version deps_baseurl deps_label deps_hash <<< \
"$(jq -r --arg dependency "${dependency}" --arg target "${target}" \
'.dependencies[$dependency] | {version, baseUrl, "label", "hash": .hashes[$target]} | join(";")' \
${buildspec_file})"
if [[ -z "${deps_version}" ]] {
log_error "No ${dependency} spec found in ${buildspec_file}."
return 2
}
log_info "Setting up ${deps_label}..."
pushd ${project_root:h}/obs-build-dependencies
case ${dependency} {
prebuilt)
_filename="macos-deps-${deps_version}-${target##*-}.tar.xz"
_url="${deps_baseurl}/${deps_version}/${_filename}"
_target="plugin-deps-${deps_version}-qt${QT_VERSION}-${target##*-}"
typeset -g OBS_DEPS_VERSION=${deps_version}
;;
qt*)
if (( ${+CI} )) {
_filename="macos-deps-qt${QT_VERSION}-${deps_version}-universal.tar.xz"
deps_hash="$(jq -r --arg dependency "${dependency}" \
'.dependencies[$dependency].hashes["macos-universal"]' \
${buildspec_file})"
} else {
_filename="macos-deps-qt${QT_VERSION}-${deps_version}-${target##*-}.tar.xz"
}
_url="${deps_baseurl}/${deps_version}/${_filename}"
_target="plugin-deps-${deps_version}-qt${QT_VERSION}-${target##*-}"
;;
}
if [[ ! -f ${_filename} ]] {
log_debug "Running curl ${curl_opts} ${_url}"
curl ${curl_opts} ${_url} && \
log_status "Downloaded ${deps_label} for ${target}."
} else {
log_status "Found downloaded ${deps_label}"
}
read -r artifact_checksum _ <<< "$(sha256sum ${_filename})"
if [[ ${deps_hash} != ${artifact_checksum} ]] {
log_error "Checksum of downloaded ${deps_label} does not match specification.
Expected : ${deps_hash}
Actual : ${artifact_checksum}"
return 2
}
log_status "Checksum of downloaded ${deps_label} matches."
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)unpack]}) )) {
mkdir -p ${_target} && pushd ${_target}
XZ_OPT=-T0 tar -xzf ../${_filename} && log_status "${deps_label} extracted."
popd
}
}
popd
pushd ${project_root:h}/obs-build-dependencies
xattr -r -d com.apple.quarantine *
log_status 'Removed quarantine flag from downloaded dependencies...'
popd
} else {
local deps_version
read -r deps_version <<< \
"$(jq -r '.dependencies.prebuilt.version' ${buildspec_file})"
typeset -g OBS_DEPS_VERSION=${deps_version}
}

122
.github/scripts/utils.zsh/setup_obs vendored Normal file
View File

@ -0,0 +1,122 @@
autoload -Uz log_error log_info log_status
if (( ! ${+buildspec_file} )) {
log_error "'buildspec_file' not set. Please set before running ${0}."
return 2
}
if (( ! ${+commands[git]} )) {
log_error 'git not found. Please install git.'
return 2
}
if (( ! ${+commands[jq]} )) {
log_error 'jq not found. Please install jq.'
return 2
}
if (( ! ${+project_root} )) {
log_error "'project_root' not set. Please set before running ${0}."
return 2
}
if (( ! ${+target} )) {
log_error "'target' not set. Please set before running ${0}."
return 2
}
log_info 'Setting up OBS-Studio...'
local obs_version
local obs_repo
local obs_branch
local obs_hash
read -r obs_version obs_repo obs_branch obs_hash <<< \
"$(jq -r --arg key "obs-studio" \
'.dependencies[$key] | {version, repository, branch, hash} | join(" ")' \
${buildspec_file})"
if [[ -z ${obs_version} ]] {
log_error "No obs-studio version found in buildspec.json"
return 2
}
pushd
mkcd ${project_root:h}/obs-studio
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)unpack]}) )) {
if [[ -d .git ]] {
git config advice.detachedHead false
git config remote.pluginbuild.url "${obs_repo:-https://github.com/obsproject/obs-studio.git}"
git config remote.pluginbuild.fetch "+refs/heads/${obs_branch:-master}:refs/remotes/origin/${obs_branch:-master}"
git rev-parse -q --verify "${obs_hash}^{commit}" > /dev/null || git fetch pluginbuild
git checkout ${obs_branch:-master} -B ${product_name}
git reset --hard "${obs_hash}"
log_status 'Found existing obs-studio repository.'
} else {
git clone "${obs_repo:-https://github.com/obsproject/obs-studio.git}" "${PWD}"
git config advice.detachedHead false
git checkout -f "${obs_hash}" --
git checkout ${obs_branch:-master} -b ${product_name}
log_status 'obs-studio checked out.'
}
git submodule foreach --recursive git submodule sync
git submodule update --init --recursive
}
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)build]}) )) {
log_info 'Configuring obs-studio...'
local -a cmake_args=(
-DCMAKE_BUILD_TYPE=${BUILD_CONFIG:-Release}
-DQT_VERSION=${QT_VERSION}
-DENABLE_PLUGINS=OFF
-DENABLE_UI=OFF
-DENABLE_SCRIPTING=OFF
-DCMAKE_INSTALL_PREFIX="${project_root:h}/obs-build-dependencies/plugin-deps-${OBS_DEPS_VERSION}-qt${QT_VERSION}-${target##*-}"
-DCMAKE_PREFIX_PATH="${project_root:h}/obs-build-dependencies/plugin-deps-${OBS_DEPS_VERSION}-qt${QT_VERSION}-${target##*-}"
)
if (( _loglevel == 0 )) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR)
if (( _loglevel > 2 )) cmake_args+=(--debug-output)
local num_procs
case ${target} {
macos-*)
autoload -Uz read_codesign
if (( ${+CODESIGN} )) {
read_codesign
}
cmake_args+=(
-DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
-DOBS_CODESIGN_LINKER=ON
-DOBS_BUNDLE_CODESIGN_IDENTITY="${CODESIGN_IDENT:--}"
)
num_procs=$(( $(sysctl -n hw.ncpu) + 1 ))
;;
linux-*)
cmake_args+=(
-DENABLE_PIPEWIRE=OFF
)
num_procs=$(( $(nproc) + 1 ))
;;
}
log_debug "Attempting to configure OBS with CMake arguments: ${cmake_args}"
cmake -S . -B plugin_build_${target##*-} -G ${generator} ${cmake_args}
log_info 'Building libobs and obs-frontend-api...'
local -a cmake_args=()
if (( _loglevel > 1 )) cmake_args+=(--verbose)
if [[ ${generator} == 'Unix Makefiles' ]] cmake_args+=(--parallel ${num_procs})
cmake --build plugin_build_${target##*-} --config ${BUILD_CONFIG:-Release} ${cmake_args} -t obs-frontend-api
cmake --install plugin_build_${target##*-} --config ${BUILD_CONFIG:-Release} --component obs_libraries ${cmake_args}
}
popd

386
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,386 @@
name: Plugin Build
on:
push:
paths-ignore:
- '**.md'
branches:
- 4.x-compat-new-cmake
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'
branches:
- 4.x-compat-new-cmake
env:
PLUGIN_NAME: 'obs-websocket-compat'
jobs:
clang_check:
name: 01 - Code Format Check
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install clang-format
run: sudo apt-get install -y clang-format-13
- name: Run clang-format
run: ./.github/scripts/check-format.sh && ./.github/scripts/check-changes.sh
- name: Install cmake-format
run: sudo pip install cmakelang
- name: Run cmake-format
run: ./.github/scripts/check-cmake.sh
macos_build:
name: 02 - macOS
runs-on: macos-12
strategy:
fail-fast: true
matrix:
arch: [x86_64, arm64, universal]
if: always()
needs: [clang_check]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
env:
CODESIGN_IDENT: '-'
CODESIGN_IDENT_INSTALLER: ''
MACOSX_DEPLOYMENT_TARGET: '10.15'
defaults:
run:
shell: zsh {0}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive
- name: Checkout obs-studio
uses: actions/checkout@v3
with:
repository: 'obsproject/obs-studio'
path: obs-studio
fetch-depth: 0
submodules: recursive
- name: Setup Environment
id: setup
working-directory: ${{ github.workspace }}/plugin
run: |
## SETUP ENVIRONMENT SCRIPT
print '::group::Clean Homebrew Environment'
typeset -a to_remove=()
for formula (speexdsp curl php) {
if [[ -d ${HOMEBREW_PREFIX}/opt/${formula} ]] to_remove+=(${formula})
}
if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
print '::endgroup::'
print '::group::Set up code signing'
if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
'${{ secrets.MACOS_INSTALLER_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
print '::set-output name=haveCodesignIdent::true'
} else {
print '::set-output name=haveCodesignIdent::false'
}
if [[ '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
'${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != '' ]] {
print '::set-output name=haveNotarizationUser::true'
} else {
print '::set-output name=haveNotarizationUser::false'
}
print '::endgroup::'
print "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
print "::set-output name=commitHash::${"$(git rev-parse HEAD)"[0,9]}"
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v2.1.7
with:
path: ${{ github.workspace }}/.ccache
key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
restore-keys: |
macos-${{ matrix.arch }}-ccache-plugin-
- name: Check for GitHub Labels
id: seekingTesters
if: ${{ github.event_name == 'pull_request' }}
run: |
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]] {
print '::set-output name=found::true'
} else {
print '::set-output name=found::false'
}
- name: Install Apple Developer Certificate
if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
with:
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
- name: Set Signing Identity
if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
run: |
print "CODESIGN_IDENT=${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}" >> $GITHUB_ENV
print "CODESIGN_IDENT_INSTALLER=${{ secrets.MACOS_INSTALLER_IDENTITY }}" >> $GITHUB_ENV
- name: Build Plugin
uses: ./plugin/.github/actions/build-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
codesign: 'true'
codesignIdent: ${{ env.CODESIGN_IDENT }}
- name: Package Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
codesign: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
notarize: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' && steps.setup.outputs.haveNotarizationUser == 'true' }}
codesignIdent: ${{ env.CODESIGN_IDENT }}
installerIdent: ${{ env.CODESIGN_IDENT_INSTALLER }}
codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
- name: Upload Build Artifact
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg
linux_build:
name: 02 - Linux
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
arch: [x86_64]
if: always()
needs: [clang_check]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive
- name: Checkout obs-studio
uses: actions/checkout@v3
with:
repository: 'obsproject/obs-studio'
path: obs-studio
fetch-depth: 0
submodules: recursive
- name: Setup Environment
working-directory: ${{ github.workspace }}/plugin
id: setup
run: |
## SETUP ENVIRONMENT SCRIPT
echo "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
echo "::set-output name=commitHash::$(git rev-parse HEAD | cut -c1-9)"
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v2.1.7
with:
path: ${{ github.workspace }}/.ccache
key: linux-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
restore-keys: |
linux-${{ matrix.arch }}-ccache-plugin-
- name: Check for GitHub Labels
id: seekingTesters
if: ${{ github.event_name == 'pull_request' }}
run: |
## GITHUB LABEL SCRIPT
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
echo '::set-output name=found::true'
else
echo '::set-output name=found::false'
fi
- name: Build Plugin
uses: ./plugin/.github/actions/build-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
- name: Package Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
- name: Upload Build Artifact
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-linux-${{ matrix.arch }}.*
windows_build:
name: 02 - Windows
runs-on: windows-2022
strategy:
fail-fast: true
matrix:
arch: [x86, x64]
if: always()
needs: [clang_check]
outputs:
commitHash: ${{ steps.setup.outputs.commitHash }}
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive
- name: Checkout obs-studio
uses: actions/checkout@v3
with:
repository: 'obsproject/obs-studio'
path: obs-studio
fetch-depth: 0
submodules: recursive
- name: Setup Environment
working-directory: ${{ github.workspace }}/plugin
id: setup
run: |
## SETUP ENVIRONMENT SCRIPT
$CommitHash = (git rev-parse HEAD)[0..8] -join ''
Write-Output "::set-output name=commitHash::${CommitHash}"
- name: Check for GitHub Labels
id: seekingTesters
working-directory: ${{ github.workspace }}/plugin
if: ${{ github.event_name == 'pull_request' }}
run: |
## GITHUB LABEL SCRIPT
$LabelFound = try {
$Params = @{
Authentication = 'Bearer'
Token = (ConvertTo-SecureString '${{ secrets.GITHUB_TOKEN }}' -AsPlainText)
Uri = '${{ github.event.pull_request.url }}'
UseBasicParsing = $true
}
(Invoke-RestMethod @Params).labels.name.contains('Seeking Testers')
} catch {
$false
}
Write-Output "::set-output name=found::$(([string]${LabelFound}).ToLower())"
- name: Build Plugin
uses: ./plugin/.github/actions/build-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
visualStudio: 'Visual Studio 17 2022'
- name: Package Plugin
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
- name: Upload Build Artifact
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*.zip
- name: Package Plugin Installer
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
uses: ./plugin/.github/actions/package-plugin
with:
workingDirectory: ${{ github.workspace }}/plugin
target: ${{ matrix.arch }}
config: RelWithDebInfo
createInstaller: true
- name: Upload Installer Artifact
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}-installer
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*.exe
make-release:
name: 03 - Create and upload release
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [macos_build, linux_build, windows_build]
defaults:
run:
shell: bash
steps:
- name: Get Metadata
id: metadata
run: |
## METADATA SCRIPT
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
- name: Download build artifacts
uses: actions/download-artifact@v3
- name: Generate Checksums
run: |
## CHECKSUM GENERATION SCRIPT
shopt -s extglob
echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
for file in ${{ github.workspace }}/**/@(*.pkg|*.exe|*.deb|*.zip); do
echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
done
- name: Create Release
id: create_release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
draft: true
prerelease: ${{ contains(steps.metadata.outputs.version, 'rc') || contains(steps.metadata.outputs.version, 'beta') }}
tag_name: ${{ steps.metadata.outputs.version }}
name: "${{ env.PLUGIN_NAME }} ${{ steps.metadata.outputs.version }}"
body_path: ${{ github.workspace }}/CHECKSUMS.txt
files: |
${{ github.workspace }}/**/*.zip
${{ github.workspace }}/**/*.exe
${{ github.workspace }}/**/*.deb
${{ github.workspace }}/**/*.pkg

3
.gitignore vendored
View File

@ -4,4 +4,7 @@
/build32/ /build32/
/build64/ /build64/
/release/ /release/
/package/
/installer/Output/ /installer/Output/
.idea
.vscode

9
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "deps/mbedtls"] [submodule "deps/websocketpp"]
path = deps/mbedtls path = deps/websocketpp
url = https://github.com/ARMmbed/mbedtls url = https://github.com/zaphoyd/websocketpp.git
[submodule "deps/asio"]
path = deps/asio
url = https://github.com/chriskohlhoff/asio.git

View File

@ -1,55 +0,0 @@
language: cpp
env:
global:
# AWS key ID
- secure: pAiNUGVbjP12BfnWPk0FFTkbnk4Tocvv88XiT3rzRqkQaD7/iyEogLBfHM4nOEgFiIMHbC41aE83w5JgRNPwn6mTgoQBOglzqq1tGuXfqPyV2VStk8beji1evubGoVjjPaoPTFyIdQc5GGxdHyogI/ed9Hb3ccyykYvjyolj9XoCiW42QHx60AHGwl+So+dEa8xydj9SLRPlZ/AitmI/cPVN3YotA7s37BLFiab54enxk7T4rwpR1nU0HVfoCpn5F4wZYxRq+LlSVFzC8vVE9cpDSLS5kjrZIZaT18tYG1/untCj+wqMIZbghaJXLtPSRW2YPHcJTz8q1YSXnJ19+0uiAIMAqaVv0kD5BAM97byYDBW+b9H6SYFkb/Pw/qcK9amMzMBjDPFpYFkl9Q2kzhsNs3HsZf/flSZjtrkQJiP3SOi/KvKzVK9X4Wym6hYZWHgmMTTYFrvr6BYnf2GkpfKNjm1d2kc0NNrq4d5H4NOEQB8MP+QH+o+BPeM6d9dthrUc1Pw+BXzOAr85CN4qtpPGoAl/Dbfgd6eu/88E2LpUufW2VFAOPWjykSOqzSN3orh7AaWuE34VFEnQ+2y3uIE8AKoyXzJv6zYkyNnNewKZeGe2kKYNwLn5UxQA9JEj7a+tvVevk4xBSkkjFAvjSG2z8/F1FXNbEfoLX1Hz/bU=
# AWS key secret
- secure: bGwljoP3E1OVBXLXox0O6p8kwQXLcNQ8YDKVa4H8u9Y+Ic7uqE4iV3rYS3ynNWSBMVRWY3ZbyClnhrCNwRhBAlcd8qWSJdpjVzs6HdQyzhuKa1P3V4FJPb7upGP/5R/DECGwex8Mun9dmXpYDak75LxfKIJUidPis5VDCYqul7k/xVVCou6Ctjpj7vQhWXDj2G/py+mdB8DERhymnQCtyK1Ziu8c4QlFKByZmnD72GFm/h3JPI1Pq1V2mz3x6x6GaYjb9Rdbd0UNwqjGQX4q2M/c3GEJa6B2JBCoTncawNZBNnPUF9qtv+zh0TNaNHMRWX13AJ/qYB+nVDub0C9b/6Mc48mt0Tv4ze15MproVrylZdV6qHYEG8yGPBqpTVbRP6gv6Y2TXIHWoTzqA+F/Gv2IDChyHXsld/MQQS2MSo5iaYktIrZKtX8Z0qAmTzPwIVBromaSI3vrE7UH0fRSQ6fAM8+Tn+MRthOBdqu23kS1dnG+X2CPbUhBfsJp0OSwVQD5jQtA51/sREVeGFiJvzQIkvwQDjb5MYilsRnwmoBXemkLmqaviXVY4rz1o5AIvz2pgZS2YggK1xHZCuI5tSjcNEkb77VwZTfsqrdDo9EJh6VgfdnGlHQhR2/A5hUJ4ANpJ/LgZlgfVp71Xg2GWQW6M4Znc5uj6A6xLBkO6FA=
matrix:
include:
- os: linux
dist: trusty
sudo: required
services:
- docker
before_install:
- docker run -d --name xenial -v $(dirname $(pwd)):/root -v /home/travis/package:/package
-e TRAVIS_BRANCH="$TRAVIS_BRANCH" -e TRAVIS_TAG="$TRAVIS_TAG" -w /root nimmis/ubuntu:16.04
- docker exec -it xenial /root/obs-websocket/CI/install-dependencies-xenial.sh
script:
- docker exec -it xenial /root/obs-websocket/CI/build-xenial.sh
after_success:
- docker exec -it xenial /root/obs-websocket/CI/package-xenial.sh
- os: osx
osx_image: xcode8.3
before_install: "./CI/install-dependencies-osx.sh"
script: "./CI/build-osx.sh"
after_success: "./CI/package-osx.sh"
deploy:
- provider: s3
region: eu-central-1
bucket: obs-websocket-linux-builds
access_key_id: "$AWS_ID"
secret_access_key: "$AWS_SECRET"
local_dir: /home/travis/package
skip_cleanup: true
acl: public_read
on:
repo: Palakis/obs-websocket
condition: "$TRAVIS_OS_NAME = linux"
all_branches: true
- provider: s3
region: eu-central-1
bucket: obs-websocket-osx-builds
access_key_id: "$AWS_ID"
secret_access_key: "$AWS_SECRET"
local_dir: release
skip_cleanup: true
acl: public_read
on:
repo: Palakis/obs-websocket
condition: "$TRAVIS_OS_NAME = osx"
all_branches: true

View File

@ -1,29 +1,66 @@
# Compiling obs-websocket # Compiling obs-websocket
## Prerequisites ## Prerequisites
You'll need [QT 5.7.0](https://download.qt.io/official_releases/qt/5.7/5.7.0/), CMake, and a working development environment for OBS Studio installed on your computer.
You'll need [Qt 5.15.2](https://download.qt.io/official_releases/qt/5.15/5.15.2/),
[CMake](https://cmake.org/download/) and a working [OBS Studio development environment](https://obsproject.com/wiki/install-instructions) installed on your
computer.
## Windows ## Windows
In cmake-gui, you'll have to set the following variables : In cmake-gui, you'll have to set the following variables :
- **QTDIR** (path) : location of the Qt environment suited for your compiler and architecture - **QTDIR** (path) : location of the Qt environment suited for your compiler and architecture
- **LIBOBS_INCLUDE_DIR** (path) : location of the libobs subfolder in the source code of OBS Studio - **LIBOBS_INCLUDE_DIR** (path) : location of the libobs subfolder in the source code of OBS Studio
- **LIBOBS_LIB** (filepath) : location of the obs.lib file - **LIBOBS_LIB** (filepath) : location of the obs.lib file
- **OBS_FRONTEND_LIB** (filepath) : location of the obs-frontend-api.lib file - **OBS_FRONTEND_LIB** (filepath) : location of the obs-frontend-api.lib file
## Linux ## Linux
On Debian/Ubuntu :
``` On Debian/Ubuntu :
sudo apt-get install libqt5websockets5-dev
```shell
sudo apt-get install libboost-all-dev
git clone --recursive https://github.com/Palakis/obs-websocket.git git clone --recursive https://github.com/Palakis/obs-websocket.git
cd obs-websocket cd obs-websocket
mkdir build && cd build mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="<path to the libobs sub-folder in obs-studio's source code>" -DCMAKE_INSTALL_PREFIX=/usr .. cmake -DLIBOBS_INCLUDE_DIR="<path to the libobs sub-folder in obs-studio's source code>" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=true ..
make -j4 make -j4
sudo make install sudo make install
``` ```
On other linux OS's, use this cmake command instead:
```shell
cmake -DLIBOBS_INCLUDE_DIR="<path to the libobs sub-folder in obs-studio's source code>" -DCMAKE_INSTALL_PREFIX=/usr ..
```
## OS X ## OS X
*To do*
As a prerequisite, you will need Xcode for your current OSX version, the Xcode command line tools, and [Homebrew](https://brew.sh/).
Homebrew's setup will guide you in getting your system set up, you should be good to go once Homebrew is successfully up and running.
Use of the macOS CI scripts is recommended. Please note that these
scripts install new software and can change several settings on your system. An
existing obs-studio development environment is not required, as
`install-build-obs-macos.sh` will install it for you. If you already have a
working obs-studio development environment and have built obs-studio, you can
skip that script.
Of course, you're encouraged to dig through the contents of these scripts to
look for issues or specificities.
```shell
git clone --recursive https://github.com/Palakis/obs-websocket.git
cd obs-websocket
./CI/macos/install-dependencies-macos.sh
./CI/macos/install-build-obs-macos.sh
./CI/macos/build-plugin-macos.sh
./CI/macos/package-plugin-macos.sh
```
This will result in a ready-to-use `obs-websocket.pkg` installer in the `release` subfolder.
## Automated Builds ## Automated Builds
- Windows : [![Automated Build status for Windows](https://ci.appveyor.com/api/projects/status/github/Palakis/obs-websocket)](https://ci.appveyor.com/project/Palakis/obs-websocket/history)
- Linux & OS X : [![Automated Build status for Linux & OS X](https://travis-ci.org/Palakis/obs-websocket.svg?branch=master)](https://travis-ci.org/Palakis/obs-websocket) [![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current)

View File

@ -1,11 +0,0 @@
#!/bin/sh
set -ex
mkdir build && cd build
cmake .. \
-DQTDIR=/usr/local/opt/qt5 \
-DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \
-DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
-DCMAKE_INSTALL_PREFIX=/usr \
&& make -j4

View File

@ -1,8 +0,0 @@
#!/bin/sh
set -ex
cd /root/obs-websocket
mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4

View File

@ -1,27 +0,0 @@
#!/bin/sh
set -ex
# OBS Studio deps
brew update
brew install ffmpeg
brew install libav
# qtwebsockets deps
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/fdb7c6e960e830b3bf630850c0002c5df9f68ed8/Formula/qt5.rb
# Build obs-studio
cd ..
git clone --recursive https://github.com/jp9000/obs-studio
cd obs-studio
git checkout 19.0.2
mkdir build && cd build
cmake .. \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake \
&& make -j4
sudo make install
# Packages app
cd ..
curl -L -O https://www.slepin.fr/obs-websocket/ci/Packages.pkg -f --retry 5 -C -
sudo installer -pkg ./Packages.pkg -target /

View File

@ -1,57 +0,0 @@
#!/bin/sh
set -ex
# OBS Studio deps
apt-get -qq update
apt-get install -y \
libc-dev-bin libc6-dev \
git \
build-essential
apt-get install -y \
build-essential \
checkinstall \
cmake \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
pkg-config \
qtbase5-dev
# obs-websocket deps
apt-get install -y libqt5websockets5-dev
# Build obs-studio
cd /root
git clone https://github.com/jp9000/obs-studio ./obs-studio
cd obs-studio
git checkout 19.0.2
mkdir build && cd build
cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
make install
ldconfig

View File

@ -1,843 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PROJECT</key>
<dict>
<key>PACKAGE_FILES</key>
<dict>
<key>DEFAULT_INSTALL_LOCATION</key>
<string>/</string>
<key>HIERARCHY</key>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../../build/QtNetwork</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>292</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../../build/QtWebSockets</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>292</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>bin</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Resources</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Contents</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>OBS.app</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Applications</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../../build/obs-websocket.so</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>bin</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../../data</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>obs-websocket</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>plugins</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>obs-studio</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Application Support</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Automator</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Documentation</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Extensions</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Filesystems</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Frameworks</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Input Methods</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Internet Plug-Ins</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>LaunchAgents</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>LaunchDaemons</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>PreferencePanes</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Preferences</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Printers</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>PrivilegedHelperTools</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>QuickLook</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>QuickTime</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Screen Savers</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Scripts</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Services</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Widgets</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Library</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Shared</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>1023</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Users</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>/</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<key>PAYLOAD_TYPE</key>
<integer>0</integer>
<key>VERSION</key>
<integer>4</integer>
</dict>
<key>PACKAGE_SCRIPTS</key>
<dict>
<key>RESOURCES</key>
<array/>
</dict>
<key>PACKAGE_SETTINGS</key>
<dict>
<key>AUTHENTICATION</key>
<integer>1</integer>
<key>CONCLUSION_ACTION</key>
<integer>0</integer>
<key>IDENTIFIER</key>
<string>fr.palakis.obswebsocket</string>
<key>OVERWRITE_PERMISSIONS</key>
<false/>
<key>VERSION</key>
<string>4.0.0</string>
</dict>
<key>PROJECT_COMMENTS</key>
<dict>
<key>NOTES</key>
<data>
PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1M
IDQuMDEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQv
c3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1ldGEgaHR0cC1l
cXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7
IGNoYXJzZXQ9VVRGLTgiPgo8bWV0YSBodHRwLWVxdWl2PSJDb250
ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp
dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u
dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD
b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjE0MDQuMTMiPgo8c3R5bGUg
dHlwZT0idGV4dC9jc3MiPgo8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5
Pgo8L2JvZHk+CjwvaHRtbD4K
</data>
</dict>
<key>PROJECT_SETTINGS</key>
<dict>
<key>BUILD_PATH</key>
<dict>
<key>PATH</key>
<string>../../release</string>
<key>PATH_TYPE</key>
<integer>1</integer>
</dict>
<key>EXCLUDED_FILES</key>
<array>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.DS_Store</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove .DS_Store files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove ".DS_Store" files created by the Finder.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.pbdevelopment</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove .pbdevelopment files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>CVS</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.cvsignore</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.cvspass</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.svn</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.git</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.gitignore</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove SCM metadata</string>
<key>PROXY_TOOLTIP</key>
<string>Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>classes.nib</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>designable.db</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>info.nib</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Optimize nib files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>Resources Disabled</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove Resources Disabled folders</string>
<key>PROXY_TOOLTIP</key>
<string>Remove "Resources Disabled" folders.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>SEPARATOR</key>
<true/>
</dict>
</array>
<key>NAME</key>
<string>obs-websocket</string>
</dict>
</dict>
<key>TYPE</key>
<integer>1</integer>
<key>VERSION</key>
<integer>2</integer>
</dict>
</plist>

View File

@ -1,59 +0,0 @@
#!/bin/sh
set -e
echo "-- Preparing package build"
export QT_PREFIX="/usr/local/opt/qt5"
export WS_LIB="$QT_PREFIX/lib/QtWebSockets.framework/QtWebSockets"
export NET_LIB="$QT_PREFIX/lib/QtNetwork.framework/QtNetwork"
export GIT_HASH=$(git rev-parse --short HEAD)
export VERSION="$GIT_HASH-$TRAVIS_BRANCH"
export LATEST_VERSION="$TRAVIS_BRANCH"
if [ -n "${TRAVIS_TAG}" ]; then
export VERSION="$TRAVIS_TAG"
export LATEST_VERSION="$TRAVIS_TAG"
fi
export FILENAME="obs-websocket-$VERSION.pkg"
export LATEST_FILENAME="obs-websocket-latest-$LATEST_VERSION.pkg"
echo "-- Copying Qt dependencies"
cp $WS_LIB ./build
cp $NET_LIB ./build
chmod +rw ./build/QtWebSockets ./build/QtNetwork
echo "-- Modifying QtNetwork"
# TODO : put a loop in there
install_name_tool \
-change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork \
-change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
./build/QtNetwork
echo "-- Modifying QtWebSockets"
install_name_tool \
-change /usr/local/opt/qt/lib/QtWebSockets.framework/Versions/5/QtWebSockets @rpath/QtWebSockets \
-change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork @rpath/QtNetwork \
-change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
./build/QtWebSockets
echo "-- Modifying obs-websocket.so"
install_name_tool \
-change "$QT_PREFIX/lib/QtWebSockets.framework/Versions/5/QtWebSockets" @rpath/QtWebSockets \
-change "$QT_PREFIX/lib/QtWidgets.framework/Versions/5/QtWidgets" @rpath/QtWidgets \
-change "$QT_PREFIX/lib/QtNetwork.framework/Versions/5/QtNetwork" @rpath/QtNetwork \
-change "$QT_PREFIX/lib/QtGui.framework/Versions/5/QtGui" @rpath/QtGui \
-change "$QT_PREFIX/lib/QtCore.framework/Versions/5/QtCore" @rpath/QtCore \
./build/obs-websocket.so
chmod -w ./build/QtWebSockets ./build/QtNetwork
echo "-- Actual package build"
packagesbuild ./CI/osx/obs-websocket.pkgproj
echo "-- Renaming obs-websocket.pkg to $FILENAME"
mv ./release/obs-websocket.pkg ./release/$FILENAME
cp ./release/$FILENAME ./release/$LATEST_FILENAME

View File

@ -1,24 +0,0 @@
#!/bin/sh
set -e
cd /root/obs-websocket
export GIT_HASH=$(git rev-parse --short HEAD)
export PKG_VERSION="1-$GIT_HASH-$TRAVIS_BRANCH-git"
if [ -n "${TRAVIS_TAG}" ]; then
export PKG_VERSION="$TRAVIS_TAG"
fi
cd /root/obs-websocket/build
PAGER=cat checkinstall -y --type=debian --fstrans=no --nodoc \
--backup=no --deldoc=yes --install=no \
--pkgname=obs-websocket --pkgversion="$PKG_VERSION" \
--pkglicense="GPLv2.0" --maintainer="contact@slepin.fr" \
--requires="libqt5websockets5" --pkggroup="video" \
--pkgsource="https://github.com/Palakis/obs-websocket" \
--pakdir="/package"
chmod ao+r /package/*

View File

@ -1,139 +1,117 @@
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.16...3.21)
project(obs-websocket)
set(CMAKE_PREFIX_PATH "${QTDIR}") project(obs-websocket-compat VERSION 4.9.1)
set(CMAKE_INCLUDE_CURRENT_DIR ON) add_library(${CMAKE_PROJECT_NAME} MODULE)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
include(external/FindLibObs.cmake) set(PLUGIN_AUTHOR "OBS Project")
find_package(LibObs REQUIRED) set(MACOS_BUNDLEID "com.obsproject.${CMAKE_PROJECT_NAME}")
find_package(Qt5Core REQUIRED)
find_package(Qt5WebSockets REQUIRED)
find_package(Qt5Widgets REQUIRED)
add_subdirectory(deps/mbedtls EXCLUDE_FROM_ALL) set(LINUX_MAINTAINER_EMAIL "tt2468@irltoolkit.com")
set(ENABLE_PROGRAMS false)
set(obs-websocket_SOURCES target_compile_definitions(obs-websocket-compat PRIVATE ASIO_STANDALONE)
obs-websocket.cpp
WSServer.cpp
WSRequestHandler.cpp
WSEvents.cpp
Config.cpp
Utils.cpp
forms/settings-dialog.cpp)
set(obs-websocket_HEADERS target_sources(
obs-websocket.h ${CMAKE_PROJECT_NAME}
WSServer.h PRIVATE src/obs-websocket.cpp
WSRequestHandler.h src/WSServer.cpp
WSEvents.h src/ConnectionProperties.cpp
Config.h src/WSRequestHandler.cpp
Utils.h src/WSRequestHandler_General.cpp
forms/settings-dialog.h) src/WSRequestHandler_Profiles.cpp
src/WSRequestHandler_Recording.cpp
src/WSRequestHandler_ReplayBuffer.cpp
src/WSRequestHandler_SceneCollections.cpp
src/WSRequestHandler_Scenes.cpp
src/WSRequestHandler_SceneItems.cpp
src/WSRequestHandler_Sources.cpp
src/WSRequestHandler_Streaming.cpp
src/WSRequestHandler_VirtualCam.cpp
src/WSRequestHandler_StudioMode.cpp
src/WSRequestHandler_Transitions.cpp
src/WSRequestHandler_Outputs.cpp
src/WSRequestHandler_MediaControl.cpp
src/WSEvents.cpp
src/Config.cpp
src/Utils.cpp
src/rpc/RpcRequest.cpp
src/rpc/RpcResponse.cpp
src/rpc/RpcEvent.cpp
src/protocol/OBSRemoteProtocol.cpp
src/forms/settings-dialog.cpp
src/obs-websocket.h
src/WSServer.h
src/ConnectionProperties.h
src/WSRequestHandler.h
src/WSEvents.h
src/Config.h
src/Utils.h
src/rpc/RpcRequest.h
src/rpc/RpcResponse.h
src/rpc/RpcEvent.h
src/protocol/OBSRemoteProtocol.h
src/forms/settings-dialog.h)
target_include_directories(
obs-websocket-compat PRIVATE ${CMAKE_SOURCE_DIR}/deps/asio/asio/include
${CMAKE_SOURCE_DIR}/deps/websocketpp)
# /!\ TAKE NOTE: No need to edit things past this point /!\
find_package(libobs REQUIRED)
find_package(obs-frontend-api REQUIRED)
include(cmake/ObsPluginHelpers.cmake)
find_qt(COMPONENTS Widgets Core)
# --- Platform-independent build settings --- # --- Platform-independent build settings ---
add_library(obs-websocket MODULE
${obs-websocket_SOURCES}
${obs-websocket_HEADERS})
add_dependencies(obs-websocket mbedcrypto) target_include_directories(${CMAKE_PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/src)
include_directories( target_link_libraries(
"${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" ${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs OBS::obs-frontend-api Qt::Core
${Qt5Core_INCLUDES} Qt::Widgets)
${Qt5WebSockets_INCLUDES}
${Qt5Widgets_INCLUDES}
${mbedcrypto_INCLUDES}
"${CMAKE_SOURCE_DIR}/deps/mbedtls/include")
target_link_libraries(obs-websocket set_target_properties(
libobs ${CMAKE_PROJECT_NAME}
Qt5::Core PROPERTIES AUTOMOC ON
Qt5::WebSockets AUTOUIC ON
Qt5::Widgets AUTORCC ON)
mbedcrypto)
target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17)
# --- End of section --- # --- End of section ---
# --- Windows-specific build settings and tasks --- # --- Windows-specific build settings and tasks ---
if(WIN32) if(OS_WINDOWS)
if(NOT DEFINED OBS_FRONTEND_LIB) configure_file(cmake/bundle/windows/installer-Windows.iss.in
set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") ${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)
message(FATAL_ERROR "Could not find OBS Frontend API\'s library !")
endif()
target_link_libraries(obs-websocket if(MSVC)
"${OBS_FRONTEND_LIB}") target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /MP /d2FH4-)
endif()
# --- End of section ---
add_custom_command(TARGET obs-websocket POST_BUILD # -- macOS specific build settings and tasks --
COMMAND if $<CONFIG:Release>==1 ("${CMAKE_COMMAND}" -E copy elseif(OS_MACOS)
"${QTDIR}/bin/Qt5WebSockets.dll" configure_file(cmake/bundle/macos/installer-macos.pkgproj.in
"${QTDIR}/bin/Qt5Network.dll" ${CMAKE_BINARY_DIR}/installer-macos.generated.pkgproj)
"${CMAKE_BINARY_DIR}/$<CONFIG>")
COMMAND if $<CONFIG:Debug>==1 ("${CMAKE_COMMAND}" -E copy set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
"${QTDIR}/bin/Qt5WebSocketsd.dll" set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
"${QTDIR}/bin/Qt5Networkd.dll" set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1")
"${CMAKE_BINARY_DIR}/$<CONFIG>")
)
# --- Release package helper --- target_compile_options(
# The "release" folder has a structure similar OBS' one on Windows ${CMAKE_PROJECT_NAME} PRIVATE -Werror-implicit-function-declaration
set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") -stdlib=libc++ -fvisibility=default)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "")
set(ARCH_NAME "64bit") # --- End of section ---
else()
set(ARCH_NAME "32bit")
endif()
add_custom_command(TARGET obs-websocket POST_BUILD
COMMAND if $<CONFIG:Release>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${RELEASE_DIR}/data/obs-plugins/obs-websocket"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
COMMAND if $<CONFIG:Release>==1 ("${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${RELEASE_DIR}/data/obs-plugins/obs-websocket")
COMMAND if $<CONFIG:Release>==1 ("${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-websocket>"
"${QTDIR}/bin/Qt5WebSockets.dll"
"${QTDIR}/bin/Qt5Network.dll"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
)
# --- End of sub-section ---
# --- Linux-specific build settings and tasks ---
else()
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "")
endif() endif()
# --- End of section --- # --- End of section ---
# --- Linux-specific build settings and tasks --- setup_plugin_target(${CMAKE_PROJECT_NAME})
if(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
target_compile_options(mbedcrypto PRIVATE -fPIC)
set_target_properties(obs-websocket PROPERTIES PREFIX "")
target_link_libraries(obs-websocket
obs-frontend-api)
file(GLOB locale_files data/locale/*.ini)
install(TARGETS obs-websocket
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/obs-plugins")
install(FILES ${locale_files}
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/obs/obs-plugins/obs-websocket/locale")
endif()
# --- End of section ---
# -- OS X specific build settings and tasks --
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default")
set_target_properties(obs-websocket PROPERTIES PREFIX "")
target_link_libraries(obs-websocket "${OBS_FRONTEND_LIB}")
endif()
# -- End of section --

82
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,82 @@
# Contributing to obs-websocket
## Translating obs-websocket to your language
Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket)
## Branches
**Development happens on `4.x-current`**
## Writing code for obs-websocket
### Code Formatting Guidelines
* Function and variable names: snake_case for C names, camelCase for C++ method names
* Request and Event names should use MixedCaps names
* Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml)
* Code is indented with Tabs. Assume they are 8 columns wide
* 80 columns max code width. (Docs can be larger)
* New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples).
These are required to automatically generate the [protocol specification document](docs/generated/protocol.md).
### Code Best-Practices
* Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this:
```cpp
if (success) {
return req->SendOKResponse();
} else {
return req->SendErrorResponse("something went wrong");
}
```
is better like this:
```cpp
if (!success) {
return req->SendErrorResponse("something went wrong");
}
return req->SendOKResponse();
```
* Some example common response/request property names are:
* `sceneName` - The name of a scene
* `sourceName` - The name of a source
* `fromScene` - From a scene - scene name
### Commit Guidelines
* Commits follow the 50/72 standard:
* 50 characters max for the commit title (excluding scope name)
* One empty line after the title
* Description wrapped to 72 columns max width per line.
* Commit titles:
* Use present tense
* Prefix the title with a "scope" name
* e.g: "CI: fix wrong behaviour when packaging for OS X"
* Typical scopes: CI, General, Requests, Events, Server
**Example commit:**
```
Requests: Add GetTransitionPosition
Adds a new request called `GetTransitionPosition` which gets the current
transition's state from 0.0f to 1.0f. Works with both auto and manual
transitions.
```
### Pull Requests
* Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`).
* Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...)
* Only open a pull request if you are ready to show off your work.
* If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers),
create it as a Draft Pull Request (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request").

View File

@ -1,199 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@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/>
*/
#include <mbedtls/base64.h>
#include <mbedtls/sha256.h>
#include <obs-frontend-api.h>
#include <util/config-file.h>
#include <string>
#include "Config.h"
#define SECTION_NAME "WebsocketAPI"
#define PARAM_ENABLE "ServerEnabled"
#define PARAM_PORT "ServerPort"
#define PARAM_DEBUG "DebugEnabled"
#define PARAM_AUTHREQUIRED "AuthRequired"
#define PARAM_SECRET "AuthSecret"
#define PARAM_SALT "AuthSalt"
Config *Config::_instance = new Config();
Config::Config()
{
// Default settings
ServerEnabled = true;
ServerPort = 4444;
DebugEnabled = false;
AuthRequired = false;
Secret = "";
Salt = "";
SettingsLoaded = false;
// OBS Config defaults
config_t* obs_config = obs_frontend_get_global_config();
if (obs_config)
{
config_set_default_bool(obs_config,
SECTION_NAME, PARAM_ENABLE, ServerEnabled);
config_set_default_uint(obs_config,
SECTION_NAME, PARAM_PORT, ServerPort);
config_set_default_bool(obs_config,
SECTION_NAME, PARAM_DEBUG, DebugEnabled);
config_set_default_bool(obs_config,
SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired);
config_set_default_string(obs_config,
SECTION_NAME, PARAM_SECRET, Secret);
config_set_default_string(obs_config,
SECTION_NAME, PARAM_SALT, Salt);
}
mbedtls_entropy_init(&entropy);
mbedtls_ctr_drbg_init(&rng);
mbedtls_ctr_drbg_seed(&rng, mbedtls_entropy_func, &entropy, nullptr, 0);
//mbedtls_ctr_drbg_set_prediction_resistance(&rng, MBEDTLS_CTR_DRBG_PR_ON);
SessionChallenge = GenerateSalt();
}
Config::~Config()
{
mbedtls_ctr_drbg_free(&rng);
mbedtls_entropy_free(&entropy);
}
void Config::Load()
{
config_t* obs_config = obs_frontend_get_global_config();
ServerEnabled = config_get_bool(obs_config, SECTION_NAME, PARAM_ENABLE);
ServerPort = config_get_uint(obs_config, SECTION_NAME, PARAM_PORT);
DebugEnabled = config_get_bool(obs_config, SECTION_NAME, PARAM_DEBUG);
AuthRequired = config_get_bool(obs_config, SECTION_NAME, PARAM_AUTHREQUIRED);
Secret = config_get_string(obs_config, SECTION_NAME, PARAM_SECRET);
Salt = config_get_string(obs_config, SECTION_NAME, PARAM_SALT);
}
void Config::Save()
{
config_t* obs_config = obs_frontend_get_global_config();
config_set_bool(obs_config, SECTION_NAME, PARAM_ENABLE, ServerEnabled);
config_set_uint(obs_config, SECTION_NAME, PARAM_PORT, ServerPort);
config_set_bool(obs_config, SECTION_NAME, PARAM_DEBUG, DebugEnabled);
config_set_bool(obs_config, SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired);
config_set_string(obs_config, SECTION_NAME, PARAM_SECRET, Secret);
config_set_string(obs_config, SECTION_NAME, PARAM_SALT, Salt);
config_save(obs_config);
}
const char* Config::GenerateSalt()
{
// Generate 32 random chars
unsigned char* random_chars = (unsigned char*)bzalloc(32);
mbedtls_ctr_drbg_random(&rng, random_chars, 32);
// Convert the 32 random chars to a base64 string
char* salt = (char*)bzalloc(64);
size_t salt_bytes;
mbedtls_base64_encode(
(unsigned char*)salt, 64, &salt_bytes,
random_chars, 32);
bfree(random_chars);
return salt;
}
const char* Config::GenerateSecret(const char *password, const char *salt)
{
// Concatenate the password and the salt
std::string passAndSalt = "";
passAndSalt += password;
passAndSalt += salt;
// Generate a SHA256 hash of the password
unsigned char* challengeHash = (unsigned char*)bzalloc(32);
mbedtls_sha256(
(unsigned char*)passAndSalt.c_str(), passAndSalt.length(),
challengeHash, 0);
// Encode SHA256 hash to Base64
char* challenge = (char*)bzalloc(64);
size_t challenge_bytes = 0;
mbedtls_base64_encode(
(unsigned char*)challenge, 64, &challenge_bytes,
challengeHash, 32);
bfree(challengeHash);
return challenge;
}
void Config::SetPassword(const char *password)
{
const char *new_salt = GenerateSalt();
const char *new_challenge = GenerateSecret(password, new_salt);
this->Salt = new_salt;
this->Secret = new_challenge;
}
bool Config::CheckAuth(const char *response)
{
// Concatenate auth secret with the challenge sent to the user
std::string challengeAndResponse = "";
challengeAndResponse += this->Secret;
challengeAndResponse += this->SessionChallenge;
// Generate a SHA256 hash of challengeAndResponse
unsigned char* hash = (unsigned char*)bzalloc(32);
mbedtls_sha256(
(unsigned char*)challengeAndResponse.c_str(),
challengeAndResponse.length(),
hash, 0);
// Encode the SHA256 hash to Base64
char* expected_response = (char*)bzalloc(64);
size_t base64_size = 0;
mbedtls_base64_encode(
(unsigned char*)expected_response, 64, &base64_size,
hash, 32);
bool authSuccess = false;
if (strcmp(expected_response, response) == 0) {
SessionChallenge = GenerateSalt();
authSuccess = true;
}
bfree(hash);
bfree(expected_response);
return authSuccess;
}
Config* Config::Current()
{
return _instance;
}

View File

@ -1,967 +0,0 @@
obs-websocket 4.1 protocol reference
================================
**This is the reference for the latest 4.1 developement build. [See here for obs-websocket 4.0.0!](https://github.com/Palakis/obs-websocket/blob/4.0.0/PROTOCOL.md)**
## General Introduction
Messages exchanged between the client and the server are JSON objects.
The protocol in general is based on the OBS Remote protocol created by Bill Hamilton, with new commands specific to OBS Studio.
### Table of contents
* [Authentication](#authentication)
* [Events](#events)
- [Description](#description)
- [Event Types](#event-types)
- **Scenes**
- ["SwitchScenes"](#switchscenes)
- ["ScenesChanged"](#sceneschanged)
- **Scene Items**
- ["SourceOrderChanged"](#sourceorderchanged)
- ["SceneItemAdded"](#sceneitemadded)
- ["SceneItemRemoved"](#sceneitemremoved)
- ["SceneItemVisibilityChanged"](#sceneitemvisibilitychanged)
- **Scene Collections**
- ["SceneCollectionChanged"](#scenecollectionchanged)
- ["SceneCollectionListChanged"](#scenecollectionlistchanged)
- **Transitions**
- ["SwitchTransition"](#switchtransition)
- ["TransitionDurationChanged"](#transitiondurationchanged)
- ["TransitionListChanged"](#transitionlistchanged)
- ["TransitionBegin"](#transitionbegin)
- **Studio Mode**
- ["PreviewSceneChanged"](#previewscenechanged)
- ["StudioModeSwitched"](#studiomodeswitched)
- **Profiles**
- ["ProfileChanged"](#profilechanged)
- ["ProfileListChanged"](#profilelistchanged)
- **Streaming**
- ["StreamStarting"](#streamstarting)
- ["StreamStarted"](#streamstarted)
- ["StreamStopping"](#streamstopping)
- ["StreamStopped"](#streamstopped)
- ["StreamStatus"](#streamstatus)
- **Recording**
- ["RecordingStarting"](#recordingstarting)
- ["RecordingStarted"](#recordingstarted)
- ["RecordingStopping"](#recordingstopping)
- ["RecordingStopped"](#recordingstopped)
- **Other**
- ["Exiting"](#exiting)
* [Requests](#requests)
- [Description](#description-1)
- [Request Types](#request-types)
- **General**
- ["GetVersion"](#getversion)
- ["GetAuthRequired"](#getauthrequired)
- ["Authenticate"](#authenticate)
- **Scenes**
- ["GetCurrentScene"](#getcurrentscene)
- ["SetCurrentScene"](#setcurrentscene)
- ["GetSceneList"](#getscenelist)
- **Studio Mode**
- ["GetStudioModeStatus"](#getstudiomodestatus)
- ["SetPreviewScene"](#setpreviewscene)
- ["TransitionToProgram"](#transitiontoprogram)
- ["EnableStudioMode"](#enablestudiomode)
- ["DisableStudioMode"](#disablestudiomode)
- ["ToggleStudioMode"](#togglestudiomode)
- **Streaming**
- ["StartStopStreaming"](#startstopstreaming)
- ["StartStreaming"](#startstreaming)
- ["StopStreaming"](#stopstreaming)
- ["GetStreamingStatus"](#getstreamingstatus)
- **Recording**
- ["StartStopRecording"](#startstoprecording)
- ["StartRecording"](#startrecording)
- ["StopRecording"](#stoprecording)
- ["GetStreamingStatus"](#getstreamingstatus)
- ["SetRecordingFolder"](#setrecordingfolder)
- ["GetRecordingFolder"](#getrecordingfolder)
- **Transitions**
- ["GetTransitionList"](#gettransitionlist)
- ["GetCurrentTransition"](#getcurrenttransition)
- ["SetCurrentTransition"](#setcurrenttransition)
- ["GetTransitionDuration"](#gettransitionduration)
- ["SetTransitionDuration"](#settransitionduration)
- **Sources**
- ["GetCurrentScene"](#getcurrentscene)
- ["GetSceneList"](#getscenelist)
- ["GetSpecialSources"](#getspecialsources)
- ["GetTextGDIPlusProperties"](#gettextgdiplusproperties)
- ["SetTextGDIPlusProperties"](#settextgdiplusproperties)
- ["GetBrowserSourceProperties"](#getbrowsersourceproperties)
- ["SetBrowserSourceProperties"](#setbrowsersourceproperties)
- ["SetVolume"](#setvolume)
- ["GetVolume"](#getvolume)
- ["SetMute"](#setmute)
- ["GetMute"](#getmute)
- ["ToggleMute"](#togglemute)
- **Scene Items**
- ["SetSceneItemRender"](#setsourcerender) (a.k.a `SetSourceRender`)
- ["SetSceneItemPosition"](#setsceneitemposition)
- ["SetSceneItemTransform"](#setsceneitemtransform)
- ["SetSceneItemCrop"](#setsceneitemcrop)
- **Scene Collections**
- ["ListSceneCollections"](#listscenecollections)
- ["SetCurrentSceneCollection"](#setcurrentscenecollection)
- ["GetCurrentSceneCollection"](#getcurrentscenecollection)
- **Streaming Server Settings**
- ["GetStreamSettings"](#getstreamsettings)
- ["SetStreamSettings"](#setstreamsettings)
- ["SaveStreamSettings"](#savestreamsettings)
- **Profiles**
- ["ListProfiles"](#listprofiles)
- ["SetCurrentProfile"](#setcurrentprofile)
- ["GetCurrentProfile"](#getcurrentprofile)
## Authentication
A call to [`GetAuthRequired`](#getauthrequired) gives the client two elements :
- A challenge : a random string that will be used to generate the auth response
- A salt : applied to the password when generating the auth response
The client knows a password and must it to authenticate itself to the server.
However, it must keep this password secret, and it is the purpose of the authentication mecanism used by obs-websocket.
After a call to [`GetAuthRequired`](#getauthrequired), the client knows a password (kept secret), a challenge and a salt (sent by the server).
To generate the answer to the auth challenge, follow this procedure :
- Concatenate the password with the salt sent by the server (in this order : password + server salt), then generate a binary SHA256 hash of the result and encode the resulting SHA256 binary hash to base64.
- Concatenate the base64 secret with the challenge sent by the server (in this order : base64 secret + server challenge), then generate a binary SHA256 hash of the result and encode it to base64.
- Voilà, this last base64 string is the auth response. You may now use it to authenticate to the server with the `Authenticate` request.
Here's how it looks in pseudocode :
```
password = "supersecretpassword"
challenge = "ztTBnnuqrqaKDzRM3xcVdbYm"
salt = "PZVbYpvAnZut2SS6JNJytDm9"
secret_string = password + salt
secret_hash = binary_sha256(secret_string)
secret = base64_encode(secret_hash)
auth_response_string = secret + challenge
auth_response_hash = binary_sha256(auth_response_string)
auth_response = base64_encode(auth_response_hash)
```
A client can then authenticate to the server by calling [`Authenticate`](#authenticate) with the computed challenge response.
## Events
### Description
Events are sent exclusively by the server and broadcast to each connected client.
An event message will contain at least one field :
- **update-type** (string) : the type of event
- **stream-timecode** (string, optional) : time elapsed between now and stream start (only present if OBS Studio is streaming)
- **rec-timecode** (string, optional) : time elapsed between now and recording start (only present if OBS Studio is recording)
Timecodes are in the following format : HH:MM:SS.mmm
Additional fields will be present in the event message depending on the event type.
### Event Types
#### "SwitchScenes"
OBS is switching to another scene (called at the end of the transition).
- **scene-name** (string) : The name of the scene being switched to.
- **sources** (array of objects) : List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene).
---
#### "ScenesChanged"
The scene list has been modified (Scenes have been added, removed, or renamed).
---
#### "SourceOrderChanged"
Scene items have been reordered.
- **"scene-name"** (string) : name of the scene where items have been reordered
---
#### "SceneItemAdded"
An item has been added to the current scene.
- **"scene-name"** (string) : name of the scene
- **"item-name"** (string) : name of the item added to **scene-name**
---
#### "SceneItemRemoved"
An item has been removed from the current scene.
- **"scene-name"** (string) : name of the scene
- **"item-name"** (string) : name of the item removed from **scene-name**
---
#### "SceneItemVisibilityChanged"
An item's visibility has been toggled.
- **"scene-name"** (string) : name of the scene
- **"item-name"** (string) : name of the item in **scene-name**
- **"item-visible"** (bool) : new visibility of item **item-name**
---
#### "SceneCollectionChanged"
Triggered when switching to another scene collection or when renaming the current scene collection.
---
#### "SceneCollectionListChanged"
Triggered when a scene collection is created, added, renamed or removed.
---
#### "SwitchTransition"
The active transition has been changed.
- **transition-name** (string) : The name of the active transition.
---
#### "TransitionDurationChanged"
Triggered when the transition duration has changed.
- **"new-duration"** (integer) : new transition duration
---
#### "TransitionListChanged"
The list of available transitions has been modified (Transitions have been added, removed, or renamed).
---
#### "TransitionBegin"
A transition other than "Cut" has begun.
---
#### "PreviewSceneChanged"
The selected Preview scene changed (only in Studio Mode).
- **scene-name** (string) : Name of the scene being previewed.
- **sources** (array of objects) : List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene).
---
#### "StudioModeSwitched"
Studio Mode has been switched on or off.
- **"new-state"** (bool) : new state of Studio Mode: true if enabled, false if disabled.
---
#### "ProfileChanged"
Triggered when switching to another profile or when renaming the current profile.
---
#### "ProfileListChanged"
Triggered when a profile is created, added, renamed or removed.
---
#### "StreamStarting"
A request to start streaming has been issued.
- **preview-only** (bool) : Always false.
---
#### "StreamStarted"
Streaming started successfully.
---
#### "StreamStopping"
A request to stop streaming has been issued.
- **preview-only** (bool) : Always false.
---
#### "StreamStopped"
Streaming stopped successfully.
---
#### "RecordingStarting"
A request to start recording has been issued.
---
#### "RecordingStarted"
Recording started successfully.
---
#### "RecordingStopping"
A request to stop streaming has been issued.
---
#### "RecordingStopped"
Recording stopped successfully.
---
#### "StreamStatus"
Sent every 2 seconds with the following information :
- **streaming** (bool) : Current Streaming state.
- **recording** (bool) : Current Recording state.
- **preview-only** (bool) : Always false.
- **bytes-per-sec** (integer) : Amount of data per second (in bytes) transmitted by the stream encoder.
- **kbits-per-sec** (integer) : "bytes-per-sec" converted to kilobits per second
- **strain** (double) : Percentage of dropped frames
- **total-stream-time** (integer) : Total time (in seconds) since the stream started.
- **num-total-frames** (integer) : Total number of frames transmitted since the stream started.
- **num-dropped-frames** (integer) : Number of frames dropped by the encoder since the stream started.
- **fps** (double) : Current framerate.
---
#### "Exiting"
OBS is exiting.
---
## Requests
### Description
Requests are sent by the client and must have at least the following two fields :
- **"request-type"** (string) : One of the request types listed in the sub-section "[Requests Types](#request-types)".
- **"message-id"** (string) : An identifier defined by the client which will be embedded in the server response.
Depending on the request type additional fields may be required (see the "[Request Types](#request-types)" section below for more information).
Once a request is sent, the server will return a JSON response with the following fields :
- **"message-id"** (string) : The identifier specified in the request.
- **"status"** (string) : Response status, will be one of the following : "ok", "error"
- **"error"** (string) : The error message associated with an "error" status.
Depending on the request type additional fields may be present (see the "[Request Types](#request-types)" section below for more information).
### Request Types
#### "GetVersion"
Returns the latest version of the plugin and the API.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"version"** (double) : OBSRemote API version. Fixed to 1.1 for retrocompatibility.
- **"obs-websocket-version"** (string) : obs-websocket version string
- **"obs-studio-version"** (string) : OBS Studio version string
---
#### "GetAuthRequired"
Tells the client if authentication is required. If it is, authentication parameters "challenge" and "salt" are passed in the response fields (see "Authentication").
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"authRequired"** (bool)
- **"challenge"** (string)
- **"salt"** (string)
---
#### "Authenticate"
Try to authenticate the client on the server.
__Request fields__ :
- **"auth"** (string) : response to the auth challenge (see "Authentication").
__Response__ : OK if auth succeeded, error if invalid credentials. No additional fields.
---
#### "GetCurrentScene"
Get the current scene's name and items.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"name"** (string) : name of the current scene
- **"sources"** (array of objects) : ordered list of the current scene's items descriptions
Objects in the "sources" array have the following fields :
- **"name"** (string) : name of the source associated with the scene item
- **"type"** (string) : internal source type name
- **"volume"** (double) : audio volume of the source, ranging from 0.0 to 1.0
- **"x"** (double) : X coordinate of the top-left corner of the item in the scene
- **"y"** (double) : Y coordinate of the top-left corner of the item in the scene
- **"source_cx"** (integer) : width of the item (without scale applied)
- **"source_cy"** (integer) : height of the item (without scale applied)
- **"cx"** (double) : width of the item (with scale applied)
- **"cy"** (double) : height of the item (with scale applied)
- **"render"** (bool) : visibility of the source in the scene
---
#### "SetCurrentScene"
Switch to the scene specified in "scene-name".
__Request fields__ :
- **"scene-name"** (string) : name of the scene to switch to.
__Response__ : always OK if scene exists, error if it doesn't. No additional fields
---
#### "GetSceneList"
List OBS' scenes.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"current-scene"** (string) : name of the currently active scene
- **"scenes"** (array of objects) : ordered list of scene descriptions (see `GetCurrentScene` for reference)
---
#### "SetSourceRender"
Show or hide a specific source in the current scene.
__Request fields__ :
- **"source"** (string) : name of the source in the currently active scene.
- **"render"** (bool) : desired visibility
- **"scene-name"** (string; optional) : name of the scene the source belongs to. defaults to current scene.
__Response__ : OK if source exists in the current scene, error otherwise.
---
#### "GetStudioModeStatus"
Tells if Studio Mode is currently enabled or disabled.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"studio-mode"** (bool) : true if OBS is in Studio Mode, false otherwise.
---
#### "GetPreviewScene"
Studio Mode only. Gets the name of the currently Previewed scene, along with a list of its sources.
__Request fields__ : none
__Response__ : OK if Studio Mode is enabled, with the same fields as [`GetCurrentScene`](#getcurrentscene), error otherwise.
---
#### "SetPreviewScene"
Studio Mode only. Sets the specified scene as the Previewed scene in Studio Mode.
__Request fields__ :
- **"scene-name"** (string) : name of the scene to selected as the preview of Studio Mode
__Response__ : OK if Studio Mode is enabled and specified scene exists, error otherwise.
---
#### "TransitionToProgram"
Studio Mode only. Transitions the currently previewed scene to Program (main output).
__Request fields__ :
- **"with-transition"** (object, optional) : if specified, use this transition when switching from preview to program. This will change the current transition in the frontend to this one.
__Response__ : OK if studio mode is enabled and optional transition exists, error otherwise.
An object passed as `"with-transition"` in a request must have the following fields :
- **"name"** (string, optional) : transition name
- **"duration"** (integer, optional) : transition duration in milliseconds
---
#### "EnableStudioMode"
Enables Studio Mode.
__Request fields__ : none
__Response__ : always OK. No additional fields.
---
#### "DisableStudioMode"
Disables Studio Mode.
__Request fields__ : none
__Response__ : always OK. No additional fields.
---
#### "ToggleStudioMode"
Toggles Studio Mode on or off.
__Request fields__ : none
__Response__ : always OK. No additional fields.
---
#### "StartStopStreaming"
Toggles streaming on or off.
__Request fields__ : none
__Response__ : always OK. No additional fields.
---
#### "StartStopRecording"
Toggles recording on or off.
__Request fields__ :
- **"stream"** (object; optional) : See 'stream' parameter in 'StartStreaming'. Ignored if stream is already started.
__Response__ : always OK. No additional fields.
---
#### "StartStreaming"
Start streaming.
__Request fields__ :
- **"stream"** (object; optional) : If specified allows for special configuration of the stream
The 'stream' object has the following fields:
- **"settings"** (object; optional) : The settings for the stream
- **"type"** (string; optional) : If specified ensures the type of the stream matches the given type (usually 'rtmp\_custom' or 'rtmp\_common'). If the currently configured stream type does not match the given stream type, all settings must be specified in the 'settings' object or an error will occur starting the stream.
- **"metadata"** (object; optional) : Adds the given object parameters as encoded query string parameters to the 'key' of the RTMP stream. Used to pass data to the RTMP service about the stream.
The 'settings' object has the following fields:
- **"server"** (string; optional) : The publish URL
- **"key"** (string; optional) : The publish key of the stream
- **"use-auth"** (bool; optional) : should authentication be used when connecting to the streaming server
- **"username"** (string; optional) : if authentication is enabled, the username for access to the streaming server. Ignored if 'use-auth' is not specified as 'true'.
- **"password"** (string; optional) : if authentication is enabled, the password for access to the streaming server. Ignored if 'use-auth' is not specified as 'true'.
The 'metadata' object supports passing any string, numeric or boolean field.
__Response__ : Error if streaming is already active, OK otherwise. No additional fields.
---
#### "StopStreaming"
Stop streaming.
__Request fields__ : none
__Response__ : Error if streaming is already inactive, OK otherwise. No additional fields.
---
#### "StartRecording"
Start recording.
__Request fields__ : none
__Response__ : Error if recording is already active, OK otherwise. No additional fields.
---
#### "StopRecording"
Stop recording.
__Request fields__ : none
__Response__ : Error if recording is already inactive, OK otherwise. No additional fields.
---
#### "SetRecordingFolder"
Change the current recording folder.
__Request fields__ :
- **"rec-folder"** (string) : path of the desired recording folder
__Response__ : OK if path is valid, error otherwise.
---
#### "GetRecordingFolder"
Get the path of the current recording folder.
__Request fields__ : none
__Response__ : OK with these additional fields :
- **"rec-folder"** (string) : path of the current recording folder
---
#### "GetStreamingStatus"
Get current streaming and recording status.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"streaming"** (bool) : streaming status (active or not)
- **"recording"** (bool) : recording status (active or not)
- **stream-timecode** (string, optional) : time elapsed between now and stream start (only present if OBS Studio is streaming)
- **rec-timecode** (string, optional) : time elapsed between now and recording start (only present if OBS Studio is recording)
- **"preview-only"** (bool) : always false. Retrocompat with OBSRemote.
---
#### "GetTransitionList"
List all transitions available in the frontend's dropdown menu.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"current-transition"** (string) : name of the current transition
- **"transitions"** (array of objects) : list of transition descriptions
Objects in the "transitions" array have only one field :
- **"name"** (string) : name of the transition
---
#### "GetCurrentTransition"
Get the name of the currently selected transition in the frontend's dropdown menu.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"name"** (string) : name of the selected transition
- **"duration"** (integer, only if transition supports this) : transition duration
---
#### "SetCurrentTransition"
__Request fields__ :
- **"transition-name"** (string) : The name of the transition.
__Response__ : OK if specified transition exists, error otherwise.
---
#### "SetTransitionDuration"
Set the duration of the currently selected transition.
__Request fields__ :
- **"duration"** (integer) : desired transition duration in milliseconds
__Response__ : always OK.
---
#### "GetTransitionDuration"
Set the duration of the currently selected transition.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"transition-duration"** (integer) : current transition duration, in milliseconds
---
#### "SetVolume"
Set the volume of a specific source.
__Request fields__ :
- **"source"** (string) : the name of the source
- **"volume"** (double) : the desired volume
__Response__ : OK if specified source exists, error otherwise.
---
#### "GetVolume"
Get the volume of a specific source.
__Request fields__ :
- **"source"** (string) : name of the source
__Response__ : OK if source exists, with these additional fields :
- **"name"** (string) : source name
- **"volume"** (double) : source volume, on a linear scale (0.0 to 1.0)
- **"muted"** (bool) : source mute status
---
#### "SetMute"
Mutes or unmutes a specific source.
__Request fields__ :
- **"source"** (string) : the name of the source
- **"mute"** (bool) : the desired mute status
__Response__ : OK if specified source exists, error otherwise.
---
#### "GetMute"
Get mute status of a specific source.
__Request fields__ :
- **"source"** (string) : the name of the source
__Response__ : OK if source exists, with these additional fields :
- **"name"** (string) : source name
- **"muted"** (bool) : source mute status
---
#### "ToggleMute"
Inverts the mute status of a specific source.
__Request fields__ :
- **"source"** (string) : the name of the source
__Response__ : OK if specified source exists, error otherwise.
---
#### "GetSpecialSources"
Get configured special sources like Desktop Audio and Mic/Aux sources.
__Request fields__ : none
__Response__ : always OK, with these additional fields :
- **"desktop-1"** (string, optional) : Name of the first Desktop Audio capture source
- **"desktop-1"** (string, optional) : Name of the second Desktop Audio capture source
- **"mic-1"** (string, optional) : Name of the first Mic/Aux input source
- **"mic-2"** (string, optional) : Name of the second Mic/Aux input source
- **"mic-3"** (string, optional) : Name of the third Mic/Aux input source
---
#### "SetSceneItemPosition"
__Request fields__ :
- **"item"** (string) : The name of the scene item.
- **"x"** (float) : x coordinate
- **"y"** (float) : y coordinate
- **"scene-name"** (string) : scene the item belongs to. defaults to current scene.
__Response__ : OK if specified item exists, error otherwise.
---
#### "SetSceneItemTransform"
__Request fields__ :
- **"item"** (string) : The name of the scene item.
- **"x-scale"** (float) : width scale factor
- **"y-scale"** (float) : height scale factor
- **"rotation"** (float) : item rotation (in degrees)
- **"scene-name"** (string) : scene the item belongs to. defaults to current scene.
__Response__ : OK if specified item exists, error otherwise.
---
#### "SetSceneItemCrop"
__Request fields__ :
- **"item"** (string) : Name of the scene item
- **"scene-name"** (string, optional) : Scene the item belongs to. Default : current scene.
- **"top"** (integer)
- **"bottom"** (integer)
- **"left"** (integer)
- **"right"** (integer)
__Response__ : OK if specified item exists, error otherwise.
---
#### "SetCurrentSceneCollection"
Change the current scene collection.
__Request fields__ :
- **"sc-name"** (string) : name of the desired scene collection
__Response__ : OK if scene collection exists, error otherwise.
---
#### "GetCurrentSceneCollection"
Get the name of the current scene collection.
__Request fields__ : none
__Response__ : OK with these additional fields :
- **"sc-name"** (string) : name of the current scene collection
---
#### "ListSceneCollections"
Get a list of available scene collections.
__Request fields__ : none
__Response__ : OK with these additional fields :
- **"scene-collections"** (array of objects) : names of available scene collections
---
#### "GetStreamSettings"
Gets the current streaming server settings
__Request fields__ : none
__Response__ : OK with these additional fields :
- **"type"** (string) : The type of streaming service configuration usually 'rtmp\_custom' or 'rtmp\_common'
- **"settings"** (object) : The actual settings of the stream (i.e. server, key, use-auth, username, password)
The 'settings' object has the following fields however they may vary by 'type':
- **"server"** (string) : The publish URL
- **"key"** (string) : The publish key of the stream
- **"use-auth"** (bool) : should authentication be used when connecting to the streaming server
- **"username"** (string) : if authentication is enabled, the username for access to the streaming server
- **"password"** (string) : if authentication is enabled, the password for access to the streaming server
--
#### "SetStreamSettings"
Sets one or more attributes of the current streaming server settings. Any options not passed will remain unchanged. Returns the updated settings in response.
If 'type' is different than the current streaming service type, all settings are required.
Returns the full settings of the stream (i.e. the same as GetStreamSettings)
__Request fields__ :
- **"type"** (string) : The type of streaming service configuration usually 'rtmp\_custom' or 'rtmp\_common'
- **"settings"** (object) : The actual settings of the stream (i.e. server, key, use-auth, username, password)
- **"save"** (bool) : If specified as true, saves the settings to disk
The 'settings' object has the following fields however they may vary by 'type':
- **"server"** (string; optional) : The publish URL
- **"key"** (string; optional) : The publish key of the stream
- **"use-auth"** (bool; optional) : should authentication be used when connecting to the streaming server
- **"username"** (string; optional) : if authentication is enabled, the username for access to the streaming server
- **"password"** (string; optional) : if authentication is enabled, the password for access to the streaming server
__Response__ : OK with the same fields as the request (except 'save')
---
#### "SaveStreamSettings"
Saves the current streaming server settings to disk
__Request fields__ : none
__Response__ : OK
#### "SetCurrentProfile"
Change the current profile.
__Request fields__ :
- **"profile-name"** (string) : name of the desired profile
__Response__ : OK if profile exists, error otherwise.
---
#### "GetCurrentProfile"
Get the name of the current profile.
__Request fields__ : none
__Response__ : OK with these additional fields :
- **"profile-name"** (string) : name of the current profile
---
#### "ListProfiles"
Get a list of available profiles.
__Request fields__ : none
__Response__ : OK with the additional fields :
- **"profiles"** (array of objects) : names of available profiles
---
#### "GetTextGDIPlusProperties"
Gets current properties for Text GDI Plus source.
__Request fields__ :
- **"source"** (string) : name of the source in the currently active scene.
- **"scene-name"** (string; optional) : name of the scene the source belongs to. defaults to current scene.
__Response__ : OK if source exists in the current scene with these additional fields when fields are set, error otherwise.
- **"align"** (string) : "left","center","right" : text alignment
- **"bk_color"** (integer) : background color
- **"bk_opacity"** (integer) : background opacity range 0 to 100
- **"chatlog"** (bool) : chat log
- **"chatlog_lines"** (integer) : chat log lines
- **"color"** (integer) : text color
- **"extents"** (bool) : extents
- **"extents_wrap"** (bool) : extents wrap
- **"extents_cx"** (integer) : extents cx
- **"extents_cy"** (integer) : extents cy
- **"file"** (string) : file path name
- **"read_from_file"** (bool) : read text from file specified
- **"font"** (object) : holds font data for face, flags, size and style
-- Example: "font": {"face": "Arial","flags": 0,"size": 150,"style": ""}
- **"face"** (string) : font face i.e. Arial
- **"flags"** (integer) : font text style flag i.e. Bold 1, Italic 2, Bold Italic 3, Underline 5, Strikeout 8
- **"size"** (integer) : font text size
- **"style"** (string) : font style (unknown function)
- **"gradient"** (bool) : gradient
- **"gradient_color"** (integer) : gradient color
- **"gradient_dir"** (float) : gradient direction
- **"gradient_opacity"** (integer) : gradient opacity range 0 to 100
- **"outline"** (bool) : outline
- **"outline_color"** (integer) : outline color
- **"outline_size"** (integer) : outline size
- **"outline_opacity"** (integer) : outline opacity range 0 to 100
- **"text"** (string) : text to be displayed
- **"valign"** (string) : "top","center","bottom" : text vertical alignment
- **"vertical"** (bool) : vertical text
- **"render"** (bool) : visibility of the scene item
---
#### "SetTextGDIPlusProperties"
Sets current properties for Text GDI Plus source.
__Request fields__ :
- **"source"** (string) : name of the source in the currently active scene.
- **"scene-name"** (string; optional) : name of the scene the source belongs to. defaults to current scene.
- **"align"** (string; optional) : "left","center","right" : text alignment
- **"bk_color"** (integer; optional) : background color
- **"bk_opacity"** (integer; optional) : background opacity range 0 to 100
- **"chatlog"** (bool; optional) : chat log
- **"chatlog_lines"** (integer; optional) : chat log lines
- **"color"** (integer; optional) : text color
- **"extents"** (bool; optional) : extents
- **"extents_wrap"** (bool; optional) : extents wrap
- **"extents_cx"** (integer; optional) : extents cx
- **"extents_cy"** (integer; optional) : extents cy
- **"file"** (string; optional) : file path name
- **"read_from_file"** (bool; optional) : read text from file specified
- **"font"** (object; optional) : holds font data for face, flags, size and style
-- Example: "font":{"face": "Arial","flags": 0,"size": 150,"style": ""}
- **"face"** (string; optional) : font face i.e. Arial
-- Example: "font":{"face": "Arial"}
- **"flags"** (integer; optional) : font text style flag i.e. Bold 1, Italic 2, Bold Italic 3, Underline 5, Strikeout 8
- **"size"** (integer; optional) : font text size
-- Example: "font": {"size":125}
- **"style"** (string; optional) : font style (unknown function)
- **"gradient"** (bool; optional) : gradient
- **"gradient_color"** (integer; optional) : gradient color
- **"gradient_dir"** (float; optional) : gradient direction
- **"gradient_opacity"** (integer; optional) : gradient opacity range 0 to 100
- **"outline"** (bool; optional) : outline
- **"outline_color"** (integer; optional) : outline color
- **"outline_size"** (integer; optional) : outline size
- **"outline_opacity"** (integer; optional) : outline opacity range 0 to 100
- **"text"** (string; optional) : text to be displayed
- **"valign"** (string; optional) : "top","center","bottom" : text vertical alignment
- **"vertical"** (bool; optional) : vertical text
- **"render"** (bool; optional) : visibility of the scene item
__Response__ : OK if source exists in the current scene, error otherwise.
---
#### "GetBrowserSourceProperties"
Gets current properties for Browser Source.
__Request fields__ :
- **"source"** (string) : name of the source in the currently active scene.
- **"scene-name"** (string; optional) : name of the scene the source belongs to. defaults to current scene.
__Response__ : OK if source exists in the current scene with these additional fields when fields are set, error otherwise.
- **"is_local_file"** (bool) : use local file
- **"url"** (string) : url or file path
- **"css"** (string) : cascading style sheet code
- **"width"** (integer) : width
- **"height"** (integer) : height
- **"fps"** (integer) : frames per second
- **"shutdown"** (bool) : shutdown when sorce is not visible
- **"render"** (bool; optional) : visibility of the scene item
---
#### "SetBrowserSourceProperties"
Sets current properties for Browser Source.
__Request fields__ :
- **"source"** (string) : name of the source in the currently active scene.
- **"scene-name"** (string; optional) : name of the scene the source belongs to. defaults to current scene.
- **"is_local_file"** (bool; optional) : use local file
- **"url"** (string; optional) : url or file path
- **"css"** (string; optional) : cascading style sheet code
- **"width"** (integer; optional) : width
- **"height"** (integer; optional) : height
- **"fps"** (integer; optional) : frames per second
- **"shutdown"** (bool; optional) : shutdown when sorce is not visible
- **"render"** (bool; optional) : visibility of the scene item
---

124
README.md
View File

@ -1,65 +1,131 @@
obs-websocket # obs-websocket
==============
Remote control of OBS Studio made easy.
Follow the project on Twitter for news & updates : [@obswebsocket](https://twitter.com/obswebsocket) WebSockets API for OBS Studio.
[![Gitter chat](https://badges.gitter.im/obs-websocket/obs-websocket.png)](https://gitter.im/obs-websocket/obs-websocket) [![Build Status - Windows](https://ci.appveyor.com/api/projects/status/github/Palakis/obs-websocket)](https://ci.appveyor.com/project/Palakis/obs-websocket/history) [![Build Status - Linux & OS X](https://travis-ci.org/Palakis/obs-websocket.svg?branch=master)](https://travis-ci.org/Palakis/obs-websocket) [![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current)
[![CodeFactor](https://www.codefactor.io/repository/github/palakis/obs-websocket/badge)](https://www.codefactor.io/repository/github/palakis/obs-websocket)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40LePalakis)](https://twitter.com/LePalakis)
[![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A)
[![Financial Contributors on Open Collective](https://opencollective.com/obs-websocket/all/badge.svg?label=financial+contributors)](https://opencollective.com/obs-websocket)
## Downloads ## Downloads
Binaries for Windows and Linux are available in the [Releases](https://github.com/Palakis/obs-websocket/releases) section.
Binaries for Windows, MacOS, and Linux are available in the [Releases](https://github.com/Palakis/obs-websocket/releases) section.
### Homebrew
If you're using MacOS you can use Homebrew for installation as well:
```sh
brew install obs-websocket
```
## Using obs-websocket ## Using obs-websocket
A web client and frontend made by [t2t2](https://github.com/t2t2/obs-tablet-remote) (compatible with tablets and other touch interfaces) is available here : http://t2t2.github.io/obs-tablet-remote/
Here is a list of available web clients: (compatible with tablets and other touch interfaces)
- [Niek/obs-web](https://github.com/Niek/obs-web)
- [t2t2/obs-tablet-remote](https://github.com/t2t2/obs-tablet-remote)
It is **highly recommended** to protect obs-websocket with a password against unauthorized control. To do this, open the "Websocket server settings" dialog under OBS' "Tools" menu. In the settings dialogs, you can enable or disable authentication and set a password for it. It is **highly recommended** to protect obs-websocket with a password against unauthorized control. To do this, open the "Websocket server settings" dialog under OBS' "Tools" menu. In the settings dialogs, you can enable or disable authentication and set a password for it.
### Possible use cases ### Possible use cases
- Remote control OBS from a phone or tablet on the same local network - Remote control OBS from a phone or tablet on the same local network
- Change your stream overlay/graphics based on the current scene (like the AGDQ overlay does) - Change your stream overlay/graphics based on the current scene
- Automate scene switching with a third-party program (e.g. : auto-pilot, foot pedal, ...) - Automate scene switching with a third-party program (e.g. : auto-pilot, foot pedal, ...)
### For developers ### For developers
The server is a typical Websockets server running by default on port 4444 (the port number can be changed in the Settings dialog).
The protocol understood by the server is documented in [PROTOCOL.md](PROTOCOL.md). The server is a typical Websockets server running by default on port 4444 (the port number can be changed in the Settings dialog).
The protocol understood by the server is documented in [PROTOCOL.md](docs/generated/protocol.md).
Here's a list of available language APIs for obs-websocket : Here's a list of available language APIs for obs-websocket :
- Javascript (browser & nodejs) : [obs-websocket-js](https://github.com/haganbmj/obs-websocket-js) by Brendan Hagan - Javascript (browser & nodejs): [obs-websocket-js](https://github.com/haganbmj/obs-websocket-js) by Brendan Hagan
- C#/VB.NET : [obs-websocket-dotnet](https://github.com/Palakis/obs-websocket-dotnet) - C#/VB.NET: [obs-websocket-dotnet](https://github.com/Palakis/obs-websocket-dotnet)
- Python : [obs-websocket-py](https://github.com/Elektordi/obs-websocket-py) by Guillaume Genty a.k.a Elektordi - Python 2 and 3: [obs-websocket-py](https://github.com/Elektordi/obs-websocket-py) by Guillaume Genty a.k.a Elektordi
- Python 3.5+ with asyncio: [obs-ws-rc](https://github.com/KirillMysnik/obs-ws-rc) by Kirill Mysnik
- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468
- Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET
- Java 11+: [obs-java-client](https://github.com/harm27/obs-java-client) by harm27
- Go: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf
- Go: [goobs](https://github.com/andreykaipov/goobs) by Andrey Kaipov
- Rust: [obws](https://github.com/dnaka91/obws) by dnaka91
- Dart: [obs_websocket](https://pub.dev/packages/obs_websocket) by faithoflifedev
- HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468
- CLI: [obs-cli](https://github.com/leafac/obs-cli) by leafac
- Godot: [obs-websocket-gd](https://github.com/you-win/obs-websocket-gd) by you-win
I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop me an email at `contact at slepin dot fr` ! I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A)
### Securing obs-websocket (via TLS/SSL)
If you are intending to use obs-websocket outside of a LAN environment, it is highly recommended to secure the connection using a tunneling service.
See the SSL [tunnelling guide](SSL-TUNNELLING.md) for easy instructions on how to encrypt your websocket connection.
## Compiling obs-websocket ## Compiling obs-websocket
See the [build instructions](BUILDING.md). See the [build instructions](BUILDING.md).
## Contributing
See [the contributing document](/CONTRIBUTING.md)
## Translations ## Translations
**We need your help on translations**. Please join the localization project on Crowdin: https://crowdin.com/project/obs-websocket
**Your help is welcome on translations.**
Please join the localization project on [Crowdin](https://crowdin.com/project/obs-websocket)
## Special thanks ## Special thanks
In order of appearance:
- [Brendan H.](https://github.com/haganbmj) : Code contributions and better English in the Protocol specification Thank you so much to all of the contibutors [(here)](https://github.com/Palakis/obs-websocket/graphs/contributors) for your amazing help.
- [Mikhail Swift](https://github.com/mikhailswift) : Code contributions
- [Tobias Frahmer](https://github.com/Frahmer) : German translation
- [Genture](https://github.com/Genteure) : Simplified Chinese and Traditional Chinese translations
- [Larissa Gabilan](https://github.com/laris151) : Portuguese translation
- [Andy Asquelt](https://github.com/asquelt) : Polish translation
- [Marcel Haazen](https://github.com/inpothet) : Dutch translation
- [Peter Antonvich](https://github.com/pantonvich) : Code contributions
And also: special thanks to supporters of the project! And also: special thanks to supporters of the project!
## Supporters ## Supporters
They have contributed financially to the project and made possible the addition of several features into obs-websocket. Many thanks to them!
These supporters have contributed financially to the project and made possible the addition of several features into obs-websocket. Many thanks to them!
--- ---
[Support Class](http://supportclass.net) designs and develops professional livestreams, with services ranging from broadcast graphics design and integration to event organization, along many other skills. [Support Class](http://supportclass.net) designs and develops professional livestreams, with services ranging from broadcast graphics design and integration to event organization, along many other skills.
[![Support Class](doc/supportclass_logo_blacktext.png)](http://supportclass.net) [![Support Class](.github/images/supportclass_logo_blacktext.png)](http://supportclass.net)
--- ---
[MediaUnit](http://www.mediaunit.no) is a Norwegian media company developing products and services for the media industry, primarly focused on web and events. [MediaUnit](http://www.mediaunit.no) is a Norwegian media company developing products and services for the media industry, primarly focused on web and events.
[![MediaUnit](doc/mediaunit_logo_black.png)](http://www.mediaunit.no/) [![MediaUnit](.github/images/mediaunit_logo_black.png)](http://www.mediaunit.no/)
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/Palakis/obs-websocket/graphs/contributors"><img src="https://opencollective.com/obs-websocket/contributors.svg?width=890&button=false" /></a>
### Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/obs-websocket/contribute)]
#### Individuals
<a href="https://opencollective.com/obs-websocket"><img src="https://opencollective.com/obs-websocket/individuals.svg?width=890"></a>
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/obs-websocket/contribute)]
<a href="https://opencollective.com/obs-websocket/organization/0/website"><img src="https://opencollective.com/obs-websocket/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/1/website"><img src="https://opencollective.com/obs-websocket/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/2/website"><img src="https://opencollective.com/obs-websocket/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/3/website"><img src="https://opencollective.com/obs-websocket/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/4/website"><img src="https://opencollective.com/obs-websocket/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/5/website"><img src="https://opencollective.com/obs-websocket/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/6/website"><img src="https://opencollective.com/obs-websocket/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/7/website"><img src="https://opencollective.com/obs-websocket/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/8/website"><img src="https://opencollective.com/obs-websocket/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/obs-websocket/organization/9/website"><img src="https://opencollective.com/obs-websocket/organization/9/avatar.svg"></a>

45
SSL-TUNNELLING.md Normal file
View File

@ -0,0 +1,45 @@
# Connecting over a TLS/secure connection (or remotely)
If you want to expose the WebSocket server of obs-websocket over a secure TLS connection (or to connect remotely), the easiest approach is to use a localhost tunneling service like [ngrok](https://ngrok.com/) or [pagekite](https://pagekite.net/).
**Before doing this, secure the WebSocket server first by enabling authentication with a strong password!**
**Please bear in mind that doing this will expose your OBS instance to the open Internet and the security risks it implies. *You've been warned!***
## ngrok
[Install the ngrok CLI tool](https://ngrok.com/download) on a linux OS, then start ngrok bound to port 4444 like this:
```bash
ngrok http 4444
```
The ngrok command will output something like this:
```text
ngrok by @inconshreveable
Tunnel Status online
Version 2.0/2.0
Web Interface http://127.0.0.1:4040
Forwarding http://TUNNEL_ID.ngrok.io -> localhost:4444
Forwarding https://TUNNEL_ID.ngrok.io -> localhost:4444
```
Where `TUNNEL_ID` is, as the name implies, the unique name of your ngrok tunnel. You'll get a new one every time you start ngrok.
Then, use `wss://TUNNEL_ID.ngrok.io` to connect to obs-websocket over TLS.
See the [ngrok documentation](https://ngrok.com/docs) for more tunneling options and settings.
## PageKite
[Install the PageKite CLI tool](http://pagekite.net/downloads), then start PageKite bound to port 4444 like this (replace NAME with one of your choosing):
```bash
python pagekite.py 4444 NAME.pagekite.me
```
Then, use `wss://NAME.pagekite.me` to connect to obs-websocket over TLS.

522
Utils.cpp
View File

@ -1,522 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@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/>
*/
#include <obs-frontend-api.h>
#include <obs.hpp>
#include <QMainWindow>
#include <QDir>
#include <QUrl>
#include "Utils.h"
#include "obs-websocket.h"
Q_DECLARE_METATYPE(OBSScene);
obs_data_array_t* string_list_to_array(char** strings, char* key)
{
if (!strings)
return obs_data_array_create();
obs_data_array_t* list = obs_data_array_create();
char* value = "";
for (int i = 0; value != nullptr; i++)
{
value = strings[i];
obs_data_t* item = obs_data_create();
obs_data_set_string(item, key, value);
if (value)
obs_data_array_push_back(list, item);
obs_data_release(item);
}
return list;
}
obs_data_array_t* Utils::GetSceneItems(obs_source_t* source)
{
obs_data_array_t* items = obs_data_array_create();
obs_scene_t* scene = obs_scene_from_source(source);
if (!scene)
return nullptr;
obs_scene_enum_items(scene, [](obs_scene_t* scene, obs_sceneitem_t* currentItem, void* param)
{
obs_data_array_t* data = static_cast<obs_data_array_t* >(param);
obs_data_t* item_data = GetSceneItemData(currentItem);
obs_data_array_insert(data, 0, item_data);
obs_data_release(item_data);
return true;
}, items);
return items;
}
obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item)
{
if (!item)
return nullptr;
vec2 pos;
obs_sceneitem_get_pos(item, &pos);
vec2 scale;
obs_sceneitem_get_scale(item, &scale);
obs_source_t* item_source = obs_sceneitem_get_source(item);
float item_width = float(obs_source_get_width(item_source));
float item_height = float(obs_source_get_height(item_source));
obs_data_t* data = obs_data_create();
obs_data_set_string(data, "name",
obs_source_get_name(obs_sceneitem_get_source(item)));
obs_data_set_string(data, "type",
obs_source_get_id(obs_sceneitem_get_source(item)));
obs_data_set_double(data, "volume",
obs_source_get_volume(obs_sceneitem_get_source(item)));
obs_data_set_double(data, "x", pos.x);
obs_data_set_double(data, "y", pos.y);
obs_data_set_int(data, "source_cx", (int)item_width);
obs_data_set_int(data, "source_cy", (int)item_height);
obs_data_set_double(data, "cx", item_width* scale.x);
obs_data_set_double(data, "cy", item_height* scale.y);
obs_data_set_bool(data, "render", obs_sceneitem_visible(item));
return data;
}
obs_sceneitem_t* Utils::GetSceneItemFromName(obs_source_t* source, const char* name)
{
struct current_search {
const char* query;
obs_sceneitem_t* result;
};
current_search search;
search.query = name;
search.result = nullptr;
obs_scene_t* scene = obs_scene_from_source(source);
if (scene == nullptr)
return nullptr;
obs_scene_enum_items(scene, [](obs_scene_t* scene, obs_sceneitem_t* currentItem, void* param)
{
current_search* search = static_cast<current_search* >(param);
const char* currentItemName =
obs_source_get_name(obs_sceneitem_get_source(currentItem));
if (strcmp(currentItemName, search->query) == 0)
{
search->result = currentItem;
obs_sceneitem_addref(search->result);
return false;
}
return true;
}, &search);
return search.result;
}
obs_source_t* Utils::GetTransitionFromName(const char* search_name)
{
obs_source_t* found_transition = NULL;
obs_frontend_source_list transition_list = {};
obs_frontend_get_transitions(&transition_list);
for (size_t i = 0; i < transition_list.sources.num; i++)
{
obs_source_t* transition = transition_list.sources.array[i];
const char* transition_name = obs_source_get_name(transition);
if (strcmp(transition_name, search_name) == 0)
{
found_transition = transition;
obs_source_addref(found_transition);
break;
}
}
obs_frontend_source_list_free(&transition_list);
return found_transition;
}
obs_source_t* Utils::GetSceneFromNameOrCurrent(const char* scene_name)
{
obs_source_t* scene = nullptr;
if (!scene_name || !strlen(scene_name))
scene = obs_frontend_get_current_scene();
else
scene = obs_get_source_by_name(scene_name);
return scene;
}
obs_data_array_t* Utils::GetScenes()
{
obs_frontend_source_list sceneList = {};
obs_frontend_get_scenes(&sceneList);
obs_data_array_t* scenes = obs_data_array_create();
for (size_t i = 0; i < sceneList.sources.num; i++)
{
obs_source_t* scene = sceneList.sources.array[i];
obs_data_t* scene_data = GetSceneData(scene);
obs_data_array_push_back(scenes, scene_data);
obs_data_release(scene_data);
}
obs_frontend_source_list_free(&sceneList);
return scenes;
}
obs_data_t* Utils::GetSceneData(obs_source* source)
{
obs_data_array_t* scene_items = GetSceneItems(source);
obs_data_t* sceneData = obs_data_create();
obs_data_set_string(sceneData, "name", obs_source_get_name(source));
obs_data_set_array(sceneData, "sources", scene_items);
obs_data_array_release(scene_items);
return sceneData;
}
obs_data_array_t* Utils::GetSceneCollections()
{
char** scene_collections = obs_frontend_get_scene_collections();
obs_data_array_t* list = string_list_to_array(scene_collections, "sc-name");
bfree(scene_collections);
return list;
}
obs_data_array_t* Utils::GetProfiles()
{
char** profiles = obs_frontend_get_profiles();
obs_data_array_t* list = string_list_to_array(profiles, "profile-name");
bfree(profiles);
return list;
}
QSpinBox* Utils::GetTransitionDurationControl()
{
QMainWindow* window = (QMainWindow*)obs_frontend_get_main_window();
return window->findChild<QSpinBox*>("transitionDuration");
}
int Utils::GetTransitionDuration()
{
QSpinBox* control = GetTransitionDurationControl();
if (control)
return control->value();
else
return -1;
}
void Utils::SetTransitionDuration(int ms)
{
QSpinBox* control = GetTransitionDurationControl();
if (control && ms >= 0)
control->setValue(ms);
}
bool Utils::SetTransitionByName(const char* transition_name)
{
obs_source_t* transition = GetTransitionFromName(transition_name);
if (transition)
{
obs_frontend_set_current_transition(transition);
obs_source_release(transition);
return true;
}
else
{
return false;
}
}
QPushButton* Utils::GetPreviewModeButtonControl()
{
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
return main->findChild<QPushButton*>("modeSwitch");
}
QListWidget* Utils::GetSceneListControl()
{
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
return main->findChild<QListWidget*>("scenes");
}
obs_scene_t* Utils::SceneListItemToScene(QListWidgetItem* item)
{
if (!item)
return nullptr;
QVariant item_data = item->data(static_cast<int>(Qt::UserRole));
return item_data.value<OBSScene>();
}
QLayout* Utils::GetPreviewLayout()
{
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
return main->findChild<QLayout*>("previewLayout");
}
bool Utils::IsPreviewModeActive()
{
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
// Clue 1 : "Studio Mode" button is toggled on
bool buttonToggledOn = GetPreviewModeButtonControl()->isChecked();
// Clue 2 : Preview layout has more than one item
int previewChildCount = GetPreviewLayout()->count();
blog(LOG_INFO, "preview layout children count : %d", previewChildCount);
return buttonToggledOn || (previewChildCount >= 2);
}
void Utils::EnablePreviewMode()
{
if (!IsPreviewModeActive())
GetPreviewModeButtonControl()->click();
}
void Utils::DisablePreviewMode()
{
if (IsPreviewModeActive())
GetPreviewModeButtonControl()->click();
}
void Utils::TogglePreviewMode()
{
GetPreviewModeButtonControl()->click();
}
obs_scene_t* Utils::GetPreviewScene()
{
if (IsPreviewModeActive())
{
QListWidget* sceneList = GetSceneListControl();
QList<QListWidgetItem*> selected = sceneList->selectedItems();
// Qt::UserRole == QtUserRole::OBSRef
obs_scene_t* scene = Utils::SceneListItemToScene(selected.first());
obs_scene_addref(scene);
return scene;
}
return nullptr;
}
bool Utils::SetPreviewScene(const char* name)
{
if (IsPreviewModeActive())
{
QListWidget* sceneList = GetSceneListControl();
QList<QListWidgetItem*> matchingItems =
sceneList->findItems(name, Qt::MatchExactly);
if (matchingItems.count() > 0)
{
sceneList->setCurrentItem(matchingItems.first());
return true;
}
else
{
return false;
}
}
return false;
}
void Utils::TransitionToProgram()
{
if (!IsPreviewModeActive())
return;
// WARNING : if the layout created in OBS' CreateProgramOptions() changes
// then this won't work as expected
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
// The program options widget is the second item in the left-to-right layout
QWidget* programOptions = GetPreviewLayout()->itemAt(1)->widget();
// The "Transition" button lies in the mainButtonLayout
// which is the first itemin the program options' layout
QLayout* mainButtonLayout = programOptions->layout()->itemAt(1)->layout();
QWidget* transitionBtnWidget = mainButtonLayout->itemAt(0)->widget();
// Try to cast that widget into a button
QPushButton* transitionBtn = qobject_cast<QPushButton*>(transitionBtnWidget);
// Perform a click on that button
transitionBtn->click();
}
const char* Utils::OBSVersionString() {
uint32_t version = obs_get_version();
uint8_t major, minor, patch;
major = (version >> 24) & 0xFF;
minor = (version >> 16) & 0xFF;
patch = version & 0xFF;
char* result = (char*)bmalloc(sizeof(char) * 12);
sprintf(result, "%d.%d.%d", major, minor, patch);
return result;
}
QSystemTrayIcon* Utils::GetTrayIcon()
{
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
return main->findChildren<QSystemTrayIcon*>().first();
}
void Utils::SysTrayNotify(QString &text, QSystemTrayIcon::MessageIcon icon, QString title)
{
if (!QSystemTrayIcon::supportsMessages())
return;
QSystemTrayIcon* trayIcon = GetTrayIcon();
if (trayIcon)
trayIcon->showMessage(title, text, icon);
}
QString Utils::FormatIPAddress(QHostAddress &addr)
{
if (addr.protocol() == QAbstractSocket::IPv4Protocol)
QString v4addr = addr.toString().replace("::fff:", "");
return addr.toString();
}
const char* Utils::GetRecordingFolder()
{
config_t* profile = obs_frontend_get_profile_config();
const char* outputMode = config_get_string(profile, "Output", "Mode");
if (strcmp(outputMode, "Advanced") == 0)
{
// Advanced mode
return config_get_string(profile, "AdvOut", "RecFilePath");
}
else
{
// Simple mode
return config_get_string(profile, "SimpleOutput", "FilePath");
}
}
bool Utils::SetRecordingFolder(const char* path)
{
if (!QDir(path).exists())
return false;
config_t* profile = obs_frontend_get_profile_config();
const char* outputMode = config_get_string(profile, "Output", "Mode");
if (strcmp(outputMode, "Advanced") == 0)
{
config_set_string(profile, "AdvOut", "RecFilePath", path);
}
else
{
config_set_string(profile, "SimpleOutput", "FilePath", path);
}
config_save(profile);
return true;
}
QString* Utils::ParseDataToQueryString(obs_data_t * data)
{
QString* query = nullptr;
if (data)
{
obs_data_item_t* item = obs_data_first(data);
if (item)
{
query = new QString();
bool isFirst = true;
do
{
if (!obs_data_item_has_user_value(item))
continue;
if (!isFirst)
query->append('&');
else
isFirst = false;
const char* attrName = obs_data_item_get_name(item);
query->append(attrName).append("=");
switch (obs_data_item_gettype(item))
{
case OBS_DATA_BOOLEAN:
query->append(obs_data_item_get_bool(item)?"true":"false");
break;
case OBS_DATA_NUMBER:
switch (obs_data_item_numtype(item))
{
case OBS_DATA_NUM_DOUBLE:
query->append(QString::number(obs_data_item_get_double(item)));
break;
case OBS_DATA_NUM_INT:
query->append(QString::number(obs_data_item_get_int(item)));
break;
case OBS_DATA_NUM_INVALID:
break;
}
break;
case OBS_DATA_STRING:
query->append(QUrl::toPercentEncoding(QString(obs_data_item_get_string(item))));
break;
default:
//other types are not supported
break;
}
} while ( obs_data_item_next( &item ) );
}
}
return query;
}

83
Utils.h
View File

@ -1,83 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@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 UTILS_H
#define UTILS_H
#include <QSpinBox>
#include <QPushButton>
#include <QLayout>
#include <QListWidget>
#include <QSystemTrayIcon>
#include <QHostAddress>
#include <stdio.h>
#include <obs-module.h>
#include <util/config-file.h>
class Utils
{
public:
static obs_data_array_t* GetSceneItems(obs_source_t* source);
static obs_data_t* GetSceneItemData(obs_scene_item* item);
static obs_sceneitem_t* GetSceneItemFromName(
obs_source_t* source, const char* name);
static obs_source_t* GetTransitionFromName(const char* search_name);
static obs_source_t* GetSceneFromNameOrCurrent(const char* scene_name);
static obs_data_array_t* GetScenes();
static obs_data_t* GetSceneData(obs_source* source);
static obs_data_array_t* GetSceneCollections();
static obs_data_array_t* GetProfiles();
static QSpinBox* GetTransitionDurationControl();
static int GetTransitionDuration();
static void SetTransitionDuration(int ms);
static bool SetTransitionByName(const char* transition_name);
static QPushButton* GetPreviewModeButtonControl();
static QLayout* GetPreviewLayout();
static QListWidget* GetSceneListControl();
static obs_scene_t* SceneListItemToScene(QListWidgetItem* item);
static bool IsPreviewModeActive();
static void EnablePreviewMode();
static void DisablePreviewMode();
static void TogglePreviewMode();
static obs_scene_t* GetPreviewScene();
static bool SetPreviewScene(const char* name);
static void TransitionToProgram();
static const char* OBSVersionString();
static QSystemTrayIcon* GetTrayIcon();
static void SysTrayNotify(
QString &text,
QSystemTrayIcon::MessageIcon n,
QString title = QString("obs-websocket"));
static QString FormatIPAddress(QHostAddress &addr);
static const char* GetRecordingFolder();
static bool SetRecordingFolder(const char* path);
static QString* ParseDataToQueryString(obs_data_t * data);
};
#endif // UTILS_H

View File

@ -1,647 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@gmail.com>
Copyright (C) 2017 Brendan Hagan <https://github.com/haganbmj>
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/>
*/
#include <util/platform.h>
#include <QTimer>
#include <QPushButton>
#include "Config.h"
#include "Utils.h"
#include "WSEvents.h"
#include "obs-websocket.h"
bool transition_is_cut(obs_source_t* transition)
{
if (!transition)
return false;
if (obs_source_get_type(transition) == OBS_SOURCE_TYPE_TRANSITION
&& strcmp(obs_source_get_id(transition), "cut_transition") == 0)
{
return true;
}
return false;
}
const char* ns_to_timestamp(uint64_t ns)
{
uint64_t ms = ns / (1000 * 1000);
uint64_t secs = ms / 1000;
uint64_t minutes = secs / 60;
uint64_t hours_part = minutes / 60;
uint64_t minutes_part = minutes % 60;
uint64_t secs_part = secs % 60;
uint64_t ms_part = ms % 1000;
char* ts = (char*)bmalloc(64);
sprintf(ts, "%02d:%02d:%02d.%03d",
hours_part, minutes_part, secs_part, ms_part);
return ts;
}
WSEvents* WSEvents::Instance = nullptr;
WSEvents::WSEvents(WSServer* srv)
{
_srv = srv;
obs_frontend_add_event_callback(WSEvents::FrontendEventHandler, this);
QSpinBox* duration_control = Utils::GetTransitionDurationControl();
connect(duration_control, SIGNAL(valueChanged(int)),
this, SLOT(TransitionDurationChanged(int)));
QTimer* statusTimer = new QTimer();
connect(statusTimer, SIGNAL(timeout()),
this, SLOT(StreamStatus()));
statusTimer->start(2000); // equal to frontend's constant BITRATE_UPDATE_SECONDS
QListWidget* sceneList = Utils::GetSceneListControl();
connect(sceneList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(SelectedSceneChanged(QListWidgetItem*, QListWidgetItem*)));
QPushButton* modeSwitch = Utils::GetPreviewModeButtonControl();
connect(modeSwitch, SIGNAL(clicked(bool)), this, SLOT(ModeSwitchClicked(bool)));
transition_handler = nullptr;
scene_handler = nullptr;
QTimer::singleShot(1000, this, SLOT(deferredInitOperations()));
_streaming_active = false;
_recording_active = false;
_stream_starttime = 0;
_rec_starttime = 0;
}
WSEvents::~WSEvents()
{
obs_frontend_remove_event_callback(WSEvents::FrontendEventHandler, this);
}
void WSEvents::deferredInitOperations()
{
obs_source_t* transition = obs_frontend_get_current_transition();
connectTransitionSignals(transition);
obs_source_release(transition);
obs_source_t* scene = obs_frontend_get_current_scene();
connectSceneSignals(scene);
obs_source_release(scene);
}
void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private_data)
{
WSEvents* owner = static_cast<WSEvents*>(private_data);
if (!owner->_srv)
return;
// TODO : implement SourceOrderChanged and RepopulateSources
if (event == OBS_FRONTEND_EVENT_SCENE_CHANGED)
{
owner->OnSceneChange();
}
else if (event == OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED)
{
owner->OnSceneListChange();
}
else if (event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED)
{
owner->OnSceneCollectionChange();
}
else if (event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED)
{
owner->OnSceneCollectionListChange();
}
else if (event == OBS_FRONTEND_EVENT_TRANSITION_CHANGED)
{
owner->OnTransitionChange();
}
else if (event == OBS_FRONTEND_EVENT_TRANSITION_LIST_CHANGED)
{
owner->OnTransitionListChange();
}
else if (event == OBS_FRONTEND_EVENT_PROFILE_CHANGED)
{
owner->OnProfileChange();
}
else if (event == OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED)
{
owner->OnProfileListChange();
}
else if (event == OBS_FRONTEND_EVENT_STREAMING_STARTING)
{
owner->OnStreamStarting();
}
else if (event == OBS_FRONTEND_EVENT_STREAMING_STARTED)
{
owner->_streaming_active = true;
owner->OnStreamStarted();
}
else if (event == OBS_FRONTEND_EVENT_STREAMING_STOPPING)
{
owner->OnStreamStopping();
}
else if (event == OBS_FRONTEND_EVENT_STREAMING_STOPPED)
{
owner->_streaming_active = false;
owner->OnStreamStopped();
}
else if (event == OBS_FRONTEND_EVENT_RECORDING_STARTING)
{
owner->OnRecordingStarting();
}
else if (event == OBS_FRONTEND_EVENT_RECORDING_STARTED)
{
owner->_recording_active = true;
owner->OnRecordingStarted();
}
else if (event == OBS_FRONTEND_EVENT_RECORDING_STOPPING)
{
owner->OnRecordingStopping();
}
else if (event == OBS_FRONTEND_EVENT_RECORDING_STOPPED)
{
owner->_recording_active = false;
owner->OnRecordingStopped();
}
else if (event == OBS_FRONTEND_EVENT_EXIT)
{
owner->OnExit();
}
}
void WSEvents::broadcastUpdate(const char* updateType, obs_data_t* additionalFields = NULL)
{
obs_data_t* update = obs_data_create();
obs_data_set_string(update, "update-type", updateType);
const char* ts = nullptr;
if (_streaming_active)
{
ts = ns_to_timestamp(os_gettime_ns() - _stream_starttime);
obs_data_set_string(update, "stream-timecode", ts);
bfree((void*)ts);
}
if (_recording_active)
{
ts = ns_to_timestamp(os_gettime_ns() - _rec_starttime);
obs_data_set_string(update, "rec-timecode", ts);
bfree((void*)ts);
}
if (additionalFields != NULL)
obs_data_apply(update, additionalFields);
const char *json = obs_data_get_json(update);
_srv->broadcast(json);
if (Config::Current()->DebugEnabled)
blog(LOG_DEBUG, "Update << '%s'", json);
obs_data_release(update);
}
void WSEvents::connectTransitionSignals(obs_source_t* transition)
{
if (transition_handler)
{
signal_handler_disconnect(transition_handler,
"transition_start", OnTransitionBegin, this);
}
if (!transition_is_cut(transition))
{
transition_handler = obs_source_get_signal_handler(transition);
signal_handler_connect(transition_handler,
"transition_start", OnTransitionBegin, this);
}
else
{
transition_handler = nullptr;
}
}
void WSEvents::connectSceneSignals(obs_source_t* scene)
{
if (scene_handler)
{
signal_handler_disconnect(scene_handler,
"reorder", OnSceneReordered, this);
signal_handler_disconnect(scene_handler,
"item_add", OnSceneItemAdd, this);
signal_handler_disconnect(scene_handler,
"item_remove", OnSceneItemDelete, this);
signal_handler_disconnect(scene_handler,
"item_visible", OnSceneItemVisibilityChanged, this);
}
// TODO : connect to all scenes, not just the current one.
scene_handler = obs_source_get_signal_handler(scene);
signal_handler_connect(scene_handler,
"reorder", OnSceneReordered, this);
signal_handler_connect(scene_handler,
"item_add", OnSceneItemAdd, this);
signal_handler_connect(scene_handler,
"item_remove", OnSceneItemDelete, this);
signal_handler_connect(scene_handler,
"item_visible", OnSceneItemVisibilityChanged, this);
}
uint64_t WSEvents::GetStreamingTime()
{
if (_streaming_active)
return (os_gettime_ns() - _stream_starttime);
else
return 0;
}
const char* WSEvents::GetStreamingTimecode()
{
return ns_to_timestamp(GetStreamingTime());
}
uint64_t WSEvents::GetRecordingTime()
{
if (_recording_active)
return (os_gettime_ns() - _rec_starttime);
else
return 0;
}
const char* WSEvents::GetRecordingTimecode()
{
return ns_to_timestamp(GetRecordingTime());
}
void WSEvents::OnSceneChange()
{
// Implements an existing update type from bilhamil's OBS Remote
obs_data_t* data = obs_data_create();
obs_source_t* current_scene = obs_frontend_get_current_scene();
obs_data_array_t* scene_items = Utils::GetSceneItems(current_scene);
connectSceneSignals(current_scene);
obs_data_set_string(data, "scene-name", obs_source_get_name(current_scene));
obs_data_set_array(data, "sources", scene_items);
broadcastUpdate("SwitchScenes", data);
obs_data_array_release(scene_items);
obs_source_release(current_scene);
obs_data_release(data);
// Dirty fix : OBS blocks signals when swapping scenes in Studio Mode
// after transition end, so SelectedSceneChanged is never called...
if (Utils::IsPreviewModeActive())
{
QListWidget* list = Utils::GetSceneListControl();
SelectedSceneChanged(list->currentItem(), nullptr);
}
}
void WSEvents::OnSceneListChange()
{
broadcastUpdate("ScenesChanged");
}
void WSEvents::OnSceneCollectionChange()
{
broadcastUpdate("SceneCollectionChanged");
scene_handler = nullptr;
transition_handler = nullptr;
OnTransitionListChange();
OnTransitionChange();
OnSceneListChange();
OnSceneChange();
}
void WSEvents::OnSceneCollectionListChange()
{
broadcastUpdate("SceneCollectionListChanged");
}
void WSEvents::OnTransitionChange()
{
obs_source_t* current_transition = obs_frontend_get_current_transition();
connectTransitionSignals(current_transition);
obs_data_t* data = obs_data_create();
obs_data_set_string(data, "transition-name",
obs_source_get_name(current_transition));
broadcastUpdate("SwitchTransition", data);
obs_data_release(data);
obs_source_release(current_transition);
}
void WSEvents::OnTransitionListChange()
{
broadcastUpdate("TransitionListChanged");
}
void WSEvents::OnProfileChange()
{
broadcastUpdate("ProfileChanged");
}
void WSEvents::OnProfileListChange()
{
broadcastUpdate("ProfileListChanged");
}
void WSEvents::OnStreamStarting()
{
// Implements an existing update type from bilhamil's OBS Remote
obs_data_t* data = obs_data_create();
obs_data_set_bool(data, "preview-only", false);
broadcastUpdate("StreamStarting", data);
obs_data_release(data);
}
void WSEvents::OnStreamStarted()
{
// New update type specific to OBS Studio
_stream_starttime = os_gettime_ns();
_lastBytesSent = 0;
broadcastUpdate("StreamStarted");
}
void WSEvents::OnStreamStopping()
{
// Implements an existing update type from bilhamil's OBS Remote
obs_data_t* data = obs_data_create();
obs_data_set_bool(data, "preview-only", false);
broadcastUpdate("StreamStopping", data);
obs_data_release(data);
}
void WSEvents::OnStreamStopped()
{
// New update type specific to OBS Studio
_stream_starttime = 0;
broadcastUpdate("StreamStopped");
}
void WSEvents::OnRecordingStarting()
{
// New update type specific to OBS Studio
broadcastUpdate("RecordingStarting");
}
void WSEvents::OnRecordingStarted()
{
// New update type specific to OBS Studio
_rec_starttime = os_gettime_ns();
broadcastUpdate("RecordingStarted");
}
void WSEvents::OnRecordingStopping()
{
// New update type specific to OBS Studio
broadcastUpdate("RecordingStopping");
}
void WSEvents::OnRecordingStopped()
{
// New update type specific to OBS Studio
_rec_starttime = 0;
broadcastUpdate("RecordingStopped");
}
void WSEvents::OnExit()
{
// New update type specific to OBS Studio
broadcastUpdate("Exiting");
}
void WSEvents::StreamStatus()
{
bool streaming_active = obs_frontend_streaming_active();
bool recording_active = obs_frontend_recording_active();
obs_output_t* stream_output = obs_frontend_get_streaming_output();
if (!stream_output || !streaming_active)
{
if (stream_output)
obs_output_release(stream_output);
return;
}
uint64_t bytes_sent = obs_output_get_total_bytes(stream_output);
uint64_t bytes_sent_time = os_gettime_ns();
if (bytes_sent < _lastBytesSent)
bytes_sent = 0;
if (bytes_sent == 0)
_lastBytesSent = 0;
uint64_t bytes_between = bytes_sent - _lastBytesSent;
double time_passed =
double(bytes_sent_time - _lastBytesSentTime) / 1000000000.0;
uint64_t bytes_per_sec = bytes_between / time_passed;
_lastBytesSent = bytes_sent;
_lastBytesSentTime = bytes_sent_time;
uint64_t totalStreamTime =
(os_gettime_ns() - _stream_starttime) / 1000000000;
int total_frames = obs_output_get_total_frames(stream_output);
int dropped_frames = obs_output_get_frames_dropped(stream_output);
float strain = obs_output_get_congestion(stream_output);
obs_data_t* data = obs_data_create();
obs_data_set_bool(data, "streaming", streaming_active);
obs_data_set_bool(data, "recording", recording_active);
obs_data_set_int(data, "bytes-per-sec", bytes_per_sec);
obs_data_set_int(data, "kbits-per-sec", (bytes_per_sec * 8) / 1024);
obs_data_set_int(data, "total-stream-time", totalStreamTime);
obs_data_set_int(data, "num-total-frames", total_frames);
obs_data_set_int(data, "num-dropped-frames", dropped_frames);
obs_data_set_double(data, "fps", obs_get_active_fps());
obs_data_set_double(data, "strain", strain);
obs_data_set_bool(data, "preview-only", false); // Retrocompat with OBSRemote
broadcastUpdate("StreamStatus", data);
obs_data_release(data);
obs_output_release(stream_output);
}
void WSEvents::TransitionDurationChanged(int ms)
{
obs_data_t* fields = obs_data_create();
obs_data_set_int(fields, "new-duration", ms);
broadcastUpdate("TransitionDurationChanged", fields);
obs_data_release(fields);
}
void WSEvents::OnTransitionBegin(void* param, calldata_t* data)
{
UNUSED_PARAMETER(data);
WSEvents* instance = static_cast<WSEvents*>(param);
instance->broadcastUpdate("TransitionBegin");
blog(LOG_INFO, "transition begin");
}
void WSEvents::OnSceneReordered(void* param, calldata_t* data)
{
WSEvents* instance = static_cast<WSEvents*>(param);
obs_scene_t* scene = nullptr;
calldata_get_ptr(data, "scene", &scene);
obs_data_t* fields = obs_data_create();
obs_data_set_string(fields, "scene-name",
obs_source_get_name(obs_scene_get_source(scene)));
instance->broadcastUpdate("SourceOrderChanged", fields);
obs_data_release(fields);
}
void WSEvents::OnSceneItemAdd(void* param, calldata_t* data)
{
WSEvents* instance = static_cast<WSEvents*>(param);
obs_scene_t* scene = nullptr;
calldata_get_ptr(data, "scene", &scene);
obs_sceneitem_t* scene_item = nullptr;
calldata_get_ptr(data, "item", &scene_item);
const char* scene_name =
obs_source_get_name(obs_scene_get_source(scene));
const char* sceneitem_name =
obs_source_get_name(obs_sceneitem_get_source(scene_item));
obs_data_t* fields = obs_data_create();
obs_data_set_string(fields, "scene-name", scene_name);
obs_data_set_string(fields, "item-name", sceneitem_name);
instance->broadcastUpdate("SceneItemAdded", fields);
obs_data_release(fields);
}
void WSEvents::OnSceneItemDelete(void* param, calldata_t* data)
{
WSEvents* instance = static_cast<WSEvents*>(param);
obs_scene_t* scene = nullptr;
calldata_get_ptr(data, "scene", &scene);
obs_sceneitem_t* scene_item = nullptr;
calldata_get_ptr(data, "item", &scene_item);
const char* scene_name =
obs_source_get_name(obs_scene_get_source(scene));
const char* sceneitem_name =
obs_source_get_name(obs_sceneitem_get_source(scene_item));
obs_data_t* fields = obs_data_create();
obs_data_set_string(fields, "scene-name", scene_name);
obs_data_set_string(fields, "item-name", sceneitem_name);
instance->broadcastUpdate("SceneItemRemoved", fields);
obs_data_release(fields);
}
void WSEvents::OnSceneItemVisibilityChanged(void* param, calldata_t* data)
{
WSEvents* instance = static_cast<WSEvents*>(param);
obs_scene_t* scene = nullptr;
calldata_get_ptr(data, "scene", &scene);
obs_sceneitem_t* scene_item = nullptr;
calldata_get_ptr(data, "item", &scene_item);
bool visible = false;
calldata_get_bool(data, "visible", &visible);
const char* scene_name =
obs_source_get_name(obs_scene_get_source(scene));
const char* sceneitem_name =
obs_source_get_name(obs_sceneitem_get_source(scene_item));
obs_data_t* fields = obs_data_create();
obs_data_set_string(fields, "scene-name", scene_name);
obs_data_set_string(fields, "item-name", sceneitem_name);
obs_data_set_bool(fields, "item-visible", visible);
instance->broadcastUpdate("SceneItemVisibilityChanged", fields);
obs_data_release(fields);
}
void WSEvents::SelectedSceneChanged(QListWidgetItem* current, QListWidgetItem* prev)
{
if (Utils::IsPreviewModeActive())
{
obs_scene_t* scene = Utils::SceneListItemToScene(current);
if (!scene) return;
obs_source_t* scene_source = obs_scene_get_source(scene);
obs_data_array_t* scene_items = Utils::GetSceneItems(scene_source);
obs_data_t* data = obs_data_create();
obs_data_set_string(data, "scene-name", obs_source_get_name(scene_source));
obs_data_set_array(data, "sources", scene_items);
broadcastUpdate("PreviewSceneChanged", data);
obs_data_array_release(scene_items);
obs_data_release(data);
}
}
void WSEvents::ModeSwitchClicked(bool checked)
{
obs_data_t* data = obs_data_create();
obs_data_set_bool(data, "new-state", checked);
broadcastUpdate("StudioModeSwitched", data);
obs_data_release(data);
}

View File

@ -1,101 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@gmail.com>
Copyright (C) 2017 Brendan Hagan <https://github.com/haganbmj>
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 WSEVENTS_H
#define WSEVENTS_H
#include <obs-frontend-api.h>
#include <QListWidgetItem>
#include "WSServer.h"
class WSEvents : public QObject
{
Q_OBJECT
public:
explicit WSEvents(WSServer* srv);
~WSEvents();
static void FrontendEventHandler(
enum obs_frontend_event event, void* private_data);
void connectTransitionSignals(obs_source_t* transition);
void connectSceneSignals(obs_source_t* scene);
static WSEvents* Instance;
uint64_t GetStreamingTime();
const char* GetStreamingTimecode();
uint64_t GetRecordingTime();
const char* GetRecordingTimecode();
private Q_SLOTS:
void deferredInitOperations();
void StreamStatus();
void TransitionDurationChanged(int ms);
void SelectedSceneChanged(
QListWidgetItem* current, QListWidgetItem* prev);
void ModeSwitchClicked(bool checked);
private:
WSServer* _srv;
signal_handler_t* transition_handler;
signal_handler_t* scene_handler;
bool _streaming_active;
bool _recording_active;
uint64_t _stream_starttime;
uint64_t _rec_starttime;
uint64_t _lastBytesSent;
uint64_t _lastBytesSentTime;
void broadcastUpdate(const char* updateType,
obs_data_t* additionalFields);
void OnSceneChange();
void OnSceneListChange();
void OnSceneCollectionChange();
void OnSceneCollectionListChange();
void OnTransitionChange();
void OnTransitionListChange();
void OnProfileChange();
void OnProfileListChange();
void OnStreamStarting();
void OnStreamStarted();
void OnStreamStopping();
void OnStreamStopped();
void OnRecordingStarting();
void OnRecordingStarted();
void OnRecordingStopping();
void OnRecordingStopped();
void OnExit();
static void OnTransitionBegin(void* param, calldata_t* data);
static void OnSceneReordered(void* param, calldata_t* data);
static void OnSceneItemAdd(void* param, calldata_t* data);
static void OnSceneItemDelete(void* param, calldata_t* data);
static void OnSceneItemVisibilityChanged(void* param, calldata_t* data);
};
#endif // WSEVENTS_H

File diff suppressed because it is too large Load Diff

View File

@ -1,116 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@gmail.com>
Copyright (C) 2017 Mikhail Swift <https://github.com/mikhailswift>
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 WSREQUESTHANDLER_H
#define WSREQUESTHANDLER_H
#include <obs-frontend-api.h>
#include <QtWebSockets/QWebSocket>
#include <QtWebSockets/QWebSocketServer>
class WSRequestHandler : public QObject
{
Q_OBJECT
public:
explicit WSRequestHandler(QWebSocket* client);
~WSRequestHandler();
void processIncomingMessage(QString textMessage);
bool hasField(const char* name);
private:
static obs_service_t* _service;
QWebSocket* _client;
const char* _messageId;
const char* _requestType;
obs_data_t* data;
QMap<QString, void(*)(WSRequestHandler*)> messageMap;
QSet<QString> authNotRequired;
void SendOKResponse(obs_data_t* additionalFields = NULL);
void SendErrorResponse(const char* errorMessage);
void SendResponse(obs_data_t* response);
static void HandleGetVersion(WSRequestHandler* req);
static void HandleGetAuthRequired(WSRequestHandler* req);
static void HandleAuthenticate(WSRequestHandler* req);
static void HandleSetCurrentScene(WSRequestHandler* req);
static void HandleGetCurrentScene(WSRequestHandler* req);
static void HandleGetSceneList(WSRequestHandler* req);
static void HandleSetSceneItemRender(WSRequestHandler* req);
static void HandleSetSceneItemPosition(WSRequestHandler* req);
static void HandleSetSceneItemTransform(WSRequestHandler* req);
static void HandleSetSceneItemCrop(WSRequestHandler* req);
static void HandleGetStreamingStatus(WSRequestHandler* req);
static void HandleStartStopStreaming(WSRequestHandler* req);
static void HandleStartStopRecording(WSRequestHandler* req);
static void HandleStartStreaming(WSRequestHandler* req);
static void HandleStopStreaming(WSRequestHandler* req);
static void HandleStartRecording(WSRequestHandler* req);
static void HandleStopRecording(WSRequestHandler* req);
static void HandleSetRecordingFolder(WSRequestHandler* req);
static void HandleGetRecordingFolder(WSRequestHandler* req);
static void HandleGetTransitionList(WSRequestHandler* req);
static void HandleGetCurrentTransition(WSRequestHandler* req);
static void HandleSetCurrentTransition(WSRequestHandler* req);
static void HandleSetVolume(WSRequestHandler* req);
static void HandleGetVolume(WSRequestHandler* req);
static void HandleToggleMute(WSRequestHandler* req);
static void HandleSetMute(WSRequestHandler* req);
static void HandleGetMute(WSRequestHandler* req);
static void HandleGetSpecialSources(WSRequestHandler* req);
static void HandleSetCurrentSceneCollection(WSRequestHandler* req);
static void HandleGetCurrentSceneCollection(WSRequestHandler* req);
static void HandleListSceneCollections(WSRequestHandler* req);
static void HandleSetCurrentProfile(WSRequestHandler* req);
static void HandleGetCurrentProfile(WSRequestHandler* req);
static void HandleListProfiles(WSRequestHandler* req);
static void HandleSetStreamSettings(WSRequestHandler* req);
static void HandleGetStreamSettings(WSRequestHandler* req);
static void HandleSaveStreamSettings(WSRequestHandler* req);
static void HandleSetTransitionDuration(WSRequestHandler* req);
static void HandleGetTransitionDuration(WSRequestHandler* req);
static void HandleGetStudioModeStatus(WSRequestHandler* req);
static void HandleGetPreviewScene(WSRequestHandler* req);
static void HandleSetPreviewScene(WSRequestHandler* req);
static void HandleTransitionToProgram(WSRequestHandler* req);
static void HandleEnableStudioMode(WSRequestHandler* req);
static void HandleDisableStudioMode(WSRequestHandler* req);
static void HandleToggleStudioMode(WSRequestHandler* req);
static void HandleSetTextGDIPlusProperties(WSRequestHandler* req);
static void HandleGetTextGDIPlusProperties(WSRequestHandler* req);
static void HandleSetBrowserSourceProperties(WSRequestHandler* req);
static void HandleGetBrowserSourceProperties(WSRequestHandler* req);
};
#endif // WSPROTOCOL_H

View File

@ -1,171 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@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/>
*/
#include <QtWebSockets/QWebSocket>
#include <QtCore/QThread>
#include <QtCore/QByteArray>
#include <obs-frontend-api.h>
#include "WSServer.h"
#include "obs-websocket.h"
#include "Config.h"
#include "Utils.h"
QT_USE_NAMESPACE
WSServer* WSServer::Instance = nullptr;
WSServer::WSServer(QObject* parent) :
QObject(parent),
_wsServer(Q_NULLPTR),
_clients(),
_clMutex(QMutex::Recursive)
{
_serverThread = new QThread();
_wsServer = new QWebSocketServer(
QStringLiteral("obs-websocket"),
QWebSocketServer::NonSecureMode,
_serverThread);
_serverThread->start();
}
WSServer::~WSServer()
{
Stop();
delete _serverThread;
}
void WSServer::Start(quint16 port)
{
if (port == _wsServer->serverPort())
return;
if(_wsServer->isListening())
Stop();
bool serverStarted = _wsServer->listen(QHostAddress::Any, port);
if (serverStarted)
{
connect(_wsServer, &QWebSocketServer::newConnection,
this, &WSServer::onNewConnection);
}
}
void WSServer::Stop()
{
_clMutex.lock();
for(QWebSocket* pClient : _clients) {
pClient->close();
}
_clMutex.unlock();
_wsServer->close();
}
void WSServer::broadcast(QString message)
{
_clMutex.lock();
for(QWebSocket* pClient : _clients) {
if (Config::Current()->AuthRequired
&& (pClient->property(PROP_AUTHENTICATED).toBool() == false))
{
// Skip this client if unauthenticated
continue;
}
pClient->sendTextMessage(message);
}
_clMutex.unlock();
}
void WSServer::onNewConnection()
{
QWebSocket* pSocket = _wsServer->nextPendingConnection();
if (pSocket)
{
connect(pSocket, &QWebSocket::textMessageReceived,
this, &WSServer::textMessageReceived);
connect(pSocket, &QWebSocket::disconnected,
this, &WSServer::socketDisconnected);
pSocket->setProperty(PROP_AUTHENTICATED, false);
_clMutex.lock();
_clients << pSocket;
_clMutex.unlock();
QHostAddress clientAddr = pSocket->peerAddress();
QString clientIp = Utils::FormatIPAddress(clientAddr);
blog(LOG_INFO, "new client connection from %s:%d",
clientIp.toUtf8().constData(), pSocket->peerPort());
QString msg = QString(obs_module_text("OBSWebsocket.ConnectNotify.ClientIP"))
+ QString(" ")
+ clientAddr.toString();
Utils::SysTrayNotify(msg,
QSystemTrayIcon::Information,
QString(obs_module_text("OBSWebsocket.ConnectNotify.Connected")));
}
}
void WSServer::textMessageReceived(QString message)
{
QWebSocket* pSocket = qobject_cast<QWebSocket*>(sender());
if (pSocket)
{
WSRequestHandler handler(pSocket);
handler.processIncomingMessage(message);
}
}
void WSServer::socketDisconnected()
{
QWebSocket* pSocket = qobject_cast<QWebSocket*>(sender());
if (pSocket)
{
pSocket->setProperty(PROP_AUTHENTICATED, false);
_clMutex.lock();
_clients.removeAll(pSocket);
_clMutex.unlock();
pSocket->deleteLater();
QHostAddress clientAddr = pSocket->peerAddress();
QString clientIp = Utils::FormatIPAddress(clientAddr);
blog(LOG_INFO, "client %s:%d disconnected",
clientIp.toUtf8().constData(), pSocket->peerPort());
QString msg = QString(obs_module_text("OBSWebsocket.ConnectNotify.ClientIP"))
+ QString(" ")
+ clientAddr.toString();
Utils::SysTrayNotify(msg,
QSystemTrayIcon::Information,
QString(obs_module_text("OBSWebsocket.ConnectNotify.Disconnected")));
}
}

View File

@ -1,55 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2017 Stéphane Lepin <stephane.lepin@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 WSSERVER_H
#define WSSERVER_H
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtCore/QMutex>
QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
QT_FORWARD_DECLARE_CLASS(QWebSocket)
#include "WSRequestHandler.h"
class WSServer : public QObject
{
Q_OBJECT
public:
explicit WSServer(QObject* parent = Q_NULLPTR);
virtual ~WSServer();
void Start(quint16 port);
void Stop();
void broadcast(QString message);
static WSServer* Instance;
private Q_SLOTS:
void onNewConnection();
void textMessageReceived(QString message);
void socketDisconnected();
private:
QWebSocketServer* _wsServer;
QList<QWebSocket*> _clients;
QMutex _clMutex;
QThread* _serverThread;
};
#endif // WSSERVER_H

View File

@ -1,50 +0,0 @@
environment:
CURL_VERSION: 7.39.0
install:
- git submodule update --init --recursive
- cd C:\projects\
- if not exist dependencies2013.zip curl -kLO https://obsproject.com/downloads/dependencies2013.zip -f --retry 5 -C -
- 7z x dependencies2013.zip -odependencies2013
- if not exist qt570.zip curl -kLO https://www.slepin.fr/obs-websocket/ci/qt570.zip -f --retry 5 -C -
- 7z x qt570.zip -o"Qt5.7.0"
- set DepsPath32=%CD%\dependencies2013\win32
- set DepsPath64=%CD%\dependencies2013\win64
- set QTDIR32=%CD%\Qt5.7.0\msvc2013
- set QTDIR64=%CD%\Qt5.7.0\msvc2013_64
- set build_config=Release
- git clone --recursive https://github.com/jp9000/obs-studio
- cd C:\projects\obs-studio\
- git checkout 19.0.2
- mkdir build
- mkdir build32
- mkdir build64
- cd ./build32
- cmake -G "Visual Studio 12 2013" -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
- cd ../build64
- cmake -G "Visual Studio 12 2013 Win64" -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build32\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build64\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cd C:\projects\obs-websocket\
- mkdir build32
- mkdir build64
- cd ./build32
- cmake -G "Visual Studio 12 2013" -DQTDIR="%QTDIR32%" -DLibObs_DIR="C:\projects\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="C:\projects\obs-studio\libobs" -DLIBOBS_LIB="C:\projects\obs-studio\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="C:\projects\obs-studio\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
- cd ../build64
- cmake -G "Visual Studio 12 2013 Win64" -DQTDIR="%QTDIR64%" -DLibObs_DIR="C:\projects\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="C:\projects\obs-studio\libobs" -DLIBOBS_LIB="C:\projects\obs-studio\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="C:\projects\obs-studio\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
build_script:
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-websocket\build32\obs-websocket.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- call msbuild /m /p:Configuration=%build_config% C:\projects\obs-websocket\build64\obs-websocket.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
before_deploy:
- 7z a "C:\projects\obs-websocket\build.zip" C:\projects\obs-websocket\release\*
deploy_script:
- ps: Push-AppveyorArtifact "C:\projects\obs-websocket\build.zip" -FileName "obs-websocket-$(git log --pretty=format:'%h' -n 1).zip"
test: off
cache:
- C:\projects\dependencies2013.zip
- C:\projects\qt570.zip

83
buildspec.json Normal file
View File

@ -0,0 +1,83 @@
{
"dependencies": {
"obs-studio": {
"version": "28.0.0-beta2",
"repository": "https://github.com/obsproject/obs-studio.git",
"branch": "master",
"hash": "6c2860a4ecd69f95f6573b8917d77bbcea203669"
},
"prebuilt": {
"version": "2022-08-02",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-built obs-deps",
"hashes": {
"macos-x86_64": "7637e52305e6fc53014b5aabd583f1a4490b1d97450420e977cae9a336a29525",
"macos-arm64": "755e0fa69b17a3ae444e1befa9d91d77e3cafe628fbd1c6333686091826595cd",
"macos-universal": "de057e73e6fe0825664c258ca2dd6798c41ae580bf4d896e1647676a4941934a",
"windows-x64": "2192d8ce780c4281b807cd457994963669e5202659ecd92f19b54c3e7d0c1915",
"windows-x86": "9f8582ab5891b000869d6484ea591add9fbac9f1c91b56c7b85fdfd56a261c1b"
}
},
"qt5": {
"version": "2022-08-02",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-built Qt5",
"hashes": {
"macos-x86_64": "3d0381a52b0e4d49967936c4357f79ac711f43564329304a6db5c90edadd2697",
"macos-arm64": "f4b32548c0530f121956bf0a9a70c36ecbbfca81073d39c396a1759baf2a05c3",
"macos-universal": "9a6cf3b9a6c9efee6ba10df649202e8075e99f3c54ae88dc9a36dbc9d7471c1e",
"windows-x64": "6488a33a474f750d5a4a268a5e20c78bb40799d99136a1b7ce3365a843cb2fd7",
"windows-x86": "a916e09b0a874036801deab2c8a7ec14fdf5d268aa5511eac5bf40727e0c4e33"
},
"pdb-hashes": {
"windows-x64": "e0e5070143fcad9311a68ce5685d8ba8f34f581ed6942b7a92d360f94ca1ba11",
"windows-x86": "36642d1052aa461964f46c17610477b0d9b9defbe2d745ccaacb85f805c1bec2"
}
},
"qt6": {
"version": "2022-08-02",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-built Qt6",
"hashes": {
"macos-x86_64": "a83f72a11023b03b6cb2dc365f0a66ad9df31163bbb4fe2df32d601856a9fad3",
"macos-arm64": "2f30af90c049670a5660656adbb440668aa1b0567f75a5f29e1def9108928403",
"macos-universal": "252e6684f43ab9c6f262c73af739e2296ce391b998da2c4ee04c254aaa07db18",
"windows-x64": "e5509b54196a3f935250cc4b9c54160c8e588fd0f92bc078a2a64f9d9e2e4e93",
"windows-x86": "24fc03bef153a0e027c1479e42eb08097a4ea1d70a4710825be0783d0626cb0d"
},
"pdb-hashes": {
"windows-x64": "60e5b1d2bc4d7c431bc05f14e3b1e85e088788c372fa85f58717cd6c49555a46",
"windows-x86": "f34d1a89fc85d92913bd6c7f75ec5c28471d74db708c98161100bc8b75f8fc63"
}
}
},
"platformConfig": {
"macos-x86_64": {
"qtVersion": 6,
"deploymentTarget": "10.15"
},
"macos-arm64": {
"qtVersion": 6,
"deploymentTarget": "11.0"
},
"macos-universal": {
"qtVersion": 6,
"deploymentTarget": "10.15"
},
"windows-x64": {
"qtVersion": 6,
"visualStudio": "Visual Studio 17 2022",
"platformSDK": "10.0.20348.0"
},
"windows-x86": {
"qtVersion": 6,
"visualStudio": "Visual Studio 17 2022",
"platformSDK": "10.0.20348.0"
},
"linux-x86_64": {
"qtVersion": 6
}
},
"name": "obs-websocket-compat",
"version": "4.9.1"
}

View File

@ -0,0 +1,506 @@
if(POLICY CMP0087)
cmake_policy(SET CMP0087 NEW)
endif()
set(OBS_STANDALONE_PLUGIN_DIR ${CMAKE_SOURCE_DIR}/release)
set(INCLUDED_LIBOBS_CMAKE_MODULES ON)
include(GNUInstallDirs)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(OS_MACOS ON)
set(OS_POSIX ON)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD")
set(OS_POSIX ON)
string(TOUPPER "${CMAKE_SYSTEM_NAME}" _SYSTEM_NAME_U)
set(OS_${_SYSTEM_NAME_U} ON)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(OS_WINDOWS ON)
set(OS_POSIX OFF)
endif()
# Old-Style plugin detected, find "modern" libobs variant instead and set global
# include directories to fix "bad" plugin behaviour
if(DEFINED LIBOBS_INCLUDE_DIR AND NOT TARGET OBS::libobs)
message(
DEPRECATION
"You are using an outdated method of adding 'libobs' to your project. Refer to the updated wiki on how to build and export 'libobs' and use it in your plugin projects."
)
find_package(libobs REQUIRED)
if(TARGET OBS::libobs)
set_target_properties(OBS::libobs PROPERTIES IMPORTED_GLOBAL TRUE)
message(STATUS "OBS: Using modern libobs target")
add_library(libobs ALIAS OBS::libobs)
if(OS_WINDOWS)
add_library(w32-pthreads ALIAS OBS::w32-pthreads)
endif()
endif()
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND (OS_WINDOWS OR OS_MACOS))
set(CMAKE_INSTALL_PREFIX
${OBS_STANDALONE_PLUGIN_DIR}
CACHE STRING "Directory to install OBS plugin after building" FORCE)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
"RelWithDebInfo"
CACHE STRING
"OBS build type [Release, RelWithDebInfo, Debug, MinSizeRel]" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo
Debug MinSizeRel)
endif()
if(NOT QT_VERSION)
set(QT_VERSION
AUTO
CACHE STRING "OBS Qt version [AUTO, 5, 6]" FORCE)
set_property(CACHE QT_VERSION PROPERTY STRINGS AUTO 5 6)
endif()
macro(find_qt)
set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC COMPONENTS_LINUX)
cmake_parse_arguments(FIND_QT "" "${oneValueArgs}" "${multiValueArgs}"
${ARGN})
set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
find_package(
Qt5
COMPONENTS Core
QUIET)
find_package(
Qt6
COMPONENTS Core
QUIET)
if(NOT _QT_VERSION AND QT_VERSION STREQUAL AUTO)
if(TARGET Qt6::Core)
set(_QT_VERSION
6
CACHE INTERNAL "")
elseif(TARGET Qt5::Core)
set(_QT_VERSION
5
CACHE INTERNAL "")
endif()
message(STATUS "Qt version: ${_QT_VERSION}")
elseif(NOT _QT_VERSION)
if(TARGET Qt${QT_VERSION}::Core)
set(_QT_VERSION
${QT_VERSION}
CACHE INTERNAL "")
else()
if(QT_VERSION EQUAL 6)
set(FALLBACK_QT_VERSION 5)
else()
set(FALLBACK_QT_VERSION 6)
endif()
message(
WARNING
"Qt${QT_VERSION} was not found, falling back to Qt${FALLBACK_QT_VERSION}"
)
if(TARGET Qt${FALLBACK_QT_VERSION}::Core)
set(_QT_VERSION
${FALLBACK_QT_VERSION}
CACHE INTERNAL "")
endif()
endif()
message(STATUS "Qt version: ${_QT_VERSION}")
endif()
set(QT_NO_CREATE_VERSIONLESS_TARGETS OFF)
if(NOT _QT_VERSION)
message(FATAL_ERROR "Neither Qt5 or Qt6 were found")
endif()
if(OS_WINDOWS)
find_package(
Qt${_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_WIN}
REQUIRED)
elseif(OS_MACOS)
find_package(
Qt${_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_MAC}
REQUIRED)
else()
find_package(
Qt${_QT_VERSION}
COMPONENTS ${FIND_QT_COMPONENTS} ${FIND_QT_COMPONENTS_LINUX}
REQUIRED)
endif()
list(APPEND FIND_QT_COMPONENTS "Core")
if("Gui" IN_LIST FIND_QT_COMPONENTS_LINUX)
list(APPEND FIND_QT_COMPONENTS_LINUX "GuiPrivate")
endif()
foreach(_COMPONENT IN LISTS FIND_QT_COMPONENTS FIND_QT_COMPONENTS_WIN
FIND_QT_COMPONENTS_MAC FIND_QT_COMPONENTS_LINUX)
if(NOT TARGET Qt::${_COMPONENT} AND TARGET Qt${_QT_VERSION}::${_COMPONENT})
add_library(Qt::${_COMPONENT} INTERFACE IMPORTED)
set_target_properties(
Qt::${_COMPONENT} PROPERTIES INTERFACE_LINK_LIBRARIES
"Qt${_QT_VERSION}::${_COMPONENT}")
endif()
endforeach()
endmacro()
file(RELATIVE_PATH RELATIVE_INSTALL_PATH ${CMAKE_SOURCE_DIR}
${CMAKE_INSTALL_PREFIX})
file(RELATIVE_PATH RELATIVE_BUILD_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
# Set up OS-specific environment and helper functions
if(OS_POSIX)
find_program(CCACHE_PROGRAM "ccache")
set(CCACHE_SUPPORT
ON
CACHE BOOL "Enable ccache support")
mark_as_advanced(CCACHE_PROGRAM)
if(CCACHE_PROGRAM AND CCACHE_SUPPORT)
set(CMAKE_CXX_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE INTERNAL "")
set(CMAKE_C_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE INTERNAL "")
set(CMAKE_OBJC_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE INTERNAL "")
set(CMAKE_OBJCXX_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE INTERNAL "")
set(CMAKE_CUDA_COMPILER_LAUNCHER
${CCACHE_PROGRAM}
CACHE INTERNAL "") # CMake 3.9+
endif()
endif()
if(OS_MACOS)
set(CMAKE_OSX_ARCHITECTURES
"x86_64"
CACHE STRING
"OBS build architecture for macOS - x86_64 required at least")
set_property(CACHE CMAKE_OSX_ARCHITECTURES PROPERTY STRINGS x86_64 arm64
"x86_64;arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET
"10.15"
CACHE STRING "OBS deployment target for macOS - 10.15+ required")
set_property(CACHE CMAKE_OSX_DEPLOYMENT_TARGET PROPERTY STRINGS 10.15 11.0
12.0 13.0)
set(OBS_BUNDLE_CODESIGN_IDENTITY
"-"
CACHE STRING "OBS code signing identity for macOS")
set(OBS_CODESIGN_ENTITLEMENTS
${CMAKE_SOURCE_DIR}/cmake/bundle/macos/entitlements.plist
CACHE INTERNAL "Path to codesign entitlements plist")
set(OBS_CODESIGN_LINKER
ON
CACHE BOOL "Enable linker code-signing on macOS (macOS 11+ required)")
# Xcode configuration
if(XCODE)
# Tell Xcode to pretend the linker signed binaries so that editing with
# install_name_tool preserves ad-hoc signatures. This option is supported by
# codesign on macOS 11 or higher. See CMake Issue 21854:
# https://gitlab.kitware.com/cmake/cmake/-/issues/21854
set(CMAKE_XCODE_GENERATE_SCHEME ON)
if(OBS_CODESIGN_LINKER)
set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
endif()
endif()
# Set default options for bundling on macOS
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks/")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
function(setup_plugin_target target)
if(NOT DEFINED MACOSX_PLUGIN_GUI_IDENTIFIER)
message(
FATAL_ERROR
"No 'MACOSX_PLUGIN_GUI_IDENTIFIER' set, but is required to build plugin bundles on macOS - example: 'com.yourname.pluginname'"
)
endif()
if(NOT DEFINED MACOSX_PLUGIN_BUNDLE_VERSION)
message(
FATAL_ERROR
"No 'MACOSX_PLUGIN_BUNDLE_VERSION' set, but is required to build plugin bundles on macOS - example: '25'"
)
endif()
if(NOT DEFINED MACOSX_PLUGIN_SHORT_VERSION_STRING)
message(
FATAL_ERROR
"No 'MACOSX_PLUGIN_SHORT_VERSION_STRING' set, but is required to build plugin bundles on macOS - example: '1.0.2'"
)
endif()
set(MACOSX_PLUGIN_BUNDLE_NAME
"${target}"
PARENT_SCOPE)
set(MACOSX_PLUGIN_BUNDLE_VERSION
"${MACOSX_BUNDLE_BUNDLE_VERSION}"
PARENT_SCOPE)
set(MACOSX_PLUGIN_SHORT_VERSION_STRING
"${MACOSX_BUNDLE_SHORT_VERSION_STRING}"
PARENT_SCOPE)
set(MACOSX_PLUGIN_EXECUTABLE_NAME
"${target}"
PARENT_SCOPE)
set(MACOSX_PLUGIN_BUNDLE_TYPE
"BNDL"
PARENT_SCOPE)
install(
TARGETS ${target}
LIBRARY DESTINATION "."
COMPONENT obs_plugins
NAMELINK_COMPONENT ${target}_Development)
if(${QT_VERSION} EQUAL 5)
set(_QT_FW_VERSION "${QT_VERSION}")
else()
set(_QT_FW_VERSION "A")
endif()
set(_COMMAND
"${CMAKE_INSTALL_NAME_TOOL} \\
-change ${CMAKE_PREFIX_PATH}/lib/QtWidgets.framework/Versions/${QT_VERSION}/QtWidgets @rpath/QtWidgets.framework/Versions/${_QT_FW_VERSION}/QtWidgets \\
-change ${CMAKE_PREFIX_PATH}/lib/QtCore.framework/Versions/${QT_VERSION}/QtCore @rpath/QtCore.framework/Versions/${_QT_FW_VERSION}/QtCore \\
-change ${CMAKE_PREFIX_PATH}/lib/QtGui.framework/Versions/${QT_VERSION}/QtGui @rpath/QtGui.framework/Versions/${_QT_FW_VERSION}/QtGui \\
\\\"\${CMAKE_INSTALL_PREFIX}/${target}.plugin/Contents/MacOS/${target}\\\""
)
install(CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
COMPONENT obs_plugins)
unset(_QT_FW_VERSION)
if(NOT XCODE)
set(_COMMAND
"/usr/bin/codesign --force \\
--sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" \\
--options runtime \\
--entitlements \\\"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/bundle/macOS/entitlements.plist\\\" \\
\\\"\${CMAKE_INSTALL_PREFIX}/${target}.plugin\\\"")
install(CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")"
COMPONENT obs_plugins)
endif()
set_target_properties(
${target}
PROPERTIES
BUNDLE ON
BUNDLE_EXTENSION "plugin"
OUTPUT_NAME ${target}
MACOSX_BUNDLE_INFO_PLIST
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/bundle/macOS/Plugin-Info.plist.in"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER
"${MACOSX_PLUGIN_GUI_IDENTIFIER}"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${OBS_BUNDLE_CODESIGN_IDENTITY}"
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/bundle/macOS/entitlements.plist")
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
/bin/sh -c
"codesign --force --sign \"-\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed >\"$<TARGET_BUNDLE_DIR:${target}>\""
COMMENT "Codesigning ${target}"
VERBATIM)
install_bundle_resources(${target})
endfunction()
function(install_bundle_resources target)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/data)
file(GLOB_RECURSE _DATA_FILES "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
foreach(_DATA_FILE IN LISTS _DATA_FILES)
file(RELATIVE_PATH _RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/data/
${_DATA_FILE})
get_filename_component(_RELATIVE_PATH ${_RELATIVE_PATH} PATH)
target_sources(${target} PRIVATE ${_DATA_FILE})
set_source_files_properties(
${_DATA_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION
Resources/${_RELATIVE_PATH})
string(REPLACE "\\" "\\\\" _GROUP_NAME ${_RELATIVE_PATH})
source_group("Resources\\${_GROUP_NAME}" FILES ${_DATA_FILE})
endforeach()
endif()
endfunction()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_ARCH_SUFFIX 64)
else()
set(_ARCH_SUFFIX 32)
endif()
set(OBS_OUTPUT_DIR ${CMAKE_BINARY_DIR}/rundir)
if(OS_POSIX)
option(LINUX_PORTABLE "Build portable version (Linux)" ON)
if(NOT LINUX_PORTABLE)
set(OBS_LIBRARY_DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(OBS_PLUGIN_DESTINATION ${OBS_LIBRARY_DESTINATION}/obs-plugins)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(OBS_DATA_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs)
else()
set(OBS_LIBRARY_DESTINATION bin/${_ARCH_SUFFIX}bit)
set(OBS_PLUGIN_DESTINATION obs-plugins/${_ARCH_SUFFIX}bit)
set(CMAKE_INSTALL_RPATH
"$ORIGIN/" "${CMAKE_INSTALL_PREFIX}/${OBS_LIBRARY_DESTINATION}")
set(OBS_DATA_DESTINATION "data")
endif()
if(OS_LINUX)
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${LINUX_MAINTAINER_EMAIL}")
set(CPACK_PACKAGE_VERSION "${CMAKE_PROJECT_VERSION}")
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-linux-x86_64")
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"obs-studio (>= 27.0.0), libqt5core5a (>= 5.9.0~beta), libqt5gui5 (>= 5.3.0), libqt5widgets5 (>= 5.7.0)"
)
set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_SOURCE_DIR}/release)
if(NOT LINUX_PORTABLE)
set(CPACK_SET_DESTDIR ON)
endif()
include(CPack)
endif()
else()
set(OBS_LIBRARY_DESTINATION "bin/${_ARCH_SUFFIX}bit")
set(OBS_LIBRARY32_DESTINATION "bin/32bit")
set(OBS_LIBRARY64_DESTINATION "bin/64bit")
set(OBS_PLUGIN_DESTINATION "obs-plugins/${_ARCH_SUFFIX}bit")
set(OBS_PLUGIN32_DESTINATION "obs-plugins/32bit")
set(OBS_PLUGIN64_DESTINATION "obs-plugins/64bit")
set(OBS_DATA_DESTINATION "data")
endif()
function(setup_plugin_target target)
set_target_properties(${target} PROPERTIES PREFIX "")
install(
TARGETS ${target}
RUNTIME DESTINATION "${OBS_PLUGIN_DESTINATION}"
COMPONENT ${target}_Runtime
LIBRARY DESTINATION "${OBS_PLUGIN_DESTINATION}"
COMPONENT ${target}_Runtime
NAMELINK_COMPONENT ${target}_Development)
install(
FILES $<TARGET_FILE:${target}>
DESTINATION $<CONFIG>/${OBS_PLUGIN_DESTINATION}
COMPONENT obs_rundir
EXCLUDE_FROM_ALL)
if(OS_WINDOWS)
install(
FILES $<TARGET_PDB_FILE:${target}>
CONFIGURATIONS "RelWithDebInfo" "Debug"
DESTINATION ${OBS_PLUGIN_DESTINATION}
COMPONENT ${target}_Runtime
OPTIONAL)
install(
FILES $<TARGET_PDB_FILE:${target}>
CONFIGURATIONS "RelWithDebInfo" "Debug"
DESTINATION $<CONFIG>/${OBS_PLUGIN_DESTINATION}
COMPONENT obs_rundir
OPTIONAL EXCLUDE_FROM_ALL)
endif()
if(MSVC)
target_link_options(
${target}
PRIVATE
"LINKER:/OPT:REF"
"$<$<NOT:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>>:LINKER\:/SAFESEH\:NO>"
"$<$<CONFIG:DEBUG>:LINKER\:/INCREMENTAL:NO>"
"$<$<CONFIG:RELWITHDEBINFO>:LINKER\:/INCREMENTAL:NO>")
endif()
setup_target_resources(${target} obs-plugins/${target})
if(OS_WINDOWS AND DEFINED OBS_BUILD_DIR)
setup_target_for_testing(${target} obs-plugins/${target})
endif()
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_PREFIX=${OBS_OUTPUT_DIR}
-DCMAKE_INSTALL_COMPONENT=obs_rundir
-DCMAKE_INSTALL_CONFIG_NAME=$<CONFIG> -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
COMMENT "Installing to plugin rundir"
VERBATIM)
endfunction()
function(setup_target_resources target destination)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/data)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/
DESTINATION ${OBS_DATA_DESTINATION}/${destination}
USE_SOURCE_PERMISSIONS
COMPONENT obs_plugins)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data
DESTINATION $<CONFIG>/${OBS_DATA_DESTINATION}/${destination}
USE_SOURCE_PERMISSIONS
COMPONENT obs_rundir
EXCLUDE_FROM_ALL)
endif()
endfunction()
if(OS_WINDOWS)
function(setup_target_for_testing target destination)
install(
FILES $<TARGET_FILE:${target}>
DESTINATION $<CONFIG>/${OBS_PLUGIN_DESTINATION}
COMPONENT obs_testing
EXCLUDE_FROM_ALL)
install(
FILES $<TARGET_PDB_FILE:${target}>
CONFIGURATIONS "RelWithDebInfo" "Debug"
DESTINATION $<CONFIG>/${OBS_PLUGIN_DESTINATION}
COMPONENT obs_testing
OPTIONAL EXCLUDE_FROM_ALL)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/
DESTINATION $<CONFIG>/${OBS_DATA_DESTINATION}/${destination}
USE_SOURCE_PERMISSIONS
COMPONENT obs_testing
EXCLUDE_FROM_ALL)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_PREFIX=${OBS_BUILD_DIR}/rundir
-DCMAKE_INSTALL_COMPONENT=obs_testing
-DCMAKE_INSTALL_CONFIG_NAME=$<CONFIG> -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
COMMENT "Installing to OBS test directory"
VERBATIM)
endfunction()
endif()
endif()

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>${MACOSX_PLUGIN_BUNDLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_PLUGIN_GUI_IDENTIFIER}</string>
<key>CFBundleVersion</key>
<string>${MACOSX_PLUGIN_BUNDLE_VERSION}</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_PLUGIN_SHORT_VERSION_STRING}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_PLUGIN_EXECUTABLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>${MACOSX_PLUGIN_BUNDLE_TYPE}</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
</dict>
</plist>

View File

@ -0,0 +1,17 @@
<!--?xml version="1.0" encoding="UTF-8"?-->
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<!-- Allows @executable_path to load libaries from within the .app bundle. -->
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,920 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PACKAGES</key>
<array>
<dict>
<key>MUST-CLOSE-APPLICATION-ITEMS</key>
<array/>
<key>MUST-CLOSE-APPLICATIONS</key>
<false/>
<key>PACKAGE_FILES</key>
<dict>
<key>DEFAULT_INSTALL_LOCATION</key>
<string>/</string>
<key>HIERARCHY</key>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Applications</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>BUNDLE_CAN_DOWNGRADE</key>
<false/>
<key>BUNDLE_POSTINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>BUNDLE_PREINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../@RELATIVE_INSTALL_PATH@/@CMAKE_PROJECT_NAME@.plugin</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>plugins</string>
<key>PATH_TYPE</key>
<integer>2</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>obs-studio</string>
<key>PATH_TYPE</key>
<integer>2</integer>
<key>PERMISSIONS</key>
<integer>509</integer>
<key>TYPE</key>
<integer>2</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Application Support</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Automator</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Documentation</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Extensions</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Filesystems</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Frameworks</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Input Methods</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Internet Plug-Ins</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>LaunchAgents</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>LaunchDaemons</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>PreferencePanes</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Preferences</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Printers</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>PrivilegedHelperTools</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>1005</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>QuickLook</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>QuickTime</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Screen Savers</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Scripts</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Services</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Widgets</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Library</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>Shared</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>1023</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>Users</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
</array>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>/</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>1</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<key>PAYLOAD_TYPE</key>
<integer>0</integer>
<key>PRESERVE_EXTENDED_ATTRIBUTES</key>
<false/>
<key>SHOW_INVISIBLE</key>
<false/>
<key>SPLIT_FORKS</key>
<true/>
<key>TREAT_MISSING_FILES_AS_WARNING</key>
<false/>
<key>VERSION</key>
<integer>5</integer>
</dict>
<key>PACKAGE_SCRIPTS</key>
<dict>
<key>POSTINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>PREINSTALL_PATH</key>
<dict>
<key>PATH_TYPE</key>
<integer>0</integer>
</dict>
<key>RESOURCES</key>
<array/>
</dict>
<key>PACKAGE_SETTINGS</key>
<dict>
<key>AUTHENTICATION</key>
<integer>0</integer>
<key>CONCLUSION_ACTION</key>
<integer>0</integer>
<key>FOLLOW_SYMBOLIC_LINKS</key>
<false/>
<key>IDENTIFIER</key>
<string>@MACOS_BUNDLEID@</string>
<key>LOCATION</key>
<integer>0</integer>
<key>NAME</key>
<string>@CMAKE_PROJECT_NAME@</string>
<key>OVERWRITE_PERMISSIONS</key>
<false/>
<key>PAYLOAD_SIZE</key>
<integer>-1</integer>
<key>REFERENCE_PATH</key>
<string></string>
<key>RELOCATABLE</key>
<false/>
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>@CMAKE_PROJECT_VERSION@</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
<key>UUID</key>
<string>0B7A74BC-65CF-4FF1-AC34-5C743E8A48F5</string>
</dict>
</array>
<key>PROJECT</key>
<dict>
<key>PROJECT_COMMENTS</key>
<dict>
<key>NOTES</key>
<data>
</data>
</dict>
<key>PROJECT_PRESENTATION</key>
<dict>
<key>BACKGROUND</key>
<dict>
<key>APPAREANCES</key>
<dict>
<key>DARK_AQUA</key>
<dict/>
<key>LIGHT_AQUA</key>
<dict/>
</dict>
<key>SHARED_SETTINGS_FOR_ALL_APPAREANCES</key>
<true/>
</dict>
<key>INSTALLATION TYPE</key>
<dict>
<key>HIERARCHIES</key>
<dict>
<key>INSTALLER</key>
<dict>
<key>LIST</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>DESCRIPTION</key>
<array/>
<key>OPTIONS</key>
<dict>
<key>HIDDEN</key>
<false/>
<key>STATE</key>
<integer>1</integer>
</dict>
<key>PACKAGE_UUID</key>
<string>0B7A74BC-65CF-4FF1-AC34-5C743E8A48F5</string>
<key>TITLE</key>
<array/>
<key>TYPE</key>
<integer>0</integer>
<key>UUID</key>
<string>52B6084A-F58D-45C3-BE37-76AD45F16072</string>
</dict>
</array>
<key>REMOVED</key>
<dict/>
</dict>
</dict>
<key>MODE</key>
<integer>0</integer>
</dict>
<key>INSTALLATION_STEPS</key>
<array>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewIntroductionController</string>
<key>INSTALLER_PLUGIN</key>
<string>Introduction</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewReadMeController</string>
<key>INSTALLER_PLUGIN</key>
<string>ReadMe</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewLicenseController</string>
<key>INSTALLER_PLUGIN</key>
<string>License</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewDestinationSelectController</string>
<key>INSTALLER_PLUGIN</key>
<string>TargetSelect</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewInstallationTypeController</string>
<key>INSTALLER_PLUGIN</key>
<string>PackageSelection</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewInstallationController</string>
<key>INSTALLER_PLUGIN</key>
<string>Install</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
<dict>
<key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
<string>ICPresentationViewSummaryController</string>
<key>INSTALLER_PLUGIN</key>
<string>Summary</string>
<key>LIST_TITLE_KEY</key>
<string>InstallerSectionTitle</string>
</dict>
</array>
<key>INTRODUCTION</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
</dict>
<key>LICENSE</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
<key>MODE</key>
<integer>0</integer>
</dict>
<key>README</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
</dict>
<key>SUMMARY</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
</dict>
<key>TITLE</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
</dict>
</dict>
<key>PROJECT_REQUIREMENTS</key>
<dict>
<key>LIST</key>
<array>
<dict>
<key>BEHAVIOR</key>
<integer>3</integer>
<key>DICTIONARY</key>
<dict>
<key>IC_REQUIREMENT_OS_DISK_TYPE</key>
<integer>1</integer>
<key>IC_REQUIREMENT_OS_DISTRIBUTION_TYPE</key>
<integer>0</integer>
<key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key>
<integer>101300</integer>
</dict>
<key>IC_REQUIREMENT_CHECK_TYPE</key>
<integer>0</integer>
<key>IDENTIFIER</key>
<string>fr.whitebox.Packages.requirement.os</string>
<key>MESSAGE</key>
<array/>
<key>NAME</key>
<string>Operating System</string>
<key>STATE</key>
<true/>
</dict>
</array>
<key>RESOURCES</key>
<array/>
<key>ROOT_VOLUME_ONLY</key>
<true/>
</dict>
<key>PROJECT_SETTINGS</key>
<dict>
<key>ADVANCED_OPTIONS</key>
<dict>
<key>installer-script.domains:enable_currentUserHome</key>
<integer>1</integer>
</dict>
<key>BUILD_FORMAT</key>
<integer>0</integer>
<key>BUILD_PATH</key>
<dict>
<key>PATH</key>
<string>../@RELATIVE_BUILD_PATH@</string>
<key>PATH_TYPE</key>
<integer>1</integer>
</dict>
<key>EXCLUDED_FILES</key>
<array>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.DS_Store</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove .DS_Store files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove ".DS_Store" files created by the Finder.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.pbdevelopment</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove .pbdevelopment files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>CVS</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.cvsignore</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.cvspass</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.svn</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.git</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>.gitignore</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove SCM metadata</string>
<key>PROXY_TOOLTIP</key>
<string>Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>classes.nib</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>designable.db</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>info.nib</string>
<key>TYPE</key>
<integer>0</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Optimize nib files</string>
<key>PROXY_TOOLTIP</key>
<string>Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>PATTERNS_ARRAY</key>
<array>
<dict>
<key>REGULAR_EXPRESSION</key>
<false/>
<key>STRING</key>
<string>Resources Disabled</string>
<key>TYPE</key>
<integer>1</integer>
</dict>
</array>
<key>PROTECTED</key>
<true/>
<key>PROXY_NAME</key>
<string>Remove Resources Disabled folders</string>
<key>PROXY_TOOLTIP</key>
<string>Remove "Resources Disabled" folders.</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>SEPARATOR</key>
<true/>
</dict>
</array>
<key>NAME</key>
<string>@CMAKE_PROJECT_NAME@</string>
<key>PAYLOAD_ONLY</key>
<false/>
<key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key>
<false/>
</dict>
</dict>
<key>TYPE</key>
<integer>0</integer>
<key>VERSION</key>
<integer>2</integer>
</dict>
</plist>

View File

@ -0,0 +1,63 @@
#define MyAppName "@CMAKE_PROJECT_NAME@"
#define MyAppVersion "@CMAKE_PROJECT_VERSION@"
#define MyAppPublisher "@PLUGIN_AUTHOR@"
#define MyAppURL "https://obsproject.com"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{CD703FE5-1F2C-4837-BD3D-DD840D83C3E3}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetDirName}
DefaultGroupName={#MyAppName}
OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows-Installer
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "..\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\LICENSE"; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
[Code]
procedure InitializeWizard();
var
GPLText: AnsiString;
Page: TOutputMsgMemoWizardPage;
begin
ExtractTemporaryFile('LICENSE');
LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText);
Page := CreateOutputMsgMemoPage(wpWelcome,
'License Information', 'Please review the license terms before installing {#MyAppName}',
'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.',
String(GPLText)
);
end;
// credit where it's due :
// following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
function GetDirName(Value: string): string;
var
InstallPath: string;
begin
// initialize default path, which will be returned when the following registry
// key queries fail due to missing keys or for some different reason
Result := '{autopf}\obs-studio';
// query the first registry value; if this succeeds, return the obtained value
if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
Result := InstallPath
end;

3
crowdin.yml Normal file
View File

@ -0,0 +1,3 @@
files:
- source: /data/locale/en-US.ini
translation: /data/locale/%locale%.ini

View File

@ -1,6 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Websocket-Server Einstellungen"
OBSWebsocket.Settings.DialogTitle="Websocket-Server Einstellungen"
OBSWebsocket.Settings.ServerEnable="Websocket-Server aktivieren"
OBSWebsocket.Settings.ServerPort="Server Port"
OBSWebsocket.Settings.AuthRequired="Authentifizierung erforderlich"
OBSWebsocket.Settings.Password="Passwort"

View File

@ -1,10 +1,21 @@
OBSWebsocket.Menu.SettingsItem="Websocket server settings" OBSWebsocketCompat.Settings.DialogTitle="WebSockets Server Settings (4.x Compat)"
OBSWebsocket.Settings.DialogTitle="obs-websocket" OBSWebsocketCompat.Settings.ServerEnable="Enable WebSockets server"
OBSWebsocket.Settings.ServerEnable="Enable Websocket server" OBSWebsocketCompat.Settings.ServerPort="Server Port"
OBSWebsocket.Settings.ServerPort="Server Port" OBSWebsocketCompat.Settings.AuthRequired="Enable authentication"
OBSWebsocket.Settings.AuthRequired="Enable authentication" OBSWebsocketCompat.Settings.Password="Password"
OBSWebsocket.Settings.Password="Password" OBSWebsocketCompat.Settings.LockToIPv4="Lock server to only using IPv4"
OBSWebsocket.Settings.DebugEnable="Enable debug logging" OBSWebsocketCompat.Settings.DebugEnable="Enable debug logging"
OBSWebsocket.ConnectNotify.Connected="New WebSocket connection" OBSWebsocketCompat.Settings.AlertsEnable="Enable System Tray Alerts"
OBSWebsocket.ConnectNotify.Disconnected="WebSocket client disconnected" OBSWebsocketCompat.Settings.AuthDisabledWarning="Running obs-websocket with authentication disabled is not recommended, as it allows attackers to easily collect sensetive data. Are you sure you want to proceed?"
OBSWebsocket.ConnectNotify.ClientIP="Client Address:" OBSWebsocketCompat.NotifyConnect.Title="New WebSocket connection"
OBSWebsocketCompat.NotifyConnect.Message="Client %1 connected"
OBSWebsocketCompat.NotifyDisconnect.Title="WebSocket client disconnected"
OBSWebsocketCompat.NotifyDisconnect.Message="Client %1 disconnected"
OBSWebsocketCompat.Server.StartFailed.Title="WebSockets Server failure"
OBSWebsocketCompat.Server.StartFailed.Message="The WebSockets compat server failed to start, maybe because:\n - TCP port %1 may currently be in use by the main obs-websocket plugin. Try setting a different TCP port in the obs-websocket Server Settings, or stop any application that could be using this port.\n - Error message: %2"
OBSWebsocketCompat.ProfileChanged.Started="WebSockets server enabled in this profile. Server started."
OBSWebsocketCompat.ProfileChanged.Stopped="WebSockets server disabled in this profile. Server stopped."
OBSWebsocketCompat.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted."
OBSWebsocketCompat.InitialPasswordSetup.Title="obs-websocket - Server Password Configuration"
OBSWebsocketCompat.InitialPasswordSetup.Text="It looks like you are running obs-websocket for the first time. Do you want to configure a password now for the WebSockets server? Setting a password is highly recommended."
OBSWebsocketCompat.InitialPasswordSetup.DismissedText="You can configure a server password later in the WebSockets Server Settings. (Under the Tools menu of OBS Studio)"

View File

@ -1,9 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Paramètres du serveur Websocket"
OBSWebsocket.Settings.DialogTitle="obs-websocket"
OBSWebsocket.Settings.ServerEnable="Activer le serveur Websockets"
OBSWebsocket.Settings.ServerPort="Port du serveur"
OBSWebsocket.Settings.AuthRequired="Activer l'authentification"
OBSWebsocket.Settings.Password="Mot de passe"
OBSWebsocket.ConnectNotify.Connected="Nouvelle connexion WebSocket"
OBSWebsocket.ConnectNotify.Disconnected="Déconnexion WebSocket"
OBSWebsocket.ConnectNotify.ClientIP="Adresse du client :"

View File

@ -1,6 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Websocket server instellingen"
OBSWebsocket.Settings.DialogTitle="obs-websocket"
OBSWebsocket.Settings.ServerEnable="Activeer Websocket server"
OBSWebsocket.Settings.ServerPort="Server Poort"
OBSWebsocket.Settings.AuthRequired="Activeer authenticatie"
OBSWebsocket.Settings.Password="Wachtwoord"

View File

@ -1,6 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Ustawienia serwera zdalnego sterowania"
OBSWebsocket.Settings.DialogTitle="Serwer zdalnego sterowania"
OBSWebsocket.Settings.ServerEnable="Włącz serwer zdalnego sterowania (Websocket)"
OBSWebsocket.Settings.ServerPort="Port serwera"
OBSWebsocket.Settings.AuthRequired="Wymagaj hasła"
OBSWebsocket.Settings.Password="Hasło"

View File

@ -1,6 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Configuraçes do Servidor Websocket"
OBSWebsocket.Settings.DialogTitle="obs-websocket"
OBSWebsocket.Settings.ServerEnable="Habilitar o Servidor Websocket"
OBSWebsocket.Settings.ServerPort="Porta do Servidor"
OBSWebsocket.Settings.AuthRequired="Autenticação Requerida"
OBSWebsocket.Settings.Password="Senha"

View File

@ -1,6 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Websocket 服务器设置"
OBSWebsocket.Settings.DialogTitle="obs-websocket 设置"
OBSWebsocket.Settings.ServerEnable="启用 Websocket 服务器"
OBSWebsocket.Settings.ServerPort="服务器端口"
OBSWebsocket.Settings.AuthRequired="启用密码认证"
OBSWebsocket.Settings.Password="密码"

View File

@ -1,6 +0,0 @@
OBSWebsocket.Menu.SettingsItem="Websocket 伺服器設定"
OBSWebsocket.Settings.DialogTitle="obs-websocket 設定"
OBSWebsocket.Settings.ServerEnable="啟用 Websocket 伺服器"
OBSWebsocket.Settings.ServerPort="伺服器端口"
OBSWebsocket.Settings.AuthRequired="啟用密碼認證"
OBSWebsocket.Settings.Password="密碼"

1
deps/asio vendored Submodule

Submodule deps/asio added at b73dc1d2c0

1
deps/mbedtls vendored

Submodule deps/mbedtls deleted from 1a6a15c795

1
deps/websocketpp vendored Submodule

Submodule deps/websocketpp added at 56123c8759

11
docs/.editorconfig Normal file
View File

@ -0,0 +1,11 @@
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
[*.md, *.mustache]
trim_trailing_whitespace = false
insert_final_newline = false

Some files were not shown because too many files have changed in this diff Show More