WMEncoder.OnSourceStateChange

Windows Media Encoder SDK banner art

The OnSourceStateChange event receives an event notice indicating whether the encoding of a specific source stream has started or stopped.

Syntax

WMEncoder.OnSourceStateChange(enumState, enumType, iIndex, strSourceGroup)

Parameters

enumState

[in]  Member of a WMENC_SOURCE_STATE enumeration type indicating whether the encoding of the input stream has been started or stopped.

enumType

[in]  Member of a WMENC_SOURCE_TYPE enumeration type indicating the media type of the input stream.

iIndex

[in]  Integer identifying which audio, video or text stream is being captured. Because there can only be one stream of each type, iIndex must be 0.

strSourceGroup

[in]  String specifying the name of the source group to which the source stream belongs.

Return Values

This event does not return a value.

Remarks

Use OnSourceStateChange to determine when a source stream has finished transmitting data during the encoding process. When all streams are finished being encoded, you can begin encoding another source group. This functionality enables you to broadcast playlists from an encoding application.

Example Code

Private Sub Encoder_OnSourceStateChange( _
ByVal enumState As WMEncoderLib.WMENC_SOURCE_STATE, _
ByVal enumType As WMEncoderLib.WMENC_SOURCE_TYPE, _
ByVal iIndex As Integer, _
ByVal sSourceGroup As String)

    Select Case enumState
        Case WMENC_SOURCE_START
            Select Case enumType
                Case WMENC_AUDIO
                    ' Process the case.
                Case WMENC_VIDEO
                    ' Process the case.
                Case WMENC_SCRIPT
                    ' Process the case.
            End Select
        Case WMENC_SOURCE_STOP
            Select Case enumType
                Case WMENC_AUDIO
                    ' Process the case.
                Case WMENC_VIDEO
                    ' Process the case.
                Case WMENC_SCRIPT
                    ' Process the case.
            End Select
        Case WMENC_SOURCE_PREPARE
            ' Process the case.
        Case WMENC_SOURCE_UNPREPARE
            ' Process the case.
    End Select

End Sub

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also