Commit Graph

15 Commits

Author SHA1 Message Date
5fc39ef054 base: Apply latest clang-format changes from upstream
Minus, some customizations, of course
2024-04-22 23:44:04 -07:00
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
f73e78582b base: Format code 2022-05-13 21:19:29 -07:00
bd6c663775 Base: Add copyright header to source 2021-11-19 17:32:22 -08:00
1b25e98dc2 Revert "Requests: Add Compare"
This reverts commit 3687086ce0.

I realized that I'm adding too much too fast, and that we should
focus on getting v5 out first.
2021-10-05 20:17:45 -07:00
3687086ce0 Requests: Add Compare
Non-functional, will have to finish impl later
2021-10-04 17:32:17 -07:00
a8d27ede9e Base: Add request batch execution types
A new `executionType` field has been added to the `RequestBatch` Op

Types added:
- `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_REALTIME`(default)
- `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_FRAME`
- `OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_PARALLEL`

`OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_REALTIME`:
- Same as how request batches have always worked.
- Requests are processed in-order
- Requests are processed as soon as possible by one worker thread
- The `Sleep` request blocks execution for a specified amount of real
world time

`OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_SERIAL_FRAME`:
- New!
- Requests are processed in-order
- Requests are processed on the graphics thread. BE VERY CAREFUL NOT
TO OVERLOAD THE GRAPHICS THREAD WITH LARGE REQUESTS. A general rule
of thumb is for your request batches to take a maximum of 2ms per
frame of processing.
- Requests processing starts right before the next frame is composited.
This functionality is perfect for things like `SetSceneItemTransform`
- The `Sleep` request will halt processing of the request batch for
a specified number of frames (ticks)
- To be clear: If you do not have any sleep requests, all requests in
the batch will be processed in the span of a single frame
- For developers: The execution of requests gets profiled by the OBS
profiler under the `obs-websocket-request-batch-frame-tick` name.
This value (shown in the OBS log after OBS shutdown) represents the
amount of time that the graphics thread spent actively processing
requests per frame. This tool can be used to determine the amount of
load that your request batches are placing on the graphics thread.

`OBS_WEBSOCKET_REQUEST_BATCH_EXECUTION_TYPE_PARALLEL`:
- New!
- Requests are processed asynchronously at the soonest possible time.
- Requests are processed by the core obs-websocket thread pool, where
the number of workers == the number of threads on your machine.
  - If you have 12 threads on your machine, obs-websocket will be able
to process 12 requests at any given moment.
- The `results` array is populated by order of request completion.
Consider the order to be random.
- The `Sleep` request will return an error if attempted to be used in
this mode.
- Note: This feature is experimental and can increase the chances of
causing race conditions (crashes). While the implementation is fully
thread-safe, OBS itself is not. Usage of this is only recommended if
you are processing very large batches and need the performance benefit.
- Example use case: Performing `SaveSourceScreenshot` on 8 sources
at once.
2021-09-26 03:12:29 -07:00
c2b717cabf RequestStatus: Put into namespace
Apparently this is supposed to help?
2021-05-03 13:43:59 -07:00
807a1501b7 base: Refactor request stuff and finish more logic 2021-05-03 13:31:22 -07:00
36af7f6f58 base: Lots of stuff, including RequestHandler progress 2021-05-02 19:48:44 -07:00
e151a9a8db base: Use Unix EOL 2021-04-29 21:13:34 -07:00
98ec9d01ac base: Dumb #include redefinitions 2021-04-27 16:45:44 -07:00
d9ee288cf1 base: cmake is fucking retarded 2021-04-27 16:33:47 -07:00
8067cfb686 Base: Tons more shit 2021-04-27 14:52:48 -07:00
a0162caad1 base: Add base RequestHandler and rpc files 2021-04-27 09:29:51 -07:00