Event VLGenericFilter.TVLGenericFilter.OnProcessData

From Mitov Wiki Doc
Jump to: navigation, search

This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.

Class: TVLGenericFilter

Contents

Syntax

Delphi:

property OnProcessData : TVLProcessVideoNotify read FOnProcessData write SetOnProcessData;

C++ Builder:

__property TVLProcessVideoNotify OnProcessData = { read=FOnProcessData, write=SetOnProcessData };

Summary

Occurs when a video frame is received.

Description

Use the OnProcessData event handler to write code that responds when a video frame is received.

Write your custom code to process the video data inside the event. The incoming image will be contained inside the InBuffer. You can assign the processed image to the OutBuffer.

You can prevent the output buffer to be sent to the next component by setting SendOutputData to False.

Usually occurs when a new frame is generated during video capturing or video playback. Example Delphi Example :

procedure TForm1.VLGenericFilter2ProcessData(Sender: TObject;
  InBuffer: IVLImageBuffer; var OutBuffer: IVLImageBuffer; var SendOutputData: Boolean);
var
  X, Y : Integer;

begin
  for X := 0 to OutBuffer.Width - 1 do
    for Y := 0 to OutBuffer.Height - 1 do
      begin
      OutBuffer.Red[ X, Y ] := InBuffer.Blue[ X, Y ] + 10;
      OutBuffer.Green[ X, Y ] := InBuffer.Red[ X, Y ] + 6;
      OutBuffer.Blue[ X, Y ] := InBuffer.Green[ X, Y ] + 2;
      end;

end;

C++ Builder Example:

void __fastcall TForm1::VLGenericFilter2ProcessData(TObject *Sender,
      TVLCVideoBuffer InBuffer, TVLCVideoBuffer &OutBuffer,
      bool &SendOutputData)
{
  for ( int x = 0; x < OutBuffer.GetWidth(); x ++ )
    for ( int y = 0; y < OutBuffer.GetHeight(); y ++ )
      {
      OutBuffer.Red[ x ][ y ] = InBuffer.Blue[ x ][ y ] + 10;
      OutBuffer.Green[ x ][ y ] = InBuffer.Red[ x ][ y ] + 6;
      OutBuffer.Blue[ x ][ y ] = InBuffer.Green[ x ][ y ] + 2;
      }
}

Visual C++/MFC Example:

void __stdcall CCustomFilterDemoDlg::VLGenericFilter2ProcessData(void *Sender,
      TVLCVideoBuffer InBuffer, TVLCVideoBuffer &OutBuffer,
      bool &SendOutputData)
{
  for ( int x = 0; x < OutBuffer.GetWidth(); x ++ )
    for ( int y = 0; y < OutBuffer.GetHeight(); y ++ )
      {
      OutBuffer.Red[ x ][ y ] = InBuffer.Blue[ x ][ y ] + 10;
      OutBuffer.Green[ x ][ y ] = InBuffer.Red[ x ][ y ] + 6;
      OutBuffer.Blue[ x ][ y ] = InBuffer.Green[ x ][ y ] + 2;
      }
}

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox