Commit ba63b9a5 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Better implement Video Processor MFT.

parent 4031786f
......@@ -15,6 +15,7 @@ C_SRCS = \
quartz_parser.c \
quartz_transform.c \
resampler.c \
video_processor.c \
wg_allocator.c \
wg_format.c \
wg_parser.c \
......
......@@ -141,6 +141,7 @@ HRESULT wg_transform_read_quartz(struct wg_transform *transform, struct wg_sampl
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj);
HRESULT h264_decoder_create(REFIID riid, void **ret);
HRESULT video_processor_create(REFIID riid, void **ret);
struct wm_stream
{
......
......@@ -37,269 +37,6 @@ DEFINE_GUID(DMOVideoFormat_RGB565,D3DFMT_R5G6B5,0x524f,0x11ce,0x9f,0x53,0x00,0x2
DEFINE_GUID(DMOVideoFormat_RGB555,D3DFMT_X1R5G5B5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70);
DEFINE_GUID(DMOVideoFormat_RGB8,D3DFMT_P8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70);
struct video_processor
{
IMFTransform IMFTransform_iface;
LONG refcount;
IMFAttributes *attributes;
IMFAttributes *output_attributes;
};
static struct video_processor *impl_video_processor_from_IMFTransform(IMFTransform *iface)
{
return CONTAINING_RECORD(iface, struct video_processor, IMFTransform_iface);
}
static HRESULT WINAPI video_processor_QueryInterface(IMFTransform *iface, REFIID riid, void **obj)
{
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
if (IsEqualIID(riid, &IID_IMFTransform) ||
IsEqualIID(riid, &IID_IUnknown))
{
*obj = iface;
IMFTransform_AddRef(iface);
return S_OK;
}
WARN("Unsupported %s.\n", debugstr_guid(riid));
*obj = NULL;
return E_NOINTERFACE;
}
static ULONG WINAPI video_processor_AddRef(IMFTransform *iface)
{
struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
ULONG refcount = InterlockedIncrement(&transform->refcount);
TRACE("%p, refcount %lu.\n", iface, refcount);
return refcount;
}
static ULONG WINAPI video_processor_Release(IMFTransform *iface)
{
struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
ULONG refcount = InterlockedDecrement(&transform->refcount);
TRACE("%p, refcount %lu.\n", iface, refcount);
if (!refcount)
{
if (transform->attributes)
IMFAttributes_Release(transform->attributes);
if (transform->output_attributes)
IMFAttributes_Release(transform->output_attributes);
free(transform);
}
return refcount;
}
static HRESULT WINAPI video_processor_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, DWORD *input_maximum,
DWORD *output_minimum, DWORD *output_maximum)
{
TRACE("%p, %p, %p, %p, %p.\n", iface, input_minimum, input_maximum, output_minimum, output_maximum);
*input_minimum = *input_maximum = *output_minimum = *output_maximum = 1;
return S_OK;
}
static HRESULT WINAPI video_processor_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs)
{
TRACE("%p, %p, %p.\n", iface, inputs, outputs);
*inputs = *outputs = 1;
return S_OK;
}
static HRESULT WINAPI video_processor_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs,
DWORD output_size, DWORD *outputs)
{
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
{
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
{
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
{
struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
TRACE("%p, %p.\n", iface, attributes);
*attributes = transform->attributes;
IMFAttributes_AddRef(*attributes);
return S_OK;
}
static HRESULT WINAPI video_processor_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
struct video_processor *transform = impl_video_processor_from_IMFTransform(iface);
TRACE("%p, %lu, %p.\n", iface, id, attributes);
*attributes = transform->output_attributes;
IMFAttributes_AddRef(*attributes);
return S_OK;
}
static HRESULT WINAPI video_processor_DeleteInputStream(IMFTransform *iface, DWORD id)
{
TRACE("%p, %lu.\n", iface, id);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids)
{
TRACE("%p, %lu, %p.\n", iface, streams, ids);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
IMFMediaType **type)
{
FIXME("%p, %lu, %lu, %p.\n", iface, id, index, type);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
IMFMediaType **type)
{
FIXME("%p, %lu, %lu, %p.\n", iface, id, index, type);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{
FIXME("%p, %lu, %p, %#lx.\n", iface, id, type, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
{
FIXME("%p, %lu, %p, %#lx.\n", iface, id, type, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{
FIXME("%p, %lu, %p.\n", iface, id, type);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{
FIXME("%p, %lu, %p.\n", iface, id, type);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
{
FIXME("%p, %lu, %p.\n", iface, id, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_GetOutputStatus(IMFTransform *iface, DWORD *flags)
{
FIXME("%p, %p.\n", iface, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper)
{
FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(lower), wine_dbgstr_longlong(upper));
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event)
{
TRACE("%p, %lu, %p.\n", iface, id, event);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
{
FIXME("%p, %u, %#Ix.\n", iface, message, param);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
{
FIXME("%p, %lu, %p, %#lx.\n", iface, id, sample, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
{
FIXME("%p, %#lx, %lu, %p, %p.\n", iface, flags, count, samples, status);
return E_NOTIMPL;
}
static const IMFTransformVtbl video_processor_vtbl =
{
video_processor_QueryInterface,
video_processor_AddRef,
video_processor_Release,
video_processor_GetStreamLimits,
video_processor_GetStreamCount,
video_processor_GetStreamIDs,
video_processor_GetInputStreamInfo,
video_processor_GetOutputStreamInfo,
video_processor_GetAttributes,
video_processor_GetInputStreamAttributes,
video_processor_GetOutputStreamAttributes,
video_processor_DeleteInputStream,
video_processor_AddInputStreams,
video_processor_GetInputAvailableType,
video_processor_GetOutputAvailableType,
video_processor_SetInputType,
video_processor_SetOutputType,
video_processor_GetInputCurrentType,
video_processor_GetOutputCurrentType,
video_processor_GetInputStatus,
video_processor_GetOutputStatus,
video_processor_SetOutputBounds,
video_processor_ProcessEvent,
video_processor_ProcessMessage,
video_processor_ProcessInput,
video_processor_ProcessOutput,
};
struct class_factory
{
IClassFactory IClassFactory_iface;
......@@ -376,32 +113,6 @@ static const IClassFactoryVtbl class_factory_vtbl =
class_factory_LockServer,
};
static HRESULT video_processor_create(REFIID riid, void **ret)
{
struct video_processor *object;
HRESULT hr;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
object->IMFTransform_iface.lpVtbl = &video_processor_vtbl;
object->refcount = 1;
if (FAILED(hr = MFCreateAttributes(&object->attributes, 0)))
goto failed;
if (FAILED(hr = MFCreateAttributes(&object->output_attributes, 0)))
goto failed;
*ret = &object->IMFTransform_iface;
return S_OK;
failed:
IMFTransform_Release(&object->IMFTransform_iface);
return hr;
}
static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a, {0x9f, 0x15, 0xd8, 0x27, 0xa9, 0xa0, 0x81, 0x62}};
static const struct class_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