Class TFilterGraph
Unit
DSPack
Declaration
type TFilterGraph = class()
Description
This component is the central component in DirectShow, the Filter Graph handle synchronization, event notification, and other aspects of the controlling the filter graph.Methods
Overview
Description
 |
constructor Create(AOwner: TComponent); override; |
TFilterGraph constructor.
 |
destructor Destroy; override; |
TFilterGraph destructor.
 |
procedure ClearGraph; |
Disconnect and remove all filters from the filter graph excepting the custom components.
 |
procedure DisconnectFilters; |
This method disconnect all pins.
 |
procedure DVDRestoreBookmark(BookMarkFile: WideString); |
Restore the State and position of a DVD movie saved by DVDSaveBookmark
.
 |
procedure DVDSaveBookmark(BookMarkFile: WideString); |
Save the current state and position of a DVD movie to a file.
See also: DVDRestoreBookmark
.
 |
function Pause: boolean; |
The Pause method pauses all the filters in the filter graph.
 |
function Play: boolean; |
The Run method runs all the filters in the filter graph. While the graph is running, data moves through the graph and is rendered.
 |
function QueryInterface(const IID: TGUID; out Obj): HResult; override; stdcall; |
Retrieve an Interface from the current Graph.
ex: (FilterGraph as IGraphBuilder).RenderFile('C:\speedis.avi', nil);
Remark: The interfaces you can Query depend of the Mode
you have defined.
gmNormal: IAMGraphStreams, IAMStats, IBasicAudio, IBasicVideo, IBasicVideo2, IFilterChain, IFilterGraph, IFilterGraph2, IFilterMapper2, IGraphBuilder, IGraphConfig, IGraphVersion, IMediaControl, IMediaEvent, IMediaEventEx, IMediaEventSink, IMediaFilter, IMediaPosition, IMediaSeeking, IQueueCommand, IRegisterServiceProvider, IResourceManager, IServiceProvider, IVideoFrameStep, IVideoWindow.
gmCapture: all gmNormal interfaces and ICaptureGraphBuilder2.
gmDVD: all gmNormal interfaces and IDvdGraphBuilder, IDvdControl2, IDvdInfo2, IAMLine21Decoder.
 |
function RenderDVD(out status: TAMDVDRenderStatus; FileName: WideString = ''; Mode: Integer = AM_DVD_HWDEC_PREFER): HRESULT; |
Render a DVD Video Volume or a File Name if specified.
 |
function RenderFile(FileName: WideString): HRESULT; |
Render a single file.
 |
function RenderFileEx(FileName: WideString): HRESULT; |
 |
function Stop: boolean; |
The Stop method stops all the filters in the graph.
Properties
Overview
Description
 |
property Active: boolean; |
Activate the Filter Graph.
 |
property AutoCreate: boolean; |
Auto-Activate the Filter Graph when component is created.
 |
property Balance: integer; |
The volume balance.
 |
property Duration: Integer; |
Retrieve the total duration of a stream.
 |
property GraphEdit: boolean; |
if true you can use GraphEdit application to connect with the Filter Graph.
 |
property LogFile: String; |
Specify a File Name to save the Filter Graph Log.
 |
property Mode: TGraphMode; |
There is 3 modes: gmNormal, gmCapture and gmDVD.
See also: .
 |
property OnActivate: TNotifyEvent; |
-------------------------------------------------------------------------
 |
property OnDSEvent: TOnDSEvent; |
Generic Filter Graph event.
Event: message sent.
Param1: first message parameter.
Param2: second message parameter.
 |
property OnDVDAngleChange: TOnDVDChange; |
Signals that either the number of available angles changed or that the current angle number changed.
Angle numbers range from 1 to 9. The current angle number can change automatically with a navigation command authored on the disc as well as through application control by using the IDvdControl2 interface.
total: value indicating the number of available angles. When the number of available angles is 1, the current video is not multiangle.
current: value indicating the current angle number.
 |
property OnDVDAnglesAvailable: TOnDVDAnglesAvailable; |
Indicates whether an angle block is being played and angle changes can be performed.
Angle changes are not restricted to angle blocks and the manifestation of the angle change can be seen only in an angle block.
available: Boolean value that indicates if an angle block is being played back. False indicates that playback is not in an angle block and angles are not available, True indicates that an angle block is being played back and angle changes can be performed.
 |
property OnDVDAudioStreamChange: TOnDVDAudioStreamChange; |
Signals that the current audio stream number changed for the main title.
The current audio stream can change automatically with a navigation command authored on the disc as well as through application control by using the IDvdControl2 interface.
stream: value indicating the new user audio stream number. Audio stream numbers range from 0 to 7. Stream $FFFFFFFF indicates that no stream is selected.
lcid: Language identifier.
Lang: Language string.
 |
property OnDVDButtonAutoActivated: TOnDVDButtonAutoActivated; |
Signals that a menu button has been automatically activated per instructions on the disc. This occurs when a menu times out and the disc has specified a button to be automatically activated.
Button: value indicating the button that was activated.
 |
property OnDVDButtonChange: TOnDVDChange; |
Signals that either the number of available buttons changed or that the currently selected button number changed.
This event can signal any of the available button numbers. These numbers do not always correspond to button numbers used for IDvdControl2.SelectAndActivateButton because that method can activate only a subset of buttons.
total: value indicating the number of available buttons.
current: value indicating the currently selected button number. Selected button number zero implies that no button is selected.
 |
property OnDVDChapterAutoStop: TNotifyEvent; |
Indicates that playback stopped as the result of a call to the IDvdControl2.PlayChaptersAutoStop method.
 |
property OnDVDChapterStart: TOnDVDChapterStart; |
Signals that the DVD player started playback of a new program in the DVD_DOMAIN_Title domain.
Only simple linear movies signal this event.
chapter: value indicating the new chapter (program) number.
 |
property OnDVDCMDEnd: TOnDVDCMD; |
Signals that a particular command has completed.
CmdID The Command ID and the completion result.
 |
property OnDVDCMDStart: TOnDVDCMD; |
Signals that a particular command has begun.
CmdID: The Command ID and the HRESULT return value.
 |
property OnDVDCurrentHMSFTime: TOnDVDCurrentHMSFTime; |
Signals the current time, in DVD_HMSF_TIMECODE format, relative to the start of the title. This event is triggered at the beginning of every VOBU, which occurs every 0.4 to 1.0 seconds.
The TDVD_HMSF_TIMECODE format is intended to replace the old BCD format that is returned in OnDVDCurrentTime events. The HMSF timecodes are easier to work with. To have the Navigator send EC_DVD_CURRENT_HMSF_TIME events instead of EC_DVD_CURRENT_TIME events, an application must call IDvdControl2.SetOption(DVD_HMSF_TimeCodeEvents, TRUE). When this flag is set, the Navigator will also expect all time parameters in the IDvdControl2 and IDvdInfo2 methods to be passed as TDVD_HMSF_TIMECODEs.
HMSFTimeCode: HMS Time code structure.
TimeCode: old time format, do not use.
 |
property OnDVDCurrentTime: TOnDVDCurrentTime; |
Deprecated, use OnDVDCurrentHMSFTime
instead.
Signals the beginning of every video object unit (VOBU), a video segment which is 0.4 to 1.0 seconds in length.
 |
property OnDVDDiscEjected: TNotifyEvent; |
Signals that a disc was ejected.
Playback automatically stops when a disc is ejected. The application does not have to take any special action in response to this event.
 |
property OnDVDDiscInserted: TNotifyEvent; |
Signals that a disc was inserted into the drive.
Playback automatically begins when a disc is inserted. The application does not have to take any special action in response to this event.
 |
property OnDVDDomainFirstPlay: TNotifyEvent; |
Performing default initialization of a DVD disc.
 |
property OnDVDDomainStop: TNotifyEvent; |
The DVD Navigator is in the DVD Stop domain.
 |
property OnDVDDomainTitle: TNotifyEvent; |
Displaying the current title.
 |
property OnDVDDomainVideoManagerMenu: TNotifyEvent; |
Displaying menus for whole disc.
 |
property OnDVDDomainVideoTitleSetMenu: TNotifyEvent; |
Displaying menus for current title set.
 |
property OnDVDErrorCopyProtectFail: TNotifyEvent; |
Key exchange for DVD copy protection failed. Playback is stopped.
 |
