Skip to content

Commit

Permalink
winegstreamer: Implement H264 decoder GetInputCurrentType.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbernon authored and julliard committed Jan 30, 2024
1 parent 2d88c57 commit 6aca31f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 0 additions & 4 deletions dlls/mf/tests/mf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3622,15 +3622,11 @@ todo_wine {
IUnknown_Release(node_object);

hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
todo_wine
ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr);
if (hr == S_OK)
{
hr = IMFMediaType_Compare(input_type, (IMFAttributes *)media_type, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &ret);
ok(hr == S_OK, "Failed to compare media types, hr %#lx.\n", hr);
ok(ret, "Input type of first transform doesn't match source node type.\n");
IMFMediaType_Release(media_type);
}

hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type);
ok(hr == S_OK, "Failed to get transform input type, hr %#lx.\n", hr);
Expand Down
2 changes: 1 addition & 1 deletion dlls/mf/tests/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -4262,7 +4262,7 @@ static void test_h264_decoder(void)

check_mft_set_input_type_required(transform, input_type_desc);
check_mft_set_input_type(transform, input_type_desc);
check_mft_get_input_current_type_(transform, expect_input_type_desc, TRUE, FALSE);
check_mft_get_input_current_type_(transform, expect_input_type_desc, FALSE, TRUE);

check_mft_get_input_stream_info(transform, S_OK, &input_info);
check_mft_get_output_stream_info(transform, S_OK, &output_info);
Expand Down
16 changes: 13 additions & 3 deletions dlls/winegstreamer/h264_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,26 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF

static HRESULT WINAPI transform_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{
FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type);
return E_NOTIMPL;
struct h264_decoder *decoder = impl_from_IMFTransform(iface);
HRESULT hr;

TRACE("iface %p, id %#lx, type %p\n", iface, id, type);

if (!decoder->input_type)
return MF_E_TRANSFORM_TYPE_NOT_SET;

if (FAILED(hr = MFCreateMediaType(type)))
return hr;

return IMFMediaType_CopyAllItems(decoder->input_type, (IMFAttributes *)*type);
}

static HRESULT WINAPI transform_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
{
struct h264_decoder *decoder = impl_from_IMFTransform(iface);
HRESULT hr;

FIXME("iface %p, id %#lx, type %p stub!\n", iface, id, type);
TRACE("iface %p, id %#lx, type %p\n", iface, id, type);

if (!decoder->output_type)
return MF_E_TRANSFORM_TYPE_NOT_SET;
Expand Down

0 comments on commit 6aca31f

Please sign in to comment.