Prevents the common problem of injecting in to certain processes and
getting the hook DLL "stuck":
- windows explorer
- steam
- battle.net
- gog galaxy
- skype
- uplay
- origin
- microsoft visual studio
- task manager
- league of legends lobby window
- windows 10 system settings window
Changed the first property of game capture to be a "mode" list (with
"any fullscreen window", "specific window", and "hotkey").
When hotkey mode is set, it'll add a hotkey pair to hotkey settings to
activate/deactivate game capture. When the hotkey to activate is
pressed, it'll treat the current foreground window as the target window
similar to "selected window" mode; it'll keep trying to capture the same
window even if the window or its application closes/reopens, and will
continue to do so until deactivated via the deactivate hotkey, or until
a new window is set via the activate hotkey.
Doing something like '#if TRUE' when 'TRUE' isn't defined is the
equivalent to '#if 0' because the preprocessor evaluates an undefined
macro as 0/false.
These comments have been added to clean up the code and make it more
clear of what the code is doing. The code felt a bit messy, and this
should help prevent the original author of the noise suppression filter
from being lost in case he decides to modify/improve the filter.
When buffering audio data, we don't want to buffer audio data that may
be old. If the audio timing jumps significant and old audio data is
buffered, clear that old data.
The noise suppression filter mistakenly operated on the assumption that
input audio data would always be in 10ms segments, and would crash if
audio data was larger than that size.
Because speexdsp operates on fixed audio frame sizes only, we must
buffer audio data to fit that frame processing size. This creates a
troublesome situation where you must buffer around that specified frame
size.
The new steps for processing are:
1. Push audio data to input circular buffer.
2. Push number of audio frames and timestamp for that audio packet to an
'info' circular buffer.
3. Check size of input circular buffer, and while it's equal to or above
the speexdsp frame size (10ms for minimum latency), pop from the
input buffer to a temporary buffer (10ms frames) and process it, then
push that temporary buffer to the output circular buffer.
4. Peek at the front of the 'info' circular buffer.
5. If the output circular buffer frame size is equal or larger than next
expected number of frames, pop both the info and output buffer, and
return the audio data with the expected audio frames/timestamp.
libVLC doesn't seem to provide full speaker configuration info, so when
downmixing audio from a file that had more than 2 channels, the audio
would sound wrong.
This change makes it so that libVLC does the downmixing to stereo rather
than libobs, just due to that lack of speaker configuration info.
It seems that it is not possible to create multiple OpenGL textures
for the same window. When sources are duplicated in studio mode this
causes window capture sources to become black. The
OBS_SOURCE_DO_NOT_DUPLICATE flag prevents that this happens.
Update Restream.io ingests list and set recommended keyframe interval to
2.
(Commit edited and formatted by Jim: Fixed commit message)
Closesjp9000/obs-studio#565
Whether buffer size is visible is determined by the value of the "Use
buffer size" property (the "use_bufsize" setting).
(Commit edited and formatted by Jim: separated this code from the
previous commit, and gave it a proper commit message)
Closesjp9000/obs-studio#567
This is why macros should be used for settings strings.
(Commit edited and formatted by Jim: separated this code from the
following commit, and gave it a proper commit message)
Closesjp9000/obs-studio#567
This reverts commit 4c505e7030.
Reverting this for the time being due to issues with quakelive. This
will be more thoroughly tested and hopefully added again.
When the crop filter was changed to a crop/pad filter, the sampler state
was changed to use a transparent border for the U/V addressing mode.
However, what was not realized at the time was that the scroll filter
also shared the crop effect file, and the scroll filter depended on the
old sampler state (wrap u/v).
This fixes the issue by simply setting a u/v wrap sampler state in the
scroll filter.
Tested using FTL (steam): SwapBuffers ultimately calls wgl_swap_buffers
causing an additional copy which just isn't necessary
This also causes game capture to sometimes capture overlays even when
not intended
This reverts commit bd70e73c25.
Turns out the commit was due to a miscommunication -- the commit it was
fixing actually worked fine, and this fix was unnecessary.
If window capture fails to find a window with a matching title, search
for a window with the same window class additionally as a backup.
Replaces the third part of the internal window string with the class
name instead of the program path due to the fact that the program path
rarely seemed to work.
Allows the ability to pad in addition to cropping. Changes the name to
Crop/Pad filter.
(Additional edits by Jim: Greatly refactored/simplified filter code)
Closesjp9000/obs-studio#532
Removing this union fixes the internal compile error that would occur on
visual studio 2015 update 2 and above when these variables were all in a
union.
(Note: This commit also modifies obs-ffmpeg and obs-outputs)
API Changed:
obs_output_info::void (*stop)(void *data);
To:
obs_output_info::void (*stop)(void *data, uint64_t ts);
This fixes the long-time design flaw where obs_output_stop and the
output 'stop' callback would just shut down the output without
considering the timing of when obs_output_stop was used, discarding any
possible buffering and causing the output to get cut off at an
unexpected timing.
The 'stop' callback of obs_output_info now takes a timestamp with the
expectation that the output will use that timestamp to stop output data
in accordance to that timing. obs_output_stop now records the timestamp
at the time that the function is called and calls the 'stop' callback
with that timestamp. If needed, obs_output_force_stop will still stop
the output immediately without buffering.
Because output stop timing has been fixed, there is no need to send the
remaining packets in the queue because it now just waits for the stop
timing anyway.
Fixes a bug where if a D3D9 program recreates its device the capture
would become invalid. Certain games (especially blizzard games) will
completely recreate their Direct3D device if a critical D3D9 error
occurs.
Adds the ability to add video playlists via libvlc instead of via the
media source. This is mostly just being added as a secondary option to
the media source to reduce maintenance costs and save time. Currently
libff cannot pause/unpause/seek, and isn't programmed to handle
playlists yet.
If VLC is installed on the computer (with the same architecture) it will
allow video playback via libVLC. In the future, users should be able to
optionally download VLC libraries via the installer as well if they
don't want to necessarily install VLC to get the plugin working.
This plugin performs runtime linking instead of compile-time linking;
compiling VLC is not required, only its headers are required. To
compile, clone the VLC repository and set the VLCPath cmake variable to
point to the VLC repository directory.
The xcomposite window capture crashes were due to a few factors:
-------------------------------
1.) The source's X error handler was possibly being overwritten by
another part of the program despite us locking the display, presumably
something in Qt which isn't locking the display when pushing/popping its
own error handler (though this is not yet certain). The source's calls
to X functions happen in the graphics thread, which is separate from the
UI thread, and it was noticed that somehow the error handler would be
overwritten almost seemingly at random, indicating that something else
in the program outside of OBS code was not locking the display while
pushing/popping the error handler.
To replicate this, make it so that the source cannot find the target
window and so it continually searches for it each video_tick call, then
resize the main OBS window continually (which causes Qt to push/pop its
own error handlers). A crash will almost always occur due to BadWindow
despite our error handling.
2.) Calling X functions with a window ID that no longer exists,
particularly XGetWindowAttributes, in conjunction the unknown error
handler set in case #1 would cause the program to outright crash because
that error handler is programmed to crash on BadWindow for whatever
reason. The source would call X functions without even checking if
'win' was 0.
3.) The source stored window IDs (in JSON, even if they've long since
become invalid/pointless, such as system restarts). This is a bad
practice and will result in more cases of BadWindow.
Fixing the problem (reducing the possibility of getting BadWindow):
-------------------------------
Step 1.) Deprecate and ignore window IDs in stored settings. Instead of
using window IDs to find the window, we now must always search the
windows and find the target window via the window name exclusively.
This helps ensure that we actually consistently have a working window
ID.
Step 2.) Do not call any X functions if the window ID is 0.
Step 3.) Reset the window ID to 0 any time the window has updated, and
make the source find the window again to ensure it still exists before
attempting to use any X functions on the window ID again.