property OnDVDErrorIncompatibleDiscAndDecoderRegions: TNotifyEvent; |
The disc cannot be played because the disc is not authored to be played in the decoder's region.
 |
property OnDVDErrorIncompatibleSystemAndDecoderRegions: TNotifyEvent; |
No discs can be played because the system region does not match the decoder region.
 |
property OnDVDErrorInvalidDiscRegion: TNotifyEvent; |
DVD-Video disc cannot be played because the disc is not authored to play in the system region.
 |
property OnDVDErrorInvalidDVD1_0Disc: TNotifyEvent; |
DVD-Video disc is authored incorrectly for specification version 1.x. Playback is stopped.
 |
property OnDVDErrorLowParentalLevel: TNotifyEvent; |
Player parental level is lower than the lowest parental level available in the DVD content. Playback is stopped.
 |
property OnDVDErrorMacrovisionFail: TNotifyEvent; |
MacrovisionŽ distribution failed. Playback stopped.
 |
property OnDVDErrorUnexpected: TNotifyEvent; |
Something unexpected happened; perhaps content is authored incorrectly. Playback is stopped.
 |
property OnDVDKaraokeMode: TOnDVDKaraokeMode; |
Indicates that the Navigator has either begun playing or finished playing karaoke data.
The DVD player signals this event whenever it changes domains.
Played: TRUE means that a karaoke track is being played and FALSE means that no karaoke data is being played.
 |
property OnDVDNoFP_PGC: TNotifyEvent; |
Signals that the DVD disc does not have a FP_PGC (First Play Program Chain) and that the DVD Navigator will not automatically load any PGC and start playback.
 |
property OnDVDParentalLevelChange: TOnDVDParentalLevelChange; |
Signals that the parental level of the authored content is about to change.
The DVD Navigator source filter does not currently support "on the fly" parental level changes in response to SetTmpPML commands on a DVD disc.
level: value representing the new parental level set in the player.
 |
property OnDVDPlaybackRateChange: TOnDVDPlaybackRateChange; |
Signals that a rate change in the playback has been initiated. rate: indicate the new playback rate. rate < 0 indicates reverse playback mode. rate > 0 indicates forward playback mode.
 |
property OnDVDPlaybackStopped: TNotifyEvent; |
Indicates that playback has been stopped. The DVD Navigator has completed playback of the title or chapter and did not find any other branching instruction for subsequent playback.
 |
property OnDVDPlayPeriodAutoStop: TNotifyEvent; |
Indicates that the Navigator has finished playing the segment specified in a call to PlayPeriodInTitleAutoStop.
 |
property OnDVDStillOff: TNotifyEvent; |
Signals the end of any still (PGC, Cell, or VOBU).
This event indicates that any currently active still has been released.
 |
property OnDVDStillOn: TOnDVDStillOn; |
Signals the beginning of any still (PGC, Cell, or VOBU). All combinations of buttons and still are possible (buttons on with still on, buttons on with still off, button off with still on, button off with still off).
NoButtonAvailable: Boolean value indicating whether buttons are available. False indicates buttons are available so the IDvdControl2.StillOff method won't work. True indicates no buttons are available, so IDvdControl2.StillOff will work.
seconds: value indicating the number of seconds the still will last. $FFFFFFFF indicates an infinite still, meaning wait until the user presses a button or until the application calls IDvdControl2.StillOff.
 |
property OnDVDSubpictureStreamChange: TOnDVDSubpictureStreamChange; |
Signals that the current subpicture stream number changed for the main title.
The subpicture can change automatically with a navigation command authored on disc as well as through application control using IDvdControl2.
SubNum: value indicating the new user subpicture stream number. Subpicture stream numbers range from 0 to 31. Stream $FFFFFFFF indicates that no stream is selected.
lcid: Language identifier.
Lang: Language string.
 |
property OnDVDTitleChange: TOnDVDTitleChange; |
Indicates when the current title number changes.
Title numbers range from 1 to 99. This number indicates the TTN, which is the title number with respect to the whole disc, not the VTS_TTN which is the title number with respect to just a current VTS.
Title: value indicating the new title number.
 |
