winegstreamer: Check whether transforms are supported at creation time.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52908
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52914
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-04-27 20:41:26 +02:00 committed by Alexandre Julliard
parent 8c5207f6a7
commit 3aaa953bd6
2 changed files with 39 additions and 0 deletions

View file

@ -595,10 +595,29 @@ static const IMFTransformVtbl transform_vtbl =
HRESULT h264_decoder_create(REFIID riid, void **ret)
{
struct wg_format output_format =
{
.major_type = WG_MAJOR_TYPE_VIDEO,
.u.video =
{
.format = WG_VIDEO_FORMAT_I420,
.width = 1920,
.height = 1080,
},
};
struct wg_format input_format = {.major_type = WG_MAJOR_TYPE_H264};
struct wg_transform *transform;
struct h264_decoder *decoder;
TRACE("riid %s, ret %p.\n", debugstr_guid(riid), ret);
if (!(transform = wg_transform_create(&input_format, &output_format)))
{
FIXME("GStreamer doesn't support H264 decoding, please install appropriate plugins\n");
return E_FAIL;
}
wg_transform_destroy(transform);
if (!(decoder = calloc(1, sizeof(*decoder))))
return E_OUTOFMEMORY;

View file

@ -853,10 +853,30 @@ static const IPropertyBagVtbl property_bag_vtbl =
HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out)
{
struct wg_format output_format =
{
.major_type = WG_MAJOR_TYPE_AUDIO,
.u.audio =
{
.format = WG_AUDIO_FORMAT_F32LE,
.channel_mask = 1,
.channels = 1,
.rate = 44100,
},
};
struct wg_format input_format = {.major_type = WG_MAJOR_TYPE_WMA};
struct wg_transform *transform;
struct wma_decoder *decoder;
TRACE("outer %p, out %p.\n", outer, out);
if (!(transform = wg_transform_create(&input_format, &output_format)))
{
FIXME("GStreamer doesn't support WMA decoding, please install appropriate plugins\n");
return E_FAIL;
}
wg_transform_destroy(transform);
if (!(decoder = calloc(1, sizeof(*decoder))))
return E_OUTOFMEMORY;