亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? upushsource.pas

?? delphi源碼
?? PAS
?? 第 1 頁 / 共 4 頁
字號:
//------------------------------------------------------------------------------
// File:              UPushSource.pas
// Original file(s):  Setup.cpp, PushSource.h,
//                    PushSourceBitmap.cpp, PushSourceBitmapSet.cpp,
//                    PushSourceDesktop.cpp, PushSource.h,
//                    DibHelper.cpp, DibHelper.h, PushGuids.h
// Converted to Delphi by Nevhasymyy Andriy (E-Mail: a.n@email.com)
// Thanks to Henri Gourvest (hgourvest@progdigy.com)
//
// Desc: DirectShow sample code - In-memory push mode source filter
//
// Portions created by Microsoft are
// Copyright (c) 1992-2002 Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------------------------

{
  @abstract(In-memory push mode source filter Delphi conversion)
  @author(Andriy Nevhasymyy: a.n@email.com)
  @created(Jun 28, 2003)
  @lastmod(Aug 04, 2003)
}
unit UPushSource;

interface
uses
  BaseClass, DirectShow9, DSUtil,
  Windows, ActiveX, SysUtils;

const
  //
  // GUID definitions for PushSource filter set
  //
  CLSID_PushSourceBitmap: TGUID = '{E446D455-7C13-492A-9C96-38F948687E8A}';
  CLSID_PushSourceBitmapSet: TGUID = '{D5070569-3C5F-4988-A77C-4DF44E850C43}';
  CLSID_PushSourceDesktop: TGUID = '{570757C1-D2D8-42D1-BA0C-24E1BED3F62F}';

  // Setup information
  sudPinTypes: TRegPinTypes =
  (
    // video stream connection
    clsMajorType: @MEDIATYPE_Video;
    // all available
    clsMinorType: @MEDIASUBTYPE_NULL
    );

  // pins info
  sudOutputPinBitmap: array[0..0] of TRegFilterPins =
  (
    (
    strName: 'Output'; // Pins string name
    bRendered: FALSE; // Is it rendered
    bOutput: TRUE; // Is it an output
    bZero: FALSE; // Are we allowed none
    bMany: FALSE; // And allowed many
    oFilter: nil; // Connects to filter
    strConnectsToPin: nil; // Connects to pin
    nMediaTypes: 1; // Number of types
    lpMediaType: @sudPinTypes // Pin information
    )
    );
  sudOutputPinBitmapSet: array[0..0] of TRegFilterPins =
  (
    (
    strName: 'Output'; // Pins string name
    bRendered: FALSE; // Is it rendered
    bOutput: TRUE; // Is it an output
    bZero: FALSE; // Are we allowed none
    bMany: FALSE; // And allowed many
    oFilter: nil; // Connects to filter
    strConnectsToPin: nil; // Connects to pin
    nMediaTypes: 1; // Number of types
    lpMediaType: @sudPinTypes // Pin information
    )
    );

  sudOutputPinDesktop: array[0..0] of TRegFilterPins =
  (
    (
    strName: 'Output'; // Pins string name
    bRendered: FALSE; // Is it rendered
    bOutput: TRUE; // Is it an output
    bZero: FALSE; // Are we allowed none
    bMany: FALSE; // And allowed many
    oFilter: nil; // Connects to filter
    strConnectsToPin: nil; // Connects to pin
    nMediaTypes: 1; // Number of types
    lpMediaType: @sudPinTypes // Pin information
    )
    );

  UNITS = 10000000;
  FPS_30 = UNITS div 30;
  FPS_20 = UNITS div 20;
  FPS_10 = UNITS div 10;
  FPS_5 = UNITS div 5;
  FPS_4 = UNITS div 4;
  FPS_3 = UNITS div 3;
  FPS_2 = UNITS div 2;
  FPS_1 = UNITS div 1;

  DefaultFrameLength: TReferenceTime = FPS_10;

  // Filter name strings
  PushBitmapName: WideString = '_ PushSource Bitmap Filter';
  PushBitmapSetName: WideString = '_ PushSource BitmapSet Filter';
  PushDesktopName: WideString = '_ PushSource Desktop Filter';

  // default bitmap file name
  BITMAP_NAME: string = 'sample.bmp';

  // Number of bitmap files to load in the CPushPinBitmapSet class
  Num_Files = 5;

