请教有关dspack2.31视频捕获的问题! (100分)

  • 主题发起人 主题发起人 xzmyzy
  • 开始时间 开始时间
X

xzmyzy

Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是驱动程序为SV713x PCI Card WDM Driver的采集卡,不能连接到视频源,图像出不来,请问在PlayVideoCap例子中如何做,是用什么语句?

unit main;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DSUtil, StdCtrls, DSPack, DirectShow9, Menus, ExtCtrls;

type
TVideoForm = class(TForm)
FilterGraph: TFilterGraph;
VideoWindow: TVideoWindow;
MainMenu1: TMainMenu;
Devices: TMenuItem;
Filter: TFilter;
Image: TImage;
SampleGrabber: TSampleGrabber;
SnapShot: TButton;
CallBack: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
procedure SnapShotClick(Sender: TObject);
procedure SampleGrabberBuffer(sender: TObject;
SampleTime:do
uble;
pBuffer: PByte;
BufferLen: Integer);
private
{ D閏larations priv閑s }
public
{ D閏larations publiques }
procedure OnSelectDevice(sender: TObject);
end;


var
VideoForm: TVideoForm;
SysDev: TSysDevEnum;
implementation

{$R *.dfm}

procedure TVideoForm.FormCreate(Sender: TObject);
var
i: integer;
Device: TMenuItem;
begin

SysDev:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
if SysDev.CountFilters > 0 then

for i := 0 to SysDev.CountFilters - 1do

begin

Device := TMenuItem.Create(Devices);
Device.Caption := SysDev.Filters.FriendlyName;
Device.Tag := i;
Device.OnClick := OnSelectDevice;
Devices.Add(Device);
end;

end;


procedure TVideoForm.OnSelectDevice(sender: TObject);
begin

FilterGraph.ClearGraph;
FilterGraph.Active := false;
Filter.BaseFilter.Moniker := SysDev.GetMoniker(TMenuItem(Sender).tag);
FilterGraph.Active := true;
with FilterGraph as ICaptureGraphBuilder2do

RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter as IBaseFilter, SampleGrabber as IBaseFilter, VideoWindow as IbaseFilter);
FilterGraph.Play;
end;


procedure TVideoForm.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin

SysDev.Free;
FilterGraph.ClearGraph;
FilterGraph.Active := false;
end;


procedure TVideoForm.SnapShotClick(Sender: TObject);
begin

SampleGrabber.GetBitmap(Image.Picture.Bitmap);
end;


procedure TVideoForm.SampleGrabberBuffer(sender: TObject;
SampleTime:do
uble;
pBuffer: PByte;
BufferLen: Integer);
begin

if CallBack.Checked then

begin

Image.Canvas.Lock;
try
SampleGrabber.GetBitmap(Image.Picture.Bitmap, pBuffer, BufferLen);
finally
Image.Canvas.Unlock;
end;

end;

end;


end.

 
组件连接好没有。
 
to jemyzhang
组件没连好,在Tfiltergraph和Tfilter中好象没有什么可选的属性.
在Tfilter中有一个basefilter,点击里面有selector页的filters中有好多的items,但不知道有什么用,因为没有什么帮助信息,在dspack的help中没有说明.
请问,如何设置组件连接.
 
后退
顶部