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

480 Commits

Author SHA1 Message Date
Clayton Groeneveld
2b50263d5c UI, libobs: Add ability to copy/paste single filter 2020-10-15 10:14:22 -07:00
Richard Stanway
c8f7a4563d libobs: Check data validity for media sources 2020-08-29 02:42:03 +02:00
Jim
e36b9c309d
Merge pull request #3216 from Xaymar/pr-fix-obs_source_enum_full_tree
libobs: Call enum_all_sources in check for enum_all_sources
2020-08-22 15:09:42 -07:00
Valentin
4508cb03b5 libobs: Fix deferred update sometimes using stale data
Currently we use a bool flag to signal the video thread that it should
call obs_source_deferred_update. This does not work correctly when the
update callback is slow and the update is triggered faster than the
callback can complete.

For example:
* the settings are set to state A
* defer_update is set
* obs_source_deferred_update is called and enters into the callback
* the callback starts making use of the settings in state A
* the settings are set to state B
* defer_update stays set
* the callback finishes
* defer_update is set to false

Now defer_update is false but the callback has only observed settings in
state A but not B.

This commit fixes this bug by keeping an update counter. If the counter
has changed while we were in the callback we know that we need to update
again.

The counter is atomic. The current version uses a plain bool which is a
data race as the value is written and read in parallel.
2020-08-04 09:28:55 +02:00
jp9000
d117908440 libobs: Add func to set async video frame immediately
Allows the ability to directly override the current async frame
immediately.
2020-07-29 13:59:49 -07:00
Michael Fabian 'Xaymar' Dirks
127dce6bf6 libobs: Call enum_all_sources in check for enum_all_sources
Fixes a crash caused by checking for enum_all_sources and then calling
enum_active_sources instead of enum_all_sources. enum_active_sources is
not required for sources that specify enum_all_sources.
2020-07-27 01:53:58 +02:00
Richard Stanway
4f7767111a libobs: Update async texture when showing preloaded video
The previous preloaded video behavior updated the texture on preload
rather than when the video was shown, during which time the texture may
have been modified by other processes, resulting in the wrong frame
being displayed.
2020-07-23 23:54:10 +02:00
Jim
8b00f7d341
Merge pull request #3085 from eric/fix-audio-on-timestamp-jump
libobs: Reset audio data on timestamp jump
2020-07-10 17:35:44 -07:00
Jim
76c42215d6
Merge pull request #2755 from exeldro/keep_filters
libobs: Don't check filter compatibility on not loaded sources
2020-06-24 14:13:48 -07:00
Eric Lindvall
f79f816b72 libobs: Reset audio data on timestamp jump
To prevent issues in audio mixing make sure the audio data is also cleared
when audio timing is reset.
2020-06-20 14:55:31 -07:00
Jim
665180350d
Merge pull request #2657 from hselasky/improvement
libobs: Implement and use better scaling function for 64-bit integers
2020-05-21 18:07:53 -07:00
Exeldro
6a567eded6 libobs: Don't check filter compatibility on not loaded sources 2020-04-19 09:11:32 +02:00
Exeldro
74b9ae07f3 libobs: Don't allow duplicating scene sources 2020-04-17 12:40:25 +02:00
Hans Petter Selasky
0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00
jpark37
b12ab46e62 libobs: Fix size mismatch warning
memcpy unlikely to exceed 4 GB, but just make VS happy.
2020-03-19 11:22:15 -07:00
jp9000
cf0a5e5c97 libobs: Fix audio not playing back with audio lines
The fix for the race condition that was made in 432017b2c also broke
audio lines.  This fixes audio lines and moves the fix to just the case
where it actually applied.
2020-03-15 04:44:47 -07:00
jp9000
360af79db2 Revert "libobs: Add extra reference when source is displayed"
This reverts commit 9cff2ae6bb.
2020-03-14 10:54:37 -07:00
jp9000
7d491c7981 Revert "libobs: Only manipulate input source ref counts"
This reverts commit 6d5bb8b244.
2020-03-14 10:54:37 -07:00
jp9000
432017b2c9 libobs: Don't render audio if context not initialized
Fixes a race where the audio subsystem could call audio render callbacks
before the source was fully initialized.
2020-03-10 07:13:58 -07:00
jp9000
19068c2960 libobs: Handle removed plugins for versioned sources
When someone adds a source and the plugin is removed for whatever
reason, it would cause a crash with the new source versioning system.
This fixes that by ensuring the unversioned id is also backed up along
with the normal id.
2020-03-09 16:53:44 -07:00
jp9000
b2302902a3 libobs: Fix source type versioning system
(This also modifies image-source, obs-text, text-freetype2, and UI)

