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

1738 Commits

Author SHA1 Message Date
wangrui05
26d3f42b89 libobs: Fix heap corruption in obs_source_output_video 2018-09-17 18:46:47 +08:00
Marvin Scholz
649fa7651b libobs/audio-monitoring: Use libobs CFString utils 2018-09-16 22:41:01 +02:00
Marvin Scholz
31f143e449 libobs: Add CFString utils 2018-09-16 22:41:01 +02:00
jp9000
f1aa71bef1 libobs: Don't call width/height funcs if context invalid
Don't allow calling a source's custom get_width or get_height callbacks
unless the context is valid.  Fixes a bug where a null pointer could be
passed to those functions.
2018-09-13 06:54:58 -07:00
Jim
118dbf9e67
Merge pull request #1481 from Andersama/patch-26
libobs: Export image-file to c
2018-09-12 02:05:26 -07:00
Jim
e615dffce5
Merge pull request #1323 from Andersama/effect-annotation-parsing
libobs: Add HLSL annotation parsing
2018-09-12 01:16:21 -07:00
Alex Anderson
b30c843622
libobs: Export image-file to c
Wraps image-file.h in extern "C" like rest of libobs api.

Prevents unresolved external errors when using in c++.
2018-09-11 13:31:45 -07:00
cg2121
0ae8a7c0ac UI: Add ability to style preview background color 2018-09-10 04:55:15 -05:00
Alex Anderson
e0cd45be9b libobs: Add additional gs_effect_get_ functions
Adds api functions to extract gs_eparam_t values, including
gs_effect_get_val(), gs_effect_get_val_size(),
gs_effect_get_default_val() and gs_effect_get_default_val_size()
2018-09-08 05:22:12 -07:00
Alex Anderson
af67086912 libobs: Add HLSL annotation parsing
Gives the ability to retrieve param annotations. Blocks wrapped in <>
following a parameter.

For example:
float slider < float max_value = 10.0; float min_value = 0.0; >;

These blocks are not for shading purposes but to help describe the
shader's gui as in the example above.

Adds graphics api functions for retrieving annotations:
size_t gs_param_get_num_annotations(const gs_eparam_t *param);

gs_eparam_t *gs_param_get_annotation_by_idx(const gs_eparam_t *param,
		size_t annotation);

gs_eparam_t *gs_param_get_annotation_by_name(const gs_eparam_t *param,
		const char *name);
2018-09-08 05:22:12 -07:00
Jim
78d940e0f4
Merge pull request #1346 from dtcooper/master
libobs/UI: Allow Access To argc/argv
2018-09-08 01:29:43 -07:00
Jim
413e8e6a7b
Merge pull request #1442 from cg2121/stereo-audio-balancing
UI: Implement stereo balancing
2018-09-07 21:28:56 -07:00
jp9000
e8eec22d15 libobs/util: Fix undefined behavior and optimize util_mul64_64
Shifting an integer larger than its bit width can have undefined
behavior.  This not only fixes that issue, but also optimizes the
shift functions.
2018-09-07 17:28:15 -07:00
cg2121
a4a7deeed6 UI: Implement stereo balancing 2018-09-07 09:27:14 -05:00
Shaolin
226d4cadf5 libobs: Remove VLA in pulse monitoring backend 2018-09-03 17:39:49 -03:00
jp9000
928ccab231 libobs: Update version to 22.0.3 2018-09-02 15:35:29 -07:00
jp9000
bfa568b750 libobs: Update version to 22.0.2 2018-08-29 09:49:34 -07:00
jp9000
deba492a2d libobs: Blacklist old obs-browser version on macOS
On macOS, the older version of the browser plugin used to reside in a
different directory.  This would cause two versions of obs-browser to
load if you installed the new version of OBS over the old version of
OBS.  This fixes that bug with an slightly unsightly hack by
blacklisting that older module if it tries to load an obs-module that
resides in that specific older directory.
2018-08-27 19:36:39 -07:00
jp9000
df75feb74a libobs: Update version to 22.0.1 2018-08-20 09:06:34 -07:00
jp9000
d180f19a5f libobs: Update to version 22.0.0 2018-08-19 19:52:48 -07:00
jp9000
2647da568f libobs: Revert version update to 22.0.0 (instead, do RC2)
This reverts commit 3d4b277a60.

