type
TVideoGrabberClass = class
private
m_VideoGrabber : pointer;
public
constructor Create;
constructor Create(aClassPtr: pointer);
destructor Destroy; override;
public
procedure About;
function AnalogVideoStandardIndex(aValue: pcwchar): cint;
procedure ASFStreaming_GetAuthorizationList;
function AVIDuration(aAVIFile: pcwchar; aDuration: pcint64; aFrameCount: pcint64): cbool;
procedure AVIHeaderInfo(aAVIFile: pcwchar; aHeaderAttribute: THeaderAttribute);
function OpenPlayer: cbool;
procedure PausePlayer;
procedure RunPlayer;
procedure ClosePlayer;
procedure SetDisplay_Embedded(aValue: cbool);
procedure Display_SetLocation(aWindowLeft: cint; aWindowTop: cint; aWindowWidth: cint; aWindowHeight: cint);
protected
function GetPlayerFileName: pcwchar;
procedure SetPlayerFileName(aValue: pcwchar);
function GetAutoStartPlayer: cbool;
procedure SetAutoStartPlayer(aValue: cbool);
public
property PlayerFileName: pcwchar read GetPlayerFileName write SetPlayerFileName;
property AutoStartPlayer: cbool read GetAutoStartPlayer write SetAutoStartPlayer;
//
// events
//
protected
procedure SetOnPlayerEndOfStream(OnPlayerEndOfStreamCb: TOnPlayerEndOfStreamCb);
procedure SetOnLog(OnLogCb: TOnLogCb);
public
property OnPlayerEndOfStream: TOnPlayerEndOfStreamCb write SetOnPlayerEndOfStream;
property OnLog: TOnLogCb write SetOnLog;
end;
implementation
constructor TVideoGrabberClass.Create;
begin
m_VideoGrabber := _CreateVideoGrabber(Self);
end;
constructor TVideoGrabberClass.Create(aClassPtr: Pointer);
begin
inherited Create;
m_VideoGrabber := _CreateVideoGrabber(aClassPtr);
end;
destructor TVideoGrabberClass.Destroy;
begin
_DestroyVideoGrabber(m_VideoGrabber);
m_VideoGrabber := nil;
inherited;
end;
procedure TVideoGrabberClass.About;
begin
_About(m_VideoGrabber);
end;
function TVideoGrabberClass.AnalogVideoStandardIndex(aValue: pcwchar): cint;
begin
result := _AnalogVideoStandardIndex(m_VideoGrabber, aValue);
end;
procedure TVideoGrabberClass.ASFStreaming_GetAuthorizationList;
begin
_ASFStreaming_GetAuthorizationList(m_VideoGrabber);
end;
function TVideoGrabberClass.AVIDuration(aAVIFile: pcwchar; aDuration: pcint64; aFrameCount: pcint64): cbool;
begin
result := _AVIDuration(m_VideoGrabber, aAVIFile, aDuration, aFrameCount);
end;
procedure TVideoGrabberClass.AVIHeaderInfo(aAVIFile: pcwchar; aHeaderAttribute: THeaderAttribute);
begin
_AVIHeaderInfo (m_VideoGrabber, aAVIFile, aHeaderAttribute);
end;
function TVideoGrabberClass.GetPlayerFileName: pcwchar;
begin
Result := _GetPlayerFileName(m_VideoGrabber);
end;
procedure TVideoGrabberClass.SetPlayerFileName(aValue: pcwchar);
begin
_SetPlayerFileName(m_VideoGrabber, aValue);
end;
function TVideoGrabberClass.GetAutoStartPlayer: cbool;
begin
Result := _GetAutoStartPlayer (m_VideoGrabber);
end;
procedure TVideoGrabberClass.SetAutoStartPlayer(aValue: cbool);
begin
_SetAutoStartPlayer (m_VideoGrabber, aValue);
end;
function TVideoGrabberClass.OpenPlayer: cbool;
begin
Result := _OpenPlayer (m_VideoGrabber);
end;
procedure TVideoGrabberClass.PausePlayer;
begin
_PausePlayer (m_VideoGrabber);
end;
procedure TVideoGrabberClass.RunPlayer;
begin
_RunPlayer (m_VideoGrabber);
end;
procedure TVideoGrabberClass.ClosePlayer;
begin
_ClosePlayer (m_VideoGrabber);
end;
procedure TVideoGrabberClass.SetOnPlayerEndOfStream(OnPlayerEndOfStreamCb: TOnPlayerEndOfStreamCb);
begin
_SetOnPlayerEndOfStream (m_VideoGrabber, OnPlayerEndOfStreamCb);
end;
procedure TVideoGrabberClass.SetDisplay_Embedded(aValue: cbool);
begin
_SetDisplayEmbedded (m_VideoGrabber, 0, aValue);
end;
procedure TVideoGrabberClass.Display_SetLocation(aWindowLeft: cint; aWindowTop: cint; aWindowWidth: cint; aWindowHeight: cint);
begin
_Display_SetLocation (m_VideoGrabber, aWindowLeft, aWindowTop, aWindowWidth, aWindowHeight);
end;
procedure TVideoGrabberClass.SetOnLog(OnLogCb: TOnLogCb);
begin
_SetOnLog (m_VideoGrabber, OnLogCb);
end;