private void RefreshCameraDeviceList() { if (mTRTCCloud == null) { return; } this.cameraDeviceComboBox.Items.Clear(); mCameraDeviceList = mTRTCCloud.getCameraDevicesList(); if (mCameraDeviceList.getCount() <= 0) { return; } mCameraDevice = mTRTCCloud.getCurrentCameraDevice(); for (uint i = 0; i < mCameraDeviceList.getCount(); i++) { this.cameraDeviceComboBox.Items.Add(mCameraDeviceList.getDeviceName(i)); if (mCameraDevice.getDeviceName().Equals(mCameraDeviceList.getDeviceName(i))) { this.cameraDeviceComboBox.SelectedIndex = (int)i; } } if (string.IsNullOrEmpty(mCameraDevice.getDeviceName()) && mCameraDeviceList.getCount() > 0) { this.cameraDeviceComboBox.SelectedIndex = 0; } }
private void OnDisposed(object sender, EventArgs e) { //清理资源 if (mCameraDevice != null) { mCameraDevice.release(); } if (mCameraDevice != null) { mMicDevice.release(); } if (mSpeakerDevice != null) { mSpeakerDevice.release(); } if (mCameraDeviceList != null) { mCameraDeviceList.release(); } if (mMicDeviceList != null) { mMicDeviceList.release(); } if (mSpeakerDevice != null) { mSpeakerDeviceList.release(); } mCameraDevice = null; mMicDevice = null; mSpeakerDevice = null; mCameraDeviceList = null; mMicDeviceList = null; mSpeakerDeviceList = null; mTRTCCloud = null; }
private void RefreshCameraDeviceList() { if (mDeviceManager == null) { return; } this.cameraDeviceComboBox.Items.Clear(); mCameraDeviceList = mDeviceManager.getDevicesList(TRTCDeviceType.TXMediaDeviceTypeCamera); if (mCameraDeviceList.getCount() <= 0) { this.cameraDeviceComboBox.Items.Add(""); this.cameraDeviceComboBox.SelectionStart = this.cameraDeviceComboBox.Text.Length; return; } mCameraDevice = mDeviceManager.getCurrentDevice(TRTCDeviceType.TXMediaDeviceTypeCamera); for (uint i = 0; i < mCameraDeviceList.getCount(); i++) { this.cameraDeviceComboBox.Items.Add(mCameraDeviceList.getDeviceName(i)); if (mCameraDevice.getDeviceName().Equals(mCameraDeviceList.getDeviceName(i))) { this.cameraDeviceComboBox.SelectedIndex = (int)i; } } if (string.IsNullOrEmpty(mCameraDevice.getDeviceName()) && mCameraDeviceList.getCount() > 0) { this.cameraDeviceComboBox.SelectedIndex = 0; } }
private void OnDisposed(object sender, EventArgs e) { //清理资源 if (mTRTCCloud == null) { return; } if (this.micTestBtn.Text.Equals("停止")) { mTRTCCloud.stopMicDeviceTest(); } if (this.speakerTestBtn.Text.Equals("停止")) { mTRTCCloud.stopSpeakerDeviceTest(); } // 注意:系统混音功能暂时不支持64位系统 if (!Util.IsSys64bit()) { if (this.systemAudioCheckBox.Checked) { mTRTCCloud.stopSystemAudioLoopback(); } } if (mMicDevice != null) { mMicDevice.release(); } if (mSpeakerDevice != null) { mSpeakerDevice.release(); } if (mMicDeviceList != null) { mMicDeviceList.release(); } if (mSpeakerDeviceList != null) { mSpeakerDeviceList.release(); } mMicDevice = null; mSpeakerDevice = null; mMicDeviceList = null; mSpeakerDeviceList = null; mTRTCCloud = null; }
private void OnDisposed(object sender, EventArgs e) { //清理资源 if (mTRTCCloud == null || mDeviceManager == null) { return; } if (this.micTestBtn.Text.Equals("停止")) { mDeviceManager.stopMicDeviceTest(); } if (this.speakerTestBtn.Text.Equals("停止")) { mDeviceManager.stopSpeakerDeviceTest(); } if (this.systemAudioCheckBox.Checked) { mTRTCCloud.stopSystemAudioLoopback(); } if (mMicDevice != null) { mMicDevice.release(); } if (mSpeakerDevice != null) { mSpeakerDevice.release(); } if (mMicDeviceList != null) { mMicDeviceList.release(); } if (mSpeakerDeviceList != null) { mSpeakerDeviceList.release(); } mMicDevice = null; mSpeakerDevice = null; mMicDeviceList = null; mSpeakerDeviceList = null; mTRTCCloud = null; mDeviceManager = null; }
private void RefreshMicDeviceList() { if (mTRTCCloud == null) { return; } this.micDeviceComboBox.Items.Clear(); mMicDevice = mTRTCCloud.getCurrentMicDevice(); Log.I(String.Format("CurrentMicDevice: pid = {0}, name = {1}", mMicDevice.getDevicePID(), mMicDevice.getDeviceName())); mMicDeviceList = mTRTCCloud.getMicDevicesList(); for (uint i = 0; i < mMicDeviceList.getCount(); i++) { this.micDeviceComboBox.Items.Add(mMicDeviceList.getDeviceName(i)); if (mMicDevice.getDeviceName().Equals(mMicDeviceList.getDeviceName(i))) { this.micDeviceComboBox.SelectedIndex = (int)i; } Log.I(String.Format("MicDevice{0} : name = {1}, pid = {2}", i + 1, mMicDeviceList.getDeviceName(i), mMicDeviceList.getDevicePID(i))); } }
private void RefreshSpeakerList() { if (mTRTCCloud == null) { return; } this.speakerDeviceComboBox.Items.Clear(); mSpeakerDeviceList = mTRTCCloud.getSpeakerDevicesList(); if (mSpeakerDeviceList.getCount() <= 0) { return; } mSpeakerDevice = mTRTCCloud.getCurrentSpeakerDevice(); for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++) { this.speakerDeviceComboBox.Items.Add(mSpeakerDeviceList.getDeviceName(i)); if (mSpeakerDevice.getDeviceName().Equals(mSpeakerDeviceList.getDeviceName(i))) { this.speakerDeviceComboBox.SelectedIndex = (int)i; } } }
private void RefreshSpeakerList() { if (mDeviceManager == null) { return; } this.speakerDeviceComboBox.Items.Clear(); mSpeakerDeviceList = mDeviceManager.getDevicesList(TRTCDeviceType.TXMediaDeviceTypeSpeaker); if (mSpeakerDeviceList.getCount() <= 0) { this.speakerDeviceComboBox.Items.Add(""); this.speakerDeviceComboBox.SelectionStart = this.speakerDeviceComboBox.Text.Length; return; } mSpeakerDevice = mDeviceManager.getCurrentDevice(TRTCDeviceType.TXMediaDeviceTypeSpeaker); for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++) { this.speakerDeviceComboBox.Items.Add(mSpeakerDeviceList.getDeviceName(i)); if (mSpeakerDevice.getDeviceName().Equals(mSpeakerDeviceList.getDeviceName(i))) { this.speakerDeviceComboBox.SelectedIndex = (int)i; } } }
private void RefreshMicDeviceList() { if (mTRTCCloud == null) { return; } this.micDeviceComboBox.Items.Clear(); mMicDeviceList = mTRTCCloud.getMicDevicesList(); if (mMicDeviceList.getCount() <= 0) { this.micDeviceComboBox.Items.Add(""); this.micDeviceComboBox.SelectionStart = this.micDeviceComboBox.Text.Length; return; } mMicDevice = mTRTCCloud.getCurrentMicDevice(); for (uint i = 0; i < mMicDeviceList.getCount(); i++) { this.micDeviceComboBox.Items.Add(mMicDeviceList.getDeviceName(i)); if (mMicDevice.getDeviceName().Equals(mMicDeviceList.getDeviceName(i))) { this.micDeviceComboBox.SelectedIndex = (int)i; } } }