RunLoopbackTest() public method

This method gets the media manager to pass local media samples to the RTP channel and then receive them back as the remote video stream. This tests that the codec and RTP packetisation are working.
public RunLoopbackTest ( ) : void
return void
Beispiel #1
0
        /// <summary>
        /// The button to place an outgoing call.
        /// </summary>
        private void CallButton_Click(object sender, RoutedEventArgs e)
        {
            if (m_uriEntryTextBox.Text.IsNullOrBlank())
            {
                SetStatusText(m_signallingStatus, "No call destination was specified.");
            }
            else if (m_uriEntryTextBox.Text == VIDEO_LOOPBACK_CALL_DESTINATION)
            {
                if (_localVideoMode == null)
                {
                    LocalVideoError("Please start the local video and try again.");
                }
                else
                {
                    SetStatusText(m_signallingStatus, "Running video loopback test...");

                    m_callButton.Visibility   = Visibility.Collapsed;
                    m_cancelButton.Visibility = Visibility.Collapsed;
                    m_byeButton.Visibility    = Visibility.Visible;

                    _mediaManager.RunLoopbackTest();
                }
            }
            else
            {
                SetStatusText(m_signallingStatus, "calling " + m_uriEntryTextBox.Text + ".");

                m_callButton.Visibility   = Visibility.Collapsed;
                m_cancelButton.Visibility = Visibility.Visible;
                m_byeButton.Visibility    = Visibility.Collapsed;

                string destination = m_uriEntryTextBox.Text;

                // SIP call.
                _activeClient = _sipClient;
                Task.Run(() => { _sipClient.Call(_mediaManager, destination); });
            }
        }
        /// <summary>
        /// The button to place an outgoing call.
        /// </summary>
        private void CallButton_Click(object sender, RoutedEventArgs e)
        {
            SIPClient client = (sender == m_callButton) ? _sipClients[0] : _sipClients[1];

            if (client == _sipClients[0] && m_uriEntryTextBox.Text.IsNullOrBlank())
            {
                SetStatusText(m_signallingStatus, "No call destination was specified.");
            }
            else if (client == _sipClients[1] && m_uriEntry2TextBox.Text.IsNullOrBlank())
            {
                SetStatusText(m_signallingStatus, "No call destination was specified.");
            }
            else if (m_uriEntryTextBox.Text == VIDEO_LOOPBACK_CALL_DESTINATION)
            {
                if (_localVideoMode == null)
                {
                    LocalVideoError("Please start the local video and try again.");
                }
                else
                {
                    SetStatusText(m_signallingStatus, "Running video loopback test...");

                    m_callButton.Visibility   = Visibility.Collapsed;
                    m_cancelButton.Visibility = Visibility.Collapsed;
                    m_byeButton.Visibility    = Visibility.Visible;

                    _mediaManager.RunLoopbackTest();
                }
            }
            else
            {
                string callDestination = null;

                if (client == _sipClients[0])
                {
                    callDestination = m_uriEntryTextBox.Text;

                    SetStatusText(m_signallingStatus, $"calling {callDestination}.");

                    m_callButton.Visibility   = Visibility.Collapsed;
                    m_cancelButton.Visibility = Visibility.Visible;
                    m_byeButton.Visibility    = Visibility.Collapsed;
                }
                else if (client == _sipClients[1])
                {
                    // Put the first call on hold.
                    if (_sipClients[0].IsCallActive)
                    {
                        _sipClients[0].PutOnHold();
                        m_holdButton.Visibility    = Visibility.Collapsed;
                        m_offHoldButton.Visibility = Visibility.Visible;
                    }

                    callDestination = m_uriEntry2TextBox.Text;

                    SetStatusText(m_signallingStatus, $"calling {callDestination}.");

                    m_call2Button.Visibility   = Visibility.Collapsed;
                    m_cancel2Button.Visibility = Visibility.Visible;
                    m_bye2Button.Visibility    = Visibility.Collapsed;
                }

                // Start SIP call.
                Task.Run(() => client.Call(callDestination));
            }
        }