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

1353 Commits

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