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

1667 Commits

Author SHA1 Message Date
pkviet
d670d7badb libobs: Fix FFmpeg constants
(This commit also modifies the deps/media-playback, obs-ffmpeg, and
win-dshow modules)

More fixes due to ffmpeg renaming some constants and deprecating
AVFMT_RAWPICTURE and AV_PIX_FMT_VDA_VLD.
Latter replaced by AV_PIX_FMT_VIDEOTOOLBOX per ffmpeg dev advice.

Closes jp9000/obs-studio#1061
2017-11-16 21:38:37 -08:00
jp9000
a33db9af20 libobs: Update to version 20.1.2 2017-11-16 20:51:38 -08:00
Christoph Hohmann
0d305af9df libobs: Copy enabled state when duplicating filters
This fixes that in studio mode disabled filters are applied to sources in
the live scene.
2017-11-12 10:40:15 +01:00
jp9000
2c58185af3 libobs: Rename obs_video_thread to obs_graphics_thread
This is to prevent confusion with video_thread in
libobs/media-io/video-io.c, which is used exclusively for video
encoding/output.  Also prevents confusion in the profiler log data.
2017-10-28 00:22:03 -07:00
Richard Stanway
a4a8b385c5 libobs: Use new ffmpeg constants 2017-10-26 19:18:30 +02:00
jp9000
ff2bb08808 libobs: Update to version 20.1.1 2017-10-25 11:32:21 -07:00
Jim
5f1fd38731 Merge pull request #1047 from RytoEX/log-win10-game-mode
Log Windows 10 Gaming Features (Game Mode)
2017-10-25 11:31:31 -07:00
jp9000
749a9d3b4d libobs: Update version to 20.1.0 2017-10-16 17:04:39 -07:00
Jim
d8c4aec00f Merge pull request #1041 from RytoEX/fix-win10-revision-detection
libobs/util: Fix Windows 10 revision detection
2017-10-16 04:39:00 -07:00
Ryan Foster
b02a97ab0f libobs: Log Windows 10 Gaming Features
This commit adds logging for Windows 10 Gaming features that may
negatively impact the performance of game capture, recording, or
streaming. This doesn't check Group Policy settings.
2017-10-14 00:31:41 -04:00
Ryan Foster
0759eeb5da libobs: Add wrapper function to query Windows registry 2017-10-14 00:31:41 -04:00
jp9000
b54f70ef8d libobs: Add async video/audio decoupling functions
Decoupling the audio from the video causes the audio to be played right
when it's received rather than attempt to sync up to the video frames.
This is useful with certain async sources/devices when the audio/video
timestamps are not reliable.

