Skip to content

Commit 09d87f4

Browse files
committed
Version 0.2.0
Fix video scaling
1 parent e293bc5 commit 09d87f4

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/droidcam.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1 VERSIONINFO
2-
FILEVERSION 0,1,2,0
2+
FILEVERSION 0,2,0,0
33
BEGIN
44
BLOCK "StringFileInfo"
55
BEGIN
@@ -11,7 +11,7 @@ BEGIN
1111
VALUE "OriginalFilename", "droidcam-virtual-output.dll"
1212
VALUE "ProductName", "DroidCam"
1313
VALUE "ProductVersion", "7"
14-
VALUE "LegalCopyright", "DEV47APPS, 2022"
14+
VALUE "LegalCopyright", "DEV47APPS, 2025"
1515
END
1616
END
1717

src/plugin.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ QAction *auto_start_action;
3838
QAction *tools_menu_action;
3939
#endif
4040

41-
const char *PluginVer = "012";
41+
const char *PluginVer = "020";
4242
const char *PluginName = "DroidCam Virtual Output";
4343
obs_output_t *droidcam_virtual_output = NULL;
4444
config_t *obs_config = NULL;
@@ -176,11 +176,16 @@ static void video_conversion(droidcam_output_plugin *plugin) {
176176

177177
float src_ar = (float) src_w / (float) src_h;
178178
float dst_ar = (float) dst_w / (float) dst_h;
179+
180+
float h_ar = (float)dst_h / (float)src_h;
181+
float w_ar = (float)dst_w / (float)src_w;
182+
179183
if (abs(src_ar - dst_ar) < 0.01f) {
180184
// same aspect ratio
181185
shift_x = 0;
182186
shift_y = 0;
183-
} else if ((src_h - dst_h) > (src_w - dst_w)) {
187+
188+
} else if (h_ar < w_ar) {
184189
const int dst_w0 = dst_w;
185190
dst_w = dst_h * src_w / src_h;
186191
shift_x = (dst_w0 - dst_w) / 2;
@@ -199,7 +204,7 @@ static void video_conversion(droidcam_output_plugin *plugin) {
199204
dst_w &= ~1;
200205
dst_h &= ~1;
201206

202-
ilog("video scaling: %dx%d -> %dx%d -> %dx%d at %d,%d",
207+
ilog("video scaling: %dx%d -> %dx%d inside %dx%d at %d,%d",
203208
src_w, src_h, dst_w, dst_h,
204209
plugin->webcam_w, plugin->webcam_h,
205210
shift_x, shift_y);

0 commit comments

Comments
 (0)