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

409 Commits

Author SHA1 Message Date
jpark37
00f280ff9d libobs: Rename DEPRECATED to OBS_DEPRECATED
Avoid collisions with other libraries that define DEPRECATED.
2020-01-20 21:44:50 -08:00
jp9000
2d35f863da libobs: Add manual transition "torque" support
Allows the ability for manual transitioning to smoothly flow
(interpolate) to the intended transition point over a short period of
time rather than simply setting a hard transition point number.  Doing
this allows manual transitioning to occur more smoothly, and in a more
visually pleasant way.
2019-12-27 16:38:20 -08:00
Clayton Groeneveld
a97039db64 libobs: Add manual transitioning support (T-bar)
Allows the ability to manually specify the transitioning point so the
user can transition at a custom rate, usually done by a device that can
be used as a T-bar

Co-authored-by: Jim <obs.jim@gmail.com>
2019-12-27 16:38:20 -08:00
Clayton Groeneveld
82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
Exeldro
e5ae662e7a libobs: Export obs_group_from_source
Export obs_group_from_source to allow it to be used externally
2019-10-15 09:21:21 -07:00
luz.paz
d124e6402c docs/sphinx: Fix various typos
(This modifies UI, libobs, deps/obs-scripting, various cmake files)

Found using:
`codespell -q 3 -S *.ini,./UI/data/locale,./deps/w32-pthreads -L aci,dur,iff,mut,numer,uint`
2019-10-14 17:19:38 -07:00
jp9000
65c7e2d19d libobs: Add API to get last OBS version of a source
Allows the ability to change the behavior of a source depending on the
previous OBS version.
2019-09-20 00:13:51 -07:00
jp9000
33c09d91c2 libobs: Add funcs to determine whether audio active
Adds functions to allow sources to inform the UI whether the audio is
currently active or not.  Allows the ability to turn on/off the items in
the mixer.
2019-09-19 23:37:29 -07:00
jpark37
3456ed0644 libobs: UI: Remove DrawBackdrop() to save fullscreen pass
It's a waste of GPU time to do two fullscreen passes to render final mix
previews. Use blend states to simulate the black background of
DrawBackdrop() for the following situations:

- Main preview window (Studio Mode off)
- Studio Mode: Program

This does not effect:

- Studio Mode: Preview (still uses DrawBackdrop)
- Fullscreen Projector (uses GPU clear to black)
- Windowed Projector (uses GPU clear to black)

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

Before:
DrawBackdrop: ~529 us
main texture: ~367 us (Cheaper than drawing a black quad?)

After:
[DrawBackdrop optimized away]
main texture: ~383 us
2019-07-18 19:58:29 -07:00
jp9000
153fa6337f libobs: Implement pausing of outputs
This implements pausing of outputs.  To accomplish this, raw audio/video
data is halted to the encoders or raw output.  Pausing is as precisely
timed as possible according to the timing of the obs_output_pause call,
and audio data will be spliced down to the exact audio sample in
accordance to that timing at the start/end marks.

Outputs that support this (outputs used for recording) can set the
OBS_OUTPUT_CAN_PAUSE capability flag.
2019-07-07 16:38:22 -07:00
jp9000
70ecbcd5d4 libobs: Add obs_get_frame_interval_ns
Returns the current video frame interval between frames, in nanoseconds.
2019-07-07 16:38:21 -07:00
jp9000
f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
VodBox
52235ba86d libobs: Add transition and showing counter functions
This commit adds a function to forcefully stop a transition, and to
increment/decrement the showing counter for a source with the MAIN_VIEW
type.

These functions are needed for the transition previews to work as
intended.
2019-05-12 21:13:21 -07:00
James Park
5471e74cbe libobs: UI: Remove Qt usage from graphics thread
This fixes Xcode warning about detecting UI usage from another thread.
2019-05-09 23:30:37 -07:00
jp9000
8d125dc01d libobs: Add better default source color range handling
Fixes handling of the `obs_source_frame::full_range` member variable,
which is often set to false by default by many plugins even when using
RGB, which would cause RGB to be marked as "partial range".  This change
is crucial for when partial range RBG support is implemented.

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

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

