请使用过Dspack开发视频捕捉的DFW进来~~~~ ( 积分: 50 )

  • 主题发起人 主题发起人 午午
  • 开始时间 开始时间

午午

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在在做一个视频捕捉软件,用的是天敏的SDK-2000视频卡,该卡有两个输入口,但是两个口的摄像不能同时使用。我想问一下用程序怎么控制输入口之间的切换?第一次用Dspack,也是第一次搞视频,请多多关照!谢谢
 
SDK_20001.VideoSource :=1表示1通道
SDK_20001.VideoSource :=1表示2通道


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, VaClasses, VaComm, OleCtrls, SDK_2000Lib_TLB;

type
TForm1 = class(TForm)
SDK_20001: TSDK_2000;
VaComm: TVaComm;
Image1: TImage;
Image2: TImage;
Timer1: TTimer;
Button1: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Button2: TButton;
Button3: TButton;
SDK_20002: TSDK_2000;
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private declarations }
f_bDSR,
f_bCTS,
f_bRING,
f_bRLSD:boolean;
public
{ Public declarations }
end;


var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
begin

self.SDK_20001.Connect(false);
self.SDK_20001.VideoSource :=2;

self.SDK_20001.ShowLogo :=true;
self.SDK_20001.ShowTime:=true;
self.SDK_20001.ShowDate:=true;
self.SDK_20001.SetPreviewWHT(120,160,2);

self.SDK_20002.Connect(false);
self.SDK_20002.VideoSource :=1;

self.SDK_20002.ShowLogo :=true;
self.SDK_20002.ShowTime:=true;
self.SDK_20002.ShowDate:=true;
self.SDK_20002.SetPreviewWHT(120,160,2);

self.f_bDSR :=false;
self.f_bCTS :=false;
self.f_bRING :=false;
self.f_bRLSD :=false;
// self.VaComm.AutoOpen :=true;
self.VaComm.Open;

end;



procedure TForm1.Timer1Timer(Sender: TObject);
begin

//1
if self.VaComm.RLSD and not self.f_bRLSD then

begin

if self.SDK_20001.VideoSource =2 then

begin

self.SDK_20001.VideoSource :=1;
sleep(1500);
end;

self.SDK_20001.SaveImageToBmp('c:/1.bmp');
//图形捕捉
self.Image1.Picture.LoadFromFile('c:/1.bmp');
self.f_bRLSD :=true;
end;

if not self.VaComm.RLSD then
self.f_bRLSD :=false;
//6
if self.VaComm.DSR and not self.f_bDSR then

begin

if self.SDK_20001.VideoSource =1 then

begin

self.SDK_20001.VideoSource :=2;
sleep(1500);
end;

self.SDK_20001.SaveImageToBmp('c:/2.bmp');
//图形捕捉
self.Image2.Picture.LoadFromFile('c:/2.bmp');
self.f_bDSR :=true;
end;

if not self.VaComm.DSR then
self.f_bDSR :=false;
//8
if self.VaComm.CTS and not self.f_bCTS then

begin

if self.SDK_20001.VideoSource =1 then

begin

self.SDK_20001.VideoSource :=2;
sleep(1500);
end;

self.SDK_20001.SaveImageToBmp('c:/2.bmp');
//图形捕捉
self.Image2.Picture.LoadFromFile('c:/2.bmp');
self.f_bCTS :=true;
end;

if not self.VaComm.CTS then
self.f_bCTS :=false;
//9
if self.VaComm.RING and not self.f_bRING then

begin

if self.SDK_20001.VideoSource =1 then

begin

self.SDK_20001.VideoSource :=2;
sleep(1500);
end;

self.SDK_20001.SaveImageToBmp('c:/2.bmp');
//图形捕捉
self.Image2.Picture.LoadFromFile('c:/2.bmp');
self.f_bRING :=true;
end;

if not self.VaComm.RING then
self.f_bRING :=false;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin

if self.SDK_20001.VideoSource =2 then

begin

self.SDK_20001.VideoSource :=1;
sleep(1500);
end;

self.SDK_20001.SaveImageToJpg('c:/1.Jpg',100);
//图形捕捉
// self.Image1.Picture.Graphic.LoadFromFile('c:/1.Jpg');
if self.SDK_20001.VideoSource =1 then

begin

self.SDK_20001.VideoSource :=2;
sleep(1500);
end;

self.SDK_20001.SaveImageToJpg('c:/2.Jpg',100);
//图形捕捉
// self.Image2.Picture.Graphic.LoadFromFile('c:/2.Jpg');
self.RadioButton2.Checked:=true;
end;


procedure TForm1.RadioButton2Click(Sender: TObject);
begin

if self.RadioButton2.Checked then
self.SDK_20001.VideoSource :=2;
end;


procedure TForm1.RadioButton1Click(Sender: TObject);
begin

if self.RadioButton1.Checked then
self.SDK_20001.VideoSource :=1;
end;


procedure TForm1.Button2Click(Sender: TObject);
begin

if self.SDK_20001.VideoSource =2 then

begin

self.SDK_20001.VideoSource :=1;
sleep(1500);
end;

self.SDK_20001.SaveImageToBmp('c:/1.bmp');
//图形捕捉
self.Image1.Picture.LoadFromFile('c:/1.bmp');
self.RadioButton1.Checked:=true;
end;


procedure TForm1.Button3Click(Sender: TObject);
begin

if self.SDK_20001.VideoSource =1 then

begin

self.SDK_20001.VideoSource :=2;
sleep(1500);
end;

self.SDK_20001.SaveImageToBmp('c:/2.bmp');
//图形捕捉
self.Image2.Picture.LoadFromFile('c:/2.bmp');
self.RadioButton2.Checked:=true;
end;


procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin

self.SDK_20001.Disconnect;
self.SDK_20002.Disconnect;
end;


end.
 
网络终于连接上了
问题还是没有得到解决,cyjsir的代码我看不懂
我问的是用dspack写该如何
 
后退
顶部