Hi Shilpi,
Thanks for your code sample. I do see a potential issue, let me explain:
- On entry to VideoInputFrameArrived callback, you have IDeckLinkAudioInputPacket pointer, this is a COM object with reference count of 1
- Inside callback you access audio buffer and add to queue
- On exit of callback, the IDeckLinkAudioInputPacket pointer is released and object is destroyed.
- Later when you read audio buffer from queue, buffer is invalid
A better solution would be to add IDeckLinkAudioInputPacket to queue (similar to FileCapture SDK sample), remembering to call AddRef to keep the interface object valid after callback. Remember to pair AddRef() with a call to Release() when the IDeckLinkAudioInputPacket object is no longer required to avoid memory leak. Better yet, you can use com_ptr.h (eg from QuadPreview SDK sample), or ATL CComPtr (if developing with Visual Studio) to manage the interface reference counts for you.
Regards
Cameron