点对点视频会议程序:VideoNet
2006-07-23 11:34:04 来源:WEB开发网本文示例源代码或素材下载
该程序可以用于两个人在LAN/Intranet(或者Internet)上进行视频会议。现在有许多视频会议程序,每个都有各自的性能提升技术。主要的问题是视频会议视频帧的尺寸对于传输来说太大。因此,性能依赖于对帧的编解码。我使用快速h263编码库来达到更好的压缩率提高速度。该程序做些小改动也可以在Internet上使用。
音频的录制与播放
我在以前的语音会议程序中使用了RecordSound和PlaySound类,这里我将提供摘要说明RecordSound和PlaySound类的使用。
// Create and Start Recorder Thread
record=new RecordSound(this);
record->CreateThread();
// Create and Start Player Thread
play=new PlaySound1(this);
play->CreateThread();
// Start Recording
record->PostThreadMessage(WM_RECORDSOUND_STARTRECORDING,0,0);
// Start Playing
play->PostThreadMessage(WM_PLAYSOUND_STARTPLAYING,0,0);
// During audio recording, data will be available in the OnSoundData
// callback function of the RecordSound class. Here, you can place
// your code to send the data to remote host...
// To play the data received from the remote host
play->PostThreadMessage(WM_PLAYSOUND_PLAYBLOCK,size,(LPARAM)data);
// Stop Recording
record->PostThreadMessage(WM_RECORDSOUND_STOPRECORDING,0,0);
// Stop Playing
play->PostThreadMessage(WM_PLAYSOUND_STOPPLAYING,0,0);
// At last, to Stop the Recording Thread
record->PostThreadMessage(WM_RECORDSOUND_ENDTHREAD,0,0);
// To stop playing thread...
play->PostThreadMessage(WM_PLAYSOUND_ENDTHREAD,0,0);
视频捕获
更多精彩
赞助商链接