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

IMFTransform::SetInput failing with MF_E_ATTRIBUTENOTFOUND on Windows 8.1

$
0
0

I am trying to configure a IMFTransform instance to convert between YUY2 and RGB24. I can get the pointer to the IMFTransform but attempts to call SetInput always ends with a MF_E_ATTRIBUTENOTFOUND error. This particular error is not documented on MSDN for that method so I'm not clear on what the problem is. I've tried two approaches, manually creating the IMFMediaType to specify and iterating over GetInputAvailableType's results and using the one that was directly provided and both result in a MF_E_ATTRIBUTENOTFOUND error. Is there something that I'm not aware of or not doing with respect the transform? Or is YUY2 to RGB24 somehow impossible? Below is the code relevant to the issue.

MFT_REGISTER_TYPE_INFO inputFormat;
MFT_REGISTER_TYPE_INFO outputFormat;

inputFormat.guidMajorType = MFMediaType_Video;
inputFormat.guidSubtype = MFVideoFormat_YUY2;
outputFormat.guidMajorType = MFMediaType_Video;
outputFormat.guidSubtype = MFVideoFormat_RGB24;

hr = MFTEnumEx(
  MFT_CATEGORY_VIDEO_PROCESSOR,
  MFT_ENUM_FLAG_SYNCMFT | MFT_ENUM_FLAG_LOCALMFT | MFT_ENUM_FLAG_SORTANDFILTER,
  &inputFormat,&outputFormat,&transformFilters,&filterCount);

// Only one transform is found.
transformFilters[0]->ActivateObject(IID_PPV_ARGS(&pTransformer));

// This particular transform has only one stream for both input and output as GetStreamCount returns a not implemented error.
DWORD typeIndex = 0;
do {
  hr = pTransformer->GetInputAvailableType(0, typeIndex, &currentMediaType);
  currentMediaType->GetGUID(MF_MT_SUBTYPE, &mediaSubGUID);
  if (mediaSubGUID == MFVideoFormat_YUY2)
  {
    // This call is always failing with MF_E_ATTRIBUTENOTFOUND
    hr = pTransformer->SetInputType(0, currentMediaType, 0);
    currentMediaType->Release();
    break;
  }
  currentMediaType->Release();++typeIndex;
} while (hr != MF_E_NO_MORE_TYPES);


Viewing all articles
Browse latest Browse all 1079

Trending Articles



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