Media Foundation アーキテクチャ(2) - MFTの列挙

公開:2013-02-03 16:45
更新:2017-07-29 13:17
カテゴリ:media foundation,audio,c++,windows,windows api

私のマシンで使えるMedia Foundation Transformを列挙してみた。列挙するコードはこんな感じ。


  void print_mft_(const GUID& guid,std::wfstream& out)
  {
    co_task_memory<IMFActivate*> activate;

    UINT32 count = 0;

    HRESULT hr = MFTEnumEx(guid,MFT_ENUM_FLAG_ALL,NULL,NULL,&activate,&count);

    if(SUCCEEDED(hr) && count > 0)
    {
      for(int i = 0; i < count;++i)
      {
        UINT32 l = 0;
        UINT32 l1 = 0;
        activate.get()[i]->GetStringLength(MFT_FRIENDLY_NAME_Attribute,&l);
        std::unique_ptr<wchar_t[]> name(new wchar_t[l+1]);
        memset(name.get(),0,l+1);
        hr = activate.get()[i]->GetString(MFT_FRIENDLY_NAME_Attribute,name.get(),l+1,&l1);
        out << name.get() << std::endl;
        activate.get()[i]->Release();
      }
      //CoTaskMemFree(activate);
    }
  }

  void print_mft()
  {
    std::wfstream out(L"MFT.txt",std::ios_base::out | std::ios_base::trunc);

    out << std::endl << "**" << L"MFT_CATEGORY_AUDIO_DECODER" << L"**" << std::endl << std::endl;

    print_mft_(MFT_CATEGORY_AUDIO_DECODER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_AUDIO_EFFECT" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_AUDIO_EFFECT,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_AUDIO_ENCODER" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_AUDIO_ENCODER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_DEMULTIPLEXER" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_DEMULTIPLEXER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_MULTIPLEXER" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_MULTIPLEXER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_OTHER" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_OTHER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_VIDEO_DECODER" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_VIDEO_DECODER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_VIDEO_EFFECT" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_VIDEO_EFFECT,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_VIDEO_ENCODER" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_VIDEO_ENCODER,out);

    out << std::endl << L"**" << L"MFT_CATEGORY_VIDEO_PROCESSOR" << L"**" << std::endl << std::endl;
    print_mft_(MFT_CATEGORY_VIDEO_PROCESSOR,out);

    out.close();
  }

列挙した結果は下記の通りである。


**MFT_CATEGORY_AUDIO_DECODER**

Microsoft Dolby Digital Plus Decoder MFT
WMAudio Decoder MFT
Microsoft AAC Audio Decoder MFT
GSM ACM Wrapper MFT
WMAPro over S/PDIF MFT
Microsoft MPEG Audio Decoder MFT
WMSpeech Decoder DMO
G711 Wrapper MFT
IMA ADPCM ACM Wrapper MFT
MP3 Decoder MFT
ADPCM ACM Wrapper MFT

**MFT_CATEGORY_AUDIO_EFFECT**

AEC
Resampler MFT

**MFT_CATEGORY_AUDIO_ENCODER**

MP3 Encoder ACM Wrapper MFT
WM Speech Encoder DMO
Microsoft MPEG-2 Audio Encoder MFT
WMAudio Encoder MFT
Microsoft AAC Audio Encoder MFT
Microsoft Dolby Digital Encoder MFT

**MFT_CATEGORY_DEMULTIPLEXER**


**MFT_CATEGORY_MULTIPLEXER**

Microsoft MPEG2 Multiplexer MFT

**MFT_CATEGORY_OTHER**

Microsoft H264 Video Remux (MPEG2TSToMP4) MFT

**MFT_CATEGORY_VIDEO_DECODER**

Microsoft MPEG Video Decoder MFT
DV Decoder MFT
Mpeg4s Decoder MFT
Microsoft H264 Video Decoder MFT
WMV Screen decoder MFT
WMVideo Decoder MFT
MJPEG Decoder MFT
Mpeg43 Decoder MFT
Mpeg4 Decoder MFT

**MFT_CATEGORY_VIDEO_EFFECT**

Frame Rate Converter
Resizer MFT
VideoStabilization MFT
Color Control
Color Converter MFT

**MFT_CATEGORY_VIDEO_ENCODER**

Intelョ Quick Sync Video H.264 Encoder MFT
H264 Encoder MFT
WMVideo8 Encoder MFT
WMVideo9 Encoder MFT
Microsoft MPEG-2 Video Encoder MFT

**MFT_CATEGORY_VIDEO_PROCESSOR**

Microsoft Video Processor MFT