[wdmaudiodev] AVStream Clock CorrelatedTime Callback Invalid PKSPIN

  • From: Richard Lince <Richard.Lince@xxxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 23 Aug 2013 11:15:26 +0000

Hi folks,

Im trying to Implement an audio clock in an AVStream driver as follows, 
however, the callback argument is an invalid pin pointer (and 'this' pointer in 
debugger).

It seems to be common on the internet as an issue with no resolution, any ideas?



//class header

const static KSCLOCK_DISPATCH AudioClockDispatch;

static LONGLONG DispatchCorrelatedTime (  IN PKSPIN Pin,  OUT PLONGLONG 
SystemTime)

{

   // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!  invalid PKSPIN Pin on callback  
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    return (reinterpret_cast <CCaptureAudioPin *> (Pin -> Context)) -> 
CorrelatedTime ( Pin, SystemTime);
}



//class body

const KSCLOCK_DISPATCH CCaptureAudioPin::AudioClockDispatch = {
   NULL,//PFNKSPINSETTIMER       SetTimer;
   NULL,//PFNKSPINCANCELTIMER    CancelTimer;
   (PFNKSPINCORRELATEDTIME)CCaptureAudioPin::DispatchCorrelatedTime, 
//PFNKSPINCORRELATEDTIME CorrelatedTime;
   (PFNKSPINRESOLUTION)CCaptureAudioPin::DispatchResolution 
//PFNKSPINRESOLUTION     Resolution;
};
const KSPIN_DISPATCH CaptureAudioPinDispatch = {
    CCaptureAudioPin::DispatchCreate,       // Pin Create
    NULL,                                   // Pin Close
    CCaptureAudioPin::DispatchProcess,      // Pin Process
    NULL,                                   // Pin Reset
    CCaptureAudioPin::DispatchSetFormat,    // Pin Set Data Format
    CCaptureAudioPin::DispatchSetState,     // Pin Set Device State
    NULL,                                   // Pin Connect
    NULL,                                   // Pin Disconnect
    &CCaptureAudioPin::AudioClockDispatch,  // Clock Dispatch
    NULL                                    // Allocator Dispatch
};



Compiles and callback time is fine.

Thanks in advance if you have any ideas.

Rich.

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Other related posts: