0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

7171 Commits

Author SHA1 Message Date
jp9000
dc6a0bf8e9 obs-browser: Fix browser panel crash
Before, we were calling DestroyWindow on the browser panel HWND from the
CEF UI thread, which meant that the main program thread had to process
window messages in order for that message to successfully through as
DestroyWindow blocks on the WM_DESTROY/WM_NCDESTROY window messages.
Unfortunately, this also had the side-effect of processing all queued Qt
events, which, when called in the destructor of a window like this, can
result in undefined behavior; specifically crashes, which were occurring
due to this.  Especially when browser panels were in docks and docked to
the main window.

So, instead of calling DestroyWindow in another thread and then
processing events in the main thread, call DestroyWindow directly in the
main thread to get WM_DESTROY/WM_NCDESTROY and only those processed on
the spot.  This appears to fix the crashes due to the undefined
behavior when closing browser panels.
2019-08-31 21:10:26 -07:00
Stéphane Lepin
5156de4b17 UI: set names on scenes duplicated for Studio Mode 2019-08-31 22:20:43 +02:00
jp9000
23111c317f libobs: Remove redundant function param and for loop
Originally when the audio_submix function was created, it used all mixer
tracks, but at a certain point that was removed because it can only use
the first track, so some older code was unintentionally left over,
causing the same code to be executed 6 times mistakenly.  This cleans
that up by removing the unnecessary function parameter and for loop.
2019-08-31 01:15:19 -07:00
jp9000
1a72b04951 libobs: Make sure to offset unpause audio data
When an unpause occurs, it takes an audio segment and splits it at the
exact point corresponding to the pause timestamp, and then it's supposed
to only send the ending part of the split.  However, the audio pointers
were not being incremented, therefore it was sending the front of the
audio segment to instead of the back of the audio segment by mistake.
2019-08-31 01:15:19 -07:00
jp9000
03e008fd2e libobs: Fix pause cutting out video data prematurely
When pause has been activated, the video_pause_check() function is used
when receiving raw frames in order to filter out frames that are in the
pause window, that way they aren't sent to the encoder or output.

However, when pause was enabled, it was unintentionally filtering out
some frames before the specified starting timestamp as well, causing
extra video data to get cut out prematurely.  This fixes that issue.
2019-08-31 01:15:19 -07:00
jp9000
f6d1887675 libobs: Fail pause/unpause if still waiting for them
When a pause/unpause occurs, a timestamp is set and the actual
pause/unpause does not occur until the output/encoders reach the
specified timestamps.  Do not allow pausing/unpausing unless that point
has been reached with all encoders of an encoded output or the output
itself when using a raw output.

This fixes a bug where pause data could get corrupted if
pausing/unpausing too fast, because the audio/video encoders aren't
necessarily synchronized and although one encoder may have unpaused, the
other encoder(s) may not have yet.  Checking all encoders first before
allowing a pause/unpause ensures that doesn't occur.
2019-08-31 01:15:19 -07:00
jp9000
df5689d534 libobs: Give a little extra time for pause to start/stop
Audio latency can get really low, and if it's low enough, the timestamp
can be passed by the audio subsystem before it's had a chance to pause
with it.  So instead, make the pause have a little bit of extra delay to
ensure that doesn't occur.
2019-08-31 01:15:18 -07:00
jpark37
9bdb16aa78 libobs: Fix Area shaders missing for RGB output
Area downscale setting currently only works with YUV outputs. This adds
the missing DrawAlphaDivide technique.
2019-08-31 00:25:24 -07:00
jpark37
fcca1c4476 obs-qsv11: Remove leftover stack variable 2019-08-30 23:45:14 -07:00
jpark37
4a81df759d obs-ffmpeg: Fix video warnings 2019-08-30 22:13:11 -07:00
jpark37
42bf026a49 libobs: Fix video warnings 2019-08-30 22:13:03 -07:00
Gol-D-Ace
05888fc3aa CI: Update Windows CEF version 2019-08-30 16:38:59 +02:00
jp9000
09fc41cc06 libobs: Use correct pointer
This is not supposed to pass the graphics context pointer -- it's
supposed to pass the device pointer held by the graphics context object.
2019-08-30 00:36:27 -07:00
jp9000
3ef5393d42 libobs: Call debug marker after null check, not before 2019-08-29 21:46:13 -07:00
jp9000
7e77294eed libobs: Don't render scene item texture if it's null 2019-08-29 21:44:34 -07:00
jp9000
1a83f3c287 obs-browser: Do not process Qt events for browser source
This fixes crashes that could occur while processing Qt events during a
source's destruction.

