CBaseControlVideo class
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The CBaseControlVideo class implements the IBasicVideo 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.
Many CBaseControlVideo member functions require only that the video renderer be connected to a filter graph. If it is not connected, member functions will return VFW_E_NOT_CONNECTED. Properties set on a video renderer persist between successive connections and disconnections. All 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 CBaseControlVideo object controls. CBaseControlVideo enables your application to set and retrieve the source rectangle. All the rectangles that CBaseControlVideo uses employ width and height values rather than right and bottom values. When no source rectangle has been set, the properties of the source rectangle return the full, native video size.
Protected Data Members | Description |
---|---|
m_pFilter | Pointer to an owning media filter. |
m_pInterfaceLock | Externally defined critical section. |
m_pPin | Control of the media types for connection. |
Member Functions | Description |
CBaseControlVideo | Constructs a CBaseControlVideo object. |
CopyImage | Creates a memory copy of a video image. |
GetImageSize | Retrieves video image size information. |
SetControlVideoPin | Sets the pin with which this object should synchronize. |
Overridable Member Functions | Description |
CheckSourceRect | Determines if a source rectangle is valid. |
CheckTargetRect | Determines if a target rectangle is valid. |
GetSourceRect | Retrieves the current source video rectangle (pure virtual). |
GetStaticImage | Returns the current image in a memory buffer (pure virtual). |
GetTargetRect | Retrieves the current target video rectangle (pure virtual). |
GetVideoFormat | Retrieves the VIDEOINFOHEADER structure containing the video format. |
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). |
OnUpdateRectangles | 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). |
SetTargetRect | Sets the current target rectangle (pure virtual). |
IBasicVideo Methods | Description |
get_AvgTimePerFrame | Retrieves an approximate average time per frame. |
get_BitErrorRate | Retrieves an approximate bit error rate. |
get_BitRate | Retrieves an approximate bit rate for the video. |
GetCurrentImage | Retrieves 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. |
GetDestinationPosition | Retrieves the current destination position. |
get_DestinationTop | 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. |
GetSourcePosition | Retrieves the current source position. |
get_SourceTop | Retrieves the current source rectangle's top coordinate. |
get_SourceWidth | Retrieves the current source rectangle's width. |
get_VideoHeight | Retrieves the native video height. |
GetVideoPaletteEntries | Retrieves a range of palette entries for the video. |
GetVideoSize | Retrieves the width and height of the native video. |
get_VideoWidth | Retrieves the native video width. |
IsUsingDefaultDestination | Determines if the renderer is using the default destination window. |
IsUsingDefaultSource | Determines if the renderer is using the default source window. |
put_DestinationHeight | Sets the destination rectangle's height. |
put_DestinationLeft | Sets the destination rectangle's left coordinate. |
put_DestinationTop | Sets the destination rectangle's top coordinate. |
put_DestinationWidth | Sets the destination rectangle's width. |
put_SourceHeight | Sets the source rectangle's height. |
put_SourceLeft | Sets the source rectangle's left coordinate. |
put_SourceTop | Sets the source rectangle's top coordinate. |
put_SourceWidth | Sets the source rectangle's width. |
SetDefaultDestinationPosition | Sets the default destination position again. |
SetDefaultSourcePosition | Sets the default source position again. |
SetDestinationPosition | Sets the destination rectangle position. |
SetSourcePosition | Sets the source rectangle position. |
See also