type
  (**********************************************
   *
   *  Class declarations
   *
   **********************************************)

  TBCPushPinBitmap = class(TBCSourceStream)
  protected
    // To track where we are in the file
    FFramesWritten: Integer;
    // Do we need to clear the buffer?
    FZeroMemory: Boolean;
    // The time stamp for each sample
    FSampleTime: TRefTime;

    // Pointer to the bitmap header
    FBmi: PBitmapInfo;
    // Size of the bitmap header
    FBitmapInfo: DWord;

    // File opening variables
     // Handle returned from CreateFile
    FFileHandle: THandle;
    // Points to beginning of file buffer
    FFileBuffer: PByte;
    // Points to pixel bits
    FImage: PByte;

    // How many frames have been displayed
    FFrameNumber: Integer;
    // Duration of one frame
    FFrameLength: TReferenceTime;

    // Protects our internal state
    FSharedState: TBCCritSec;

  public
    constructor Create(out hr: HResult; Filter: TBCSource);
    destructor Destroy; override;

    // Override the version that offers exactly one media type
    function GetMediaType(MediaType: PAMMediaType): HResult; override;
    function DecideBufferSize(Allocator: IMemAllocator;
      Properties: PAllocatorProperties): HRESULT; override;
    function FillBuffer(Sample: IMediaSample): HResult; override;

    // Quality control
   // Not implemented because we aren't going in real time.
   // If the file-writing filter slows the graph down, we just do nothing, which means
   // wait until we're unblocked. No frames are ever dropped.
    // Quality control notifications sent to us
    function Notify(Filter: IBaseFilter; q: TQuality): HRESULT; override;
      stdcall;
  end;

  TBCPushPinBitmapSet = class(TBCSourceStream)
  protected
    // To track where we are in the file
    FFramesWritten: Integer;
    // Do we need to clear the buffer?
    FZeroMemory: Boolean;
    // The time stamp for each sample
    FSampleTime: TRefTime;

    // Array of bitmap headers pointers
    FBmi: array[0..Num_Files - 1] of PBitmapInfo;
    // Sizes of the bitmap headers
    FBitmapInfo: array[0..Num_Files - 1] of DWord;

    // File opening variables
     // Handles returned from CreateFile
    FFileHandle: array[0..Num_Files - 1] of THandle;
    // Points to beginning of files buffer
    FFileBuffer: array[0..Num_Files - 1] of PByte;
    // Points to pixel bits
    FImage: array[0..Num_Files - 1] of PByte;

    // number of files loaded
    FFilesLoaded: Boolean;

    // Which bitmap is being displayed
    FCurrentBitmap,
      // How many frames have been displayed
    FFrameNumber: Integer;
    // Duration of one frame
    FFrameLength: TReferenceTime;

    // Protects our internal state
    FSharedState: TBCCritSec;

  public
    constructor Create(out hr: HResult; Filter: TBCSource);
    destructor Destroy; override;

    // Override the version that offers exactly one media type
    function GetMediaType(MediaType: PAMMediaType): HResult; override;
    function DecideBufferSize(Allocator: IMemAllocator;
      Properties: PAllocatorProperties): HRESULT; override;
    function FillBuffer(Sample: IMediaSample): HResult; override;

    // Quality control
   // Not implemented because we aren't going in real time.
   // If the file-writing filter slows the graph down, we just do nothing, which means
   // wait until we're unblocked. No frames are ever dropped.
    // Quality control notifications sent to us
    function Notify(Filter: IBaseFilter; q: TQuality): HRESULT; override;
      stdcall;
  end;

  TBCPushPinDesktop = class(TBCSourceStream)
  protected
    // To track where we are in the file
    FFramesWritten: Integer;
    // Do we need to clear the buffer?
    FZeroMemory: Boolean;
    // The time stamp for each sample
    FSampleTime: TRefTime;

    // How many frames have been displayed
    FFrameNumber: Integer;
    // Duration of one frame
    FFrameLength: TReferenceTime;

    // Rect containing entire screen coordinates
    FScreenRect: TRect;

    // The current image height
    FImageHeight,
      // And current image width
    FImageWidth,
      // Time in msec between frames
    FRepeatTime,
      // Screen bit depth
    FCurrentBitDepth: Integer;

    FMediaType: TAMMediaType;

    // Protects our internal state
    FSharedState: TBCCritSec;

  public
    constructor Create(out hr: HResult; Filter: TBCSource);
    destructor Destroy; override;

    // Override the version that offers exactly one media type
    function GetMediaType(iPosition: Integer;
      out MediaType: PAMMediaType): HResult; override;
    // We will accept 8, 16, 24 or 32 bit video formats, in any
    // image size that gives room to bounce.
    // Returns E_INVALIDARG if the mediatype is not acceptable
    function CheckMediaType(MediaType: PAMMediaType): HResult; override;
    function DecideBufferSize(Allocator: IMemAllocator;
      Properties: PAllocatorProperties): HRESULT; override;
    function SetMediaType(MediaType: PAMMediaType): HRESULT; override;
    function FillBuffer(Sample: IMediaSample): HResult; override;

    // Quality control
   // Not implemented because we aren't going in real time.
   // If the file-writing filter slows the graph down, we just do nothing, which means
   // wait until we're unblocked. No frames are ever dropped.
    // Quality control notifications sent to us
    function Notify(Filter: IBaseFilter; q: TQuality): HRESULT; override;
      stdcall;
  end;

  // In-memory push mode source filter
  // Provides a static bitmap as the video output stream.
  TBCPushSourceBitmap = class(TBCSource)
  private
    FPin: TBCPushPinBitmap;

  public
    constructor Create(ObjName: string; Unk: IUnKnown; out hr: HRESULT);
    constructor CreateFromFactory(Factory: TBCClassFactory;
      const Controller: IUnknown); override;
    destructor Destroy; override;
  end;

  // In-memory push mode source filter
  // Provides a rotating set of bitmaps as the video output stream.
  TBCPushSourceBitmapset = class(TBCSource)
  private
    FPin: TBCPushPinBitmapSet;

  public
    constructor Create(ObjName: string; Unk: IUnKnown; out hr: HRESULT);
    constructor CreateFromFactory(Factory: TBCClassFactory;
      const Controller: IUnknown); override;
    destructor Destroy; override;
  end;

  // In-memory push mode source filter
  // Provides an image of the user's desktop as a continuously updating stream.
  TBCPushSourceDesktop = class(TBCSource)
  private
    FPin: TBCPushPinDesktop;

  public
    constructor Create(ObjName: string; Unk: IUnKnown; out hr: HRESULT);
    constructor CreateFromFactory(Factory: TBCClassFactory;
      const Controller: IUnknown); override;
    destructor Destroy; override;
  end;