Reverting temporarily for the sake of completeness and confirming
testing results.
2018-08-18 04:56:42 -07:00
Ryan Foster
044aaee2e7 libobs: Fix typo in function names
Correct "regsiter" to "register" in a couple function names. These
functions are currently unused. Let's correct these names before they
start getting used.
2018-08-17 23:57:13 -04:00
jp9000
3d4b277a60 libobs: Update version to 22.0.0 2018-08-17 16:12:45 -07:00
jp9000
e6dd009386 libobs: Add function to force a sceneitem transform update
Useful when you need to modify transform properties of group sub-items
and have the transform available immediately (group sub-items always
automatically defer their transform update to the next frame).
2018-08-16 08:42:19 -07:00
jp9000
7afe99188e libobs: Fix applying group transform of flipped sources
Fixes a bug where sources that are flipped vertically and/or
horizontally would not maintain their flipped state.
2018-08-15 10:02:05 -07:00
jp9000
caceb62328 libobs: Initialize hotkey pair ID variable properly
The value of 0 can represent a valid hotkey ID, so make sure that when
we initialize a hotkey variable, that we use OBS_INVALID_HOTKEY_ID or
OBS_INVALID_HOTKEY_PAIR_ID and not 0.

This fixes a bug where scene item hotkey pair IDs would be initialized
to 0, and it would unregister valid unrelated hotkeys.  Particularly,
the start/stop streaming hotkey pair ID, which would commonly be the
first hotkey pair created, thus having the hotkey pair ID of 0.  The
start/streaming hotkey pair would unintentionally be unregistered via
code in obs-scene.c.
2018-08-14 13:06:05 -07:00
jp9000
e3c2202791 cmake: Add release candidate versions/cmake variables
Allows specifying a release candidate version, and outputs release
candidate version variables to libobs/obs-config.h.  Useful for using
cmake to specify a release candidate version.
2018-08-13 01:19:23 -07:00
Richard Stanway
41b7f85332
libobs/media-io: Prevent overwriting of remux input 2018-08-12 17:06:39 +02:00
jp9000
a2bc0f2e4f libobs: Update version from latest tag
Originally, the build numbers 21.1.1 and  21.1.2 weren't added to the
master branch -- only to the two bugfix tag branches.  This is being
added again in order to build some test builds that don't prompt for
update.
2018-08-11 07:09:49 -07:00
Richard Stanway
750f0f2ea4
libobs: Remove unnecessary null check 2018-08-11 01:56:08 +02:00
jp9000
fc37cbcca4 libobs: Add functions to get/set global private data
Allows the ability to set custom global OBS context private data for
allowing the frontend to communicate variables with plugins in an
indirect way.
2018-08-10 06:09:23 -07:00
jp9000
c43702e335 libobs: Move function declarations to correct spot
These function declarations were in the wrong section.
2018-08-10 06:09:23 -07:00
jp9000
8e5a618f03 libobs: When ungrouping groups, duplicate items
Because groups can now be used in multiple scenes at once, it's
important that if the user wishes to ungroup a group, that they must be
able to keep the group intact if it exists in other scenes.  This
requires duplicating all scene items (as well as their hotkey/private
data) instead of just reparenting the subitems.

This fixes an issue where if the user had the group referenced in
multiple scenes, the group would become empty in other scenes.
2018-08-05 04:21:42 -07:00
jp9000
ef40100c64 libobs: Add internal function to dup. scene item data
Adds an internal function to duplicate scene item data.
2018-08-05 04:21:42 -07:00
jp9000
ba4692622e libobs: Add function to save hotkey pair data 2018-08-05 04:21:42 -07:00
Ryan Foster
6c76e9a736 libobs: Log libobs bitness in crash logs 2018-07-31 11:49:35 -04:00
Jim
3fd33478f8
Merge pull request #1345 from TheMuso/fix-input-output-mac-audio-devices
libobs: Rework code for checking Mac audio device capabilities for mo…
2018-07-31 00:33:14 -07:00
jp9000
d13bbe6e59 libobs: Always try to update transform in current thread
Due to the recent change in which scene items now only update their
transforms during the next frame's tick, snapping sources would
sometimes jitter and have incorrect snapping.  This fixes that issue by
reverting to the behavior of updating the transform immediately rather
than deferring the update to the next frame tick, but only on non-group
items.

