locked
throw MF_E_INVALIDMEDIATYPE error in custom decoder RRS feed

  • Question

  • Hi,
    Now I want to play ogg file by use media foundation. 
    I have created a custom media source “oggsource” which base on the sample code wavsource project
    and I have created a custom mft "oggdecoder" which base on the sample code mpeg1decoder.
    oggdecoder's InputTypes is { MFMediaType_Audio, MFAudioFormat_OGG}  // MFAudioFormat_OGG is a custom subtype and I have register it.
    oggdecoder's OutputTypes is { MFMediaType_Audio, MFAudioFormat_PCM}
    when I debug the decoder then it will show a message: Play error hr:0xC00D36B4, it means invalid media type
    when I debug in topoedit then it will show a message: The data specified for the media type is invalid, inconsistent, or not supported by this object.

    I'm new on media foundation, How should I do?


    • Edited by troyou Wednesday, May 2, 2012 9:01 AM locate question
    Wednesday, May 2, 2012 4:08 AM

Answers

  • hi there,

    is the audio subtype everything you added to your media type? even if this might be enough for your mft as input type, i guess just havingthe subtype in the output type might not be enogh information for the rest of the topology. you might need additional information like avg bytes/s, number of channels, sample size, etc.

    • Marked as answer by troyou Wednesday, May 2, 2012 8:45 AM
    Wednesday, May 2, 2012 7:25 AM

All replies

  • hi there,

    is the audio subtype everything you added to your media type? even if this might be enough for your mft as input type, i guess just havingthe subtype in the output type might not be enogh information for the rest of the topology. you might need additional information like avg bytes/s, number of channels, sample size, etc.

    • Marked as answer by troyou Wednesday, May 2, 2012 8:45 AM
    Wednesday, May 2, 2012 7:25 AM
  • hi Joachim. thanks for you answer.

    I have tried this in IMFTransform::GetOutputAvailableType

    MFCreateMediaType(&pOutputType);

    pOutputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT,1); pOutputType->SetUINT32(MF_MT_COMPRESSED,1); pOutputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES,1); pOutputType->SetUINT32(MF_MT_SAMPLE_SIZE,1); pOutputType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS,2); pOutputType->SetUINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND,44100); pOutputType->SetUINT32(MF_MT_AUDIO_FLOAT_SAMPLES_PER_SECOND,44100); pOutputType->SetUINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND,176400); pOutputType->SetUINT32(MF_MT_AUDIO_BITS_PER_SAMPLE,16); pOutputType->SetUINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT,4); pOutputType->SetUINT32(MF_MT_ORIGINAL_WAVE_FORMAT_TAG,1);

    but it still show the same error msg, is there I missing something?

    • Marked as answer by troyou Wednesday, May 2, 2012 8:45 AM
    • Unmarked as answer by troyou Wednesday, May 2, 2012 8:45 AM
    Wednesday, May 2, 2012 8:27 AM
  • Hi

    Now I can render ogg file in topoedit and it doesn't work before. but when I play it will still show a msg: Error starting playback,The data specified for the media type is invalid, inconsistent, or not supported by this object."

    thx~

    Wednesday, May 2, 2012 8:39 AM
  • now it's ok:)
    Wednesday, May 2, 2012 10:01 AM