This improves source definition versioning.  To do this, it now stores
two identifier names.  One "unversioned" which is the original name, and
one "versioned" with the version number appended.

This fixes both backward compatibility with older OBS versions, and
fixes the inability to use "add existing" in OBS itself on sources
created from older version definitions.
2020-03-09 06:12:22 -07:00
jpark37
6d5bb8b244 libobs: Only manipulate input source ref counts
Filters can be hidden without being shown, which can unbalance the ref
count and destroys them prematurely. We really only care about input
sources having a chance to clean up from the render thread from the hide
handler, Windows 10 window capture specifically.
2020-03-06 01:14:38 -08:00
jp9000
b9d6675e2c libobs: Add ability to rotate async sources 2020-03-01 03:39:54 -08:00
jpark37
9cff2ae6bb libobs: Add extra reference when source is displayed
This provides a chance to clean up resources on the graphics thread in
the hide callback, which Windows Graphics Capture requires.
2020-02-22 21:02:33 -08:00
Clayton Groeneveld
f9ccea5235 libobs: Add media control support to backend 2020-01-30 21:40:20 -08:00
jp9000
2d35f863da libobs: Add manual transition "torque" support
Allows the ability for manual transitioning to smoothly flow
(interpolate) to the intended transition point over a short period of
time rather than simply setting a hard transition point number.  Doing
this allows manual transitioning to occur more smoothly, and in a more
visually pleasant way.
2019-12-27 16:38:20 -08:00
jp9000
c1522019e0 libobs: Do not include unrelated flags in filter check
Closes obsproject/obs-studio#2224
2019-12-10 09:22:18 -08:00
Clayton Groeneveld
82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
VodBox
e8c1ec4035 libobs: Send activate and show signals to filters 2019-11-07 06:19:34 -08:00
Exeldro
e5ae662e7a libobs: Export obs_group_from_source
Export obs_group_from_source to allow it to be used externally
2019-10-15 09:21:21 -07:00
jp9000
65c7e2d19d libobs: Add API to get last OBS version of a source
Allows the ability to change the behavior of a source depending on the
previous OBS version.
2019-09-20 00:13:51 -07:00
jp9000
33c09d91c2 libobs: Add funcs to determine whether audio active
Adds functions to allow sources to inform the UI whether the audio is
currently active or not.  Allows the ability to turn on/off the items in
the mixer.
2019-09-19 23:37:29 -07:00
jp9000
abaed69627 libobs: Check to swap BGRX/BGRA in async filters
If for whatever reason the format is swapped between BGRA/BGRX in an
async filter, swap the texture to compensate for that.  This allows
plugins to change the format if necessary.
2019-09-17 13:51:40 -07:00
Jim
1523acd726
Merge pull request #2055 from jpark37/video-warnings
Fix video format warnings
2019-08-31 21:16:23 -07: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
jpark37
42bf026a49 libobs: Fix video warnings 2019-08-30 22:13:03 -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
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
SoraYuki
21135f1483 libobs: Merge obs_source_process_filter_(tech_)?end functions 2019-08-14 14:03:34 +08:00
jpark37
3d6f5c8ad6 libobs: Add YUV alpha formats
This will allow YUV alpha formats to be converted to RGBA on the GPU.
2019-08-11 11:26:22 -07:00
jpark37
bdd8d64053 libobs: Separate textures for YUV input
The shaders to unpack YUV information from the same texture were rather
complicated. Breaking them up into separate textures makes the shaders
much simpler, and we can remove the PRECISION_OFFSET hack.

Performance also gets a nice boost on Intel for planar textures.

