JunkBox_Win_Lib 1.5.3
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CWinMediaBuffer Class Reference

#include <WinMediaBuffer.h>

Inheritance diagram for CWinMediaBuffer:
Collaboration diagram for CWinMediaBuffer:

Public Member Functions

 CWinMediaBuffer (DWORD len=0)
 
virtual ~CWinMediaBuffer (void)
 
void init (DWORD len)
 
void free (void)
 
void clear (void)
 
Buffer * getBuffer (void)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
STDMETHODIMP QueryInterface (REFIID riid, void **ppv)
 
STDMETHODIMP SetLength (DWORD length)
 
STDMETHODIMP GetMaxLength (DWORD *pMaxLength)
 
STDMETHODIMP GetBufferAndLength (BYTE **ppData, DWORD *pLength)
 

Protected Attributes

Buffer * m_pBuffer
 

Detailed Description

Definition at line 28 of file WinMediaBuffer.h.

Constructor & Destructor Documentation

◆ CWinMediaBuffer()

CWinMediaBuffer ( DWORD len = 0)

Definition at line 15 of file WinMediaBuffer.cpp.

16{
17 m_pBuffer = NULL;
18 init(len);
19}

References CWinMediaBuffer::init(), and CWinMediaBuffer::m_pBuffer.

Here is the call graph for this function:

◆ ~CWinMediaBuffer()

virtual ~CWinMediaBuffer ( void )
inlinevirtual

Definition at line 32 of file WinMediaBuffer.h.

32{ free();}

References CWinMediaBuffer::free().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void clear ( void )
inline

Definition at line 36 of file WinMediaBuffer.h.

36{ m_pBuffer->vldsz = 0;}

References CWinMediaBuffer::m_pBuffer.

Referenced by CWinAudioStream::CaptureThread().

Here is the caller graph for this function:

◆ free()

void free ( void )

Definition at line 33 of file WinMediaBuffer.cpp.

34{
35 if (m_pBuffer!=NULL) {
36 del_Buffer(&m_pBuffer);
37 }
38 m_pBuffer = NULL;
39}

References CWinMediaBuffer::m_pBuffer.

Referenced by CWinMediaBuffer::init(), and CWinMediaBuffer::~CWinMediaBuffer().

Here is the caller graph for this function:

◆ getBuffer()

Buffer * getBuffer ( void )
inline

Definition at line 38 of file WinMediaBuffer.h.

38{ return m_pBuffer;}

References CWinMediaBuffer::m_pBuffer.

◆ GetBufferAndLength()

STDMETHODIMP GetBufferAndLength ( BYTE ** ppData,
DWORD * pLength )
inline

Definition at line 69 of file WinMediaBuffer.h.

70 {
71 if (ppData!=NULL) *ppData = (BYTE*)m_pBuffer->buf;
72 if (pLength!=NULL) *pLength = (DWORD)m_pBuffer->vldsz;
73 return NOERROR;
74 }

References CWinMediaBuffer::m_pBuffer.

Referenced by CWinAudioStream::CaptureThread(), CWinAudioStream::QueueCapturedData(), and CWinAudioStream::ReadOneBuffer().

Here is the caller graph for this function:

◆ GetMaxLength()

STDMETHODIMP GetMaxLength ( DWORD * pMaxLength)
inline

Definition at line 67 of file WinMediaBuffer.h.

67{ *pMaxLength = (DWORD)m_pBuffer->bufsz; return NOERROR;}

References CWinMediaBuffer::m_pBuffer.

Referenced by CWinAudioStream::QueueCapturedData().

Here is the caller graph for this function:

◆ init()

void init ( DWORD len)

Definition at line 23 of file WinMediaBuffer.cpp.

24{
25 free();
26
27 m_pBuffer = new_Buffer(0);
28 if (len>0) *m_pBuffer = make_Buffer(len);
29}

References CWinMediaBuffer::free(), and CWinMediaBuffer::m_pBuffer.

Referenced by CWinMediaBuffer::CWinMediaBuffer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QueryInterface()

STDMETHODIMP QueryInterface ( REFIID riid,
void ** ppv )
inline

Definition at line 47 of file WinMediaBuffer.h.

48 {
49 if (riid==IID_IUnknown) {
50 AddRef();
51 *ppv = (IUnknown*)this;
52 return NOERROR;
53 }
54 else if (riid==IID_IMediaBuffer) {
55 AddRef();
56 *ppv = (IMediaBuffer*)this;
57 return NOERROR;
58 }
59 else return E_NOINTERFACE;
60 }

◆ SetLength()

STDMETHODIMP SetLength ( DWORD length)
inline

Definition at line 66 of file WinMediaBuffer.h.

66{ m_pBuffer->vldsz = (int)length; return NOERROR;}

References CWinMediaBuffer::m_pBuffer.

Referenced by CWinAudioStream::Back2BufferStack(), CWinAudioStream::GetWriteBuffer(), and CWinAudioStream::QueueCapturedData().

Here is the caller graph for this function:

◆ STDMETHODIMP_() [1/2]

STDMETHODIMP_ ( ULONG )
inline

Definition at line 44 of file WinMediaBuffer.h.

44{ return 2;}

◆ STDMETHODIMP_() [2/2]

STDMETHODIMP_ ( ULONG )
inline

Definition at line 45 of file WinMediaBuffer.h.

45{ return 1;}

Member Data Documentation

◆ m_pBuffer


The documentation for this class was generated from the following files: