[PATCH resend 4/5] winegstreamer: Implement ::Get(Input/Output)StreamInfo for audio conversion transform.

Derek Lesho dlesho at codeweavers.com
Mon Jan 25 09:20:30 CST 2021


On 1/25/21 10:09 AM, Nikolay Sivov wrote:

>
> On 1/18/21 10:30 PM, Derek Lesho wrote:
>> Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
>> ---
>>   dlls/winegstreamer/audioconvert.c | 26 ++++++++++++++++++++++----
>>   1 file changed, 22 insertions(+), 4 deletions(-)
>>
>> diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
>> index e16fc6f1a78..a95fc5506e7 100644
>> --- a/dlls/winegstreamer/audioconvert.c
>> +++ b/dlls/winegstreamer/audioconvert.c
>> @@ -123,16 +123,34 @@ static HRESULT WINAPI audio_converter_GetStreamIDs(IMFTransform *iface, DWORD in
>>   
>>   static HRESULT WINAPI audio_converter_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
>>   {
>> -    FIXME("%p %u %p.\n", iface, id, info);
>> +    TRACE("%p %u %p.\n", iface, id, info);
>>   
>> -    return E_NOTIMPL;
>> +    if (id != 0)
>> +        return MF_E_INVALIDSTREAMNUMBER;
>> +
>> +    info->dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_DOES_NOT_ADDREF;
>> +    info->cbMaxLookahead = 0;
>> +    info->cbAlignment = 0;
>> +    info->hnsMaxLatency = 0;
>> +    /* TODO: this can be calculated using MFCalculateImageSize */
>> +    info->cbSize = 0;
>> +
>> +    return S_OK;
>>   }
>>   
>>   static HRESULT WINAPI audio_converter_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
>>   {
>> -    FIXME("%p %u %p.\n", iface, id, info);
>> +    TRACE("%p %u %p.\n", iface, id, info);
>>   
>> -    return E_NOTIMPL;
>> +    if (id != 0)
>> +        return MF_E_INVALIDSTREAMNUMBER;
>> +
>> +    info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | MFT_OUTPUT_STREAM_WHOLE_SAMPLES;
>> +    info->cbAlignment = 0;
>> +    /* TODO: this can be calculated using MFCalculateImageSize */
>> +    info->cbSize = 0;
>> +
>> +    return S_OK;
>>   }
>>   
>>   static HRESULT WINAPI audio_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
> Was that verified with what converter returns on Windows? I could work
> on tests for that if you want, because returning something like that
> looks rather arbitrary. And comment for image size probably does not
> apply for audio.

No, that was not verified, I think the reason I kept this commit around 
is that the session needs some implementation of it.  As for the 
specific flags, I think that they match the implementation of the 
transform, we do allocate the output samples, and the whole_samples flag 
seems to be meaningless in the case of uncompressed audio.

It seems like the tests for fixing this function would be simple enough, 
so maybe I should just include them in the updated/fixed patch.

>



More information about the wine-devel mailing list