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

2630 Commits

Author SHA1 Message Date
jp9000
619edf5e7d libobs: Add pointer to obs_data_item name
Rather than have to look up the string each time, just add a pointer to
the string. Still all stored in the same memory though.
2023-03-18 10:46:28 +01:00
derrod
1fd50a9324 libobs: Add obs_reset_source_uuids 2023-03-12 01:11:38 +01:00
derrod
29db52ad27 libobs: Save/Load source UUID in scene item data 2023-03-12 01:11:38 +01:00
derrod
30519768ad libobs: Add UUIDs to obs_source objects 2023-03-12 01:11:38 +01:00
derrod
f72cc4498f libobs: Add os_generate_uuid() to platform utils 2023-03-12 01:11:38 +01:00
derrod
4b062a7147 libobs: Add functions for getting/saving pretty JSON 2023-03-10 23:55:42 +01:00
derrod
75693a6682 libobs: Write default values to config 2023-03-07 17:44:19 -05:00
pkv
a0a23e8a18 libobs: Fix leak with empty path in stats
If the recording path is left empty in Settings, a leak can occur in
window-basic-stats.cpp because a bmalloc is called for a size 1.
This fixes the leak by checking against the path in the
os_get_free_disk_space function.

Signed-off-by: pkv <pkv@obsproject.com>
2023-03-04 16:23:07 -08:00
Richard Stanway
2468268569 libobs: Hold async mutex when calling set_async_texture_size
Calling set_async_texture_size without holding async_mutex is dangerous
as cur_async_frame could be changed / freed by another thread.
2023-03-04 16:10:19 -08:00
Richard Stanway
01786a3f11 libobs: Disable encoder scaling request if it matches output size
It was possible to set the encoder to scale the video to the same size
as the output, resulting in unnecessary passes through swscale and
skipping hardware encoders. This was a common user error in Advanced
Output mode where they would tick the rescale box but leave it at the
same resolution as their main output.
2023-03-04 15:14:42 -08:00
Chris (Flaeri)
0eb496e8cf libobs/media-io: Add color range and space to conversion
By adding the range data we can get successful handling of full range
color via custom FFmpeg output. Previously it would always default to 0
which would yield partial/limited output. Without the colorspace info
the output file is correctly tagged, but not undergone the actual
conversion.
2023-03-03 21:48:09 +00:00
Richard Stanway
5b193bca55
libobs/util: Fix typo in curl revocation support check 2023-03-02 19:36:31 +01:00
derrod
f9cce334d2 libobs: Add copy constructor for ComQIPtr 2023-03-01 20:39:53 +01:00
pkv
2e79d4c902 obs-ffmpeg: Fix for FFmpeg 6 deprecating a flag
Also modifies libobs & deps/media-playback.
AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 [1].
We ifdef the code depending on it to allow compilation.

[1] avcodec: remove FF_API_FLAG_TRUNCATED
3ceffe7839

Signed-off-by: pkv <pkv@obsproject.com>
2023-03-01 13:23:51 -05:00
PatTheMav
e23455dc74 libobs: Fix device functions not marked as EXPORT
As clang and gcc use "default" visibility (as in "not hidden") when
no visibility is specified, all functions are implicitly exported.

When changing default visibility to "hidden", the corresponding symbols
are not exposed anymore and linking fails. This PR updates all
functions signatures that were added in recent commits but not set to
be EXPORTed.

Also makes required OpenGL imports for texture sharing on macOS
mandatory.
2023-03-01 12:02:33 -05:00
derrod
a9d3b9cbd1 libobs: Clarify memalign ToDo item 2023-03-01 11:18:47 -05:00
derrod
a5468cfee0 libobs: Make wcs<->utf8 conversion consistent
On Windows NULL characters would be included in the output if insize is
non-zero, but on *nix it would abort on the first NULL.
2023-02-28 18:36:18 -08:00
Frank
20a3ec4a2f libobs: Fix scene_audio_render() incorrectly mixing audio
When the `pos` variable is non-zero, audio does not get mixed correctly.
This is due to the fact that the `pos` variable was erroneously being
applied to the input rather than the output.
2023-02-25 19:25:15 -08:00
CodeYan01
d2dd917721 docs: Fix layout and typos 2023-02-26 10:31:02 +11:00
Kurt Kartaltepe
bc9eee922e libobs: Fix pulseaudio monitoring, once and for all
This makes multiple changes to resolve issues with monitoring. We have
added a number of things over time to resolve various issues due to our
misunderstanding of the pulse api and the explicitly wrong pulse api
documentation.

