|
有实现,请看我源码:
private void initAnychat()
{
if (hallForm != null && !hallForm.bReleased)
{
AnyChatCoreSDK.Logout();
AnyChatCoreSDK.Release();
}
else
{
hallForm = null;
hallForm = new VideoForm(m_myUserID, m_userName, m_firendID, m_LocalVideoWidth, m_LocalVideoHeight,deviceList);
hallForm.OnVideoCall_Reply += new EventHandler<NotifyMessageEventArgs>(hallForm_OnVideoCall_Reply);
//this.Hide();
hallForm.Show();
hallForm.LoadBg(loading);
}
SystemSetting.Init(this.Handle);
int bEnableScreenCamera = 1;
int x = AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_CORESDK_SCREENCAMERACTRL, ref bEnableScreenCamera, sizeof(int));
//设置视频分辨率
int m_Refw = AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_WIDTHCTRL, ref m_LocalVideoWidth, sizeof(int));
int m_Refh = AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_HEIGHTCTRL, ref m_LocalVideoHeight, sizeof(int));
AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_BITRATECTRL, ref m_LocalVideoBitrate, sizeof(int));
AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_FPSCTRL, ref m_LocalVideoFps, sizeof(int));
AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_PRESETCTRL, ref m_LocalPreset, sizeof(int));
AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_GOPCTRL, ref m_LocalGop, sizeof(int));
AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_QUALITYCTRL, ref m_LocalQuality, sizeof(int));
//应用本地视频编码参数,使得前述修改即时生效(参数为int型:1 使用新参数,0 使用默认参数)
int m_AppLocal = 1;
AnyChatCoreSDK.SetSDKOption(AnyChatCoreSDK.BRAC_SO_LOCALVIDEO_APPLYPARAM, ref m_AppLocal, sizeof(int));
//AnyChatCoreSDK.SelectVideoCapture(capture);
AnyChatCoreSDK.Connect(videoServerIP, videoPort);
} |
|