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

1421 Commits

Author SHA1 Message Date
Michael Fabian Dirks
f8b14bdb46 libobs: Ensure scene items don't have pre-multiplied alpha
Scene items would incorrectly have pre-multiplied alpha when they were
scaled with different scale filtering, when they were cropped, or when
the item itself was a scene.  This happens because the scene renders the
items to a texture in those cases, and when they are rendered to a
texture the blend function would be the default srcalpha/invsrcalpha
blend function, which would cause alpha to become pre-multiplied in the
texture's result rather than straight alpha.

This changes the behavior to directly copy the color/alpha to the
texture using the one/zero blend function instead, which makes the
resulting texture straight alpha.  (Note that you do not want to turn
off the blend mode for the same result because certain sources can have
custom drawing that may rely on blending being available)

Related Issue: https://obsproject.com/mantis/view.php?id=954

Closes jp9000/obs-studio#966
2017-07-21 08:30:14 -07:00
SammyJames
4fd66d4d1e libobs: Add post-load module callback
This allows the ability for certain types of modules (particularly
scripting-related modules) to initialize extra data when all other
modules have loaded.  Because front-ends may wish to have custom
handling for loading modules, the front-end must manually call
obs_post_load_modules after it has completed loading all plug-in
modules.

Closes jp9000/obs-studio#965
2017-07-21 08:27:31 -07:00
jp9000
3a06cb25df libobs: Add ability for transitions to render sources directly
For specific types of transitions (stingers in this case), there is no
blending done of the two targets, so wasting GPU resources rendering
them to textures is unnecessary.
2017-07-19 16:23:06 -07:00
jp9000
cb42f08d1e libobs: Add function to get current transition time 2017-07-19 16:23:06 -07:00
jp9000
e801c766c9 libobs: Add transition callbacks for starting/stopping 2017-07-19 16:23:06 -07:00
jp9000
e37f6b3bd6 libobs: Do not save hotkeys for private sources 2017-07-19 16:23:06 -07:00
jp9000
24571599db libobs: Add ability for service to specify its output type
Allows the ability to change the output type in case one service
requires a different output type.

NOTE: This should be considered a temporarily yet simple solution to a
specific problem: support for RTMP-like outputs.  This will allows
seamless integration of supporting different RTMP-like output types
within the same service.  This should probably be replaced with a more
ideal solution later, such as implementing a completely different
service type instead, when time permits.
2017-07-14 12:38:46 -07:00
jp9000
d839c77824 libobs: Add API to specify codec support on encoded outputs
(This commit also modifies obs-outputs)
2017-07-14 08:15:16 -07:00
cg2121
14d330c455 libobs: Add obs_volmeter_get_cur_db function 2017-07-01 19:06:58 -07:00
Jim
35474f5b72 Merge pull request #950 from Xaymar/patch_fix-log-stats
libobs: Fix an int underflow in log_frame_info
2017-07-01 10:50:37 -07:00
Shaolin
e5756a922a libobs/plugins/UI: Suppress unused variables warnings
Closes jp9000/obs-studio#937
2017-06-27 21:55:37 -07:00
adocilesloth
4c61ae9513 libobs: Add <> or \| on RT 102-key as hotkey
Closes jp9000/obs-studio#948
2017-06-27 21:35:52 -07:00
jp9000
8770453c09 libobs/util: Make minor optimization to circlebuf pops
If size is 0 after popping data from the front or back, set the
start/end points to 0 as well to ensure that any subsequent buffer
pushes start from the beginning of the buffer rather than the middle of
the buffer.  Reduces potential unnecessary operations in that case.

Additionally, this fixes a bug with circulebuf_pop_back where if start
position was 0, and all the data was popped off the buffer (equal to the
capacity), the end position would be equal to the original size.  As an
example to replicate the bug, push 5, pop 5, then push 10.  The
start/end points will be invalid.

Closes jp9000/obs-studio#954
2017-06-27 21:25:00 -07:00
mntone
a6938c11b0 UI, libobs: Add Japanese shortcut keys for Windows
Add Japanese shortcut keys, non-convert (無変換) and convert (変換) and
disable IME for OBSHotkeyEdit.

Closes jp9000/obs-studio#930
2017-06-27 18:14:48 -07:00
cg2121
fce078d997 UI, libobs: Add ability to lock individual scene items
Adds a lock checkbox to allow the user to lock a specific scene item.

