dsdmo: Implement IMediaObject::SetOutputType().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-07-24 19:20:24 -05:00 committed by Alexandre Julliard
parent f21d13e2bc
commit ffdc68d517
2 changed files with 28 additions and 7 deletions

View File

@ -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)

View File

@ -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);