ImageEn, unit ieMMF

TIEMediaFoundationSourceReader.PushNotifyReceiver

TIEMediaFoundationSourceReader.PushNotifyReceiver

Declaration

procedure PushNotifyReceiver(notifyReceiver: IIEMediaFoundationReaderNotifyReceiver);

Description

Add a notify receiver. A notify receiver receives notifications like "start capturing", "new frame", "end of stream".

Applications can use this method to add an audio renderer before capture begins.

Note: TImageEnView is setup as receiver of TIEMediaFoundationSourceReader in order to deliver OnMediaFoundationNotify events.

Notifications are only sent if the reader was created in asynchronous mode, which requires at least one receiver when the input is set (e.g. SetFileInput or SetURLInput). TImageEnIO adds its receiver before the input is set, so receivers added later are also notified. If you use a standalone TIEMediaFoundationSourceReader, push at least one receiver before setting the input.

Example

// Add the audio renderer
audioStreamindex := ImageEnView1.IO.MediaFoundationSourceReader.IndexOfFirstStream( mmf_AUDIO_STREAM) ;
ImageEnView1.IO.MediaFoundationSourceReader.PushNotifyReceiver( TIEMediaFoundationAudioRenderer.Create( audioStreamIndex ));
ImageEnView1.IO.MediaFoundationSourceReader.StartCapture();

// Remove the audio renderer
ImageEnView1.IO.MediaFoundationSourceReader.StopCapture();
ImageEnView1.IO.MediaFoundationSourceReader.PopNotifyReceiver();

See Also

◼PopNotifyReceiver
◼TIEMediaFoundationAudioRenderer