Intel GPA, SetStablePowerState, Intel HD Graphics 530, 1920x1080

UYVY: 473 us -> 457 us
YUY2: 492 us -> 422 us
YVYU: 491 us -> 441 us
I420: 1637 us -> 505 us
I422: 1644 us -> 482 us
I444: 1653 us -> 504 us
NV12: 1656 us -> 369 us
Y800 (limited): 270 us -> 277 us
Y800 (full): 263 us -> 289 us
RGB (limited): 341 us -> 411 us
BGR3 (limited): 512 us -> 509 us
BGR3 (full): 527 us -> 534 us
2019-08-09 21:14:29 -07:00
jpark37
b0e7c5d0d3 libobs: Fix stale format in async frame cache
The video format is not updated if switching between cache-compatible
formats, e.g. YUY2 and YVYU, resulting in the wrong conversion technique
being used. This change ensures the format is always up-to-date.
2019-08-07 06:47:27 -07:00
James Park
37f663a789 libobs: obs-ffmpeg: win-dshow: Planar 4:2:2 video
This format has been seen when using FFmpeg MJPEG decompression.
2019-07-25 20:11:37 -07:00
Jim
ffcfe4c9d9
Merge pull request #1951 from jpark37/audio-buffering
Fix audio buffering for devices like GV-USB2
2019-07-20 17:05:27 -07:00
Michael Fabian 'Xaymar' Dirks
3f6bbe2d49 libobs: Call both get_defaults and get_defaults2
Unlike get_properties, there is not reason to not call get_defaults if it is
given in addition to get_defaults2. Additonally this fixes the bug with
'init_encoder' which would only ever call get_defaults, resulting in broken
encoders if those used get_defaults2.
2019-07-13 00:49:18 +02:00
James Park
da87f08da4 libobs: Buffer-smoothing enhancements
If an audio source does not provide enough data at a steady pace, the
timestamp update does not happen, and buffering increases until it
maxes out. To counteract this, update the timestamp anyway.

Another issue for decoupled audio sources is that timing is not
adjusted for divergence from system time. Making this adjustment is
better for timing stability.

5+ hours of stable audio without any buffering on my GV-USB2 where it
used to add 21ms every 5 mintues or so.

Fixes https://obsproject.com/mantis/view.php?id=1269
2019-07-05 09:13:18 -07:00
jpark37
2ef25ceb85 libobs: Fix format selection
Fix ternary test to use BGRX render targets for YUV to RGB
conversions. The previous behavior may have been fine though since
the shaders fill the alpha channel with 1.0 anyway.
2019-06-27 08:57:41 -05:00
jp9000
f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
James Park
aa22b61e3e libobs: Full-screen triangle format conversions
The cache coherency of rasterization for full-screen passes is better
using an oversized triangle that is clipped rather than two triangles.
Traversal order of rasterization is GPU-specific, but will almost
certainly be better using an undivided primitive.

A smaller benefit is that quads along the diagonal are not evaluated
multiple times, but that's minor in comparison.

Redo format shaders to bypass vertex buffer, and input layout. Add
global shader bool "obs_glsl_compile" to make API-specific decisions,
i.e. handle upside-down UVs. gl_ortho is not needed for format
conversion because the vertex shader does not use ViewProj anymore.

This can be applied to more situations, but start small first.

Testbed full screen passes, Intel HD Graphics 530:
RGBA -> UYVX: 467 -> 439 us, ~6% savings
UYVX -> uv: 295 -> 239 us, ~19% savings
2019-06-18 22:29:07 -07:00
Jim
fafda14963
Merge pull request #1906 from jpark37/bgr-three
libobs: linux-v412: obs-ffmpeg: Add packed BGR3 video support
2019-06-15 16:40:44 -07:00
James Park
e72eb39e47 libobs: Disable blending when converting sources
This fixes the issue where limited-range RGB sources were being
composited with dirty render targets.
2019-06-12 22:23:51 -07:00
James Park
614025742b libobs: linux-v412: obs-ffmpeg: Add packed BGR3 video support
Someone mentioned this format preserves the most quality for a
particular capture card using V4L2.
2019-05-30 06:05:53 -07:00
James Park
ab8e895b12 libobs: Remove unreachable YUV decode paths
A previous refactoring to make DrawMatrix unnecessary has left behind
unreachable YUV conversions. Even if this code was somehow reachable,
DrawMatrix for YUV -> RGB doesn't exist anymore, so they would render
incorrectly anyway.
2019-05-19 21:27:18 -07:00
VodBox
52235ba86d libobs: Add transition and showing counter functions
This commit adds a function to forcefully stop a transition, and to
increment/decrement the showing counter for a source with the MAIN_VIEW
type.

