/**********************************************************************
Copyright (c) 2008,天津天地伟业数码科技有限公司研发司法行业中心
All rights reserved.
文件名称:
文件标识:
摘 要:
当前版本:1.0
作 者:包万象
完成日期:2009-10-12
取代版本:1.0
原作者 :
完成日期:
*********************************************************************/
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Registry.hpp>
#pragma hdrstop
#include "code__frmMain.h"
#include "CLS_FireWallOpt.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//DLL导出函数
typedef int __stdcall (*dllInit)(HWND _hLocalVideo, HWND _hRemoteVideo);
dllInit Init = NULL;
typedef void __stdcall (*dllChangeVideoSize)(bool _bFull);
dllChangeVideoSize VideoFull = NULL;
typedef int __stdcall (*dllStartVideoChat)();
dllStartVideoChat StartChat = NULL;
typedef void __stdcall (*dllSetConnectSocket)(void);
dllSetConnectSocket SetConncetSocket = NULL;
typedef void __stdcall (*dllUnInit)(void); //销毁资源
dllUnInit Uninit = NULL;
typedef int __stdcall (*dllConnect)(const char* _pcTargetIP); //开始录像 _pcRecPath:全路径
dllConnect Connect = NULL;
/*
typedef void __stdcall (*dllStopVideoChat)(void);
dllStopVideoChat StopChat = NULL;
typedef void __stdcall (*dllSetRecPath)(const char* _pcRecPath);
dllSetRecPath SetRecPath = NULL;
typedef void __stdcall (*dllStartRecord)(void);
dllStartRecord StartRecord = NULL;
typedef void __stdcall (*dllStopRecord)(void);
dllStopRecord StopRecord = NULL;
*/
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
CLS_FireWallOpt::LoadFireWallLibrary();
CLS_FireWallOpt::Initialize();
CLS_FireWallOpt::AddApplication(WideString(Application->ExeName), L"视频交流Demo");
m_hAVChat = LoadLibrary("AVChatDll.dll");
if(m_hAVChat)
{
Init = (dllInit)::GetProcAddress(m_hAVChat, "AV_Init");
VideoFull = (dllChangeVideoSize)::GetProcAddress(m_hAVChat, "AV_ChangeVideoSize");
StartChat = (dllStartVideoChat)::GetProcAddress(m_hAVChat, "AV_StartVideoChat");
//StopChat = (dllStopVideoChat)::GetProcAddress(m_hAVChat, "dllStopVideoChat");
Uninit = (dllUnInit)::GetProcAddress(m_hAVChat, "AV_Uninit");
Connect = (dllConnect)::GetProcAddress(m_hAVChat, "AV_Connect");
SetConncetSocket = (dllSetConnectSocket)::GetProcAddress(m_hAVChat,"AV_SetConnect");
//SetRecPath = (dllSetRecPath)::GetProcAddress(m_hAVChat,"dllSetRecPath");
//StartRecord = (dllStartRecord)::GetProcAddress(m_hAVChat,"dllStartRecord");
//StopRecord = (dllStopRecord)::GetProcAddress(m_hAVChat,"dllStopRecord");
}
//修改注册表 防止弹出XVID压缩对话框 HKEY_CURRENT_USER\Software\GNU\Xvid\display_status"=dword:00000000
TRegistry *regXvid = new TRegistry;
if(regXvid)
{
regXvid->RootKey = HKEY_CURRENT_USER;
if(regXvid->OpenKey("Software\\GNU\\Xvid" , false))
{
regXvid->WriteInteger("display_status", 0);
regXvid->CloseKey();
}
delete regXvid;
regXvid = NULL;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnInitClick(TObject *Sender)
{
if(Init)
{
Init(pnlLocal->Handle, pnlRemote->Handle);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnStartClick(TObject *Sender)
{
if(StartChat)
{
StartChat();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnStopClick(TObject *Sender)
{
/*
if(StopChat)
{
StopChat();
} */
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnUinitClick(TObject *Sender)
{
if(Uninit)
{
Uninit();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
CLS_FireWallOpt::RemoveApplication(WideString(Application->ExeName));
CLS_FireWallOpt::Uninitialize();
CLS_FireWallOpt::FreeFireWallLibrary();
if(m_hAVChat)
{
FreeLibrary(m_hAVChat);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn2Click(TObject *Sender)
{
if(Connect)
{
Connect(edtIp->Text.c_str());
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn3Click(TObject *Sender)
{
if(SetConncetSocket)
{
SetConncetSocket();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnResizeClick(TObject *Sender)
{
if(VideoFull)
{
VideoFull(true);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn1Click(TObject *Sender)
{
if(VideoFull)
{
VideoFull(false);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::pnlRemoteDblClick(TObject *Sender)
{
if(VideoFull)
{
VideoFull(false);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn4Click(TObject *Sender)
{
//SetRecPath(edtPath->Text.c_str());
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn5Click(TObject *Sender)
{
//StartRecord();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn6Click(TObject *Sender)
{
//StopRecord();
}
//---------------------------------------------------------------------------
基于USB摄像头的音视频对讲
3星 · 超过75%的资源 需积分: 10 28 浏览量
2010-09-21
16:15:49
上传
评论
收藏 234KB RAR 举报
Tim_包
- 粉丝: 67
- 资源: 8
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