When using the original `obs_source_frame`, `obs_source_output_video`,
and `obs_source_preload_video` functions, RGB will always be full range
by default for backward compatibility purposes.
2019-04-25 15:12:08 -07:00
James Park
e01fcae133 libobs: UI: Fix rotated line scale
The line drawing functions previously assumed the upper-left 3x3 for
box_transform only held scale. The matrix can also hold rotation, so
pass in scale separately.

Fixes https://obsproject.com/mantis/view.php?id=1442
2019-04-19 06:35:42 -07:00
Jim
827f45acfd
Merge pull request #1672 from derrod/captions-no-throttling
libobs: Add minimum display duration to caption data
2019-04-14 04:19:07 -07:00
jp9000
70b8f0aa65 libobs: Fix ABI break
OBS_EFFECT_AREA from 7d811499e was inserted in the middle of the enum,
which breaks ABI for any binaries that use
OBS_EFFECT_PREMULTIPLIED_ALPHA or OBS_EFFECT_BILINEAR_LOWRES.
2019-03-22 03:46:42 -07:00
Colin Edwards
5c16a96770
Merge pull request #1715 from jpark37/area-filter
Add "Area" scale filter
2019-03-13 23:30:25 -05:00
jp9000
a2829643f4 libobs: Add function to get libobs object data 2019-03-13 00:50:19 -07:00
James Park
7d811499e0 Add "Area" scale filter
This new scale filter computes pixels by weighing the coverage area of
source pixels over the target pixel. This algorithm works well for both
upsampling and downsampling, but was mainly designed to upscale
high-quality low-resolution sources like RGB/HDMI retro consoles. I've
heard of people using odd workarounds like scaling up to very high
resolutions before scaling back down to preserve pixel shartpness. This
algorithm directly addresses this use-case in a much more direct
fashion.

The Area scale filter does a better job of preserving the thickness of
thin features than the Point filter.

The Area scale filter does not look at source pixels that lie outside
of the target pixel, leading to a much sharper image than Bilinear,
Bicubic, and Lanczos filters.

This filter should interpolate pixels in linear space, but OBS is not
equipped to do that at the moment.

libobs: Add GPU effect, and wire up scene serialization.

obs-filters: Add Area as an option for scale_filter.

UI: Add Area as an option for both scene items, and canvas downscaling.
2019-03-06 20:53:15 -08:00
jp9000
17e85f04fd libobs: Add func to get encoder caps by encoder pointer 2019-02-26 08:02:57 -08:00
derrod
b8b2b7e2e3 libobs: Add minimum display duration to caption data
Adds display_duration declaring the minimum duration a caption text
is not going to be overwritten by a new one. To keep the functions
backwards-compatible obs_output_output_caption_text2 was added while
obs_output_output_caption_text1 continues having a 2 second default.
2019-02-20 06:05:08 +01:00
VodBox
f095cb2d0e UI: Add scene item canvas overflow to preview 2019-02-08 20:38:53 +13:00
jp9000
9b8bc22ffa libobs: Add ability to reroute encoders
Allows the ability for one encoder to defer to another in case of
failure or unsupported feature.  Okay, fine, it's mostly a hack so the
new NVENC encoder can fall back to the FFmpeg encoder if NV12 textures
aren't in use, that way it does not have to implement raw fallback
support itself.  The settings and properties are pretty much the same,
so there's no reason not to utilize it in order to save time that could
otherwise be spent more productively.
2019-02-07 17:00:46 -08:00
jp9000
28d0cc8b97 libobs: Use NV12 textures when available 2019-02-07 17:00:46 -08:00
jp9000
82848d513e libobs: Add obs_video_active() function
(This commit also modifies UI)

