TIEMediaFoundationSourceReader.GetNextSample
Declaration
function GetNextSample(): TIEMFReceivedSample;
Description
Retrieve the next sample from the samples buffer.
Note: Applications should free the received sample.
// Handler for TImageEnView.OnMediaFoundatioNotify event
procedure TForm1.ImageEnView1MediaFoundationNotify(Sender, MediaFoundationObject: TObject; NotifyType: TIEMediaFountationNotifyType);
var
sample: TIEMFReceivedSample;
begin
if NotifyType = iemfnFRAME then // is this a frame?
begin
sample := ImageEnView1.IO.MediaFoundationSourceReader.GetNextSample(); // retrieve frame sample
try
sample.DecodeSample(ImageEnView1.IEBitmap); // convert frame sample to bitmap
ImageEnView1.Update(); // update TImageEnView to show the new bitmap
finally
sample.Free(); // free the sample
end;
end;
end;
See Also
◼Capturing
◼StartCapture
◼StopCapture