os_readdir might return an empty path if the OS filename doesn't fit
into the buffer after os_wcs_to_utf8. If this empty path is then passed
to os_get_path_extension it causes a crash.
When an audio source is removed, it signals its "destroy" callbacks.
One of the callbacks is OBSSourceLabel::SourceDestroyed. When its Qt
destroy signal is fired, it causes a call to LoadAudioSources to refresh
the source list. LoadAudioSources deletes the old layout, and so the
QWidget that the OBSSource is based on is freed while it's still in the
middle of running the signal callback, resulting in access to freed
memory.
Previously, any short write would be treated elsewhere as a failure. The
easiest solution is to have pipe_write() automatically retry until either
it's written everything, or it couldn't write anything at all.
Adds an "Automatic" method to the capture method property of window
capture. This allows the ability for window capture to automatically
determine the best capture method to use. Primarily, it prefers BitBlt
in most cases, but will use WGC when it detects the window is a browser,
microsoft office, or a UWP program.
This was implemented because the new capture method has a number of
undesired effects associated with it -- the issue of the capture border
that we can do nothing about, the fact that we can't control the capture
of the cursor, and the fact that Microsoft designed it to switch the
cursor away from hardware cursor mode when the capture is active (there
was absolutely no reason to do this because even OBS can capture the
hardware cursor with no issue). Until we get a new version of this API
that doesn't absolutely blow, we're stuck preferring BitBlt instead.
But hey, at least people will be able to capture browser windows now.
Users will now have the option of legacy window capture via BitBlt, or
Windows Graphics Capture, which is new to Windows 10.
There are two annoyances with the new capture method though. One is that
there is a bright, yellow border added to the original window (but not
the OBS view of it). The other is that the mouse cursor is always
captured, and we won't be able to capture without cursor until a later
version of Windows 10 is released.
It should also be noted that DPI scaling is now applied, which may
result in blurrier images caused by Windows rescaling.