First is removing the prior stream write tracking. Write tracking
was incorrect as pulse sends you the total number of bytes it wants
written at that time and not a incremental, but also this write tracking
is unhelpful since we can just let begin_write signal when we should
stop writing.

Second removing underflow tracking, this sort of worked to detect high
latency sources like vlc which buffer ~1s of data before writing audio
data. It worked because it would grow the buffer in PA until we could
write enough data into it, but it didn't allow us to leverage that
larger buffer because we never paused the PA stream.

To solve the buffering/high latency issue instead start the PA stream
corked and only uncork it once we have enough data to reach the targeted
latency. We also check how much data we recieve from the source and if
it appears to be high latency providing us with much more data than our
target latency we increase the latency to match the source. Fixing the
VLC source issue and resulting in a smooth start to audio instead of
underruns while we play and increase latency.

Finally add some handling for pulses incorrectly documented API. Notably
that begin_write may request more or less data from you so handle both
cases. And stop attempting to use attr.maxlength which is not updated
after set_buffer_attr calls and was always -1, and tlength is just more
appropriate.

old mantis resulting in some changes, still fixed. https://obsproject.com/mantis/view.php?id=1076
fixes #7574
2023-02-25 15:13:08 -08:00
PatTheMav
76732846d7 libobs: Fix non-exhaustive switch statements
New video formats introduced for ProRes 4444 encoding have not been
implemented in function calls used for video decoding, which makes the
switch statements non-exhaustive.

This does not functionally change the status quo (decoding ProRes 4444
files could still be broken because libobs does not explicitly handle
the colour format).
2023-02-23 20:32:52 +01:00
jpark37
463bf0dff5 libobs,UI: Add P216/P416 pixel formats
Will be useful for ProRes.
2023-02-21 18:48:44 +01:00
jpark37
0efaf88caf libobs: Add PQ/HLG support for I210/I412 formats
Seen when playing back ProRes files.
2023-02-21 18:48:44 +01:00
PatTheMav
db3a01db6b libobs: Remove unused variables 2023-02-18 15:22:33 -08:00
PatTheMav
fb7a9edadc libobs: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
Richard Stanway
c57a291316 libobs: Convert security product name to UTF-8 for logging
Co-Authored-By: gkvjwa <285794886@qq.com>
2023-02-15 15:36:13 -05:00
Richard Stanway
7178124da9 libobs: Fix typo in function name 2023-02-15 13:40:13 -05:00
tuduweb
e36163ce89 libobs/media-io: Correctly check codec tag compatibility for out stream 2023-02-15 18:21:09 +01:00
tytan652
cb6b5cc249 libobs: Add desktop environment to Linux log 2023-02-11 16:19:12 -08:00
tytan652
eacc246584 libobs: Add Flatpak info logging 2023-02-11 16:19:12 -08:00
Norihiro Kamae
ee6ddeeaed libobs: Avoid position underflow when mixing audio sources
When a variable `pos` became larger than `AUDIO_OUTPUT_FRAMES`, `count`
will get overflowed number. To avoid the overflow, continue the loop
when `AUDIO_OUTPUT_FRAMES - pos` is not positive.
2023-02-11 15:22:17 -08:00
Jim
1f469e4f7c libobs/media-io: Add get_total_audio_size()
get_audio_size() gets the size of individual planes.
get_total_audio_size() gets the size if you include all planes.
2023-02-05 02:55:24 -08:00
jp9000
2ff210acfd libobs: Update version to 29.0.2 2023-02-04 02:17:49 -08:00
Jim
5d3943ab48 libobs: Update version to 29.0.1 2023-01-31 22:58:37 -08:00
Norihiro Kamae
2b4bc03b4c libobs/graphics: Remove unused macros for inputs 2023-01-28 19:03:55 -08:00
Norihiro Kamae
d18a6f1039 libobs/graphics: Remove unused macros
The macros BOUNDS_MAX_X, BOUNDS_MAX_Y, and BOUNDS_MAX_Z are never used
and they are never defined how to use.
2023-01-28 19:03:55 -08:00
Barnabás Pőcze
5810571e53 libobs: Close display when destroying X11 hotkey platform
Currently, the X11 display is leaked when the X11 hotkey
platform is destroyed. Fix that by calling XCloseDisplay()
to free it.

