Commit graph

1472 commits

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