- uses Windows, ActiveX, DirectShow, Graphics;
- // DirectShow Media Player.
- TDSMP = record
- Initialized : boolean;
- // DirectShow stuff.
- GraphBuilder : IGraphBuilder;
- MediaControl : IMediaControl;
- MediaSeeking : IMediaSeeking;
- MediaEventEx : IMediaEvent;
- BasicAudio : IBasicAudio;
- BasicVideo : IBasicVideo;
- VideoWindow : IVideoWindow;
- Dvd : IDVDControl;
- DvdInfo : IDvdInfo;
- // Video info.
- VideoAvail : boolean;
- VideoWidth : integer;
- VideoHeight : integer;
- VideoBitRate : integer;
- VideoFPS : single;
- end;
- function dsmpGetVideoImage(_dsmp: TDSMP) : TBitmap;
- var
- Buffersize : Longint;
- bmp: TBitmap;
- begin
- bmp := TBitmap.Create;
- bmp.width := _dsmp.VideoWidth;
- bmp.height := _dsmp.VideoHeight;
- buffersize := ( _dsmp.VideoWidth * _dsmp.VideoHeight )* 3;
- _dsmp.BasicVideo.GetCurrentImage(buffersize, bmp);
- result.Assign(bmp);
- bmp.free;
- end;