Click here to Skip to main content
15,888,287 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there

I'm creating a media foundation sink to process an avi file. I'm trying to modify some source code that comes with the book: Developing Microsoft Media Foundation Applications by Anton Polinger.

I'm am new to windows media foundation.

I'm using a class CAviSink that inherits from :
IMFFinalizableMediaSink, IMFClockStateSink,IMFAsyncCallback

However, I need to set the presentation clock for the sink. I'm not sure how to go about this. I've tried
C#
IMFPresentationClock **ppPresentationClock = NULL;
   
MFCreatePresentationClock(ppPresentationClock);
   
mySink.SetPresentationClock(*ppPresentationClock);


but ppPresentationClock is null.

This is probably the completely wrong way to do this. However, all I can find is very detailed information on the media foundation e.g. what the presentation clock does but no pointers on the basics of how to create one.

I was wondering if someone could give me a pointer to help me find my way through all this confusing docs...

Many thanks...
Posted

1 solution

You need to understand pointers to pointers in C++. Without seeing the documentation, I suspect your code should read:

C++
IMFPresentationClock *pPresentationClock = NULL;
   
MFCreatePresentationClock(&pPresentationClock);

mySink.SetPresentationClock(*pPresentationClock);
// or maybe even
mySink.SetPresentationClock(pPresentationClock);
 
Share this answer
 
Comments
FlurryKnox 13-Apr-13 6:40am    
Hi Thanks....that was a silly mistake...Thanks for the hint...
Richard MacCutchan 14-Apr-13 10:29am    
One we have all made. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900