From: Rémi Bernon rbernon@codeweavers.com
Fixes 681d20146226132c2ed18ae7ecb53003e6ffcf44. The winegstreamer private declaration of HEAACWAVEINFO previously didn't include the WAVEFORMATEX member as it should. --- dlls/winegstreamer/mfplat.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 82fb19126bb..e6d9fb9fd2c 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -634,12 +634,14 @@ static void mf_media_type_to_wg_format_audio(IMFMediaType *type, const GUID *sub
static void mf_media_type_to_wg_format_audio_mpeg4(IMFMediaType *type, const GUID *subtype, struct wg_format *format) { - BYTE buffer[64]; - HEAACWAVEFORMAT *user_data = (HEAACWAVEFORMAT *)buffer; + BYTE buffer[sizeof(HEAACWAVEFORMAT) + 64]; + HEAACWAVEFORMAT *wfx = (HEAACWAVEFORMAT *)buffer; UINT32 codec_data_size; BOOL raw_aac;
- if (FAILED(IMFMediaType_GetBlob(type, &MF_MT_USER_DATA, buffer, sizeof(buffer), &codec_data_size))) + wfx->wfInfo.wfx.cbSize = sizeof(buffer) - sizeof(wfx->wfInfo.wfx); + if (FAILED(IMFMediaType_GetBlob(type, &MF_MT_USER_DATA, (BYTE *)(&wfx->wfInfo.wfx + 1), + wfx->wfInfo.wfx.cbSize, &codec_data_size))) { FIXME("Codec data is not set.\n"); return; @@ -647,16 +649,16 @@ static void mf_media_type_to_wg_format_audio_mpeg4(IMFMediaType *type, const GUI
raw_aac = IsEqualGUID(subtype, &MFAudioFormat_RAW_AAC); if (!raw_aac) - codec_data_size -= min(codec_data_size, offsetof(HEAACWAVEFORMAT, pbAudioSpecificConfig)); + codec_data_size -= min(codec_data_size, sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)); if (codec_data_size > sizeof(format->u.audio_mpeg4.codec_data)) { FIXME("Codec data needs %u bytes.\n", codec_data_size); return; } if (raw_aac) - memcpy(format->u.audio_mpeg4.codec_data, buffer, codec_data_size); + memcpy(format->u.audio_mpeg4.codec_data, (BYTE *)(&wfx->wfInfo.wfx + 1), codec_data_size); else - memcpy(format->u.audio_mpeg4.codec_data, user_data->pbAudioSpecificConfig, codec_data_size); + memcpy(format->u.audio_mpeg4.codec_data, wfx->pbAudioSpecificConfig, codec_data_size);
format->major_type = WG_MAJOR_TYPE_AUDIO_MPEG4;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/aac_decoder.c | 203 ++++++++++--------------------- 1 file changed, 66 insertions(+), 137 deletions(-)
diff --git a/dlls/winegstreamer/aac_decoder.c b/dlls/winegstreamer/aac_decoder.c index dfab7a8b0c0..811313b6fe4 100644 --- a/dlls/winegstreamer/aac_decoder.c +++ b/dlls/winegstreamer/aac_decoder.c @@ -32,22 +32,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); WINE_DECLARE_DEBUG_CHANNEL(winediag);
-static struct +static HEAACWAVEINFO aac_decoder_input_types[] = { - const GUID *const guid; - UINT32 payload_type; -} aac_decoder_input_types[] = -{ - {&MFAudioFormat_AAC, 0}, - {&MFAudioFormat_RAW_AAC, -1}, - {&MFAudioFormat_AAC, 1}, - {&MFAudioFormat_AAC, 3}, - {&MFAudioFormat_ADTS, -1}, +#define MAKE_HEAACWAVEINFO(format, payload) \ + {.wfx = {.wFormatTag = format, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ + .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)}, \ + .wPayloadType = payload} + + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 0), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_RAW_AAC1, 0), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 1), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 3), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_ADTS_AAC, 0), + +#undef MAKE_HEAACWAVEINFO }; -static const GUID *const aac_decoder_output_types[] = + +static WAVEFORMATEXTENSIBLE const aac_decoder_output_types[] = { - &MFAudioFormat_PCM, - &MFAudioFormat_Float, + {.Format = {.wFormatTag = WAVE_FORMAT_IEEE_FLOAT, .wBitsPerSample = 32, .nSamplesPerSec = 48000, .nChannels = 2}}, + {.Format = {.wFormatTag = WAVE_FORMAT_PCM, .wBitsPerSample = 16, .nSamplesPerSec = 48000, .nChannels = 2}}, };
static const UINT32 default_channel_mask[7] = @@ -234,79 +238,41 @@ static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD strea static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - IMFMediaType *media_type; - const GUID *subtype; - HRESULT hr; - TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type);
+ *type = NULL; if (id) return MF_E_INVALIDSTREAMNUMBER; - - *type = NULL; if (index >= ARRAY_SIZE(aac_decoder_input_types)) return MF_E_NO_MORE_TYPES; - subtype = aac_decoder_input_types[index].guid; - - if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; - - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) - goto done; - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, subtype))) - goto done; - - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 32))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, 6))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, 24))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, 48000))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 1152000))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_PREFER_WAVEFORMATEX, 1))) - goto done; - if (IsEqualGUID(subtype, &MFAudioFormat_AAC)) - { - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, 0))) - goto done; - if (aac_decoder_input_types[index].payload_type != -1 - && FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AAC_PAYLOAD_TYPE, - aac_decoder_input_types[index].payload_type))) - goto done; - } - -done: - if (SUCCEEDED(hr)) - IMFMediaType_AddRef((*type = media_type)); - - IMFMediaType_Release(media_type); - return hr; + return MFCreateAudioMediaType(&aac_decoder_input_types[index].wfx, (IMFAudioMediaType **)type); }
static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { - UINT32 channel_count, sample_size, sample_rate, block_alignment; struct aac_decoder *decoder = impl_from_IMFTransform(iface); + UINT32 channel_count, sample_rate; + WAVEFORMATEXTENSIBLE wfx = {{0}}; IMFMediaType *media_type; - const GUID *output_type; HRESULT hr;
TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type);
+ *type = NULL; + if (id) return MF_E_INVALIDSTREAMNUMBER; if (!decoder->input_type) return MF_E_TRANSFORM_TYPE_NOT_SET;
- *type = NULL; + wfx = aac_decoder_output_types[index % ARRAY_SIZE(aac_decoder_output_types)];
if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_NUM_CHANNELS, &channel_count)) || !channel_count) - channel_count = 2; + channel_count = wfx.Format.nChannels; + if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &sample_rate))) + sample_rate = wfx.Format.nSamplesPerSec;
if (channel_count >= ARRAY_SIZE(default_channel_mask)) return MF_E_INVALIDMEDIATYPE; @@ -321,54 +287,24 @@ static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWOR
if (index >= ARRAY_SIZE(aac_decoder_output_types)) return MF_E_NO_MORE_TYPES; - index = ARRAY_SIZE(aac_decoder_output_types) - index - 1; - output_type = aac_decoder_output_types[index];
- if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; + wfx.Format.nChannels = channel_count; + wfx.Format.nSamplesPerSec = sample_rate; + wfx.Format.nBlockAlign = wfx.Format.wBitsPerSample * wfx.Format.nChannels / 8; + wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
- if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) - goto done; - if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, output_type))) - goto done; - - if (IsEqualGUID(output_type, &MFAudioFormat_Float)) - sample_size = 32; - else if (IsEqualGUID(output_type, &MFAudioFormat_PCM)) - sample_size = 16; - else + if (wfx.Format.nChannels >= 3) { - FIXME("Subtype %s not implemented!\n", debugstr_guid(output_type)); - hr = E_NOTIMPL; - goto done; + wfx.SubFormat = MFAudioFormat_Base; + wfx.SubFormat.Data1 = wfx.Format.wFormatTag; + wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfx.dwChannelMask = default_channel_mask[wfx.Format.nChannels]; }
- if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, sample_size))) - goto done; - - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_NUM_CHANNELS, channel_count))) - goto done; - - if (FAILED(hr = IMFMediaType_GetUINT32(decoder->input_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &sample_rate))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, sample_rate))) - goto done; - - block_alignment = sample_size * channel_count / 8; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, block_alignment))) - goto done; - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, sample_rate * block_alignment))) - goto done; - - if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1))) - goto done; + if (FAILED(hr = MFCreateAudioMediaType(&wfx.Format, (IMFAudioMediaType **)&media_type))) + return hr; if (FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, 1))) goto done; - if (channel_count < 3 && FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_PREFER_WAVEFORMATEX, 1))) - goto done; - if (channel_count >= 3 && FAILED(hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_CHANNEL_MASK, - default_channel_mask[channel_count]))) - goto done;
done: if (SUCCEEDED(hr)) @@ -378,12 +314,22 @@ done: return hr; }
+static BOOL matches_format(const WAVEFORMATEXTENSIBLE *a, const WAVEFORMATEXTENSIBLE *b) +{ + if (a->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE && b->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) + return IsEqualGUID(&a->SubFormat, &b->SubFormat); + if (a->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) + return a->SubFormat.Data1 == b->Format.wFormatTag; + if (b->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE) + return b->SubFormat.Data1 == a->Format.wFormatTag; + return a->Format.wFormatTag == b->Format.wFormatTag; +} + static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct aac_decoder *decoder = impl_from_IMFTransform(iface); - MF_ATTRIBUTE_TYPE item_type; - UINT32 channel_count; - GUID major, subtype; + WAVEFORMATEXTENSIBLE *format, wfx; + UINT32 size; HRESULT hr; ULONG i;
@@ -392,28 +338,19 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM if (id) return MF_E_INVALIDSTREAMNUMBER;
- if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major))) - return E_INVALIDARG; - - if (!IsEqualGUID(&major, &MFMediaType_Audio) - || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) - return MF_E_INVALIDMEDIATYPE; + if (FAILED(hr = MFCreateWaveFormatExFromMFMediaType(type, (WAVEFORMATEX **)&format, &size, + MFWaveFormatExConvertFlag_ForceExtensible))) + return hr; + wfx = *format; + CoTaskMemFree(format);
for (i = 0; i < ARRAY_SIZE(aac_decoder_input_types); ++i) - if (IsEqualGUID(&subtype, aac_decoder_input_types[i].guid)) + if (matches_format((WAVEFORMATEXTENSIBLE *)&aac_decoder_input_types[i], &wfx)) break; if (i == ARRAY_SIZE(aac_decoder_input_types)) return MF_E_INVALIDMEDIATYPE;
- if (SUCCEEDED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &channel_count)) - && channel_count >= ARRAY_SIZE(default_channel_mask)) - return MF_E_INVALIDMEDIATYPE; - - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_USER_DATA, &item_type)) - || item_type != MF_ATTRIBUTE_BLOB) + if (wfx.Format.nChannels >= ARRAY_SIZE(default_channel_mask) || !wfx.Format.nSamplesPerSec || !wfx.Format.cbSize) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK; @@ -433,8 +370,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct aac_decoder *decoder = impl_from_IMFTransform(iface); - MF_ATTRIBUTE_TYPE item_type; - GUID major, subtype; + WAVEFORMATEXTENSIBLE *format, wfx; + UINT32 size; HRESULT hr; ULONG i;
@@ -445,27 +382,19 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (!decoder->input_type) return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) - || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) + if (FAILED(hr = MFCreateWaveFormatExFromMFMediaType(type, (WAVEFORMATEX **)&format, &size, + MFWaveFormatExConvertFlag_ForceExtensible))) return hr; - - if (!IsEqualGUID(&major, &MFMediaType_Audio)) - return MF_E_INVALIDMEDIATYPE; + wfx = *format; + CoTaskMemFree(format);
for (i = 0; i < ARRAY_SIZE(aac_decoder_output_types); ++i) - if (IsEqualGUID(&subtype, aac_decoder_output_types[i])) + if (matches_format(&aac_decoder_output_types[i], &wfx)) break; if (i == ARRAY_SIZE(aac_decoder_output_types)) return MF_E_INVALIDMEDIATYPE;
- if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_BITS_PER_SAMPLE, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_NUM_CHANNELS, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &item_type)) - || item_type != MF_ATTRIBUTE_UINT32) + if (!wfx.Format.wBitsPerSample || !wfx.Format.nChannels || !wfx.Format.nSamplesPerSec) return MF_E_INVALIDMEDIATYPE; if (flags & MFT_SET_TYPE_TEST_ONLY) return S_OK;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/aac_decoder.c | 58 +++++++++++++++++++------------- 1 file changed, 34 insertions(+), 24 deletions(-)
diff --git a/dlls/winegstreamer/aac_decoder.c b/dlls/winegstreamer/aac_decoder.c index 811313b6fe4..c0bc57f278e 100644 --- a/dlls/winegstreamer/aac_decoder.c +++ b/dlls/winegstreamer/aac_decoder.c @@ -32,21 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat); WINE_DECLARE_DEBUG_CHANNEL(winediag);
-static HEAACWAVEINFO aac_decoder_input_types[] = -{ -#define MAKE_HEAACWAVEINFO(format, payload) \ - {.wfx = {.wFormatTag = format, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ - .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)}, \ - .wPayloadType = payload} - - MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 0), - MAKE_HEAACWAVEINFO(WAVE_FORMAT_RAW_AAC1, 0), - MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 1), - MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 3), - MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_ADTS_AAC, 0), - -#undef MAKE_HEAACWAVEINFO -}; +#define NEXT_WAVEFORMATEXTENSIBLE(format) (WAVEFORMATEXTENSIBLE *)((BYTE *)(&(format)->Format + 1) + (format)->Format.cbSize)
static WAVEFORMATEXTENSIBLE const aac_decoder_output_types[] = { @@ -69,6 +55,10 @@ struct aac_decoder { IMFTransform IMFTransform_iface; LONG refcount; + + UINT input_type_count; + WAVEFORMATEXTENSIBLE *input_types; + IMFMediaType *input_type; IMFMediaType *output_type;
@@ -238,14 +228,18 @@ static HRESULT WINAPI transform_AddInputStreams(IMFTransform *iface, DWORD strea static HRESULT WINAPI transform_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index, IMFMediaType **type) { + struct aac_decoder *decoder = impl_from_IMFTransform(iface); + const WAVEFORMATEXTENSIBLE *format = decoder->input_types; + UINT count = decoder->input_type_count; + TRACE("iface %p, id %#lx, index %#lx, type %p.\n", iface, id, index, type);
*type = NULL; if (id) return MF_E_INVALIDSTREAMNUMBER; - if (index >= ARRAY_SIZE(aac_decoder_input_types)) - return MF_E_NO_MORE_TYPES; - return MFCreateAudioMediaType(&aac_decoder_input_types[index].wfx, (IMFAudioMediaType **)type); + for (format = decoder->input_types; index > 0 && count > 0; index--, count--) + format = NEXT_WAVEFORMATEXTENSIBLE(format); + return count ? MFCreateAudioMediaType(&format->Format, (IMFAudioMediaType **)type) : MF_E_NO_MORE_TYPES; }
static HRESULT WINAPI transform_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index, @@ -328,10 +322,9 @@ static BOOL matches_format(const WAVEFORMATEXTENSIBLE *a, const WAVEFORMATEXTENS static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags) { struct aac_decoder *decoder = impl_from_IMFTransform(iface); + UINT32 size, count = decoder->input_type_count; WAVEFORMATEXTENSIBLE *format, wfx; - UINT32 size; HRESULT hr; - ULONG i;
TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags);
@@ -344,10 +337,9 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM wfx = *format; CoTaskMemFree(format);
- for (i = 0; i < ARRAY_SIZE(aac_decoder_input_types); ++i) - if (matches_format((WAVEFORMATEXTENSIBLE *)&aac_decoder_input_types[i], &wfx)) - break; - if (i == ARRAY_SIZE(aac_decoder_input_types)) + for (format = decoder->input_types; count > 0 && !matches_format(format, &wfx); count--) + format = NEXT_WAVEFORMATEXTENSIBLE(format); + if (!count) return MF_E_INVALIDMEDIATYPE;
if (wfx.Format.nChannels >= ARRAY_SIZE(default_channel_mask) || !wfx.Format.nSamplesPerSec || !wfx.Format.cbSize) @@ -574,6 +566,22 @@ static const IMFTransformVtbl transform_vtbl = transform_ProcessOutput, };
+static HEAACWAVEINFO aac_decoder_input_types[] = +{ +#define MAKE_HEAACWAVEINFO(format, payload) \ + {.wfx = {.wFormatTag = format, .nChannels = 6, .nSamplesPerSec = 48000, .nAvgBytesPerSec = 1152000, \ + .nBlockAlign = 24, .wBitsPerSample = 32, .cbSize = sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX)}, \ + .wPayloadType = payload} + + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 0), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_RAW_AAC1, 0), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 1), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_HEAAC, 3), + MAKE_HEAACWAVEINFO(WAVE_FORMAT_MPEG_ADTS_AAC, 0), + +#undef MAKE_HEAACWAVEINFO +}; + HRESULT aac_decoder_create(REFIID riid, void **ret) { static const struct wg_format output_format = @@ -604,6 +612,8 @@ HRESULT aac_decoder_create(REFIID riid, void **ret)
if (!(decoder = calloc(1, sizeof(*decoder)))) return E_OUTOFMEMORY; + decoder->input_types = (WAVEFORMATEXTENSIBLE *)aac_decoder_input_types; + decoder->input_type_count = ARRAY_SIZE(aac_decoder_input_types);
if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) {
This merge request was approved by Zebediah Figura.