Laex / Delphi-OpenCV

Project Delphi-OpenCV. Translation of OpenCV library header files in Delphi
501 stars 226 forks source link

TocvFileSource end of file event not firing #33

Closed DonovanBoddy closed 9 years ago

DonovanBoddy commented 9 years ago

OnEndOfFile event on TocvFileSource does not fire when video completes.

Think this could be the solution but still not reliable for some reason

procedure TocvFileSource.SetEnabled (Value: Boolean); Var pFileName: PAnsiChar; begin if FEnabled <> Value then begin if not(csDesigning in ComponentState) then begin if Assigned (FCapture) and FEnabled then begin (FSourceThread as TocvCaptureThread).Capture := nil; cvReleaseCapture (FCapture); FCapture := Nil; end; if Value and FileExists (FileName) then begin pFileName := PAnsiChar (@(AnsiString(FileName)[1])); FCapture := cvCreateFileCapture (pFileName); if Assigned (FCapture) then begin (FSourceThread as TocvCaptureThread).Capture := FCapture; (FSourceThread as TocvCaptureThread).OnNoData := OnNoData;// Here is the addition FSourceThread.Resume; end; end; end; FEnabled := Value; end; end;