property OnDVDValidUOPSChange: TOnDVDValidUOPSChange; |
Signals that the available set of IDvdControl2 interface methods has changed.
UOPS: value representing a ULONG whose bits indicate which IDvdControl2 commands the DVD disc explicitly disabled.
 |
property OnDVDWarningFormatNotSupported: TNotifyEvent; |
A decoder would not support the current format. Playback of a stream (audio, video or subpicture) might not function.
 |
property OnDVDWarningIllegalNavCommand: TNotifyEvent; |
The internal DVD navigation command processor attempted to process an illegal command.
 |
property OnDVDWarningInvalidDVD1_0Disc: TNotifyEvent; |
DVD-Video disc is authored incorrectly. Playback can continue, but unexpected behavior might occur.
 |
property OnDVDWarningOpen: TNotifyEvent; |
File Open failed.
 |
property OnDVDWarningRead: TNotifyEvent; |
File Read failed.
 |
property OnDVDWarningSeek: TNotifyEvent; |
File Seek failed.
 |
property OnGraphBufferingData: TOnGraphBufferingData; |
The graph is buffering data, or has stopped buffering data. A filter can send this event if it needs to buffer data from an external source. (for example, it might be loading data from a network.) The application can use this event to adjust its user interface.
buffering: TRUE if the graph is starting to buffer, or FALSE if the graph has stopped buffering.
 |
property OnGraphChanged: TNotifyEvent; |
The filter graph has changed. This event code is intended for debugging. It is not sent for all graph changes.
 |
property OnGraphClockChanged: TNotifyEvent; |
The reference clock has changed. The filter graph manager sends this event when its IMediaFilter.SetSyncSource method is called.
 |
property OnGraphClockUnset: TNotifyEvent; |
The clock provider was disconnected.
KSProxy signals this event when the pin of a clock-providing filter is disconnected.
 |
property OnGraphComplete: TOnGraphComplete; |
All data from a particular stream has been rendered. By default, the filter graph manager does not forward this event to the application. However, after all the streams in the graph report EC_COMPLETE, the filter graph manager posts a separate EC_COMPLETE event to the application.
Result: HRESULT value; can be S_OK.
Renderer: nil, or a reference to the renderer's IBaseFilter interface.
 |
property OnGraphDeviceLost: TOnGraphDeviceLost; |
A Plug and Play device was removed or became available again. When the device becomes available again, the previous state of the device filter is no longer valid. The application must rebuild the graph in order to use the device.
Device: IUnknown interface of the filter that represents the device.
Removed: True if the device was removed, or False if the device is available again.
 |
property OnGraphEndOfSegment: TOnGraphEndOfSegment; |
The end of a segment was reached. This event code supports seamless looping. When a call to the IMediaSeeking.SetPositions method includes the AM_SEEKING_Segment flag, the source filter sends this event code instead of calling IPin.EndOfStream.
StreamTime: TREFERENCE_TIME value that specifies the accumulated stream time since the start of the segment.
NumSegment: Cardinal value indicating the segment number (zero-based).
 |
property OnGraphErrorAbort: TOnDSResult; |
An operation was aborted because of an error.
Result: value of the operation that failed.
 |
property OnGraphErrorStillPlaying: TOnDSResult; |
An asynchronous command to run the graph has failed. if the filter graph manager issues an asynchronous run command that fails, it sends this event to the application. The graph remains in a running state. The state of the underlying filters is indeterminate. Some filters might be running, others might not.
Result: value of the operation that failed.
 |
property OnGraphEXTDeviceModeChange: TOnGraphEXTDeviceModeChange; |
Sent by filter supporting IAMExtDevice.
NewMode: the new mode
DeviceID: the device ID of the sending object
 |
property OnGraphFullscreenLost: TOnGraphFullscreenLost; |
The video renderer is switching out of full-screen mode. When the Full Screen Renderer loses activation, it sends this event. When another video renderer switches out of full-screen mode, the filter graph manager sends this event, in response to an EC_ACTIVATE event from the renderer.
Renderer: the video renderer's IBaseFilter interface, or nil.
 |
property OnGraphOleEvent: TOnGraphOleEvent; |
A filter is passing a text string to the application. By convention, the first parameter contains type information (for example, Text) and the second parameter contains the text string.
String1, String2: Wide Strings
 |
