我正在尝试通过使用内存流作为源流将动态生成的数据馈送到 Media Foundation Source Reader:
InMemoryRandomAccessStream^ memstream = ref new InMemoryRandomAccessStream();
IRandomAccessStream^ pInputStream = (IRandomAccessStream^)memstream;
ComPtr<IMFByteStream> pInputByteStream;
MFCreateMFByteStreamOnStreamEx((IUnknown*)pInputStream, &pInputByteStream);
hr = MFCreateSourceReaderFromByteStream(pInputByteStream.Get(), NULL, &m_pSourceReader);
// last line FAILS, “The handle is invalid.”
但是,我被上面的错误困住了。为什么这无效,我该如何纠正?或者,是否有更好的方法来创建包含动态数据的媒体基础管道?