Closes jp9000/obs-studio#949
2017-06-27 10:27:57 -07:00
jp9000
9ab0f26214 libobs: Fix bug where obs_data default might not be set
If a source is created with settings, default values would not be set on
data items that already had values set.  The check here was supposed to
be a not equal rather than an equal because you're not supposed to be
able to set a default value of one type on an item that already exists
but is of a different type.

This bug would make it so that if a particular setting was removed,
there would be no default value to fall back on, and it would always be
0 or NULL for all values.

It's likely this bug wasn't encountered until now because before now
there had been no reason to clear or remove settings on most things.
2017-06-26 17:10:20 -07:00
jp9000
1b62287109 libobs: Update version to 19.0.3 2017-06-21 00:13:33 -07:00
Michael Fabian Dirks
4e3e67bb8c libobs: Fix an int underflow in log_frame_info
I believe the issue with the next to impossible frame count to be an integer underflow, as in order to achieve those you'd have to have recorded for at least 345 days with 144 fps. So this commit fixes them by using a normal integer first and then deciding on the result if it should be used or be replaced with a 0.
2017-06-19 04:12:06 +02:00
Shaolin
cb9f767e45 libobs/plugins/UI: Suppress -Wimplicit-fallthrough introduced by GCC 7
Signed-off-by: Shaolin <admshao@gmail.com>
2017-05-29 21:05:18 -03:00
jp9000
83e7191f33 libobs: Update to version 19.0.2 2017-05-21 02:34:27 -07:00
jp9000
69dbb2c0bf libobs: Update version to 19.0.1 2017-05-20 14:27:17 -07:00
jp9000
a2953d1161 libobs: Fix bug where outputs would not set stopped event
When an output fails to connect and it's already been prematurely
stopped, the event to mark the output as stopped would not be signaled,
causing obs_output_destroy to lock up indefinitely while waiting for the
event to be signaled.
2017-05-20 13:11:59 -07:00
jp9000
87f14a1254 libobs: Always call stop callback
Rather than have the back-end try to determine whether the output can or
cannot stop, allow the stop callback to continue in the plugin either
way and let the plugin itself make that determination.

This fixes a bug where the back-end wouldn't have data active while
connecting, therefore the stop callback wouldn't be called, and once
connected it wouldn't know that it was supposed to stop.  In other words
trying to call obs_output_stop on an output that was in a state of
connecting would do nothing and the output would never stop.
2017-05-20 12:31:57 -07:00
jp9000
b8355c656c libobs/util: Also remove CR/LF from dstr_depad
Prevents newline characters from being included in things like stream
keys
2017-05-20 11:15:00 -07:00
jp9000
eb7fb990b7 libobs: Do not allow incompatible filters on sources
Fixes a potential issue where copying filters from one source to another
might add filters from the old source that are not compatible with the
new source.
2017-05-19 00:25:27 -07:00
jp9000
2348a1ce83 libobs: Make obs_source_default_render exported
Allows directly rendering a non-async source without going through
filters.
2017-05-16 17:29:04 -07:00
jp9000
3aef119240 libobs: Update to version 19.0.0 2017-05-16 13:49:54 -07:00
Richard Stanway
50f8a066b9
libobs: Add support for output error messages 2017-05-15 12:04:11 +02:00
jp9000
2c74fc36e2 libobs: Add scene item IDs
Adds a method of uniquely identifying scene items, as well as finding
those scene items via that unique ID.
2017-05-15 00:18:18 -07:00
jp9000
d13fa96851 libobs: Don't use source flags for async buffering
(This commit also modifies the decklink, linux-v4l2, mac-avcapture,
obs-ffmpeg, and win-dshow modules)

Originally, async buffering for sources was supposed to be a
user-controllable flag.  However, that turned out to be less than ideal
because sources (such as the win-dshow plugin) were programmed with
automatic control over their buffering (such as automatically detecting
USB 2.0 capture devices and then enabling in those cases).

The fact that it was a flag caused a design flaw to where buffering
values would be overwritten when a source is loaded from save data.

Because of that, this flag is being deprecated and replaced with a
specific function to enable unbuffered mode instead.
2017-05-13 23:32:40 -07:00
jp9000
d64542e10b Revert "libobs: Allow source to fully control source flags (for now)"
This reverts commit d85224bb9b.

Would cause other flags to stop saving.  Buffering needs to be split off
from the source flags.
2017-05-13 23:30:36 -07:00
jp9000
5c773d6807 libobs: Add obs_output_reconnecting func
Returns whether the output is currently in a state of reconnecting or
not.
2017-05-13 01:21:18 -07:00
jp9000
0a7361f4cc libobs: Add functions to get total/lagged frames
Useful for rendering statistics.
2017-05-13 01:21:17 -07:00
jp9000
cb9a478821 libobs: Add function to get average render time
Useful for real-time rendering statistics
2017-05-13 01:21:16 -07:00
jp9000
9e466a4697 libobs/util: Add function to get free disk space 2017-05-13 01:21:14 -07:00
Richard Stanway
9e95b2eb6f
Various: Don't use boolean bitfields
Using bitfields causes less optimized code generation and the memory
savings are minimal as none of the objects are instantiated enough
times to be worth it.

See https://blogs.msdn.microsoft.com/oldnewthing/20081126-00/?p=20073
2017-05-10 23:28:46 +02:00
fryshorts
0527cb5c15 libobs: Fix os_safe_replace not working linux
Make sure the target file exists before attempting to create a backup.
This will allow for the function to work correctly if the target does
not yet exist.
2017-05-08 19:24:02 +02:00
jp9000
a81646ed9c libobs: Don't allow lagged frames to be counted as skipped
Prevents lagged frames (frames that took too long to render) to be
counted as skipped frames (frames that are skipped due to encoding
taking too long to process)
2017-05-06 11:29:32 -07:00
jp9000
668763550c libobs: Add function to allow getting output connect time 2017-05-06 11:29:31 -07:00
jp9000
ad57aa1520 libobs: Add function to allow custom output drawing
Optionally allows drawing directly to the primary output instead of
having to use a source to draw.
2017-05-06 11:29:29 -07:00
jp9000
ffef736640 libobs: Pass exact data when calling obs_get_video_info
Originally, obs_get_video_info would recreate the obs_video_info
structure that was originally passed to it from obs_reset_video.  This
changes that to just store a copy of the obs_video_info when calling
obs_reset_video, and then copying that to the parameter of
obs_get_video_info when called.
2017-05-06 11:29:28 -07:00
jp9000
6fc74d69a9 libobs: Add functions to get logical/physical cores 2017-05-06 11:29:27 -07:00
jp9000
829ec5be2d libobs: Fix skipped frames reporting
When frames are skipped the skipped frame count would increment, but the
total frame count would not increment, causing the percentage
calculation to fail.

Additionally, the skipped frames log reporting has been moved to
media-io/video-io.c instead of each output.
2017-05-06 11:29:25 -07:00
jp9000
7c6c7bc4c0 libobs: Add random shader
Strangely, to the "Solid" effect file.
2017-05-06 11:29:24 -07:00
jp9000
f9b5da513a libobs: Fix tex.Load lookup (needs int3, not int2)
libobs' shader language is basically HLSL, and tex.Load uses an int3 for
2D textures, with texture mipmap index for the last component.  This bug
bypassed testing because the front-end automatically switches to OpenGL
if D3D11 initialization fails, and when converted to GLSL, works fine
because texelFetch only requires two components.  This also means
there's a bug in GLSL shader conversion code, because it's essentially
ignoring the third component when it shouldn't be.
2017-05-06 10:39:42 -07:00
jp9000
e7f754df97 libobs: Use tex.Load for reverse NV12/I420 funcs
Eventually, most things should be replaced with Load where applicable
(though in some cases sub-pixel sampling is desired).

This commit also fixes a bug where NV12 async sources wouldn't render
correctly.
2017-05-06 01:24:45 -07:00
jp9000
2537f9a5e2 libobs/util: Use MoveFileEx with MOVEFILE_REPLACE_EXISTING
Ensures that it will replace an old file if it exists.
2017-05-04 18:44:15 -07:00
jp9000
ac2f792d50 libobs/util: Flush text files when writing
Helps prevent the possibility of an empty file from being written.
2017-05-04 18:24:00 -07:00
jp9000
6d3777129d libobs/util: Use os_safe_replace in safe file writes 2017-05-04 18:23:23 -07:00
jp9000
651d80c0df libobs/util: Add os_safe_replace function
Allows safely/atomically replacing a file and creating a backup of the
original.  The reason for adding this function is because Microsoft
provides a ReplaceFile function which does this in a single call.
2017-05-04 18:21:51 -07:00