Commit Graph

86 Commits (73a1bf923602a57eeb89efbf71ac9846c9332aad)

Author SHA1 Message Date
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 d96092a0c9 libobs: Make sure X11_XCB is not linked with apple systems 2016-09-23 12:15:02 -07:00
jp9000 11ed262a36 libobs: Fix XGetXCBConnection link error on linux
A linker error for XGetXCBConnection started occurring after the
frontend API was added, the fix is simply to make sure libobs is
properly linking to X11_XCB.
2016-09-23 12:02:13 -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
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 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 13890a46e6 libobs/graphics: Add gs_image_file_* functions (w/animated gifs)
These functions allow animated gifs and management of image files.  Uses
libnsgif to load animated gifs.
2016-01-25 17:29:08 -08:00
jp9000 38f368aa80 libobs/util: Make all atomic funcs inline and use intrinsics
Needless function calls here for what should be intrinsic calls
2016-01-23 07:17:44 -08:00
jp9000 ac63bd819c libobs: Move windows headers to WIN32 section in cmake file
These were in the APPLE section by mistake
2016-01-23 07:17:43 -08:00
jp9000 9f9a4bc3f3 libobs/util: Add uint128 structure/functions
Allows some limited 128bit integer math functions, primarily for the
sake of performing calculations on nanosecond-based intervals of time
2015-12-22 06:18:17 -08:00
Palana 95487c3eec libobs/media-io: Add frame rate helpers 2015-11-14 15:37:47 +01:00
jp9000 48550b9691 libobs/util: Add function to calculate CRC32 2015-10-04 21:16:27 -07:00
jp9000 b3d6d9e49d libobs: Add file serializers 2015-10-04 21:16:25 -07:00
jp9000 df14671d2f libobs: Fix cmake bug (make sure variable exists)
If the FFMPEG_AVCODEC_LIBRARIES variable does not exist, it will
generate a cmake error, so check to make sure the variable exists before
executing this code.
2015-09-13 11:29:28 -07:00
jp9000 d78d0072a0 libobs/util: Add functions to inhibit sleep
These fucntions prevent the computer from going to sleep, hibernating,
or starting up a screen saver.

On linux, it will also attempt to use DBus to prevent gnome/kde/etc
sleep, but it's not necessarily required in order to compile the
library.  Otherwise, it will simply call "xdg-screensaver reset" once
every 30 seconds to reset the screensaver timer.
2015-09-12 22:08:05 -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
Palana 91ea844333 libobs/util: Add compressed profiler snapshot saving 2015-08-12 15:30:30 +02:00
Palana d9cf5c668b libobs/util: Add profiler 2015-08-12 15:30:28 +02:00
jp9000 ef332ab8b6 libobs: Add function to get the windows version
Microsoft basically deprecated GetVersion/GetVersionEx, so now you have
to query the file version of kernel32.dll in order to get the actual
windows version.  Because of the steps involved in getting the windows
version are fairly complicated, this is an exported libobs helper
function that can be used to get the windows version if needed.
(Microsoft does have its own set of helper functions for this but the
API feels a bit..  awkward, and you can't actually get the real windows
version with them)
2015-08-01 14:51:21 -07:00
jp9000 9a93e4b859 libobs: Add platform-specific headers to cmake 2015-08-01 14:51:20 -07:00
jp9000 c87d3b1f12 cmake: Rename FindFFMpeg to FindFFmpeg
This was sort of driving me crazy: The 'm' in FFmpeg isn't supposed to
be capitalized.
2015-07-18 16:32:26 -07:00
jp9000 c82da7da93 libobs/media-io: Add common audio math functions
This adds functions specific to audio math, which at the moment is just
converting to and from decibel and multiple.
2015-06-26 03:40:27 -07:00
Palana f37e72205a libobs: Add OSX hotkey implementation 2015-05-11 20:45:24 +02:00
Palana 5ad553d06d libobs: Add global hotkey support 2015-05-11 20:45:24 +02:00
fryshorts 7a33f27c72 libobs: Link against compat sysinfo on FreeBSD
Link against the compatibility library that provides sysinfo on FreeBSD.
2015-05-04 22:37:17 +02:00
martell 47c86b6cbe libobs: avoid using to w32-pthreads for mingw-w64
mingw-w64 provides its own pthreads library.

