This method is meant to have less overhead ------------------------------------------------
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected