Commit Graph

507 Commits

Author SHA1 Message Date
tt2468
d9026c1791 docs: Fix lint formatting error 2022-07-02 08:30:23 -07:00
tt2468
2524dc47cf requesthandler: Fix oopsies in OpenVideoMixProjector 2022-07-02 08:27:18 -07:00
tt2468
9cdfa41113 requesthandler: Add projector creation requests
I didn't think I'd be able to make remotely usable requests using OBS'
existing projector API, but I'm actually pretty happy with how it
turned out.

Closes #929

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-07-02 08:25:38 -07:00
tt2468
be1b13f15d requesthandler: Echo request details in response of CallVendorRequest
I generally don't like to echo data provided to obs-websocket in
requests, but since we do that for the request type in base requests,
this particular case seems fair.

Closes #919
2022-07-02 07:09:31 -07:00
tt2468
4201664c7b requesthandler, eventhandler: Add outputPath fields when record stops
Closes #934
2022-07-02 07:02:44 -07:00
tt2468
3deea2b5da requesthandler: Rework and fix a few data consistency checks
Some stuff led to possible crashes, other stuff simply didn't work.
Should be much better now.

Closes #942
2022-06-08 01:32:27 -07:00
tt2468
f4b72b69ce utils: Clean up a few iteration functions 2022-06-08 01:04:43 -07:00
tt2468
5b8fd096d5 clang-format: Indent namespaces 2022-06-08 00:37:04 -07:00
tt2468
22fee0312d utils: Move from explicit enum converters to nlohmann macros 2022-06-08 00:33:41 -07:00
tt2468
17292520f2 utils: A few casting nitpicks 2022-06-07 23:36:47 -07:00
tt2468
711746524c Revert "Config, websocketserver: Add feature to bind to loopback (default)"
This reverts commit 1da0214201.
2022-06-07 23:07:09 -07:00
tt2468
e04bca0993 Revert "forms: Add configuration to enable external access"
This reverts commit 1cd12c1023.
2022-06-07 22:34:40 -07:00
tt2468
c8d0ed2138 docs: Fix EventSubscription::All subscribes 2022-06-07 21:47:54 -07:00
tt2468
6deadc25ac base: Change column limit to 132
A column limit of 80 is very restrictive and code readability was
suffering. A limit of 132 is more realistic for this plugin.
2022-06-07 21:36:51 -07:00
tt2468
f73e78582b base: Format code 2022-05-13 21:19:29 -07:00
tt2468
27d21975f0 websocketapi: Fix build on Windows 64 bit 2022-05-13 19:06:03 -07:00
tt2468
749ecc976b base, lib: Update plugin API example and tests
Updates the example and tests for the plugin API to include the latest
additions to the plugin API.
2022-05-10 23:04:21 -07:00
tt2468
d85c86e3a0 base, lib: Add ability to call obs-websocket requests via plugin API
**Increments Plugin API Version**

Adds functions:
- `obs_websocket_get_api_version()` - Gets the current obs-websocket
plugin API version
- `obs_websocket_call_request()` - Calls an obs-websocket request via
the plugin API

Adds structs:
- `obs_websocket_request_response`
2022-05-10 23:04:04 -07:00
tt2468
3303acfcca requesthandler: Don't require session for Request Handler
Required to call requests in situations where a session is not
relevant.
2022-05-10 22:48:57 -07:00
tt2468
1cd12c1023 forms: Add configuration to enable external access
After discussion in the Discord server, and some internal discussion,
this was deemed a reasonable patch for various security concerns. This
basically controls whether obs-websocket binds to 127.0.0.1 or 0.0.0.0.

I decided to have obs-websocket bind to 127.0.0.1 by default, since
most users appear to be using obs-websocket on the same machines as
their client software. This will be changed if it poses significant
support-related issues.

Further security solutions have been discussed, but are either a heavy
amount of work, or significantly impact client applications' connect
flows.

One idea that I should mention is like a cookie system, where:
- On first connect, obs-websocket asks the user to approve the
connection.
- After authentication, obs-websocket gives the client a token in the
`Identified` message, which the client stores.
- On future connects, the client uses this token, along with the
password, to authenticate without needing user confirmation.

This system will likely be implemented in a future version of
obs-websocket.

Closes #907
2022-04-26 03:24:26 -07:00
tt2468
1da0214201 Config, websocketserver: Add feature to bind to loopback (default)
Binds to localhost or 127.0.0.1 by default, since most users don't have
to access obs-websocket externally.
2022-04-25 21:31:52 -07:00
tt2468
226c81ce78 utils/Platform: Ignore virtualbox interface IP
Somewhat common on systems, so we'll just manually ignore it.

Closes #928
2022-04-25 20:38:26 -07:00
tt2468
ac102de1e8
Merge branch 'master' into docs-formatting 2022-04-25 20:30:25 -07:00
Christopher Sund
2479501879 Requests: Add GetMonitorList
Adds a new request `GetMonitorList` that returns a json Array of
objects containing data about connected monitors. See #868
2022-04-25 20:20:45 -07:00
Chris Tallon
3a5f0d89b9 Server: Add --websocket_ipv4_only switch
Socket listening default changed to IPv4 and IPv6,
overridable to IPv4 only by using the command line switch.
2022-04-25 19:53:15 -07:00
tt2468
8b85658c61 requesthandler: Add platform info to GetVersion
It can be very useful to know which platform you're connecting to in
the case of things like text input modification, where Windows uses
GDI while unix uses FT2.
2022-04-25 19:43:40 -07:00
tt2468
a9c9363d4a eventhandler: Fix group remove signals
Like inputs, if a group is ungrouped, the group itself is not removed.
What actually happens is the removal of the last scene item triggers
a destroy, just like with inputs.

This modifies the old signal selection in favor of falling back
to the destroy signal if an object is not explicitly removed.
2022-04-16 19:34:47 -07:00
tt2468
9d899376a5 requesthandler: Fix docs for SetSourceFilterEnabled 2022-04-13 02:17:27 -07:00
tt2468
d8c042fe4a requesthandler: Add private scene item settings get/set
Some may need it, similarly to Get/SetSourcePrivateSettings.
2022-04-13 02:13:30 -07:00
tt2468
c355c72f4b requesthandler, utils: Add search offset to GetSceneItemId
Allows you to select a specific match by offset, or select the
last (top) scene item by specifying `-1`.
2022-04-13 02:01:40 -07:00
tt2468
71a32c981c utils: Reserve vector capacity where possible
Slight optimization for iteration
2022-03-01 14:48:10 -08:00
tt2468
bbf9c283c0 eventhandler: Add SceneTransitionVideoEnded 2022-03-01 14:36:35 -08:00
tt2468
9ac7c5890e eventhandler: Add SceneTransitionEnded 2022-03-01 14:36:35 -08:00
tt2468
a7698a732f eventhandler: Add SceneTransitionStarted + cleanup
This commit cleans up a bunch of code in the event handler,
making it much easier to understand (IMO). I feel much better
about how we handle connecting and disconnecting callbacks. Before,
we were actually allowing a bunch of callbacks to stay connected and
get cleaned up. Now, we actually properly disconnect them.
2022-03-01 14:36:35 -08:00
Dominik Nakamura
2297432f90
Fix type in SetSourceFilterEnabled docs 2022-02-19 16:13:42 +09:00
Dominik Nakamura
2027394d33
Fix new markdown warnings from latest master 2022-02-19 15:58:42 +09:00
Dominik Nakamura
d7de347b37
Merge branch 'master' into docs-formatting 2022-02-19 15:53:39 +09:00
tt2468
aa13828cf5 requesthandler: Add SetSourceFilterName 2022-02-16 13:37:18 -08:00
tt2468
db2ffa569a Base: Fix some formatting 2022-02-16 13:30:10 -08:00
tt2468
66c14dced5 requesthandler: Reorder a filter request 2022-02-16 13:23:49 -08:00
Brendan Allan
361547a96d
requesthandler: Filter requests & events (#888)
* Implement filter requests

* Fix CreateSourceFilter

* Implement most Filter events

* build against 27.1.3

* Update main.yml

* SourceFilterNameChanged rename

* revert main.yml changes

* rename SourceFilterCreated and revert CI changes

* cleanup

* Base: Various cleanups + fix -Werror

* Base: A few nitpicks/fixes

* requesthandler: Fix CreateSourceFilter

* utils: Fix CreateSourceFilter

Use obs_source_t* instead of OBSSourceAutoRelease to prevent double
release

* requesthandler: Remove filterIndex from CreateSourceFilter

The purpose of sceneItemEnabled in CreateSceneItem is to hide the
scene item while we still hold the scene mutex (guaranteeing the input
will never be shown). Since we don't hold a mutex when creating
filters, there's no reason to do any extra steps.

* requesthandler: Validate input/filter kinds in *DefaultSettings

Co-authored-by: tt2468 <tt2468@gmail.com>
2022-02-16 13:17:06 -08:00
tt2468
7b52d7e015 requesthandler: Move GetRecordDirectory to config
More consistency
2022-02-14 17:11:07 -08:00
tt2468
9664f28483 requesthandler: Finish transition requests 2022-02-14 17:01:44 -08:00
tt2468
d9070f9edb requesthandler: Add scene scene transition override requests
It's named like:
`Get Scene (Scene Transition) Override`
2022-02-14 15:57:33 -08:00
tt2468
fa8a091a3e RequestHandler: Add SendStreamCaption 2022-02-13 15:20:19 -08:00
tt2468
341259e610 RequestHandler: Save config after profile parameter change
Fixes a bug where changed parameters were not applying across loads

Fixes #895
2022-02-13 14:46:49 -08:00
tt2468
c64e360c2d
Merge pull request #904 from dnaka91/fix-int-type
server: Fix int type of batch execution enum
2022-02-13 14:41:45 -08:00
Dominik Nakamura
403c69463a
server: Fix int type of batch execution enum 2022-02-02 10:36:59 +09:00
Dominik Nakamura
ddf752fd03
docs: Fix wrong field name in SceneItemLockStateChanged 2022-01-29 23:50:12 +09:00
tt2468
d2ddde3229 eventhandler: Add a few transition events 2022-01-28 16:56:21 -08:00
tt2468
14227237d7 Base: [BREAKING] Update default WebSocket port to 4455
Our original strategy of relying on clients to simply detect the
protocol version and use the correct one was optimistic at best,
and it has been realized during the transition process from 4.x to 5.x
that sharing 4444 is not practical. As such, we'll be using 4455 in
the future for 5.x.

If you are a client developer, we suggest continuing to maintain
appropriate protocol version detection and support, as the WebSocket
port is at the end of the day simply a suggestion.
2022-01-28 15:38:08 -08:00
tt2468
3e2984fd7a eventhandler: Add SceneItemSelected event
So I didn't think anyone actually used this, but I was wrong. So I'm
adding it again.
2022-01-28 15:33:28 -08:00
tt2468
38d78596ce requesthandler: Add replay buffer requests 2022-01-26 21:19:10 -08:00
tt2468
13c7b83c34 requesthandler: Fix compiler warnings with latest OBS master
OBS has deprecated the `_addref` functions, so the new norm is to use
`_get_ref`.
2022-01-26 17:40:45 -08:00
tt2468
ae906bb283 RequestHandler: Add VirtualCam requests 2022-01-18 19:23:06 -08:00
tt2468
873eadec05
requesthandler: Fix documentation of dB value input
Max dB value is 26dB, not -26dB.
2022-01-08 22:13:53 -08:00
tt2468
dea0fcd561 Base: Add logging for compile time ASIO version 2022-01-07 23:00:48 -08:00
tt2468
6035294339 requesthandler: Add GetSourceFilter 2022-01-03 13:54:27 -08:00
tt2468
6a2d5968ad requesthandler: Add private source settings get/set requests
It was requested via Discord to be able to modify the private settings
of any private source, since that functionality is used by some client
software to store stateful data. As private settings are in territory
that no normal user should ever tread into, these requests will be left
undocumented.
2022-01-01 17:43:26 -08:00
tt2468
fe64620731 requesthandler: Add scene item blend mode requests 2021-12-31 18:05:05 -08:00
tt2468
24e43d0276 requesthandler: Add GetSpecialInputs 2021-12-31 16:49:18 -08:00
tt2468
506a9167c3 requesthandler: Add SetInputAudioTracks 2021-12-31 15:26:54 -08:00
tt2468
35c8a87def requesthandler: Profile requests if PLUGIN_TESTS is enabled 2021-12-31 15:26:54 -08:00
tt2468
e451a8d6b0 requesthandler: Use unordered_map for request table
Shaves like 0.0005ms off of request time, but still worth noting.
2021-12-31 15:26:54 -08:00
tt2468
702f88cea8 requesthandler: Add GetInputAudioTracks 2021-12-31 14:08:22 -08:00
tt2468
6d216e0412 docs: Fix docs of InputAudioTracksChanged 2021-12-31 14:08:22 -08:00
tt2468
e43ebde794 Base: Use static_cast in place of reinterpret_cast
static_cast is a much safer cast method
2021-12-30 00:21:29 -08:00
tt2468
4a2654d095 RequestHandler: Add GetGroupList 2021-12-30 00:12:41 -08:00
tt2468
a90dafb971
Merge pull request #885 from obsproject/feature/input-audio-requests-events
Input audio requests and events
2021-12-29 21:12:23 -08:00
tt2468
12c6527442
Merge pull request #884 from obsproject/feature/ui-dialog-requests
RequestHandler: Add input open dialog requests
2021-12-29 21:08:41 -08:00
tt2468
31997db509 EventHandler: Uncomment audio_monitoring signal 2021-12-29 21:05:28 -08:00
tt2468
9113ff9021 RequestHandler: Add audio balance requests 2021-12-29 21:03:16 -08:00
tt2468
1ed095de48 EventHandler: Add InputAudioBalanceChanged 2021-12-29 21:03:16 -08:00
tt2468
a94ac24027 RequestHandler: Add input open dialog requests
Adds
- `OpenInputPropertiesDialog`
- `OpenInputFiltersDialog`
- `OpenInputInteractDialog`
2021-12-29 21:00:11 -08:00
tt2468
903b7d4171
Merge pull request #860 from obsproject/fix/audio_monitoring_check
Requests: Add support check for monitoring in `SetInputAudioMonitoringType`
2021-12-29 20:59:38 -08:00
tt2468
a59ce69ba1
Merge pull request #857 from obsproject/fix/remove-old-ifdefs
Base: Remove old ifdefs
2021-12-29 20:54:24 -08:00
tt2468
195c4a3ca9
Merge pull request #873 from obsproject/fix/inputvolumemeters-check
ObsVolumeMeter: Reenable check for valid input
2021-12-29 20:54:00 -08:00
tt2468
3b2369ae97 Requests: Add support check for SetInputAudioMonitorType 2021-12-29 20:50:27 -08:00
tt2468
af634b63fd
Merge pull request #854 from obsproject/request/removeinput
Requests: Enable RemoveInput
2021-12-29 20:49:09 -08:00
tt2468
444685c89d Utils: Reenable check for valid input in volumemeter 2021-12-29 20:45:20 -08:00
tt2468
05aba45809 Base: Remove old ifdefs
It was a very cool method to save our precious std::strtoll method,
but will no longer be needed on the next OBS release.
2021-12-29 20:40:49 -08:00
tt2468
1f1a8926b1 Requests: Enable RemoveInput 2021-12-29 20:40:14 -08:00
tt2468
947450ce4e Revert "Revert "Events: Re-enable *Changing events""
This reverts commit c60d09246c.
2021-12-29 20:29:45 -08:00
tt2468
38157579a6 Requests: Enable GetRecordDirectory 2021-12-29 19:53:10 -08:00
tt2468
707ac3f7e3 docs: Increase complexity of G/SetProfileParameter 2021-12-29 00:51:50 -08:00
tt2468
732d5af50c EventHandler: Add Ui category 2021-12-29 00:34:25 -08:00
tt2468
0939273abf EventSubscription: Add Ui category 2021-12-29 00:32:28 -08:00
tt2468
f8263caa03 RequestHandler: Add code comment to RemoveSceneItem 2021-12-29 00:23:30 -08:00
tt2468
af217c05f1 EventHandler: [BREAKING] Rename CurrentSceneChanged to CurrentProgramSceneChanged
Now matches the requests
2021-12-28 23:53:58 -08:00
tt2468
e640ae1218 docs: Finish documenting events 2021-12-28 23:45:11 -08:00
tt2468
bb2c125601 Utils: Use atomic in VolumeMeter manager 2021-12-28 22:50:11 -08:00
tt2468
e1cb858d2d Utils: Split monitor type util 2021-12-28 22:49:58 -08:00
tt2468
1339202c02 docs: Fix Array fields in transition requests 2021-12-28 22:37:00 -08:00
tt2468
964e91bbd7 docs: Document ObsMediaInputAction 2021-12-28 18:57:02 -08:00
tt2468
9385a2449e docs: Document the rest of the undocumented requests 2021-12-28 18:28:04 -08:00
tt2468
ec79124b5f docs: Document transition requests 2021-12-28 18:11:30 -08:00
tt2468
4d65c2adee Utils: Move GetListPropertyItems to utils 2021-12-28 17:16:41 -08:00
tt2468
e2f60b002e RequestHandler: Reorder Ui requests to new category 2021-12-28 16:58:28 -08:00
tt2468
86506778ad RequestHandler: Add Ui category
Creates a new category specific to requests controlling the OBS UI.
2021-12-28 16:58:28 -08:00
tt2468
0992f74fad RequestHandler: Use ValidateScene2 for GetSceneItemId 2021-12-28 16:58:28 -08:00