AudRecordLib
|
#include <InterfaceWrap.h>
Public Member Functions | |
TargetSinkWrap (AudRecordCLI::ITargetSink^ pOrigSink) | |
HRESULT WINAPI | QueryInterface (REFIID riid, PVOID *ppv) |
ULONG WINAPI | AddRef () |
ULONG WINAPI | Release () |
HRESULT WINAPI | OnHeader (INSSBuffer *pHeader) |
HRESULT WINAPI | IsRealTime (BOOL *pRealTime) |
HRESULT WINAPI | AllocateDataUnit (DWORD dataSize, INSSBuffer **ppBuffer) |
HRESULT WINAPI | OnDataUnit (INSSBuffer *pBuffer) |
HRESULT WINAPI | OnEndWriting () |
Native wrapper around an ITargetSink interface which enables it to be passed to the AddCustomSink method exposed by IAudRecord
TargetSinkWrap::TargetSinkWrap | ( | AudRecordCLI::ITargetSink^ | pOrigSink | ) |
Constructs the wrapper around the specified target object
pOrigSink | The target to wrap |
ULONG WINAPI TargetSinkWrap::AddRef | ( | ) |
Increments the objects reference count
HRESULT WINAPI TargetSinkWrap::AllocateDataUnit | ( | DWORD | dataSize, |
INSSBuffer ** | ppBuffer | ||
) |
Allocates a buffer of specified size and returns it to the caller
First the function calls the managed AllocateDataUnit to create a buffer in whichever way it sees fit. If it returns successfully, the IDataBuffer interface it returns is wrapped in a ManagedDataBufferWrap which is returned to the caller via its INSSBuffer interface
dataSize | Number of bytes to allocate |
ppBuffer | A pointer to an interface on the returned buffer |
HRESULT WINAPI TargetSinkWrap::IsRealTime | ( | BOOL * | pRealTime | ) |
Determines whether the wrapped sink wants realtime packet delivery
The function simply calls the managed IsRealTime and puts the returned value in the pointer parameter
pRealTime | Pointer that receives the value returned from ITargetSink::IsRealTime() |
HRESULT WINAPI TargetSinkWrap::OnDataUnit | ( | INSSBuffer * | pBuffer | ) |
Called when there's a buffer of data to be written.
The native buffer is wrapped into a managed IDataBuffer and passed to RaiseOnDataUnit which fires the event. Afterwards, the managed wrapper is deleted. Any exceptions arising from raising the event are caught, logged and cause the function to return E_FAIL
pBuffer | A native buffer that contains the data to be written |
HRESULT WINAPI TargetSinkWrap::OnEndWriting | ( | ) |
Called when writing has finished for this session
Simply raises the managed event of the same name
HRESULT WINAPI TargetSinkWrap::OnHeader | ( | INSSBuffer * | pHeader | ) |
Called when there's a header to be written.
The native buffer is wrapped into a managed IDataBuffer and passed to RaiseOnHeader which fires the event. Afterwards, the managed wrapper is deleted. Any exceptions arising from raising the event are caught, logged and cause the function to return E_FAIL
pHeader | A native buffer that contains the header data |
HRESULT WINAPI TargetSinkWrap::QueryInterface | ( | REFIID | iid, |
PVOID * | ppv | ||
) |
Returns pointers for implemented interfaces on the object
Currently supported interfaces are IUnknown and IWMWriterSink
iid | The id of the requested interface | |
[out] | ppv | A pointer to a pointer that receives the interface pointer or NULL |
ULONG WINAPI TargetSinkWrap::Release | ( | ) |
Drecreases the objects reference count
If the ref count reaches zero, the object is destroyed