These functions are needed for the transition previews to work as
intended.
2019-05-12 21:13:21 -07:00
James Park
f03b4dc965 libobs: Restore casts to fix Clang warnings
Clang doesn't like it if you convert T** to const T* const* without
casting even though it should be safe. Might be a C language thing.
2019-05-09 21:59:38 -07:00
James Park
a86710ec5b libobs: Support limited color range for RGB/Y800 sources
libobs: Add support for limited to full color range conversions when
using RGB or Y800 formats, and move RGB converison for Y800 formats to
the GPU.

decklink: Stop hiding color space/range properties for RGB formats, and
remove "YUV" from "YUV Color Space" and "YUV Color Range".

win-dshow: Remove "YUV" from "YUV Color Space" and "YUV Color Range".

UI: Remove "YUV" from "YUV Color Space" and "YUV Color Range".
2019-04-25 15:13:05 -07:00
jp9000
8d125dc01d libobs: Add better default source color range handling
Fixes handling of the `obs_source_frame::full_range` member variable,
which is often set to false by default by many plugins even when using
RGB, which would cause RGB to be marked as "partial range".  This change
is crucial for when partial range RBG support is implemented.

Adds `obs_source_frame2` structure that replaces the `full_range` member
variable with a `range` variable, which uses the `video_range_type` enum
to allow handling default range values.  This member variable treats
VIDEO_RANGE_DEFAULT as full range if the format is RGB, and partial
range if the format is YUV.

Also adds `obs_source_output_video2` and `obs_source_preload_video2`
functions which use the `obs_source_frame2` structure instead of the
`obs_source_frame` structure.

When using the original `obs_source_frame`, `obs_source_output_video`,
and `obs_source_preload_video` functions, RGB will always be full range
by default for backward compatibility purposes.
2019-04-25 15:12:08 -07:00
jp9000
f109d1c2bf Revert "libobs: libobs-d3d11: obs-filters: No excess alpha"
This reverts commit d91bd327d7, which
broke alpha with sources, scenes, and filter, causing them all to become
opaque unintentionally.
2019-04-25 08:36:41 -07:00
Jim
f1399b6d18
Merge pull request #1765 from jpark37/blend-alpha
libobs: libobs-d3d11: Fix blend alpha overflow
2019-04-14 00:22:20 -07:00
James Park
69c215345a libobs: Simplify YUV conversion
Currently several shaders need "DrawMatrix" techniques to support the
possibility that the input texture is a "YUV" format. Also, "DrawMatrix"
is overloaded for translation in both directions when it is written for
RGB to "YUV" only.

A cleaner solution is to handle "YUV" to RGB up-front as part of format
conversion, and ensure only RGB inputs reach the other shaders. This is
necessary to someday perform correct scale filtering without the cost of
redundant "YUV" conversions per texture tap.

A necessary prerequisite for this is to add conversion support for
VIDEO_FORMAT_I444, and that is now in place. There was already a hack in
place to cover VIDEO_FORMAT_Y800. All other "YUV" formats already have
conversion functions.

"DrawMatrix" has been removed from shaders that only supported "YUV" to
RGB conversions. It still exists in shaders that perform RGB to "YUV"
conversions, and the implementations have been sanitized accordingly.
2019-04-11 23:00:03 -07:00
James Park
21f4dd63d4 libobs: UI: Use graphics debug markers
Add D3D/GL debug markers to make RenderDoc captures easier to tranverse.

Also add obs_source_get_name_no_null() to avoid boilerplate for safe
string formatting.

