22#pragma comment(lib, "avrt.lib")
23#pragma comment(lib, "winmm.lib")
42 BOOL
openOutput(ULONG bufcount=100, WAVEFORMATEX* format=NULL);
58 UINT ref = InterlockedDecrement(&
m_cRef);
59 if (ref==0)
delete this;
65 if (riid==IID_IUnknown) {
67 *ppv = (IUnknown*)
this;
70 else if (riid==IID_IStream) {
72 *ppv = (IStream*)
this;
75 else return E_NOINTERFACE;
82 STDMETHODIMP
Read(
void*, ULONG, ULONG*);
83 STDMETHODIMP
Seek(LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
84 STDMETHODIMP
Write(
const void*, ULONG, ULONG*);
87 STDMETHODIMP
SetSize(ULARGE_INTEGER) {
return E_NOTIMPL;}
88 STDMETHODIMP
CopyTo(IStream*, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*) {
return E_NOTIMPL;}
89 STDMETHODIMP
Commit(DWORD) {
return E_NOTIMPL;}
90 STDMETHODIMP
Revert(
void) {
return E_NOTIMPL;}
91 STDMETHODIMP
LockRegion (ULARGE_INTEGER, ULARGE_INTEGER, DWORD) {
return E_NOTIMPL;}
92 STDMETHODIMP
UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD) {
return E_NOTIMPL;}
93 STDMETHODIMP
Stat(STATSTG*, DWORD) {
return E_NOTIMPL;}
94 STDMETHODIMP
Clone(IStream**) {
return E_NOTIMPL;}
STDMETHODIMP Read(void *, ULONG, ULONG *)
CWinMediaBuffer * m_readBuffer
void QueueCapturedBuffer(CWinMediaBuffer *pMediaBuf)
void Back2BufferStack(CWinMediaBuffer *pMediaBuf)
STDMETHODIMP CopyTo(IStream *, ULARGE_INTEGER, ULARGE_INTEGER *, ULARGE_INTEGER *)
STDMETHODIMP Revert(void)
STDMETHODIMP SetSize(ULARGE_INTEGER)
CWinThread * m_captureThread
CWinAudioStream(IMediaObject *pObj)
MediaBufferStack m_bufferStack
STDMETHODIMP_(ULONG) Release(void)
CWinMediaBuffer * GetWriteBuffer(void)
CWinMediaBuffer * m_writeBuffer
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
STDMETHODIMP Clone(IStream **)
STDMETHODIMP Seek(LARGE_INTEGER, DWORD, ULARGE_INTEGER *)
virtual ~CWinAudioStream(void)
STDMETHODIMP Stat(STATSTG *, DWORD)
BOOL startCapture(WAVEFORMATEX *format=NULL)
IMediaObject * m_pMediaObj
void Back2BufferStackAll(void)
ULONG m_outputBufferIndex
void freeOutputHeaders(void)
STDMETHODIMP Write(const void *, ULONG, ULONG *)
STDMETHODIMP Commit(DWORD)
STDMETHODIMP_(ULONG) AddRef(void)
void QueueCapturedData(BYTE *pData, UINT cbData)
static const UINT MaxOutputBuffers
STDMETHODIMP UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD)
void ReadOneBuffer(BYTE **ppbData, ULONG *pcbData)
STDMETHODIMP LockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD)
BOOL openOutput(ULONG bufcount=100, WAVEFORMATEX *format=NULL)
static const UINT MaxReadBuffers
MediaBufferQueue m_bufferQueue
std::stack< CWinMediaBuffer * > MediaBufferStack
std::queue< CWinMediaBuffer * > MediaBufferQueue