Adds a universal function for determining whether video output is
currently active, rather than having to use video_output_active() on the
value returned by obs_get_video().
2019-02-07 17:00:46 -08:00
Zachary Lund
fe3f7539a3 libobs: Allow const argument in obs_set_cmdline_args
obs_set_cmdline_args copies the arguments passed to it. This means that
the array passed will never require it to be modified.
2018-12-30 00:02:00 -06:00
jp9000
b8a3ae1b10 libobs: Add multi-track support to non-encoded outputs 2018-10-04 20:32:35 -07:00
Michael Fabian 'Xaymar' Dirks
e55579e63d libobs: Add obs_enum_scenes for enumerating scenes
Closes obsproject/obs-studio#1507
2018-10-01 10:24:42 -07:00
cg2121
0ae8a7c0ac UI: Add ability to style preview background color 2018-09-10 04:55:15 -05: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
cg2121
a4a7deeed6 UI: Implement stereo balancing 2018-09-07 09:27:14 -05: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
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
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
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
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
Bas van Meel
1653d258fe libobs: add obs_source_frame_copy 2018-06-11 10:03:37 +02: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
Zachary Lund
396c05e23c libobs: Allow custom core data paths
Closes obsproject/obs-studio#1300
2018-05-29 04:56:37 -07: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
Zachary Lund
daf5a4b9f3 libobs: Expose source save/load signal 2018-05-01 16:09:51 -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
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
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
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
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
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
jp9000
b54f70ef8d libobs: Add async video/audio decoupling functions
Decoupling the audio from the video causes the audio to be played right
when it's received rather than attempt to sync up to the video frames.
This is useful with certain async sources/devices when the audio/video
timestamps are not reliable.

Naturally because it plays audio right when it's received, this should
only be used when the async source is operating in unbuffered mode,
otherwise the video frame timing will be out of sync by the amount of
buffering the video currently has.
2017-10-10 06:45:34 -07:00
jp9000
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
Richard Stanway
f9565febdf
libobs: Export obs_output_get_last_error 2017-08-07 00:32:46 +02: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
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
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
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
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
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
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
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
Ryan Foster
be98cee2a0 Fix various typos across multiple modules 2017-04-25 22:39:42 -04: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
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
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
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
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
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
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
95ce556051 libobs: Add obs_get_active_fps function
Allows getting the current active framerate that the core is rendering
with.  This takes in to account any rendering lag or stalls that may be
occurring.
2016-08-22 12:05:57 -07:00
jp9000
b9d67cbf4b libobs: Add function to log currently loaded modules 2016-08-05 18:59:33 -07:00
jp9000
d49833830c libobs: Add ability to use scale filters on scene items
Allows the ability to use scale filters such as point, bicubic, lanczos
on specific scene items, disabled by default.  When using one of the
latter two options, if the item's scale is under half of the source's
original size, it uses the bilinear low resolution downscale shader
instead.
2016-06-29 08:00:54 -07:00
jp9000
ff99ba7818 libobs: Allow filter processing function to return false
(Note: this commit also modifies the obs-filters and test-input modules)

Changes the obs_source_process_filter_begin return type so that it
returns true/false to indicate that filter processing should or should
not continue (for example if the filter is bypassed or if there's some
other sort of issue that causes the filtering to fail)
2016-04-22 10:18:12 -07:00
jp9000
e38a5c61d3 libobs: Add encoder caps (with deprecated flag)
Allows the ability to mark an encoder as deprecated (such as the media
foundation h264 encoders)
2016-04-13 19:01:06 -07:00
jp9000
5920778572 libobs: Add ability to create private services
This is a band-aid solution to be able to create temporary services
without logging them and keep them out of enumeration functions.

This is a band-aid solution -- 'master obs context lists' should not be
kept by the core.  Logging of object creation/destruction should also be
controlled by the front-end instead of the core.
2016-04-10 22:53:15 -07:00
jp9000
822ffb8519 libobs: Add obs_obj_invalid function
Determines whether an obs object was created successfully.  If a plugin
that's used for a saved object is removed (third party plugins), its
data will become invalid, but the objects can often still be created for
the sake of preserving user settings, but sometimes these objects can
cause problems if they're actually used (such as using them for
transitions).
2016-04-03 21:54:02 -07:00
jp9000
eb1ee87f38 libobs: Add functions to crop individual scene items
Renders the scene item to a texture if crop is enabled; otherwise
renders directly.
2016-03-30 18:59:36 -07:00
jp9000
0d7a969ebf libobs: Add functions to defer scene item update
Allows the ability to defer updating the item transform until all
functions have been executed.
2016-03-30 18:35:59 -07:00
jp9000
96d848f3d2 libobs: Add premultiplied alpha base effect 2016-03-26 21:41:49 -07:00
jp9000
07c644c581 libobs: Add deinterlacing API functions
Adds deinterlacing API functions.  Both standard and 2x variants are
supported.  Deinterlacing is set via obs_source_set_deinterlace_mode and
obs_source_set_deinterlace_field_order.

This was implemented in to the core itself because deinterlacing should
happen before effect filters are processed, but after async filters are
processed.  If this were added as a filter, there is the possibility
that a different filter is processed before deinterlacing, which could
mess with the result.  It was also a bit easier to implement this way
due to the fact that that deinterlacing may need to have access to the
previous async frame.

Effects were split in to separate files to reduce load time (especially
for yadif shaders which take a significant amount of time to compile).
2016-03-21 21:22:32 -07:00
John Bradley
310f390e1e libobs: Allow filters to specify technique 2016-03-21 21:22:27 -07:00
jp9000
772f70ec9e libobs: Change email
Kindly ignore this commit, this is to prove that this is also my email.
2016-03-12 06:28:59 -08:00
jp9000
aa2bea3749 (API Change) libobs: Don't use signal for obs_load_sources
(Note: This commit also changes the UI)

Changed:
-------------------
void obs_load_sources(obs_data_array_t *sources_list);

To:
-------------------
void obs_load_sources(obs_data_array_t *sources_list,
		obs_source_load_cb callback, void *private_data);

Signals should really never be required to use to make some function
work properly.  The "source_load" signal was required for the
obs_load_sources function, but it's meant more for loading private data
in the settings, not for general loading of sources.

This changes it so that a callback is explicitly required to load the
sources.
2016-03-04 12:59:56 -08:00
jp9000
0facb9be9a libobs: Add function to get obs object id 2016-02-27 02:49:04 -08:00
jp9000
d069302b2e libobs: Add function to get obs object type 2016-02-27 02:49:03 -08:00
jp9000
a61933dd8e (API Change) libobs: Add 'type' to obs_scene_duplicate
(Note: This commit also modifies the UI)