Closes obsproject/obs-studio#1799
2019-04-08 02:05:37 -07:00
James Park
d91bd327d7 libobs: libobs-d3d11: obs-filters: No excess alpha
Currently SrcBlendAlpha and DestBlendAlpha are both ONE, and can
combine together to form two. This is not a noticeable problem for
UNORM targets because the channels are clamped, but it will likely
become a problem if FLOAT targets are more widely used.

This change switches DestBlendAlpha to INVSRCALPHA, and starts
backgrounds as opaque black instead of transparent black. The blending
behavior of stacked transparents is preserved without overflowing the
alpha channel.
2019-04-07 18:16:56 -07:00
jp9000
4fa30c619c libobs: Fix starting timestamp for preloaded frames
If audio monitoring is enabled and set to output only, the
obs_source_show_preloaded_video function would still incorrectly set the
current source audio output timestamp to the current system time, which
would cause audio to use an incorrect starting point from long ago for
the first starting audio segment if audio monitoring is then turned off
some time after having started the source.

Instead, the starting timestamp should be set to 0 if audio monitoring
is enabled with no output to stream, so that if/when audio monitoring is
disabled, it recalculates the starting timestamp of the first audio
packet on the spot again.

Closes obsproject/obs-studio#1522
2018-12-03 08:44:55 -08:00
jp9000
0951039322 libobs: Do not process panning if panning centered
Fixes a bug where audio panning would always be processed even if
panning was centered (and thus inactive).
2018-11-23 03:24:11 -08:00
Jim
31561b3231
Merge pull request #1428 from pantherrui/master
fix heap corruption when video capture thread release the frame before it push into source->async_frames.
2018-09-17 05:19:58 -07:00
wangrui05
26d3f42b89 libobs: Fix heap corruption in obs_source_output_video 2018-09-17 18:46:47 +08:00
jp9000
f1aa71bef1 libobs: Don't call width/height funcs if context invalid
Don't allow calling a source's custom get_width or get_height callbacks
unless the context is valid.  Fixes a bug where a null pointer could be
passed to those functions.
2018-09-13 06:54:58 -07:00
cg2121
a4a7deeed6 UI: Implement stereo balancing 2018-09-07 09:27:14 -05:00
jp9000
5dfab20a46 libobs: Allow group duplication 2018-07-16 19:03:34 -07:00
Bas van Meel
1653d258fe libobs: add obs_source_frame_copy 2018-06-11 10:03:37 +02:00
jp9000
516c0de2e0 libobs: Don't signal "source_create" for private sources 2018-05-03 12:38:47 -07:00
Jim
6f4985e4d6
Merge pull request #1261 from Andersama/patch-11
libobs: Fix pasting filters crash when missing sources
2018-04-22 06:56:52 -07:00
sorayuki
fc26e3cfcf libobs: Fix potential filter rendering race condition
The filters array should not be accessed without locking the filter
mutex.  This locks the filter mutex, grabs a reference to the first
filter, unlocks the mutex, renders the filter, and then releases the
reference.

Closes obsproject/obs-studio#1215
2018-04-20 01:55:52 -07:00
Alex Anderson
b0cd7fe890 libobs: Fix pasting filters crash when missing sources
Solves crash when a user tries to paste filters without selecting a
source or when pasting filters from a deleted source. This commit
checks if both sources are still valid before pasting.

