Partager via


CBaseControlVideo Class (Compact 2013)

3/26/2014

CBaseControlVideo Class

This 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 CBaseControlVideo 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 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 top, left, width, and height rather than top, left, right, and bottom, which is favored in Win32 programming.

When no source rectangle has been set, the properties of the source rectangle return the full, native video size.

Protected Data Members

Member

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

Member function

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.

Overrideable Member Functions

Member function

Description

CheckSourceRect

Determines if a source rectangle is valid.

CheckTargetRect

Determines if a target rectangle is valid.

GetSourceRect

Retrieves the current source video rectangle as a pure virtual function.

GetStaticImage

Returns the current image in a memory buffer as a pure virtual function.

GetTargetRect

Retrieves the current target video rectangle as a pure virtual function.

GetVideoFormat

Retrieves the VIDEOINFOHEADER structure containing the video format.

IsDefaultSourceRect

Determines if the renderer is using the default source rectangle as a pure virtual function.

IsDefaultTargetRect

Determines if the renderer is using the default target rectangle as a pure virtual function.

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 as a pure virtual function.

SetDefaultTargetRect

Sets the default target video rectangle as a pure virtual function.

SetSourceRect

Sets the current source video rectangle as a pure virtual function.

SetTargetRect

Sets the current target rectangle as a pure virtual function.

Implemented IBasicVideo Methods

Method

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.

Requirements

Header

dshow.h,
Streams.h

Library

ole32.lib,
Ole32auth.lib,
Strmbase.lib,
Strmiids.lib,
uuid.lib

See Also

Reference

DirectShow Classes