Commit Graph
259 Commits
Author SHA1 Message Date
PatTheMavandRyan Foster aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.

By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
2022-03-26 09:44:23 -04:00
Norihiro KamaeandJim ba68eda590 obs-ffmpeg: Use av_packet_alloc instead of av_init_packet
sizeof(AVPacket) being a part of the public ABI is deprecated. once
av_init_packet() is removed, new packets will only be able to be
allocated with av_packet_alloc().
In ffmpeg-mux, ffmpeg-vaapi, and obs-ffmpeg-nvenc, AVPacket is allocated
at the initialization to avoid frequent allocation of AVPacket.

Includes changes to win-dshow.
2022-03-24 17:19:40 -07:00
PatTheMav 49e9d49943 plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
jpark37andJim c7c52a59f9 win-dshow: Fix hwdevice_ctx leak 2022-03-05 15:02:23 -08:00
jp9000 490c6214f0 virtualcam-module: Revert changes since 27.1.3 (for now)
This reverts commit 4b0767741a,
3f3f9ed7e6,
0e7c17bd6e, and
865eecb739.
2022-03-02 17:35:36 -08:00
jp9000 4b0767741a virtualcam-module: Prevent placeholder memory leak 2022-03-02 05:06:12 -08:00
jp9000 2026270b65 virtualcam-module: Only initialize placeholder once 2022-03-02 05:06:12 -08:00
jp9000 3f3f9ed7e6 virtualcam-module: Fix incorrect correct res/fps
Apparently the testing that was done was not sufficient enough or did
not check all test cases, so resolution/fps does not get set properly on
the virtualcam.
2022-03-02 04:19:02 -08:00
jp9000 0e7c17bd6e virtualcam-module: Remove unnecessarily inlines 2022-02-27 22:26:10 -08:00
jp9000 865eecb739 virtualcam-module: Stop thread on Stop call
This causes the thread to only start when the IMediaFilter::Run/Pause
calls have been made, and stop whenever either the IMediaFilter::Stop
call has been made, or on destruction, whichever comes first.