Allows the ability to duplicate sources fully copied, and/or have the
scene and its duplicates be private sources
2016-01-26 11:49:52 -08:00
jp9000
6824910f5d libobs: Add obs_scene_create_private function
Creates a scene marked as a private source
2016-01-26 11:49:52 -08:00
jp9000
9661ba8142 libobs: Add obs_source_duplicate function
Allows full duplication of sources (with exception of sources that are
marked with the OBS_SOURCE_DO_NOT_DUPLICATE output capability flag)
2016-01-26 11:49:51 -08:00
jp9000
56dc605497 libobs: Add obs_is_source_configurable function
Mostly only used for transitions with the intention of automatically
creating transitions which don't require configuration, returns whether
the source has any properties or not (whether it's configurable)
2016-01-26 11:49:49 -08:00
jp9000
3371ff59c9 libobs: Add *_create_private functions
Allows creation of private/unlisted sources/outputs/services/encoders
2016-01-26 11:49:48 -08:00
jp9000
669da7ba36 libobs: Do not use signals with audio capture/controls
(Note: This commit also modifies UI)

Instead of using signals, use designated callback lists for audio
capture and audio control helpers.  Signals aren't suitable here due to
the fact that signals aren't meant for things that happen every frame or
things that happen every time audio/video is received.  Also prevents
audio from being allocated every time these functions are called due to
the calldata structure.
2016-01-26 11:49:47 -08:00
jp9000
6839ff7686 libobs: Implement transition sources
Transition sources are implemented by registering a source type as
OBS_SOURCE_TYPE_TRANSITION.  They're automatically marked as video
composite sources, and video_render/audio_render callbacks must be set
when registering the source.  get_width and get_height callbacks are
unused for these types of sources, as transitions automatically handle
width/height behind the scenes with the transition settings.

In the video_render callback, the helper function
obs_transition_video_render is used to assist in automatically
processing and rendering the audio.  A render callback is passed to the
function, which in turn passes to/from textures that are automatically
rendered in the back-end.

Similarly, in the audio_render callback, the helper function
obs_transition_audio_render is used to assist in automatically
processing and rendering the audio.  Two mix callbacks are used to
handle how the source/destination sources are mixed together.  To ensure
the best possible quality, audio processing is per-sample.

Transitions can be set to automatically resize, or they can be set to
have a fixed size.  Sources within transitions can be made to scale to
the transition size (with or without aspect ratio), or to not scale
unless they're bigger than the transition.  They can have a specific
alignment within the transition, or they just default to top-left.
These features are implemented for the purpose of extending transitions
to also act as "switch" sources later, where you can switch to/from two
different sources using the transition animation.

Planned (but not yet implemented and lower priority) features:

- "Switch" transitions which allow the ability to switch back and forth
  between two sources with a transitioning animation without discarding
  the references

- Easing options to allow the option to transition with a bezier or
  custom curve

- Manual transitioning to allow the front-end/user to manually control
  the transition offset
2016-01-26 11:49:45 -08:00
jp9000
84251055fa libobs: Add function to enumerate all source types 2016-01-26 11:49:38 -08:00
jp9000
b0104fcee0 (API Change) libobs: Remove source_type param from functions
(Note: test and UI are also modified by this commit)

API Changed (removed "enum obs_source_type type" parameter):
-------------------------
obs_source_get_display_name
obs_source_create
obs_get_source_output_flags
obs_get_source_defaults
obs_get_source_properties

Removes the "type" parameter from these functions.  The "type" parameter
really doesn't serve much of a purpose being a parameter in any of these
cases, the type is just to indicate what it's used for.
2016-01-26 11:49:37 -08:00
jp9000
c1dd156db8 libobs: Implement new audio subsystem
The new audio subsystem fixes two issues:

- First Primary issue it fixes is the ability for parent sources to
  intercept the audio of child sources, and do custom processing on
  them.  The main reason for this was the ability to do custom
  cross-fading in transitions, but it's also useful for things such as
  side-chain effects, applying audio effects to entire scenes, applying
  scene-specific audio filters on sub-sources, and other such
  possibilities.

- The secondary issue that needed fixing was audio buffering.
  Previously, audio buffering was always a fixed buffer size, so it
  would always have exactly a certain number of milliseconds of audio
  buffering (and thus output delay).  Instead, it now dynamically
  increases audio buffering only as necessary, minimizing output delay,
  and removing the need for users to have to worry about an audio
  buffering setting.

The new design makes it so that audio from the leaves of the scene graph
flow to the root nodes, and can be intercepted by parent sources.  Each
audio source handles its own buffering, and each audio tick a specific
number of audio frames are popped from the front of the circular buffer
on each audio source.  Composite sources (such as scenes) can access the
audio for child sources and do custom processing or mixing on that
audio.  Composite sources use the audio_render callback of sources to do
synchronous or deferred audio processing per audio tick.  Things like
scenes now mix audio from their sub-sources.
2016-01-26 11:49:34 -08:00
jp9000
a5c9350be5 libobs: Remove "presentation volume" and "base volume" (skip)
(Note: This commit breaks libobs compilation.  Skip if bisecting)

These variables are considered obsolete and will no longer be needed.
2016-01-26 11:49:32 -08:00
jp9000
bc0b85cb79 libobs: Store circular audio buffer on source itself (skip)
(Note: This commit breaks libobs compilation.  Skip if bisecting)

Removes audio lines and stores the circular buffer for the audio on the
source itself.
2016-01-26 11:49:30 -08:00
jp9000
9c5f95d823 libobs: Add function to get current video time (in nanosec)
Allows getting the timestamp for the video frame currently being
rendered.
2016-01-25 17:29:08 -08:00
jp9000
b0ca6eaf50 libobs: Make obs_source_save and obs_source_load internal
There shouldn't be any need to call these functions manually.  These
functions are called automatically by obs_save_sources and
obs_load_sources.
2016-01-23 07:17:47 -08:00
jp9000
5be855e852 libobs: Make scene item visibility activate/deactivate
Before if a source was set to invisible it would still be considered
active.  This changes it so that the source is deactivated when the
source is invisible to reduce needless resource usage or capturing.
2015-12-22 05:49:03 -08:00
jp9000
c8f4fbe42b (API Change) libobs: Rename funcs relating to active child sources
Renames:
----------------------------------------
obs_source_add_child
obs_source_remove_child
obs_source_enum_sources
obs_source_enum_tree
obs_source_info::enum_sources

To:
----------------------------------------
obs_source_add_active_child
obs_source_remove_active_child
obs_source_enum_active_sources
obs_source_enum_active_tree
obs_source_info::enum_active_sources

These functions/callbacks had misleading names: they originally implied
any child sources, when they actually meant active child sources that
are being used to render video or audio.  It's important that the
function names represent their actual purpose.
2015-12-22 05:49:02 -08:00
Palana
ec86bdaa09 libobs: Add obs_save_sources_filtered (skip)
(Note: This commit breaks UI compilation.  Skip if bisecting)

Adds a means of saving specific sources that the front-end chooses,
rather than being forced to use the now-removed "user list".
2015-12-22 05:48:59 -08:00
jp9000
70fec7ae8e (API Change) libobs: Remove "User sources list" (skip)
(Note: This commit breaks UI compilation.  Skip if bisecting)

API Removed:
------------------------
obs_add_source

API Changed:
------------------------
obs_source_remove: Now just marks/signals a source for removal

The concept of "user sources" is flawed: it was something that the
front-end was forced to deal with if it wanted to automate source
saving/loading, and often it had to code around it.  That's not how
saving/loading should work, a front-end should be allowed to manage
lists of sources in the way it explicitly chooses, and it should be able
to choose which sources it wants to save/load.
2015-12-22 05:48:43 -08:00
jp9000
bb1b705cd3 libobs: Put obs_get_default_rect_effect back in temporarily
This function was removed even though the browser plugin was using this
function on mac, so this is being put back in temporarily while the
browser plugin is modified to remove this function.
2015-12-11 16:47:22 -08:00
jp9000
03d6eab49d libobs: Rename obs_output_canpause
Renames obs_output_canpause to obs_output_can_pause
2015-10-21 07:46:42 -07:00
jp9000
63f7daa61c libobs: Add API to get object ids 2015-10-21 07:46:41 -07:00
jp9000
6ad8df8adb (API Change) libobs: Use single func for base effects
API removed:
--------------------
gs_effect_t *obs_get_default_effect(void);
gs_effect_t *obs_get_default_rect_effect(void);
gs_effect_t *obs_get_opaque_effect(void);
gs_effect_t *obs_get_solid_effect(void);
gs_effect_t *obs_get_bicubic_effect(void);
gs_effect_t *obs_get_lanczos_effect(void);
gs_effect_t *obs_get_bilinear_lowres_effect(void);

API added:
--------------------
gs_effect_t *obs_get_base_effect(enum obs_base_effect effect);

Summary:
--------------------
Combines multiple near-identical functions into a single function with
an enum parameter.
2015-10-19 00:52:45 -07:00
jp9000
0ed913a136 libobs: Add functions to get private type data
The private type data is the type_data variable that's provided when
object types are registered by plugins.
2015-09-16 09:17:14 -07:00
jp9000
0538865553 libobs: Add encoded output delay support
This feature allows a user to delay an output (as long as the output
itself supports it).  Needless to say this intended for live streams,
where users may want to delay their streams to prevent stream sniping,
cheating, and other such things.

The design this time was a bit more elaborate, but still simple in
design:  the user can now schedule stops/starts without having to wait
for the stream itself to stop before being able to take any action.
Optionally, they can also forcibly stop stream (and delay) in case
something happens which they might not want to be streamed.

Additionally, a new option was added to preserve stream cutoff point on
disconnections/reconnections, so that if you get disconnected while
streaming, when it reconnects, it will reconnect right at the point
where it left off.  This will probably be quite useful for a number of
applications in addition to regular delay, such as setting the delay to
1 second and then using this feature to minimize, for example, a
critical stream such as a tournament stream from getting any of its
stream data cut off.  However, using this feature will of course cause
the stream data to buffer and increase delay (and memory usage) while
it's in the process of reconnecting.
2015-09-10 12:13:37 -07:00
jp9000
ba718e94b5 libobs: Add function to duplicate scenes 2015-08-28 15:01:15 -07:00
jp9000
0d30d1229f libobs: Add API func to get module config path
Allows the ability to get a module-specific configuration file/path
2015-08-19 12:16:21 -07:00
jp9000
2bd8ab7c09 (API Change) libobs: Add global module config path
API Changed:
---------------------------
From:
- bool obs_startup(const char *locale, profiler_name_store_t *store);

To:
- bool obs_startup(const char *locale, const char *module_config_path,
		profiler_name_store_t *store);

Summary:
---------------------------
This allows plugin modules to store plugin-specific configuration data
(rather than only allowing objects to store configuration data).  This
will be useful for things like caching data, for example looking up and
storing ingests from remote (rather than storing locally), or caching
font data (so it doesn't have to build a font cache each time), among
other things.

Also adds a module-specific directory for the UI
2015-08-19 12:16:20 -07:00
Palana
44b5afbd07 (API Change) libobs: Add profile_name_store_t parameter to obs_startup
Due to all the threads in libobs it wouldn't be safe to make that
parameter reconfigurable after libobs is initialized without adding
even more synchronization. On the other hand, adding a function to set
the name store before calling obs_startup would solve the problem of
passing a name store into libobs, but it can lead to more complicated
semantics for obs_get_profiler_name_store (e.g., should it always return
the current name store even if libobs isn't initialized until someone
calls set_name_store(NULL)? should obs_shutdown call
set_name_store(NULL)? Passing it as obs_startup parameter avoids
these (and hopefully other) potential misunderstandings
2015-08-12 15:30:29 +02:00
jp9000
6dfb59572f libobs: Remove windowless context #error 2015-08-05 01:07:10 -07:00
jp9000
b89ea47b96 (API Change) libobs: Remove main window funcs/vars
(Non-compiling commit: windowless-context branch)

API Changed:
---------------------
Removed functions:
- obs_add_draw_callback
- obs_remove_draw_callback
- obs_resize
- obs_preview_set_enabled
- obs_preview_enabled

Removed member variables from struct obs_video_info:
- window_width
- window_height
- window

Summary:
---------------------
Changes the core libobs API to not be dependent upon a main window/view.
If you wish to draw to a window/view, use an obs_display object to
handle it.

This allows the use of libobs without requiring a window to be present
on the system.  This is also prunes code that had to be needlessly
duplicated to handle the "main" window.
2015-08-05 01:07:09 -07:00
jp9000
358eb56228 libobs: Add windowless context #error
Intentionally breaks compilation when trying to compile the specific
merged commits within the windowless-context branch.  This is meant to
be used in conjunction with a merge commit so that bisecting will never
see any non-compiling commits.
2015-08-05 01:07:03 -07:00
jp9000
9f96e691ae libobs: Add API to get encoder sample rate
In case the encoder has to use a different sample rate (due to the
sample rate being unsupported), we need an API function for the encoder
to get the sample rate that the encoder is actually running at.
2015-07-09 10:42:09 -07:00
Palana
41689fe746 libobs: Add obs_scene_reorder_items 2015-06-28 04:10:10 +02:00
Palana
ef9090e0a3 libobs: Add obs_scene_atomic_update 2015-06-28 04:10:10 +02:00
Palana
7b3b083889 libobs: Add audio source hotkeys 2015-05-11 20:45:25 +02:00
Palana
1d39c3e9b6 (API Change) libobs: Add hotkey data to *_create functions 2015-05-11 20:45:25 +02:00
Palana
5ad553d06d libobs: Add global hotkey support 2015-05-11 20:45:24 +02:00
Palana
71abed387f (API Change) libobs: Make obs_service refcounted 2015-05-07 02:08:05 +02:00
Palana
ba0b8eb0e1 (API Change) libobs: Make obs_encoder refcounted 2015-05-07 02:07:56 +02:00
Palana
f094bf199d (API Change) libobs: Make obs_output refcounted 2015-05-07 02:06:40 +02:00
Palana
a563fbc05b libobs: Add weak reference type for obs_source 2015-05-07 01:57:14 +02:00
jp9000
1ee277ed33 libobs: Add preferred video format encoder funcs
Allows the ability to hint at encoders what format should be used.

This is particularly useful if libobs is currently operating in planar
4:4:4, but you want to force an encoder used for streaming to convert to
NV12 to prevent streaming issues.
2015-04-17 20:17:42 -07:00
jp9000
65517ea4cf libobs: Add low resolution bilinear scale effect
This effect preserves detail of images that are scaled below half size
by using sampling 9 pixels.
2015-04-10 07:27:24 -07:00
jp9000
27a0749d8d libobs: Add func to set display background color
This function sets the background color for a display
2015-04-10 07:27:23 -07:00
jp9000
1a9c512f38 libobs: Add functions to disable main preview
If you don't need to see what's displayed, then this is particularly
useful for two reasons:
1. It reduces the number of draw/present calls
2. It can prevent issues with certain hardware setups where rendering on
   a monitor hooked up to a separate card can experience slowdowns
2015-04-10 07:27:22 -07:00
jp9000
ebfe477caf libobs: Add ability to disable displays
Sometimes it can be useful to turn off rendering to the display in order
to reduce the number of draw calls and present calls.
2015-04-10 07:27:21 -07:00
jp9000
a73816665c libobs: Simplify comment
These are basically just capabilities of a source, that and too much
text on one line.
2015-03-25 10:03:18 -07:00
jp9000
c16f1a7430 libobs: Add obs_get_source_output_flags function
Gets the output flags by its source type.
2015-03-25 10:03:17 -07:00
jp9000
0d8ae565f2 libobs: Add API to hide/show scene items 2015-03-25 10:03:16 -07:00
jp9000
e31fea66be libobs: Add API to mute/unmute sources 2015-03-25 10:03:13 -07:00
jp9000
f04ef236ac libobs: Add ability to disable sources/filters 2015-03-25 10:03:13 -07:00
jp9000
44e484ad34 (API Change) Fix filter rendering design flaw
obs_source_process_filter tried to do everything in a single function,
but the problem is that effect parameters would not properly be
accounted for due to the way it internally draws, therefore it was
necessary to split the functions in to two, you first call
obs_source_process_filter_begin, then you set your effect parameters,
then you finally call obs_source_process_filter_end.  This ensures that
when the filter is drawn, that the effect parameters are set.
2015-03-25 10:03:06 -07:00
jp9000
c2775eaa3d libobs: Add obs_source_skip_video_filter function
This allows a filter to skip its step and move on to the next target in
the chain without affecting performance.
2015-03-25 10:03:02 -07:00