LanMsg 代码分析

UsersOpt.cs 介绍:

readyLogin() 入口

private void DataArrival(byte[] Data, System.Net.IPAddress Ip, int Port) 这是收到消息的处理函数,里面有个一个大的switch

ServiceMain.cs

FormAccess.cs

newSendMsgForm() 产生新用户发送消息窗口 (其中有打洞代码)
if (user.State != 0 && !user.isWANConnected)//如果用户在线且与对方未连接,则向服务器请求获得对方IP与端口,并请求服务器通知对方UDP打洞
    FormAccess.GetUserIPRequest(BitConverter.GetBytes(user.Index));

MyAV.cs 包含一个AV.cs
Connect() 连接到对方并且开始发送AV数据

AV.cs
IniVideoRender(){

            IMLibrary.AV.BITMAPINFOHEADER bmi = new IMLibrary.AV.BITMAPINFOHEADER();
            bmi.biCompression = 0;
            bmi.biWidth = 160;
            bmi.biHeight = 120;
            bmi.biPlanes = 1;
            bmi.biBitCount = 0x18;
            bmi.biXPelsPerMeter = 0;
            bmi.biYPelsPerMeter = 0;
            bmi.biClrUsed = 0;
            bmi.biClrImportant = 0;
            bmi.biSizeImage = 0xE100;//0x9600;
            bmi.biSize = Marshal.SizeOf(bmi);
}

 

WaveOut.cs 包装 winmm.dll
WaveIn.cs 包装 winmm.dll

DrawDib.cs 包装了Render
1. this.SrcRect = this.DstRect = new Rectangle(0, 0, 80, 60);
2. BITMAPINFOHEADER 外面可以直接赋值。
用DrawDibDraw()把BMP图像绘制到屏幕上。

IniVideoCapture()

VideoCapturer.cs 包装 AVICAP32.dll
VideoCapturer() 构造函数

             this.m_hwnd = capCreateCaptureWindow("", WS_VISIBLE | WS_CHILD, 0, 0, control.Width, control.Height, control.Handle, 0);
            if (this.m_hwnd == IntPtr.Zero)
            {
                throw new AVException();
            }
            this.m_parms = new IMLibrary.AV.CaptureParms();
            this.m_streamCallBack = new capVideoStreamCallback(this.streamCallBack);
            this.m_errorCallBack = new IMLibrary.AV.capErrorCallback(this.capErrorCallback);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值