Esempio n. 1
0
 private void OnDisposed(object sender, EventArgs e)
 {
     //清理资源
     if (mTRTCCloud != null && mMainForm != null)
     {
         mTRTCCloud.enableCustomAudioCapture(false);
         mTRTCCloud.enableCustomVideoCapture(false);
         mMainForm.OnCustomCaptureAudioCallback(true);
         mMainForm.OnCustomCaptureVideoCallback(true);
         mStartCustomCaptureAudio = false;
         mStartCustomCaptureVideo = false;
         if (mAudioCustomThread != null)
         {
             mAudioCustomThread.Join();
             mAudioCustomThread.DisableComObjectEagerCleanup();
             mAudioCustomThread = null;
         }
         if (mVideoCustomThread != null)
         {
             mVideoCustomThread.Join();
             mVideoCustomThread.DisableComObjectEagerCleanup();
             mVideoCustomThread = null;
         }
     }
     mMainForm  = null;
     mTRTCCloud = null;
 }
Esempio n. 2
0
 private void OnDisposed(object sender, EventArgs e)
 {
     //清理资源
     if (mTRTCCloud != null && mMainForm != null)
     {
         mTRTCCloud.enableCustomAudioCapture(false);
         mTRTCCloud.enableCustomVideoCapture(false);
         mMainForm.OnCustomCaptureAudioCallback(true);
         mMainForm.OnCustomCaptureVideoCallback(true);
     }
     mMainForm  = null;
     mTRTCCloud = null;
 }
        private void OnDisposed(object sender, EventArgs e)
        {
            //清理资源
            if (mTRTCCloud != null && mMainForm != null)
            {
                mTRTCCloud.enableCustomAudioCapture(false);
                mTRTCCloud.enableCustomVideoCapture(false);
                mMainForm.OnCustomCaptureAudioCallback(true);
                mMainForm.OnCustomCaptureVideoCallback(true);
                mStartCustomCaptureAudio = false;
                mStartCustomCaptureVideo = false;
                if (mAudioCustomThread != null)
                {
                    mAudioCustomThread.Join();
                    mAudioCustomThread.DisableComObjectEagerCleanup();
                    mAudioCustomThread = null;
                }
                if (mVideoCustomThread != null)
                {
                    mVideoCustomThread.Join();
                    mVideoCustomThread.DisableComObjectEagerCleanup();
                    mVideoCustomThread = null;
                }
            }
            if (this.audioRecordBtn.Text.Equals("停止录音"))
            {
                mTRTCCloud.stopAudioRecording();
            }

            //清理资源
            if (mTRTCCloud == null)
            {
                return;
            }
            mTRTCCloud = null;
        }