Responsibility separation : File and Media handlers


The IFileHandler interface is the contract for all File Handlers implementations.
A file handler is in charge of the physical access to the file stream. it should only provide a stream to the raw bytes of the file, without exposing any metadata.
It is also responsible for creating the right implementation of the IMediaHandler interface.


the IMediaHandler interface is in charge of handling the container, that is : the Media Handler knows how to interprete the file : headers if available, metadata, (mayb missing codecs for video files, using fourcc ?)
It is not th job of the MediaHandler to decode or even handle the media differently according to the codec used.


Usually inherent to the rendering plugin used to open the media file, the DirectShow engine (with the help of in-house code) will choose the right filters, codecs, and graphs to use to render the video. This is only this brick which will make the difference between media-streams within the container of the same type.
The DirectShow brick can be replaced by any other rendering mechanism as it will be related to the rendering plugin chosen to open the file !

Last edited Apr 29, 2010 at 8:53 PM by salfab, version 2


No comments yet.