When there is no media, set the media to the restart state.
Currently, this only affects the VLC source, as the media
source doesn't use the OBS_MEDIA_STATE_NONE, at this time.
In 218b936b1d, the virtual camera was ignored when checking the active
state, which is kind of a lackluster solution. Instead, this makes
SetupOutputs() a virtual function, and calls it before starting the
virtual camera to be more consistent with the rest of the outputs.
Because the window capture source updates its data whenever certain
properties are modified, this would cause a race condition because
source updates normally happen in the graphics thread. To solve this
for the time being, put access to that data within a mutex when updating
or updating visibility.
When the feature was added to allow slashes in recording/replay
filenames to automatically create directories, auto-remux was not
accounted for, and all filenames were assumed to be complete. It used
fi.completeBaseName() to construct the new name which would only add the
last part after the last slash as the filename, causing the remuxed file
to save in the base directory rather than the intended directory. This
fixes that by simply using the input string as the output string,
removing the extension, appending the new extension.
Because the virtual camera stops immediately when you call
obs_output_stop() rather than with a delay like other outputs, it
exposed a bug where the tray icon would show OBS as active when stopping
the source, regardless of the fact that it was stopped. The bug was
that the expression used to activate the tray icon did not check to make
sure that the output was actually active, so add that to the expression.
The BasicOutputHandler::Active() function was used for checking whether
outputs had started or not. However, the virtual camera is not used in
the subclasses; instead it's a part of the base class. Because of that
fact, when the virtual camera is started, the procedures used to start
up the other outputs are never called, causing outputs to crash because
they hadn't been initialized properly. For example, starting the
virtual camera, then starting stream/recording would crash.
So, as a simple fix to this, when checking the active status in the
derived classes, do not factor in the virtual camera.
The edit widget on the image source toolbar had a maximum width set,
which caused the layout for the toolbar to look ugly if it hit that
maximum width.
When selecting a color on the color source, if you pressed cancel, it
would cause it to set the color to black. Instead, make sure to check
isValid() on the returned color value to see if the user pressed cancel
when selecting a color.
Casting from char[] to uint32_t * is considered undefined behavior due
to different alignment requirements. Instead of using char[] for the new
value, this uses a macro to set a uint32_t directly.
Issue detected by PVS Studio.
This adds logging for the "Hardware-accelerated GPU Scheduler" (HAGS)
introduced with Windows 10 2004 which is known to cause issues with OBS
and game performance.