This is the interface for the LEAD Video Resize transform.
Holds the predefined resizing constants.
typedef enum
{
SIZE_1OVER8 = 0,
SIZE_1OVER4 = 1,
SIZE_1OVER2 = 2,
SIZE_NORMAL = 3,
SIZE_X2 = 4,
SIZE_X4 = 5,
SIZE_X8 = 6
} QUICKRESIZE;
The output width and height are 1/8 of the source width and height.
The output width and height are 1/4 of the source width and height.
The output width and height are 1/2 of the source width and height.
The output width and height are same as the source width and height.
The output width and height are 2X of the source width and height.
The output width and height are 4X of the source width and height.
The output width and height are 8X of the source width and height.
Holds the resizing algorithms constants.
typedef enum
{
RESIZE_NORMAL = 0x0000,
RESIZE_BRESENHAM = 0x0001,
RESIZE_RESAMPLE = 0x0002,
RESIZE_BICUBIC = 0x0004,
} SIZETYPES;
Use the normal resizing method.
Use Bresenham resizing.
Use resampling.
Use bicubic resizing.
Specifies whether to use the video input aspect ratio or ignore it.
typedef enum
{
INPUTASPECTRATIO_SQUAREPIXELS = 0,
INPUTASPECTRATIO_USEINPUT = 1,
INPUTASPECTRATIO_CUSTOM = 2,
INPUTASPECTRATIO_4_3 = 10,
INPUTASPECTRATIO_16_9 = 11,
} InputAspectRatioModeConstants;
Ignore the input aspect ratio and consider the input to be square pixels.
Use the input aspect ratio (if present). Otherwise, consider the input to be square pixels.
Ignore any input aspect ratio and consider it to be given by the CustomInputAspectRatioWidth and CustomInputAspectRatioHeight properties.
Ignore the input aspect ratio and consider it to be 4:3.
Ignore the input aspect ratio and consider it to be 16:9.
Specifies the desired output aspect ratio.
typedef enum
{
OUTPUTASPECTRATIO_SQUAREPIXELS = 0,
OUTPUTASPECTRATIO_USEINPUT = 1,
OUTPUTASPECTRATIO_CUSTOM = 2,
OUTPUTASPECTRATIO_4_3 = 10,
OUTPUTASPECTRATIO_16_9 = 11,
} OutputAspectRatioModeConstants;
Make the output aspect ratio square pixels.
Make the output aspect ratio be the same as the input aspect ratio.
Use the output aspect ratio given by the CustomOutputAspectRatioWidth and CustomOutputAspectRatioHeight properties.
Make the output have a 4:3 aspect ratio.
Make the output have a 4:3 aspect ratio.
Specifies whether the input should be stretched to the output, or the aspect ratio should be preserved.
typedef enum
{
STRETCHMODE_STRETCH,
STRETCHMODE_FITWIDTH,
STRETCHMODE_FITHEIGHT,
STRETCHMODE_FIT,
STRETCHMODE_ENLARGEDFIT,
} StretchModeConstants;
Ignore any input aspect ratio and stretch the video to the output width and height. Ignore the WidthControlMode and HeightControlMode properties (consider them both as Fixed).
Resize the video by preserving the aspect ratio and fit to width. This might cause colored bars on top and bottom of the video or it can cause the top and bottom of the video to be truncated.
Resize the video by preserving the aspect ratio and fit to height. This might cause colored bars on left and right side of the video or it can cause the left and right side of the video to be truncated.
Resize the video by preserving the aspect ratio and fit both width and height inside the output rectangle. This might add colored bars on the edges.
Resize the video by preserving the aspect ratio and enlarging the width or height so the output rectangle fits inside the resulting output. (This is the default resize mode performed by the Media Foundation renderers). This might cause video edges to be cropped.
Specifies whether the transform can modify the output size.
typedef enum
{
SIZECONTROL_FIXED,
SIZECONTROL_ADJUSTABLE,
} SizeControlModeConstants;
Keep the output size (width or height) fixed.
You can adjust the output size (width or height) to preserve the input aspect ratio.
Specifies the action to apply if the output does not have square pixels and the downstream transform does not preserve the aspect ratio.
typedef enum
{
SQUAREPIXELOUTPUT_SAMESIZE,
SQUAREPIXELOUTPUT_FITWIDTH,
SQUAREPIXELOUTPUT_FITHEIGHT,
SQUAREPIXELOUTPUT_INCREASESIZE,
SQUAREPIXELOUTPUT_DECREASESIZE,
} SquarePixelOutputModeConstants;
Keep the output size unchanged. This might distort the output.
Keep the output width the same and modify the output height to preserve the visual output ratio.
Keep the output height the same and modify the output width to preserve the visual output ratio.
Increase the video size (width or height) so the requested output size fits inside the new output size. (This is the default resizing performed by the Media Foundation video renderers).
Decrease the video size (width or height) so the new output size fits inside the requested output size.
Lists the valid values for the ApiLevel parameter that can be passed to the ResetToDefaultsEx method.
typedef enum
{
LMVResize_APILEVEL_1 = 0,
LMVResize_APILEVEL_2 = 1,
} LMVResize_APILEVEL;
Use the defaults from the previous versions of the resize transform.
Use the defaults from the current version of the resize transform.
Obsolete, use StretchModeConstants instead
Holds auto resizing mode constants.
typedef enum
{
AUTORESIZEMODE_INCREASE = 0x00,
AUTORESIZEMODE_FITWIDTH = 0x00,
AUTORESIZEMODE_DECREASE = 0x01
AUTORESIZEMODE_FITHEIGHT = 0x01
} AutoResizeModeConstants;
Obsolete.
Obsolete.
The height will be changed according to the width.
The width will be changed according to the height.
Type | Name | Description |
---|---|---|
VARIANT_BOOL | Enabled | VARIANT_TRUE to enable resizing. |
VARIANT_BOOL | EnableQuickResize | VARIANT_TRUE to enable predefined ratios selection. |
VARIANT_BOOL | AspectRatio | Obsolete property, use StretchMode instead.VARIANT_TRUE to preserve the size aspect ratio, if the transform input is not connected, no aspect ratio is used. |
VARIANT_BOOL | AutoStop | If VARIANT_TRUE, allows the graph to be stopped automatically. This is necessary when the dimensions change while the graph is running. The graph needs to be re-run after the change is applied. |
long | Width | New width to use. |
long | Height | New height to use. |
QUICKRESIZE | QuickResize | If EnableQuickResize is VARIANT_TRUE, this property must be set to one of the QUICKRESIZE constants. When using the QUICKRESIZE constants the Width and Height properties are ignored. |
SIZETYPES | Flags | One of the SIZETYPES constants, which specify the algorithm used for resizing. |
VARIANT_BOOL | IsLEADInputPinConnected | Read only. Returns VARIANT_TRUE if the transforms input pin is connected. |
VARIANT_BOOL | IsLEADOutputPinConnected | Read only; returns VARIANT_TRUE if the transforms output pin is connected. |
long | InWidth | Read only; the input stream width. |
long | InHeight | Read only; the input stream height. |
long | OutWidth | Read only; the output stream width. |
long | OutHeight | Read only; the output stream height. |
long | InBits | Read only; the input stream bits per pixel. |
long | OutBits | Read only; the output stream bits per pixel. |
VARIANT_BOOL | AutoSize | Obsolete property, use WidthControlMode and HeightControlMode instead.If selected, preserves the actual video size aspect ratio. If the width changes then the height will be changed as well. |
long | FillColor | The color that will be used to fill the different size. |
AutoResizeModeConstants | AutoResizeMode | Obsolete property, use StretchMode instead.A value that represents the auto resize mode. It must be one of AutoResizeModeConstants values. |
InputAspectRatioModeConstants | InputAspectRatioMode | Use this property to specify whether to use the video input aspect ratio or override it. |
long | CustomInputAspectRatioWidth | Width component for custom aspect ratio. Used only if InputAspectRatioMode is set to INPUTASPECTRATIO_CUSTOM . |
long | CustomInputAspectRatioHeight | Height component for custom aspect ratio. Used only if InputAspectRatioMode is set to INPUTASPECTRATIO_CUSTOM . |
OutputAspectRatioModeConstants | OutputAspectRatioMode | Use this property to specify the desired output aspect ratio. |
long | CustomOutputAspectRatioWidth | Width component for custom aspect ratio. Used only if OutputAspectRatioMode is set to OUTPUTASPECTRATIO_CUSTOM . |
long | CustomOutputAspectRatioHeight | Height component for custom aspect ratio. Used only if OutputAspectRatioMode is set to OUTPUTASPECTRATIO_CUSTOM . |
StretchModeConstants | StretchMode | Allows you to specify whether the input should be stretched to the output or whether the aspect ratio should be preserved. |
SizeControlModeConstants | WidthControlMode | Specifies whether the transform can modify the output width if necessary to preserve the input aspect ratio. This property is ignored if StretchMode is set to STRETCHMODE_STRETCH . |
SizeControlModeConstants | HeightControlMode | Specifies whether the transform can modify the output height if necessary to preserve the input aspect ratio. This property is ignored if StretchMode is set to STRETCHMODE_STRETCH . |
SquarePixelOutputModeConstants | SquarePixelOutputMode | Specifies what to do if the output does not have square pixels and the downstream transform does not preserve the aspect ratio. This setting allows you to specify how to modify the output width and height if the downstream transform insists on a square pixel output. This option overrides the WidthControlMode and HeightControlMode properties. (In other words, this indicates what should be down if the output media type is not VIDEOINFO2). |
VARIANT_BOOL | ForceSquarePixelOutput | Force the output to be square pixels (VIDEOINFO). In this case, the output might be resized as specified by the SquarePixelOutputMode property. |
Call this method when you are about to change the resize attributes. The changes take effect when StopChangingAttributes is called with bCancelChanges set to VARIANT_FALSE
.
S_OK if connected; otherwise, S_FALSE.
bCancelChanges
Sets the resize attributes. Set to VARIANT_FALSE to set the resize attributes. Use VARIANT_TRUE to reset the resize attributes to the old one.
S_OK if connected; otherwise, S_FALSE.
✎ NOTE
This method is now obsolete. Call
ResetToDefaultsEx(LMVResize_APILEVEL_1)
instead.
Resets resizing to default values from the previous version of the transform.
S_OK if connected; otherwise, S_FALSE.
LMVResize_APILEVEL ApiLevel
.
Resets resizing to default values. The ApiLevel
determines which default values to use. Current applications should set ApiLevel to LMVResize_APILEVEL_2
= 1.
The resize transform might change in the future and have different properties or default behavior. Calling this method ensure the transform will have the same default values as they were at the time you developed your application.
It is recommended you call ResetToDefaultsEx(LMVResize_APILEVEL_2)
before you start setting properties and start calling other methods for this interface.
S_OK if connected; otherwise, S_FALSE.
Loads transform settings from the registry. The Media Foundation transforms import the settings from the registry only at creation time. This method will force the transform to re-load its settings from the registry. If the transform has no settings to load from the registry, E_NOTIMPL
is returned.
Return
S_OK if successful; otherwise, S_FALSE.
Writes transform settings to the registry. This method will force the transform to save its settings to the registry before its released.
If the transform has no settings to write to the registry, E_NOTIMPL
is returned.
Return
S_OK if successful; otherwise, S_FALSE.
Note:
Changes that affect the video frame dimensions cannot be performed while the media session is active, as a result these changes will be reverted. You must close the currently open media, change the properties, and then re-open the media.
For more information on how the transform's properties are used during the resizing process, please see the Notes and Comments section of the LEAD Video Resize Transform User Interface topic.