I'm trying to figure out how to do this, but I can't find anything on the subject. From what I can tell, you have to make a media sample, then use outputpin_sendsample to deliver it, so, how do I fill up a media sample with a single frame? For now, just with NULL data would be sufficient..
Maarten Lankhorst wrote:
I'm trying to figure out how to do this, but I can't find anything on the subject. From what I can tell, you have to make a media sample, then use outputpin_sendsample to deliver it, so, how do I fill up a media sample with a single frame?
A sample *is* a single frame, so there is no special case. For code that does this, please see dlls/quartz/acmwrapper.c. The general pattern is: 1. Get a blank available sample (OutputPin_GetDeliveryBuffer). 2. Set the size of the data represented by the sample (IMediaSample_SetActualDataLength) 3. Get a pointer to the sample buffer (IMediaSample_GetPointer) 4. Fill with data (memcpy). 5. Send the sample to the downstream filter (OutputPin_SendSample).
For now, just with NULL data would be sufficient..
Replace the above mentioned memcpy call with a memset instead then.
Rob