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

235 Commits

Author SHA1 Message Date
Vainock
11a690b038 Update translations from Crowdin 2021-09-24 09:42:08 -07:00
Thomas Schnitzler
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
Translation
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 Stanway
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
wangshaohui
f316762a2a win-dshow: Fix memory leak caused by using incorrect API 2021-03-22 13:59:22 -07:00
Andrés Barreiro
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
jp9000
072a886453 win-dshow: Add "activate" proc to proc handler 2020-09-07 16:12:50 -07:00
jp9000
57c21e3cb9 win-dshow: Fix 24bit audio not being detected correctly 2020-09-07 15:26:01 -07:00
jp9000
1538b6909f win-dshow: Fix AJA devices crashing 2020-09-07 14:14:40 -07:00
Jim
86147d9719
Merge pull request #3415 from jpark37/default-color-space
Unify color space settings as 709
2020-09-07 13:29:44 -07:00
jpark37
b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
Joel Bethke
a94ede6d00 win-dshow: Add VirtualCam installer scripts
This adds two batch scripts to install and uninstall the virtual cam
devices for installations where the installer could not be used.  Most
commonly, this is for portable installations or those who prefer the
.zip file.
2020-09-06 18:04:44 -07:00
jp9000
da8192544b win-dshow: Use cmake-based GUID for virtualcam 2020-09-06 17:04:06 -07:00
Richard Stanway
288a84dc95 win-dshow: Add file description for virtual camera DLL 2020-08-29 03:04:44 +02:00
Richard Stanway
21fb1e770e win-dshow: Use constant reference for virtualcam CLSID 2020-08-29 02:46:03 +02:00
Richard Stanway
4c08c7bfa4 win-dshow: Reduce size of virtualcam placeholder image 2020-08-29 02:42:03 +02:00
jp9000
3691dc536d win-dshow: Fix virtual camera filter name
The filter name is supposed to be "OBS Virtual Camera"
2020-07-20 14:22:49 -07:00
Clayton Groeneveld
f4223ad061 win-dshow: Fix virtual camera enable bug 2020-07-20 06:02:16 -05:00
jp9000
6377fe3177 win-dshow: Add Virtual Camera (Windows)
The virtual camera adds the ability to use the output of OBS itself as a
camera that can be selected within other Windows applications.  This is
very loosely based upon the catxfish virtual camera plugin design.

There is a shared memory queue, but instead of having 10-20 frames in
the queue, there are now only 3 frames in the queue to minimize latency
and reduce memory usage.  The third frame is mostly to ensure that
writing does not occur on the same frame being read; the delay is merely
one frame at all times.

The frames of the shared memory queue are NV12 instead of YUYV, which
reduces the memory and data copied, as well as eliminate unnecessary
conversion from NV12.  Some programs (such as chrome, which uses webrtc
to capture) do not support NV12 however, so an I420 conversion is
provided, which is far less expensive than YUYV.  The CPU cost of NV12
-> I420 is negligible in comparison.

The virtual camera filter itself is based upon the output filter within
the libdshowcapture library, which was originally implemented for other
purposes.  This is more ideal than the Microsoft example code because
for one, it's far less convoluted, two, allows us to be able to
customize the filter to our needs a bit more easily, and three, has much
better RAII.  The Microsoft CBaseFilter/etc code comprised of about 30
source files, where as the output filter comprises of two or three
required source files which we already had, so it's a huge win to
compile time.

Scaling is avoided whenever possible to minimize CPU usage.  When the
virtual camera is activated in OBS, the width, height, and frame
interval are saved, that way if the filter is activated, it will always
remember the last OBS resolution/interval that the virtual camera was
activated with, even if OBS is not active.  If for some reason the
filter activates before OBS starts up, and OBS starts up with a
different resolution, it will use simple point scaling intermittently,
and then will remember the new scaling in the future.  The scaler could
use some optimization.  FFmpeg was not opted for because the FFmpeg DLLs
would have to be provided for both architectures, which would be about
30 megabytes in total, and would make writing the plugin much more
painful.  Thus a simple point scaling algorithm is used, and scaling is
avoided whenever possible.

(If another willing participant wants to have a go at improving the
scaling then go for it.  But otherwise, it avoids scaling whenever
possible anyway, so it's not a huge deal)
2020-07-07 06:09:59 -07:00
jp9000
7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
Colin Edwards
55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
Gol-D-Ace
d74fc65047 Update translations from Crowdin 2020-03-16 20:14:50 +01:00
jp9000
40817331d3 win-dshow: Fix rotation not working in all cases 2020-03-07 06:48:07 -08:00
jp9000
07089873fc win-dshow: Add support for devices that relay rotation
Adds support for devices that can relay rotation, such as the Logitech
StreamCam.
2020-03-01 03:42:46 -08:00
jpark37
9eeef48b5a win-dshow: Fix upside-down RGB DIBs
Fix regression to RGB DIB orientation according to MSDN.
2020-01-13 21:50:54 -08:00
jpark37
3f58810b0e libdshowcapture: Update to latest submodule 2019-12-08 14:52:00 -08:00
Jim
c36e3fbc92
Merge pull request #2196 from jpark37/ffmpeg-mjpeg-spam
win-dshow: Suppress MJPEG error spam
2019-11-29 20:48:40 -08:00
jpark37
f685322a0f win-dshow: Suppress MJPEG error spam
Only print the first message for this known benign error.
2019-11-24 23:59:27 -08:00
Clayton Groeneveld
82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
jpark37
f896c773e8 win-dshow: Support bottom-up DIBs
The biHeight field can be negative, leading to crashes on some cards
like VisionRGB-E1S. Adding flip support is fairly straightforward.

There also appears to be a hack to automatically flip for RGB formats,
but I wish to remove it because it seems to fight with this change. We
already have a separate vertical flip checkbox to deal with non
compliant behavior.
2019-11-12 17:59:59 -08:00