Skip to content

Commit f34484c

Browse files
committed
Version 0.2.2
Removed 9:16 options Initial arm64 support (beta)
1 parent 9d19ce4 commit f34484c

4 files changed

Lines changed: 67 additions & 24 deletions

File tree

src/droidcam.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
1 VERSIONINFO
2-
FILEVERSION 0,2,1,0
2+
FILEVERSION 0,2,2,0
33
BEGIN
44
BLOCK "StringFileInfo"
55
BEGIN
66
BLOCK "040904B0"
77
BEGIN
88
VALUE "CompanyName", "DEV47APPS"
9-
VALUE "FileDescription", "OBS Virtual Output Plugin"
9+
VALUE "FileDescription", "Virtual Output Plugin for OBS"
1010
VALUE "InternalName", "droidcam-virtual-output.dll"
1111
VALUE "OriginalFilename", "droidcam-virtual-output.dll"
1212
VALUE "ProductName", "DroidCam"

src/plugin.cc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2022 DEV47APPS, github.com/dev47apps
2+
Copyright (C) 2025 DEV47APPS, github.com/dev47apps
33
44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -24,21 +24,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2424

2525
#if DROIDCAM_OVERRIDE==0
2626

27-
#if LIBOBS_API_MAJOR_VER==28
28-
#include <QtGui/QAction>
29-
#else
30-
#include <QtWidgets/QAction>
31-
#endif
32-
#include <QtWidgets/QMenu>
33-
#include <QtWidgets/QMessageBox>
34-
#include <QtWidgets/QMainWindow>
27+
#include <QAction>
28+
#include <QMenu>
29+
#include <QMessageBox>
30+
#include <QMainWindow>
3531
#include "obs-frontend-api.h"
3632

3733
QAction *auto_start_action;
3834
QAction *tools_menu_action;
3935
#endif
4036

41-
const char *PluginVer = "021";
37+
const char *PluginVer = "022";
4238
const char *PluginName = "DroidCam Virtual Output";
4339
obs_output_t *droidcam_virtual_output = NULL;
4440
config_t *obs_config = NULL;
@@ -570,8 +566,9 @@ bool obs_module_load(void) {
570566
obs_data_release(obs_settings);
571567

572568
#else
569+
blog(LOG_INFO, "[droidcam-virtual-output] module loaded release %s", PluginVer);
573570

574-
obs_config = obs_frontend_get_global_config();
571+
obs_config = obs_frontend_get_profile_config();
575572
config_set_default_bool(obs_config, "DroidCamVirtualOutput", "AutoStart", false);
576573

577574
QMainWindow *main_window = (QMainWindow *)obs_frontend_get_main_window();

src/structs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#define CONTROL 0x02020101
66
#define MAX_WIDTH 3860
77
#define MAX_HEIGHT 2160
8-
#define DEF_WIDTH 640
9-
#define DEF_HEIGHT 480
8+
#define DEF_WIDTH 1280
9+
#define DEF_HEIGHT 720
1010

1111
#define RGB_BUFFER_SIZE(w,h) (w*h*3)
1212

src/yuv420_yuyv.c

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717
#include <stdint.h>
1818

19-
#ifdef _MSC_VER
20-
#if (defined(_M_AMD64) || defined(_M_X64) || (_M_IX86_FP == 2))
21-
#define __SSE2__ // MSVC does not have __SSE2__ macro
22-
#endif
23-
#include <emmintrin.h>
24-
#else
25-
#include <x86intrin.h>
19+
#if defined(__aarch64__) || defined(_M_ARM64)
20+
#define HAVE_NEON 1
21+
#include <arm_neon.h>
22+
23+
#elif defined(_MSC_VER)
24+
/* MSVC */
25+
#if defined(_M_AMD64) || defined(_M_X64) || \
26+
(defined(_M_IX86_FP) && (_M_IX86_FP == 2))
27+
#define HAVE_SSE2 1
28+
#include <emmintrin.h>
29+
#endif
30+
31+
#elif defined(__x86_64__)
32+
/* GCC / Clang */
33+
#if defined(__SSE2__)
34+
#define HAVE_SSE2 1
35+
#include <x86intrin.h>
36+
#endif
37+
2638
#endif
2739

2840
void map_yuv420_yuyv(uint8_t** data, uint32_t *linesize, uint8_t* dst,
@@ -50,7 +62,7 @@ void map_yuv420_yuyv(uint8_t** data, uint32_t *linesize, uint8_t* dst,
5062
}
5163

5264
// Each row N and N+1 use the same UV values (4:2:0 -> 4:2:2)
53-
#ifdef __SSE2__
65+
#if HAVE_SSE2
5466
if (is_aligned_128b)
5567
{
5668
for (int y = 0; y < (height>>1); ++y) {
@@ -65,7 +77,6 @@ void map_yuv420_yuyv(uint8_t** data, uint32_t *linesize, uint8_t* dst,
6577
__m128i yuv0 = _mm_unpacklo_epi8(y, uv); \
6678
__m128i yuv1 = _mm_unpackhi_epi8(y, uv); \
6779
_mm_stream_si128((__m128i*)(dst + (x<<1)), yuv0); \
68-
\
6980
_mm_stream_si128((__m128i*)(dst + (x<<1) + 16), yuv1); \
7081
} \
7182
if (shift_x) dst += shift_x2;
@@ -83,10 +94,45 @@ void map_yuv420_yuyv(uint8_t** data, uint32_t *linesize, uint8_t* dst,
8394

8495
return;
8596
}
97+
#elif HAVE_NEON
98+
if (is_aligned_128b)
99+
{
100+
for (int y = 0; y < (height>>1); ++y) {
101+
#define CONVERT_ROW \
102+
if (shift_x) dst += shift_x; \
103+
for (int x = 0; x < width; x += 16) { \
104+
uint8x16_t yq = vld1q_u8(src_y + x); \
105+
uint8x8_t u8 = vld1_u8(src_u + (x >> 1)); \
106+
uint8x8_t v8 = vld1_u8(src_v + (x >> 1)); \
107+
/*interleave u and v */ \
108+
uint8x8x2_t uvz = vzip_u8(u8, v8); \
109+
/* combine into one 16-byte vector */ \
110+
uint8x16_t uvq = vcombine_u8(uvz.val[0], uvz.val[1]); \
111+
/* interleave Y and UV bytes */ \
112+
uint8x16x2_t yuv = vzipq_u8(yq, uvq); \
113+
vst1q_u8(dst + (x << 1), yuv.val[0]); \
114+
vst1q_u8(dst + (x << 1) + 16, yuv.val[1]); \
115+
} \
116+
if (shift_x) dst += shift_x2;
117+
118+
CONVERT_ROW
119+
dst += linesize_dst;
120+
src_y += linesize[0];
121+
122+
CONVERT_ROW
123+
dst += linesize_dst;
124+
src_y += linesize[0];
125+
src_u += linesize[1];
126+
src_v += linesize[2];
127+
}
128+
129+
return;
130+
}
86131
#else // not __SSE2__
87132
(void) is_aligned_128b;
88133
#endif
89134

135+
#undef CONVERT_ROW
90136
for (int y = 0; y < (height>>1); y++) {
91137
#define CONVERT_ROW \
92138
if (shift_x) dst += shift_x; \

0 commit comments

Comments
 (0)