also change some link libs as mingw-w64 libraries are not postfixed .lib
2015-02-09 03:41:37 -08:00
jp9000 e3068ed985 libobs: Add win32 crash handler
A slightly refactored version of R1CH's crash handler, allows crash
handling for windows which provides stack traces of all threads and a
list of all loaded modules.  Also shows the processor, windows version,
and current libobs version.
2015-01-03 02:37:21 -08:00
Nicolas F 486b1082d2 libobs: Use FFmpeg for image loading by default 2014-12-04 15:38:58 +01:00
jp9000 225f597379 libobs: Add process piping functions
This adds functions for piping a command line program's stdin or stdout.
Note however that this is unidirectional only.

This will be especially useful later on when implementing MP4 output,
because MP4 output has to be piped to prevent unexpected program
termination from corrupting the file.
2014-11-27 00:07:48 -08:00
fryshorts 8dcbd77bf2 libobs: Add audio control functions
This adds a new library of audio control functions mainly for the use in
GUIS. For now it includes an implementation of a software fader that can
be attached to sources in order to easily control the volume.
The fader can translate between fader-position, volume in dB and
multiplier with a configurable mapping function.
Currently only a cubic mapping (mul = fader_pos ^ 3) is included, but
different mappings can easily be added.

Due to libobs saving/restoring the source volume from the multiplier,
the volume levels for existing source will stay the same, and live
changing of the mapping will work without changing the source volume.
2014-11-26 20:07:26 +01:00
Palana 4247a7b81e Add media remuxer to media-io 2014-10-12 06:27:33 +02:00
BtbN 599febcb54 cmake: Replace FFMpeg modules with single module
Now using components instead of one find_package call per module
2014-09-27 09:41:13 -07:00
BtbN 9dd341a3ed cmake: Properly check for Threading support 2014-09-26 22:52:30 -07:00
kc5nra 26cf4688c2 Add interaction support to libobs 2014-09-15 17:19:37 -05:00
BtbN 415a698bac Add support for build time dependency copying 2014-07-19 01:38:42 +02:00
BtbN 38c2fc87aa Move all data into the subdir it belongs to
Completely removes the build dir in favor of cmake based build layouting
2014-07-19 01:38:41 +02:00
BtbN 973435cb52 Move config include path, so it works for the exported target 2014-07-17 21:32:31 +02:00
BtbN 3b26db389d Fix Jansson dependency importing 2014-07-17 18:13:25 +02:00
Jim 83c041e14f Merge pull request #152 from BtbN/cmake_fixes
Cmake fixes
2014-07-10 20:43:23 -07:00
BtbN d09f6dae1f Don't hardcode include directory for plugins 2014-07-10 14:38:46 +02:00
Timo R a53c75f67e Add forgotten obs.hpp header to CMakeLists 2014-07-10 14:37:50 +02:00
BtbN 17a9fcaafb Use propper ffmpeg compatiblity instead of relying on deprecated functions 2014-06-28 20:54:14 +02:00
BtbN ed9d5b1d63 Add ImageMagic/Libavcodec find logic 2014-06-28 20:37:57 +02:00
jp9000 32b4d12fe3 Add FFmpeg image file support to the core 2014-06-28 10:12:58 -07:00
BtbN e2c2e50f4c Fix ffmpeg/x264 find modules according to cmake find module naming conventions 2014-05-22 13:03:47 +02:00
jp9000 4f9e4a27d5 libobs/util: Remove dup. code, add os_opendir
Just use platform-nix.c code for general stuff that mac is compliant
with, and put a define around everything else.  Take that code out of
platform-cocoa.m.

Added os_opendir, os_readdir, and os_closedir to be able to query
available files within a directory.
2014-05-14 17:44:32 -07:00
BtbN fe8d964889 Add sse/mmx flags, so used intrinsics compile on 32bit 2014-05-08 23:08:45 +02:00
BtbN ce542525fc Fix dependency on win32-pthreads 2014-05-08 14:43:16 +02:00
BtbN 38594fff9e Export libobs cmake target, so external plugins can be built without ugly hacks 2014-05-08 14:43:16 +02:00
Palana 9f43e6c257 Add yuv_to_rgb matrices and video_format_get_parameters utility 2014-04-24 16:47:06 +02:00