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

dsdmo: Implement IMediaObject::SetOutputType().

parent f21d13e2
......@@ -226,8 +226,29 @@ static HRESULT WINAPI effect_SetInputType(IMediaObject *iface, DWORD index, cons
static HRESULT WINAPI effect_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags)
{
FIXME("iface %p, index %u, type %p, flags %#x, stub!\n", iface, index, type, flags);
return E_NOTIMPL;
struct effect *effect = impl_from_IMediaObject(iface);
HRESULT hr;
TRACE("iface %p, index %u, type %p, flags %#x.\n", iface, index, type, flags);
if (flags & DMO_SET_TYPEF_CLEAR)
return S_OK;
if (!IsEqualGUID(&type->majortype, &MEDIATYPE_Audio))
return DMO_E_TYPE_NOT_ACCEPTED;
if (!IsEqualGUID(&type->subtype, &MEDIASUBTYPE_PCM)
&& !IsEqualGUID(&type->subtype, &MEDIASUBTYPE_IEEE_FLOAT))
return DMO_E_TYPE_NOT_ACCEPTED;
if (!IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx))
return DMO_E_TYPE_NOT_ACCEPTED;
EnterCriticalSection(&effect->cs);
hr = memcmp(type->pbFormat, &effect->format, sizeof(WAVEFORMATEX)) ? DMO_E_TYPE_NOT_ACCEPTED : S_OK;
LeaveCriticalSection(&effect->cs);
return hr;
}
static HRESULT WINAPI effect_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type)
......
......@@ -254,22 +254,22 @@ static void test_media_types(const GUID *clsid)
build_pcm_format(&wfx, depths[j].format, depths[j].depth, sample_rates[i], 3 - channels);
hr = IMediaObject_SetOutputType(dmo, 0, &mt, 0);
todo_wine ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
hr, sample_rates[i], channels, depths[j].format, depths[j].depth);
build_pcm_format(&wfx, depths[j].format, depths[j].depth, 2 * sample_rates[i], channels);
hr = IMediaObject_SetOutputType(dmo, 0, &mt, 0);
todo_wine ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
hr, sample_rates[i], channels, depths[j].format, depths[j].depth);
build_pcm_format(&wfx, depths[j].format, 24 - depths[j].depth, sample_rates[i], channels);
hr = IMediaObject_SetOutputType(dmo, 0, &mt, 0);
todo_wine ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
hr, sample_rates[i], channels, depths[j].format, depths[j].depth);
build_pcm_format(&wfx, depths[j].format, depths[j].depth, sample_rates[i], channels);
hr = IMediaObject_SetOutputType(dmo, 0, &mt, 0);
todo_wine ok(hr == S_OK, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
ok(hr == S_OK, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
hr, sample_rates[i], channels, depths[j].format, depths[j].depth);
hr = IMediaObject_SetInputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR);
......@@ -277,7 +277,7 @@ static void test_media_types(const GUID *clsid)
hr, sample_rates[i], channels, depths[j].format, depths[j].depth);
hr = IMediaObject_SetOutputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR);
todo_wine ok(hr == S_OK, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
ok(hr == S_OK, "Got hr %#x for %u Hz, %u channels, format %#x, depth %u.\n",
hr, sample_rates[i], channels, depths[j].format, depths[j].depth);
hr = IMediaObject_SetInputType(dmo, 0, NULL, DMO_SET_TYPEF_CLEAR);
......
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