This should not be done on items that are sub-items of groups because we
rely on the obs_scene_item::update_transform variable to update the
parent group's transform in addition.
2018-07-24 02:41:31 -07:00
jp9000
593345a3b1 libobs: Only update scene item texture on frame tick
Instead of updating the scene item texture any time
update_item_transform() is called, only update it when
obs_scene_item::update_transform is called.  Prevents having to lock the
graphics mutex needlessly.
2018-07-24 02:41:31 -07:00
jp9000
8741bfcb8f libobs: Don't assign variables before if/return 2018-07-24 02:41:31 -07:00
Luke Yelavich
f29a4a8145 libobs: Copy the device uid string for mac audio monitor 2018-07-21 09:14:12 +10:00
Luke Yelavich
5c066ed48f libobs: Pass address of cf_uid rather than the contents of cf_uid 2018-07-21 09:14:12 +10:00
Luke Yelavich
ddc32aaf1c libobs: Fix setting of audio monitor device on Mac 2018-07-21 09:14:12 +10:00
Luke Yelavich
002696e795 libobs: Rework checking Mac audio device capabilities
As of commit 2eb5a22, CoreAudio devices that use one device handle for
both input and output can no longer be used for audio monitoring. This
commit fixes that.

Tested with the built-in output, a Magewell XI100DUSB-HDMI which is
input only, and a MOTU UltraLite audio interface, which shows as
output/input capable.
2018-07-21 09:14:12 +10:00
jp9000
621c519cc5 libobs: Add function to get encoder object's defaults
Rather than relying on the encoder's type identifier, additionally allow
the ability to get defaults via an encoder object.
2018-07-20 01:49:32 -07:00
jp9000
d11b05a83d libobs: Defer update of scene item texture
If the scene item crop/filtering is updated, instead of
creating/destroying the item texture on the spot, update it in the
graphics thread to prevent potential race conditions (especially when
the crop function for example could be called from within
obs_scene_enum_items in some situations, which would lock the graphics
and scene mutexes in the wrong order).
2018-07-19 00:53:30 -07:00
jp9000
1aeb87ac52 libobs/util: Don't use assert for darray_push_back_array
Instead, just check to see whether array and num are valid, and if they
are not, safely return.
2018-07-18 18:47:44 -07:00
David Cooper
16e879ca51 libobs/UI: Allow Access To argc/argv
This paves the way for plugins to have access to the argc/argv used
when spawning OBS. Notably, this will allow a patch to obs-browser that
passes through command line arguments on macOS to CEF.
2018-07-18 10:39:39 -07:00
jp9000
5dfab20a46 libobs: Allow group duplication 2018-07-16 19:03:34 -07:00
jp9000
5993834815 libobs: Change groups to actual public types
(This commit also modifies UI)

Changes groups to their own independent type, "group".  This allows them
to be used like other regular types, and allows the ability to reference
groups in multiple scenes.  Before, a group would always be linked to
the scene it was in.  This made it cumbersome for users to modify groups
if they had a similar group in multiple scenes (they would have to
modify each group in each scene).  Making groups like other source types
makes more sense to solve this issue so they can be referenced in
multiple scenes at once.  This also removes a significant amount of
group-specific handling code required for implementing groups in the
front-end.

One limitation however: due to the way sub-items of groups are
seamlessly modifiable and sortable as part of the whole scene, the user
cannot have multiple references to the same group within one scene.
2018-07-16 19:01:51 -07:00
jp9000
f45247d5c8 libobs: Abstract resize_group to resize_scene_base 2018-07-15 19:01:34 -07:00
jp9000
8f786db5f2 libobs: Refactor creation of scenes
Allows using a different source type (I.E. "group" instead of "scene").
2018-07-15 19:01:28 -07:00
jp9000
35704c4c04 libobs: Remove group_sceneitem from obs_scene struct
(This commit also modifies UI)

Removes obs_scene::group_sceneitem and replaces it with
obs_scene::is_group.  Changes a number of other functions related to
groups so that a group is not inherently tied to a specific scene, and
helps allow a single group to be referenced in multiple scenes if
desired.
2018-07-15 19:01:14 -07:00
jp9000
2329c6f6ea libobs: Add obs_data_array_push_back_array
Allows easily/safely appending all the values of one data array to
another.
2018-07-15 17:09:02 -07:00
Matthew Szatmary
a8517f3698 libobs: Update libcaption library
(This commit also modifies deps/libcaption)

