Commit 1e3d4a1d authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winegstreamer: Implement _GetInputStatus() for h264 decoder transform.

parent efb819c7
...@@ -3505,6 +3505,7 @@ static void test_h264_decoder(void) ...@@ -3505,6 +3505,7 @@ static void test_h264_decoder(void)
IMFMediaType *media_type; IMFMediaType *media_type;
IMFTransform *transform; IMFTransform *transform;
ULONG i, ret, ref; ULONG i, ret, ref;
DWORD flags;
HRESULT hr; HRESULT hr;
hr = CoInitialize(NULL); hr = CoInitialize(NULL);
...@@ -3541,6 +3542,11 @@ static void test_h264_decoder(void) ...@@ -3541,6 +3542,11 @@ static void test_h264_decoder(void)
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#lx\n", hr); ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#lx\n", hr);
flags = 0xdeadbeef;
hr = IMFTransform_GetInputStatus(transform, 0, &flags);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Got %#lx\n", hr);
ok(flags == 0xdeadbeef, "Got flags %#lx.\n", flags);
/* setting output media type first doesn't work */ /* setting output media type first doesn't work */
check_mft_set_output_type(transform, output_type_desc, MF_E_TRANSFORM_TYPE_NOT_SET); check_mft_set_output_type(transform, output_type_desc, MF_E_TRANSFORM_TYPE_NOT_SET);
check_mft_get_output_current_type(transform, NULL); check_mft_get_output_current_type(transform, NULL);
...@@ -3629,12 +3635,20 @@ static void test_h264_decoder(void) ...@@ -3629,12 +3635,20 @@ static void test_h264_decoder(void)
ret = IMFSample_Release(output_sample); ret = IMFSample_Release(output_sample);
ok(ret == 0, "Release returned %lu\n", ret); ok(ret == 0, "Release returned %lu\n", ret);
flags = 0;
hr = IMFTransform_GetInputStatus(transform, 0, &flags);
ok(hr == S_OK, "Got %#lx\n", hr);
ok(flags == MFT_INPUT_STATUS_ACCEPT_DATA, "Got flags %#lx.\n", flags);
hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0);
ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); ok(hr == S_OK, "ProcessInput returned %#lx\n", hr);
ret = IMFSample_Release(input_sample); ret = IMFSample_Release(input_sample);
ok(ret <= 1, "Release returned %lu\n", ret); ok(ret <= 1, "Release returned %lu\n", ret);
input_sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len); input_sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len);
flags = 0;
hr = IMFTransform_GetInputStatus(transform, 0, &flags);
ok(hr == S_OK, "Got %#lx\n", hr);
ok(flags == MFT_INPUT_STATUS_ACCEPT_DATA, "Got flags %#lx.\n", flags);
hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0);
ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); ok(hr == S_OK, "ProcessInput returned %#lx\n", hr);
ret = IMFSample_Release(input_sample); ret = IMFSample_Release(input_sample);
...@@ -3757,6 +3771,23 @@ static void test_h264_decoder(void) ...@@ -3757,6 +3771,23 @@ static void test_h264_decoder(void)
ret = IMFSample_Release(output_sample); ret = IMFSample_Release(output_sample);
ok(ret == 0, "Release returned %lu\n", ret); ok(ret == 0, "Release returned %lu\n", ret);
do
{
flags = 0;
hr = IMFTransform_GetInputStatus(transform, 0, &flags);
ok(hr == S_OK, "Got %#lx\n", hr);
ok(flags == MFT_INPUT_STATUS_ACCEPT_DATA, "Got flags %#lx.\n", flags);
hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0);
ok(hr == S_OK || hr == MF_E_NOTACCEPTING, "Got %#lx\n", hr);
input_sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len);
} while (hr == S_OK);
ok(hr == MF_E_NOTACCEPTING, "Got %#lx\n", hr);
flags = 0;
hr = IMFTransform_GetInputStatus(transform, 0, &flags);
ok(hr == S_OK, "Got %#lx\n", hr);
ok(flags == MFT_INPUT_STATUS_ACCEPT_DATA, "Got flags %#lx.\n", flags);
ret = IMFTransform_Release(transform); ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %lu\n", ret); ok(ret == 0, "Release returned %lu\n", ret);
ret = IMFSample_Release(input_sample); ret = IMFSample_Release(input_sample);
......
...@@ -548,8 +548,15 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD ...@@ -548,8 +548,15 @@ static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD
static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags) static HRESULT WINAPI transform_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
{ {
FIXME("iface %p, id %#lx, flags %p stub!\n", iface, id, flags); struct h264_decoder *decoder = impl_from_IMFTransform(iface);
return E_NOTIMPL;
TRACE("iface %p, id %#lx, flags %p.\n", iface, id, flags);
if (!decoder->wg_transform)
return MF_E_TRANSFORM_TYPE_NOT_SET;
*flags = MFT_INPUT_STATUS_ACCEPT_DATA;
return S_OK;
} }
static HRESULT WINAPI transform_GetOutputStatus(IMFTransform *iface, DWORD *flags) static HRESULT WINAPI transform_GetOutputStatus(IMFTransform *iface, DWORD *flags)
......
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