On Fri Mar 21 10:15:56 2025 +0000, Nikolay Sivov wrote:
Do we need to try? We know that on mismatching subtypes we need an encoder. Are there any other cases?
Basically, I do this because we are already doing this in reader, see [reader.c](https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mfreadwrite/reader.c?...).
But like you said, the only situation we need an encoder is that the input type is uncompressed and stream type is compressed, it should be ok to check that. Do you think we should check the type rather than try creating it? Maybe with something like this:
``` uncompressed_types = {...};
bool is_type_compressed(GUID *subtype) { for (i : uncompressed_types) if is equal guid, return false; return true; }
sink_writer_SetInputMediaType { use_encoder = !input_compressed && stream_compressed; ... if (!(flags & MF_MEDIATYPE_EQUAL_FORMAT_DATA)) hr = stream_create_transforms(stream, type, stream_type, use_encoder); } ``` I don't find any api that can check if a subtype is compressed or not.