`
`Page 8 of8
`
`CAMThread::ThreadProc
`
`CAMThread Class
`
`Overridden member function in which to implement a thread.
`
`virtual DWORD ThreadProc( );
`
`Return Values
`
`The meaning of this return value is not defined by the CAMThread class.
`
`Remarks
`
`The thread calls this member function upon startup. Derived classes must override this
`member function. When this member function returns, the thread terminates. This member
`function is protected.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`1096
`
`
`
`CAutoLock Class
`
`Page 1 of2
`
`w41411.111e 1:1.11119 Topic Contents 1 @1#1 1 ttti8
`
`CAutoLock Class
`
`( CAutolock
`
`The CAutol.o<:k class holds a critical section for the scope of a block or function. The
`constructor locks the critical section and the destructor unlocks it. The object passed to the
`CA1.1tolock constructor must be derived from the CCritSec class. Thus, by declaring a
`CA1.1tolock object as a local variable in a fUnction, a critical section can be locked without the
`danger of forgetting to unlock it in some of the code paths: the destructor ensures that upon
`exit from the function (or the scope of the declaration), the critical section wm be unlocked.
`Member functions in this class are not designed for overriding.
`
`/* Typical usage ensuring object is always unlocked correctly*/
`
`HRESULT MyFunc{IMediaSarrple *pSarrple)
`{
`
`CAutoLock cObjectLock{m_pMyLockl;
`
`/* Ignore sarrples passed when inactive */
`
`if { Jm bActive) {
`return NOERROR;
`
`/*Add the sarrple to the pending queue */
`
`HRESULT hr= m PendingList,AddTail{pSarrple);
`if {FAILED{hr)J {
`pSarrple->Release(J;
`ret.uD1 hr;
`
`}
`return NOERROR;
`
`Protected Data Members
`Name
`Des<:nptlon
`m_pl.o<:k Critical section for thiS lock.
`
`Member F1.1nctlons
`Name
`Des<:rlptlon
`CAutoLock Takes a pointer to a critical section object and locks it.
`
`+414 "·II' a 1:1.1 .. 19 Topic Contents
`
`l@i§MMt§M
`
`1097
`
`
`
`CAutoLock Class
`
`Page 2 of2
`
`CAutolock: :CAutolock
`
`CAutoLock Class
`
`Takes a pointer to a critical section object and locks it.
`
`CAutolock(
`CCritSec * plock
`);
`
`Parameters
`
`plock
`
`Pointer to a critical section object.
`
`Return Values
`
`No return value.
`
`Remarks
`
`The critical section is unlocked when the CAutoLock object is destroyed.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`1098
`
`
`
`CBaseAllocator CI ass
`
`Page 1of11
`
`w41411.111e 1:1.11119 Topic Contents 1 @1#1 1 ttti8
`
`CBaseAllocator Class
`
`( CBaseObject
`
`),
`
`I INonDelegatingUnknown
`L.l( CUnknown
`
`I
`
`( CCritSec
`I !MemAllocator
`I r CBaseAllocator
`
`).
`
`I
`
`)i
`
`CBaseAllo<:ator is an abstract base class that implements the basic mechanisms for an
`allocator with a fixed number of fixed-size bUffers. The number of buffers and their si:ze can be
`changed using the CBaseA!!ocator::SetProperties member function when an input pin and an
`output pin negotiate the allocator between them.
`
`The class provides the basic functionality for a memory allocator by implementing the
`IMemA!!ocator interface. It provides support for managing a list of CMediaSamp!e objects (or
`objects derived from thiS class), including support for the lMemA!!ocator: :Commit and
`lMemA!!ocator:: Decommit methods, and blocking the lMemA!!ocator: :Get Buffer method.
`
`Any class derived from this class (such as CMemA!!ocator) must create CMediaSamp!e objects,
`which this base class does not.
`
`A signaling mechanism employing a semaphore is used so that if there are no samples, a
`thread can wait until there are samples or until the allocator is decommitted. The m !Free and
`m hSem member variables are used to implement this simple signaling mechanism as follows.
`
`When a thread calls CBaseA!!ocator: :GetBufl'er and there are no samples available, m rNaiting
`is incremented and the thread calls the Microsoft® Win32® WaitforSing!eObject function on
`the semaphore indicated by m hSem.
`
`When a sample is freed (by the !Unknown: :Release method returning the reference count to
`:zero) or CBaseA!!ocator: :Decommit is called and m !Waiting is nonzero, the Win32
`Re!easeSemaphore function is called on m hSem with a release count of m_IWaltlng, and
`m_IWaltlng is reset to :zero.
`
`Al! member functions in this class that return HRESULT and accept a pointer as a parameter
`return E .... POIITTER when passed a nu!! pointer.
`
`Protected Data Members
`
`1099
`
`
`
`CBaseAllocator Class
`
`Page 2of11
`
`Name
`m_bChanged
`m_bCommitted
`
`Description
`TRUE if the buffers have changed; otherwise, FALSE.
`If TRUE, the allocator is in a state in which all
`!MemAllocator: :GetBuffer methods fail. The
`!MemAllocator: :SetProoerties method is the only member
`function permitted to operate in this state.
`m_bDecommitinProgress If TRUE, the decommit process completes upon the return of all
`media samples. Until the decommit process has completed, any
`calls to !MemAllocator: :GetBuffer return E_OUTOFMEMORY.
`Semaphore for signaling.
`Agreed alignment of the buffer.
`Number of buffers actually allocated.
`Established number of buffers to provide.
`List of CMediaSamole objects that are currently free (free list).
`Agreed prefix of the buffer (precedes value returned by
`!MediaSamole: :GetPointer).
`Size of each buffer.
`Count of threads waiting for samples.
`
`m_hSem
`m_IAlignment
`m_IAllocated
`m_ICount
`m_IFree
`m_IPrefix
`
`m_ISize
`m_IWaiting
`
`Member Functions
`Name
`Description
`CBaseAllocator Constructs a CBaseAllocator object.
`NotifySamole Notifies a waiting thread that a sample is available on the free list.
`SetWaiting
`Increments the m !Waiting data member to indicate that a thread is waiting
`for a sample.
`
`Overridable Member Functions
`Name Description
`AUQi; Allocates memory, instantiates CMediaSamole objects, and adds them to the
`m !Allocated and m IFree data members.
`~ Decommits memory when the last buffer is freed.
`
`Decommit
`
`Implemented IMemAllocator Methods
`Name
`Description
`Commit
`Allocates memory by calling the CBaseAllocator: :Alloc member function, which
`you must override.
`Releases any resources and enters the inactive state. Any blocking calls to
`!MemAllocator: :GetBuffer should return with an error value, and all further calls
`to GetBuffer fail when in the inactive state.
`Retrieves a container for a sample.
`GetBuffer
`GetProoerties Determines the size, number, and alignment of blocks.
`ReleaseBuffer Releases the CMediaSamole object.
`SetProoerties Specifies a desired number of blocks, size of the blocks, and block alignment
`figure. This method returns the actual values for the same.
`
`Implemented INonDelegatingUnknown Methods
`
`1100
`
`
`
`CBaseAllocator Class
`
`Page 3of11
`
`Description
`Name
`NonDelegatingQueryinterface Passes out pointers to any interfaces added to the derived filter
`class.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M 111.],.(9 Topic Contents
`
`lmll§lllMM
`
`MQi§i!!.ljj,i 111.J,,[9 Topic Contents 1@1§111$8
`
`CBaseAllocator: :Alloc
`
`CBaseAllocator Class
`
`Allocates a media sample object.
`
`HRESULT Alloc(void);
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`Override this member function to allocate memory, instantiate CMediaSample objects, and add
`them to the free list represented by the m IFree data member. The CMemAllocator: :Alloc
`member function is an example of an override of this member function. It calls this member
`function first to ensure that allocator properties have been set.
`
`This member function is called from the CBaseAllocator: :Commit member function when
`entering the active state. The default implementation returns an error value if the
`IMemAllocator: :SetProperties method has not been called yet, and checks that there are no
`outstanding buffers.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M ill.HS Topic Contents •@!§* 1gnw
`
`CBaseAllocator: :CBaseAllocator
`
`CBaseAllocator Class
`
`1101
`
`
`
`CBaseAllocator Class
`
`Page 4of11
`
`Constructs a CBaseAllocator object.
`
`CBaseAllocator(
`TCHAR * pName,
`LPUNKNOWN lpUnk,
`HRESULT * phr,
`BOOL bListSemaphore = TRUE
`
`);
`
`Parameters
`
`pName
`Name of the allocator object.
`lpUnk
`Pointer to LPUNKNOWN.
`
`phr
`
`Pointer to an HRESULT for return values. This is not modified unless this member
`function fails.
`bListSemaphore
`If TRUE, the free list in the allocator has a semaphore associated with it. If FALSE, no
`semaphore is created for the list. Setting this to FALSE can be useful for subclassing
`CBaseAllocator when the semaphore is not required for blocking. The semaphore is used
`for the waiting and signaling mechanism.
`
`Return Values
`
`No return value.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQi§i[.jjj,M 11!.HS Topic Contents
`
`lml!§lllMM
`
`MQl§i[.jjj,M '!!·HM Topic Contents
`
`i@i§ill@iM
`
`CBaseAllocator: :Commit
`
`CBaseAllocator Class
`
`Commits the memory for the specified buffers.
`
`HRESULT Commit(void);
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`1102
`
`
`
`CBaseAllocator Class
`
`Page 5of11
`
`This member function implements the IMemAllocator: :Commit method. The
`IMemAllocator: :SetProoerties method must be called before calling this member function. This
`member function sets m bCommitted to TRUE and overrides any pending decommit operation.
`It then calls the CBaseAllocator: :Alloc member function to allocate memory (which should be
`overridden in the derived class to call the base class member function and then allocate the
`memory). The IMemAllocator: :GetBuffer method fails if it is called before calling this member
`function.
`
`Call CBaseAllocator:: Decommit to release memory when done with the buffers.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M 111.l:.!j Topic Contents
`
`l@i§i llfttiM
`
`CBaseAllocator::Decommit
`
`CBaseAllocator Class
`
`Releases the memory for the specified buffers.
`
`HRESULT Decommit(void);
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IMemAllocator:: Decommit method. Any threads waiting
`in the IMemAllocator: :GetBuffer method return with an error after this method is called. The
`IMemAllocator::GetBuffer method fails if it is called before the IMemAllocator: :Commit
`method or after this method.
`
`See Also
`
`CBaseAllocator: :Commit
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M l!i.! 111j Topic Contents
`
`l@i§lllMM
`
`CBaseAllocator:: Free
`
`1103
`
`
`
`CBaseAllocator Class
`
`Page 6of11
`
`CBaseAllocator Class
`
`Called to decommit the memory when the last buffer is freed.
`
`virtual void Free(void) PURE;
`
`Return Values
`
`No return value.
`
`Remarks
`
`This member function must be implemented in the derived class. It is called from
`CBaseAllocator:: ReleaseBuffer when a decommit is pending and the allocator has put its last
`buffer on the free list. It is also called from CBaseAllocator:: Decommit.
`
`The CMemAllocator:: Free member function is an example of how this can be implemented in
`the derived class. In this case, it simply returns, because the CMemAllocator class releases
`memory from its destructor.
`
`This member function is protected.
`
`© 1997 Microsoft Corooration . All rights reserved. Terms of Use.
`
`MQ<§i[.jjj,M MB.HS
`
`Topic Contents
`
`i@faii!MM
`
`CBaseAllocator: :GetBuffer
`
`CBaseAllocator Class
`
`Retrieves a container for a sample.
`
`HRESULT GetBuffer(
`IMediaSample ** ppBuffer,
`REFERENCE_ TIME * pStartTime,
`REFERENCE_ TIME* pEndTime,
`DWORD dwF/ags
`);
`
`Parameters
`
`ppBuffer
`Pointer to a retrieved media sample buffer.
`pStartTime
`Either NULL or set to the beginning time of the sample to retrieve.
`pEndTime
`
`1104
`
`
`
`CBaseAllocator Class
`
`Page 7of11
`
`Either NULL or set to the ending time of the sample to retrieve.
`dwF/ags
`The following flags are supported.
`Value
`Meaning
`AM_GBF _PREVFRAMESKIPPED The buffer returned will not be filled with data contiguous
`to any previous data sent.
`Dynamic format changes are not allowed on this buffer
`because it is not a key frame.
`
`AM GBF _NOTASYNCPOINT
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`This member function implements the IMemAllocator: :GetBuffer method.
`
`This is a blocking, synchronous call to access the next free buffer (as represented by an
`IMediaSample interface). Upon return, properties (such as the time and so on) are invalid, but
`the buffer pointer and size are correct.
`
`If no buffers are available, CBaseAllocator::GetBuffer calls CBaseAllocator: :SetWaiting and
`then calls the Microsoft® Win32® WaitForSingleObject function to wait for the list to signal
`that a sample is available. The list signals by calling CBaseAllocator:: ReleaseBuffer, which in
`turn calls CBaseAllocator:: NotifySample, which sets m !Waiting to zero and calls the Win32
`ReleaseSemaphore function.
`
`This member function also takes two time parameters. These parameters are used in certain
`advanced buffering scenarios, when it is necessary to have an idea of the amount of time a
`buffer is required. The only place this is currently used is in the video renderer, when the time
`stamps are used as a guide to when the primary surfaces of Display Control Interface (DCI)
`and Microsoft® DirectDraw® should be returned (this is because filling a primary surface
`buffer corresponds directly to the actual rendering of the data). In all other cases, these
`parameters can be safely set to NULL. If one is non-NULL, both should be non-NULL; these
`times will not be set on the sample when it is subsequently returned.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi§1[.]I!:+ +!!.HM Topic Contents
`
`i@l§ii!MM
`
`MQi@[.jlj,M M!i.11119 Topic Contents
`
`i@l§i 11111+
`
`CBaseAllocator::GetProperties
`
`CBaseAllocator Class
`
`Retrieves the size, number, and alignment of blocks.
`
`1105
`
`
`
`CBaseAllocator Class
`
`Page 8of11
`
`HRESULT GetProperties(
`ALLOCATOR_PROPERTIES * pProps
`);
`
`Parameters
`
`pProps
`Structure to be filled in with allocator properties.
`
`Return Values
`
`Returns an HRESULT value. The default implementation returns NOERROR.
`
`Remarks
`
`This member function implements the IMemAllocator: :GetProoerties method. The default
`implementation fills the ALLOCATOR PROPERTIES structure passed in with the values of
`m ISize, m ICount, m !Alignment, and m !Prefix.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+;<§1[.]lj,i '!!·!:.!¥ Topic Contents i@i§ll!¥+
`
`CBaseAllocator::NonDelegatingQuerylnterface
`
`CBaseAllocator Class
`
`Retrieves an interface and increments the reference count.
`
`H RESULT Non Delegati ngQueryinterface(
`REFIID riid,
`void** ppv
`);
`
`Parameters
`
`riid
`
`ppv
`
`Reference identifier.
`
`Pointer to the interface.
`
`Return Values
`
`Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or
`E_NOINTERFACE if it is not.
`
`Remarks
`
`1106
`
`
`
`CBaseAllocator Class
`
`Page 9of11
`
`This member function implements the INonDeleqatinqUnknown: :NonDeleqatinqQuerylnterface
`method and passes out references to the IMemAllocator and !Unknown interfaces. Override
`this member function to return other interfaces on the object in the derived class.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+QH"·h' 111.q9 Topic Contents 1@1§111¥+
`
`CBaseAllocator::NotifySample
`
`CBaseAllocator Class
`
`Notifies a waiting thread that a sample is available on the free list.
`
`void NotifySample(void);
`
`Return Values
`
`No return value.
`
`Remarks
`
`If m !Waiting has been incremented (is not zero), this indicates a thread is waiting. This
`member function checks for this condition and calls the Microsoft Win32 ReleaseSemaphore
`function with the semaphore value m hSem to activate any waiting thread. It also sets
`m_IWaiting back to zero.
`
`This member function is called from CBaseAllocator:: ReleaseBuffer when putting a sample
`back on the free list and from CBaseAllocator: :Decommit when decommitting the allocator (so
`that waiting threads can be denied).
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`+Qi§i[.jjj,M 111.],.[9 Topic Contents
`
`l@i§il!MM
`
`CBaseAllocator:: Release Buffer
`
`CBaseAllocator Class
`
`Releases the object back to the list of free objects.
`
`HRESULT ReleaseBuffer(
`
`1107
`
`
`
`CBaseAllocator Class
`
`Page 10of11
`
`IMediaSample * pSample
`);
`
`Parameters
`
`pSample
`Pointer to the IMediaSample interface of the media sample object.
`
`Return Values
`
`No return value.
`
`Remarks
`
`This member function implements the IMemAllocator:: ReleaseBuffer method. It adds the
`sample to the free list (represented by m IFree) and calls CBaseAllocator: :NotifySample to
`notify any blocked thread waiting for a free sample. If there is a pending
`CBaseAllocator:: Decommit call (indicated by m bDecommitinProgress), the pure virtual
`CBaseAllocator:: Free member function is called to decommit memory when the last buffer is
`placed on the free list.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`MQi§i[.jjj,M 11!.HS
`
`Topic Contents
`
`lmli§lllMM
`
`CBaseAllocator::SetProperties
`
`CBaseAllocator Class
`
`Determines the size, number, and alignment of blocks.
`
`HRESULT SetProperties(
`ALLOCATOR_PROPERTIES * pRequest,
`ALLOCATOR_PROPERTIES * pActual
`);
`
`Parameters
`
`pRequest
`Allocator properties requested to be set.
`pActual
`Allocator properties actually set.
`
`Return Values
`
`Returns an HRESULT value.
`
`Remarks
`
`1108
`
`
`
`CBaseAllocator Class
`
`Page 11of11
`
`The pRequest parameter is filled in by the caller with the requested values for the count,
`number, and alignment as specified by the ALLOCATOR PROPERTIES structure. The pActual
`parameter is filled in by the allocator with the closest values that it can provide for the
`request. This method cannot be called unless the allocator has been decommitted using the
`IMemAllocator:: Decommit method.
`
`The values of data members m ISize, m ICount, m !Alignment, and m !Prefix are set to the
`corresponding members of the pActual parameter's ALLOCATOR PROPERTIES structure.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQi@[.jlj,M l!i.! 111j Topic Contents
`
`l@IJll!MM
`
`CBaseAllocator: :SetWaiting
`
`CBaseAllocator Class
`
`Increments the m !Waiting data member to indicate that a thread is waiting for a sample.
`
`void SetWaiting( );
`
`Return Values
`
`No return value.
`
`Remarks
`
`This member function is called from CBaseAllocator: :GetBuffer if no samples are available on
`the free list. After calling this, CBaseAllocator::GetBuffer calls the Microsoft® Win32®
`WaitForSingleObject function to wait for the list to signal that a sample is available. The list
`signals by calling CBaseAllocator:: ReleaseBuffer, which in turn calls
`CBaseAllocator:: NotifySample, which sets m !Waiting to zero and calls the Win32
`ReleaseSemaphore function.
`
`© 1997 Microsoft Corporation . All rights reserved. Terms of Use.
`
`1109
`
`
`
`CBaseB asic Video Class
`
`Page 1 of6
`
`w41411.111e 1:1.11119 Topic Contents 1 @1#1 1 ttti8
`
`CBaseBasicVideo Class
`
`CBaseObject
`
`INonDelegatingUnknown
`
`CUnknown
`
`!Dispatch
`
`CB aseBasicVideo
`
`The CBaseSaslcVlcleo class handles the lDisoatch component of the lBasicVideo interface and
`!eaves the properties and methods pure virtual.
`
`The lDisoatch: :GetlDsQfNames. lDisoatch: :GetTuoelnfo, lDisoatch: :GetTuoelnfoCount, and
`lDisoatch: :Invoke methods are standard imp!ementatiOns of the !Dispatch interface using the
`CBaseDispatch class (and a type library) to parse the commands and pass them to the pure
`virtual methods of the IBasicVideo interface.
`
`Membe .. Functions
`Name
`Des<: .. lptlon
`CBaseBasicVideo Constructs a CBaseBasicVideo object.
`
`Implemented INonDelegatlngUnknown Methods
`Name
`Des<: .. lption
`NonoeiegatjogQ1 reryintertace Returns a specified reference-counted interface.
`
`Implemented !Dispatch Methods
`Name
`Des<:ription
`GetlDsQfNames Maps a single member and an optional set of parameters to a
`corresponding set of integer dispatch identifiers, whieh can be used during
`subsequent ca us to the !Dispatch:: Invoke method.
`Retrieves a type-information object, whieh can retrieve the type
`information for an interface.
`GetTupelnfoCount Retrieves the number of type-information interfaces provided by an object.
`Ioyo!<e
`Provides access to properties and methods exposed by an object.
`
`GetTupelnfo
`
`w;•; "·II' a 111.11119 Topic Contents
`
`l@i§Mit§M
`
`1110
`
`
`
`CBaseBasicVideo Class
`
`Page 2of6
`
`+Qi§1[.]++ 1 !!·HM Topic Contents
`
`i@l§ii!MM
`
`CBaseBasicVideo: :CBaseBasicVideo
`
`CBaseBasicVideo Class
`
`Constructs a CBaseBasicVideo object.
`
`CBaseBasicVideo (
`const TCHAR * pName,
`LPUNKNOWN pUnk
`);
`
`Parameters
`
`pName
`Name of the object for debugging purposes.
`
`pUnk
`
`Pointer to the owner of this object.
`
`Return Values
`
`No return value.
`
`Remarks
`
`Allocate the pName parameter in static memory. This name appears on the debugging terminal
`upon creation and deletion of the object.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+ Q i§i [.] jj,+ +!!·HM Topic Contents
`
`i@l§ii!MM
`
`CBaseBasicVideo: :GetlDsOfNa mes
`
`CBaseBasicVideo Class
`
`Maps a single member function and an optional set of parameters to a corresponding set of
`integer dispatch identifiers, which can be used upon subsequent calls to the
`CBaseBasicVideo:: Invoke member function.
`
`HRESULT GetIDsOfNames(
`
`1111
`
`
`
`CBaseBasicVideo Class
`
`Page 3of6
`
`REFIID riid,
`OLECHAR * * rgszNames,
`UINT cNames,
`LCID lcid,
`DISPID * rgdispid
`);
`
`Parameters
`
`riid
`
`Reference identifier. Reserved for future use. Must be NULL.
`rgszNames
`Passed-in array of names to be mapped.
`cNames
`Count of the names to be mapped.
`
`lcid
`
`Locale context in which to interpret the names.
`rgdispid
`Caller-allocated array, each element of which contains an ID corresponding to one of the
`names passed in the rgszNames array. The first element represents the member name;
`the subsequent elements represent each of the member's parameters.
`
`Return Values
`
`Returns one of the following values.
`Value
`Meaning
`S_OK
`Success.
`E_OUTOFMEMORY
`Out of memory.
`DISP E UNKNOWN NAME One or more of the names were not known. The returned DISPIDs
`contain DISPID_UNKNOWN for each entry that corresponds to an
`unknown name.
`DISP _E_UNKNOWN_CLSID The CLSID was not recognized.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Q'41[.]1!,+ 1 !1·HM Topic Contents
`
`ifflj[§ii!¥M
`
`+Q<@[.]ij,+ 111.11119 Topic Contents 1@1§11!¥+
`
`CBaseBasicVideo: :GetTypeinfo
`
`CBaseBasicVideo Class
`
`Retrieves a type-information object, which can retrieve the type information for an interface.
`
`HRESULT GetTypeinfo(
`UINT itinfo,
`
`1112
`
`
`
`CBaseBasicVideo Class
`
`Page 4of6
`
`LCID lcid,
`ITypeinfo * * pptinfo
`);
`
`Parameters
`
`itinfo
`
`Type information to return. Pass zero to retrieve type information for the IDispatch
`implementation.
`
`lcid
`
`Locale ID for the type information. An object might be able to return different type
`information for different languages. This is important for classes that support localized
`member names. For classes that do not support localized member names, this parameter
`can be ignored.
`pptinfo
`Pointer to the type-information object requested.
`
`Return Values
`
`Returns an E_POINTER if pptinfo is invalid. Returns TYPE_E_ELEMENTNOTFOUND if itinfo is not
`zero. Returns S_OK if is successful. Otherwise, returns an HRESULT from one of the calls to
`retrieve the type. The HRESULT indicates the error and can be one of the following standard
`constants, or other values not listed:
`Value
`Meaning
`E_FAIL
`Failure.
`E_POINTER
`Null pointer argument.
`E_INVALIDARG Invalid argument.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`+Qi§1[.]I!:+ +!!.HM Topic Contents
`
`i@l§ii!MM
`
`MQi@[.jlj,M M!i.11119 Topic Contents
`
`i@l§i 11111+
`
`CBaseBasicVideo: :GetTypeinfoCou nt
`
`CBaseBasicVideo Class
`
`Retrieves the number of type-information interfaces provided by an object.
`
`HRESULT GetTypeinfoCount(
`UI NT * pctinfo
`);
`
`Parameters
`
`pctinfo
`
`1113
`
`
`
`CBaseBasicVideo Class
`
`Page 5of6
`
`Pointer to the location that receives the number of type-information interfaces that the
`object provides. If the object provides type information, this number is 1; otherwise, the
`number is 0.
`
`Return Values
`
`Returns E_POINTER if pctinfo is invalid; otherwise, returns S_OK.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M l!i.! 11ij Topic Contents
`
`l@i§lllMM
`
`CBaseBasicVideo: :Invoke
`
`CBaseBasicVideo Class
`
`Provides access to properties and methods exposed by an object.
`
`HRESULT Invoke(
`DISPID dispidMember,
`REFIID riid,
`LCID lcid,
`WORD wF/ags,
`DISPPARAMS * pdispparams,
`VARIANT* pvarResult,
`EXCEPINFO * pexcepinfo,
`UI NT * puArgErr
`);
`
`Parameters
`
`dispidMember
`Identifier of the member. Use CBaseBasicVideo: :GetIDsOfNames or the object's
`documentation to obtain the dispatch identifier.
`
`riid
`
`Reserved for future use. Must be IID NULL.
`
`lcid
`
`Locale context in which to interpret arguments.
`wF/ags
`Flags describing the context of the CBaseBasicVideo::Invoke call.
`pdispparams
`Pointer to a structure containing an array of arguments, an array of argument dispatch
`IDs for named arguments, and counts for number of elements in the arrays.
`pvarResult
`Pointer to where the result is to be stored, or NULL if the caller expects no result.
`pexcepinfo
`Pointer to a structure containing exception information.
`puArgErr
`Index of the first argument, within the rgvarg array, that has an error.
`
`1114
`
`
`
`CBaseBasicVideo Class
`
`Page 6of6
`
`Return Values
`
`Returns DISP _E_UNKNOWNINTERFACE if riid is not IID_NULL. Returns one of the error codes
`from CBaseBasicVideo: :GetTypelnfo if the call fails. Otherwise, returns the HRESULT from the
`call to !Dispatch: :Invoke.
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M 111.l:.!j Topic Contents
`
`l@i§i llfttiM
`
`MQl§i[.jjj,M 111.],.(j Topic Contents
`
`l@i§lllMM
`
`CBaseBasicVideo::NonDelegatingQuerylnterface
`
`CBaseBasicVideo Class
`
`Returns a specified reference-counted interface.
`
`H RESULT Non Delegati ngQueryinterface(
`REFIID riid,
`void **ppv
`);
`
`Parameters
`
`riid
`
`ppv
`
`Reference identifier.
`
`Pointer to the interface.
`
`Return Values
`
`Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or
`E_NOINTERFACE if it is not.
`
`Remarks
`
`Returns pointers to the IBasicVideo and !Unknown interfaces by default. Override this method
`to publish any additional interfaces implemented by the derived class.
`
`© 1997 Microsoft Cornoration . All rights reserved. Terms of Use.
`
`1115
`
`
`
`CBaseContro!Video Class
`
`Page 1of41
`
`w41411.111e 1:1.11119 Topic Contents 1 @1#1 1 ttti8
`
`CBaseControlVideo Class
`
`CBaseObject
`
`INonDelegatingUnknown
`
`CUnknown
`
`!Dispatch
`
`CBaseBasicVideo
`
`CBaseControlVideo
`
`The CBaseControlVldeo class implements the IBasicVideo dual interface and controls the
`video properties of a generic video window. Generally, a CBaseControlVideo object is a video
`renderer that draws video into a window on the display.
`
`The CBaseControlVldeo class supports both properties and methods. Properties are more
`easily accessible from many Automation controllers (such as the Microsoft:® Visual Basic®
`programming system). However, some operations require applications to be able to change
`several properties simultaneously; for this reason, methods are provided that enable a number
`of related properties to be changed.
`
`Many CBaseControlVldeo member functions require only that the video renderer be
`connected to a filter graph. If it is not connected, member functions wm return
`VFW E NOT CONNECTED. Properties set on a video renderer persist between successive
`connections and disconnections. AU applications should ensure that they reset the renderer
`properties before starting a presentation.
`
`When working with video, the application can select a portion of the video to use. This portion
`is the source rectangle that the CBaseControlVldeo object controls. CBaseControlVldeo
`enables your application to set and retrieve the source rectangle. AU the rectangles that
`CBaseControlVloeo uses employ top, left, width, and height rather than top, left, right, and
`bottom, which is favored in Microsoft: Win32® programming. When no source rectangle has
`been set, the properties of the source rectangle return the full, native video size.
`
`Protected Data Members
`Name
`Description
`m_pfllter
`Pointer to an owning media filter.
`m_plnterfaceLock Externally defined critieal section.
`m_pPln
`Control of the media types for connection.
`
`Member Functions
`
`1116
`
`
`
`CBaseContro!Video Class
`
`Page 2 of 41
`
`Description
`Name
`CBaseControlVideo Constructs a CBaseControlVideo object.
`Cooylmage
`Creates a memory copy of a video image.
`GetlmageSize
`Retrieves video image size information.
`SetControlVideoPin Sets the pin with which this object should synchronize.
`
`Overridable Member Functions
`Description
`Name
`Determines if a source rectangle is valid.
`CheckSourceRect
`Determines if a target rectangle is valid.
`CheckTa rgetRect
`Retrieves the current source video rectangle (pure virtual).
`GetSourceRect
`Returns the current image in a memory buffer (pure virtual).
`GetStaticlmage
`Retrieves the current target video rectangle (pure virtual).
`GetTa rgetRect
`Retrieves the VIDEOINFOHEADER structure containing the video format.
`GetVideoFormat
`IsDefaultSourceRect Determines if the renderer is using the default source rectangle (pure
`virtual).
`IsDefaultTargetRect Determines if the renderer is using the default target rectangle (pure
`virtual).
`OnUodateRectangles Called when the source or target rectangle changes.
`OnVideoSizeChange Passes EC_VIDEO_SIZE_CHANGED to the application.
`SetDefaultSourceRect Sets the default source video rectangle (pure virtual).
`SetDefaultTargetRect Sets the default target video rectangle (pure virtual).
`SetSourceRect
`Sets the current source video rectangle (pure virtual).
`SetTa rgetRect
`Sets the current target rectangle (pure virtual).
`
`Implemented IBasicVideo Methods
`Name
`Description
`get AvgTimePerFrame
`Returns an approximate average time per frame.
`get BitErrorRate
`Returns an approximate bit error rate.
`get BitRate
`Returns an approximate bit rate for the video.
`GetCurrentlmage
`Returns a memory rendering of the current image.
`get DestinationHeight
`Retrieves the current destination rectangle's height.
`get Destinationleft
`Retrieves the current destination rectangle's left coordinate.
`Retrieves the current destination position.
`GetDestinationPosition
`get DestinationToo
`Retrieves the current destination rectangle's top coordinate.
`get DestinationWidth
`Retrieves the current destination rectangle's width.
`get SourceHeight
`Retrieves the current source rectangle's height.
`get Sourceleft
`Retrieves the current source rectangle's left coordinate.
`Retrieves the current source position.
`GetSourcePosition
`get SourceToo
`Retrieves the current source rectangle's top coordinate.
`get SourceWidth
`Retrieves the current source rectangle's width.
`get VideoHeight
`Retrieves the native video height.
`GetVideoPa letteEntries
`Retrieves a range of palette entries for the video.
`Retrieves the width and height of the native video.
`GetVideoSize
`get VideoWidth
`Retrieves the native video width.
`
`1117
`
`
`
`CBaseControlVideo Class
`
`Page 3 of 41
`
`IsUsinqDefaultDestination
`
`Determines if the renderer is using the default destination
`window.
`IsUsingDefa ultSource
`Determines if the renderer is using the default source window.
`put DestinationHeight
`Sets the destination rectangle's height.
`Sets the destination rectangle's left coordinate.
`D!.!t DestinatiQnLeft
`Sets the destination rectangle's top coordinate.
`D!.!t DestinatiQnTQD
`Sets the destination rectangle's width.
`D!.!t DestinatiQnWidth
`Sets the source rectangle's height.
`D!.!t SQurceHeight
`Sets the source rectangle's left coordinate.
`D!.!t SQurceLeft
`Sets the source rectangle's top coordinate.
`D!.!t SQurceTQD
`Sets the source rectangle's width.
`D!.!t SQurceWidth
`SetDefaultDestinationPosition Sets the default destination position again.
`SetDefaultSourcePosition
`Sets the default source position again.
`Sets the destination rectangle position.
`SetDestinatiQnPQsitiQn
`Sets the source rectangle position.
`SetSQ u rcePQsit iQn
`
`© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
`
`MQl@[.jlj,M l!i.l:.ij Topic Contents
`
`l@i§i llfttiM
`
`MQl§i[.jjj,M 111.],.(j Topic Contents
`
`•@m••1m+
`
`C BaseControlVideo:: C Ba seControlVideo
`
`CBaseControlVideo Class
`
`Constructs a CBaseCQntmlVideQ object.
`
`CBaseControlVideo (
`CBaseFilter *