(Non-compiling commit: windowless-context branch)
On windows, you can just create a hidden window as the "main" opengl
window to get the equivalent of a windowless context. You might be able
to do it without a window, but honestly it's more trouble than it's
worth.
(Non-compiling commit: windowless-context branch)
On cocoa, windowless contexts appear to be no problem. You just don't
set a view or just clear the view.
(Non-compiling commit: windowless-context branch)
Now that all obs_display related code has been moved to OBSQTDisplay,
we can prune a whole bunch of boilerplate code that had to be repeated
for the displays of each window.
Affects:
- Properties
- Filters
- Interact
- Projector
(Non-compiling commit: windowless-context branch)
Gets rid of all functions/data related to setting up the main preview to
be associated with obs_reset_video and instead uses OBSQTDisplay for the
main window display (thus associating it with an obs_display object).
(Non-compiling commit: windowless-context branch)
This makes it so that OBSQTDisplay now uses/controls an obs_display
object directly (rather than having the owner have to associate an
OBSDisplay with it). It was separated before because the main window
for the basic UI would was using the "main preview" stuff before the
windowless context and had to be handled differently, so you couldn't
just associate an obs_display object with OBSQTDisplay, meaning that all
"secondary" previews such as properties/filters/etc had to handle the
obs_display alone, which caused a lot of needlessly duplicated code.
Also adds a DisplayCreated signal to allow owners to be able to add
callbacks and such on creation of the actual obs_display context.
(Non-compiling commit: windowless-context branch)
API Changed:
---------------------
Removed functions:
- obs_add_draw_callback
- obs_remove_draw_callback
- obs_resize
- obs_preview_set_enabled
- obs_preview_enabled
Removed member variables from struct obs_video_info:
- window_width
- window_height
- window
Summary:
---------------------
Changes the core libobs API to not be dependent upon a main window/view.
If you wish to draw to a window/view, use an obs_display object to
handle it.
This allows the use of libobs without requiring a window to be present
on the system. This is also prunes code that had to be needlessly
duplicated to handle the "main" window.
(Non-compiling commit: windowless-context branch)
Changes API from:
---------------------
EXPORT int gs_create(graphics_t **graphics, const char *module,
const struct gs_init_data *data);
To:
---------------------
EXPORT int gs_create(graphics_t **graphics, const char *module,
uint32_t adapter);
Summary:
---------------------
Changes the gs_create function to use an adapter parameter instead of
requiring a gs_init_data with window/color/etc information.
Intentionally breaks compilation when trying to compile the specific
merged commits within the windowless-context branch. This is meant to
be used in conjunction with a merge commit so that bisecting will never
see any non-compiling commits.
If the first guessed pts is less than the start_pts, it could
lead to a negative PTS being returned.
Change the behavior so that the first frame's pts, if zero, is
set to the start_pts. If more than one frame is less than the
start_pts, the start_pts is determined invalid and set to 0.
Valid start_pts example:
start_pts = 500
first frame (pts = 0)
pts = 500 (< start_pts)
pts -= 500 (offset by start_pts)
ret 0
second frame (pts = 700)
pts = 700 (no change, > start_pts)
pts -= 500 (offset by start_pts)
ret 200
Invalid start_pts example:
start_pts = 500
first frame (pts = 0)
pts = 500 (< start_pts)
pts -= 500 (offset by start_pts)
ret 0
second frame (pts = 300)
pts = 300 (< start_pts, start_pts set to 0)
pts -= 0 (start_pts is now 0)
ret 300
Microsoft basically deprecated GetVersion/GetVersionEx, so now you have
to query the file version of kernel32.dll in order to get the actual
windows version. Because of the steps involved in getting the windows
version are fairly complicated, this is an exported libobs helper
function that can be used to get the windows version if needed.
(Microsoft does have its own set of helper functions for this but the
API feels a bit.. awkward, and you can't actually get the real windows
version with them)
glFlush is somewhat implementation-specific; on OSX for example, it is
additionally used to draw to a view. However, we're already using the
Objective-C function flushBuffer, which apparently calls glFlush
internally anyway to draw to views. That means that we're superfluously
calling glFlush most of the time if there's an active swap chain. So
instead, only call glFlush when there are no active swap chains on OSX.
This is my fault; I made an idiotic assumption about the data and it
ended up causing the plugin to crash. This is definitely one of my more
embarrassing moments.
A minor optimization: in copy_rgbx_frame (used when libobs is set to
output RGBA frames instead of YUV frames), if the line sizes for the
source and destination match, just use a single memcpy call for all of
the data instead of multiple memcpy calls.
Found via clang-3.6, actual warning:
window-basic-main.hpp:406:14: warning: 'GetProfilePath' overrides
a member function but is not marked 'override'
[-Winconsistent-missing-override]
Added cast to unsigned and the assert because microsoft's compiler
doesn't support "%zu"
Actual warning:
libobs/graphics/effect-parser.c:1387:4: warning: format specifies type
'unsigned int' but the argument has type 'size_t' (aka 'unsigned long')
[-Wformat]
This addition allows external cmake modules to include the same modules
that are commonly distributed with the main obs-studio repo: things like
FFmpeg, curl, etc.