Previously on the topic:
- Part 1: Starting the Project
- Part 2: Video Processing
- Part 3: Persistence, Automation and Property Pages
- Part 4: Merit
Due to the nature of the brightness and constract correction processing, it would make sense to combine and simplify processing to apply correction “in-place”, that is without copying data from input to output buffer, but instead processing the same buffer before it is passed further downstream.
DMO API offers additional optional IMediaObjectInPlace interface to be implemented on the DMO which the hosting object might prefer to regular IMediaObject.
The interface itself is simple with basically the only Process method to actually handle the processing:
// IMediaObjectInPlace STDMETHOD(Process)(ULONG nSize, BYTE* pnData, REFERENCE_TIME nStartTime, DWORD nFlags) STDMETHOD(Clone)(IMediaObjectInPlace** ppMediaObject) STDMETHOD(GetLatency)(REFERENCE_TIME* pnLatencyTime)