JunkBox_Win_Lib 1.5.3
|
#include <WinAudioStream.h>
Public Member Functions | |
CWinAudioStream (IMediaObject *pObj) | |
virtual | ~CWinAudioStream (void) |
BOOL | startCapture (WAVEFORMATEX *format=NULL) |
void | stopCapture (void) |
Buffer | input (void) |
BOOL | openOutput (ULONG bufcount=100, WAVEFORMATEX *format=NULL) |
void | closeOutput (void) |
void | output (Buffer buf) |
STDMETHODIMP_ (ULONG) AddRef(void) | |
STDMETHODIMP_ (ULONG) Release(void) | |
STDMETHODIMP | QueryInterface (REFIID riid, void **ppv) |
STDMETHODIMP | Read (void *, ULONG, ULONG *) |
STDMETHODIMP | Seek (LARGE_INTEGER, DWORD, ULARGE_INTEGER *) |
STDMETHODIMP | Write (const void *, ULONG, ULONG *) |
STDMETHODIMP | SetSize (ULARGE_INTEGER) |
STDMETHODIMP | CopyTo (IStream *, ULARGE_INTEGER, ULARGE_INTEGER *, ULARGE_INTEGER *) |
STDMETHODIMP | Commit (DWORD) |
STDMETHODIMP | Revert (void) |
STDMETHODIMP | LockRegion (ULARGE_INTEGER, ULARGE_INTEGER, DWORD) |
STDMETHODIMP | UnlockRegion (ULARGE_INTEGER, ULARGE_INTEGER, DWORD) |
STDMETHODIMP | Stat (STATSTG *, DWORD) |
STDMETHODIMP | Clone (IStream **) |
Private Member Functions | |
void | freeOutputHeaders (void) |
CWinMediaBuffer * | GetWriteBuffer (void) |
void | Back2BufferStack (CWinMediaBuffer *pMediaBuf) |
void | Back2BufferStackAll (void) |
void | QueueCapturedData (BYTE *pData, UINT cbData) |
void | QueueCapturedBuffer (CWinMediaBuffer *pMediaBuf) |
void | ReadOneBuffer (BYTE **ppbData, ULONG *pcbData) |
UINT | CaptureThread (void) |
BOOL | IsCapturing (void) |
Static Private Member Functions | |
static UINT | CaptureThread (LPVOID pParam) |
Private Attributes | |
CRITICAL_SECTION | m_lock |
UINT | m_cRef |
IMediaObject * | m_pMediaObj |
HANDLE | m_hStopEvent |
HANDLE | m_hDataReady |
CWinThread * | m_captureThread |
MediaBufferStack | m_bufferStack |
MediaBufferQueue | m_bufferQueue |
CWinMediaBuffer * | m_writeBuffer |
CWinMediaBuffer * | m_readBuffer |
ULONG | m_readBufferSize |
ULONG | m_readBufferCount |
ULONG | m_readBufferIndex |
HWAVEOUT | m_hWave |
WAVEHDR * | m_waveHeaders |
ULONG | m_outputBufferNum |
ULONG | m_outputBufferIndex |
Buffer | m_streamData |
Static Private Attributes | |
static const UINT | MaxReadBuffers = 20 |
static const UINT | MaxOutputBuffers = 2*1024*1024 |
Definition at line 30 of file WinAudioStream.h.
CWinAudioStream | ( | IMediaObject * | pObj | ) |
Definition at line 29 of file WinAudioStream.cpp.
References CWinAudioStream::m_captureThread, CWinAudioStream::m_cRef, CWinAudioStream::m_hDataReady, CWinAudioStream::m_hStopEvent, CWinAudioStream::m_hWave, CWinAudioStream::m_lock, CWinAudioStream::m_outputBufferIndex, CWinAudioStream::m_outputBufferNum, CWinAudioStream::m_pMediaObj, CWinAudioStream::m_readBuffer, CWinAudioStream::m_readBufferCount, CWinAudioStream::m_readBufferIndex, CWinAudioStream::m_readBufferSize, CWinAudioStream::m_streamData, CWinAudioStream::m_waveHeaders, and CWinAudioStream::m_writeBuffer.
|
virtual |
Definition at line 59 of file WinAudioStream.cpp.
References CWinAudioStream::closeOutput(), CWinAudioStream::m_lock, and CWinAudioStream::stopCapture().
|
private |
Definition at line 333 of file WinAudioStream.cpp.
References CWinAudioStream::m_bufferStack, CWinAudioStream::m_lock, and CWinMediaBuffer::SetLength().
Referenced by CWinAudioStream::Back2BufferStackAll(), and CWinAudioStream::ReadOneBuffer().
|
private |
Definition at line 347 of file WinAudioStream.cpp.
References CWinAudioStream::Back2BufferStack(), CWinAudioStream::m_bufferQueue, CWinAudioStream::m_lock, CWinAudioStream::m_readBuffer, and CWinAudioStream::m_readBufferIndex.
Referenced by CWinAudioStream::stopCapture().
|
staticprivate |
Definition at line 455 of file WinAudioStream.cpp.
References CWinAudioStream::CaptureThread().
Referenced by CWinAudioStream::CaptureThread().
|
private |
Definition at line 463 of file WinAudioStream.cpp.
References CWinMediaBuffer::clear(), CWinMediaBuffer::GetBufferAndLength(), CWinAudioStream::m_hDataReady, CWinAudioStream::m_hStopEvent, CWinAudioStream::m_pMediaObj, CWinAudioStream::m_readBufferSize, and CWinAudioStream::QueueCapturedData().
Referenced by CWinAudioStream::startCapture().
|
inline |
Definition at line 94 of file WinAudioStream.h.
void closeOutput | ( | void | ) |
Definition at line 188 of file WinAudioStream.cpp.
References CWinAudioStream::freeOutputHeaders(), and CWinAudioStream::m_hWave.
Referenced by CWinAudioTool::closeOutput(), and CWinAudioStream::~CWinAudioStream().
|
inline |
Definition at line 89 of file WinAudioStream.h.
|
inline |
Definition at line 88 of file WinAudioStream.h.
|
private |
Definition at line 223 of file WinAudioStream.cpp.
References CWinAudioStream::m_outputBufferNum, and CWinAudioStream::m_waveHeaders.
Referenced by CWinAudioStream::closeOutput().
|
private |
Definition at line 309 of file WinAudioStream.cpp.
References CWinAudioStream::m_bufferQueue, CWinAudioStream::m_bufferStack, CWinAudioStream::m_lock, and CWinMediaBuffer::SetLength().
Referenced by CWinAudioStream::QueueCapturedData().
Buffer input | ( | void | ) |
Definition at line 201 of file WinAudioStream.cpp.
References CWinAudioStream::m_streamData, and CWinAudioStream::Read().
Referenced by CWinAudioTool::getAudioData().
|
inlineprivate |
Definition at line 145 of file WinAudioStream.h.
References CWinAudioStream::m_hStopEvent.
Referenced by CWinAudioStream::Read().
|
inline |
Definition at line 91 of file WinAudioStream.h.
BOOL openOutput | ( | ULONG | bufcount = 100, |
WAVEFORMATEX * | format = NULL ) |
Definition at line 153 of file WinAudioStream.cpp.
References CWinAudioStream::m_hWave, CWinAudioStream::m_outputBufferNum, CWinAudioStream::m_pMediaObj, CWinAudioStream::m_waveHeaders, and CWinAudioStream::MaxOutputBuffers.
Referenced by CWinAudioTool::openOutput().
void output | ( | Buffer | buf | ) |
Definition at line 213 of file WinAudioStream.cpp.
References CWinAudioStream::Write().
|
inline |
Definition at line 63 of file WinAudioStream.h.
Referenced by CWinAudioTool::init(), and CWinAudioTool::setMediaType().
|
private |
Definition at line 400 of file WinAudioStream.cpp.
References CWinAudioStream::m_bufferQueue, CWinAudioStream::m_hDataReady, and CWinAudioStream::m_lock.
Referenced by CWinAudioStream::QueueCapturedData().
|
private |
Definition at line 367 of file WinAudioStream.cpp.
References CWinMediaBuffer::GetBufferAndLength(), CWinMediaBuffer::GetMaxLength(), CWinAudioStream::GetWriteBuffer(), CWinAudioStream::m_writeBuffer, CWinAudioStream::QueueCapturedBuffer(), and CWinMediaBuffer::SetLength().
Referenced by CWinAudioStream::CaptureThread().
STDMETHODIMP Read | ( | void * | pData, |
ULONG | cbBuffer, | ||
ULONG * | pcbRead ) |
Definition at line 242 of file WinAudioStream.cpp.
References CWinAudioStream::IsCapturing(), CWinAudioStream::m_hDataReady, CWinAudioStream::m_readBuffer, CWinAudioStream::m_readBufferCount, and CWinAudioStream::ReadOneBuffer().
Referenced by CWinAudioStream::input().
|
private |
Definition at line 412 of file WinAudioStream.cpp.
References CWinAudioStream::Back2BufferStack(), CWinMediaBuffer::GetBufferAndLength(), CWinAudioStream::m_bufferQueue, CWinAudioStream::m_lock, CWinAudioStream::m_readBuffer, and CWinAudioStream::m_readBufferIndex.
Referenced by CWinAudioStream::Read().
|
inline |
Definition at line 90 of file WinAudioStream.h.
STDMETHODIMP Seek | ( | LARGE_INTEGER | dlibMove, |
DWORD | dwOrigin, | ||
ULARGE_INTEGER * | plibNewPosition ) |
Definition at line 263 of file WinAudioStream.cpp.
References CWinAudioStream::m_readBufferCount.
|
inline |
Definition at line 87 of file WinAudioStream.h.
BOOL startCapture | ( | WAVEFORMATEX * | format = NULL | ) |
Definition at line 73 of file WinAudioStream.cpp.
References CWinAudioStream::CaptureThread(), CWinAudioStream::m_bufferStack, CWinAudioStream::m_captureThread, CWinAudioStream::m_hDataReady, CWinAudioStream::m_hStopEvent, CWinAudioStream::m_pMediaObj, CWinAudioStream::m_readBufferCount, CWinAudioStream::m_readBufferSize, CWinAudioStream::m_streamData, CWinAudioStream::m_writeBuffer, and CWinAudioStream::MaxReadBuffers.
Referenced by CWinAudioTool::startCapture().
|
inline |
Definition at line 93 of file WinAudioStream.h.
|
inline |
|
inline |
Definition at line 56 of file WinAudioStream.h.
References CWinAudioStream::m_cRef.
void stopCapture | ( | void | ) |
Definition at line 112 of file WinAudioStream.cpp.
References CWinAudioStream::Back2BufferStackAll(), CWinAudioStream::m_bufferStack, CWinAudioStream::m_captureThread, CWinAudioStream::m_hDataReady, CWinAudioStream::m_hStopEvent, and CWinAudioStream::m_streamData.
Referenced by CWinAudioTool::stopCapture(), and CWinAudioStream::~CWinAudioStream().
|
inline |
Definition at line 92 of file WinAudioStream.h.
STDMETHODIMP Write | ( | const void * | pbuf, |
ULONG | bufsz, | ||
ULONG * | dummy ) |
Definition at line 272 of file WinAudioStream.cpp.
References CWinAudioStream::m_hWave, CWinAudioStream::m_outputBufferIndex, CWinAudioStream::m_outputBufferNum, CWinAudioStream::m_waveHeaders, and CWinAudioStream::MaxOutputBuffers.
Referenced by CWinAudioStream::output().
|
private |
Definition at line 111 of file WinAudioStream.h.
Referenced by CWinAudioStream::Back2BufferStackAll(), CWinAudioStream::GetWriteBuffer(), CWinAudioStream::QueueCapturedBuffer(), and CWinAudioStream::ReadOneBuffer().
|
private |
Definition at line 110 of file WinAudioStream.h.
Referenced by CWinAudioStream::Back2BufferStack(), CWinAudioStream::GetWriteBuffer(), CWinAudioStream::startCapture(), and CWinAudioStream::stopCapture().
|
private |
Definition at line 108 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::startCapture(), and CWinAudioStream::stopCapture().
|
private |
Definition at line 99 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::STDMETHODIMP_(), and CWinAudioStream::STDMETHODIMP_().
|
private |
Definition at line 106 of file WinAudioStream.h.
Referenced by CWinAudioStream::CaptureThread(), CWinAudioStream::CWinAudioStream(), CWinAudioStream::QueueCapturedBuffer(), CWinAudioStream::Read(), CWinAudioStream::startCapture(), and CWinAudioStream::stopCapture().
|
private |
Definition at line 105 of file WinAudioStream.h.
Referenced by CWinAudioStream::CaptureThread(), CWinAudioStream::CWinAudioStream(), CWinAudioStream::IsCapturing(), CWinAudioStream::startCapture(), and CWinAudioStream::stopCapture().
|
private |
Definition at line 123 of file WinAudioStream.h.
Referenced by CWinAudioStream::closeOutput(), CWinAudioStream::CWinAudioStream(), CWinAudioStream::openOutput(), and CWinAudioStream::Write().
|
private |
Definition at line 97 of file WinAudioStream.h.
Referenced by CWinAudioStream::Back2BufferStack(), CWinAudioStream::Back2BufferStackAll(), CWinAudioStream::CWinAudioStream(), CWinAudioStream::GetWriteBuffer(), CWinAudioStream::QueueCapturedBuffer(), CWinAudioStream::ReadOneBuffer(), and CWinAudioStream::~CWinAudioStream().
|
private |
Definition at line 127 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), and CWinAudioStream::Write().
|
private |
Definition at line 126 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::freeOutputHeaders(), CWinAudioStream::openOutput(), and CWinAudioStream::Write().
|
private |
Definition at line 100 of file WinAudioStream.h.
Referenced by CWinAudioStream::CaptureThread(), CWinAudioStream::CWinAudioStream(), CWinAudioStream::openOutput(), and CWinAudioStream::startCapture().
|
private |
Definition at line 114 of file WinAudioStream.h.
Referenced by CWinAudioStream::Back2BufferStackAll(), CWinAudioStream::CWinAudioStream(), CWinAudioStream::Read(), and CWinAudioStream::ReadOneBuffer().
|
private |
Definition at line 117 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::Read(), CWinAudioStream::Seek(), and CWinAudioStream::startCapture().
|
private |
Definition at line 118 of file WinAudioStream.h.
Referenced by CWinAudioStream::Back2BufferStackAll(), CWinAudioStream::CWinAudioStream(), and CWinAudioStream::ReadOneBuffer().
|
private |
Definition at line 116 of file WinAudioStream.h.
Referenced by CWinAudioStream::CaptureThread(), CWinAudioStream::CWinAudioStream(), and CWinAudioStream::startCapture().
|
private |
Definition at line 129 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::input(), CWinAudioStream::startCapture(), and CWinAudioStream::stopCapture().
|
private |
Definition at line 124 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::freeOutputHeaders(), CWinAudioStream::openOutput(), and CWinAudioStream::Write().
|
private |
Definition at line 113 of file WinAudioStream.h.
Referenced by CWinAudioStream::CWinAudioStream(), CWinAudioStream::QueueCapturedData(), and CWinAudioStream::startCapture().
|
staticprivate |
Definition at line 121 of file WinAudioStream.h.
Referenced by CWinAudioStream::openOutput(), and CWinAudioStream::Write().
|
staticprivate |
Definition at line 103 of file WinAudioStream.h.
Referenced by CWinAudioStream::startCapture().