MCPcopy Create free account
hub / github.com/cmauri/eviacam / SampleCB

Method SampleCB

creavision/videoInput.cpp:135–155  ·  view source on GitHub ↗

This method is meant to have less overhead ------------------------------------------------

Source from the content-addressed store, hash-verified

133 //This method is meant to have less overhead
134 //------------------------------------------------
135 STDMETHODIMP SampleCB(double Time, IMediaSample *pSample){
136 if(WaitForSingleObject(hEvent, 0) == WAIT_OBJECT_0) return S_OK;
137
138 HRESULT hr = pSample->GetPointer(&ptrBuffer);
139
140 if(hr == S_OK){
141 latestBufferLength = pSample->GetActualDataLength();
142 if(latestBufferLength == numBytes){
143 EnterCriticalSection(&critSection);
144 memcpy(pixels, ptrBuffer, latestBufferLength);
145 newFrame = true;
146 freezeCheck = 1;
147 LeaveCriticalSection(&critSection);
148 SetEvent(hEvent);
149 }else{
150 printf("ERROR: SampleCB() - buffer sizes do not match\n");
151 }
152 }
153
154 return S_OK;
155 }
156
157
158 //This method is meant to have more overhead

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected