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

1759 Commits

Author SHA1 Message Date
jp9000
7a2337c1f2 libobs: Refactor item signaling (add func to signal parent) 2018-06-03 15:04:39 -07:00
jp9000
a1012c3f2c libobs: Do not draw item texture if source size 0 2018-06-03 15:04:39 -07:00
jp9000
b3dfd7ef80 libobs: Fix bug where cropped items would recalc transform
Fixes a bug where items that had cropping would recalculate transform
every frame.  obs_scene_item::last_width and obs_scene_item::last_height
would be set to the cropped sizes rather than the source's actual size.
2018-06-03 15:04:38 -07:00
jp9000
df88140e6a libobs: Zero scene data instead of setting members manually 2018-06-03 15:04:38 -07:00
jp9000
3a05cf6ab0 libobs/callback: Add signal reference counting
Adds a simple signal reference counting function
(signal_handler_connect_ref) that makes it so that signals keep the
handler around until the all the signal itself is disconnected.  This
prevents potential crashes where a signal might try to disconnect after
a handler has already been destroyed (typically in C++ with
OBSSignalHandler helper objects, where destruction isn't guaranteed to
be predictable).

This also modifies OBSSignalHandler to use the reference-counting
connections.
2018-06-03 15:04:03 -07:00
jp9000
10fc206f98 libobs: Refactor obs_scene_add to allow adding internally
Allows using obs_scene_add_internal to add without sending signals.
2018-06-03 07:24:59 -07:00
Ryan Foster
797c9d330c libobs: Copy metadata for tracks/streams when remuxing 2018-06-02 10:15:13 -04:00
Richard Stanway
834ebbd2d4
libobs: Avoid busy cursor when starting processes
Windows 10 shows a busy cursor when a process is created, this is not
useful for our background processes which have no UI.
2018-05-30 17:25:33 +02:00
Zachary Lund
396c05e23c libobs: Allow custom core data paths
Closes obsproject/obs-studio#1300
2018-05-29 04:56:37 -07:00
nleseul
5a111cf073 libobs: Handle 'in', 'out', and 'inout' keywords in shader parsers 2018-05-28 12:07:20 -04:00
Shaolin
b8e6e7a9fe libobs: Use xcb-xinput when available for events
This enables extra mouse buttons to be detected by libobs. This allows
up to 29 extra buttons.
2018-05-07 21:31:16 -03:00
Jim
57121478ac
Merge pull request #1282 from computerquip-streamlabs/source-save-load-signal
libobs: Expose source save/load signal
2018-05-07 14:41:39 -07:00
jp9000
8a1a02e7fc libobs: Make callback optional for obs_load_sources
Due to the ability to track creation of scenes via the "source_created"
global signal, the callback parameter of obs_load_sources has become
somewhat obsolete.  This change allows the ability to pass NULL to the
callback parameter in case the callback is not needed.
2018-05-04 11:44:19 -07:00
jp9000
516c0de2e0 libobs: Don't signal "source_create" for private sources 2018-05-03 12:38:47 -07:00
Zachary Lund
daf5a4b9f3 libobs: Expose source save/load signal 2018-05-01 16:09:51 -07:00
jp9000
8211b9e220 libobs: Use unaligned store rather than aligned store
Prevents a potential crash when being used with audio data that is
unaligned.
2018-05-01 09:26:10 -07:00
jp9000
4785d9906c libobs: Convert sse inline funcs to macros 2018-05-01 09:01:04 -07:00
jp9000
238df3da3a libobs: Add "static" to inline func
Fixes linux-specific compiler error:
libobs/libobs.so.0: undefined reference to `hmax_ps'
2018-04-30 04:16:15 -07:00
Tjienta Vara
b0f94afaf2 libobs, UI: Add true peak measurements
Add a new algorithm to calculate the true-peak. It implements the
Whittaker- Shannon interpolation from four samples to create 4
intermediate samples (5 x oversampling) inbetween the middle two
samples.

With 4 samples and 4 intermediate samples the algorithm can be
implemented as a 4x4 vector-matrix cross product, which is ideal for
SSE.

I've also replaced the sample-peak algorithm using SSE as well to
improve performance.

Closes obsproject/obs-studio#1189
2018-04-30 03:53:26 -07:00
Jim
76a5cc12a6
Merge pull request #1274 from computerquip-streamlabs/frontend-crash-handling
Separate crash handler from libobs startup
2018-04-25 14:02:49 -07:00
Zachary Lund
121035346f libobs: Separate crash handler from startup 2018-04-25 12:56:18 -07:00
Zachary Lund
189e535014 libobs: Add functions to get output capability flags
Closes obsproject/obs-studio#1263
2018-04-25 03:15:30 -07:00
jp9000
c4b482efef libobs: Add functions to get raw video output
Adds obs_add_raw_video_callback() and obs_remove_raw_video_callback()
functions which allow the ability to get raw video frames without
necessarily needing to create an output.
2018-04-23 10:58:30 -07:00
jp9000
45b5291530 libobs: Deactivate unnecessary GPU ops when not encoding
Reduces GPU usage when encoding is not active.  Does not perform color
conversion, frame staging, or frame downloading unless encoding is
explicitly active.
2018-04-23 08:14:18 -07:00
Shaolin
47d920e9a2 libobs: Log *nix window manager
This should ease the support task to help with performance and
xcomposite issues on such systems.

Closes obsproject/obs-studio#1194
2018-04-23 04:48:24 -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
jp9000
904ad9be1d libobs: Add function to get last main output texture
Allows the ability to get the last rendered texture of the main output
view.
2018-04-20 05:57:47 -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
cec6168fd2 libobs: Update version to 21.1.0 2018-03-17 11:23:15 -07:00
jp9000
4b54bde426 cmake, libobs, win-capture: Fix VS2017 warnings 2018-03-12 16:16:38 -07:00
Colin Edwards
cf91d9d02d deps/obs-scripting: Expose obs video info to swig
Closes jp9000/obs-studio#1203
2018-02-27 22:41:33 -08:00
jamacanbacn
8a59d68e47 libobs: Fix property text typo
(This commit also modifies UI)

Closes jp9000/obs-studio#1204
2018-02-27 05:37:40 -08:00
jp9000
8fdfdd9dd2 libobs/util: Fix blank config file values being ignored
If a config file value is set to a blank value, the value would not be
set and the default value would be used.  This fixes a bug where the
user would try to remove the replay buffer prefix, only to have the
prefix be added again next time they start the program.
2018-02-27 01:52:25 -08:00
jp9000
90692c9791 libobs: Update to version 21.0.3 (mac update)
This version change is specific for the mac version -- it's mostly just
to update the Qt package.
2018-02-21 01:19:02 -08:00
Shaolin
ffd2303a36 libobs: Log YUV space/range on video reset
Closes jp9000/obs-studio#1196
2018-02-20 04:26:29 -08:00
JetMeta
18c1f10488 libobs/util: Cache windows CPU frequency
Caches the frequency of the performance counter.  It was supposed to be
caching it already, but it seems that code was unintentionally not
included.

Closes jp9000/obs-studio#1185
2018-02-19 22:11:55 -08:00
pkviet
645d6ae8dd libobs/media-io: Change speaker layout to match FFmpeg aac.
(This commit also modifies the obs-ffmpeg module)

The default channel layouts from aac spec are implemented in FFmpeg
native aac encoder as follows:

    AV_CH_LAYOUT_MONO,
    AV_CH_LAYOUT_STEREO,
    AV_CH_LAYOUT_SURROUND,
    AV_CH_LAYOUT_4POINT0,
    AV_CH_LAYOUT_5POINT0_BACK,
    AV_CH_LAYOUT_5POINT1_BACK,
    AV_CH_LAYOUT_7POINT1,

The correspondence of speaker layouts to AV_CH_LAYOUT from FFmpeg is
changed to reflect the previous table.

Although FFmpeg native aac encoder can now encode all the layouts listed
in avutil channel_layout.h (on master), there might be issues with older
FFmpeg binaries.

Note that 2.1 speaker layout will be encoded as AV_CH_LAYOUT_SURROUND
(FL FR FC) because it is not listed as the default layout for three
channels.

This just means some optimizations for LFE channel will not be used by
the encoder which will treat it as an SCE (single channel element).

Closes jp9000/obs-studio#1182
2018-02-06 06:14:24 -08:00
jp9000
8733228126 libobs: Update version to 21.0.2 (mac tag) 2018-01-25 10:29:54 -08:00
jp9000
682c89bb33 libobs: Update version to 21.0.1 2018-01-22 13:55:54 -08:00
jp9000
7abbd4d247 libobs: Update version to 21.0.0 2018-01-20 16:46:33 -08:00
Jim
77643cce1e
Merge pull request #1139 from takev/pulseaudio-surround-selection
linux-pulseaudio: Surround speaker map
2018-01-19 16:14:04 -08:00
jp9000
e3d19c5b16 libobs/callback: Add calldata_create and calldata_destroy
These functions aren't particularly useful in C/C++, but these functions
are necessary to allow creating/destroying a calldata_t object via
script.
2018-01-18 08:53:19 -08:00
Tjienta Vara
48a8e750bb linux-pulseaudio: Surround speaker map
When using more than two channels, the channel map of pulse-audio is incorrect.

Add an API for getting a speaker map based on OBS speaker layout. Then use the
speaker map when connecting to a pulse-audio device, for both source and
monitor output.
2018-01-17 13:05:04 +01: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
dc7e05c0b9 libobs: Fix double -> float conversion warning 2018-01-16 12:03:03 -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
SuslikV
70bc2581b7
libobs: Fix log message
Refines warning message to make it clear for the end-user.

Module may fail to load by different reasons.
2018-01-13 12:26:34 +02:00
jp9000
a79992eae9 libobs: Fix audio issue with scene items
When a scene is added as a scene item with the same audio sources that
are already in the current scene, it would cause the current scene to no
longer output audio due to audio.

To replicate the issue, you would create two separate audio device
captures in scene 1, use add existing in scene 2 and add one of those
audio sources, then go back to scene 1, add scene 2 as a source, then
make scene 1 invisible.
2018-01-09 18:13:32 -08:00
Tjienta Vara
8f6d048817 linux-pulseaudio: Default sample format float32le
This pull request changes the fallback sample format for pulse-audio
to from PA_SAMPLE_S16LE to PA_SAMPLE_FLOAT32LE.

The pulseaudio plugin can handle the following sample format:
* PA_SAMPlE_U8
* PA_SAMPLE_S16LE
* PA_SAMPLE_S32LE
* PA_SAMPLE_FLOAT32LE

When an audio device advertises itself as another format, the pulseaudio-plugin
will ask pulse audio to convert to the fallback sample format.

The fallback PA_SAMPLE_S16LE is not ideal when your audio interface advertises
as PA_SAMPLE_S24LE since the conversion will lose precision.
With PA_SAMPLE_FLOAT32LE there is no precision loss and it is also equals OBS's
internal format.
2018-01-08 19:31:09 +01:00
Jim
26a471b65a
Merge pull request #1107 from admshao/pulse-fix-mantis-0001076
libobs: Fix pulseaudio monitor playback stuttering
2018-01-07 16:25:29 -08:00
Jim
e7aab8b4b8
Merge pull request #1128 from takev/volume-meters
UI: Rework volume-meters, adding more information
2018-01-07 13:57:21 -08:00
Shaolin
9de1ffe32b libobs: Fix pulseaudio monitor playback stuttering 2018-01-07 19:27:58 -02: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
Jim
98d291c037
Merge pull request #1122 from SuslikV/patch-5
libobs: Fix incomplete struct in scaler call
2018-01-05 16:00:54 -08:00
pkviet
67e48ecc2c libobs/media-io: Replace quad with 4.0
(also obs, deps/media-playback, libobs/audio-monitoring, decklink,
linux-alsa, linux-pulseaudio, mac-capture, obs-ffmpeg, win-dshow,
win-wasapi)

Default channel layout for 4 channels is 4.0 in FFmpeg.
Replacing quad with 4.0 will improve compatibility since FFmpeg has
better support of its default channel layouts.
2018-01-05 09:48:52 -08:00
pkviet
fb580535c9 libobs/media-io: Clean surround API
(also modifies obs-ffmpeg, audio-monitoring, win-wasapi, decklink,
obs-outputs)

Removes speaker layouts which are not exposed in UI.  The speaker
layouts selectable by users in the UI are the most common ones.  It is
not necessary to keep other layouts.  (This basically removes
5POINT1_SURROUND, 7POINT1_SURROUND, SURROUND =3.0).
2018-01-05 09:47:59 -08:00
Tjienta Vara
50ce228455 UI: Rework volume-meters, adding more information
The following features have been added to the audio-meters:
 * Stereo PPM-level meter, with 40 dB/1.7s decay rate.
 * Stereo VU-level meter, with 300 ms integration time.
 * Stereo Peak-hold meter, with 20 second sustain.
 * Input peak level color-squares in front of every meter.
 * Minor-ticks for each dB.
 * Major-ticks for every 5 dB.
 * Meter is divided in sections at -20 dB and -9 dB.

The ballistic parameters chosen here where taken from:
 * https://en.wikipedia.org/wiki/Peak_programme_meter (SMPTE RP.0155)
 * https://en.wikipedia.org/wiki/VU_meter

In the rework I have removed any ballistic calculations from
libobs/obs-audio-controls.c making the calculations here a lot more
simple doing only MAX and RMS calculations for only the samples in
the current update. The actual ballistics are now done by just
the UI/volume-control.cpp because ballistics need to be updated
based on the repaint-rate of the user-interface.

The dB to pixel conversion has been moved from
libobs/obs-audio-controls.c to UI/volume-control.cpp as well to reduce
coupling between these two objects, especially when implementing the
major- and minor-ticks and the sections.

All colors and ballistic parameters are adjustable via QT style sheets.
There are slight differences in colors for each of the themes.
2018-01-05 11:01:25 +01: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
Richard Stanway
8395cfcbce libobs: Log which security software is in use
(Windows only)
3rd party antivirus / firewalls cause a large number of issues in OBS.
Logging which products are installed will help narrow down potential
issues when users ask for help and include their log files.

Closes jp9000/obs-studio#1124
2018-01-04 17:55:36 -08:00
jp9000
fd9e5d45a3 libobs: Add obs_property_set_modified_callback2
Allows the ability to pass private data to a callback (useful
specifically for scripting purposes).
2018-01-03 17:04:04 -08:00
jp9000
6d628c1ceb libobs: Add obs_properties_add_button2
Allows passing button-specific private data to the button callback
rather than just passing the private data of the properties object.
2018-01-03 17:04:04 -08:00
jp9000
1902594da4 libobs: Fix function to be static inline
The function in the header was marked as just inline, which would cause
processing problems for SWIG.
2018-01-03 17:04:04 -08:00
jp9000
66f993d214 libobs: Exclude certain declarations from SWIG processing
Prevents SWIG from being able to process certain declarations that would
cause binding generation errors/warnings.
2018-01-03 17:04:04 -08:00
jp9000
f06f85fd56 libobs: Prevent access to OBS context during shutdown
The "obs" global variable can still be accessed by functions during
shutdown.  To prevent access to the variable during shutdown, move the
pointer to a temporary function variable, and set the "obs" global
variable to NULL before shutting down.
2018-01-03 17:04:03 -08:00
jp9000
ad64f7834d libobs: Store string copies in properties
Individual property objects would store pointers to strings rather than
copies of the strings and assume that memory would continue to exist, so
instead just duplicate the strings.
2018-01-03 17:04:02 -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
c8a0f661fb libobs/callback: Add global callback to signal handler
A global callback allows capturing all signals from a signal handler
rather than just a specific signal.
2018-01-03 17:04:02 -08:00
jp9000
b8bb60c83b libobs/callback: Add signal_handler_remove_current func
Convenience function that allows removing the current signal handler
callback within the callback without having to use
signal_handler_disconnect with all of its required parameters.
2018-01-03 17:04:02 -08:00
jp9000
b56c33a260 libobs/util: Add THREAD_LOCAL macro
Adds a thread local storage macro to declare thread local storage
independent of platform.
2018-01-03 17:04:02 -08:00
jp9000
0ffc9bbf05 libobs: Add video tick callback functions
Allows the ability to have a callback invoked every time video ticks.
Particularly useful for scripting.
2018-01-03 17:03:57 -08:00
jp9000
9f9cd1fec3 libobs/util: Ignore PRINTFATTR if using SWIG preprocessor
SWIG will fail because it doesn't define _MSC_VER and because it doesn't
know what to do with things like __attribute__.
2018-01-03 17:03:05 -08:00
jp9000
97ec7166b7 libobs/util: Optimize strlist_* functions
When splitting a string in to a string list via stringlist_split, it
would previously allocate memory for each sub-string and again for the
list itself.  This optimizes that function to use a single contiguous
chunk of memory for the sake of access optimization and memory
allocation efficiency.
2018-01-03 17:03:05 -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
7f6cf97bd7 libobs: Add obs_render_main_texture
(Note: This commit also modifies UI and test)

This makes it so that main preview panes are rendered with the main
output texture rather than re-rendering the main view.  The view will
render all objects again, whereas the output texture will be a single
texture render of the same exact thing.

Also fixes some abnormal artifacting when scaling the main preview pane.
2018-01-01 18:52:47 -08:00
SuslikV
ac906ba6e5
libobs: Fix incomplete struct in scaler call
Fixes the Rescale Output range and colorspace conversion issue.

When range and colorspace properties were missing and thus undefined:
get_ffmpeg_coeffs returns SWS_CS_ITU601
get_ffmpeg_range_type returns 0 (wich is VIDEO_RANGE_PARTIAL).

Should solve mantis: https://obsproject.com/mantis/view.php?id=947
More info: https://obsproject.com/forum/threads/x264-rescale-output-over-saturating-colors.69730/
2017-12-24 11:13:20 +02:00
Richard Stanway
2f577c1b71
libobs: Make get_reg_dword handle missing keys
Previously if the key didn't exist it would return uninitialized stack
memory. Reported at https://obsproject.com/forum/threads/obs-freezes-computer-on-startup-sometimes.78030/#post-330590
2017-12-19 12:04:00 +01:00
jp9000
0497095f97 Fix a number of GCC warnings 2017-12-06 16:42:45 -08:00
jp9000
3114a240b4 libobs/media-io: Add ifdef for newer FFmpeg functions
The AVCodecParameters weren't introduced until avcodec version 57.48.101
(FFmpeg version 3.1), so this will make sure to still use the older
avcodec_copy_context if the detected FFmpeg version is earlier.
2017-12-06 07:46:49 -08:00
jp9000
0d6204c8af Fix a number of MSVC warnings
Fixes a number of warnings with all modules
2017-12-05 13:53:44 -08:00
jp9000
5d9854ea44 libobs/util: Add funcs to push zeroed data to circlebufs
Adds circlebuf_push_front_zero and circlebuf_push_back_zero to
conveniently push zeroed data to the front/back of the buffer without
having to create an intermediary buffer to accomplish the same thing.
2017-12-02 13:52:40 -08:00
jp9000
78411de75e libobs/graphics: Add gs_effect_set_color
Convenience function for setting a color (in hex format, e.g.
0xAARRGGBB)
2017-12-01 12:05:52 -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
SuslikV
d4676e27dd
libobs: Fix height return value condition
This should fix "Output fails" when Rescale Output height set to 0.
2017-11-27 15:27:14 +02:00
jp9000
c111fa68b8 libobs: Add vertex/index buffer "direct" flush functions
(Note: This commit also modifies libobs-d3d11 and libobs-opengl)

Allows the ability to flush data directly without having to use the
buffer's internal data.

Allows the caller to manage his/her own vertex/index buffer data if
desired, working around the design flaw of having to rely on a
vertex/index buffer's internal data.
2017-11-27 03:00:20 -08:00
jp9000
a46f0b4808 libobs: Add option to duplicate vertex/index buffer data
Prevents from having to pass ownership of buffer data from caller when
using gs_vertexbuffer_create() or gs_indexbuffer_create() (which is a
design flaw).
2017-11-27 02:45:33 -08:00
pkviet
bbac3280c1 libobs: Add surround sound audio support
(This commit also modifies the following modules: UI,
deps/media-playback, coreaudio-encoder, decklink, linux-alsa,
linux-pulseaudio, mac-capture, obs-ffmpeg, obs-filters, obs-libfdk,
obs-outputs, win-dshow, and win-wasapi)

Adds surround sound audio support to the core, core plugins, and user
interface.

Compatible streaming services: Twitch, FB 360 live
Compatible protocols: rtmp / mpeg-ts tcp udp
Compatible file formats: mkv mp4 ts  (others untested)
Compatible codecs: ffmpeg aac, fdk_aac, CoreAudio aac,
		   opus, vorbis, pcm (others untested).
Tested streaming servers: wowza, nginx
	 HLS, mpeg-dash : surround passthrough
Html5 players tested with live surround:
	 videojs, mediaelement, viblast (hls+dash), hls.js
Decklink: on win32, swap channels order for 5.1 7.1
         (due to different channel mapping on wav, mpeg, ffmpeg)
Audio filters: surround working.
Monitoring: surround working (win macOs linux (pulse-audio)).
VST:	 stereo plugins keep in general only the first two channels.
	 surround plugins should work (e.g. mcfx does).
OS: win, macOs, linux (alsa, pulse-audio).
Misc: larger audio bitrates unlocked to accommodate more channels
NB: mf-aac only supports mono and stereo + 5.1 on win 10
         (not implemented due to lack of usefulness)

Closes jp9000/obs-studio#968
2017-11-26 03:41:53 -08:00
Jim
d432cc85c8
Merge pull request #1075 from reboot/fix_disabled_filters_applied_in_live_scene
libobs: Copy enabled state when duplicating filters
2017-11-26 01:01:31 -08:00
jp9000
350e7a7612 libobs: Update to version 20.1.3 2017-11-17 04:32:23 -08:00
pkviet
d670d7badb libobs: Fix FFmpeg constants
(This commit also modifies the deps/media-playback, obs-ffmpeg, and
win-dshow modules)

More fixes due to ffmpeg renaming some constants and deprecating
AVFMT_RAWPICTURE and AV_PIX_FMT_VDA_VLD.
Latter replaced by AV_PIX_FMT_VIDEOTOOLBOX per ffmpeg dev advice.

Closes jp9000/obs-studio#1061
2017-11-16 21:38:37 -08:00
jp9000
a33db9af20 libobs: Update to version 20.1.2 2017-11-16 20:51:38 -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
2c58185af3 libobs: Rename obs_video_thread to obs_graphics_thread
This is to prevent confusion with video_thread in
libobs/media-io/video-io.c, which is used exclusively for video
encoding/output.  Also prevents confusion in the profiler log data.
2017-10-28 00:22:03 -07:00
Richard Stanway
a4a8b385c5 libobs: Use new ffmpeg constants 2017-10-26 19:18:30 +02:00
jp9000
ff2bb08808 libobs: Update to version 20.1.1 2017-10-25 11:32:21 -07:00
Jim
5f1fd38731 Merge pull request #1047 from RytoEX/log-win10-game-mode
Log Windows 10 Gaming Features (Game Mode)
2017-10-25 11:31:31 -07:00
jp9000
749a9d3b4d libobs: Update version to 20.1.0 2017-10-16 17:04:39 -07:00
Jim
d8c4aec00f Merge pull request #1041 from RytoEX/fix-win10-revision-detection
libobs/util: Fix Windows 10 revision detection
2017-10-16 04:39:00 -07:00
Ryan Foster
b02a97ab0f libobs: Log Windows 10 Gaming Features
This commit adds logging for Windows 10 Gaming features that may
negatively impact the performance of game capture, recording, or
streaming. This doesn't check Group Policy settings.
2017-10-14 00:31:41 -04:00
Ryan Foster
0759eeb5da libobs: Add wrapper function to query Windows registry 2017-10-14 00:31:41 -04: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
Ryan Foster
d6ee57ae83 libobs/util: Fix Windows 10 revision detection
Follow-up to 47aa56b (PR #620). Windows 10 revision detection broke in
Build 15036 (Creators Update) after Revision 296. This aims to further
fix revision detection on Windows 10.
2017-10-08 04:16:48 -04:00
jp9000
3399f7b822 libobs: Disable pulseaudio dependency lookup on mac
The cmake script code used to find and depend on pulseaudio for audio
monitoring on linux was unintentionally being triggered on mac.  This
patch makes it so that the pulseaudio cmake code is ignored on mac.
2017-10-06 05:16:27 -07:00
jp9000
3ea23320b8 libobs: Initialize randomization seed in video thread
Ensures that any rand() calls in the video thread will have a unique
seed to start from.
2017-10-03 18:48:56 -07:00
jp9000
849944ca79 libobs/media-io: Fix decompress_420 function
This function had a number of bugs and just wasn't working properly at
all.  This function is currently not used in public builds because GPU
is used for color conversion instead (hence why it had probably not
really been tested), but a need came up where CPU conversion was useful
for the sake of testing something else in the back-end, and it needed to
be fixed before CPU conversion could be used.
2017-10-02 07:36:02 -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
260de35be6 libobs: When interleaving packets, make video come first
During packet interleaving (for outputs), ensure that if two packets
coincide with the same timestamp, that the video packet always comes
first instead of the audio packet.

This fix is required to make FLV demux properly with certain demuxers;
some FLV demuxers expect the video packet before the audio packet when
two packets coincide with the same timestamps.
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
jp9000
4a5ac39749 libobs: Fix starting video packet offset in outputs
(This commit also modifies the obs-outputs module)

The first video packet video offset (the value used to set the starting
point of video data) would be set to the DTS value of the first video
packet.  However, when b-frames are used, the first DTS value will be
negative.  This was originally done because FLV muxing requires that the
first packet's DTS start from 0.  Unfortunately, this would also
effectively cause the first packet's PTS/DTS value to be shifted forward
by the negative amount, which would cause video sync to be off by a
video frame or two.

This fixes it to start at the PTS value instead and preserve any
negative offsets.  Additionally, the FLV muxing code has been fixed to
ensure that it adjusts the starting video DTS to 0, and now correctly
adjusts the first audio packet's timestamp according to that DTS as well
(which it didn't do before).
2017-10-02 07:36:02 -07:00
jp9000
2f04010a4a libobs: Fix paired audio encoder discarding one segment
On audio encoder startup, audio encoders paired with a video encoder
would unintentionally discard a single audio data segment, causing it to
be 1024 audio frames out of sync.
2017-10-02 07:36:02 -07:00
Richard Stanway
27d16f961b
libobs: Restore Windows Vista compatibility
Certain PSAPI functions moved to KERNEL32 after Vista, setting
PSAPI_VERSION 1 uses the old PSAPI exports for compatibility. Vista
support was unintentionally broken by a6318ff.
2017-09-28 13:28:46 +02: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
Jimi Huotari
73c4ebc289 libobs: Adjust grammar of an error message
Change 'but both were not found' to 'but neither were found.'

Closes jp9000/obs-studio#1018
2017-09-15 08:23:58 -07:00
Jimi Huotari
068874bc3e libobs: Stop configure if ImageMagick is preferred, but not found
With certain combinations of CMake (<3.9) and ImageMagick (>=7),
configure will silently fail setting up support for ImageMagick,
even if the user requested for it, and the build will move on
(as long as FFMPEG_AVCODEC is found).  This commit adds a check
that will stop configure in such cases.

Closes jp9000/obs-studio#1018
2017-09-15 08:23:54 -07:00
Jimi Huotari
fef71c4b7c libobs: Fix ImageMagick header path
Since ImageMagick 7, the header path has been changed.  This commit
implements a check for the version being used, and includes the
header as is appropriate.

Special thanks to Hu.

Mantis-Bug: https://obsproject.com/mantis/view.php?id=966

Gentoo-Bug: https://bugs.gentoo.org/627520

Closes jp9000/obs-studio#1018
2017-09-15 08:23:32 -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
Palana
db1da73647 libobs: Fix I420 shader for (width/2)%4 == 2 resolutions
For those resolutions the last two chroma samples of every other
line would be overwritten by the last chroma samples of the previous
line (depending on sampler used), producing artifacts on the left
edge of the resulting image (e.g. any color present on the right
edge of the image would "bleed" to every other line on
the left edge)
2017-09-13 16:39:36 +02:00
Palana
9ce9c35b0d libobs: Fix texture_ready feedback for CPU conversion path 2017-09-13 16:39:27 +02:00
Jim
ee5b371576 Merge pull request #988 from ishitatsuyuki/xcb-segfault
Fix XCB keyboard mapping size calculation
2017-09-12 05:23:15 -07:00
Shaolin
b6042d91ea libobs: Add Pulseaudio audio monitoring support
Checks if the system has Pulseaudio and enables support via the
HAVE_PULSEAUDIO flag.

Closes jp9000/obs-studio#940
2017-09-12 03:37:54 -07:00
Jim
b1f2b72628 Merge pull request #929 from RytoEX/nix-sysinfo
Make *nix system info logging more like Windows/Mac
2017-09-12 01:58:49 -07:00
mntone
a6318ffdca libobs/util: Add memory usage functions
Closes jp9000/obs-studio#953
2017-09-12 01:49:11 -07:00
SuslikV
650495331d libobs: Add default hotkey id to duplicated item
Fixes https://obsproject.com/mantis/view.php?id=508

The toggle_visibility set only by init_hotkeys() call, but used each
time in obs_sceneitem_destroy() call.  Because zero hotkey_pair_id is
valid - we need to set item property other than zero here.

Closes jp9000/obs-studio#1000
2017-08-11 08:41:22 -07:00
jp9000
0b909a8d9e libobs: Update version to 20.0.1 2017-08-11 08:24:27 -07:00
jp9000
21d1658925 libobs: Update version to 20.0.0 2017-08-08 23:20:47 -07:00
Zachary Lund
9941ddb52c libobs: Fix a potential divide by zero crash 2017-08-09 01:07:50 +02:00
Tatsuyuki Ishi
7d1fde3529 libobs: Fix XCB keyboard mapping size calculation 2017-08-07 17:48:27 +09:00
Richard Stanway
f9565febdf
libobs: Export obs_output_get_last_error 2017-08-07 00:32:46 +02:00
jp9000
a9e9246bde libobs: Add ability to transition to NULL source 2017-08-04 20:33:57 -07:00
jp9000
c0b8bdf89e libobs: Log output frame count instead of encoded count
Instead of logging the relative encoded count (which is susceptible to
integer overflow), log the output frame count instead.  If there's an
issue with encoding, it'll show up when all encoding stops regardless.
2017-08-02 15:13:09 -07:00
jp9000
ba33bb7745 Revert "libobs: Fix an int underflow in log_frame_info"
This reverts commit 4e3e67bb8c.

The way this is handled will erroneously report 0 frames encoded when
frames have actually been properly encoded, which is best avoided.
Additionally, and overflow would be generated for drawn frames where
none occurred before.  The encoded value should probably not even be
present in the log for the output due to the way it's handled.
2017-08-02 15:13:09 -07:00
jp9000
e423492d61 libobs: Add API function to get version string
Some plugins are using the OBS_VERSION macro obs-config.h to specify the
current version, which will bake the string in to the plugin, making it
so that if the plugin is not replaced for a patch, it could potentially
have the incorrect version.  This makes it so that a plugin/frontend can
get the current version string that's baked in to libobs itself.
2017-07-31 13:52:08 -07:00
Dmitry Odintsov
2a53d03d5f libobs: Fix item copying during scene duplication
When item in the old scene had only Scale Filter, texture renderer
was not created for an item in the new scene. However if the item also
had Crop set, the texture renderer was created.

Now after copying the data, texture renderer is created for the item in
the new scene when needed.

Closes jp9000/obs-studio#969
2017-07-21 08:48:05 -07:00
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
Ryan Foster
d6e43aefc4 libobs: Log *nix system info more like Windows/Mac
Rename "Processor" to "CPU Name" and place it before the number of
cores. Log free RAM for *nix. Log CPU Speed on Linux and FreeBSD. Unify
processor logging on Linux and FreeBSD. Get physical and logical cores
on *nix.

Use the new os_get_logical_cores and os_get_physical_cores function from
commits 6fc74d6 and e4a64f0 to get CPU core counts on *nix systems.
2017-05-26 22:54:12 -04:00
Ryan Foster
e4a64f0efa libobs/util: Fix *nix CPU core counts
Get logical and physical CPU cores on Linux and FreeBSD, even for
multi-core CPUs.
2017-05-26 00:30:36 -04: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
jp9000
85a6d16258 libobs: Don't call unlink unnecessarily
A file rename will automatically replace the old file if an older file
exists, and will do so automatically.  Unlinking is unnecessary, and may
have a chance of preventing that move operation from being atomic.
2017-05-04 18:19:46 -07:00
jp9000
82d72803d6 libobs/util: Add Get function to BPtr<> 2017-05-04 05:46:29 -07:00
jp9000
6fcb77e165 libobs: Update to 18.0.2 (windows hotfix) 2017-05-02 00:50:07 -07:00
Ryan Foster
be98cee2a0 Fix various typos across multiple modules 2017-04-25 22:39:42 -04: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
Hugh Bailey ("Jim")
54805fe55d Merge pull request #870 from kkartaltepe/feature-free-type-data
libobs: Remove multiple calls to free_type_data
2017-04-03 21:28:34 -07:00
Kurt Kartaltepe
63688002a8 libobs: Remove multiple calls to free_type_data 2017-03-30 10:05:48 -05:00
jp9000
0941a9c13d libobs: Add ability to preload async frames
Prevents any delay when starting up certain async video sources.
Additionally prevents old frames from being presented as well.
2017-03-28 09:39:47 -07:00
jp9000
d85224bb9b libobs: Allow source to fully control source flags (for now)
This change prevents source flags from being incorrectly overwritten and
set to 0.  Eventually flags need to be separated from source settings
and this should be reverted, but for now this solves an issue where
buffering would be enabled on async video sources regardless of whether
the user disabled it or not on the source.
2017-03-28 09:19:01 -07:00
jp9000
dc4e205008 libobs: Delay stop detection of audio source
Delay the "audio stopped" detection by one audio tick to ensure that
audio doesn't get intentionally cut out in some situations
2017-03-28 09:19:00 -07:00
Kurt Kartaltepe
624aa2a504 libobs: Remove unimplemented exports
Closes jp9000/obs-studio#840
2017-03-25 09:51:45 -07:00
cg2121
1ef7a48e9c libobs: Add obs_source_copy_filters function
Allows copying filters from one source to another.

Closes jp9000/obs-studio#860
2017-03-25 04:23:22 -07:00
jp9000
1355243697 libobs: Update to 18.0.1 2017-03-06 03:54:52 -08:00
jp9000
65ffb8800c libobs: Apply sync offset to win32 audio monitoring 2017-03-05 14:29:59 -08:00
Richard Stanway
64f62ad74a
libobs: Add missing mutex unlock in audio monitoring 2017-02-26 22:04:01 +01:00
jp9000
a5828610bb libobs: Fix bug where scenes would not properly mix audio 2017-02-26 08:20:54 -08:00
jp9000
4c2fac8e4c libobs: Update version to 18.0.0 2017-02-26 07:26:44 -08:00
Richard Stanway
8b640fae24
Fix various null pointer issues detected by Coverity 2017-02-25 16:45:45 +01:00
jp9000
7fba736df9 libobs/util: Use a mutex with config files 2017-02-21 23:03:18 -08:00
jp9000
528325578f libobs: Fix audio monitoring delaying perpetually
On windows, when a source has only audio (no video) yet is marked as
capable of both video and audio, it would be programmed to expect a
video frame to synchronize with.  This fixes that potential issue by
detecting whether any video is actually playing or not.
2017-02-21 10:59:02 -08:00
jp9000
d2934eca7e libobs: Implement audio monitoring
Adds functions to turn on audio monitoring to allow the user to hear
playback of an audio source over the user's speaker.  It can be set to
turn off monitoring and only output to stream, or it can be set to
output only to monitoring, or it can be set to both.

On windows, audio monitoring uses WASAPI.  Windows also is capable of
syncing the audio to the video according to when the video frame itself
was played.

On mac, it uses AudioQueue.

On linux, it's not currently implemented and won't do anything (to be
implemented).
2017-02-06 11:44:02 -08:00
jp9000
74f9c389cb libobs: Use original audio structure for audio signal
Ensures audio has the source-local timestamp when used with audio
monitoring.
2017-02-06 11:44:01 -08:00
jp9000
f728f5b9ec libobs: Mark parameter as constant if not modifying 2017-02-06 11:44:00 -08:00
jp9000
d60d222d71 libobs: Mark last video ts even when buffering off
Ensures that the system always has a record of when the last video frame
was played.
2017-02-06 11:43:59 -08:00
Take Vos
ab3531caa9 libobs: Add optional ultrawide -> wide scaling techniques
This algorithm reduces scaling distortion on the center of the image
when scaling from ultrawide to wide.

(Jim: edited effect files to prevent an impact in performance for
standard scaling.  Now effectively generates an extra pixel shader, and
the extra code is only applied to the DrawUndistort technique, while the
original Draw technique is unaffected due to the compiler automatically
removing unused code branches via the hard-coded boolean value)

From jp9000/obs-studio#762
2017-01-30 05:59:17 -08:00
jp9000
d8500b47ea libobs: Add ability to get output congestion
From 0.0 (not congested) to 1.0 (completely congested/dropping).
2017-01-24 15:31:44 -08:00
Alexandre Vicenzi
1d5a5558ab libobs: Log correct amount of memory on 32bit (windows)
Closes jp9000/obs-studio#764
2017-01-24 11:28:52 -08:00
jp9000
841dfade55 libobs: Update to 17.0.2 2017-01-18 06:00:41 -08:00
jp9000
5f5582b87e libobs: Update to version 17.0.1 2017-01-17 09:20:49 -08:00
jp9000
b1707b18b2 libobs: Add callback for enumerating all scene children
Prevents infinite recursion when adding children to a scene.
2017-01-16 09:55:15 -08:00
jp9000
69ec87b9a5 libobs: Enumerate full tree when adding active child
Fixes a bug that would allow possible infinite recursion within a source
tree.  To fix this, inactive sources must be enumerated as well in order
to prevent infinite recursion.
2017-01-16 09:53:16 -08:00
jp9000
2877f1d553 libobs: Add func to enum active and inactive child tree 2017-01-16 09:53:08 -08:00
jp9000
3f976bec8b libobs: Fix scale filtering bug when duplicating scenes
When duplicating scenes, scene item scale filtering options would not be
preserved.
2017-01-15 09:15:44 -08:00
jp9000
93e084088f libobs: Update to version 17.0.0 2016-12-24 04:44:14 -08:00
jp9000
5cbd34df92 libobs: Eliminate an unnecessary allocation with captions 2016-12-24 03:45:19 -08:00
jp9000
fba152aed9 libobs: Fix bug in AVC encoder packet allocation
Meant to subtract the ref size, not add.  This is what one gets for
"clever" coding tricks.
2016-12-24 03:44:13 -08:00
jp9000
50773499a1 libobs: Create referenced parsed AVC encoder packet
When creating an encoder packet via obs_parse_avc_packet, make sure to
create a proper referenced encoder packet
2016-12-24 03:01:50 -08:00
jp9000
cd7bc32388 libobs: Fix caption encoder packet reallocation
Captions do something unusual with encoder packets: they reallocate them
due to appending extra h.264 data.  Due to the way allocations are
handled with core encoder packets (they now store a reference in their
data), instead of modifying the encoder data directly, create a new
encoder packet instead and release the old packet.
2016-12-24 03:01:49 -08:00
jp9000
04ae015a60 libobs: Add ability to insert captions into frames
Uses the libcaption library to allow insertion of caption data directly
in to H.264 frame data.
2016-12-23 10:37:09 -08:00
jp9000
5868133587 libobs/util: Fix C++ compilation issue
When the C header circlebuf.h is used from a C++ source file, this
implicit cast from void to uint8_t* will cause an error unless changed
to an explicit cast.
2016-12-23 10:37:03 -08:00
jp9000
e71137534c libobs: Process all scene audio actions if no audio playing
When there are audio sources in a scene and they've all stopped playing
their audio (audio is pending), all scene item audio actions (volume
changes, toggling visibility) will perpetually buffer and no longer be
processed until audio plays again.

So instead of that, if all audio sources have stopped playing in the
scene, just process all pending scene item audio actions immediately to
prevent them from never being processed while waiting for a scene item
to start playing audio.
2016-12-22 00:31:11 -08:00
jp9000
521c40460e libobs: Fix bug drawing RGB/BGR async sources
Commit 53955301a2 introduced a async source texture copy bug due to
creating a new case in a switch without adding a break to the one above
it, causing it to execute both cases by mistake.
2016-12-21 20:11:31 -08:00
jp9000
f10e2c6740 libobs: Increase maximum audio tracks to 6 2016-12-21 17:13:19 -08:00
Autumin
0ff4feab02 libobs/graphics: Fix the 2D vector dot product func
The operators were unintentionally reversed.

Closes jp9000/obs-studio#724
2016-12-18 06:20:24 -08:00
jp9000
53955301a2 libobs: Fix line size issue when copying Y800 data 2016-12-17 22:53:52 -08:00
jp9000
919aecfd62 libobs: Fix format not being set for new source frames
With the previous Y800 fix a bug was introduced where the format for the
destination frame wouldn't be set if it wasn't Y800, causing a crash.
2016-12-17 21:56:10 -08:00
jp9000
85269fb5b2 libobs: Convert Y800 to RGBX manually
Because D3D11 specifically does not support an L8 texture format (you
have to use a shader swizzle), manually convert Y800 signals to RGBX
instead.  This also fixes a bug where Y800 signals will render red.

Closes jp9000/obs-studio#718
2016-12-17 19:58:01 -08:00
jp9000
e541e170a3 libobs: Fix possible reverse order mutex hard lock
For displays, instead of using the draw_callbacks_mutex and risk a
reverse mutual lock scenario, use a separate mutex to lock display size
data.

This bug was exposed when trying to reorder filters in the UI module.
The UI thread would try to reorder the filters, locking the filter mutex
of the source, and then the reorder would signal the UI to resize the
display, so the display would lock its draw_callbacks_mutex.  Then, in
the graphics thread, it would lock the display's draw_callbacks_mutex,
try to draw the source, and then the source would try to lock that same
filter mutex.

A mutex trace:
UI thread -> lock source filter mutex -> waiting on display mutex
graphics thread -> lock display mutex -> waiting on source filter mutex

Closes jp9000/obs-studio#714
2016-12-17 15:21:00 -08:00
jp9000
7d6e6eee79 libobs: Use reference counting for encoder packets
Prevents reallocation of encoded packet data.

Deprecates:
obs_duplicate_encoder_packet
obs_free_encoder_packet

Replaces those functions with:
obs_encoder_packet_ref
obs_encoder_packet_release
2016-12-08 03:27:39 -08:00
jp9000
eb6d8e10fa libobs/util: Do not ignore deprecation on windows
On MSVC, deprecated types/functions were being completely ignored by the
compiler due to this pragma.  Any plugins/programs that depended on this
would also have this warning disabled due to it being in this file.
This pragma was most likely originally done due to the MSVC warnings for
C-standard functions, which are now ignored via _CRT_SECURE_NO_WARNINGS
on all projects instead.
2016-12-08 03:27:38 -08:00
jp9000
b29d8a44d1 libobs: Fix deprecated macro
There's no need to have two separate macros to declare something as
deprecated.
2016-12-08 03:27:37 -08:00
jp9000
ec4317dd2b libobs: Fix bug where outputs cannot initialize hotkeys
When an output's context data is being created, it cannot register any
hotkeys because the output has not initialized its reference counting
capability.  This is due to the fact that when a hotkey is registered,
it creates a weak reference to the source/output/service/encoder.

The solution to this is to make sure the output's reference counter data
is created before calling the create callback.
2016-12-08 03:27:35 -08:00
jp9000
b277000f97 libobs/util: Add function to generate formatted filenames
(Note: This commit also modifies the UI)

Being able to generate file names based upon a specification is useful
for more than just the UI; it can also be useful for things such as the
replay buffer where file names need to be generated on the fly.
2016-12-08 03:27:34 -08:00
jp9000
3aa6b50fbe libobs/util: Add function to get circlebuf data offset
Allows getting pointer to an offset at a specific index within the
circlebuf data.  Useful for iterating through circlebuf data.
2016-12-08 03:27:33 -08:00
jp9000
cf2a05ed88 libobs: Update to 0.16.6 2016-11-14 22:20:23 -08:00
jp9000
4c2a49285e Revert "libobs: Ensure AVC priority is always highest for keyframes"
This reverts commit 66525632a0.
2016-11-14 17:43:37 -08:00
jp9000
66525632a0 libobs: Ensure AVC priority is always highest for keyframes 2016-11-13 16:29:06 -08:00
Jim
9982581a4f libobs: Ensure async source sizes are always reset
If an async source is cropped on one side, then when the program is
restarted and the source is loaded from file, the async source will
start out with a width/height of zero.  This will cause the async source
to not be drawn if cropping or scale filtering is added to the scene
item, because it has to be rendered to a texture first.  However, the
source cannot reset its size until it's drawn, so it leaves it in
perpetual state of having a 0x0 size.

This fixes that problem by ensuring that the async source size is always
reset even when not being rendered.

Close jp9000/obs-studio#686
2016-11-10 00:13:06 -08:00
Jim
ee5aecac01 Merge pull request #688 from reboot/fix_duplicating_scene_sources
libobs: Duplicate filters of a scene when it is is duplicated
2016-11-09 13:44:53 -08:00
Ryan Foster
d516a33c60 libobs: Add Windows bitness/arch to crash handler
Commit aa899c2 (PR #603) added Windows bitness/arch to regular logs.
This adds it to the crash logs.

Closes jp9000/obs-studio#690
2016-11-09 12:44:10 -08:00
Ryan Foster
788a1e22b7 libobs: Refactor check for Windows bitness/arch
Commit aa899c2 (PR #603) added logging for Windows bitness/arch, but it
was a bit incomplete/short-sighted.  It only added that information to
the regular logs.  This commit makes it easier to retrieve that
information for other purposes, like the crash handler.
2016-11-09 12:41:07 -08:00
jp9000
9adad2ebc2 libobs: Update to 0.16.5 2016-11-07 21:04:06 -08:00