This addresses Mantis Issue 1220
(https://obsproject.com/mantis/view.php?id=1220).
2018-04-18 09:11:47 -07:00
jp9000
8a1486d15f libobs: Fix rendering if filter context no longer exists
If a filter's implementation (its plugin for example) no longer exists,
it would cause the source to stop rendering if that filter was present
on the source.  Instead, just bypass the filter to ensure that the
source continues to render.
2018-01-17 02:08:06 -08:00
jp9000
d6ac457025 libobs: Optimize clearing of unused source audio mixes
Prevents calling memset on mixes that aren't currently active.
2018-01-16 12:02:00 -08:00
Christoph Hohmann
f4142a8ac8 libobs: Fix audio buffer clear in custom source mixing
The memset in custom_audio_render() did not clear all audio buffers when
the number of output channels was less then 8.  This caused wrong audio
output on mixes that did not get cleared.

Closes jp9000/obs-studio#1123
2018-01-16 11:56:11 -08:00
Shaolin
78961818f8 libobs: Fix for int-in-bool-context-warning
The 'bool private' variable was receiving either OBS_SCENE_DUP_PRIVATE_COPY or
OBS_SCENE_DUP_COPY hence always being true.
2018-01-07 00:26:55 -02:00
SuslikV
c706742097 libobs: Fix scene filter duplication
Scene filters were not being copied when a scene was duplicated with
obs_scene_duplicate.

Closes jp9000/obs-studio#1104
2018-01-04 20:36:11 -08:00
SuslikV
f81adbd856 libobs: Fix bad source release placement
(This commit also modifies the UI)

The source release was being done in the wrong file.
2018-01-04 20:36:11 -08:00
jp9000
a730f9d6ce libobs: Add ability to disable source types
Because it would be troublesome to add the ability to remove source
types (in case for example a script fails to reload), instead make it so
source types can be temporarily disabled while the program is running.
2018-01-03 17:04:02 -08:00
jp9000
92b4276ee7 libobs: Add obs_source_info::get_properties2
Uses type_data to get the type-specific data of a source type
2018-01-02 13:51:03 -08:00
jp9000
5d7c899ebe libobs: Add obs_source_info::get_defaults2
Uses type_data to get the type-specific data of a source type
2018-01-02 13:51:03 -08:00
jp9000
e70b226e7e libobs: Duplicate private scene/source settings
Ensures that private settings data is also duplicated when a scene or a
source is duplicated.
2017-11-30 05:05:06 -08:00
Christoph Hohmann
0d305af9df libobs: Copy enabled state when duplicating filters
This fixes that in studio mode disabled filters are applied to sources in
the live scene.
2017-11-12 10:40:15 +01:00
jp9000
b54f70ef8d libobs: Add async video/audio decoupling functions
Decoupling the audio from the video causes the audio to be played right
when it's received rather than attempt to sync up to the video frames.
This is useful with certain async sources/devices when the audio/video
timestamps are not reliable.

Naturally because it plays audio right when it's received, this should
only be used when the async source is operating in unbuffered mode,
otherwise the video frame timing will be out of sync by the amount of
buffering the video currently has.
2017-10-10 06:45:34 -07:00
jp9000
ef97f15d6b libobs: Set video timing_adjust to obs video time
When an async video frame comes in and it sets the timing_adjust value
(used to sync audio to video based upon their timestamps), it would use
os_gettime_ns as a base.  Instead, it should use OBS' current video
frame time so that the audio and video playback is as accurate as
possible relative to the actual exact timestamp of the video frame.
(Results are almost insignificant, but it's nice to be as precise as
possible)
2017-10-02 07:36:02 -07:00
jp9000
dc1e233168 libobs: Move macro to internal C file
Modifying this value would cause the entire project to recompile when
it's only used in one file in the first place.
2017-10-02 07:36:02 -07:00
Jim
48cc90d5bb Merge pull request #996 from twitchalerts/audio-subsystem-crash-fix
libobs: Fix a potential divide by zero crash
2017-09-15 13:12:41 -07:00
jp9000
2ef00ecec4 libobs: Add private settings to scene items/sources
Allows setting and sharing of user data for sources and scene items.
2017-09-13 21:17:44 -07:00
Zachary Lund
9941ddb52c libobs: Fix a potential divide by zero crash 2017-08-09 01:07:50 +02:00
Shaolin
e5756a922a libobs/plugins/UI: Suppress unused variables warnings
Closes jp9000/obs-studio#937
2017-06-27 21:55:37 -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
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
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
Shaolin
e006d961a4 audio-monitoring: Add ability to monitor Outputs
(Note: This commits also modifies the linux-pulseaudio, mac-capture, and
win-wasapi plugins)

Do not prevent the targeted output device from being monitored if the
selected monitor output device is a different one.

Closes jp9000/obs-studio#872
2017-04-05 18:58:08 -07:00