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

1643 Commits

Author SHA1 Message Date
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