Naturally because it plays audio right when it's received, this should
only be used when the async source is operating in unbuffered mode,
otherwise the video frame timing will be out of sync by the amount of
buffering the video currently has.
2017-10-10 06:45:34 -07:00
Ryan Foster
d6ee57ae83 libobs/util: Fix Windows 10 revision detection
Follow-up to 47aa56b (PR #620). Windows 10 revision detection broke in
Build 15036 (Creators Update) after Revision 296. This aims to further
fix revision detection on Windows 10.
2017-10-08 04:16:48 -04:00
jp9000
3399f7b822 libobs: Disable pulseaudio dependency lookup on mac
The cmake script code used to find and depend on pulseaudio for audio
monitoring on linux was unintentionally being triggered on mac.  This
patch makes it so that the pulseaudio cmake code is ignored on mac.
2017-10-06 05:16:27 -07:00
jp9000
3ea23320b8 libobs: Initialize randomization seed in video thread
Ensures that any rand() calls in the video thread will have a unique
seed to start from.
2017-10-03 18:48:56 -07:00
jp9000
849944ca79 libobs/media-io: Fix decompress_420 function
This function had a number of bugs and just wasn't working properly at
all.  This function is currently not used in public builds because GPU
is used for color conversion instead (hence why it had probably not
really been tested), but a need came up where CPU conversion was useful
for the sake of testing something else in the back-end, and it needed to
be fixed before CPU conversion could be used.
2017-10-02 07:36:02 -07:00
jp9000
ef97f15d6b libobs: Set video timing_adjust to obs video time
When an async video frame comes in and it sets the timing_adjust value
(used to sync audio to video based upon their timestamps), it would use
os_gettime_ns as a base.  Instead, it should use OBS' current video
frame time so that the audio and video playback is as accurate as
possible relative to the actual exact timestamp of the video frame.
(Results are almost insignificant, but it's nice to be as precise as
possible)
2017-10-02 07:36:02 -07:00
jp9000
260de35be6 libobs: When interleaving packets, make video come first
During packet interleaving (for outputs), ensure that if two packets
coincide with the same timestamp, that the video packet always comes
first instead of the audio packet.

This fix is required to make FLV demux properly with certain demuxers;
some FLV demuxers expect the video packet before the audio packet when
two packets coincide with the same timestamps.
2017-10-02 07:36:02 -07:00
jp9000
dc1e233168 libobs: Move macro to internal C file
Modifying this value would cause the entire project to recompile when
it's only used in one file in the first place.
2017-10-02 07:36:02 -07:00
jp9000
4a5ac39749 libobs: Fix starting video packet offset in outputs
(This commit also modifies the obs-outputs module)

The first video packet video offset (the value used to set the starting
point of video data) would be set to the DTS value of the first video
packet.  However, when b-frames are used, the first DTS value will be
negative.  This was originally done because FLV muxing requires that the
first packet's DTS start from 0.  Unfortunately, this would also
effectively cause the first packet's PTS/DTS value to be shifted forward
by the negative amount, which would cause video sync to be off by a
video frame or two.

This fixes it to start at the PTS value instead and preserve any
negative offsets.  Additionally, the FLV muxing code has been fixed to
ensure that it adjusts the starting video DTS to 0, and now correctly
adjusts the first audio packet's timestamp according to that DTS as well
(which it didn't do before).
2017-10-02 07:36:02 -07:00
jp9000
2f04010a4a libobs: Fix paired audio encoder discarding one segment
On audio encoder startup, audio encoders paired with a video encoder
would unintentionally discard a single audio data segment, causing it to
be 1024 audio frames out of sync.
2017-10-02 07:36:02 -07:00
Richard Stanway
27d16f961b
libobs: Restore Windows Vista compatibility
Certain PSAPI functions moved to KERNEL32 after Vista, setting
PSAPI_VERSION 1 uses the old PSAPI exports for compatibility. Vista
support was unintentionally broken by a6318ff.
2017-09-28 13:28:46 +02:00
Jim
48cc90d5bb Merge pull request #996 from twitchalerts/audio-subsystem-crash-fix
libobs: Fix a potential divide by zero crash
2017-09-15 13:12:41 -07:00
Jimi Huotari
73c4ebc289 libobs: Adjust grammar of an error message
Change 'but both were not found' to 'but neither were found.'

Closes jp9000/obs-studio#1018
2017-09-15 08:23:58 -07:00
Jimi Huotari
068874bc3e libobs: Stop configure if ImageMagick is preferred, but not found
With certain combinations of CMake (<3.9) and ImageMagick (>=7),
configure will silently fail setting up support for ImageMagick,
even if the user requested for it, and the build will move on
(as long as FFMPEG_AVCODEC is found).  This commit adds a check
that will stop configure in such cases.

Closes jp9000/obs-studio#1018
2017-09-15 08:23:54 -07:00
Jimi Huotari
fef71c4b7c libobs: Fix ImageMagick header path
Since ImageMagick 7, the header path has been changed.  This commit
implements a check for the version being used, and includes the
header as is appropriate.

Special thanks to Hu.

Mantis-Bug: https://obsproject.com/mantis/view.php?id=966

Gentoo-Bug: https://bugs.gentoo.org/627520

Closes jp9000/obs-studio#1018
2017-09-15 08:23:32 -07:00
jp9000
2ef00ecec4 libobs: Add private settings to scene items/sources
Allows setting and sharing of user data for sources and scene items.
2017-09-13 21:17:44 -07:00
Palana
db1da73647 libobs: Fix I420 shader for (width/2)%4 == 2 resolutions
For those resolutions the last two chroma samples of every other
line would be overwritten by the last chroma samples of the previous
line (depending on sampler used), producing artifacts on the left
edge of the resulting image (e.g. any color present on the right
edge of the image would "bleed" to every other line on
the left edge)
2017-09-13 16:39:36 +02:00
Palana
9ce9c35b0d libobs: Fix texture_ready feedback for CPU conversion path 2017-09-13 16:39:27 +02:00
Jim
ee5b371576 Merge pull request #988 from ishitatsuyuki/xcb-segfault
Fix XCB keyboard mapping size calculation
2017-09-12 05:23:15 -07:00
Shaolin
b6042d91ea libobs: Add Pulseaudio audio monitoring support
Checks if the system has Pulseaudio and enables support via the
HAVE_PULSEAUDIO flag.

Closes jp9000/obs-studio#940
2017-09-12 03:37:54 -07:00
Jim
b1f2b72628 Merge pull request #929 from RytoEX/nix-sysinfo
Make *nix system info logging more like Windows/Mac
2017-09-12 01:58:49 -07:00
mntone
a6318ffdca libobs/util: Add memory usage functions
Closes jp9000/obs-studio#953
2017-09-12 01:49:11 -07:00
SuslikV
650495331d libobs: Add default hotkey id to duplicated item
Fixes https://obsproject.com/mantis/view.php?id=508

The toggle_visibility set only by init_hotkeys() call, but used each
time in obs_sceneitem_destroy() call.  Because zero hotkey_pair_id is
valid - we need to set item property other than zero here.

Closes jp9000/obs-studio#1000
2017-08-11 08:41:22 -07:00
jp9000
0b909a8d9e libobs: Update version to 20.0.1 2017-08-11 08:24:27 -07:00
jp9000
21d1658925 libobs: Update version to 20.0.0 2017-08-08 23:20:47 -07:00
Zachary Lund
9941ddb52c libobs: Fix a potential divide by zero crash 2017-08-09 01:07:50 +02:00
Tatsuyuki Ishi
7d1fde3529 libobs: Fix XCB keyboard mapping size calculation 2017-08-07 17:48:27 +09:00
Richard Stanway
f9565febdf
libobs: Export obs_output_get_last_error 2017-08-07 00:32:46 +02:00
jp9000
a9e9246bde libobs: Add ability to transition to NULL source 2017-08-04 20:33:57 -07:00
jp9000
c0b8bdf89e libobs: Log output frame count instead of encoded count
Instead of logging the relative encoded count (which is susceptible to
integer overflow), log the output frame count instead.  If there's an
issue with encoding, it'll show up when all encoding stops regardless.
2017-08-02 15:13:09 -07:00
jp9000
ba33bb7745 Revert "libobs: Fix an int underflow in log_frame_info"
This reverts commit 4e3e67bb8c.

The way this is handled will erroneously report 0 frames encoded when
frames have actually been properly encoded, which is best avoided.
Additionally, and overflow would be generated for drawn frames where
none occurred before.  The encoded value should probably not even be
present in the log for the output due to the way it's handled.
2017-08-02 15:13:09 -07:00
jp9000
e423492d61 libobs: Add API function to get version string
Some plugins are using the OBS_VERSION macro obs-config.h to specify the
current version, which will bake the string in to the plugin, making it
so that if the plugin is not replaced for a patch, it could potentially
have the incorrect version.  This makes it so that a plugin/frontend can
get the current version string that's baked in to libobs itself.
2017-07-31 13:52:08 -07:00
Dmitry Odintsov
2a53d03d5f libobs: Fix item copying during scene duplication
When item in the old scene had only Scale Filter, texture renderer
was not created for an item in the new scene. However if the item also
had Crop set, the texture renderer was created.

Now after copying the data, texture renderer is created for the item in
the new scene when needed.

Closes jp9000/obs-studio#969
2017-07-21 08:48:05 -07:00
Michael Fabian Dirks
f8b14bdb46 libobs: Ensure scene items don't have pre-multiplied alpha
Scene items would incorrectly have pre-multiplied alpha when they were
scaled with different scale filtering, when they were cropped, or when
the item itself was a scene.  This happens because the scene renders the
items to a texture in those cases, and when they are rendered to a
texture the blend function would be the default srcalpha/invsrcalpha
blend function, which would cause alpha to become pre-multiplied in the
texture's result rather than straight alpha.

This changes the behavior to directly copy the color/alpha to the
texture using the one/zero blend function instead, which makes the
resulting texture straight alpha.  (Note that you do not want to turn
off the blend mode for the same result because certain sources can have
custom drawing that may rely on blending being available)

Related Issue: https://obsproject.com/mantis/view.php?id=954

Closes jp9000/obs-studio#966
2017-07-21 08:30:14 -07:00
SammyJames
4fd66d4d1e libobs: Add post-load module callback
This allows the ability for certain types of modules (particularly
scripting-related modules) to initialize extra data when all other
modules have loaded.  Because front-ends may wish to have custom
handling for loading modules, the front-end must manually call
obs_post_load_modules after it has completed loading all plug-in
modules.

Closes jp9000/obs-studio#965
2017-07-21 08:27:31 -07:00
jp9000
3a06cb25df libobs: Add ability for transitions to render sources directly
For specific types of transitions (stingers in this case), there is no
blending done of the two targets, so wasting GPU resources rendering
them to textures is unnecessary.
2017-07-19 16:23:06 -07:00
jp9000
cb42f08d1e libobs: Add function to get current transition time 2017-07-19 16:23:06 -07:00
jp9000
e801c766c9 libobs: Add transition callbacks for starting/stopping 2017-07-19 16:23:06 -07:00
jp9000
e37f6b3bd6 libobs: Do not save hotkeys for private sources 2017-07-19 16:23:06 -07:00
jp9000
24571599db libobs: Add ability for service to specify its output type
Allows the ability to change the output type in case one service
requires a different output type.

NOTE: This should be considered a temporarily yet simple solution to a
specific problem: support for RTMP-like outputs.  This will allows
seamless integration of supporting different RTMP-like output types
within the same service.  This should probably be replaced with a more
ideal solution later, such as implementing a completely different
service type instead, when time permits.
2017-07-14 12:38:46 -07:00
jp9000
d839c77824 libobs: Add API to specify codec support on encoded outputs
(This commit also modifies obs-outputs)
2017-07-14 08:15:16 -07:00
cg2121
14d330c455 libobs: Add obs_volmeter_get_cur_db function 2017-07-01 19:06:58 -07:00
Jim
35474f5b72 Merge pull request #950 from Xaymar/patch_fix-log-stats
libobs: Fix an int underflow in log_frame_info
2017-07-01 10:50:37 -07:00
Shaolin
e5756a922a libobs/plugins/UI: Suppress unused variables warnings
Closes jp9000/obs-studio#937
2017-06-27 21:55:37 -07:00
adocilesloth
4c61ae9513 libobs: Add <> or \| on RT 102-key as hotkey
Closes jp9000/obs-studio#948
2017-06-27 21:35:52 -07:00
jp9000
8770453c09 libobs/util: Make minor optimization to circlebuf pops
If size is 0 after popping data from the front or back, set the
start/end points to 0 as well to ensure that any subsequent buffer
pushes start from the beginning of the buffer rather than the middle of
the buffer.  Reduces potential unnecessary operations in that case.

Additionally, this fixes a bug with circulebuf_pop_back where if start
position was 0, and all the data was popped off the buffer (equal to the
capacity), the end position would be equal to the original size.  As an
example to replicate the bug, push 5, pop 5, then push 10.  The
start/end points will be invalid.

Closes jp9000/obs-studio#954
2017-06-27 21:25:00 -07:00
mntone
a6938c11b0 UI, libobs: Add Japanese shortcut keys for Windows
Add Japanese shortcut keys, non-convert (無変換) and convert (変換) and
disable IME for OBSHotkeyEdit.

Closes jp9000/obs-studio#930
2017-06-27 18:14:48 -07:00
cg2121
fce078d997 UI, libobs: Add ability to lock individual scene items
Adds a lock checkbox to allow the user to lock a specific scene item.

Closes jp9000/obs-studio#949
2017-06-27 10:27:57 -07:00
jp9000
9ab0f26214 libobs: Fix bug where obs_data default might not be set
If a source is created with settings, default values would not be set on
data items that already had values set.  The check here was supposed to
be a not equal rather than an equal because you're not supposed to be
able to set a default value of one type on an item that already exists
but is of a different type.

This bug would make it so that if a particular setting was removed,
there would be no default value to fall back on, and it would always be
0 or NULL for all values.

It's likely this bug wasn't encountered until now because before now
there had been no reason to clear or remove settings on most things.
2017-06-26 17:10:20 -07:00
jp9000
1b62287109 libobs: Update version to 19.0.3 2017-06-21 00:13:33 -07:00
Michael Fabian Dirks
4e3e67bb8c libobs: Fix an int underflow in log_frame_info
I believe the issue with the next to impossible frame count to be an integer underflow, as in order to achieve those you'd have to have recorded for at least 345 days with 144 fps. So this commit fixes them by using a normal integer first and then deciding on the result if it should be used or be replaced with a 0.
2017-06-19 04:12:06 +02:00
Shaolin
cb9f767e45 libobs/plugins/UI: Suppress -Wimplicit-fallthrough introduced by GCC 7
Signed-off-by: Shaolin <admshao@gmail.com>
2017-05-29 21:05:18 -03:00
Ryan Foster
d6e43aefc4 libobs: Log *nix system info more like Windows/Mac
Rename "Processor" to "CPU Name" and place it before the number of
cores. Log free RAM for *nix. Log CPU Speed on Linux and FreeBSD. Unify
processor logging on Linux and FreeBSD. Get physical and logical cores
on *nix.

Use the new os_get_logical_cores and os_get_physical_cores function from
commits 6fc74d6 and e4a64f0 to get CPU core counts on *nix systems.
2017-05-26 22:54:12 -04:00
Ryan Foster
e4a64f0efa libobs/util: Fix *nix CPU core counts
Get logical and physical CPU cores on Linux and FreeBSD, even for
multi-core CPUs.
2017-05-26 00:30:36 -04:00
jp9000
83e7191f33 libobs: Update to version 19.0.2 2017-05-21 02:34:27 -07:00
jp9000
69dbb2c0bf libobs: Update version to 19.0.1 2017-05-20 14:27:17 -07:00
jp9000
a2953d1161 libobs: Fix bug where outputs would not set stopped event
When an output fails to connect and it's already been prematurely
stopped, the event to mark the output as stopped would not be signaled,
causing obs_output_destroy to lock up indefinitely while waiting for the
event to be signaled.
2017-05-20 13:11:59 -07:00
jp9000
87f14a1254 libobs: Always call stop callback
Rather than have the back-end try to determine whether the output can or
cannot stop, allow the stop callback to continue in the plugin either
way and let the plugin itself make that determination.

This fixes a bug where the back-end wouldn't have data active while
connecting, therefore the stop callback wouldn't be called, and once
connected it wouldn't know that it was supposed to stop.  In other words
trying to call obs_output_stop on an output that was in a state of
connecting would do nothing and the output would never stop.
2017-05-20 12:31:57 -07:00
jp9000
b8355c656c libobs/util: Also remove CR/LF from dstr_depad
Prevents newline characters from being included in things like stream
keys
2017-05-20 11:15:00 -07:00
jp9000
eb7fb990b7 libobs: Do not allow incompatible filters on sources
Fixes a potential issue where copying filters from one source to another
might add filters from the old source that are not compatible with the
new source.
2017-05-19 00:25:27 -07:00
jp9000
2348a1ce83 libobs: Make obs_source_default_render exported
Allows directly rendering a non-async source without going through
filters.
2017-05-16 17:29:04 -07:00
jp9000
3aef119240 libobs: Update to version 19.0.0 2017-05-16 13:49:54 -07:00
Richard Stanway
50f8a066b9
libobs: Add support for output error messages 2017-05-15 12:04:11 +02:00
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
d64542e10b Revert "libobs: Allow source to fully control source flags (for now)"
This reverts commit d85224bb9b.

Would cause other flags to stop saving.  Buffering needs to be split off
from the source flags.
2017-05-13 23:30:36 -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
9e466a4697 libobs/util: Add function to get free disk space 2017-05-13 01:21:14 -07:00
Richard Stanway
9e95b2eb6f
Various: Don't use boolean bitfields
Using bitfields causes less optimized code generation and the memory
savings are minimal as none of the objects are instantiated enough
times to be worth it.

See https://blogs.msdn.microsoft.com/oldnewthing/20081126-00/?p=20073
2017-05-10 23:28:46 +02:00
fryshorts
0527cb5c15 libobs: Fix os_safe_replace not working linux
Make sure the target file exists before attempting to create a backup.
This will allow for the function to work correctly if the target does
not yet exist.
2017-05-08 19:24:02 +02:00
jp9000
a81646ed9c libobs: Don't allow lagged frames to be counted as skipped
Prevents lagged frames (frames that took too long to render) to be
counted as skipped frames (frames that are skipped due to encoding
taking too long to process)
2017-05-06 11:29:32 -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
jp9000
ffef736640 libobs: Pass exact data when calling obs_get_video_info
Originally, obs_get_video_info would recreate the obs_video_info
structure that was originally passed to it from obs_reset_video.  This
changes that to just store a copy of the obs_video_info when calling
obs_reset_video, and then copying that to the parameter of
obs_get_video_info when called.
2017-05-06 11:29:28 -07:00
jp9000
6fc74d69a9 libobs: Add functions to get logical/physical cores 2017-05-06 11:29:27 -07:00
jp9000
829ec5be2d libobs: Fix skipped frames reporting
When frames are skipped the skipped frame count would increment, but the
total frame count would not increment, causing the percentage
calculation to fail.

Additionally, the skipped frames log reporting has been moved to
media-io/video-io.c instead of each output.
2017-05-06 11:29:25 -07:00
jp9000
7c6c7bc4c0 libobs: Add random shader
Strangely, to the "Solid" effect file.
2017-05-06 11:29:24 -07:00
jp9000
f9b5da513a libobs: Fix tex.Load lookup (needs int3, not int2)
libobs' shader language is basically HLSL, and tex.Load uses an int3 for
2D textures, with texture mipmap index for the last component.  This bug
bypassed testing because the front-end automatically switches to OpenGL
if D3D11 initialization fails, and when converted to GLSL, works fine
because texelFetch only requires two components.  This also means
there's a bug in GLSL shader conversion code, because it's essentially
ignoring the third component when it shouldn't be.
2017-05-06 10:39:42 -07:00
jp9000
e7f754df97 libobs: Use tex.Load for reverse NV12/I420 funcs
Eventually, most things should be replaced with Load where applicable
(though in some cases sub-pixel sampling is desired).

This commit also fixes a bug where NV12 async sources wouldn't render
correctly.
2017-05-06 01:24:45 -07:00
jp9000
2537f9a5e2 libobs/util: Use MoveFileEx with MOVEFILE_REPLACE_EXISTING
Ensures that it will replace an old file if it exists.
2017-05-04 18:44:15 -07:00
jp9000
ac2f792d50 libobs/util: Flush text files when writing
Helps prevent the possibility of an empty file from being written.
2017-05-04 18:24:00 -07:00
jp9000
6d3777129d libobs/util: Use os_safe_replace in safe file writes 2017-05-04 18:23:23 -07:00
jp9000
651d80c0df libobs/util: Add os_safe_replace function
Allows safely/atomically replacing a file and creating a backup of the
original.  The reason for adding this function is because Microsoft
provides a ReplaceFile function which does this in a single call.
2017-05-04 18:21:51 -07:00
jp9000
85a6d16258 libobs: Don't call unlink unnecessarily
A file rename will automatically replace the old file if an older file
exists, and will do so automatically.  Unlinking is unnecessary, and may
have a chance of preventing that move operation from being atomic.
2017-05-04 18:19:46 -07:00
jp9000
82d72803d6 libobs/util: Add Get function to BPtr<> 2017-05-04 05:46:29 -07:00
jp9000
6fcb77e165 libobs: Update to 18.0.2 (windows hotfix) 2017-05-02 00:50:07 -07:00
Ryan Foster
be98cee2a0 Fix various typos across multiple modules 2017-04-25 22:39:42 -04:00
Shaolin
e006d961a4 audio-monitoring: Add ability to monitor Outputs
(Note: This commits also modifies the linux-pulseaudio, mac-capture, and
win-wasapi plugins)

Do not prevent the targeted output device from being monitored if the
selected monitor output device is a different one.

Closes jp9000/obs-studio#872
2017-04-05 18:58:08 -07:00
Hugh Bailey ("Jim")
54805fe55d Merge pull request #870 from kkartaltepe/feature-free-type-data
libobs: Remove multiple calls to free_type_data
2017-04-03 21:28:34 -07:00
Kurt Kartaltepe
63688002a8 libobs: Remove multiple calls to free_type_data 2017-03-30 10:05:48 -05: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
jp9000
d85224bb9b libobs: Allow source to fully control source flags (for now)
This change prevents source flags from being incorrectly overwritten and
set to 0.  Eventually flags need to be separated from source settings
and this should be reverted, but for now this solves an issue where
buffering would be enabled on async video sources regardless of whether
the user disabled it or not on the source.
2017-03-28 09:19:01 -07:00
jp9000
dc4e205008 libobs: Delay stop detection of audio source
Delay the "audio stopped" detection by one audio tick to ensure that
audio doesn't get intentionally cut out in some situations
2017-03-28 09:19:00 -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
1355243697 libobs: Update to 18.0.1 2017-03-06 03:54:52 -08:00
jp9000
65ffb8800c libobs: Apply sync offset to win32 audio monitoring 2017-03-05 14:29:59 -08:00
Richard Stanway
64f62ad74a
libobs: Add missing mutex unlock in audio monitoring 2017-02-26 22:04:01 +01:00
jp9000
a5828610bb libobs: Fix bug where scenes would not properly mix audio 2017-02-26 08:20:54 -08:00
jp9000
4c2fac8e4c libobs: Update version to 18.0.0 2017-02-26 07:26:44 -08:00
Richard Stanway
8b640fae24
Fix various null pointer issues detected by Coverity 2017-02-25 16:45:45 +01:00
jp9000
7fba736df9 libobs/util: Use a mutex with config files 2017-02-21 23:03:18 -08:00
jp9000
528325578f libobs: Fix audio monitoring delaying perpetually
On windows, when a source has only audio (no video) yet is marked as
capable of both video and audio, it would be programmed to expect a
video frame to synchronize with.  This fixes that potential issue by
detecting whether any video is actually playing or not.
2017-02-21 10:59:02 -08: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
74f9c389cb libobs: Use original audio structure for audio signal
Ensures audio has the source-local timestamp when used with audio
monitoring.
2017-02-06 11:44:01 -08:00
jp9000
f728f5b9ec libobs: Mark parameter as constant if not modifying 2017-02-06 11:44:00 -08:00
jp9000
d60d222d71 libobs: Mark last video ts even when buffering off
Ensures that the system always has a record of when the last video frame
was played.
2017-02-06 11:43:59 -08:00
Take Vos
ab3531caa9 libobs: Add optional ultrawide -> wide scaling techniques
This algorithm reduces scaling distortion on the center of the image
when scaling from ultrawide to wide.

(Jim: edited effect files to prevent an impact in performance for
standard scaling.  Now effectively generates an extra pixel shader, and
the extra code is only applied to the DrawUndistort technique, while the
original Draw technique is unaffected due to the compiler automatically
removing unused code branches via the hard-coded boolean value)

From jp9000/obs-studio#762
2017-01-30 05:59:17 -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
Alexandre Vicenzi
1d5a5558ab libobs: Log correct amount of memory on 32bit (windows)
Closes jp9000/obs-studio#764
2017-01-24 11:28:52 -08:00
jp9000
841dfade55 libobs: Update to 17.0.2 2017-01-18 06:00:41 -08:00
jp9000
5f5582b87e libobs: Update to version 17.0.1 2017-01-17 09:20:49 -08:00
jp9000
b1707b18b2 libobs: Add callback for enumerating all scene children
Prevents infinite recursion when adding children to a scene.
2017-01-16 09:55:15 -08:00
jp9000
69ec87b9a5 libobs: Enumerate full tree when adding active child
Fixes a bug that would allow possible infinite recursion within a source
tree.  To fix this, inactive sources must be enumerated as well in order
to prevent infinite recursion.
2017-01-16 09:53:16 -08:00
jp9000
2877f1d553 libobs: Add func to enum active and inactive child tree 2017-01-16 09:53:08 -08:00
jp9000
3f976bec8b libobs: Fix scale filtering bug when duplicating scenes
When duplicating scenes, scene item scale filtering options would not be
preserved.
2017-01-15 09:15:44 -08:00
jp9000
93e084088f libobs: Update to version 17.0.0 2016-12-24 04:44:14 -08:00
jp9000
5cbd34df92 libobs: Eliminate an unnecessary allocation with captions 2016-12-24 03:45:19 -08:00
jp9000
fba152aed9 libobs: Fix bug in AVC encoder packet allocation
Meant to subtract the ref size, not add.  This is what one gets for
"clever" coding tricks.
2016-12-24 03:44:13 -08:00
jp9000
50773499a1 libobs: Create referenced parsed AVC encoder packet
When creating an encoder packet via obs_parse_avc_packet, make sure to
create a proper referenced encoder packet
2016-12-24 03:01:50 -08:00
jp9000
cd7bc32388 libobs: Fix caption encoder packet reallocation
Captions do something unusual with encoder packets: they reallocate them
due to appending extra h.264 data.  Due to the way allocations are
handled with core encoder packets (they now store a reference in their
data), instead of modifying the encoder data directly, create a new
encoder packet instead and release the old packet.
2016-12-24 03:01:49 -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
5868133587 libobs/util: Fix C++ compilation issue
When the C header circlebuf.h is used from a C++ source file, this
implicit cast from void to uint8_t* will cause an error unless changed
to an explicit cast.
2016-12-23 10:37:03 -08:00
jp9000
e71137534c libobs: Process all scene audio actions if no audio playing
When there are audio sources in a scene and they've all stopped playing
their audio (audio is pending), all scene item audio actions (volume
changes, toggling visibility) will perpetually buffer and no longer be
processed until audio plays again.

So instead of that, if all audio sources have stopped playing in the
scene, just process all pending scene item audio actions immediately to
prevent them from never being processed while waiting for a scene item
to start playing audio.
2016-12-22 00:31:11 -08:00
jp9000
521c40460e libobs: Fix bug drawing RGB/BGR async sources
Commit 53955301a2 introduced a async source texture copy bug due to
creating a new case in a switch without adding a break to the one above
it, causing it to execute both cases by mistake.
2016-12-21 20:11:31 -08:00
jp9000
f10e2c6740 libobs: Increase maximum audio tracks to 6 2016-12-21 17:13:19 -08:00
Autumin
0ff4feab02 libobs/graphics: Fix the 2D vector dot product func
The operators were unintentionally reversed.

Closes jp9000/obs-studio#724
2016-12-18 06:20:24 -08:00
jp9000
53955301a2 libobs: Fix line size issue when copying Y800 data 2016-12-17 22:53:52 -08:00
jp9000
919aecfd62 libobs: Fix format not being set for new source frames
With the previous Y800 fix a bug was introduced where the format for the
destination frame wouldn't be set if it wasn't Y800, causing a crash.
2016-12-17 21:56:10 -08:00
jp9000
85269fb5b2 libobs: Convert Y800 to RGBX manually
Because D3D11 specifically does not support an L8 texture format (you
have to use a shader swizzle), manually convert Y800 signals to RGBX
instead.  This also fixes a bug where Y800 signals will render red.

Closes jp9000/obs-studio#718
2016-12-17 19:58:01 -08:00
jp9000
e541e170a3 libobs: Fix possible reverse order mutex hard lock
For displays, instead of using the draw_callbacks_mutex and risk a
reverse mutual lock scenario, use a separate mutex to lock display size
data.

This bug was exposed when trying to reorder filters in the UI module.
The UI thread would try to reorder the filters, locking the filter mutex
of the source, and then the reorder would signal the UI to resize the
display, so the display would lock its draw_callbacks_mutex.  Then, in
the graphics thread, it would lock the display's draw_callbacks_mutex,
try to draw the source, and then the source would try to lock that same
filter mutex.

A mutex trace:
UI thread -> lock source filter mutex -> waiting on display mutex
graphics thread -> lock display mutex -> waiting on source filter mutex

Closes jp9000/obs-studio#714
2016-12-17 15:21:00 -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
eb6d8e10fa libobs/util: Do not ignore deprecation on windows
On MSVC, deprecated types/functions were being completely ignored by the
compiler due to this pragma.  Any plugins/programs that depended on this
would also have this warning disabled due to it being in this file.
This pragma was most likely originally done due to the MSVC warnings for
C-standard functions, which are now ignored via _CRT_SECURE_NO_WARNINGS
on all projects instead.
2016-12-08 03:27:38 -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
ec4317dd2b libobs: Fix bug where outputs cannot initialize hotkeys
When an output's context data is being created, it cannot register any
hotkeys because the output has not initialized its reference counting
capability.  This is due to the fact that when a hotkey is registered,
it creates a weak reference to the source/output/service/encoder.

The solution to this is to make sure the output's reference counter data
is created before calling the create callback.
2016-12-08 03:27:35 -08:00
jp9000
b277000f97 libobs/util: Add function to generate formatted filenames
(Note: This commit also modifies the UI)

Being able to generate file names based upon a specification is useful
for more than just the UI; it can also be useful for things such as the
replay buffer where file names need to be generated on the fly.
2016-12-08 03:27:34 -08:00
jp9000
3aa6b50fbe libobs/util: Add function to get circlebuf data offset
Allows getting pointer to an offset at a specific index within the
circlebuf data.  Useful for iterating through circlebuf data.
2016-12-08 03:27:33 -08:00
jp9000
cf2a05ed88 libobs: Update to 0.16.6 2016-11-14 22:20:23 -08:00
jp9000
4c2a49285e Revert "libobs: Ensure AVC priority is always highest for keyframes"
This reverts commit 66525632a0.
2016-11-14 17:43:37 -08:00
jp9000
66525632a0 libobs: Ensure AVC priority is always highest for keyframes 2016-11-13 16:29:06 -08:00
Jim
9982581a4f libobs: Ensure async source sizes are always reset
If an async source is cropped on one side, then when the program is
restarted and the source is loaded from file, the async source will
start out with a width/height of zero.  This will cause the async source
to not be drawn if cropping or scale filtering is added to the scene
item, because it has to be rendered to a texture first.  However, the
source cannot reset its size until it's drawn, so it leaves it in
perpetual state of having a 0x0 size.

This fixes that problem by ensuring that the async source size is always
reset even when not being rendered.

Close jp9000/obs-studio#686
2016-11-10 00:13:06 -08:00
Jim
ee5aecac01 Merge pull request #688 from reboot/fix_duplicating_scene_sources
libobs: Duplicate filters of a scene when it is is duplicated
2016-11-09 13:44:53 -08:00
Ryan Foster
d516a33c60 libobs: Add Windows bitness/arch to crash handler
Commit aa899c2 (PR #603) added Windows bitness/arch to regular logs.
This adds it to the crash logs.

Closes jp9000/obs-studio#690
2016-11-09 12:44:10 -08:00
Ryan Foster
788a1e22b7 libobs: Refactor check for Windows bitness/arch
Commit aa899c2 (PR #603) added logging for Windows bitness/arch, but it
was a bit incomplete/short-sighted.  It only added that information to
the regular logs.  This commit makes it easier to retrieve that
information for other purposes, like the crash handler.
2016-11-09 12:41:07 -08:00
jp9000
9adad2ebc2 libobs: Update to 0.16.5 2016-11-07 21:04:06 -08:00
Christoph Hohmann
a276b9023b libobs: Duplicate filters of a scene when it is is duplicated
When a scene is duplicated the filters on the scene were not copied to
the new scene. This causes that a temporary copy of a scene renders
differently in the program than in the preview when using studio mode.
2016-11-05 19:51:06 +01:00
jp9000
b77fdd7c9a libobs: Update to version 0.16.4 2016-11-04 05:54:02 -07:00
jp9000
5b44b1994e libobs: Update to version 0.16.3 2016-11-03 13:36:23 -07:00
Jim
7a077b311a Merge pull request #671 from reboot/fix_missing_profile_end
libobs: Fix missing call to profile_end() when encoding fails
2016-10-28 01:28:59 -07:00
jp9000
523e1ace49 libobs: Add date/time to crash handler 2016-10-27 18:39:13 -07:00
Christoph Hohmann
e775abaa71 libobs: Fix missing call to profile_end() when encoding fails
The do_encode() method does not call profile_end() when encoding fails
which causes an error message about mismatching names being logged.
2016-10-24 13:44:28 +02:00
jp9000
39a91d749c libobs/util: Add Get() function to CoTaskMemPtr 2016-10-23 09:20:54 -07:00
Jim
ad2550e060 Merge pull request #628 from RytoEX/master
libobs/util: Fix get_dll_ver not reporting DLL name
2016-10-09 19:46:21 -07:00
jp9000
580cfc1a95 libobs: Update to 0.16.2 2016-09-29 12:21:12 -07:00
jp9000
6d16c51cd1 libobs: Update to 0.16.1 2016-09-28 02:05:20 -07:00
jp9000
8b877f7c36 libobs/util: Fix fread_utf8 not working with files < 3 bytes
When it was checking for the BOM at the beginning of the file, it would
just return out of the function if it didn't read at least 3 bytes.
This would particularly affect text sources.
2016-09-28 02:01:30 -07:00
jp9000
8991fdc53e libobs: Update version to 0.16.0 2016-09-27 16:05:51 -07:00
Ryan Foster
87f4d586b0 libobs/util: Fix get_dll_ver not reporting DLL name
Follow-up to commit 2cf5c5f.
2016-09-24 14:14:53 -04: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
Ryan Foster
300dc8838d libobs: Add downscale filter to log 2016-09-23 00:18:06 -04:00
jp9000
2cf5c5f7f7 libobs/util: Fix get_dll_ver always getting kernel32 info 2016-09-19 17:52:20 -07:00
Ryan Foster
47aa56b3e9 libobs/util: Fix Windows 10 revision detection
Sometimes the revision number isn't put in to the kernel32.dll version
information.  It's best to use the registry in this case.
2016-09-19 17:52:19 -07:00
jp9000
c99f65a0df libobs: Add property functions to mod. int/double limits 2016-09-19 07:04:00 -07:00
jp9000
0bc0db1207 libobs/graphics: Add gs_draw_sprite_subregion function
Allows rendering only a subregion of a specific sprite.
2016-09-19 07:03:57 -07:00
jp9000
6b2862fe1e Revert "libobs/util: Add index operator to BPtr"
This reverts commit 7224e8d36e.

This change was unnecessary due to the fact that indexing is already
performed automatically via the cast operator.
2016-09-14 16:59:47 -07:00
jp9000
855381fc9e libobs: Add source capability flag for deprecation 2016-09-14 16:58:15 -07:00
jp9000
bc3944301f libobs: Allow forced stop even when already stopping
Allow outputs to force a stop even when already in the process of
stopping.  If for example a stream is heavily congested and taking a
very long time to stop, this allows frontends to give the users the
option to forcibly stop the stream to make it stop as quickly as
possible.
2016-09-09 17:39:18 -07:00
jp9000
988bbc6080 libobs: Add obs_module_get_string helper function
Allows getting a translated string for the current module, returning
false if no string available.
2016-09-06 22:01:49 -07:00
jp9000
7224e8d36e libobs/util: Add index operator to BPtr 2016-09-06 04:43:52 -07:00
Ryan Foster
aa899c2278 libobs: Log Windows bitness (32/64-bit) 2016-08-27 05:04:21 -04: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
Caitlin Potter
65e738e253 libobs: Set core signal handlers to NULL after destroying
Fixes https://obsproject.com/mantis/view.php?id=595
2016-08-21 21:00:07 -04:00
Colin Edwards
0c0f6031e2 libobs/util: Use FormatMessage on error when LoadLibrary fails
Outputting a human-readable error message on library load failure makes
it a little bit easier for plugin developers to determine why a plugin
library may have failed to load (such as missing dependency), rather
than having to look up the error code each time.

Closes jp9000/obs-studio#596
2016-08-19 17:04:44 -07:00
jp9000
d305343e8b libobs: Do not enum private sources with obs_enum_sources 2016-08-19 05:44:39 -07:00
jp9000
7d5df34a6b libobs: Do not set p-frames to highest priority
P-frames were initially set as highest priority to prevent them from
being dropped (not sure what the rationale was behind this), but this
caused a problem where if there's too much congestion for whatever
reason data will continue to stay buffered, so to prevent this p-frames
should be droppable.
2016-08-13 01:24:47 -07:00
jp9000
632f0bff5a libobs: Update to 0.15.4 2016-08-08 04:57:10 -07:00
jp9000
a576439f22 libobs/util: Fix possible null pointer dereference
Never checks to see whether the source dstr is empty before copying, and
will crash if empty.
2016-08-08 04:56:26 -07:00
jp9000
a818e60706 libobs: Update version to 0.15.3 2016-08-06 20:20:14 -07:00
jp9000
e284ffd896 libobs: Limit reconnect retry interval to 15 mins max
The retry interval seconds could grow exponentially large.  Limit it to
a maximum of 15 minutes between retry intervals.
2016-08-06 20:10:18 -07:00
jp9000
50aec61d39 libobs: Log whether user is running as administrator 2016-08-06 20:00:48 -07:00
jp9000
b9d67cbf4b libobs: Add function to log currently loaded modules 2016-08-05 18:59:33 -07:00
jp9000
526d390adb libobs: Reduce unnecessary logging (info -> debug)
(Note: This commit also modifies coreaudio-encoder, win-capture, and
win-mf modules)

This reduces logging to the user's log file.  Most of the things
specified are not useful for examining log files, and make reading log
files more painful.

The things that are useful to log should be up to the front-end to
implement.  The core and core plugins should have minimal mandatory
logging.
2016-08-05 18:59:32 -07:00
Michael Fabian Dirks
99b0acf4f0 libobs: Fix possible null pointer dereference 2016-08-02 21:04:55 +02:00
jp9000
ac4bd2aa80 libobs: Add long description to properties
Allows setting a "long" description for detailed explanation of certain
properties that may need them, but don't want to display them on the
user interface by default.
2016-07-20 08:09:45 -07:00
jp9000
cf983b7ccf libobs: Update version to 0.15.2 2016-07-15 13:06:11 -07:00
jp9000
6eec8dc90d libobs: Update version to 0.15.1 2016-07-10 00:47:52 -07:00
jp9000
58265e6950 libobs: Fix null pointer dereference
How this was replicated:
- Create new VLC video source
- Add video in its properties
- Press cancel on the properties dialog to reset the settings
2016-07-09 08:14:42 -07:00
jp9000
5fb9dcbaa7 libobs: Fix possible null pointer dereference 2016-07-09 07:41:13 -07:00
jp9000
4f4d7cde7e libobs/util: Add os_get_program_data_path* functions
Allows getting the system-local program data path.  Typically:

Windows:  C:\ProgramData
Mac:      /Library/Application Support
Linux:    /usr/local/share
2016-07-06 03:47:50 -07:00
jp9000
e29c7751e1 libobs: Update version to 0.15.0 2016-07-05 12:52:14 -07:00
jp9000
a9caa99c5b libobs: Fix source active/show incrementing/decrementing
The active_refs and show_refs variable would only increment/decrement
their children if their values were 1 and 0, which means that in the
case of scenes within scenes, sub-sources of scenes within scenes would
end up having the wrong ref values.
2016-07-02 14:13:17 -07:00
jp9000
4d61fa9a4c libobs: Use item texture if scene item is scene
Allows rendering scenes as scene items without off-screen sub-source of
the scene popping out on the sides.
2016-07-01 15:21:12 -07:00
jp9000
643823505c libobs: Fix obs_source_duplicate on scenes
Scenes have special duplication handling, so make it internally call
obs_scene_duplicate instead.
2016-07-01 15:20:27 -07:00
jp9000
364cb9fb03 libobs: Use strings instead of enums when saving scale data
Saves the scene item scale filters as strings instead of enums.  It's
important to save data in a form that won't break if an API enum
changes.
2016-06-29 08:19:23 -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
4dc0024198 libobs/graphics: Add ability to set shader texture sampler
(Note: This also modifies libobs-d3d11 and libobs-opengl)

Allows overriding the sampler for a specific shader parameter.
2016-06-29 04:15:38 -07:00
jp9000
f60952fe09 libobs: Add obs_data_item_get_name function
Allows getting the name of a data sub-item.
2016-06-28 02:52:15 -07:00
jp9000
a90c37987f libobs/graphics: Change BorderColor to just use number
Instead of prefixing the color with the '#' character, just take it as
an actual integer.
2016-06-28 02:46:35 -07:00
jp9000
d5e2cdf4d3 libobs/util: Add func to go to next CF token and copy it
Adds a function to the C-family parser to go to the next token and
create a string copy of it.  Useful for when you want to get a copy of
the next token regardless of what type it is.
2016-06-28 02:46:35 -07:00
Kurt Kartaltepe
7ef690d4e1 libobs: Fix obs-module.h typo
Fixes a small typo in the obs-module.h comments.

Closes jp9000/obs-studio#557
2016-06-27 18:14:42 -07:00
jp9000
5cc59256e7 libobs: Fix 'set but unused' warnings 2016-06-22 14:10:43 -07:00
jp9000
41277f6cac libobs: Fix 'may be uninitialized' warning 2016-06-22 14:10:43 -07:00
jp9000
b738f496b5 libobs: Forcibly stop output if stopped during reconnect
This fixes an design flaw where a delayed output would schedule a
stop even while in the process of reconnecting instead of just shutting
down right away.
2016-06-22 14:10:40 -07:00
jp9000
e13dd53376 libobs: Fix output shutdown order
When obs_output_actual_stop is called on shutdown, it should wait for
the output to fully stop before doing anything, and then it should wait
for the data capture to end.  The service should not be removed until
after the output has stopped, otherwise it could result in a possible
memory leak on stop.  Packets should be freed last.
2016-06-22 14:10:40 -07:00
jp9000
d7db0b8b01 (API Change) libobs: Fix output data cutoff on stop
(Note: This commit also modifies obs-ffmpeg and obs-outputs)

API Changed:
obs_output_info::void (*stop)(void *data);

To:
obs_output_info::void (*stop)(void *data, uint64_t ts);

This fixes the long-time design flaw where obs_output_stop and the
output 'stop' callback would just shut down the output without
considering the timing of when obs_output_stop was used, discarding any
possible buffering and causing the output to get cut off at an
unexpected timing.

The 'stop' callback of obs_output_info now takes a timestamp with the
expectation that the output will use that timestamp to stop output data
in accordance to that timing.  obs_output_stop now records the timestamp
at the time that the function is called and calls the 'stop' callback
with that timestamp.  If needed, obs_output_force_stop will still stop
the output immediately without buffering.
2016-06-22 14:10:39 -07:00
jp9000
29e849e355 libobs: Move output/encoder shutdown to independent thread
obs_output_end_data_capture could cause a hard lock due to mutex lock
ordering, depending on what thread it was called in.
2016-06-22 03:08:44 -07:00
jp9000
7018c6039d libobs: Do not allow output stop calls more than once 2016-06-22 03:08:43 -07:00
jp9000
ceb675f6df libobs: Use atomics for certain output boolean variables 2016-06-22 03:08:32 -07:00
jp9000
3d53cf3a6c libobs: Store system timestamp DTS on packets 2016-06-20 02:28:52 -07:00
jp9000
9948eee6c2 libobs/util: Add function to get path extension 2016-06-15 16:18:56 -07:00
jp9000
aa88b323aa libobs: Do not draw transitions if size 0 2016-06-15 16:18:43 -07:00
jp9000
b5df4537a9 libobs: Fix null pointer dereference w/ null private sources 2016-06-11 12:27:05 -07:00
jp9000
03b2ca65cf libobs: Only lock audio meter/fader when accessing data
Fixes an issue where the audio meter/fader would call an obs function
and lock another mutex, potentially causing a mutual inverted lock in
another thread.
2016-06-11 11:36:46 -07:00
jp9000
fb1ff173f9 libobs: Fix crash with 4:2:0 async source resolutions
When using GPU conversion for 4:2:0 frames on async video sources, it
would create a texture bigger than necessary and try to copy too much
data from the frame, resulting in a crash.
2016-06-06 23:46:56 -07:00
jp9000
695278dd42 libobs/util: Do not append .so w/ .dylibs on OSX 2016-06-06 23:46:55 -07:00
jp9000
1c37200549 libobs/util: Check for null pointer before calling dlclose
Apparently dlclose can crash if you use it with a null pointer.
2016-05-30 16:03:01 -07:00
hwdro
e3847109be libobs/graphics: Add SSE intrinsics for matrix4_transpose 2016-05-26 22:13:01 -07:00
hwdro
017d77b399 libobs/graphics: Remove redundant variable assignment 2016-05-26 22:12:54 -07:00
jp9000
07a26b1720 libobs: Add more editable list types
(Note: This commit also modifies the UI)

The editable list only had two types: A type that allows both files and
URLS, and a type that only allows strings.

This changes it so the editable list can have a "files only" type, a
"files and URLs" type, and a "strings only" type.
2016-05-26 10:55:51 -07:00
jp9000
cb9ce7547d libobs: Fix bug activating/showing transitions in a tree
When a transition is a sub-source of another source, it would not call
the transition's active source enum function, meaning that any sources
the transition had would not increment their active/showing refs (it
would only be called when activating the transition directly before).
That would result in negative/invalid active/showing refs on its
sub-sources, causing them to become permanently active/inactive and/or
permanently showing/hidden.
2016-05-26 08:13:21 -07:00
jp9000
0c5fd7a0fb libobs/graphics: Always load gif frame if needed
Under certain circumstances it's necessary to seek, but if the frame
isn't loaded for the position that's being seeked to, it won't update
the texture.  This just ensures the texture will update when seeking.
2016-05-26 08:13:21 -07:00
jp9000
fe62658c69 libobs: Recalculate transition transforms when starting
If custom transforms were used, the very first frame after starting
would always render with the previous transform before calculating the
new transform.
2016-05-24 07:30:42 -07:00
jp9000
2f6a10c93f libobs: Fix log message about max memory on 32bit
Sometimes windows will report 2 gigs instead of 4 gigs max.
2016-05-24 07:30:41 -07:00
jp9000
ddc7484a6e libobs: Fix rendering of transitions with fixed sizes
If a transition had a fixed size, it would not render itself or its
sub-sources according to that fixed size.  The fixed size value was
essentially being ignored.
2016-05-24 07:30:41 -07:00
jp9000
9a295a188f libobs: Render transition sub-sources w/ matrix
When a transition is not in the state of transitioning from one source
to another, it would not use the sub-source's assigned matrix to render.
2016-05-24 07:30:40 -07:00
jp9000
1ca1502518 libobs: Set projection matrix for transition renders
This fixes a bug where the sub-sources on a transition wouldn't render
with the expected size when the transition had a different size from its
sub-sources
2016-05-24 07:30:40 -07:00
jp9000
c5008e9c65 libobs: Update version to 0.14.2 2016-05-13 23:00:07 -07:00
jp9000
2741624fbe libobs: Log when a filter is added/removed from a source 2016-05-04 20:29:26 -07:00
jp9000
3cb36bbd51 libobs: Fix deinterlacing discarding flipped status
When rendering the deinterlaced surface, it would not take in to account
whether the async surfaces were marked as flipped or not.
2016-05-01 16:56:21 -07:00
jp9000
7af9c2d882 libobs: Don't prematurely stop transition audio
Transition audio was programmed to stop if there is no queued audio from
both sources.  Because of that, when a source's audio started after the
transition started, it would cause audio from the source to be excluded
from the transition until the transition had completed because the audio
had already been marked as stopped.

Instead, if there's no audio from the transition sources, the audio
should only be marked as stopped when video has stopped.  This allows
the to/from sources to have an opportunity to start/restart audio during
the transition safely.
2016-05-01 15:22:27 -07:00
jp9000
853ec3cba0 libobs: Update to 0.14.1 2016-04-24 16:40:58 -07:00
jp9000
84ce1076f1 libobs: Fix field order of retro/linear 2x shaders
The field orders of retro 2x and linear 2x deinterlace shaders were
inverted.  Note that yadif 2x does not act the same in this regard, its
field ordering is correct due to how it operates.
2016-04-24 01:21:30 -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
737a66cb39 libobs: Update version to 0.14.0 2016-04-21 06:19:21 -07:00
jp9000
8a9f1bc7c1 libobs: Fix discard/retro deinterlace equations 2016-04-20 20:13:49 -07:00
jp9000
82a7d795db libobs: Always prune excessive starting audio packets
On outputs that use already-active video/audio encoder, the audio
pruning to sync up audio packets with video packets doesn't always get
called (for example if the video pruning function was called).  Always
prune excess starting audio packets.
2016-04-20 20:13:49 -07:00