Exemple #1
0
        private void GetSetting()
        {
            int retCode   = 0;
            int streamIdx = Int32.Parse((comboBox_videoDeviceList.SelectedItem as ComboBoxItem).Value.ToString());

            //streamIdx = streamIdx + 1;

            AnyChatCoreSDK.SelectVideoCapture((comboBox_videoDeviceList.SelectedItem as ComboBoxItem).Text);

            int videoBitrate = 0;

            if (streamIdx == 100)
            {
                retCode = AnyChatCoreSDK.QueryUserState(-1, AnyChatCoreSDK.BRAC_USERSTATE_VIDEOBITRATE, ref videoBitrate, sizeof(int));
            }
            else
            {
                retCode = AnyChatCoreSDK.GetUserStreamInfo(-1, streamIdx, AnyChatCoreSDK.BRAC_STREAMINFO_VIDEOBITRATE, ref videoBitrate, sizeof(int));
            }
            for (int idx = 0; idx < comboBox_VideoBitrate.Items.Count; idx++)
            {
                if ((videoBitrate >= Int32.Parse((comboBox_VideoBitrate.Items[idx] as ComboBoxItem).Value.ToString())) &&
                    (videoBitrate <= Int32.Parse((comboBox_VideoBitrate.Items[idx + 1] as ComboBoxItem).Value.ToString())))
                {
                    comboBox_VideoBitrate.SelectedIndex = idx;
                    break;
                }
            }

            //分辨率
            int videoWidth  = 0;
            int videoHeigth = 0;

            retCode = AnyChatCoreSDK.GetUserStreamInfo(-1, streamIdx, AnyChatCoreSDK.BRAC_STREAMINFO_VIDEOWIDTH, ref videoWidth, sizeof(int));
            retCode = AnyChatCoreSDK.GetUserStreamInfo(-1, streamIdx, AnyChatCoreSDK.BRAC_STREAMINFO_VIDEOHEIGHT, ref videoHeigth, sizeof(int));
            string resolution = videoWidth.ToString() + "x" + videoHeigth;

            lblVideoResolution.Text = "(当前分辨率:	"+ resolution + ")";
            for (int idx = 0; idx < comboBox_VideoResolution.Items.Count; idx++)
            {
                if (resolution == (comboBox_VideoResolution.Items[idx] as ComboBoxItem).Text.ToString())
                {
                    comboBox_VideoResolution.SelectedIndex = idx;
                    break;
                }
            }


            //帧率
            int videoFPS = 0;

            //videoFPS = Int32.Parse((comboBox_VideoFPS.SelectedItem as ComboBoxItem).Value.ToString());
            retCode = AnyChatCoreSDK.GetUserStreamInfo(-1, streamIdx, AnyChatCoreSDK.BRAC_STREAMINFO_VIDEOFPS, ref videoFPS, sizeof(int));
            for (int idx = 0; idx < comboBox_VideoFPS.Items.Count; idx++)
            {
                if (videoFPS.ToString() == (comboBox_VideoFPS.Items[idx] as ComboBoxItem).Value.ToString())
                {
                    comboBox_VideoFPS.SelectedIndex = idx;
                    break;
                }
            }
        }