FormatVideoGetByIndex Method (MFWriterClass)
format type
index of a format
video properties
name of the format
Gets the video format by its index.
Syntax
Public Overridable Sub FormatVideoGetByIndex( _
   ByVal _eFormatType As eMFormatType, _
   ByVal _nIndex As Integer, _
   ByRef _pVidProps As M_VID_PROPS, _
   ByRef _pbsName As String _
) 
public virtual void FormatVideoGetByIndex( 
   eMFormatType _eFormatType,
   int _nIndex,
   out M_VID_PROPS _pVidProps,
   out string _pbsName
)
public procedure FormatVideoGetByIndex( 
    _eFormatType: eMFormatType;
    _nIndex: Integer;
   Out  _pVidProps: M_VID_PROPS;
   Out  _pbsName: String
); virtual; 
public: virtual void FormatVideoGetByIndex( 
   eMFormatType _eFormatType,
   int _nIndex,
   [PARAMFLAG::Out] M_VID_PROPS _pVidProps,
   [PARAMFLAG::Out] BSTR* _pbsName
) 

Parameters

_eFormatType
format type
_nIndex
index of a format
_pVidProps
video properties
_pbsName
name of the format
Example

Here is an example of how to fill a combobox with all available input video formats for a live source and select a current format:

M_VID_PROPS vidProps;
int fCount;
m_objLive.FormatVideoGetCount(eMFormatType.eMFT_Input, out fCount);
if (fCount > 0)
{
    for (int i = 0; i < fCount; i++)
    {
        string name;
        m_objLive.FormatVideoGetByIndex(eMFormatType.eMFT_Input, i, out vidProps, out name);
        comboBoxVF.Items.Add(name);
    }
    // Get current format
    int nCurrent = 0;
    try
    {
        string strName;
        M_VID_PROPS _vidProps;
        m_objLive.FormatVideoGet(eMFormatType.eMFT_Input, out _vidProps, out nCurrent, out strName);
    }
    catch (System.Exception) { }
    // Select a current format
    comboBoxVF.SelectedIndex = nCurrent;
}
See Also

Reference

MFWriterClass Class
MFWriterClass Members