The filter graph manager exposes the IBasicVideo object, which supports the video properties of a generic video window. Generally, this is a video renderer that draws video into a window on the display.
The video renderer must be connected to use IBasicVideo object methods. If it isn't connected, all methods return run-time error 521. Properties set on a video renderer generally 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 IBasicVideo object controls. IBasicVideo allows the source rectangle to be set and retrieved. All IBasicVideo rectangles have top, left, width, and height properties. When no source rectangle has been set, the properties of the source rectangle return the full, native video size.
Properties
AvgTimePerFrame Retrieves the average time between successive frames in 100-nanosecond units. BitErrorRate Retrieves an approximate bit error rate for the video stream. BitRate Retrieves an approximate bit rate for the video stream. DestinationLeft Sets or retrieves the x-axis coordinate for the destination video rectangle. DestinationHeight Sets or retrieves the height of the destination video rectangle. DestinationTop Sets or retrieves the y-axis coordinate for the destination video rectangle. DestinationWidth Sets or retrieves the width of the destination video rectangle. SourceHeight Sets or retrieves the height of the source video rectangle. SourceLeft Sets or retrieves the x-axis coordinate for the source video rectangle. SourceTop Sets or retrieves the y-axis coordinate for the source video rectangle. SourceWidth Sets or retrieves the width of the source video rectangle. VideoHeight Retrieves the current video height. VideoWidth Retrieves the current video width.
Methods
GetCurrentImage Returns a copy of the image that is currently waiting at the renderer. GetDestinationPosition Retrieves the destination rectangle for the window. GetSourcePosition Retrieves the source video rectangle. GetVideoPaletteEntries Retrieves the color palette entries required by the video. GetVideoSize Retrieves the native video dimensions. IsUsingDefaultSource Indicates whether the default source is being used. SetDefaultDestinationPosition Sets the default destination position for the window. SetDefaultSourcePosition Informs the renderer to use the default source rectangle. SetDestinationPosition Sets the destination rectangle for the window. SetSourcePosition Sets the source video rectangle.
Retrieves the average time between successive frames in 100-nanosecond units.
Syntax
objVideo.AvgTimePerFrame
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Retrieves a bit error rate for the video stream (one error for approximately this many bits).
Syntax
objVideo.BitErrorRate
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Retrieves an approximate bit rate for the video stream (in bits per second).
Syntax
objVideo.BitRate
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Retrieves or sets the height of the destination rectangle.
Syntax
objVideo.DestinationHeight [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- New value for the destination rectangle height.
Remarks
Setting this coordinate does not affect the destination rectangle y-axis origin.
Retrieves or sets the destination x-axis origin coordinate.
Syntax
objVideo.DestinationLeft [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- New value of the destination x-axis origin.
Remarks
Setting this coordinate does not affect the destination rectangle width.
Retrieves or sets the destination y-axis origin coordinate.
Syntax
objVideo.DestinationTop [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- New value of the y-axis origin.
Remarks
Setting this coordinate does not affect the destination rectangle height.
Retrieves or sets the width of the destination rectangle.
Syntax
objVideo.DestinationWidth [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- New width value.
Remarks
Setting this coordinate does not affect the destination rectangle x-axis origin.
Retrieves the image currently waiting at the renderer.
Syntax
objVideo.GetCurrentImage BufferSize, DIBImage
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- BufferSize
- Long value that specifies the size of the buffer the caller is passing in. GetCurrentImage sets this value to the actual number of bytes in the buffer before exiting.
- DIBImage
- Long value that will contain the buffer where the complete image will be stored in device-independent bitmap (DIB) format. You must pass the buffer by reference.
Remarks
Pause the video renderer before calling this method; calling this method in any other state returns run-time error 549. Depending on what data the source filter has available, the video renderer is not guaranteed to service this request.
An application can use this method to get a copy of the current image the video renderer holds when paused by calling the method with DIBImage set to Nothing.
Retrieves the position of the destination rectangle in window coordinates.
Syntax
objVideo.GetDestinationPosition Left, Top, Width, Height
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- Left
- Long integer value that will contain the destination window's x-axis origin.
- Top
- Long integer value that will contain the destination window's y-axis origin.
- Width
- Long integer value that will contain the destination window's width.
- Height
- Long integer value that will contain the destination window's height.
Remarks
This method has the same effect as individually retrieving the DestinationLeft, DestinationTop, DestinationWidth, and DestinationHeight properties.
Retrieves the source position that is clipped to the available video.
Syntax
objVideo.GetSourcePosition Left, Top, Width, Height
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- Left
- Long integer value that will contain the source window's x-axis origin.
- Top
- Long integer value that will contain the source window's y-axis origin.
- Width
- Long integer value that will contain the source window's width.
- Height
- Long integer value that will contain the source window's height.
Remarks
This method has the same effect as retrieving the values of the SourceLeft, SourceTop, SourceWidth, and SourceHeight properties.
Retrieves the palette colors for the video.
Syntax
objVideo.GetVideoPaletteEntries StartIndex, Entries, Retrieved, Palette
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- StartIndex
- Long integer value that specifies the start index for the palette.
- Entries
- Long integer value that specifies the number of palette entries required.
- Retrieved
- Long integer value that will contain the number of entries actually returned in Palette.
- Palette
- Long integer value that will contain a pointer to an array of Microsoft® Win32® PALETTEENTRY structures.
Retrieves the native video dimensions.
Syntax
objVideo.GetVideoSize Width, Height
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- Width
- Long integer value that will contain the video window's width.
- Height
- Long integer value that will contain the video window's height.
Remarks
Retrieves the native video width and height, disregarding any source rectangle that might have been set. ActiveX Controls or other applications can use this information to negotiate space in compound documents.
Retrieves whether this object is using the default source.
Syntax
objVideo.IsUsingDefaultSource
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Return Value
True indicates that the IBasicVideo object is using the default source; False indicates that it is not.
Sets the default destination position of the video window so that the renderer uses the entire window for playback.
Syntax
objVideo.SetDefaultDestinationPosition
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Informs the renderer to use the default source rectangle.
Syntax
objVideo.SetDefaultSourcePosition
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Sets the destination rectangle in window coordinates.
Syntax
objVideo.SetDestinationPosition Left, Top, Width, Height
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- Left
- Long value specifying the x-axis origin of the destination window, in pixels.
- Top
- Long value specifying the y-axis origin of the destination window, in pixels.
- Width
- Long value specifying the width of the destination window, in pixels.
- Height
- Long value specifying the height of the destination window, in pixels.
Remarks
This method has the same effect as setting the DestinationLeft, DestinationTop, DestinationWidth, and DestinationHeight properties individually.
Sets the source rectangle and is clipped against the available video.
Syntax
objVideo.SetSourcePosition Left, Top, Width, Height
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- Left
- Long value specifying the x-axis origin of the source window.
- Top
- Long value specifying the y-axis origin of the source window.
- Width
- Long value specifying the width of the source window.
- Height
- Long value specifying the height of the source window.
Remarks
This method has the same effect as setting the SourceLeft, SourceTop, SourceWidth, and SourceHeight properties individually.
Retrieves or sets the height of the source rectangle.
Syntax
objVideo.SourceHeight [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- Long value specifying the current rectangle height, in pixels.
Remarks
Setting the height of the source rectangle has no effect on the width and other source values.
Retrieves or sets the source rectangle's x-coordinate.
Syntax
objVideo.SourceLeft [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- New value for the x-axis origin of the source rectangle.
Remarks
Changes to this property do not affect the width and other source values.
Retrieves or sets the source rectangle y-axis origin coordinate.
Syntax
objVideo.SourceTop [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- Long value specifying the distance from the top of the display to the top of the current window, in pixels.
Remarks
Setting this method has no effect on the source rectangle height.
Retrieves or sets the source rectangle width.
Syntax
objVideo.SourceWidth [= lValue]
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
- lValue
- Long value specifying the current width, in pixels.
Remarks
This method has no effect on the source rectangle x-axis coordinate.
Retrieves the native height of the video.
Syntax
objVideo.VideoHeight
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Remarks
This method returns the actual height of the video supplied to the renderer. It does not address any set source rectangle, but simply returns the native vertical dimension. It can be used by applications to negotiate size requirements with in-place container documents.
Retrieves the native width of the video.
Syntax
objVideo.VideoWidth
Parts
- objVideo
- Object expression that evaluates to an IBasicVideo object.
Remarks
This method returns the actual width of the video supplied to the renderer. It does not address any set source rectangle, but simply returns the native horizontal dimension. It can be used by applications to negotiate size requirements with in-place container documents.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.