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

qcap: Pass a single AM_MEDIA_TYPE pointer to get_format().

parent 8ad37074
...@@ -50,7 +50,7 @@ struct video_capture_device_ops ...@@ -50,7 +50,7 @@ struct video_capture_device_ops
void (*destroy)(struct video_capture_device *device); void (*destroy)(struct video_capture_device *device);
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);
HRESULT (*get_format)(struct video_capture_device *device, AM_MEDIA_TYPE **mt); HRESULT (*get_format)(struct video_capture_device *device, AM_MEDIA_TYPE *mt);
HRESULT (*get_caps)(struct video_capture_device *device, LONG index, AM_MEDIA_TYPE **mt, VIDEO_STREAM_CONFIG_CAPS *caps); HRESULT (*get_caps)(struct video_capture_device *device, LONG index, AM_MEDIA_TYPE **mt, VIDEO_STREAM_CONFIG_CAPS *caps);
LONG (*get_caps_count)(struct video_capture_device *device); LONG (*get_caps_count)(struct video_capture_device *device);
HRESULT (*get_prop_range)(struct video_capture_device *device, VideoProcAmpProperty property, HRESULT (*get_prop_range)(struct video_capture_device *device, VideoProcAmpProperty property,
......
...@@ -212,15 +212,11 @@ static HRESULT v4l_device_set_format(struct video_capture_device *iface, const A ...@@ -212,15 +212,11 @@ static HRESULT v4l_device_set_format(struct video_capture_device *iface, const A
return S_OK; return S_OK;
} }
static HRESULT v4l_device_get_format(struct video_capture_device *iface, AM_MEDIA_TYPE **mt) static HRESULT v4l_device_get_format(struct video_capture_device *iface, AM_MEDIA_TYPE *mt)
{ {
struct v4l_device *device = v4l_device(iface); struct v4l_device *device = v4l_device(iface);
*mt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); return CopyMediaType(mt, &device->current_caps->media_type);
if (!*mt)
return E_OUTOFMEMORY;
return CopyMediaType(*mt, &device->current_caps->media_type);
} }
static __u32 v4l2_cid_from_qcap_property(VideoProcAmpProperty property) static __u32 v4l2_cid_from_qcap_property(VideoProcAmpProperty property)
......
...@@ -223,16 +223,18 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt) ...@@ -223,16 +223,18 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt)
return hr; return hr;
} }
static HRESULT WINAPI AMStreamConfig_GetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE **pmt) static HRESULT WINAPI AMStreamConfig_GetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE **mt)
{ {
VfwCapture *filter = impl_from_IAMStreamConfig(iface); VfwCapture *filter = impl_from_IAMStreamConfig(iface);
HRESULT hr; HRESULT hr;
TRACE("filter %p, mt %p.\n", filter, pmt); TRACE("filter %p, mt %p.\n", filter, mt);
hr = filter->device->ops->get_format(filter->device, pmt); if (!(*mt = CoTaskMemAlloc(sizeof(**mt))))
if (SUCCEEDED(hr)) return E_OUTOFMEMORY;
strmbase_dump_media_type(*pmt);
if (SUCCEEDED(hr = filter->device->ops->get_format(filter->device, *mt)))
strmbase_dump_media_type(*mt);
return hr; return hr;
} }
......
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