I’m still a bit new to directshow filters and am studying the base classes closely. One thing that has come up almost immediately is the base implementation of CMediaType::IsPartiallySpecified.
It reads:
if ((majortype == GUID_NULL) ||
(formattype == GUID_NULL)) {
return TRUE;
} else {
return FALSE;
}
but surely it should read:
if ((majortype == GUID_NULL) ||
(subtype == GUID_NULL) ||
(formattype == GUID_NULL)) {
return TRUE;
} else {
return FALSE;
}
It doesn’t inspire confidence in the rest of the classes. Is there an errata published somewhere?
It should read the way it is, and it should not read the way you think it surely should read.
Partialmeans that major type and/or format type are intentionally omitted.You will also be surprised that
IsPartiallySpecifiedis almost not used within DirectShow SDK and dependent filter, and even if you break it the rest will still work rock solid. The idea around partially specified media types is to be able give a hint on filter capabilities. This still has a very limited use.Partial media type is something like major type and subtype only, for the input pin to say “Hey, I don’t have media type to try but I think I have an idea what it should approximately look like”.