Closes obsproject/obs-studio#1354
2018-07-08 01:14:27 -07:00
Hunter L. Allen
e3356d5ff6 libobs: Remove unnecessary const qualifier
This function returns a char *, so it should not be const (the value is
set from a function which also returns a char *, so there is no real
reason for this to be const).
2018-07-01 12:03:31 -04:00
Hunter L. Allen
f838585b03 libobs: Remove unused variable 2018-07-01 12:03:26 -04:00
Hunter L. Allen
b797b97bf6 libobs: Remove unused variable 2018-07-01 12:03:22 -04:00
Hunter L. Allen
31ad26ac3c libobs: Fix equality check
Removes a likely unintentional self-comparison.
2018-07-01 12:03:12 -04:00
Hunter L. Allen
6766565928 libobs: Add missing return type
As declared, transform_val is static inline, but it should be marked as
a static inline void since it does not return.
2018-07-01 12:01:47 -04:00
Hunter L. Allen
f78a5426be libobs: Remove unused variable 2018-07-01 12:01:00 -04:00
Hunter L. Allen
294d32aee0 libobs: Change int to size_t
The loop increments i towards an unsigned type, so i should also be an
unsigned type.
2018-07-01 11:58:43 -04:00
Jim
f44dc16669
Merge pull request #1319 from Andersama/patch-18
libobs: prevent crash from unbounded copy and bfree
2018-06-19 17:28:42 -07:00
Alex Anderson
7ce217bbc0 libobs: prevent crash from unbounded copy and bfree
Restricts the range of the copy to count number of characters.
Changes function to strip wrapping quotes as intended.
2018-06-19 00:13:55 -07:00
Jim
8dd7024b67
Merge pull request #1325 from exeldro/copy-frame
libobs: add obs_source_frame_copy
2018-06-18 21:31:00 -07:00
Jim
1a31d9097c
Merge pull request #1318 from TheOrsa/fixMonitoringOnOSX
libobs: Fix Monitoring devices showing input devices
2018-06-17 23:02:27 -07:00
Jim
446dc9fd4b
Merge pull request #1310 from vokama/updated-hotkey-names
libobs, UI: reset hotkey description on target rename
2018-06-16 23:09:06 -07:00
Bas van Meel
1653d258fe libobs: add obs_source_frame_copy 2018-06-11 10:03:37 +02:00
Daniel Lopez
4cebbcc23b libobs: Fix compilation issue on case-sensitive filesystems
When using a macOS running on a case-sensitive filesystem, the project
build fails due to AudioToolBox/AudioQueue.h not being found.
The correct path is AudioToolbox/AudioQueue.h. Since macOS comes with a
case-insensitive filesystem by default, this is a rare ocurrence
among developers who change it to be case-sensitive.
2018-06-08 19:06:23 -05:00
Daniel Lopez
ceac83e499 libobs: Add check for cf_uid pointer free
This little change skips returning true immediately when a call to
CoreAudio fails. Instead, it uses similar behavior as further 3 calls
below this change, just checking for unfreed pointers before also
returning true.
2018-06-08 19:05:23 -05:00
Daniel Lopez
2eb5a2288a libobs: Fix Monitoring devices showing input devices
This bug fix is to show output devices in the Advanced Audio
Settings configuration, where currently on macOS it shows erroneously
input devices.
2018-06-08 19:03:53 -05:00
Jim
8c0be08040
Merge pull request #1309 from nleseul/effect-arg-modifier
libobs: Handle 'in', 'out', and 'inout' keywords in shader parsers
2018-06-05 15:51:36 -07:00
vokama
4c73e5f6c5 libobs: Update hotkey label on scene item rename 2018-06-05 01:24:42 +03:00
vokama
c457630c39 libobs: Enable setting hotkey name and description 2018-06-05 01:23:19 +03:00
Jim
b188883966
Merge pull request #1315 from RytoEX/copy-stream-metadata-on-remux
libobs: Copy metadata for tracks/streams when remuxing
2018-06-04 04:52:43 -07:00
jp9000
26d5560da3 libobs: Add scene item grouping
Allows the ability to group scene items.  Groups internally are
sub-scenes, which allows the ability to add unique filters and
transforms to each group.
2018-06-03 15:04:39 -07:00
jp9000
690f738a76 libobs: Add custom size support to scenes
Allows scenes to have a custom size.  Mainly used for grouping, but can
be extended with public API later.
2018-06-03 15:04:39 -07:00
jp9000
f0164f9d28 libobs: Do not signal reorder while scene mutex locked
Prevents a potential race condition with the scene mutex.
2018-06-03 15:04:39 -07:00
jp9000
ff52d34027 libobs: Defer and refactor scene item transform update
Defers updating the scene item transform to the graphics thread to
reduce the number of transform update calls.
2018-06-03 15:04:39 -07:00
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