Exemple #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;
 }
Exemple #2
0
 private void OnDisposed(object sender, EventArgs e)
 {
     //清理资源
     mScreenList.release();
     mScreenList = null;
     mTRTCCloud  = null;
     mMainForm   = null;
 }
Exemple #3
0
        public TRTCDeviceForm(TRTCMainForm mainform)
        {
            InitializeComponent();

            this.Disposed += new EventHandler(OnDisposed);

            mTRTCCloud = DataManager.GetInstance().trtcCloud;
            mMainForm  = mainform;
        }
Exemple #4
0
        public TRTCScreenForm(ITRTCCloud cloud, TRTCMainForm form)
        {
            InitializeComponent();

            this.Disposed += new EventHandler(OnDisposed);

            mTRTCCloud = cloud;
            mMainForm  = form;
        }
Exemple #5
0
        public TRTCScreenForm(TRTCMainForm form)
        {
            InitializeComponent();

            this.Disposed += new EventHandler(OnDisposed);

            mTRTCCloud = DataManager.GetInstance().trtcCloud;
            mMainForm  = form;

            mImageList           = new ImageList();
            mImageList.ImageSize = new Size(120, 70);
        }
 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;
 }
        public TRTCCustomCaptureForm(TRTCMainForm mainForm)
        {
            InitializeComponent();

            this.Disposed += new EventHandler(OnDisposed);

            mTRTCCloud = DataManager.GetInstance().trtcCloud;
            mMainForm  = mainForm;

            this.customAudioComboBox.Items.Add("48_1_audio.pcm");
            this.customAudioComboBox.Items.Add("16_1_audio.pcm");
            this.customVideoComboBox.Items.Add("320x240_video.yuv");
        }
        public AudioSettingForm(TRTCMainForm mainform)
        {
            InitializeComponent();
            this.Disposed += new EventHandler(OnDisposed);

            mTRTCCloud = DataManager.GetInstance().trtcCloud;

            if (Util.IsSys64bit())
            {
                this.systemAudioCheckBox.Visible = false;
            }

            mMainForm = mainform;
        }
Exemple #9
0
        private void OnJoinRoomBtnClick(object sender, EventArgs e)
        {
            if (GenerateTestUserSig.SDKAPPID == 0)
            {
                ShowMessage("Error: 请先在 GenerateTestUserSig 填写 sdkappid 信息");
                return;
            }

            SetTestEnv();
            SetPureAudioStyle();

            string userId = this.userTextBox.Text;
            string roomId = this.roomTextBox.Text;

            if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(roomId))
            {
                ShowMessage("房间号或用户号不能为空!");
                return;
            }

            uint room = 0;

            if (!uint.TryParse(roomId, out room))
            {
                ShowMessage(String.Format("目前支持的最大房间号为{0}", uint.MaxValue));
                return;
            }

            DataManager.GetInstance().userId = userId;
            DataManager.GetInstance().roomId = room;

            // 从本地计算获取 userId 对应的 userSig
            // 注意!本地计算是适合在本地环境下调试使用,正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,
            // 然后由 App 按需向您的服务器获取实时算出的 UserSig。
            // 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。
            string userSig = GenerateTestUserSig.GetInstance().GenTestUserSig(userId);

            if (string.IsNullOrEmpty(userSig))
            {
                ShowMessage("userSig 获取失败,请检查是否填写账号信息!");
                return;
            }

            this.Hide();
            TRTCMainForm mainForm = new TRTCMainForm(this);

            mainForm.Show();
            mainForm.EnterRoom();
        }
        public OtherSettingForm(TRTCMainForm mainform)
        {
            InitializeComponent();

            this.Disposed += new EventHandler(OnDisposed);

            mTRTCCloud = DataManager.GetInstance().trtcCloud;
            mMainForm  = mainform;
            this.voiceCheckBox.Checked = DataManager.GetInstance().isShowVolume;

            this.mirrorCheckBox.Checked = DataManager.GetInstance().isLocalVideoMirror&& DataManager.GetInstance().isRemoteVideoMirror;

            this.customAudioComboBox.Items.Add("48_1_audio.pcm");
            this.customAudioComboBox.Items.Add("16_1_audio.pcm");
            this.customVideoComboBox.Items.Add("320x240_video.yuv");
        }
Exemple #11
0
        private void OnJoinRoomBtnClick(object sender, EventArgs e)
        {
            SetTestEnv();

            string userId = this.userTextBox.Text;
            string roomId = this.roomTextBox.Text;

            if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(roomId))
            {
                ShowMessage("房间号或用户号不能为空!");
                return;
            }
            int room = int.Parse(roomId);
            // 从本地计算获取 userId 对应的 userSig
            string userSig = GenerateTestUserSig.GetInstance().GenTestUserSig(userId);

            if (string.IsNullOrEmpty(userSig))
            {
                ShowMessage("userSig 获取失败,请检查是否填写账号信息!");
                return;
            }

            TRTCParams trtcParams = new TRTCParams();

            trtcParams.sdkAppId      = GenerateTestUserSig.SDKAPPID;
            trtcParams.roomId        = (uint)room;
            trtcParams.userId        = userId;
            trtcParams.userSig       = userSig;
            trtcParams.privateMapKey = "";
            trtcParams.businessInfo  = "";
            trtcParams.role          = TRTCRoleType.TRTCRoleAnchor;

            this.Hide();
            TRTCMainForm mainForm = new TRTCMainForm(this);

            mainForm.Show();
            SaveUserInfo();
            mainForm.SetTestEnv(mTestEnv);
            mainForm.EnterRoom(trtcParams);
        }
Exemple #12
0
        public VedioSettingForm(TRTCMainForm mainform)
        {
            InitializeComponent();
            this.Disposed += new EventHandler(OnDisposed);

            this.mTRTCCloud     = DataManager.GetInstance().trtcCloud;
            this.mDeviceManager = mTRTCCloud.getDeviceManager();

            this.resolutionComboBox.Items.Add("120 x 120");
            this.resolutionComboBox.Items.Add("160 x 160");
            this.resolutionComboBox.Items.Add("270 x 270");
            this.resolutionComboBox.Items.Add("480 x 480");
            this.resolutionComboBox.Items.Add("160 x 120");
            this.resolutionComboBox.Items.Add("240 x 180");
            this.resolutionComboBox.Items.Add("280 x 210");
            this.resolutionComboBox.Items.Add("320 x 240");
            this.resolutionComboBox.Items.Add("400 x 300");
            this.resolutionComboBox.Items.Add("480 x 360");
            this.resolutionComboBox.Items.Add("640 x 480");
            this.resolutionComboBox.Items.Add("960 x 720");
            this.resolutionComboBox.Items.Add("160 x 90");
            this.resolutionComboBox.Items.Add("256 x 144");
            this.resolutionComboBox.Items.Add("320 x 180");
            this.resolutionComboBox.Items.Add("480 x 270");
            this.resolutionComboBox.Items.Add("640 x 360");
            this.resolutionComboBox.Items.Add("960 x 540");
            this.resolutionComboBox.Items.Add("1280 x 720");

            this.fpsComboBox.Items.Add("15 fps");
            this.fpsComboBox.Items.Add("20 fps");
            this.fpsComboBox.Items.Add("24 fps");

            this.resolutionModeComboBox.Items.Add("横屏模式");
            this.resolutionModeComboBox.Items.Add("竖屏模式");

            mMainForm = mainform;
        }