Beispiel #1
0
 private void cbb_fbl_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbb_fbl.SelectedIndex == 0)
     {
         int bUseAppParam = 0;
         //应用本地视频编码参数,使得前述修改即时生效(参数为int型:1 使用新参数,0 使用默认参数)
         AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_APPLYPARAM, ref bUseAppParam, sizeof(int));
     }
     else
     {
         int bitrate = 0;  //0表示质量模式
         //设置本地视频编码的码率
         AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_BITRATECTRL, ref bitrate, sizeof(int));
         int keyframe = 25;
         //设置本地视频编码的关键帧间隔
         AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_GOPCTRL, ref keyframe, sizeof(int));
         int framerate = 25;
         //设置本地视频编码的帧率
         AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_FPSCTRL, ref framerate, sizeof(int));
         int defaultParam = 3;
         // 设置本地视频编码的预设参数
         AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_PRESETCTRL, ref defaultParam, sizeof(int));
         int bUseAppParam = 1;
         //应用本地视频编码参数,使得前述修改即时生效(参数为int型:1 使用新参数,0 使用默认参数)
         AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_APPLYPARAM, ref bUseAppParam, sizeof(int));
     }
 }
Beispiel #2
0
        void InitChat()
        {
            string path = Application.StartupPath;

            SystemSetting.Text_OnReceive        = new TextReceivedHandler(Received_Text);               //文本回调涵数
            SystemSetting.TransBuffer_OnReceive = new TransBufferReceivedHandler(Received_TransBuffer); //透明通道传输回调
            SystemSetting.TransFile_OnReceive   = new TransFileReceivedHandler(Received_TransFile);     //文件传输回调
            AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_CORESDK_PATH, path, path.Length);



            SystemSetting.Init(this.Handle);

            ////设置视频分辨率
            //int m_Refw = AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_WIDTHCTRL, ref frmLogin.m_LocalVideoWidth, sizeof(int));
            //int m_Refh = AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_HEIGHTCTRL, ref frmLogin.m_LocalVideoHeight, sizeof(int));
            ////应用本地视频编码参数,使得前述修改即时生效(参数为int型:1 使用新参数,0 使用默认参数)
            //int m_AppLocal = 1;
            //AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_APPLYPARAM, ref m_AppLocal, sizeof(int));

            //StringBuilder m_ServerKey = new StringBuilder();
            //m_ServerKey.Append("d");
            //int retkey = AnyChatCoreSDK.SetServerAuthPass(m_ServerKey);
            int ret = AnyChatCoreSDK.Connect(frmLogin.m_VideoServerIP, frmLogin.m_VideoTcpPort);

            ret = AnyChatCoreSDK.Login(frmLogin.m_UserName, "", 0);
        }
Beispiel #3
0
        void InitChat()
        {
            string path = Application.StartupPath;

            SystemSetting.Text_OnReceive     = new TextReceivedHandler(Received_Text);
            SystemSetting.TransFile_Received = new TransFileReceivedHandler(Received_TransFile);
            AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_CORESDK_PATH, path, path.Length);
            SystemSetting.Init(this.Handle);

            int ret = AnyChatCoreSDK.Connect("demo.anychat.cn", 8906);

            ret = AnyChatCoreSDK.Login("user2", "", 0);
        }