AudioVideoFlow.BeginApplyChanges Method

Definition

Overloads

BeginApplyChanges(AudioVideoFlowTemplate, AsyncCallback, Object)

Applies changes from the specified template.

BeginApplyChanges(AudioVideoFlowTemplate, IEnumerable<SignalingHeader>, AsyncCallback, Object)

Applies changes from the specified template.

BeginApplyChanges(AudioVideoFlowTemplate, AsyncCallback, Object)

Applies changes from the specified template.

public:
 IAsyncResult ^ BeginApplyChanges(Microsoft::Rtc::Collaboration::AudioVideo::AudioVideoFlowTemplate ^ template, AsyncCallback ^ userCallback, System::Object ^ state);
public IAsyncResult BeginApplyChanges (Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoFlowTemplate template, AsyncCallback userCallback, object state);
member this.BeginApplyChanges : Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoFlowTemplate * AsyncCallback * obj -> IAsyncResult
Public Function BeginApplyChanges (template As AudioVideoFlowTemplate, userCallback As AsyncCallback, state As Object) As IAsyncResult

Parameters

template
AudioVideoFlowTemplate

The template to be used as a reference.

userCallback
AsyncCallback

The method to be called when the asynchronous operation is completed.

state
Object

A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Returns

An IAsyncResult that references the asynchronous operation.

Exceptions

Thrown when the AudioVideoFlow is not in the Active state, or when the template has no channels, or when the template's HoldType property is not equal to either None or the AudioVideoFlow's current HoldStatus, or when there is already an asynchronous operation in progress.

Thrown when the template argument is null.

Examples

The following example applies changes to an AudioVideoFlow.

C# Modifying AudioChannelTemplate properties.


AudioVideoFlowTemplate templateToApply = new AudioVideoFlowTemplate(audioVideoFlow);
AudioChannelTemplate audioChannelTemplate = (AudioChannelTemplate)templateToApply.Audio.GetChannels()[ChannelLabel.AudioMono];
audioChannelTemplate.AllowedDirection = MediaChannelDirection.SendOnly;
audioChannelTemplate.SendDirectionSamplingRate = AudioSamplingRate.EightKhz;

// ApplyChanges
audioVideoFlow.BeginApplyChanges(
    templateToApply,
    new AsyncCallback(delegate(IAsyncResult result)
    {
        try
        {
            audioVideoFlow.EndApplyChanges(result);
        }
        catch (RealTimeException e)
        {
            // handle exception
            throw e;
        }

        // ApplyChanges is done, verify changes result..
        AudioChannel audioChannel = audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono];
        if (audioChannel.Direction == MediaChannelDirection.SendOnly &amp;&amp;
            audioChannel.SendDirectionSamplingRate == AudioSamplingRate.EightKhz)
        {
            // remote side accepted changes as they were
        }
        else
        {
            // remote side accepted changes but filtered them more.
        }
    }),
    this);



Remarks

This method cannot be used to change the AudioVideoFlow's hold status. Call BeginHold to put the AudioVideoFlow on hold, and BeginRetrieve to unhold. The value of the template's HoldType property must be equal to either None or the current value of the AudioVideoFlow HoldStatus property. A value of None will not change the AudioVideoFlow's hold status.

Applies to

BeginApplyChanges(AudioVideoFlowTemplate, IEnumerable<SignalingHeader>, AsyncCallback, Object)

Applies changes from the specified template.

public:
 IAsyncResult ^ BeginApplyChanges(Microsoft::Rtc::Collaboration::AudioVideo::AudioVideoFlowTemplate ^ template, System::Collections::Generic::IEnumerable<Microsoft::Rtc::Signaling::SignalingHeader ^> ^ headers, AsyncCallback ^ userCallback, System::Object ^ state);
public IAsyncResult BeginApplyChanges (Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoFlowTemplate template, System.Collections.Generic.IEnumerable<Microsoft.Rtc.Signaling.SignalingHeader> headers, AsyncCallback userCallback, object state);
member this.BeginApplyChanges : Microsoft.Rtc.Collaboration.AudioVideo.AudioVideoFlowTemplate * seq<Microsoft.Rtc.Signaling.SignalingHeader> * AsyncCallback * obj -> IAsyncResult
Public Function BeginApplyChanges (template As AudioVideoFlowTemplate, headers As IEnumerable(Of SignalingHeader), userCallback As AsyncCallback, state As Object) As IAsyncResult

Parameters

template
AudioVideoFlowTemplate

The template to be used as a reference.

headers
IEnumerable<SignalingHeader>

The signaling headers.

userCallback
AsyncCallback

The method to be called when the asynchronous operation is completed.

state
Object

A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Returns

An IAsyncResult that references the asynchronous operation.

Exceptions

Thrown when the AudioVideoFlow is not in the Active state, or when the template has no channels, or when the template's HoldType property is not equal to either None or the AudioVideoFlow's current HoldStatus, or when there is already an asynchronous operation in progress.

Thrown when the template argument is null.

Remarks

This method cannot be used to change the AudioVideoFlow's hold status. Call BeginHold to put the AudioVideoFlow on hold, and BeginRetrieve to unhold. The value of the template's HoldType property must be equal to either None or the current value of the AudioVideoFlow HoldStatus property. A value of None will not change the AudioVideoFlow's hold status.

Applies to