implementation

// --- TBCPushPinBitmap ---------------

constructor TBCPushPinBitmap.Create(out hr: HResult; Filter: TBCSource);
var
  CurrentDir: array[0..MAX_PATH - 1] of Char;
  CurrentFileName, MediaFileName: AnsiString;
  MsgText: AnsiString;
  FileSize, BytesRead: DWord;
  FileHeaderSize: Integer;
  BmpFileHeader: PBITMAPFILEHEADER;
  pb: PByte;

begin
  inherited Create('_ Push Source Bitmap', hr, Filter, 'Out');

  FFramesWritten := 0;
  FZeroMemory := False;
  FBmi := nil;
  FBitmapInfo := 0;
  FFileHandle := INVALID_HANDLE_VALUE;
  FFileBuffer := nil;
  FImage := nil;
  FFrameNumber := 0;
  // Display 5 bitmap frames per second
  FFrameLength := FPS_5;
  FSharedState := TBCCritSec.Create;

  // The main point of this sample is to demonstrate how to take a DIB
  // in host memory and insert it into a video stream.
  // To keep this sample as simple as possible, we just read a single 24 bpp bitmap
  // from a file and copy it into every frame that we send downstream.

  // In the filter graph, we connect this filter to the AVI Mux, which creates
  // the AVI file with the video frames we pass to it. In this case,
  // the end result is a still image rendered as a video stream.

  // Your filter will hopefully do something more interesting here.
  // The main point is to set up a buffer containing the DIB pixel bits.
  // This must be done before you start running.

  // First look for the bitmap in the current directory
  GetCurrentDirectory(MAX_PATH - 1, CurrentDir);
  CurrentFileName := Format('%s\%s', [CurrentDir, Bitmap_Name]);

  FFileHandle := CreateFile(PChar(CurrentFileName), GENERIC_READ, 0, nil,
    OPEN_EXISTING,
    FILE_ATTRIBUTE_NORMAL, 0);

  if (FFileHandle = INVALID_HANDLE_VALUE) then
  begin
    // File was not in the application's current directory,
    // so look in the DirectX SDK media path instead.
    MediaFileName := Format('%s\%s'#0, [GetDXSDKMediaPath, Bitmap_Name]);

    FFileHandle := CreateFile(PChar(MediaFileName), GENERIC_READ, 0, nil,
      OPEN_EXISTING,
      FILE_ATTRIBUTE_NORMAL, 0);

    if (FFileHandle = INVALID_HANDLE_VALUE) then
    begin
      MsgText := Format('Could not open bitmap source file ' +
        'in the application directory:'#13#10 + '%s'#13#10 +
        'or in the DirectX SDK Media folder:'#13#10 + '%s'#13#10 +
        'Please copy this file either to the application''s folder'#13#10 +
        'or to the DirectX SDK Media folder, then recreate this filter'#13#10 +
        'Otherwise, you will not be able to render the output pin',
        [CurrentFileName, MediaFileName]);

      OutputDebugString(PChar(MsgText));
      MessageBox(0, PChar(MsgText), 'PushSource filter error',
        MB_ICONERROR or MB_OK);
      hr := HRESULTFROMWIN32(GetLastError);
      Exit;
    end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲五月六月丁香激情| 国产精品一卡二卡| 国产麻豆成人精品| 在线中文字幕不卡| 337p粉嫩大胆色噜噜噜噜亚洲 | 欧美精品丝袜中出| 中文字幕第一页久久| 日本午夜一本久久久综合| 成人av免费在线观看| 日韩精品专区在线| 日韩主播视频在线| 在线观看亚洲a| 亚洲色图欧美在线| 成人午夜视频免费看| 久久综合狠狠综合久久激情 | 在线视频观看一区| 国产精品免费aⅴ片在线观看| 麻豆精品一区二区三区| 欧美午夜免费电影| 一卡二卡三卡日韩欧美| 99热国产精品| 中文字幕一区日韩精品欧美| 91搞黄在线观看| 国产精品久久久久久久久久久免费看| 久久精品噜噜噜成人av农村| 欧美精三区欧美精三区| 一区二区视频在线| 色婷婷av一区| 亚洲精品菠萝久久久久久久| 色综合网色综合| 亚洲视频综合在线| 一本久道中文字幕精品亚洲嫩| 国产精品三级av在线播放| 国产精品456露脸| 欧美极品少妇xxxxⅹ高跟鞋| 国产成人精品免费一区二区| 亚洲国产精品国自产拍av| 国产精品系列在线播放| 中文字幕国产精品一区二区| 成人av网址在线| 一区二区三区中文在线观看| 欧美亚洲国产怡红院影院| 亚洲一区二区免费视频| 欧美日韩亚洲高清一区二区| 五月婷婷另类国产| 91精品福利在线一区二区三区| 麻豆精品一区二区三区| 久久久国产一区二区三区四区小说| 国产永久精品大片wwwapp| 国产片一区二区| av在线播放不卡| 亚洲国产你懂的| 欧美一卡二卡三卡| 高清beeg欧美| 亚洲自拍偷拍欧美| 欧美va亚洲va香蕉在线| 国产.欧美.日韩| 一区二区三区加勒比av| 欧美一区二区三区四区五区 | 亚洲午夜成aⅴ人片| 4438成人网| 国产成人精品亚洲午夜麻豆| 亚洲欧洲性图库| 6080国产精品一区二区| 色噜噜夜夜夜综合网| 亚洲妇熟xx妇色黄| 国产偷国产偷精品高清尤物| 一本久久a久久精品亚洲| 日韩av电影天堂| 亚洲欧洲性图库| 日韩欧美中文一区二区| 97精品国产露脸对白| 免费成人结看片| 亚洲男人天堂av| 欧美精品一区二区三| 在线观看一区二区精品视频| 国产乱码精品一区二区三区五月婷| 中文在线一区二区| 日韩一区二区三区视频在线观看| 国产成人精品亚洲日本在线桃色| 亚洲一区二区三区四区中文字幕| 精品成人一区二区| 欧美日韩国产一级二级| 成人国产精品免费观看视频| 免费日本视频一区| 一区二区成人在线视频| 日本一区二区成人| 欧美成人一区二区三区片免费 | 国产乱码精品一区二区三| 亚洲一区二区视频在线观看| 国产日韩欧美激情| 日韩一区二区三区免费看| 91麻豆国产在线观看| 国产精品小仙女| 精品在线一区二区三区| 午夜激情一区二区| 亚洲最新视频在线观看| 国产精品毛片久久久久久| 久久综合狠狠综合久久激情 | 自拍偷拍欧美精品| 久久久久久97三级| 精品国产乱码久久久久久牛牛 | 久久色成人在线| 欧美一区二区在线看| 欧美亚洲日本国产| 色哟哟一区二区三区| bt欧美亚洲午夜电影天堂| 国产精品影视在线| 国产剧情在线观看一区二区| 久久se这里有精品| 黑人巨大精品欧美黑白配亚洲 | 亚洲综合在线电影| 亚洲欧美色一区| 亚洲黄色小说网站| 亚洲精选视频免费看| 伊人婷婷欧美激情| 亚洲综合男人的天堂| 亚洲国产成人精品视频| 无码av免费一区二区三区试看 | 欧美裸体一区二区三区| 欧美亚州韩日在线看免费版国语版| 色哟哟日韩精品| 欧美日韩国产色站一区二区三区| 欧美伦理电影网| 精品日韩一区二区三区| 久久婷婷综合激情| 国产精品久久久久婷婷二区次| 一区免费观看视频| 亚洲国产日日夜夜| 国产乱色国产精品免费视频| voyeur盗摄精品| 色综合久久99| 欧美日韩国产天堂| 精品国产1区2区3区| 中文字幕精品一区二区三区精品| 国产精品伦理一区二区| 亚洲与欧洲av电影| 视频在线观看一区二区三区| 韩国欧美国产一区| 成人激情动漫在线观看| 欧美伊人久久久久久久久影院| 在线91免费看| 欧美国产精品劲爆| 亚洲国产精品欧美一二99| 久久狠狠亚洲综合| av在线这里只有精品| 欧美日韩国产美女| 国产农村妇女毛片精品久久麻豆 | 亚洲国产精品视频| 韩国中文字幕2020精品| 99久久777色| 制服视频三区第一页精品| 国产欧美日韩久久| 香蕉加勒比综合久久| 久久99精品国产.久久久久| 北条麻妃一区二区三区| 欧美日韩美少妇| 日本一区二区免费在线| 石原莉奈在线亚洲三区| 成人美女在线视频| 欧美一区二区三区在| 中文字幕字幕中文在线中不卡视频| 免费观看日韩电影| 色综合久久88色综合天天免费| 精品国产乱码久久久久久1区2区| 一区二区三区欧美在线观看| 国产一区二区三区在线观看免费| 欧美中文一区二区三区| 国产婷婷色一区二区三区四区 | 亚洲欧美国产77777| 极品销魂美女一区二区三区| 欧美亚洲日本一区| 中文字幕一区二区三区四区不卡 | 成人h动漫精品一区二| 91精品国产91热久久久做人人| 亚洲三级在线观看| 成人丝袜视频网| 日韩视频免费观看高清完整版| 洋洋av久久久久久久一区| 波多野结衣91| 国产精品水嫩水嫩| 国产高清视频一区| 中文字幕欧美一| 国产成人欧美日韩在线电影| 精品久久一区二区三区| 日本亚洲一区二区| 9191成人精品久久| 视频一区二区三区在线| 91国内精品野花午夜精品 | 亚洲最色的网站| 91蝌蚪porny| 亚洲三级免费观看| 99久久精品久久久久久清纯| 国产午夜亚洲精品不卡| 国产毛片一区二区| 国产视频一区二区在线观看| 国产乱码一区二区三区| 国产日韩欧美综合一区| 成人自拍视频在线观看| 中文字幕一区二区视频|