The rationale for rejecting these register calls is that these functions
may be required for the plugin to work properly, which can't be
guaranteed when libobs doesn't know about them.
This behavior may be revisited once the plugin manager is implemented,
to e.g. make it configurable (potentially per plugin) to allow loading
newer plugins in case they are known to work with the older libobs
The id and parent_id fields should now allow better recovery of the
actual call trees, though they aren't compatible between different data
dumps in a single profiler session anymore; for that reason the new
fields name_id and parent_name_id are introduced, they hold the old id
and parent_id values respectively
The single darray solution was potentially unsafe since you're not
allowed to modify the (encode) buffer between calls to
complex_input_data_proc which is potentially violated if the darray
had to be resized due to capacity being < 2 * in_bytes_required
Due to all the threads in libobs it wouldn't be safe to make that
parameter reconfigurable after libobs is initialized without adding
even more synchronization. On the other hand, adding a function to set
the name store before calling obs_startup would solve the problem of
passing a name store into libobs, but it can lead to more complicated
semantics for obs_get_profiler_name_store (e.g., should it always return
the current name store even if libobs isn't initialized until someone
calls set_name_store(NULL)? should obs_shutdown call
set_name_store(NULL)? Passing it as obs_startup parameter avoids
these (and hopefully other) potential misunderstandings
This allows people to use the base directory of cross-compiled
dependencies (typically our dependencies.zip file), rather than always
having to specify the actual include directory.
Fixes a minor bug introduced by the windowless graphics context merge.
When setting a new base resolution, it would not recalculate the preview
size, and the preview would display the wrong size until the main window
was resized by the user. This patch makes it so that it calls the
recalculation function when the base resolution is changed to prevent
that from happening.
API Changed (obs.h):
-----------------------------------------
- Removed member variables from struct obs_video_info:
- window_width
- window_height
- window
- Removed functions:
- obs_add_draw_callback
- obs_remove_draw_callback
- obs_resize
- obs_preview_set_enabled
- obs_preview_enabled
API Changed (graphics/graphics.h)
-----------------------------------------
- Changed third parameter of gs_create from
const struct gs_init_data *data
to
uint32_t adapter
Summary
-----------------------------------------
Changing to a windowless context allows the ability to use libobs
without needing to have it depend on an open window/view, and removes
superfluous functionality that's already provided by the obs_display
functions.
Biggest benefits of windowless context:
- Make it so all window/view related code uses obs_display (which is a
major refactor/prune)
- Allows core functions to not have to be dependent upon an existing
window/view
- Allow the ability to make a fully CLI front end that doesn't depend on
a window
- Allows the ability to a hypothetical CLI from a remote
Because of the API changes, multiple modules are affected by this commit
to prevent creating broken commits: libobs, libobs-opengl, libobs-d3d11,
and the UI.
In the libobs back-end, all preview/window API functions that are not
related to obs_display have been removed, and to draw on a window/view
you must now always create an obs_display (rather than having "main"
display functions and then "secondary" display functions that use
obs_display).
For the technicalities of the graphics back-end, the gs_init function
now only takes in an adapter parameter instead of window/format/etc
information. To draw on a window/view you must now always create a swap
chain for it (note that obs_display wraps this functionality).
As for the UI, the UI has been refactored so that all dialogs/windows
that have a preview do not have to manually create OBSDisplay objects;
the OBSQTDisplay class now automatically handles all the code related to
displays. The main window preview now also relies on that same
functionality/code.
Now that we aren't dependent upon a window for our context, we can
safely move the obs context creation/destruction to obs-app.cpp, and use
the OBSContext helper class to automatically shut down obs.
(Non-compiling commit: windowless-context branch)
In the land of X11, life is suffering.
Suffering aside, X11 is capable of a hardware-accelerated windowless
context by using a GLXPbuffer in conjunction with glXMakeContextCurrent.