Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 107 +++++++++++++++++++++++++++++++++------------ dlls/mf/tests/mf.c | 52 ++++++++++++++++++++++ 2 files changed, 131 insertions(+), 28 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 8e41942448..3a33a88a4b 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -85,6 +85,7 @@ enum clock_command CLOCK_CMD_START = 0, CLOCK_CMD_STOP, CLOCK_CMD_PAUSE, + CLOCK_CMD_SET_RATE, CLOCK_CMD_MAX, };
@@ -94,6 +95,16 @@ enum clock_notification CLOCK_NOTIFY_STOP, CLOCK_NOTIFY_PAUSE, CLOCK_NOTIFY_RESTART, + CLOCK_NOTIFY_SET_RATE, +}; + +struct clock_state_change_param +{ + union + { + LONGLONG offset; + float rate; + } u; };
struct sink_notification @@ -101,7 +112,7 @@ struct sink_notification IUnknown IUnknown_iface; LONG refcount; MFTIME system_time; - LONGLONG offset; + struct clock_state_change_param param; enum clock_notification notification; IMFClockStateSink *sink; }; @@ -118,6 +129,7 @@ struct presentation_clock IMFClockStateSink *time_source_sink; MFCLOCK_STATE state; struct list sinks; + float rate; CRITICAL_SECTION cs; };
@@ -1092,8 +1104,8 @@ static const IUnknownVtbl sinknotificationvtbl = sink_notification_Release, };
-static HRESULT create_sink_notification(MFTIME system_time, LONGLONG offset, enum clock_notification notification, - IMFClockStateSink *sink, IUnknown **out) +static HRESULT create_sink_notification(MFTIME system_time, struct clock_state_change_param param, + enum clock_notification notification, IMFClockStateSink *sink, IUnknown **out) { struct sink_notification *object;
@@ -1104,7 +1116,7 @@ static HRESULT create_sink_notification(MFTIME system_time, LONGLONG offset, enu object->IUnknown_iface.lpVtbl = &sinknotificationvtbl; object->refcount = 1; object->system_time = system_time; - object->offset = offset; + object->param = param; object->notification = notification; object->sink = sink; IMFClockStateSink_AddRef(object->sink); @@ -1114,15 +1126,15 @@ static HRESULT create_sink_notification(MFTIME system_time, LONGLONG offset, enu return S_OK; }
-static HRESULT clock_call_state_change(MFTIME system_time, LONGLONG offset, enum clock_notification notification, - IMFClockStateSink *sink) +static HRESULT clock_call_state_change(MFTIME system_time, struct clock_state_change_param param, + enum clock_notification notification, IMFClockStateSink *sink) { HRESULT hr = S_OK;
switch (notification) { case CLOCK_NOTIFY_START: - hr = IMFClockStateSink_OnClockStart(sink, system_time, offset); + hr = IMFClockStateSink_OnClockStart(sink, system_time, param.u.offset); break; case CLOCK_NOTIFY_STOP: hr = IMFClockStateSink_OnClockStop(sink, system_time); @@ -1133,6 +1145,10 @@ static HRESULT clock_call_state_change(MFTIME system_time, LONGLONG offset, enum case CLOCK_NOTIFY_RESTART: hr = IMFClockStateSink_OnClockRestart(sink, system_time); break; + case CLOCK_NOTIFY_SET_RATE: + /* System time source does not allow 0.0 rate, presentation clock allows it without raising errors. */ + IMFClockStateSink_OnClockSetRate(sink, system_time, param.u.rate); + break; default: ; } @@ -1140,20 +1156,22 @@ static HRESULT clock_call_state_change(MFTIME system_time, LONGLONG offset, enum return hr; }
-static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_command command, LONGLONG offset) +static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_command command, + struct clock_state_change_param param) { static const BYTE state_change_is_allowed[MFCLOCK_STATE_PAUSED+1][CLOCK_CMD_MAX] = - { /* S S* P */ - /* INVALID */ { 1, 1, 1 }, - /* RUNNING */ { 1, 1, 1 }, - /* STOPPED */ { 1, 1, 0 }, - /* PAUSED */ { 1, 1, 0 }, + { /* S S* P, R */ + /* INVALID */ { 1, 1, 1, 1 }, + /* RUNNING */ { 1, 1, 1, 1 }, + /* STOPPED */ { 1, 1, 0, 1 }, + /* PAUSED */ { 1, 1, 0, 1 }, }; static const MFCLOCK_STATE states[CLOCK_CMD_MAX] = { - /* CLOCK_CMD_START */ MFCLOCK_STATE_RUNNING, - /* CLOCK_CMD_STOP */ MFCLOCK_STATE_STOPPED, - /* CLOCK_CMD_PAUSE */ MFCLOCK_STATE_PAUSED, + /* CLOCK_CMD_START */ MFCLOCK_STATE_RUNNING, + /* CLOCK_CMD_STOP */ MFCLOCK_STATE_STOPPED, + /* CLOCK_CMD_PAUSE */ MFCLOCK_STATE_PAUSED, + /* CLOCK_CMD_SET_RATE */ 0, /* Unused */ }; enum clock_notification notification; struct clock_sink *sink; @@ -1162,7 +1180,7 @@ static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_c MFTIME system_time; HRESULT hr;
- if (clock->state == states[command] && clock->state != MFCLOCK_STATE_RUNNING) + if (command != CLOCK_CMD_SET_RATE && clock->state == states[command] && clock->state != MFCLOCK_STATE_RUNNING) return MF_E_CLOCK_STATE_ALREADY_SET;
if (!state_change_is_allowed[clock->state][command]) @@ -1173,7 +1191,7 @@ static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_c switch (command) { case CLOCK_CMD_START: - if (clock->state == MFCLOCK_STATE_PAUSED && offset == PRESENTATION_CURRENT_POSITION) + if (clock->state == MFCLOCK_STATE_PAUSED && param.u.offset == PRESENTATION_CURRENT_POSITION) notification = CLOCK_NOTIFY_RESTART; else notification = CLOCK_NOTIFY_START; @@ -1184,18 +1202,21 @@ static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_c case CLOCK_CMD_PAUSE: notification = CLOCK_NOTIFY_PAUSE; break; + case CLOCK_CMD_SET_RATE: + notification = CLOCK_NOTIFY_SET_RATE; + break; default: ; }
- if (FAILED(hr = clock_call_state_change(system_time, offset, notification, clock->time_source_sink))) + if (FAILED(hr = clock_call_state_change(system_time, param, notification, clock->time_source_sink))) return hr;
clock->state = states[command];
LIST_FOR_EACH_ENTRY(sink, &clock->sinks, struct clock_sink, entry) { - if (SUCCEEDED(create_sink_notification(system_time, offset, notification, sink->state_sink, ¬ify_object))) + if (SUCCEEDED(create_sink_notification(system_time, param, notification, sink->state_sink, ¬ify_object))) { hr = MFCreateAsyncResult(notify_object, &clock->IMFAsyncCallback_iface, NULL, &result); IUnknown_Release(notify_object); @@ -1213,12 +1234,14 @@ static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_c static HRESULT WINAPI present_clock_Start(IMFPresentationClock *iface, LONGLONG start_offset) { struct presentation_clock *clock = impl_from_IMFPresentationClock(iface); + struct clock_state_change_param param = { 0 }; HRESULT hr;
TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(start_offset));
EnterCriticalSection(&clock->cs); - hr = clock_change_state(clock, CLOCK_CMD_START, start_offset); + param.u.offset = start_offset; + hr = clock_change_state(clock, CLOCK_CMD_START, param); LeaveCriticalSection(&clock->cs);
return hr; @@ -1227,12 +1250,13 @@ static HRESULT WINAPI present_clock_Start(IMFPresentationClock *iface, LONGLONG static HRESULT WINAPI present_clock_Stop(IMFPresentationClock *iface) { struct presentation_clock *clock = impl_from_IMFPresentationClock(iface); + struct clock_state_change_param param = { 0 }; HRESULT hr;
TRACE("%p.\n", iface);
EnterCriticalSection(&clock->cs); - hr = clock_change_state(clock, CLOCK_CMD_STOP, 0); + hr = clock_change_state(clock, CLOCK_CMD_STOP, param); LeaveCriticalSection(&clock->cs);
return hr; @@ -1241,12 +1265,13 @@ static HRESULT WINAPI present_clock_Stop(IMFPresentationClock *iface) static HRESULT WINAPI present_clock_Pause(IMFPresentationClock *iface) { struct presentation_clock *clock = impl_from_IMFPresentationClock(iface); + struct clock_state_change_param param = { 0 }; HRESULT hr;
TRACE("%p.\n", iface);
EnterCriticalSection(&clock->cs); - hr = clock_change_state(clock, CLOCK_CMD_PAUSE, 0); + hr = clock_change_state(clock, CLOCK_CMD_PAUSE, param); LeaveCriticalSection(&clock->cs);
return hr; @@ -1292,16 +1317,41 @@ static ULONG WINAPI present_clock_rate_control_Release(IMFRateControl *iface)
static HRESULT WINAPI present_clock_rate_SetRate(IMFRateControl *iface, BOOL thin, float rate) { - FIXME("%p, %d, %f.\n", iface, thin, rate); + struct presentation_clock *clock = impl_from_IMFRateControl(iface); + struct clock_state_change_param param; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %d, %f.\n", iface, thin, rate); + + if (thin) + return MF_E_THINNING_UNSUPPORTED; + + EnterCriticalSection(&clock->cs); + param.u.rate = rate; + if (SUCCEEDED(hr = clock_change_state(clock, CLOCK_CMD_SET_RATE, param))) + clock->rate = rate; + LeaveCriticalSection(&clock->cs); + + return hr; }
static HRESULT WINAPI present_clock_rate_GetRate(IMFRateControl *iface, BOOL *thin, float *rate) { - FIXME("%p, %p, %p.\n", iface, thin, rate); + struct presentation_clock *clock = impl_from_IMFRateControl(iface);
- return E_NOTIMPL; + TRACE("%p, %p, %p.\n", iface, thin, rate); + + if (!rate) + return E_INVALIDARG; + + if (thin) + *thin = FALSE; + + EnterCriticalSection(&clock->cs); + *rate = clock->rate; + LeaveCriticalSection(&clock->cs); + + return S_OK; }
static const IMFRateControlVtbl presentclockratecontrolvtbl = @@ -1439,7 +1489,7 @@ static HRESULT WINAPI present_clock_sink_callback_Invoke(IMFAsyncCallback *iface
data = impl_from_IUnknown(object);
- clock_call_state_change(data->system_time, data->offset, data->notification, data->sink); + clock_call_state_change(data->system_time, data->param, data->notification, data->sink);
IUnknown_Release(object);
@@ -1475,6 +1525,7 @@ HRESULT WINAPI MFCreatePresentationClock(IMFPresentationClock **clock) object->IMFAsyncCallback_iface.lpVtbl = &presentclocksinkcallbackvtbl; object->refcount = 1; list_init(&object->sinks); + object->rate = 1.0f; InitializeCriticalSection(&object->cs);
*clock = &object->IMFPresentationClock_iface; diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 8f9a97d497..cb2db22d93 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1430,6 +1430,7 @@ static void test_presentation_clock(void) MFCLOCK_PROPERTIES props, props2; IMFRateControl *rate_control; IMFPresentationClock *clock; + MFSHUTDOWN_STATUS status; IMFShutdown *shutdown; MFTIME systime, time; LONGLONG clock_time; @@ -1437,7 +1438,9 @@ static void test_presentation_clock(void) IMFTimer *timer; unsigned int i; DWORD value; + float rate; HRESULT hr; + BOOL thin;
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); ok(hr == S_OK, "Failed to start up, hr %#x.\n", hr); @@ -1577,6 +1580,40 @@ static void test_presentation_clock(void)
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control); ok(hr == S_OK, "Failed to get rate control interface, hr %#x.\n", hr); + + hr = IMFRateControl_GetRate(rate_control, NULL, &rate); + ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr); + + hr = IMFRateControl_GetRate(rate_control, &thin, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + hr = IMFRateControl_GetRate(rate_control, &thin, &rate); + ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr); + ok(rate == 1.0f, "Unexpected rate.\n"); + ok(!thin, "Unexpected thinning.\n"); + + hr = IMFPresentationClock_Start(clock, 0); + ok(hr == S_OK, "Failed to stop, hr %#x.\n", hr); + + hr = IMFRateControl_SetRate(rate_control, FALSE, 0.0f); + ok(hr == S_OK, "Failed to set clock rate, hr %#x.\n", hr); + hr = IMFRateControl_GetRate(rate_control, &thin, &rate); + ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr); + ok(rate == 0.0f, "Unexpected rate.\n"); + hr = IMFRateControl_SetRate(rate_control, FALSE, 1.0f); + ok(hr == S_OK, "Failed to set clock rate, hr %#x.\n", hr); + hr = IMFRateControl_SetRate(rate_control, FALSE, 0.0f); + ok(hr == S_OK, "Failed to set clock rate, hr %#x.\n", hr); + hr = IMFRateControl_SetRate(rate_control, FALSE, 0.5f); + ok(hr == S_OK, "Failed to set clock rate, hr %#x.\n", hr); + hr = IMFRateControl_SetRate(rate_control, TRUE, -1.0f); + ok(hr == MF_E_THINNING_UNSUPPORTED, "Unexpected hr %#x.\n", hr); + + hr = IMFRateControl_GetRate(rate_control, &thin, &rate); + ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr); + ok(rate == 0.5f, "Unexpected rate.\n"); + ok(!thin, "Unexpected thinning.\n"); + IMFRateControl_Release(rate_control);
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFTimer, (void **)&timer); @@ -1585,6 +1622,21 @@ static void test_presentation_clock(void)
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFShutdown, (void **)&shutdown); ok(hr == S_OK, "Failed to get shutdown interface, hr %#x.\n", hr); + + /* Shutdown behavior. */ + hr = IMFShutdown_GetShutdownStatus(shutdown, NULL); +todo_wine + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + hr = IMFShutdown_Shutdown(shutdown); +todo_wine + ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr); + + hr = IMFShutdown_GetShutdownStatus(shutdown, &status); +todo_wine { + ok(hr == S_OK, "Failed to get status, hr %#x.\n", hr); + ok(status == MFSHUTDOWN_COMPLETED, "Unexpected status.\n"); +} IMFShutdown_Release(shutdown);
IMFPresentationClock_Release(clock);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 155 ++++++++++++++++++++++++++++++++++++++++ include/mfapi.h | 2 + include/mferror.h | 28 ++++++++ include/mfidl.idl | 2 + include/mftransform.idl | 7 +- 5 files changed, 193 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index cb2db22d93..cc85221dc0 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -30,6 +30,8 @@ #include "ole2.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); +DEFINE_GUID(MFVideoFormat_P208, 0x38303250, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); +DEFINE_GUID(MFVideoFormat_ABGR32, 0x00000020, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
#undef INITGUID #include <guiddef.h> @@ -2021,6 +2023,158 @@ todo_wine ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr); }
+static BOOL is_supported_video_type(const GUID *guid) +{ + return IsEqualGUID(guid, &MFVideoFormat_L8) + || IsEqualGUID(guid, &MFVideoFormat_L16) + || IsEqualGUID(guid, &MFVideoFormat_D16) + || IsEqualGUID(guid, &MFVideoFormat_IYUV) + || IsEqualGUID(guid, &MFVideoFormat_YV12) + || IsEqualGUID(guid, &MFVideoFormat_NV12) + || IsEqualGUID(guid, &MFVideoFormat_420O) + || IsEqualGUID(guid, &MFVideoFormat_P010) + || IsEqualGUID(guid, &MFVideoFormat_P016) + || IsEqualGUID(guid, &MFVideoFormat_UYVY) + || IsEqualGUID(guid, &MFVideoFormat_YUY2) + || IsEqualGUID(guid, &MFVideoFormat_P208) + || IsEqualGUID(guid, &MFVideoFormat_NV11) + || IsEqualGUID(guid, &MFVideoFormat_AYUV) + || IsEqualGUID(guid, &MFVideoFormat_ARGB32) + || IsEqualGUID(guid, &MFVideoFormat_RGB32) + || IsEqualGUID(guid, &MFVideoFormat_A2R10G10B10) + || IsEqualGUID(guid, &MFVideoFormat_A16B16G16R16F) + || IsEqualGUID(guid, &MFVideoFormat_RGB24) + || IsEqualGUID(guid, &MFVideoFormat_I420) + || IsEqualGUID(guid, &MFVideoFormat_YVYU) + || IsEqualGUID(guid, &MFVideoFormat_RGB555) + || IsEqualGUID(guid, &MFVideoFormat_RGB565) + || IsEqualGUID(guid, &MFVideoFormat_RGB8) + || IsEqualGUID(guid, &MFVideoFormat_Y216) + || IsEqualGUID(guid, &MFVideoFormat_v410) + || IsEqualGUID(guid, &MFVideoFormat_Y41P) + || IsEqualGUID(guid, &MFVideoFormat_Y41T) + || IsEqualGUID(guid, &MFVideoFormat_Y42T) + || IsEqualGUID(guid, &MFVideoFormat_ABGR32); +} + +static void test_video_processor(void) +{ + DWORD input_count, output_count, input_id, output_id, flags; + DWORD input_min, input_max, output_min, output_max, i, count; + IMFAttributes *attributes, *attributes2; + IMFMediaType *media_type; + IMFTransform *transform; + HRESULT hr; + GUID guid; + + hr = CoInitialize(NULL); + ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr); + + hr = CoCreateInstance(&CLSID_VideoProcessorMFT, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, + (void **)&transform); +todo_wine + ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "Failed to create video processor transform, hr %#x.\n", hr); + + if (FAILED(hr)) + goto failed; + + /* Transform global attributes. */ + hr = IMFTransform_GetAttributes(transform, &attributes); + ok(hr == S_OK, "Failed to get attributes, hr %#x.\n", hr); + hr = IMFTransform_GetAttributes(transform, &attributes2); + ok(hr == S_OK, "Failed to get attributes, hr %#x.\n", hr); + ok(attributes == attributes2, "Unexpected instance.\n"); + IMFAttributes_Release(attributes); + IMFAttributes_Release(attributes2); + + hr = IMFTransform_GetStreamLimits(transform, &input_min, &input_max, &output_min, &output_max); + ok(hr == S_OK, "Failed to get stream limits, hr %#x.\n", hr); + ok(input_min == input_max && input_min == 1 && output_min == output_max && output_min == 1, + "Unexpected stream limits.\n"); + + hr = IMFTransform_GetStreamCount(transform, &input_count, &output_count); + ok(hr == S_OK, "Failed to get stream count, hr %#x.\n", hr); + ok(input_count == 1 && output_count == 1, "Unexpected stream count %u, %u.\n", input_count, output_count); + + hr = IMFTransform_GetStreamIDs(transform, 1, &input_id, 1, &output_id); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + + input_id = 100; + hr = IMFTransform_AddInputStreams(transform, 1, &input_id); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_DeleteInputStream(transform, 0); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputStatus(transform, 0, &flags); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputStreamAttributes(transform, 0, &attributes); + ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetOutputStatus(transform, &flags); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetOutputStreamAttributes(transform, 0, &attributes); + ok(hr == S_OK, "Failed to get output attributes, hr %#x.\n", hr); + hr = IMFTransform_GetOutputStreamAttributes(transform, 0, &attributes2); + ok(hr == S_OK, "Failed to get output attributes, hr %#x.\n", hr); + ok(attributes == attributes2, "Unexpected instance.\n"); + IMFAttributes_Release(attributes); + IMFAttributes_Release(attributes2); + + for (i = 0;;++i) + { + hr = IMFTransform_GetInputAvailableType(transform, 0, i, &media_type); + if (hr == MF_E_NO_MORE_TYPES) + break; + ok(hr == S_OK, "Failed to get supported input type, hr %#x.\n", hr); + + hr = IMFMediaType_GetMajorType(media_type, &guid); + ok(hr == S_OK, "Failed to get major type, hr %#x.\n", hr); + ok(IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected major type.\n"); + + IMFMediaType_Release(media_type); + } + + hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); + ok(hr == MF_E_NO_MORE_TYPES, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetInputCurrentType(transform, 1, &media_type); + ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type); + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); + + hr = IMFTransform_GetOutputCurrentType(transform, 1, &media_type); + ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr); + + /* Configure stream types. */ + for (i = 0;;++i) + { + if (FAILED(hr = IMFTransform_GetInputAvailableType(transform, 0, i, &media_type))) + break; + + hr = IMFMediaType_GetCount(media_type, &count); + ok(hr == S_OK, "Failed to get attributes count, hr %#x.\n", hr); + ok(count == 2, "Unexpected count %u.\n", count); + + hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); + ok(hr == S_OK, "Failed to get subtype, hr %#x.\n", hr); + ok(is_supported_video_type(&guid), "Unexpected media type %s.\n", wine_dbgstr_guid(&guid)); + + IMFMediaType_Release(media_type); + } + + IMFTransform_Release(transform); + +failed: + CoUninitialize(); +} + START_TEST(mf) { test_topology(); @@ -2031,4 +2185,5 @@ START_TEST(mf) test_MFShutdownObject(); test_presentation_clock(); test_sample_grabber(); + test_video_processor(); } diff --git a/include/mfapi.h b/include/mfapi.h index f3ca3d9444..3809a95142 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -44,8 +44,10 @@ extern "C" { ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) #endif
+#ifndef DEFINE_MEDIATYPE_GUID #define DEFINE_MEDIATYPE_GUID(name, format) \ DEFINE_GUID(name, format, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); +#endif
#ifndef DIRECT3D_VERSION #define LOCAL_D3DFMT_DEFINES 1 diff --git a/include/mferror.h b/include/mferror.h index 4d3a530734..ba4d365a79 100644 --- a/include/mferror.h +++ b/include/mferror.h @@ -121,6 +121,34 @@ #define MF_E_TOPO_MISSING_SOURCE _HRESULT_TYPEDEF_(0xc00d521a) #define MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d521b)
+#define MF_E_TRANSFORM_TYPE_NOT_SET _HRESULT_TYPEDEF_(0xc00d6d60) +#define MF_E_TRANSFORM_STREAM_CHANGE _HRESULT_TYPEDEF_(0xc00d6d61) +#define MF_E_TRANSFORM_INPUT_REMAINING _HRESULT_TYPEDEF_(0xc00d6d62) +#define MF_E_TRANSFORM_PROFILE_MISSING _HRESULT_TYPEDEF_(0xc00d6d63) +#define MF_E_TRANSFORM_PROFILE_INVALID_OR_CORRUPT _HRESULT_TYPEDEF_(0xc00d6d64) +#define MF_E_TRANSFORM_PROFILE_TRUNCATED _HRESULT_TYPEDEF_(0xc00d6d65) +#define MF_E_TRANSFORM_PROPERTY_PID_NOT_RECOGNIZED _HRESULT_TYPEDEF_(0xc00d6d66) +#define MF_E_TRANSFORM_PROPERTY_VARIANT_TYPE_WRONG _HRESULT_TYPEDEF_(0xc00d6d67) +#define MF_E_TRANSFORM_PROPERTY_NOT_WRITEABLE _HRESULT_TYPEDEF_(0xc00d6d68) +#define MF_E_TRANSFORM_PROPERTY_ARRAY_VALUE_WRONG_NUM_DIM _HRESULT_TYPEDEF_(0xc00d6d69) +#define MF_E_TRANSFORM_PROPERTY_VALUE_SIZE_WRONG _HRESULT_TYPEDEF_(0xc00d6d6a) +#define MF_E_TRANSFORM_PROPERTY_VALUE_OUT_OF_RANGE _HRESULT_TYPEDEF_(0xc00d6d6b) +#define MF_E_TRANSFORM_PROPERTY_VALUE_INCOMPATIBLE _HRESULT_TYPEDEF_(0xc00d6d6c) +#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_OUTPUT_MEDIATYPE _HRESULT_TYPEDEF_(0xc00d6d6d) +#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_INPUT_MEDIATYPE _HRESULT_TYPEDEF_(0xc00d6d6e) +#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION _HRESULT_TYPEDEF_(0xc00d6d6f) +#define MF_E_TRANSFORM_CONFLICTS_WITH_OTHER_CURRENTLY_ENABLED_FEATURES _HRESULT_TYPEDEF_(0xc00d6d70) +#define MF_E_TRANSFORM_NEED_MORE_INPUT _HRESULT_TYPEDEF_(0xc00d6d72) +#define MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_SPKR_CONFIG _HRESULT_TYPEDEF_(0xc00d6d73) +#define MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING _HRESULT_TYPEDEF_(0xc00d6d74) +#define MF_S_TRANSFORM_DO_NOT_PROPAGATE_EVENT _HRESULT_TYPEDEF_(0x000d6d75) +#define MF_E_UNSUPPORTED_D3D_TYPE _HRESULT_TYPEDEF_(0xc00d6d76) +#define MF_E_TRANSFORM_ASYNC_LOCKED _HRESULT_TYPEDEF_(0xc00d6d77) +#define MF_E_TRANSFORM_CANNOT_INITIALIZE_ACM_DRIVER _HRESULT_TYPEDEF_(0xc00d6d78) +#define MF_E_TRANSFORM_STREAM_INVALID_RESOLUTION _HRESULT_TYPEDEF_(0xc00d6d79) +#define MF_E_TRANSFORM_ASYNC_MFT_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d6d7a) +#define MF_E_TRANSFORM_EXATTRIBUTE_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d6d7c) + #define MF_E_CLOCK_NO_TIME_SOURCE _HRESULT_TYPEDEF_(0xc00d9c41) #define MF_E_CLOCK_STATE_ALREADY_SET _HRESULT_TYPEDEF_(0xc00d9c42)
diff --git a/include/mfidl.idl b/include/mfidl.idl index 93e20a6978..4968bf9aa7 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -823,3 +823,5 @@ cpp_quote("EXTERN_GUID(MF_RATE_CONTROL_SERVICE, 0x866fa297, 0xb802, 0x4bf8, 0x9d
cpp_quote("EXTERN_GUID(MF_SAMPLEGRABBERSINK_SAMPLE_TIME_OFFSET, 0x62e3d776, 0x8100, 0x4e03, 0xa6, 0xe8, 0xbd, 0x38, 0x57, 0xac, 0x9c, 0x47);") cpp_quote("EXTERN_GUID(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, 0x0efda2c0, 0x2b69, 0x4e2e, 0xab, 0x8d, 0x46, 0xdc, 0xbf, 0xf7, 0xd2, 0x5d);") + +cpp_quote("EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);") diff --git a/include/mftransform.idl b/include/mftransform.idl index 14f74a3eb9..4321d002be 100644 --- a/include/mftransform.idl +++ b/include/mftransform.idl @@ -42,7 +42,7 @@ typedef struct _MFT_OUTPUT_DATA_BUFFER IMFCollection *pEvents; } MFT_OUTPUT_DATA_BUFFER, *PMFT_OUTPUT_DATA_BUFFER;
-typedef enum _MFT_MESSAGE_TYPE +typedef [v1_enum] enum _MFT_MESSAGE_TYPE { MFT_MESSAGE_COMMAND_FLUSH = 0x00000000, MFT_MESSAGE_COMMAND_DRAIN = 0x00000001, @@ -56,6 +56,11 @@ typedef enum _MFT_MESSAGE_TYPE MFT_MESSAGE_COMMAND_MARKER = 0x20000000 } MFT_MESSAGE_TYPE;
+enum _MFT_SET_TYPE_FLAGS +{ + MFT_SET_TYPE_TEST_ONLY = 0x00000001, +}; + [ object, uuid(bf94c121-5b05-4e6f-8000-ba598961414d)