I`m trying to buld MFT but I can't set collect type that caller accepts.
Caller just keeps calling IMFTransform::GetOutputCurrentType and IMFTransform::GetOutputAvailableType over and over again. What kind of types should I set just setting GUID of MF_MT_MAJOR_TYPE and MF_MT_SUBTYPE ok
accoding to Media Foundation Transform document p.2 Sequence OfEvents "10. Caller calls GetOutputAvailableType iteratively on every output stream until the caller either exhausts the available types for that stream or finds one it likes. If the transform returns E_NOTIMPL, it moves on to setting the output types (step 11). (optional)"
I tryed retruning E_NOTIMPL form GetOutputAvailableType but keeps going back to step 9.

IMFTransform::SetOutputType is never called.
JimmyS
Hi Kasumi,
I'll probably need a little more info from you to start answering your questions.
First off, when you talk about the calls you're getting from the "caller" -- what is the calling code Have you included this MFT in a topology which you passed to IMFMediaSession::SetTopology, or are you doing something else with your MFT
The fact that you're not fully specifying your media type is very likely at least part of the problem. The GetOutputCurrent/AvailableType types should be as fully specified as possible. What attributes you need to set depends on what type of MFT it is. The Windows SDK includes a sample MFT that does "grayscale" and works on video types -- this will give you an example of what kinds of things would need to be specified in a video media type. If it is the topology loader inside the Media Session making these calls, perhaps it is getting confused by the incompletely-specified media types.
Becky
MatthewVincent
Dear Kasumi,
I think you modify sample code from Windows SDK. Grayscale MFT sample miss something.
Try to add the following code in your "GetOutputAvailableType()"
if (dwTypeIndex >= /* your max available type*/) {
return MF_E_NO_MORE_TYPES;
}
But I think you will get the error code if you add this code segment.
Caller, media session I think, will call those two functions again and again just because there is no suitable type for connection, I think.
Hope this useful. If I am wrong, please advice.
Padmaja T Chavali
Thank you Becky and Legis
I'm trying to write MPEG2 decoder using MFT and modifying GrayscaleMFT and
using PLaybackFX sample as test player.
GrayscaleMFT only set same types that came from input to output.
I chagned little to jest setting GUID of MF_MT_MAJOR_TYPE and MF_MT_SUBTYPE but it didn't work. What are the minimum type should I set
Are there any good test tool like graphEdit in dShow
Are there any mpeg2 file source sample
jschroedl
So I assume at this point you already know the input type
Essentially, you'll need to advertise an output type that the video renderer can accept. So first off, make sure that your majortype is MFMediaType_Video and your subtype is a valid uncompressed video subtype (the GrayscaleMFT sample has some... see g_MediaSubtypes[] in that sample). Then you'll need to set some basic attributes like the frame size (MF_MT_FRAME_SIZE), frame rate (MF_MT_FRAME_RATE), and the interlace mode (MF_MT_INTERLACE_MODE). Because the video renderer can't very well render frames if it doesn't know stuff like this about them :-) Try these and see how it goes.
To get started, you could even start by looking through all the attributes on the input type and seeing which you want to keep... Though that might be more educational than anything else.
And just as a sanity check: you'll need to have source nodes for an MPEG2 source in your topology for any of this to work (your question indicates to me that you might not have your Media Source yet, which could be part of the problem). And the media types in the Presentation Descriptor coming from this Media Source need to correctly reflect what's in your content.
Hope this helps,
Becky