Fixes: bcb04bb800 ("libobs: Open a separate X11 connection for hotkeys")
2023-01-25 13:56:50 -05:00
jpark37
792f8473ee libobs: Fix SDR async video on non-SDR targets
Bug was seen when projecting SDR video capture on WCG displays.
2023-01-24 19:39:42 -08:00
Jan Beich
c082c4a74d libobs/graphics: Enable DMABUF on FreeBSD and DragonFly
Required under Wayland (wlrobs) on FreeBSD and DragonFly. DMABUF was
already partially exposed after c50c625555.
2023-01-24 11:50:13 -05:00
tt2468
018ce16703 libobs: Fix loading of custom_size for empty scenes
Previously, `custom_size` was checked at the end of the `scene_load`
function. If the scene contained no "items" array, the `custom_scene`
loading code would never be run.

This moves the `custom_size` code above the return statement.
2023-01-22 10:26:47 +11:00
tytan652
678b0287e6 libobs: Calm stringop-overflow warning on GCC
Those warnings appeared with GCC 12 with -O2, those are potentially
created by regression from GCC.
2023-01-19 13:08:46 -05:00
tytan652
c648222332 libobs,libobs-opengl,obs-ffmpeg-mux: Calm deprecation warnings on *nix
Calm libobs-opengl deprecation warnings on macOS.

Calm FFmpeg deprecation warning with LIBAVFORMAT_VERSION_MAJOR < 59.
2023-01-19 13:08:46 -05:00
tytan652
ca896dbce7 media-io: Fix FF_API_BUFFER_SIZE_T not being defined on Ubuntu 20.04 2023-01-19 13:08:46 -05:00
tytan652
b0c1c9c86c libobs,plugins: Remove individual -Wno-switch 2023-01-19 13:08:46 -05:00
John Bradley
61284cf9ba libobs: Refactor obs-output encoded use of mixes
There was quite a bit of conflated usage of mixes (which refers
to raw audio) and encoder counts. This fully separates the two
and makes a distinct separation when iterating over mixes vs
encoders.
2023-01-18 11:54:20 -08:00
John Bradley
d70171daa6 libobs: Make internal version of remove encoder 2023-01-18 11:54:20 -08:00
tt2468
25df3e183e libobs: Fix logging of remaining views
OBS has been logging `1 views remain at shutdown` when in reality there
are not technically any views remaining. When views are removed, the
view itself is destroyed immediately, but the mix remains, to be
garbage collected by the graphics thread.

In this case, the view has already been removed, but the graphics
thread has not run an interation and cleaned up the mix, so this
log message appears.

Fixes the issue by checking if a mix actually has an assigned view,
instead of blindly logging existing mixes.
2023-01-18 12:17:35 -06:00
tt2468
c69e40734d libobs: Prevent encoders from initializing/starting if no media is set
This fixes a case of undefined behavior, where encoders can try to init
or start without actually having any video_t or audio_t object
assigned.
2023-01-18 12:17:35 -06:00
tt2468
7e30d3f8a2 libobs: Remove unused internal encoder util function
Was previously introduced in a0f679bc40,
but has since been made unused.
2023-01-18 12:17:35 -06:00
tt2468
eb0d9dc5d2 libobs: Allow sending NULL to obs_encoder_set_video/audio()
There is currently no way to clear a video_t or audio_t object from an
encoder once applied. `audio_t`/`video_t` objects can be destructed at
any time, and it is dangerous to prevent these object references from
even being cleared.

This does not fix the issue where destroying an audio/video object does
not clear the reference from all subscribed encoders.
2023-01-18 12:17:35 -06:00