模拟视频标准对话框

时间:2013-07-11 16:31:50

标签: c++ delphi directshow video-capture mci

我正在创建一个显示视频的程序,因为我正在使用Delphi和directshow。我需要选择视频输入格式(NTSC,PAL,SECAM)。有一个对话框允许您进行此选择,但我不知道如何使用delphi或c +和directshow显示它。显示允许您选择模拟视频标准的对话框的步骤是什么?

谢谢!

1 个答案:

答案 0 :(得分:1)

function DisplayPropertyFrame(Filter: IBaseFilter; Handle: THandle): HResult;
var
  PropertyPages: ISpecifyPropertyPages;
  Pages: CAUUID;
  FilterInfo: TFilterInfo;
  pfilterUnk: IUnknown;
begin
  Result := E_FAIL;

  if Filter = NIL then EXIT;

  Result := Filter.QueryInterface(ISpecifyPropertyPages, PropertyPages);

  if (SUCCEEDED(Result)) then
  begin
    Filter.QueryFilterInfo(FilterInfo);
    Filter.QueryInterface(IUnknown, pfilterUnk);

    PropertyPages.GetPages(Pages);
    PropertyPages := NIL;

    OleCreatePropertyFrame(
       Handle,                 
       0,
       0,                   
       FilterInfo.achName,     
       1,                      
       @pfilterUnk,            
       Pages.cElems,           
       Pages.pElems,           
       0,                      
       0,
       NIL                  
    );

    pfilterUnk := NIL;
    FilterInfo.pGraph := NIL;
    CoTaskMemFree(Pages.pElems);
  end;
end;

function DisplayVideoCaptureDeviceProperty( Handle: THandle): HResult;
begin
  Result := DisplayPropertyFrame(VideoCaptureFilter, Handle);
end;