This potentially will work around a suspected race condition that
appears to be in the WebRTC library where the filter's library will be
released while the filter is in the process of being destroyed, which
can take longer than usual if the join takes too long. Basically, fixes
a reported crash (that doesn't appear to technically be our fault) when
the filter is used with browsers when the virtualcam is deactivating in
web browsers.
2022-02-27 22:23:41 -08:00
jpark37andJim 847eebc648 win-dshow: Fix wrong AVCodecContext free call 2022-02-27 04:38:30 -08:00
jpark37andJim 2e1d9e8e64 win-dshow: Add hardware decode status to log 2022-02-27 02:40:09 -08:00
jpark37andJim 42fad9b2b4 win-dshow: Add hardware decode toggle
Off by default because it can be buggy, or overburden the GPU.
2022-02-26 15:31:48 -08:00
jp9000 0dbae4ebef win-dshow: Ensure thread is joinable before joining
This may have been the issue behind the reported firefox crashes, but
strangely, the thread should always be joinable here because it's
explicitly always created in the constructor and joined in the
destructor.
2022-02-23 04:13:38 -08:00
Translation UpdaterandTranslation Updater ac8dbf67be Update translations from Crowdin 2022-02-06 02:24:08 +00:00
ChrisandJim 306e23292d win-dshow: Log buffered state 2022-01-29 15:14:58 -08:00
jpark37andJim 9f41531541 win-dshow: Use OBS_SOURCE_FRAME_LINEAR_ALPHA
This flag leads to a cheaper technique, "Draw" instead of
"DrawNonlinearAlpha", and all the paths are opaque anyway.
2022-01-29 15:10:53 -08:00
Matt Gajownik 3900ae0974 libdshowcapture: Add P010 support 2022-01-11 10:40:01 +11:00
hellowandaandJim a01a01f752 win-virtualcam: Make sure virtualcam output thread safe 2021-12-18 07:14:47 -08:00
JimandGitHub 91a9688d9f Merge pull request #5501 from RytoEX/fix-ffmpeg-deprecations
Fix FFmpeg deprecations up to FFmpeg 4.4 and current FFmpeg git
2021-12-17 01:16:35 -08:00
Translation UpdaterandTranslation Updater 062de2c998 Update translations from Crowdin 2021-12-17 08:01:29 +00:00
Translation UpdaterandTranslation Updater 261345f9ef Update translations from Crowdin 2021-12-12 02:38:59 +00:00
Matt Gajownik 9c01b1ecc8 libdshowcapture: Add FindPin, RGB24, & use CMake instead of pragma
This updates the libdshowcapture submodule to the latest commit.
This also changes win-dshow CMakeList to ensure compatibility.

Full commit list:
 - Add support of RGB24 format
 - CMake: Add Win32 libs instead of pragma directives.
 - Implement FindPin
 - Simplify error handling
 - Fix log level of DebugHR
 - Use default constructor instead of empty function
 - Use std::move instead of copy where appropriate
 - Mark some strings as const
2021-12-12 11:35:48 +11:00
Ryan Foster 6d1433f228 win-dshow: Use AVFrame.pts instead of AVFrame pkt_pts
AVFrame.pkt_pts was deprecated in FFmpeg commit 32c8359093d1 dated June
21, 2016 for lavc 57.24.0 (FFmpeg 3.2). AVFrame.pkt_pts was replaced by
AVFrame.pts, and it was removed in FFmpeg commit 6e30b35b85b8 [2] on
April 27, 2021. Ubuntu 18.04 has the oldest FFmpeg version we support,
FFmpeg 3.4. We should be able to safely migrate from AVFrame.pkt_pts to
AVFrame.pts.

[1]: https://github.com/FFmpeg/FFmpeg/commit/32c8359093d1ff4f45ed19518b449b3ac3769d27
[2]: https://github.com/FFmpeg/FFmpeg/commit/6e30b35b85b81c802e52a1078ec7a3097e353c6d
2021-11-21 11:30:02 -05:00
VainockandJim 11a690b038 Update translations from Crowdin 2021-09-24 09:42:08 -07:00
Thomas SchnitzlerandJim 22f5e68121 win-dshow: Don't buffer Elgato Facecam device by default
Buffering should be disabled for Elgato Facecam in "Auto-detect" mode to
prevent latency changes over time
2021-09-20 18:42:36 -07:00
Richard Stanway 4bf81e9bf6 win-dshow: Avoid redundant string conversions
We were going from wstring -> wchar_t * -> wstring. Issue detected by
PVS Studio.
2021-08-18 23:45:11 +02:00
Richard Stanway 486380e2c3 win-dshow: Use constant references for resolution check
Avoids unnecessary creation of a new VideoDevice. Issue detected by
PVS Studio.
2021-08-18 23:45:08 +02:00
TranslationandJim ef2b1eb1c6 Update translations from Crowdin 2021-06-11 07:18:15 -07:00
Gol-D-Ace 90df8d44df Update translations from Crowdin 2021-05-30 20:33:35 +02:00
Matt Gajownik 2a7fd297e4 win-dshow: Add support for ASUS coupled audio 2021-05-01 13:53:37 +10:00
Richard Stanway 47fcbdb0c9 win-dshow: Fix virtual camera CPU usage, add more comments
My previous commits would rescale the placeholder for output on every
frame which was not CPU efficient. Now we store a copy of the scaled
placeholder and update it any time the resolution / FPS / format
changes.

A new function GetOutputBufferSize was added to allow calculating the
output size when needed. The existing code assumed a 12-bit format if
the placeholder didn't load, which could cause grey / green output.

An optimization was made to only load and scale the placeholder once
the virtual output starts, as many applications load and unload the
filter multiple times during enumeration of devices.

Various comments were also added to help clarify how the filter works.
2021-04-15 03:11:33 +02:00
jp9000 a79b6d6f79 win-dshow: Fix libdshowcapture formatting 2021-04-06 12:00:12 -07:00
jp9000 b479d60917 win-dshow/libdshowcapture: Update to 0.8.7 2021-04-04 01:37:29 -07:00
Richard StanwayandJim c5f06a2837 win-dshow: Fix crashing when using a custom vcam placeholder
The scaler assumed the placeholder was the same size as the camera which
caused crashes if the user replaced the placeholder with a smaller
resolution image (or if the camera was potentially running at > 1080p).
This adds a separate scaler for the placeholder and uses the resolution
of the virtual camera instead of defaulting to 1080p.
2021-03-31 02:36:16 -07:00
Richard Stanway 6424901120 win-dshow: Check return value of ReadFile 2021-03-23 03:15:07 +01:00
Richard Stanway 45643adb03 win-dshow: Check return values for memory allocation functions
Since some of these run inside the virtual cam module, we should be a
good guest and not crash the host process if we run out of memory.
2021-03-23 03:07:22 +01:00
Richard Stanway 670156db8b win-dshow: Fix incorrect variable used in condition 2021-03-23 02:49:44 +01:00
Richard Stanway 5c8587eab3 win-dshow: Don't call DisableThreadLibraryCalls in virtualcam
Per MSDN: Do not call this function from a DLL that is linked to the static C
run-time library (CRT). The static CRT requires DLL_THREAD_ATTACH and
DLL_THREAD_DETATCH notifications to function properly.
2021-03-23 02:49:44 +01:00
wangshaohuiandJim f316762a2a win-dshow: Fix memory leak caused by using incorrect API 2021-03-22 13:59:22 -07:00
Andrés BarreiroandJim c83273cc72 win-dshow: Add autorotation toggle 2021-02-07 21:12:48 -08:00
jp9000 dffa822112 win-dshow: Fix dshowcapture not linking audio of certain devices 2021-01-04 07:02:53 -08:00
Gol-D-Ace 7368a2c7cc Update translations from Crowdin 2020-12-14 00:29:44 +01:00
Gol-D-Ace 7ab98ca00f Update translations from Crowdin 2020-11-25 20:11:39 +01:00
jp9000 18a73c9a45 win-dshow: Add support for YUY2 in virtualcam 2020-11-14 04:25:39 -08:00
jp9000 4b3639972b win-dshow: Fix virtualcam crash and reference bug
Fixes a null pointer dereference in the output filter, and fixes a bug
where the output filter would incorrectly hold a reference to the filter
graph.
2020-10-30 01:55:55 -07:00
jp9000 7a2d64d00a win-dshow: Fix decoupled audio with EVGA/magewell
EVGA/magewell devices seem to use the default system drivers rather than
custom drivers, which causes their audio to become decoupled and treated
as completely separate devices rather than as an audio pin on the video
device. Basically, this would cause those devices to not have audio by
default, and force the user to have to manually select the audio, which
is bad user experience.

We already had a workaround for this with elgato devices, so expand that
code to become a whitelist of devices, and include EVGA/magewell
devices.
2020-10-04 10:07:12 -07:00
Gol-D-Ace c66ebde080 Update translations from Crowdin 2020-09-27 23:07:27 +02:00
Matt Gajownik ccd1ef2bd0 win-dshow: Set current working directory in VirtualCam scripts 2020-09-15 19:58:02 +10:00
jp9000 e86b8241f3 win-dshow: Fix bug determining closest audio config
This fixes the remaining bugs that were still present when trying to fix
audio-related crashes with AJA devices.
2020-09-07 18:05:54 -07:00