• 大小: 2.01MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-08
  • 语言: 其他
  • 标签: delphi2010  dspack  

资源简介

安装简单,可播放视频、打开摄像头。dspack For Delphi 2010 ,视频播放, 亲测可用.

资源截图

代码片段和文件信息

//---------------------------------------------------------------------------

#include 
#pragma hdrstop

#include “main.h“
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link “DSPack“
#pragma resource “*.dfm“
TMainForm *MainForm;
TSysDevEnum *SysDev;

//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormCreate(Tobject *Sender)
{
  SysDev = new TSysDevEnum(CLSID_VideoInputDeviceCategory);
  if (SysDev->CountFilters > 0) {
    int i;
    TMenuItem *Device;
    for(i = 0; i < SysDev->CountFilters; i++) {
      Device = new TMenuItem(Devices);
      Device->Caption = SysDev->Filters[i].FriendlyName;
      Device->Tag = i;
      Device->onclick = DevicesClick;
      Devices->Add(Device);
    }
  };
}
//---------------------------------------------------------------------------


void __fastcall TMainForm::DevicesClick(Tobject *Sender)
{
  FilterGraph->ClearGraph();
  FilterGraph->Active = false;
  Filter->baseFilter->Moniker = SysDev->GetMoniker(((TMenuItem *)Sender)->Tag);
  FilterGraph->Active = true;
  ICaptureGraphBuilder2 *Graph = NULL;
  IbaseFilter *SourceFilter = NULL;
  IbaseFilter *VideoFilter = NULL;
  CheckDSError(FilterGraph->QueryInterface(IID_ICaptureGraphBuilder2 &Graph));
  CheckDSError(VideoWindow->QueryInterface(IID_IbaseFilter &VideoFilter));
  CheckDSError(Filter->QueryInterface(IID_IbaseFilter &SourceFilter));
  Graph->RenderStream(&PIN_CATEGORY_PREVIEW NULL SourceFilter NULL VideoFilter);
  FilterGraph->Play();
  Graph->Release();
  VideoFilter->Release();
  SourceFilter->Release();
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::FormDestroy(Tobject *Sender)
{
  delete SysDev;
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::FormCloseQuery(Tobject *Sender bool &CanClose)
{
  FilterGraph->Active = false;        
}
//---------------------------------------------------------------------------


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        3280  2008-09-16 10:27  changes.txt
     文件         142  2003-07-29 01:43  Clean.bat
     文件         117  2004-09-04 02:38  CreateDoc.bat
     目录           0  2009-09-04 16:24  Demos\
     目录           0  2009-09-04 16:24  Demos\BCB6\
     目录           0  2009-09-04 16:24  Demos\BCB6\Playcap\
     文件        2323  2003-06-30 06:23  Demos\BCB6\Playcap\main.cpp
     文件        1026  2003-06-30 06:23  Demos\BCB6\Playcap\main.dfm
     文件        1200  2003-06-30 06:23  Demos\BCB6\Playcap\main.h
     文件        5754  2003-06-30 06:23  Demos\BCB6\Playcap\Playcap.bpr
     文件        1077  2003-06-30 06:23  Demos\BCB6\Playcap\Playcap.cpp
     目录           0  2009-09-04 16:24  Demos\BCB6\PlayWin\
     文件        1808  2003-06-30 06:23  Demos\BCB6\PlayWin\main.cpp
     文件       40512  2003-06-30 06:23  Demos\BCB6\PlayWin\main.dfm
     文件        1643  2003-06-30 06:23  Demos\BCB6\PlayWin\main.h
     文件        5180  2003-06-30 06:23  Demos\BCB6\PlayWin\PlayWin.bpr
     文件        1077  2003-06-30 06:23  Demos\BCB6\PlayWin\PlayWin.cpp
     文件          80  2003-06-30 06:23  Demos\Clean.bat
     目录           0  2009-09-04 16:24  Demos\D5\
     目录           0  2009-09-04 16:24  Demos\D5\Compress\
     目录           0  2009-09-04 16:24  Demos\D5\Compress\DIVX Compressor\
     文件         190  2003-06-30 06:23  Demos\D5\Compress\DIVX Compressor\Compressor.dpr
     文件        2673  2003-06-30 06:23  Demos\D5\Compress\DIVX Compressor\Unit1.dfm
     文件        2113  2003-06-30 06:23  Demos\D5\Compress\DIVX Compressor\Unit1.pas
     目录           0  2009-09-04 16:24  Demos\D5\Compress\File Recompressor\
     文件         188  2003-06-30 06:23  Demos\D5\Compress\File Recompressor\Project1.dpr
     文件        3740  2003-06-30 06:23  Demos\D5\Compress\File Recompressor\Unit1.dfm
     文件        5506  2003-06-30 06:23  Demos\D5\Compress\File Recompressor\Unit1.pas
     文件        1393  2003-06-30 06:23  Demos\D5\Demos.bpg
     目录           0  2009-09-04 16:24  Demos\D5\DVDPlay\
     文件         211  2003-06-30 06:23  Demos\D5\DVDPlay\DVDPlay.dpr
............此处省略336个文件信息

评论

共有 条评论