Skip to content

OnVideoFromBitmapsNextFrameNeeded

event

Delphi
property OnVideoFromBitmapsNextFrameNeeded: TOnVideoFromBitmapsNextFrameNeeded read FOnVideoFromBitmapsNextFrameNeeded write FOnVideoFromBitmapsNextFrameNeeded;
C++Builder
__property TOnVideoFromBitmapsNextFrameNeeded OnVideoFromBitmapsNextFrameNeeded = {read=FOnVideoFromBitmapsNextFrameNeeded, write=FOnVideoFromBitmapsNextFrameNeeded};
typedef void __fastcall (__closure *TOnVideoFromBitmapsNextFrameNeeded)(System::TObject* Sender, bool FirstSample);
C#
public event OnVideoFromBitmapsNextFrameNeededEventHandler OnVideoFromBitmapsNextFrameNeeded;
public delegate void OnVideoFromBitmapsNextFrameNeededEventHandler(object sender, TOnVideoFromBitmapsNextFrameNeededEventArgs e);
VB.NET
Public Event OnVideoFromBitmapsNextFrameNeeded As OnVideoFromBitmapsNextFrameNeededEventHandler
Public Delegate Sub OnVideoFromBitmapsNextFrameNeededEventHandler(sender As Object, e As TOnVideoFromBitmapsNextFrameNeededEventArgs)
C++/Qt
void SetOnVideoFromBitmapsNextFrameNeeded (TOnVideoFromBitmapsNextFrameNeededCb OnVideoFromBitmapsNextFrameNeededCb);
typedef void CALLBACK TOnVideoFromBitmapsNextFrameNeededCb (void *Object, void *Sender, BOOL FirstSample);

Requests a bitmap handle to build the next video frame. This TOnVideoFromBitmapsNextFrameNeeded event occurs for each video frame that will be build from a bitmap handle when a preview or recording graph is running and VideoSource = vs_JPEGsOrBitmaps.

From this event you must invoke SendImageToVideoFromBitmaps , and pass as parameter: - either a file path to a BMP or JPEG file through the BMPorJPEGFile parameter (a)

  • either a bitmap handle through the BitmapHandle parameter (b)

If no more images are available, set the EndOfData parameter to true to notify the end of the recording or preview.

Remarks: (a) if a BMPorJPEGFile string is specified (the string is not empty), set the BitmapHandle parameter to 0 (b) if a bitmap handle is used, enable CanFreeBitmapHandle if TVideoGrabber must free the bitmap handle, or disable CanFreeBitmapHandle if you need to reuse the bitmap later.

You can find sample code in the MainDemo project included in the package.