1799 Commits

Author SHA1 Message Date
jp9000
ec9e48f3c7 libobs: Remove unnecessary count check 2019-03-06 07:43:22 -08:00
jp9000
fbe382a15c libobs: Fix code styling 2019-03-06 07:27:16 -08:00
jp9000
cd3d64215e libobs: Fix first frame when output restarted
When all outputs stop, and then the output starts back up again at a
later point after that, the last frame data or two from the previous
output session would end up as the first frame or two of the proceeding
output.  This was because certain rendering variables were not being
properly cleared when a new output starts back up.
2019-03-05 19:20:18 -08:00
jp9000
7f01fee8c2 libobs: Always query shared texture handle for encoding
Always query the texture's shared handle in case the texture had to be
rebuilt from a driver crash.
2019-03-04 04:54:25 -08:00
Colin Edwards
84b87df161
Merge pull request #1686 from pkviet/mono_upmix
libobs/media-io: Fix mono upmix
2019-03-03 22:38:59 -06:00
Michael Fabian 'Xaymar' Dirks
c633413f06 libobs: Tell filters that we want to load
Previously only sources would receive a load signal, but sources and
filters would receive a save signal. This meant that filters that had
a save signal to store something on disk would never receive a load
signal to load it from disk.

With this both sources and filters will now receive save and load
signals, allowing both to work the same way.
2019-03-01 20:36:31 +01:00
jp9000
15b8ebb5e6 libobs: Update version to 23.0.1 2019-02-26 12:16:06 -08:00
jp9000
17e85f04fd libobs: Add func to get encoder caps by encoder pointer 2019-02-26 08:02:57 -08:00
pkv
918fc6d6c2 libobs/media-io: Fix mono upmix
A mono source is currently upmixed by swresampler in the following way:
- for stereo output, FL=FR=input/sqrt(2)
- for other speaker layouts of the outputs, FC=input, other channels
are zeroed.

In the case of stereo output, this leads to a 3dB level decrease which
users have issue with [1].
The obvious fix of adding a 3dB gain is reported to be adding distortions
on some setups [2].
Note that the "Downmix to Mono" does not fix this upmix problem, since
it just makes all output channels identical by summing all input channels
and normalizing (by dividing by the number of output channels). This last
normalization step results in a level reduction for a mono input.

[1] This fixes https://obsproject.com/mantis/view.php?id=960.
[2] See also: https://obsproject.com/forum/threads/please-allow-for-mono-recording-of-microphones-ill-explain-why.84834
2019-02-24 14:00:57 +01:00
jp9000
88247dae36 libobs: Update version to 23.0.0 2019-02-20 22:16:45 -08:00
derrod
b8b2b7e2e3 libobs: Add minimum display duration to caption data
Adds display_duration declaring the minimum duration a caption text
is not going to be overwritten by a new one. To keep the functions
backwards-compatible obs_output_output_caption_text2 was added while
obs_output_output_caption_text1 continues having a 2 second default.
2019-02-20 06:05:08 +01:00
Richard Stanway
3ddfc55e46 libobs: Fix missing mutex unlock from 26dbe54 2019-02-18 23:42:01 +01:00
Richard Stanway
26dbe54896 libobs: Check fwrite return value for extra safety 2019-02-18 17:49:33 +01:00
jp9000
b63e7fbcb5 libobs: Fix indent 2019-02-12 19:33:13 -08:00
jp9000
573197af5b libobs: Fix race conditions
Uses obs_source_get_ref on the sources enumerated in the tick_sources
function in obs-video.c to ensure a reference has been incremented
before calling that source's video_tick, and replaces an
obs_source_addref with obs_source_get_ref in the push_audio_tree
function in obs-audio.c to ensure that it cannot increment a source that
has already decremented its reference to 0.
2019-02-12 19:23:24 -08:00
jp9000
131fb7b460 libobs: Fix potential race condition on shutdown
If the remove_connection call of obs_encoder_stop_internal took too
long, obs_encoder_destroy could get called before that function
completed, causing a race condition.
2019-02-12 16:07:14 -08:00
jp9000
d416f781fd libobs: Fix crash starting raw encoder before gpu encoder
Fixes a crash when starting a raw encoder before a GPU encoder.
2019-02-10 22:22:31 -08:00
jp9000
b029453d30 libobs: Fix texture-based encoder decklock
Ensures that there are no textures being encoded before attempting to
shut down a texture-based encoder.
2019-02-10 21:53:24 -08:00
jp9000
2a92555f58 libobs: Make sure to destroy effect
This actually isn't necessary because the graphics subsystem technically
automatically frees effects, but that could change, so call this just to
be safe.
2019-02-10 18:12:37 -08:00
VodBox
f095cb2d0e UI: Add scene item canvas overflow to preview 2019-02-08 20:38:53 +13:00
jp9000
93ba6e7128 libobs: Add texture-based encoding support
Allows the ability to encode by passing NV12 textures.  This uses a
separate thread for texture-based encoders with a small queue of
textures.  An output texture with a keyed mutex shared texture is locked
between OBS and each encoder.  A new encoder callback and capability
flag is used to encode with textures.
2019-02-07 17:00:46 -08:00
jp9000
cd1607ca6e libobs: Split do_encode in to two funcs
This splits the "do_encode" function in to "do_encode" and
"send_off_encoder_packet", the latter of which allows the ability for
texture-based encoders to manage their own encoding and just simply send
off a packet to the outputs.
2019-02-07 17:00:46 -08:00
jp9000
36ffa65b68 libobs/media-io: Add frame funcs for separate GPU thread
Normally, the total and skipped frame count for the encoder is performed
in the video-io thread.  However, because a new thread is being
introduced for texture-based encoding, the frontend has no way of being
able to query that.  So, instead of making the frontend query that data
separately, just make the texture encoder thread increment the values of
video-io.  That way, the frontend doesn't need to change any code, and
can continue using the same functions for determining the total/skipped
frame count.

This can cause the frame count to be doubled if both a texture-based
encoder and a raw data encoder is active at the same time, but it's an
acceptable alternative.
2019-02-07 17:00:46 -08:00
jp9000
8134b8afda libobs/util: Fix bug with get_winver
get_winver is supposed to return a 16bit value in a format equivalent to
0xMMmm (Major minor).  It was returning 0xMM00mm incorrectly instead.
2019-02-07 17:00:46 -08:00
jp9000
e6c719a1dd libobs/util: Fix bug with circlebuf_data
If the index specified is equal to the size of the data, return NULL.
2019-02-07 17:00:46 -08:00
jp9000
9b8bc22ffa libobs: Add ability to reroute encoders
Allows the ability for one encoder to defer to another in case of
failure or unsupported feature.  Okay, fine, it's mostly a hack so the
new NVENC encoder can fall back to the FFmpeg encoder if NV12 textures
aren't in use, that way it does not have to implement raw fallback
support itself.  The settings and properties are pretty much the same,
so there's no reason not to utilize it in order to save time that could
otherwise be spent more productively.
2019-02-07 17:00:46 -08:00
jp9000
2e1a19456a libobs/util: Add get_win_ver_int() func (windows)
Returns the current version number of windows.  The lowest byte is the
minor version number, then the next lowest byte is the major version
number.  E.g. 0x601 for Windows 7, 0x602 for Windows 8, 0x603 for
Windows 8.1, and 0xA00 for Windows 10.
2019-02-07 17:00:46 -08:00
jp9000
28d0cc8b97 libobs: Use NV12 textures when available 2019-02-07 17:00:46 -08:00
jp9000
82848d513e libobs: Add obs_video_active() function
(This commit also modifies UI)

Adds a universal function for determining whether video output is
currently active, rather than having to use video_output_active() on the
value returned by obs_get_video().
2019-02-07 17:00:46 -08:00
jp9000
93fc61fa82 libobs/graphics: Add NV12 texture support 2019-02-07 17:00:46 -08:00
jp9000
b64d7d71d0 libobs/graphics: Add texture sharing functions 2019-02-07 17:00:46 -08:00
Dmitry-Me
8df42cda8a libobs: Fix scanf type specifiers 2019-02-04 16:02:49 +03:00
Matthew Orlando
09d77878fd libobs: Initialize service before starting output
This fixes the case where initialize is not called on a service if the
output is not encoded.
2019-02-02 15:16:27 -08:00
jp9000
8f106dc3c1 libobs, UI: Do not log redundant warnings
Reduces log file clutter by not logging certain warning messages that
were already safe/normal/expected failures.
2019-01-12 16:50:55 -08:00
Jim
6a0b9517db
Merge pull request #1596 from computerquip/const-correct-cmdline2
libobs: Allow const argument in obs_set_cmdline_args
2019-01-05 06:51:25 -08:00
Jim
194f344727
Merge pull request #1590 from OsirisNL/game_mode_fix
libobs: Fix Windows Game Mode detection on newer Windows 10 versions
2019-01-05 06:49:23 -08:00
Jim
3d401b7068
Merge pull request #1582 from justinlynn/port-to-ppc64
Build on PPC64LE using x86 Intrinsic Compat Shims
2019-01-04 16:19:01 -08:00
Colin Edwards
2e4bcf5dc0
Merge pull request #1576 from DDRBoxman/rebasedkeyer
Decklink: Keyer Support
2019-01-04 17:34:50 -06:00
Colin Edwards
19bc92d267 Decklink: Keyer support 2019-01-04 17:34:00 -06:00
Jim
1e6bfa2eb1
Merge pull request #1572 from craftwar/utf8-fix
libobs: Fix utf-8 bom is not properly skipped
2019-01-04 14:55:57 -08:00
Michael Fabian 'Xaymar' Dirks
93549ea17c libobs: Add get_defaults2 and get_properties2 for encoders
Adds optional alternate functions to allow passing the encoder type_data
to reduce code duplication.

Closes obsproject/obs-studio#1541
2019-01-04 12:23:46 -08:00
Jim
62935bfef9
Merge pull request #1521 from Andersama/patch-31
libobs: Fix crash when pixel or vertex shader are missing
2019-01-04 06:37:53 -08:00
Zachary Lund
fe3f7539a3 libobs: Allow const argument in obs_set_cmdline_args
obs_set_cmdline_args copies the arguments passed to it. This means that
the array passed will never require it to be modified.
2018-12-30 00:02:00 -06:00
Exeldro
a0a0ca73c1 libobs: Fix circlebuf_pop_back returning front 2018-12-27 09:28:49 +01:00
Michel Snippe
7fd8743633 libobs: Fix Windows Game Mode detection on newer Windows 10 versions 2018-12-26 23:13:37 +01:00
J Lynn
36a6629e6b Add support for building on PPC64LE using x86 Intrinsic Compat Shim 2018-12-17 05:33:16 +11:00
craftwar
0a6dc398b7 libobs: Fix utf-8 bom is not properly skipped 2018-12-10 07:57:32 +08:00
Jim
875e13baf9
Merge pull request #1545 from pkviet/syncfix
libobs: Fix audio offset not reset for all tracks
2018-12-05 18:04:29 -08:00
Alex Anderson
fc97512f71 libobs: Fix crash when pixel or vertex shader are missing
Checks that the token is not null while looping. Logs errors when pixel
or vertex shader are missing.
2018-12-03 15:02:20 -08:00
pkviet
1002f9b695 libobs: Log audio source when buffering is added
Closes obsproject/obs-studio#1521
2018-12-03 09:23:38 -08:00