All named objects (including file mapped shared memory) need to be
created within the hook itself due to the fact that UWP programs cannot
access named objects outside of the UWP process.
Because shared memory needs to be created within the hook, the capture
loop cannot start until the shared memory has been filled with valid
data. Creating an additional "initialize" event fixes this issue.
Additionally, changed the way that named kernel objects are
opened/created. Before, there were functions that would first try to
open named objects and then implicitly create them if opening failed
(assuming that if the hook didn't create it first, game capture would),
now it's been changed so that you can only either explicitly open or
create.
To check to make sure game capture is still active in the capture
program, it currently uses a named event, and then it checks to see if
that named event exists. However with UWP programs, you can't open a
named event outside of the UWP process. FindWindow on the other hand
does work, so instead of checking to see if a named kernel object
exists, create a window and check to see if that window exists.
The "main" windows detected for UWP programs are basically to help
sandbox the programs -- they run in the ApplicationFrameHost process and
help reduce the possibility of other programs trying to access the
actual process window, which is a child window.
To bypass this, go through the list of child windows for the
ApplicationFrameHost window, and then find the one that's attached to
a different process; that different process will always be the target,
and will allows us to open the actual process of the UWP program.
Instead of calling OpenThread, use DuplicateHandle with the minimal
access rights (SYNCHRONIZE) to be able to get the current thread handle
within a UWP program.
Adds the ability to use a specific prefix and/or suffix on replay buffer
filenames to distinguish them from normal recordings. Defaults to
having the prefix "Replay".
Replay buffer and recording should be separate in case the user wants to
start recording from a specific point rather being forced to reconfigure
for regular recording.
Creates a new button on the main window below the recording button for
turning on/off the replay buffer.
On MSVC, deprecated types/functions were being completely ignored by the
compiler due to this pragma. Any plugins/programs that depended on this
would also have this warning disabled due to it being in this file.
This pragma was most likely originally done due to the MSVC warnings for
C-standard functions, which are now ignored via _CRT_SECURE_NO_WARNINGS
on all projects instead.
This prevents issues with using standard C functions, where microsoft
would otherwise spit out pointless warnings to encourage using
microsoft-specific functions instead.
When an output's context data is being created, it cannot register any
hotkeys because the output has not initialized its reference counting
capability. This is due to the fact that when a hotkey is registered,
it creates a weak reference to the source/output/service/encoder.
The solution to this is to make sure the output's reference counter data
is created before calling the create callback.
(Note: This commit also modifies the UI)
Being able to generate file names based upon a specification is useful
for more than just the UI; it can also be useful for things such as the
replay buffer where file names need to be generated on the fly.
This reverts commit 0edaebe192.
The commit was actually less optimal than it was before. Shaders are
always fully unfolded and both sides of a branch are always executed.
Despite that fact, the "avoid branching" commit actually *added* two
extra unnecessary instructions with the same number of actual sample
instructions, making it arguably less optimal than before.
This was tested via the D3DDissamble function.
The xcb message queue is not currently emptied. If errors are generated
by any void requests the message queue will simply fill up and messages
will never be deleted.
Due to a (currently unknown) other problem this happens for me, and
results in OBS using up all memory with a queue that will never be
emptied.
Here we add a poll loop that will empty the xcb message queue and
discard the messages. While this means that errors are still not
handled, OBS wont end up crashing either.
Closesjp9000/obs-studio#675
(Note: This commit also modifies the ipc-util/seg-service modules)
When compiling the final project, always compile
ipc-util/get-graphics-offsets/graphics-hook/inject-helper/seg-service
with static MSVC runtimes to prevent the need of requiring the MSVC
runtimes for both architectures.