icdecompressbegin(capvar.hic,@bmpininfo.bmiheader, @bmpoutinfo^.bmiheader);
最后,当然是视频数据的解压过程
if video_data.bkeyframe then
result:=icdecompress(capvar.hic,0,@bmpininfo,@video_data.buf,
@bmpoutinfo.bmiheader,outbuffer)
else
result:=icdecompress(capvar.hic,icdecompress_notkeyframe,@bmpininfo,@video_data.buf,
@bmpoutinfo.bmiheader,outbuffer);
if (result=icerr_ok) then
begin
setdibitstodevice(canvas.handle,0,0,bmptmp.width,bmptmp.height,0,0,0,bmpoutinfo^.bmiheader.biheight ,
outbuffer,bmpoutinfo^,dib_rgb_colors);
end;
这样,传送过来的视频数据变直接画到了canvas.handle上了。
还忘记了服务端关闭摄像头的方法,调用capdriverdisconnect(capwnd) 就ok了。
全文就over了,jasonke还要说的就是,这个方法是用的微软的老函数,不过实现起来很简单,相信会点api的都能开发出来,还有一种方法当然是用directshow了哟,这需要你开发filter,要搞明白微软的几个接口,你可以看看dshownetwork例子。这个方法也有很多c++的兄弟在痛苦的实现,想一想directshow的功能真是强大哟,哈哈。
欢迎大家光临《黑雨共享软件》,谢谢大家对中国共享软件的支持
http://brsoft.0033.cn