Originally the processEvents code was added to make sure that any window
messages being sent to the browsers were being processed by Qt.
However, that was only necessary for browser panels as they are actually
associated with windows/views.  Browser sources are OCR, thus they do
not need this.
2019-08-29 20:46:18 -07:00
jp9000
bf41fd5a6b libobs: Add graphics API to get graphics object pointer 2019-08-29 12:43:10 -07:00
jp9000
86572935af deps/media-playback: Remove cuda for hardware decoding
Cuda appears to be a bit buggy and can result in corruption where as
it's not being seen with other hardware decoders.  Remove cuda for now
as a hardware decoder to prevent the possibility of corruption.
2019-08-29 12:06:55 -07:00
Jim
8d43af7748
Merge pull request #2050 from h-o-sein/master
rtmp-services: Update GameTips.TV
2019-08-29 11:59:47 -07:00
jp9000
43957286d7 deps/media-playback: Fix hw decode dropping last few frames
Fixes a bug where hardware frames would not transfer to RAM for the last
few frames of a video.  The 'ret' variable can be 0 even though there
are still frames ready.
2019-08-29 11:55:49 -07:00
jpark37
f8572813b1 libobs-d3d11: Print feature level as %x for readability 2019-08-28 21:11:48 -07:00
jpark37
fe02a8286e libobs-d3d11: Consistent exception catch parameters
Fixed missing references, and stray usages of const references instead
of reference to const types. Apply const correctly where applicable.
2019-08-28 21:10:51 -07:00
Jim
6943d9a973
Merge pull request #2047 from jpark37/scale-weights
Bicubic/Lanczos Shader Improvements
2019-08-28 08:47:28 -07:00
Hosein
2222d23e31 rtmp-services: Update GameTips.TV 2019-08-28 08:32:14 -07:00
Jim
f2ad6ab076
Merge pull request #2048 from VodBox/webm-hwaccel
deps/media-playback: Use hardware decoding with non-alpha WebM files
2019-08-28 08:31:02 -07:00
VodBox
c2a2bc5e40 deps/media-playback: Use hwaccel with non-alpha WebM files 2019-08-27 22:57:59 -07:00
jp9000
4f2c8ad4a1 obs-browser: Ensure FPS always matches OBS
When "custom FPS" is disabled, ensures that OBS and the browser always
use the same FPS even if the user changes it in settings.
2019-08-27 22:46:24 -07:00
jp9000
f7c285a749 obs-browser: Don't signal frame begin if feature disabled 2019-08-26 21:51:09 -07:00
jp9000
3f12b5e846 obs-browser: Actually fix browsers sometimes not rendering
Fixes same issue as 5c04876de1, but reverts that and changes it so that
external_begin_frame_enabled is not used instead, which seems to fix
that issue.
2019-08-26 19:41:56 -07:00
jp9000
83e237fec1 libobs: Fix default mixer values
There are 6 mixers, so we want 0x3F for 6 bits, not 0xF which is only 4
bits.
2019-08-26 08:24:02 -07:00
jp9000
c5178a5d1e obs-qsv11: Do not enable b-frames on sandy/ivy bridge
B-frames on sandy/ivy bridge do not work, so disable for those
platforms.
2019-08-26 08:13:24 -07:00
jp9000
5c04876de1 obs-browser: Fix browser source sometimes not rendering
On 3770, when many (5+) browser sources/panels are active at once,
browsers started freezing.  It is apparently due to this particular
issue:

https://bitbucket.org/chromiumembedded/cef/issues/2483/osr-invalidate-does-not-generate-frame

The solution is to remove the "WasHidden(true)" call.
2019-08-26 06:43:00 -07:00
jp9000
0845844e5d libobs: Insert sources to linked lists after creation
This fixes a race condition where the audio/video backends/threads may
start using sources before their obs_source_info::create function has
been called.
2019-08-25 19:19:57 -07:00
jp9000
2557ffce7e libobs: Add missing static to function
This function is not used outside of the source file, so make it static.
2019-08-25 19:19:57 -07:00
jp9000
2c3ea4af55 libobs: Fix null potential pointer dereference
When a source type has been removed (i.e. its plugin has been removed)
info can be null, which is permitted.
2019-08-25 19:19:57 -07:00
jpark37
af01e044a2 libobs: Fix Lanczos calculations
- Fix: Ensure (1, 1) coordinate gets clamped.
- Fix: Increase weight precision by premultiplying UV in VS.
- Cleanup: Group coordinates 012/345 instead of 024/135.
- Cleanup: Remove unnecessary branches.

NVIDIA RTX 2080 Ti, Intel GPA, SetStablePowerState

256x224 -> 1323x1080: 123 us -> 123 us
2019-08-25 10:00:23 -07:00
jpark37
3485c4cdac libobs: Simplify bicubic weight calculations
Also increase weight precision by premultiplying UV in VS.

Intel HD Graphics 530, Intel GPA, SetStablePowerState

256x224 -> 1323x1080: 1221 us -> 1020 us
2019-08-25 10:00:10 -07:00
Jim
68bdadf812
Merge pull request #2043 from pkviet/nvenc-dbrfix
obs-ffmpeg: Set some parameters for dynamic bitrate in new nvenc
2019-08-24 20:25:12 -07:00
pkv
adedd967d5 obs-ffmpeg: Use NV_FAILED() instead of FAILED()
The FAILED() macro is for HRESULT values; NV_FAILED() is what should be
used for NVENCSTATUS.
2019-08-24 18:24:28 -07:00
pkv
1a11e15a30 obs-ffmpeg: Force I-Frame when reconfiguring jim-nvenc
This forces an I-Frame when reconfiguring encoding parameters so that
the changes apply immediately.
2019-08-24 18:19:59 -07:00
jp9000
707f83f57d deps/media-playback: Fix memory leak
The hardware accelerated decoder context needs to be explicitly unrefed
when it's no longer in use, otherwise it and many resources associated
with it will leak.
2019-08-24 18:15:25 -07:00
jp9000
94581952b5 deps/media-playback: Fix hw accel decode crash
When hardware accelerated decoding is enabled, sometimes it can't
initialize for whatever reason, so it will fall back to software on its
own.  When this occurs, it will not use the hardware pixel format on the
frame; instead it will defer to a standard format on the frame.  So if
the frame format does not match the expected format, assume software
decoding.  (This was also what the hw-decode.c FFmpeg example did if the
format did not match the expected format)
2019-08-24 18:12:02 -07:00
Stéphane Lepin
09e10a46ff libobs: add pointer check in reset_raw_output 2019-08-23 18:59:07 +02:00
jp9000
41e9dd38fa UI: Clarify dynamic bitrate support in tooltip 2019-08-22 16:26:34 -07:00
jp9000
6863140381 obs-x264: Do not display log messages every update
Prevents log spam when dynamic bitrate is used
2019-08-22 16:21:59 -07:00
jp9000
4dd96aa6d9 UI: Move "area" scale below bilinear, above bicubic 2019-08-22 15:15:44 -07:00
jp9000
1986445511 UI: Fix bug where FTL was using AAC instead of opus
When the streaming audio track was separated from the recording tracks
in advanced output mode in be8c06334, it mistakenly removed the opus
audio encoder code when FTL is used.  This restores that code.
2019-08-22 15:08:24 -07:00
jp9000
f0140cbb74 obs-browser: Fix audio cutting out
CEF outputs multiple audio streams at once, and OBS was only able to
handle one at a time.  This fixes it by using audio lines for each CEF
audio stream, and mixes them together itself.
2019-08-21 16:07:31 -07:00
jp9000
73704f20db libobs: Add audio lines
Adds the "audio_line" internal source type as a bare source type for the
sole purpose of outputting audio, and the obs_source_info::audio_mix
callback which allows mixing of those audio lines, which is then treated
as normal audio for the source.  Audio line objects should be added as
sub-sources when multiple audio lines from a single source are needed,
then mixed together with the audio_mix callback.

The difference between the new obs_source_info::audio_mix callback and
obs_source_info::audio_render is that obs_source_info::audio_mix (along
with the audio_line source) are only one track, and it outputs audio to
the source automatically via obs_source_output_audio() when the call
completes.  This allows the mixed audio to be treated like a normal
source's audio, in that you can filter it, change its volume, or monitor
it.

This change was necessary because the CEF (used with the browser source)
outputs multiple audio streams at once to a single browser source, so
it's the program's responsibility to mix those streams together itself.
2019-08-21 15:19:19 -07:00
Jim
509d7f49e1
Merge pull request #2041 from cg2121/pause-stuff
UI: A couple of pause changes
2019-08-20 12:23:58 -07:00