Commit d4ded92b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

qcap: Move v4l2 support to a new Unix library.

parent 8bcb4466
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(qcap); WINE_DEFAULT_DEBUG_CHANNEL(qcap);
static HINSTANCE qcap_instance; HINSTANCE qcap_instance;
static LONG objects_ref = 0; static LONG objects_ref = 0;
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "wine/strmbase.h" #include "wine/strmbase.h"
#include "wine/unicode.h" #include "wine/unicode.h"
extern HINSTANCE qcap_instance DECLSPEC_HIDDEN;
extern DWORD ObjectRefCount(BOOL increment) DECLSPEC_HIDDEN; extern DWORD ObjectRefCount(BOOL increment) DECLSPEC_HIDDEN;
HRESULT audio_record_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT audio_record_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
...@@ -59,6 +61,4 @@ struct video_capture_funcs ...@@ -59,6 +61,4 @@ struct video_capture_funcs
BOOL (*read_frame)(struct video_capture_device *device, BYTE *data); BOOL (*read_frame)(struct video_capture_device *device, BYTE *data);
}; };
extern const struct video_capture_funcs v4l_funcs;
#endif #endif
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#define BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD /* work around ioctl breakage on Android */ #define BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD /* work around ioctl breakage on Android */
#include "config.h" #include "config.h"
...@@ -47,7 +51,11 @@ ...@@ -47,7 +51,11 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "initguid.h"
#include "qcap_private.h" #include "qcap_private.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL(qcap); WINE_DEFAULT_DEBUG_CHANNEL(qcap);
...@@ -558,17 +566,12 @@ const struct video_capture_funcs v4l_funcs = ...@@ -558,17 +566,12 @@ const struct video_capture_funcs v4l_funcs =
.read_frame = v4l_device_read_frame, .read_frame = v4l_device_read_frame,
}; };
#else NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out)
static struct video_capture_device *v4l_device_create(USHORT index)
{ {
ERR("v4l2 was not present at compilation time.\n"); if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
return NULL;
}
const struct video_capture_funcs v4l_funcs = *(const struct video_capture_funcs **)ptr_out = &v4l_funcs;
{ return STATUS_SUCCESS;
.create = v4l_device_create, }
};
#endif /* defined(VIDIOCMCAPTURE) */ #endif /* HAVE_LINUX_VIDEODEV2_H */
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include "qcap_private.h" #include "qcap_private.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL(qcap); WINE_DEFAULT_DEBUG_CHANNEL(qcap);
...@@ -839,7 +840,7 @@ static const IAMVideoControlVtbl IAMVideoControl_VTable = ...@@ -839,7 +840,7 @@ static const IAMVideoControlVtbl IAMVideoControl_VTable =
static BOOL WINAPI load_capture_funcs(INIT_ONCE *once, void *param, void **context) static BOOL WINAPI load_capture_funcs(INIT_ONCE *once, void *param, void **context)
{ {
capture_funcs = &v4l_funcs; __wine_init_unix_lib(qcap_instance, DLL_PROCESS_ATTACH, NULL, &capture_funcs);
return TRUE; return TRUE;
} }
...@@ -850,7 +851,7 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out) ...@@ -850,7 +851,7 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out)
static const WCHAR source_name[] = {'O','u','t','p','u','t',0}; static const WCHAR source_name[] = {'O','u','t','p','u','t',0};
struct vfw_capture *object; struct vfw_capture *object;
if (!InitOnceExecuteOnce(&init_once, load_capture_funcs, NULL, NULL)) if (!InitOnceExecuteOnce(&init_once, load_capture_funcs, NULL, NULL) || !capture_funcs)
return E_FAIL; return E_FAIL;
if (!(object = CoTaskMemAlloc(sizeof(*object)))) if (!(object = CoTaskMemAlloc(sizeof(*object))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment