Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

Using MP3 decoder directly, without session

$
0
0

Hello,

I wish to use the MP3 decoder object on Windows 7, to feed him some MP3 data, and read back some PCM samples. I'm having a hard time using the API to make it work. I'm wondering if anyone could manage something like this, or if anyone knows of an exemple where it is used like that. I've look into many open source project, but found no one using this...

I've read from http://social.msdn.microsoft.com/Forums/en-US/a7dd62e4-6d65-433c-a715-43b4a39230bd/mp3-decoder-filter-missing-in-vista?forum=windowsdirectshowdevelopment that the decoder might be deliberately crippled, but if so, why put it in the documentation ? Maybe I have to use it with the DirectShow APIs  ?? 

So here is my problem. I successfully instantiate the CLSID_CMP3DecMediaObject object with CoCreateInstance, I can use GetStreamCount which gives me 1 input and 0 output :

hr = CoCreateInstance(&CLSID_CMP3DecMediaObject, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, &mp3CoObject);
hr = mp3CoObject->GetStreamCount(mp3CoObject, &cInputStreams,&cOutputStreams);

Then, I cannot configure it further.

When I call SetInputType with MP3 format on it, I get a MF_E_INVALIDMEDIATYPE error. Maybe I give him a bad media type (see next lines), but I don't really know what to give...

MFCreateMediaType(&inputMediaType);
hr = inputMediaType->SetGUID(inputMediaType, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio);
hr = inputMediaType->SetGUID(inputMediaType, &MF_MT_SUBTYPE, &MFAudioFormat_MP3);
hr = inputMediaType->SetUINT32(inputMediaType, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);

Then, ignoring this error, I get MF_E_TRANSFORM_TYPE_NOT_SET on SetOutputType or GetOutputAvailableType call.

I've got the same kind of problem using the DMO apis btw...

Any idea please ?

Fred


Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>