Beispiel #1
0
        /// <summary>
        /// 码流选择处理
        /// </summary>
        /// <param name="videoOpt"></param>
        private void VideoEncOptSelectChange(DH_VIDEOENC_OPT videoOpt)
        {
            try
            {
                chkVideoEnable.Checked = (videoOpt.byVideoEnable == 1 ? true : false);//视频使能
                chkAudioEnable.Checked = (videoOpt.byAudioEnable == 1 ? true : false);//音频使能
                cmbBitRateControl.SelectedIndex = videoOpt.byBitRateControl;//码流控制
                cmbFramesPerSec.SelectedIndex = videoOpt.byFramesPerSec;//帧率
                cmbEncodeMode.SelectedIndex = videoOpt.byEncodeMode;//解码模式
                cmbImageSize.SelectedIndex = videoOpt.byImageSize;//分辨率
                cmbImageQlty.SelectedIndex = videoOpt.byImageQlty - 1;//画质[1-6转成SelectIndex时要减1]
                cmbFormatTag.SelectedIndex = videoOpt.wFormatTag;//音频编码
                txtChannels.Text = videoOpt.nChannels.ToString("D");//声道数
                txtSamplesPerSec.Text = videoOpt.nSamplesPerSec.ToString("D");//采样率
                txtBitsPerSampl.Text = videoOpt.wBitsPerSample.ToString("D");//采样深度
            }
            catch
            {
                MessageBox.Show("赋值错误!", pMsgTitle);
            }

        }
Beispiel #2
0
 /// <summary>
 /// 码流选择前的数据保存处理
 /// </summary>
 private void VideEncOptSaveData(ref DH_VIDEOENC_OPT videoOpt)
 {
     try
     {
         videoOpt.byVideoEnable=(byte)(chkVideoEnable.Checked ==true? 1 : 0);//视频使能
         videoOpt.byAudioEnable = (byte)(chkAudioEnable.Checked == true ? 1 : 0);//音频使能
         videoOpt.byBitRateControl=(byte)cmbBitRateControl.SelectedIndex ;//码流控制
         videoOpt.byFramesPerSec=(byte)cmbFramesPerSec.SelectedIndex ;//帧率
         videoOpt.byEncodeMode = (byte)cmbEncodeMode.SelectedIndex;//解码模式
         videoOpt.byImageSize=(byte)cmbImageSize.SelectedIndex;//分辨率
         videoOpt.byImageQlty=(byte)(cmbImageQlty.SelectedIndex +1);//画质[1-6转成SelectIndex时要减1]
         videoOpt.wFormatTag=(byte)cmbFormatTag.SelectedIndex;//音频编码
         videoOpt.nChannels=ushort.Parse(txtChannels.Text);//声道数
         videoOpt.nSamplesPerSec=ushort.Parse(txtSamplesPerSec.Text);//采样率
         videoOpt.wBitsPerSample=ushort.Parse(txtBitsPerSampl.Text);//采样深度
     }
     catch
     {
         MessageBox.Show("保存错误!", pMsgTitle);
     }
 }