I should note that my entire career as a developer, I tried to stay away from platform dependent development. This was helped by ready-made open libraries that allow me to abstract from the platform, such as Qt, WxWidgets, SDL, ACE, and. etc. I did not have to write drivers, but for quite complex applications and systems of this approach, coupled with C ++ and one, the other dynamic language was more than enough.
But fate sent a client, thanks to which, I encountered the following problem - the move from
DirectShow to the
Media Foundation . Both frameworks are designed to work with various audio / video, media formats, codecs, streams, etc. Media Foundation should gradually replace DirectShow and remain the main and only. In the new Windows 8, metro applications with DirectShow do not work. Actually this was the reason for the move. I came across DirectShow 10 years ago, for stuffing video into textures on the go, I didn't like it, but somehow we coped with it. And, as far as I know, this is a well-established, well-studied framework that is supported as a backend by many projects, such as VideoLAN, ffmpeg, phonon, etc.
And now the actual crying Yaroslavna. Why, pray tell, are the developers getting into this Media Foundation? And why did you eliminate compatibility with DirectShow in Metro applications? To understand this, Media Foundation has to spend a lot of time, because there are simply no sane examples and documentation!
Here is an example that captures video in a file that still needs to be found as a download. In the example, more than a thousand lines of code written in a terrible inhuman format. How to take out from there the skills to work with the Media Foundation? And here is a piece of code from the example that shows the stream captured from the camera:
')
HRESULT CaptureManager::SetDevice(HWND hwndPreview, IUnknown *pUnkVideo) { DestroyCaptureEngine(); m_pCallback = new (std::nothrow) CaptureEngineCB(m_hwndEvent); if (m_pCallback == NULL) { return E_OUTOFMEMORY; } m_hwndPreview = hwndPreview;
This is only a small piece, "which is not clear how" designates the device.
21st century in the yard, how to live with such a monster?
Or
here's an example of documentation. What can be understood from it about the IAdvancedMediaCaptureInitializationSettings interface? What is he "Provides initialization settings for advanced media capture"? Cool, and what else? The interface name is very promising. Does he have any method? People are in a hurry and rush to release applications under the new axis, how many ridges will break on such development tools? And it became possible to simulate a webcam only by writing a driver, while you could do with a filter in DirectShow. When I saw similar frameworks in the 90s, Windows had no alternative, but now I’m overdoing it. Developers, developers, developers?
And actually, in conclusion, if there is anyone experienced in this matter, tell me, is it that I lost my mind on the free breads of open libraries, where everything is more convenient and quicker to understand, or is it just a big mistake of a large corporation?