Ya encontre una forma que funciona , ahora estoy usando eventos en una unit :
Código Delphi
[-]
unit capture;
interface
uses SysUtils, Windows, Jpeg, Vcl.Graphics, VSample,
VFrames, Classes;
var
m1: TMethod;
video: TVideoImage;
function capture_webcam(): boolean;
implementation
procedure OnNewVideoFrame(ASelf:Pointer; Width, Height: integer;
DataPtr: Pointer);
begin
end;
function capture_webcam(): boolean;
var
DeviceList: TStringList;
begin
DeviceList := TStringList.Create;
video := TVideoImage.Create;
video.GetListOfDevices(DeviceList);
video.VideoStart(DeviceList[0]);
m1.code := @OnNewVideoFrame;
m1.Data := video;
video.OnNewVideoFrame := TNewVideoFrameEvent(m1);
end;
end.
Todo compila bien pero cuando ejecuto la funcion me devuelve este error : access violation at 0x0018fdee: write of address 0x00000000
Solo es ese detalle , ya funciona todo , ¿ alguien sabe cual es el problema al crear el evento ? porque funciona en otros eventos pero en este no.