[PATCH v2 3/7] qcap: Make video capture functions CDECL.

Zebediah Figura z.figura12 at gmail.com
Thu Nov 26 22:34:32 CST 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/qcap/qcap_private.h | 26 ++++++++++++++------------
 dlls/qcap/v4l.c          | 24 ++++++++++++------------
 2 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/dlls/qcap/qcap_private.h b/dlls/qcap/qcap_private.h
index 046821142d2..7c27c689677 100644
--- a/dlls/qcap/qcap_private.h
+++ b/dlls/qcap/qcap_private.h
@@ -44,21 +44,23 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
 
 struct video_capture_funcs
 {
-    struct video_capture_device *(*create)(USHORT index);
-    void (*destroy)(struct video_capture_device *device);
-    HRESULT (*check_format)(struct video_capture_device *device, const AM_MEDIA_TYPE *mt);
-    HRESULT (*set_format)(struct video_capture_device *device, const AM_MEDIA_TYPE *mt);
-    void (*get_format)(struct video_capture_device *device, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format);
-    HRESULT (*get_media_type)(struct video_capture_device *device,
+    struct video_capture_device *(CDECL *create)(USHORT index);
+    void (CDECL *destroy)(struct video_capture_device *device);
+    HRESULT (CDECL *check_format)(struct video_capture_device *device, const AM_MEDIA_TYPE *mt);
+    HRESULT (CDECL *set_format)(struct video_capture_device *device, const AM_MEDIA_TYPE *mt);
+    void (CDECL *get_format)(struct video_capture_device *device, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format);
+    HRESULT (CDECL *get_media_type)(struct video_capture_device *device,
             unsigned int index, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format);
-    void (*get_caps)(struct video_capture_device *device, LONG index, AM_MEDIA_TYPE *mt,
+    void (CDECL *get_caps)(struct video_capture_device *device, LONG index, AM_MEDIA_TYPE *mt,
             VIDEOINFOHEADER *format, VIDEO_STREAM_CONFIG_CAPS *caps);
-    LONG (*get_caps_count)(struct video_capture_device *device);
-    HRESULT (*get_prop_range)(struct video_capture_device *device, VideoProcAmpProperty property,
+    LONG (CDECL *get_caps_count)(struct video_capture_device *device);
+    HRESULT (CDECL *get_prop_range)(struct video_capture_device *device, VideoProcAmpProperty property,
             LONG *min, LONG *max, LONG *step, LONG *default_value, LONG *flags);
-    HRESULT (*get_prop)(struct video_capture_device *device, VideoProcAmpProperty property, LONG *value, LONG *flags);
-    HRESULT (*set_prop)(struct video_capture_device *device, VideoProcAmpProperty property, LONG value, LONG flags);
-    BOOL (*read_frame)(struct video_capture_device *device, BYTE *data);
+    HRESULT (CDECL *get_prop)(struct video_capture_device *device,
+            VideoProcAmpProperty property, LONG *value, LONG *flags);
+    HRESULT (CDECL *set_prop)(struct video_capture_device *device,
+            VideoProcAmpProperty property, LONG value, LONG flags);
+    BOOL (CDECL *read_frame)(struct video_capture_device *device, BYTE *data);
 };
 
 #endif
diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c
index 5783dca4197..fe153a5c4b5 100644
--- a/dlls/qcap/v4l.c
+++ b/dlls/qcap/v4l.c
@@ -118,7 +118,7 @@ static int xioctl(int fd, int request, void * arg)
     return r;
 }
 
-static void v4l_device_destroy(struct video_capture_device *device)
+static void CDECL v4l_device_destroy(struct video_capture_device *device)
 {
     if (device->fd != -1)
         video_close(device->fd);
@@ -148,7 +148,7 @@ static const struct caps *find_caps(struct video_capture_device *device, const A
     return NULL;
 }
 
-static HRESULT v4l_device_check_format(struct video_capture_device *device, const AM_MEDIA_TYPE *mt)
+static HRESULT CDECL v4l_device_check_format(struct video_capture_device *device, const AM_MEDIA_TYPE *mt)
 {
     TRACE("device %p, mt %p.\n", device, mt);
 
@@ -202,7 +202,7 @@ static HRESULT set_caps(struct video_capture_device *device, const struct caps *
     return S_OK;
 }
 
-static HRESULT v4l_device_set_format(struct video_capture_device *device, const AM_MEDIA_TYPE *mt)
+static HRESULT CDECL v4l_device_set_format(struct video_capture_device *device, const AM_MEDIA_TYPE *mt)
 {
     const struct caps *caps;
 
@@ -216,13 +216,13 @@ static HRESULT v4l_device_set_format(struct video_capture_device *device, const
     return set_caps(device, caps);
 }
 
-static void v4l_device_get_format(struct video_capture_device *device, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format)
+static void CDECL v4l_device_get_format(struct video_capture_device *device, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format)
 {
     *mt = device->current_caps->media_type;
     *format = device->current_caps->video_info;
 }
 
-static HRESULT v4l_device_get_media_type(struct video_capture_device *device,
+static HRESULT CDECL v4l_device_get_media_type(struct video_capture_device *device,
         unsigned int index, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format)
 {
     unsigned int caps_count = (device->current_caps) ? 1 : device->caps_count;
@@ -261,7 +261,7 @@ static __u32 v4l2_cid_from_qcap_property(VideoProcAmpProperty property)
     }
 }
 
-static HRESULT v4l_device_get_prop_range(struct video_capture_device *device, VideoProcAmpProperty property,
+static HRESULT CDECL v4l_device_get_prop_range(struct video_capture_device *device, VideoProcAmpProperty property,
         LONG *min, LONG *max, LONG *step, LONG *default_value, LONG *flags)
 {
     struct v4l2_queryctrl ctrl;
@@ -282,7 +282,7 @@ static HRESULT v4l_device_get_prop_range(struct video_capture_device *device, Vi
     return S_OK;
 }
 
-static HRESULT v4l_device_get_prop(struct video_capture_device *device,
+static HRESULT CDECL v4l_device_get_prop(struct video_capture_device *device,
         VideoProcAmpProperty property, LONG *value, LONG *flags)
 {
     struct v4l2_control ctrl;
@@ -301,7 +301,7 @@ static HRESULT v4l_device_get_prop(struct video_capture_device *device,
     return S_OK;
 }
 
-static HRESULT v4l_device_set_prop(struct video_capture_device *device,
+static HRESULT CDECL v4l_device_set_prop(struct video_capture_device *device,
         VideoProcAmpProperty property, LONG value, LONG flags)
 {
     struct v4l2_control ctrl;
@@ -337,7 +337,7 @@ static void reverse_image(struct video_capture_device *device, LPBYTE output, co
     }
 }
 
-static BOOL v4l_device_read_frame(struct video_capture_device *device, BYTE *data)
+static BOOL CDECL v4l_device_read_frame(struct video_capture_device *device, BYTE *data)
 {
     while (video_read(device->fd, device->image_data, device->image_size) < 0)
     {
@@ -388,7 +388,7 @@ static void fill_caps(__u32 pixelformat, __u32 width, __u32 height,
     caps->pixelformat = pixelformat;
 }
 
-static void v4l_device_get_caps(struct video_capture_device *device, LONG index,
+static void CDECL v4l_device_get_caps(struct video_capture_device *device, LONG index,
         AM_MEDIA_TYPE *type, VIDEOINFOHEADER *format, VIDEO_STREAM_CONFIG_CAPS *vscc)
 {
     *vscc = device->caps[index].config;
@@ -396,12 +396,12 @@ static void v4l_device_get_caps(struct video_capture_device *device, LONG index,
     *format = device->caps[index].video_info;
 }
 
-static LONG v4l_device_get_caps_count(struct video_capture_device *device)
+static LONG CDECL v4l_device_get_caps_count(struct video_capture_device *device)
 {
     return device->caps_count;
 }
 
-struct video_capture_device *v4l_device_create(USHORT index)
+struct video_capture_device * CDECL v4l_device_create(USHORT index)
 {
     struct v4l2_frmsizeenum frmsize = {0};
     struct video_capture_device *device;
-- 
2.29.2




More information about the wine-devel mailing list