nativeaudio

audio playback for Go
Log | Files | Refs | README | LICENSE

callback_64.go (907B)


      1 //go:build windows && (amd64 || arm64)
      2 
      3 package mf
      4 
      5 import "syscall"
      6 
      7 // onReadSampleTrampoline implements IMFSourceReaderCallback::OnReadSample:
      8 //
      9 //	HRESULT OnReadSample(HRESULT hrStatus, DWORD dwStreamIndex,
     10 //	                     DWORD dwStreamFlags, LONGLONG llTimestamp,
     11 //	                     IMFSample *pSample)
     12 //
     13 // Every argument occupies one pointer-sized slot here, so the 64-bit
     14 // timestamp needs no special handling. It is ignored in any case, because
     15 // the timestamp is read back from the sample itself. That keeps this
     16 // signature the only thing that differs between word sizes.
     17 var onReadSampleTrampoline = syscall.NewCallback(
     18 	func(this *callback, status uintptr, streamIndex, flags uint32, timestamp int64, sample *IMFSample) uintptr {
     19 		return guard("IMFSourceReaderCallback::OnReadSample", func() HRESULT {
     20 			return this.onReadSample(HRESULT(status), flags, sample)
     21 		})
     22 	},
     23 )