public static Task ApplyChangesAsync(this AudioVideoFlow flow, AudioVideoFlowTemplate template) { return Task.Factory.FromAsync( flow.BeginApplyChanges, flow.EndApplyChanges, template, null); }
public static Task ApplyChangesAsync(this AudioVideoFlow flow, AudioVideoFlowTemplate template) { return(Task.Factory.FromAsync( flow.BeginApplyChanges, flow.EndApplyChanges, template, null)); }
public static Task ApplyChangesAsync(this AudioVideoFlow flow, AudioVideoFlowTemplate template, IEnumerable<SignalingHeader> headers) { return Task.Factory.FromAsync( flow.BeginApplyChanges, flow.EndApplyChanges, template, headers, null); }
public static Task ApplyChangesAsync(this AudioVideoFlow flow, AudioVideoFlowTemplate template, IEnumerable <SignalingHeader> headers) { return(Task.Factory.FromAsync( flow.BeginApplyChanges, flow.EndApplyChanges, template, headers, null)); }
private void OnAudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { this.LockAndExecuteOotyCallback(delegate { this.DebugTrace("Inside BaseUMconnectivityTester OnAudioVideoFlowConfigurationRequested", new object[0]); AudioVideoFlowTemplate audioVideoFlowTemplate = new AudioVideoFlowTemplate(e.Flow); audioVideoFlowTemplate.EncryptionPolicy = (this.mediaSecured ? 3 : 1); e.Flow.Initialize(audioVideoFlowTemplate); e.Flow.StateChanged += this.OnMediaStateChanged; }); }
//Flow configuration requested indicates that there is a flow present to begin media operations with that it is no longer null, and is ready to be configured. public void audioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { // Change the default behavior before the negotiation is completed // Create a template based on the current AudioVideoFlow AudioVideoFlowTemplate template = new AudioVideoFlowTemplate(e.Flow); // Accept only 8Khz audio sampling rate codecs template.Audio.GetChannels()[ChannelLabel.AudioMono].AllowedDirection = MediaChannelDirection.Inactive; Console.WriteLine("AudioVideoFlow initialized as Inactive."); // Change _audioVideoFlow settings according to the template e.Flow.Initialize(template); }
public void Run() { // Create AudioVideoFlow AudioVideoFlowHelper audioVideoFlowHelper = new AudioVideoFlowHelper(); _audioVideoFlow = audioVideoFlowHelper.CreateAudioVideoFlow( null, audioVideoFlow_StateChanged); // When something happens involving negotiation this event will be triggered. _audioVideoFlow.ConfigurationChanged += new EventHandler <AudioVideoFlowConfigurationChangedEventArgs>(audioVideoFlow_ConfigurationChanged); // Attaches a player with a source and starts it in constant loop. audioVideoFlowHelper.AttachAndStartPlayer(_audioVideoFlow, true); // Check allowed direction. Console.WriteLine("AudioVideoFlow using sampling rate: " + _audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono].SamplingRate); Thread.Sleep(10000); Console.WriteLine("Call ApplyChanges changing sampling rate from 8Khz or 16Khz to only 8Khz."); AudioVideoFlowTemplate template = new AudioVideoFlowTemplate(_audioVideoFlow); AudioChannelTemplate audioChannelTemplate = template.Audio.GetChannels()[ChannelLabel.AudioMono]; audioChannelTemplate.SamplingRate = AudioSamplingRate.EightKhz; // Change allowed direction to SendOnly. _audioVideoFlow.BeginApplyChanges(template, audioVideoFlow_ApplyChangesCompleted, _audioVideoFlow); _waitForApplyChangesCompleted.WaitOne(); Console.WriteLine("AudioVideoFlow using sampling rate: " + _audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono].SamplingRate); Thread.Sleep(10000); // Shutdown the platform ShutdownPlatform(); //Wait for shutdown to occur. _waitForShutdownEventCompleted.WaitOne(); }
public void Run() { // Create AudioVideoFlow AudioVideoFlowHelper audioVideoFlowHelper = new AudioVideoFlowHelper(); _audioVideoFlow = audioVideoFlowHelper.CreateAudioVideoFlow( audioVideoCall_FlowConfigurationRequested, audioVideoFlow_StateChanged); // When something happens involving negotiation this event will be triggered. _audioVideoFlow.ConfigurationChanged += new EventHandler <AudioVideoFlowConfigurationChangedEventArgs>(audioVideoFlow_ConfigurationChanged); // Attaches a player with a source and starts it in constant loop. audioVideoFlowHelper.AttachAndStartPlayer(_audioVideoFlow, true); // Check allowed direction. Console.WriteLine("AudioVideoFlow audio channel direction: " + _audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono].Direction); Thread.Sleep(10000); Console.WriteLine("Call ApplyChanges changing audio direcion to send and receive."); AudioVideoFlowTemplate template = new AudioVideoFlowTemplate(_audioVideoFlow); AudioChannelTemplate audioChannelTemplate = template.Audio.GetChannels()[ChannelLabel.AudioMono]; audioChannelTemplate.AllowedDirection = MediaChannelDirection.SendReceive; // Change allowed direction to SendOnly. _audioVideoFlow.BeginApplyChanges(template, audioVideoFlow_ApplyChangesCompleted, _audioVideoFlow); _waitForApplyChangesCompleted.WaitOne(); Console.WriteLine("AudioVideoFlow audio channel direction: " + _audioVideoFlow.Audio.GetChannels()[ChannelLabel.AudioMono].Direction); Thread.Sleep(5000); // Shutdown the platform ShutdownPlatform(); //Wait for shutdown to occur. _waitForShutdownEventCompleted.WaitOne(); }