mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 06:38:57 +00:00
qcap: Directly pass a VIDEOINFOHEADER pointer to the get_media_type() operation.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
82abcec541
commit
6de7c227ed
|
@ -47,7 +47,8 @@ struct video_capture_funcs
|
||||||
HRESULT (*check_format)(struct video_capture_device *device, const AM_MEDIA_TYPE *mt);
|
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);
|
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);
|
void (*get_format)(struct video_capture_device *device, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format);
|
||||||
HRESULT (*get_media_type)(struct video_capture_device *device, unsigned int index, AM_MEDIA_TYPE *mt);
|
HRESULT (*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 (*get_caps)(struct video_capture_device *device, LONG index, AM_MEDIA_TYPE *mt,
|
||||||
VIDEOINFOHEADER *format, VIDEO_STREAM_CONFIG_CAPS *caps);
|
VIDEOINFOHEADER *format, VIDEO_STREAM_CONFIG_CAPS *caps);
|
||||||
LONG (*get_caps_count)(struct video_capture_device *device);
|
LONG (*get_caps_count)(struct video_capture_device *device);
|
||||||
|
|
|
@ -216,7 +216,7 @@ static void v4l_device_get_format(struct video_capture_device *device, AM_MEDIA_
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT v4l_device_get_media_type(struct video_capture_device *device,
|
static HRESULT v4l_device_get_media_type(struct video_capture_device *device,
|
||||||
unsigned int index, AM_MEDIA_TYPE *mt)
|
unsigned int index, AM_MEDIA_TYPE *mt, VIDEOINFOHEADER *format)
|
||||||
{
|
{
|
||||||
unsigned int caps_count = (device->current_caps) ? 1 : device->caps_count;
|
unsigned int caps_count = (device->current_caps) ? 1 : device->caps_count;
|
||||||
|
|
||||||
|
@ -224,9 +224,16 @@ static HRESULT v4l_device_get_media_type(struct video_capture_device *device,
|
||||||
return VFW_S_NO_MORE_ITEMS;
|
return VFW_S_NO_MORE_ITEMS;
|
||||||
|
|
||||||
if (device->current_caps)
|
if (device->current_caps)
|
||||||
return CopyMediaType(mt, &device->current_caps->media_type);
|
{
|
||||||
|
*mt = device->current_caps->media_type;
|
||||||
return CopyMediaType(mt, &device->caps[index].media_type);
|
*format = device->current_caps->video_info;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*mt = device->caps[index].media_type;
|
||||||
|
*format = device->caps[index].video_info;
|
||||||
|
}
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __u32 v4l2_cid_from_qcap_property(VideoProcAmpProperty property)
|
static __u32 v4l2_cid_from_qcap_property(VideoProcAmpProperty property)
|
||||||
|
|
|
@ -658,7 +658,20 @@ static HRESULT source_get_media_type(struct strmbase_pin *pin,
|
||||||
unsigned int index, AM_MEDIA_TYPE *mt)
|
unsigned int index, AM_MEDIA_TYPE *mt)
|
||||||
{
|
{
|
||||||
struct vfw_capture *filter = impl_from_strmbase_pin(pin);
|
struct vfw_capture *filter = impl_from_strmbase_pin(pin);
|
||||||
return capture_funcs->get_media_type(filter->device, index, mt);
|
VIDEOINFOHEADER *format;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!(format = CoTaskMemAlloc(sizeof(*format))))
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
if ((hr = capture_funcs->get_media_type(filter->device, index, mt, format)) != S_OK)
|
||||||
|
{
|
||||||
|
CoTaskMemFree(format);
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
mt->cbFormat = sizeof(VIDEOINFOHEADER);
|
||||||
|
mt->pbFormat = (BYTE *)format;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
|
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
|
||||||
|
|
Loading…
Reference in a new issue