DSPack.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:221k
- (*********************************************************************
- * DSPack 2.3.3 *
- * *
- * home page : http://www.progdigy.com *
- * email : hgourvest@progdigy.com *
- * Thanks to Michael Andersen. (DSVideoWindowEx) *
- * *
- * date : 2003-09-08 *
- * *
- * The contents of this file are used with permission, subject to *
- * the Mozilla Public License Version 1.1 (the "License"); you may *
- * not use this file except in compliance with the License. You may *
- * obtain a copy of the License at *
- * http://www.mozilla.org/MPL/MPL-1.1.html *
- * *
- * Software distributed under the License is distributed on an *
- * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or *
- * implied. See the License for the specific language governing *
- * rights and limitations under the License. *
- * *
- * Contributor(s) *
- * Peter J. Haas <DSPack@pjh2.de> *
- * Andriy Nevhasymyy <a.n@email.com> *
- * Milenko Mitrovic <dcoder@dsp-worx.de> *
- * Michael Andersen <michael@mechdata.dk> *
- * Martin Offenwanger <coder@dsplayer.de> *
- * *
- *********************************************************************)
- {
- @abstract(DSPack Components.)
- @author(Henri Gourvest: hgourvest@progdigy.com)
- @created(Mar 14, 2002)
- @lastmod(Oct 24, 2003)
- }
- {$I jedi.inc}
- {$IFDEF COMPILER6_UP}
- {$WARN SYMBOL_DEPRECATED OFF}
- {$ENDIF}
- {$IFDEF COMPILER7_UP}
- {$WARN SYMBOL_DEPRECATED OFF}
- {$WARN UNSAFE_CODE OFF}
- {$WARN UNSAFE_TYPE OFF}
- {$WARN UNSAFE_CAST OFF}
- {$ENDIF}
- {$ALIGN ON}
- {$MINENUMSIZE 4}
- unit DSPack;
- interface
- uses
- Windows, Classes, SysUtils, Messages, Graphics, Forms, Controls, ActiveX, DirectShow9,
- DirectDraw, DSUtil, ComCtrls, MMSystem, Math, Consts, ExtCtrls,
- MultiMon, Dialogs, Registry, SyncObjs, Direct3D9, WMF9;
- const
- { Filter Graph message identifier. }
- WM_GRAPHNOTIFY = WM_APP + 1;
- { Sample Grabber message identifier. }
- WM_CAPTURE_BITMAP = WM_APP + 2;
- type
- { Video mode to use with @link(TVideoWindow). }
- TVideoMode = (
- vmNormal,
- vmVMR
- );
- { Graph Mode to use with @link(TFilterGraph).}
- TGraphMode = (
- gmNormal,
- gmCapture,
- gmDVD
- );
- { Render device returned by then OnGraphVMRRenderDevice event. }
- {$IFDEF VER140}
- TVMRRenderDevice = (
- rdOverlay = 1,
- rdVidMem = 2,
- rdSysMem = 4
- );
- {$ELSE}
- TVMRRenderDevice = Integer;
- const
- rdOverlay = 1;
- rdVidMem = 2;
- rdSysMem = 4;
- type
- {$ENDIF}
- {@exclude}
- TGraphState = (
- gsUninitialized,
- gsStopped,
- gsPaused,
- gsPlaying
- );
- { Specifies the seeking capabilities of a media stream. }
- TSeekingCap = (
- CanSeekAbsolute, // The stream can seek to an absolute position.
- CanSeekForwards, // The stream can seek forward.
- CanSeekBackwards, // The stream can seek backward.
- CanGetCurrentPos, // The stream can report its current position.
- CanGetStopPos, // The stream can report its stop position.
- CanGetDuration, // The stream can report its duration.
- CanPlayBackwards, // The stream can play backward.
- CanDoSegments, // The stream can do seamless looping (see IMediaSeeking.SetPositions).
- Source // Reserved.
- );
- { Specifies the seeking capabilities of a media stream. }
- TSeekingCaps = set of TSeekingCap;
- { Video Mixer Render Preferences: <br>
- <b>vpForceOffscreen:</b> Indicates that the VMR should use only offscreen surfaces for rendering.<br>
- <b>vpForceOverlays:</b> Indicates that the VMR should fail if no overlay surfaces are available.<br>
- <b>vpForceMixer:</b> Indicates that the VMR must use Mixer when the number of streams is 1.<br>
- <b>vpDoNotRenderColorKeyAndBorder:</b> Indicates that the application is responsible for painting the color keys.<br>
- <b>vpRestrictToInitialMonitor:</b> Indicates that the VMR should output only to the initial monitor.<br>
- <b>vpPreferAGPMemWhenMixing:</b> Indicates that the VMR should attempt to use AGP memory when allocating texture surfaces.}
- TVMRPreference = (
- vpForceOffscreen,
- vpForceOverlays,
- vpForceMixer,
- vpDoNotRenderColorKeyAndBorder,
- vpRestrictToInitialMonitor,
- vpPreferAGPMemWhenMixing
- );
- { Pointer to @link(TVMRPreferences).}
- PVMRPreferences = ^TVMRPreferences;
- { Set of @link(TVMRPreference).}
- TVMRPreferences = set of TVMRPreference;
- TOnDSEvent = procedure(sender: TComponent; Event, Param1, Param2: Integer) of object;
- {@exclude}
- TOnGraphBufferingData = procedure(sender: TObject; Buffering: boolean) of object ; {@exclude}
- TOnGraphComplete = procedure(sender: TObject; Result: HRESULT; Renderer: IBaseFilter) of object ; {@exclude}
- TOnGraphDeviceLost = procedure(sender: TObject; Device: IUnknown; Removed: Boolean) of object ; {@exclude}
- TOnGraphEndOfSegment = procedure(sender: TObject; StreamTime: TReferenceTime; NumSegment: Cardinal) of object ; {@exclude}
- TOnDSResult = procedure(sender: TObject; Result: HRESULT) of object ; {@exclude}
- TOnGraphFullscreenLost = procedure(sender: TObject; Renderer: IBaseFilter) of object ; {@exclude}
- TOnGraphOleEvent = procedure(sender: TObject; String1, String2: WideString) of object ; {@exclude}
- TOnGraphOpeningFile = procedure(sender: TObject; opening: boolean) of object ; {@exclude}
- TOnGraphSNDDevError = procedure(sender: TObject; OccurWhen: TSndDevErr; ErrorCode: LongWord) of object ; {@exclude}
- TOnGraphStreamControl = procedure(sender: TObject; PinSender: IPin; Cookie: LongWord) of object ; {@exclude}
- TOnGraphStreamError = procedure(sender: TObject; Operation: HRESULT; Value: LongWord) of object ; {@exclude}
- TOnGraphVideoSizeChanged = procedure(sender: TObject; Width, height: word) of object ; {@exclude}
- TOnGraphTimeCodeAvailable = procedure(sender: TObject; From: IBaseFilter; DeviceID: LongWord) of object ; {@exclude}
- TOnGraphEXTDeviceModeChange = procedure(sender: TObject; NewMode, DeviceID: LongWord) of object ; {@exclude}
- TOnGraphVMRRenderDevice = procedure(sender: TObject; RenderDevice: TVMRRenderDevice) of object;
- {@exclude}
- TOnDVDAudioStreamChange = procedure(sender: TObject; stream, lcid: Integer; Lang: string) of object; {@exclude}
- TOnDVDCurrentTime = procedure(sender: TObject; Hours, minutes,seconds,frames,frate : Integer) of object; {@exclude}
- TOnDVDTitleChange = procedure(sender: TObject; title: Integer) of object; {@exclude}
- TOnDVDChapterStart = procedure(sender: TObject; chapter: Integer) of object; {@exclude}
- TOnDVDValidUOPSChange = procedure(sender: TObject; UOPS: Integer) of object; {@exclude}
- TOnDVDChange = procedure(sender: TObject; total,current: Integer) of object; {@exclude}
- TOnDVDStillOn = procedure(sender: TObject; NoButtonAvailable: boolean; seconds: Integer) of object; {@exclude}
- TOnDVDSubpictureStreamChange = procedure(sender: TObject; SubNum, lcid: Integer; Lang: string) of object; {@exclude}
- TOnDVDPlaybackRateChange = procedure(sender: TObject; rate: single) of object; {@exclude}
- TOnDVDParentalLevelChange = procedure(sender: TObject; level: Integer) of object; {@exclude}
- TOnDVDAnglesAvailable = procedure(sender: TObject; available: boolean) of object; {@exclude}
- TOnDVDButtonAutoActivated = procedure(sender: TObject; Button: Cardinal) of object; {@exclude}
- TOnDVDCMD = procedure(sender: TObject; CmdID: Cardinal) of object; {@exclude}
- TOnDVDCurrentHMSFTime = procedure(sender: TObject; HMSFTimeCode: TDVDHMSFTimeCode; TimeCode: TDVDTimeCode) of object; {@exclude}
- TOnDVDKaraokeMode = procedure(sender: TObject; Played: boolean) of object;
- {@exclude}
- TOnBuffer = procedure(sender: TObject; SampleTime: Double; pBuffer: Pointer; BufferLen: longint) of object ;
- TOnSelectedFilter = function (Moniker: IMoniker; FilterName: WideString; ClassID: TGuid): Boolean of Object;
- TOnCreatedFilter = function (Filter: IBaseFilter; ClassID: TGuid): Boolean of Object;
- TOnUnableToRender = function (Pin: IPin): Boolean of Object;
- // *****************************************************************************
- // IFilter
- // *****************************************************************************
- {@exclude}
- TFilterOperation = (
- foAdding, // Before the filter is added to graph.
- foAdded, // After the filter is added to graph.
- foRemoving, // Before the filter is removed from graph.
- foRemoved, // After the filter is removed from graph.
- foRefresh // Designer notification to Refresh the filter .
- );
- {@exclude}
- IFilter = interface
- ['{887F94DA-29E9-44C6-B48E-1FBF0FB59878}']
- { Return the IBaseFilter Interface (All DirectShow filters expose this interface). }
- function GetFilter: IBaseFilter;
- { Return the filter name (generally the component name). }
- function GetName: string;
- { Called by the @link(TFilterGraph) component, this method receive notifications
- on what the TFilterGraph is doing. if Operation = foGraphEvent then Param is the
- event code received by the FilterGraph.}
- procedure NotifyFilter(operation: TFilterOperation; Param: integer = 0);
- end;
- {@exclude}
- TControlEvent = (
- cePlay,
- cePause,
- ceStop,
- ceFileRendering,
- ceFileRendered,
- ceDVDRendering,
- ceDVDRendered,
- ceActive
- );
- {@exclude}
- IEvent = interface
- ['{6C0DCD7B-1A98-44EF-A6D5-E23CBC24E620}']
- { FilterGraph events. }
- procedure GraphEvent(Event, Param1, Param2: integer);
- { Control Events. }
- procedure ControlEvent(Event: TControlEvent; Param: integer = 0);
- end;
- // *****************************************************************************
- // TFilterGraph
- // *****************************************************************************
- { This component is the central component in DirectShow, the Filter Graph
- handle synchronization, event notification, and other aspects of the
- controlling the filter graph. }
- TFilterGraph = class(TComponent, IAMGraphBuilderCallback, IAMFilterGraphCallback,
- IServiceProvider)
- private
- FActive : boolean;
- FAutoCreate : boolean;
- FHandle : THandle; // to capture events
- FMode : TGraphMode;
- FVolume : integer;
- FBalance : integer;
- FRate : Double;
- FLinearVolume : Boolean;
- FFilters: TInterfaceList;
- FGraphEvents: TInterfaceList;
- // builders
- FFilterGraph : IGraphBuilder;
- FCaptureGraph : ICaptureGraphBuilder2;
- FDVDGraph : IDvdGraphBuilder;
- // events interface
- FMediaEventEx : IMediaEventEx;
- // Graphedit
- FGraphEdit : boolean;
- FGraphEditID : Integer;
- // Log File
- FLogFileName: String;
- FLogFile: TFileStream;
- FOnActivate: TNotifyEvent;
- // All Events Code
- FOnDSEvent : TOnDSEvent;
- // Generic Graph Events
- FOnGraphBufferingData : TOnGraphBufferingData;
- FOnGraphClockChanged : TNotifyEvent;
- FOnGraphComplete : TOnGraphComplete;
- FOnGraphDeviceLost : TOnGraphDeviceLost;
- FOnGraphEndOfSegment : TOnGraphEndOfSegment;
- FOnGraphErrorStillPlaying : TOnDSResult;
- FOnGraphErrorAbort : TOnDSResult;
- FOnGraphFullscreenLost : TOnGraphFullscreenLost;
- FOnGraphChanged : TNotifyEvent;
- FOnGraphOleEvent : TOnGraphOleEvent;
- FOnGraphOpeningFile : TOnGraphOpeningFile;
- FOnGraphPaletteChanged : TNotifyEvent;
- FOnGraphPaused : TOnDSResult;
- FOnGraphQualityChange : TNotifyEvent;
- FOnGraphSNDDevInError : TOnGraphSNDDevError;
- FOnGraphSNDDevOutError : TOnGraphSNDDevError;
- FOnGraphStepComplete : TNotifyEvent;
- FOnGraphStreamControlStarted : TOnGraphStreamControl;
- FOnGraphStreamControlStopped : TOnGraphStreamControl;
- FOnGraphStreamErrorStillPlaying : TOnGraphStreamError;
- FOnGraphStreamErrorStopped : TOnGraphStreamError;
- FOnGraphUserAbort : TNotifyEvent;
- FOnGraphVideoSizeChanged : TOnGraphVideoSizeChanged;
- FOnGraphTimeCodeAvailable : TOnGraphTimeCodeAvailable;
- FOnGraphEXTDeviceModeChange : TOnGraphEXTDeviceModeChange;
- FOnGraphClockUnset : TNotifyEvent;
- FOnGraphVMRRenderDevice : TOnGraphVMRRenderDevice;
- FOnDVDAudioStreamChange : TOnDVDAudioStreamChange;
- FOnDVDCurrentTime : TOnDVDCurrentTime;
- FOnDVDTitleChange : TOnDVDTitleChange;
- FOnDVDChapterStart : TOnDVDChapterStart;
- FOnDVDAngleChange : TOnDVDChange;
- FOnDVDValidUOPSChange : TOnDVDValidUOPSChange;
- FOnDVDButtonChange : TOnDVDChange;
- FOnDVDChapterAutoStop : TNotifyEvent;
- FOnDVDStillOn : TOnDVDStillOn;
- FOnDVDStillOff : TNotifyEvent;
- FOnDVDSubpictureStreamChange : TOnDVDSubpictureStreamChange;
- FOnDVDNoFP_PGC : TNotifyEvent;
- FOnDVDPlaybackRateChange : TOnDVDPlaybackRateChange;
- FOnDVDParentalLevelChange : TOnDVDParentalLevelChange;
- FOnDVDPlaybackStopped : TNotifyEvent;
- FOnDVDAnglesAvailable : TOnDVDAnglesAvailable;
- FOnDVDPlayPeriodAutoStop : TNotifyEvent;
- FOnDVDButtonAutoActivated : TOnDVDButtonAutoActivated;
- FOnDVDCMDStart : TOnDVDCMD;
- FOnDVDCMDEnd : TOnDVDCMD;
- FOnDVDDiscEjected : TNotifyEvent;
- FOnDVDDiscInserted : TNotifyEvent;
- FOnDVDCurrentHMSFTime : TOnDVDCurrentHMSFTime;
- FOnDVDKaraokeMode : TOnDVDKaraokeMode;
- // DVD Warning
- FOnDVDWarningInvalidDVD1_0Disc : TNotifyEvent;//=1,
- FOnDVDWarningFormatNotSupported : TNotifyEvent;//=2,
- FOnDVDWarningIllegalNavCommand : TNotifyEvent;//=3
- FOnDVDWarningOpen : TNotifyEvent;//=4
- FOnDVDWarningSeek : TNotifyEvent;//=5
- FOnDVDWarningRead : TNotifyEvent;//=6
- // DVDDomain
- FOnDVDDomainFirstPlay : TNotifyEvent;
- FOnDVDDomainVideoManagerMenu : TNotifyEvent;
- FOnDVDDomainVideoTitleSetMenu : TNotifyEvent;
- FOnDVDDomainTitle : TNotifyEvent;
- FOnDVDDomainStop : TNotifyEvent;
- // DVDError
- FOnDVDErrorUnexpected : TNotifyEvent;
- FOnDVDErrorCopyProtectFail : TNotifyEvent;
- FOnDVDErrorInvalidDVD1_0Disc : TNotifyEvent;
- FOnDVDErrorInvalidDiscRegion : TNotifyEvent;
- FOnDVDErrorLowParentalLevel : TNotifyEvent;
- FOnDVDErrorMacrovisionFail : TNotifyEvent;
- FOnDVDErrorIncompatibleSystemAndDecoderRegions : TNotifyEvent;
- FOnDVDErrorIncompatibleDiscAndDecoderRegions : TNotifyEvent;
- FOnSelectedFilter: TOnSelectedFilter;
- FOnCreatedFilter: TOnCreatedFilter;
- FOnUnableToRender: TOnUnableToRender;
- procedure HandleEvents;
- procedure WndProc(var Msg: TMessage);
- procedure SetActive(Activate: boolean);
- procedure SetGraphMode(Mode: TGraphMode);
- procedure SetGraphEdit(enable: boolean);
- procedure ClearOwnFilters;
- procedure AddOwnFilters;
- procedure GraphEvents(Event, Param1, Param2: integer);
- procedure ControlEvents(Event: TControlEvent; Param: integer = 0);
- procedure SetLogFile(FileName: String);
- function GetState: TGraphState;
- procedure SetState(Value: TGraphState);
- procedure SetVolume(Volume: Integer);
- procedure SetBalance(Balance: integer);
- function GetSeekCaps: TSeekingCaps;
- procedure SetRate(Rate: double);
- function GetDuration: integer;
- procedure SetLinearVolume(aEnabled: Boolean);
- procedure UpdateGraph;
- // IAMGraphBuilderCallback
- function SelectedFilter(pMon: IMoniker): HResult; stdcall;
- function CreatedFilter(pFil: IBaseFilter): HResult; stdcall;
- // IAMFilterGraphCallback
- function UnableToRender(ph1, ph2: integer; pPin: IPin): HResult; // thiscall
- protected
- {@exclude}
- procedure DoEvent(Event, Param1, Param2: Integer); virtual;
- {@exclude}
- procedure InsertFilter(AFilter: IFilter);
- {@exclude}
- procedure RemoveFilter(AFilter: IFilter);
- {@exclude}
- procedure InsertEventNotifier(AEvent: IEvent);
- {@exclude}
- procedure RemoveEventNotifier(AEvent: IEvent);
- {@exclude}
- function QueryService(const rsid, iid: TGuid; out Obj): HResult; stdcall;
- public
- { Retrieve the total duration of a stream. }
- property Duration: Integer read GetDuration;
- { Retrieve/Set the rate. }
- property Rate: Double read fRate write SetRate;
- { Retrieve the seeking capabilities. }
- property SeekCapabilities: TSeekingCaps read GetSeekCaps;
- { The volume balance. }
- property Balance: integer read fBalance write SetBalance;
- { The volume. }
- property Volume: integer read fVolume write SetVolume;
- { Current state of the filter graph. }
- property State: TGraphState read GetState write SetState;
- { TFilterGraph constructor. }
- constructor Create(AOwner: TComponent); override;
- { TFilterGraph destructor. }
- destructor Destroy; override;
- { @exclude}
- procedure Loaded; override;
- { Retrieve an Interface from the current Graph.<br>
- <b>ex: </b> (FilterGraph <b>as</b> IGraphBuilder).RenderFile('C:speedis.avi', <b>nil</b>);<br>
- <b>Remark: </b> The interfaces you can Query depend of the @link(Mode) you
- have defined.<br>
- <b>gmNormal: </b>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. <br>
- <b>gmCapture: </b> all gmNormal interfaces and ICaptureGraphBuilder2.<br>
- <b>gmDVD: </b> all gmNormal interfaces and IDvdGraphBuilder, IDvdControl2,
- IDvdInfo2, IAMLine21Decoder.}
- function QueryInterface(const IID: TGUID; out Obj): HResult; override; stdcall;
- { 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 Play: boolean;
- { The Pause method pauses all the filters in the filter graph. }
- function Pause: boolean;
- { The Stop method stops all the filters in the graph. }
- function Stop: boolean;
- { This method disconnect all pins.}
- procedure DisconnectFilters;
- { Disconnect and remove all filters from the filter graph excepting the custom components. }
- procedure ClearGraph;
- { Render a single file. }
- function RenderFile(FileName: WideString): HRESULT;
- function RenderFileEx(FileName: WideString): HRESULT;
- { Render a DVD Video Volume or a File Name if specified. }
- function RenderDVD(out status: TAMDVDRenderStatus;
- FileName: WideString = ''; Mode: Integer = AM_DVD_HWDEC_PREFER): HRESULT;
- { Save the current state and position of a DVD movie to a file.<br>
- See also: @link(DVDRestoreBookmark).}
- procedure DVDSaveBookmark(BookMarkFile: WideString);
- { Restore the State and position of a DVD movie saved by @link(DVDSaveBookmark).}
- procedure DVDRestoreBookmark(BookMarkFile: WideString);
- published
- { Specify a File Name to save the Filter Graph Log. }
- property LogFile: String read FLogFileName write SetLogFile;
- { Activate the Filter Graph.}
- property Active: boolean read FActive write SetActive default False;
- { Auto-Activate the Filter Graph when component is created.}
- property AutoCreate: boolean read FAutoCreate write FAutoCreate default False;
- { There is 3 modes: gmNormal, gmCapture and gmDVD. <br>
- See also: @link(GraphInterFace).}
- property Mode: TGraphMode read FMode write SetGraphMode default gmNormal;
- { if true you can use GraphEdit application to connect with the Filter Graph.}
- property GraphEdit: boolean read FGraphEdit write SetGraphEdit;
- { if true, Volume and Balance is set by using a linear algorythm instead of
- logatithmic. }
- property LinearVolume: Boolean read FLinearVolume write SetLinearVolume;
- // -------------------------------------------------------------------------
- // Events
- // -------------------------------------------------------------------------
- property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
- { Generic Filter Graph event.<br>
- <b>Event:</b> message sent.<br>
- <b>Param1:</b> first message parameter.<br>
- <b>Param2:</b> second message parameter.}
- property OnDSEvent: TOnDSEvent read FOnDSEvent write FOnDSEvent;
- { 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.<br>
- <b>buffering:</b> TRUE if the graph is starting to buffer, or FALSE if
- the graph has stopped buffering. }
- property OnGraphBufferingData: TOnGraphBufferingData read FOnGraphBufferingData write FOnGraphBufferingData;
- { The reference clock has changed. The filter graph manager sends this event
- when its IMediaFilter.SetSyncSource method is called.}
- property OnGraphClockChanged: TNotifyEvent read FOnGraphClockChanged write FOnGraphClockChanged;
- { 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.<br>
- <b>Result:</b> HRESULT value; can be S_OK.<br>
- <b>Renderer:</b> nil, or a reference to the renderer's IBaseFilter interface.}
- property OnGraphComplete: TOnGraphComplete read FOnGraphComplete write FOnGraphComplete;
- { 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.<br>
- <b>Device:</b> IUnknown interface of the filter that represents the device.<br>
- <b>Removed:</b> True if the device was removed, or False if the device is available again.}
- property OnGraphDeviceLost: TOnGraphDeviceLost read FOnGraphDeviceLost write FOnGraphDeviceLost;
- { 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.<br>
- <b>StreamTime:</b> TREFERENCE_TIME value that specifies the accumulated stream time since the start of the segment.<br>
- <b>NumSegment:</b> Cardinal value indicating the segment number (zero-based).}
- property OnGraphEndOfSegment: TOnGraphEndOfSegment read FOnGraphEndOfSegment write FOnGraphEndOfSegment;
- { 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.<br>
- <b>Result:</b> value of the operation that failed.}
- property OnGraphErrorStillPlaying: TOnDSResult read FOnGraphErrorStillPlaying write FOnGraphErrorStillPlaying;
- { An operation was aborted because of an error.<br>
- <b>Result:</b> value of the operation that failed.}
- property OnGraphErrorAbort: TOnDSResult read FOnGraphErrorAbort write FOnGraphErrorAbort;
- { 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.<br>
- <b>Renderer:</b> the video renderer's IBaseFilter interface, or nil.}
- property OnGraphFullscreenLost: TOnGraphFullscreenLost read FOnGraphFullscreenLost write FOnGraphFullscreenLost;
- { The filter graph has changed.
- This event code is intended for debugging. It is not sent for all graph changes.}
- property OnGraphChanged: TNotifyEvent read FOnGraphChanged write FOnGraphChanged;
- { 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.<br>
- <b>String1, String2:</b> Wide Strings}
- property OnGraphOleEvent: TOnGraphOleEvent read FOnGraphOleEvent write FOnGraphOleEvent;
- { 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.<br>
- <b>opening:</b> TRUE if the graph is starting to open a file, or FALSE
- if the graph is no longer opening the file.}
- property OnGraphOpeningFile: TOnGraphOpeningFile read FOnGraphOpeningFile write FOnGraphOpeningFile;
- { The video palette has changed.
- Video renderers send this event if they detect a palette change in the stream.}
- property OnGraphPaletteChanged: TNotifyEvent read FOnGraphPaletteChanged write FOnGraphPaletteChanged;
- { A pause request has completed.
- The filter graph manager sends this event when it completes an asynchronous pause command.<br>
- <b>Result:</b> value that indicates the result of the transition. if the
- value is S_OK, the filter graph is now in a paused state.}
- property OnGraphPaused: TOnDSResult read FOnGraphPaused write FOnGraphPaused;
- { 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 OnGraphQualityChange: TNotifyEvent read FOnGraphQualityChange write FOnGraphQualityChange;
- { An audio device error occurred on an input pin.<br>
- <b>OccurWhen:</b> value from the TSNDDEV_ERR enumerated type, indicating how the device was being accessed when the failure occurred.<br>
- <b>ErrorCode:</b> value indicating the error returned from the sound device call.}
- property OnGraphSNDDevInError: TOnGraphSNDDevError read FOnGraphSNDDevInError write FOnGraphSNDDevInError;
- { An audio device error occurred on an output pin.<br>
- <b>OccurWhen:</b> value from the TSNDDEV_ERR enumerated type, indicating how the device was being accessed when the failure occurred.<br>
- <b>ErrorCode:</b> value indicating the error returned from the sound device call.}
- property OnGraphSNDDevOutError: TOnGraphSNDDevError read FOnGraphSNDDevOutError write FOnGraphSNDDevOutError;
- { A filter has completed frame stepping.
- The filter graph manager pauses the graph and passes the event to the application.}
- property OnGraphStepComplete: TNotifyEvent read FOnGraphStepComplete write FOnGraphStepComplete;
- { 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.<br>
- <b>PinSender</b> parameter specifies the pin that executes the start command.
- Depending on the implementation, it might not be the pin that
- received the StartAt call.<br>
- <b>Cookie</b> parameter is specified by the application in the StartAt method.
- This parameter enables the application to track multiple calls to the method.}
- property OnGraphStreamControlStarted: TOnGraphStreamControl read FOnGraphStreamControlStarted write FOnGraphStreamControlStarted;
- { 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.<br>
- <b>PinSender</b> parameter specifies the pin that executes the stop command.
- Depending on the implementation, it might not be the pin
- that received the StopAt call.<br>
- <b>Cookie</b> parameter is specified by the application in the StopAt method.
- This parameter enables the application to track multiple calls to the method.}
- property OnGraphStreamControlStopped: TOnGraphStreamControl read FOnGraphStreamControlStopped write FOnGraphStreamControlStopped;
- { An error occurred in a stream, but the stream is still playing.<br>
- <b>Operation:</b> HRESULT of the operation that failed.<br>
- <b>Value:</b> LongWord value, generally zero. }
- property OnGraphStreamErrorStillPlaying : TOnGraphStreamError read FOnGraphStreamErrorStillPlaying write FOnGraphStreamErrorStillPlaying;
- { A stream has stopped because of an error.<br>
- <b>Operation:</b> HRESULT of the operation that failed.<br>
- <b>Value:</b> LongWord value, generally zero. }
- property OnGraphStreamErrorStopped: TOnGraphStreamError read FOnGraphStreamErrorStopped write FOnGraphStreamErrorStopped;
- { The user has terminated playback.<br>
- 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.<br>
- 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 OnGraphUserAbort: TNotifyEvent read FOnGraphUserAbort write FOnGraphUserAbort;
- { The native video size has changed.<br>
- <b>width:</b> new width, in pixels.<br>
- <b>height:</b> new height, in pixels. }
- property OnGraphVideoSizeChanged: TOnGraphVideoSizeChanged read FOnGraphVideoSizeChanged write FOnGraphVideoSizeChanged;
- { Sent by filter supporting timecode.<br>
- <b>From:</b> sending object.<br>
- <b>DeviceID:</b> device ID of the sending object}
- property OnGraphTimeCodeAvailable: TOnGraphTimeCodeAvailable read FOnGraphTimeCodeAvailable write FOnGraphTimeCodeAvailable;
- { Sent by filter supporting IAMExtDevice.<br>
- <b>NewMode:</b> the new mode<br>
- <b>DeviceID:</b> the device ID of the sending object}
- property OnGraphEXTDeviceModeChange: TOnGraphEXTDeviceModeChange read FOnGraphEXTDeviceModeChange write FOnGraphEXTDeviceModeChange;
- { The clock provider was disconnected.<br>
- KSProxy signals this event when the pin of a clock-providing filter is disconnected.}
- property OnGraphClockUnset: TNotifyEvent read FOnGraphClockUnset write FOnGraphClockUnset;
- { Identifies the type of rendering mechanism the VMR is using to display video.}
- property OnGraphVMRRenderDevice: TOnGraphVMRRenderDevice read FOnGraphVMRRenderDevice write FOnGraphVMRRenderDevice;
- { Signals that the current audio stream number changed for the main title.<br>
- 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.<br>
- <b>stream:</b> value indicating the new user audio stream number. Audio stream numbers
- range from 0 to 7. Stream $FFFFFFFF indicates that no stream is selected.<br>
- <b>lcid:</b> Language identifier.<br>
- <b>Lang:</b> Language string. }
- property OnDVDAudioStreamChange: TOnDVDAudioStreamChange read FOnDVDAudioStreamChange write FOnDVDAudioStreamChange;
- { Deprecated, use @link(OnDVDCurrentHMSFTime) instead.<br>
- Signals the beginning of every video object unit (VOBU), a video segment
- which is 0.4 to 1.0 seconds in length.<br> }
- property OnDVDCurrentTime: TOnDVDCurrentTime read FOnDVDCurrentTime write FOnDVDCurrentTime;
- { Indicates when the current title number changes.<br>
- 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.<br>
- <b>Title:</b> value indicating the new title number.}
- property OnDVDTitleChange: TOnDVDTitleChange read FOnDVDTitleChange write FOnDVDTitleChange;
- { Signals that the DVD player started playback of a new program in the
- DVD_DOMAIN_Title domain.<br>
- Only simple linear movies signal this event.<br>
- <b>chapter:</b> value indicating the new chapter (program) number.}
- property OnDVDChapterStart: TOnDVDChapterStart read FOnDVDChapterStart write FOnDVDChapterStart;
- { Signals that either the number of available angles changed or that the
- current angle number changed.<br>
- 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.<br>
- <b>total:</b> value indicating the number of available angles. When the
- number of available angles is 1, the current video is not multiangle.<br>
- <b>current:</b> value indicating the current angle number.}
- property OnDVDAngleChange: TOnDVDChange read FOnDVDAngleChange write FOnDVDAngleChange;
- { Signals that the available set of IDvdControl2 interface methods has changed.<br>
- <b>UOPS:</b> value representing a ULONG whose bits indicate which IDvdControl2
- commands the DVD disc explicitly disabled. }
- property OnDVDValidUOPSChange: TOnDVDValidUOPSChange read FOnDVDValidUOPSChange write FOnDVDValidUOPSChange;
- { Signals that either the number of available buttons changed or that the
- currently selected button number changed.<br>
- 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.<br>
- <b>total:</b> value indicating the number of available buttons.<br>
- <b>current:</b> value indicating the currently selected button number.
- Selected button number zero implies that no button is selected.}
- property OnDVDButtonChange: TOnDVDChange read FOnDVDButtonChange write FOnDVDButtonChange;
- { Indicates that playback stopped as the result of a call to the
- IDvdControl2.PlayChaptersAutoStop method.}
- property OnDVDChapterAutoStop: TNotifyEvent read FOnDVDChapterAutoStop write FOnDVDChapterAutoStop;
- { 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).<br>
- <b>NoButtonAvailable</b>: 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.<br>
- <b>seconds</b>: 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 OnDVDStillOn: TOnDVDStillOn read FOnDVDStillOn write FOnDVDStillOn;
- { Signals the end of any still (PGC, Cell, or VOBU).<br>
- This event indicates that any currently active still has been released.}
- property OnDVDStillOff: TNotifyEvent read FOnDVDStillOff write FOnDVDStillOff;
- { Signals that the current subpicture stream number changed for the main title.<br>
- The subpicture can change automatically with a navigation command authored
- on disc as well as through application control using IDvdControl2.<br>
- <b>SubNum:</b> value indicating the new user subpicture stream number.
- Subpicture stream numbers range from 0 to 31. Stream $FFFFFFFF indicates
- that no stream is selected.<br>
- <b>lcid:</b> Language identifier.<br>
- <b>Lang:</b> Language string.}
- property OnDVDSubpictureStreamChange: TOnDVDSubpictureStreamChange read FOnDVDSubpictureStreamChange write FOnDVDSubpictureStreamChange;
- { 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 OnDVDNoFP_PGC: TNotifyEvent read FOnDVDNoFP_PGC write FOnDVDNoFP_PGC;
- { Signals that a rate change in the playback has been initiated.
- <b>rate:</b> indicate the new playback rate. rate < 0 indicates reverse playback
- mode. rate > 0 indicates forward playback mode.}
- property OnDVDPlaybackRateChange: TOnDVDPlaybackRateChange read FOnDVDPlaybackRateChange write FOnDVDPlaybackRateChange;
- { Signals that the parental level of the authored content is about to change.<br>
- The DVD Navigator source filter does not currently support "on the fly"
- parental level changes in response to SetTmpPML commands on a DVD disc.<br>
- <b>level:</b> value representing the new parental level set in the player.}
- property OnDVDParentalLevelChange: TOnDVDParentalLevelChange read FOnDVDParentalLevelChange write FOnDVDParentalLevelChange;
- { 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 OnDVDPlaybackStopped: TNotifyEvent read FOnDVDPlaybackStopped write FOnDVDPlaybackStopped;
- { Indicates whether an angle block is being played and angle changes can be performed.<br>
- Angle changes are not restricted to angle blocks and the manifestation of
- the angle change can be seen only in an angle block.<br>
- <b>available:</b> 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 OnDVDAnglesAvailable: TOnDVDAnglesAvailable read FOnDVDAnglesAvailable write FOnDVDAnglesAvailable;
- { Indicates that the Navigator has finished playing the segment specified
- in a call to PlayPeriodInTitleAutoStop.}
- property OnDVDPlayPeriodAutoStop: TNotifyEvent read FOnDVDPlayPeriodAutoStop write FOnDVDPlayPeriodAutoStop;
- { 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.<br>
- <b>Button</b>: value indicating the button that was activated.}
- property OnDVDButtonAutoActivated: TOnDVDButtonAutoActivated read FOnDVDButtonAutoActivated write FOnDVDButtonAutoActivated;
- { Signals that a particular command has begun.<br>
- <b>CmdID:</b> The Command ID and the HRESULT return value.}
- property OnDVDCMDStart: TOnDVDCMD read FOnDVDCMDStart Write FOnDVDCMDStart;
- { Signals that a particular command has completed.<br>
- <b>CmdID</b> The Command ID and the completion result.}
- property OnDVDCMDEnd: TOnDVDCMD read FOnDVDCMDEnd Write FOnDVDCMDEnd;
- { Signals that a disc was ejected.<br>
- Playback automatically stops when a disc is ejected. The application does
- not have to take any special action in response to this event.}
- property OnDVDDiscEjected: TNotifyEvent read FOnDVDDiscEjected Write FOnDVDDiscEjected;
- { Signals that a disc was inserted into the drive.<br>
- Playback automatically begins when a disc is inserted. The application does
- not have to take any special action in response to this event.}
- property OnDVDDiscInserted: TNotifyEvent read FOnDVDDiscInserted write FOnDVDDiscInserted;
- { 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.<br>
- 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.<br>
- <b>HMSFTimeCode:</b> HMS Time code structure.<br>
- <b>TimeCode:</b> old time format, do not use. }
- property OnDVDCurrentHMSFTime: TOnDVDCurrentHMSFTime read FOnDVDCurrentHMSFTime write FOnDVDCurrentHMSFTime;
- { Indicates that the Navigator has either begun playing or finished playing karaoke data.<br>
- The DVD player signals this event whenever it changes domains.<br>
- <b>Played:</b> TRUE means that a karaoke track is being played and FALSE means
- that no karaoke data is being played. }
- property OnDVDKaraokeMode: TOnDVDKaraokeMode read FOnDVDKaraokeMode write FOnDVDKaraokeMode;
- { Performing default initialization of a DVD disc.}
- property OnDVDDomainFirstPlay: TNotifyEvent read FOnDVDDomainFirstPlay write FOnDVDDomainFirstPlay;
- { Displaying menus for whole disc. }
- property OnDVDDomainVideoManagerMenu: TNotifyEvent read FOnDVDDomainVideoManagerMenu write FOnDVDDomainVideoManagerMenu;
- { Displaying menus for current title set. }
- property OnDVDDomainVideoTitleSetMenu: TNotifyEvent read FOnDVDDomainVideoTitleSetMenu write FOnDVDDomainVideoTitleSetMenu;
- { Displaying the current title. }
- property OnDVDDomainTitle: TNotifyEvent read FOnDVDDomainTitle write FOnDVDDomainTitle;
- { The DVD Navigator is in the DVD Stop domain.}
- property OnDVDDomainStop: TNotifyEvent read FOnDVDDomainStop write FOnDVDDomainStop;
- { Something unexpected happened; perhaps content is authored incorrectly.
- Playback is stopped.}
- property OnDVDErrorUnexpected: TNotifyEvent read FOnDVDErrorUnexpected write FOnDVDErrorUnexpected;
- { Key exchange for DVD copy protection failed. Playback is stopped. }
- property OnDVDErrorCopyProtectFail: TNotifyEvent read FOnDVDErrorCopyProtectFail write FOnDVDErrorCopyProtectFail;
- { DVD-Video disc is authored incorrectly for specification version 1.x.
- Playback is stopped.}
- property OnDVDErrorInvalidDVD1_0Disc: TNotifyEvent read FOnDVDErrorInvalidDVD1_0Disc write FOnDVDErrorInvalidDVD1_0Disc;
- { DVD-Video disc cannot be played because the disc is not authored to play in
- the system region. }
- property OnDVDErrorInvalidDiscRegion: TNotifyEvent read FOnDVDErrorInvalidDiscRegion write FOnDVDErrorInvalidDiscRegion;
- { Player parental level is lower than the lowest parental level available in
- the DVD content. Playback is stopped. }
- property OnDVDErrorLowParentalLevel: TNotifyEvent read FOnDVDErrorLowParentalLevel write FOnDVDErrorLowParentalLevel;
- { Macrovision