property OnGraphOpeningFile: TOnGraphOpeningFile; |
The graph is opening a file, or has finished opening a file. A filter can send this event if it spends significant time opening a file. (for example, the file might be located on a network.) The application can use this event to adjust its user interface.
opening: TRUE if the graph is starting to open a file, or FALSE if the graph is no longer opening the file.
 |
property OnGraphPaletteChanged: TNotifyEvent; |
The video palette has changed. Video renderers send this event if they detect a palette change in the stream.
 |
property OnGraphPaused: TOnDSResult; |
A pause request has completed. The filter graph manager sends this event when it completes an asynchronous pause command.
Result: value that indicates the result of the transition. if the value is S_OK, the filter graph is now in a paused state.
 |
property OnGraphQualityChange: TNotifyEvent; |
The graph is dropping samples, for quality control. A filter sends this event if it drops samples in response to a quality control message. It sends the event only when it adjusts the quality level, not for each sample that it drops.
 |
property OnGraphSNDDevInError: TOnGraphSNDDevError; |
An audio device error occurred on an input pin.
OccurWhen: value from the TSNDDEV_ERR enumerated type, indicating how the device was being accessed when the failure occurred.
ErrorCode: value indicating the error returned from the sound device call.
 |
property OnGraphSNDDevOutError: TOnGraphSNDDevError; |
An audio device error occurred on an output pin.
OccurWhen: value from the TSNDDEV_ERR enumerated type, indicating how the device was being accessed when the failure occurred.
ErrorCode: value indicating the error returned from the sound device call.
 |
property OnGraphStepComplete: TNotifyEvent; |
A filter has completed frame stepping. The filter graph manager pauses the graph and passes the event to the application.
 |
property OnGraphStreamControlStarted: TOnGraphStreamControl; |
A stream-control start command has taken effect. Filters send this event in response to the IAMStreamControl.StartAt method. This method specifies a reference time for a pin to begin streaming. When streaming does begin, the filter sends this event.
PinSender parameter specifies the pin that executes the start command. Depending on the implementation, it might not be the pin that received the StartAt call.
Cookie parameter is specified by the application in the StartAt method. This parameter enables the application to track multiple calls to the method.
 |
property OnGraphStreamControlStopped: TOnGraphStreamControl; |
A stream-control start command has taken effect. Filters send this event in response to the IAMStreamControl.StopAt method. This method specifies a reference time for a pin to stop streaming. When streaming does halt, the filter sends this event.
PinSender parameter specifies the pin that executes the stop command. Depending on the implementation, it might not be the pin that received the StopAt call.
Cookie parameter is specified by the application in the StopAt method. This parameter enables the application to track multiple calls to the method.
 |
property OnGraphStreamErrorStillPlaying: TOnGraphStreamError; |
An error occurred in a stream, but the stream is still playing.
Operation: HRESULT of the operation that failed.
Value: LongWord value, generally zero.
 |
property OnGraphStreamErrorStopped: TOnGraphStreamError; |
A stream has stopped because of an error.
Operation: HRESULT of the operation that failed.
Value: LongWord value, generally zero.
 |
property OnGraphTimeCodeAvailable: TOnGraphTimeCodeAvailable; |
Sent by filter supporting timecode.
From: sending object.
DeviceID: device ID of the sending object
 |
property OnGraphUserAbort: TNotifyEvent; |
The user has terminated playback.
This event code signals that the user has terminated normal graph playback. for example, video renderers send this event if the user closes the video window.
After sending this event, the filter should reject all samples and not send any EC_REPAINT events, until the filter stops and is reset.
 |
property OnGraphVideoSizeChanged: TOnGraphVideoSizeChanged; |
The native video size has changed.
width: new width, in pixels.
height: new height, in pixels.
 |
property OnGraphVMRRenderDevice: TOnGraphVMRRenderDevice; |
Identifies the type of rendering mechanism the VMR is using to display video.
 |
property Rate: Double; |
Retrieve/Set the rate.
 |
property SeekCapabilities: TSeekingCaps; |
Retrieve the seeking capabilities.
 |
property State: TGraphState; |
Current state of the filter graph.
 |
property Volume: integer; |
The volume.
Generated by DIPasDoc 0.8.0 on Sun 1 Jun 2003 23:53:07