1
//------------------------------------------------------------------------------
4
// Desc: DirectShow base classes.
6
// Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
7
//------------------------------------------------------------------------------
10
// Base classes implementing IDispatch parsing for the basic control dual
11
// interfaces. Derive from these and implement just the custom method and
12
// property methods. We also implement CPosPassThru that can be used by
13
// renderers and transforms to pass by IMediaPosition and IMediaSeeking
18
// OLE Automation has different ideas of TRUE and FALSE
24
// It's possible that we could replace this class with CreateStdDispatch
32
CBaseDispatch() : m_pti(NULL) {}
35
/* IDispatch methods */
36
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
38
STDMETHODIMP GetTypeInfo(
42
__deref_out ITypeInfo ** pptinfo);
44
STDMETHODIMP GetIDsOfNames(
46
__in_ecount(cNames) LPOLESTR * rgszNames,
49
__out_ecount(cNames) DISPID * rgdispid);
53
class AM_NOVTABLE CMediaControl :
57
CBaseDispatch m_basedisp;
61
CMediaControl(const TCHAR *, LPUNKNOWN);
65
// override this to publicise our interfaces
66
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
68
/* IDispatch methods */
69
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
71
STDMETHODIMP GetTypeInfo(
74
__deref_out ITypeInfo ** pptinfo);
76
STDMETHODIMP GetIDsOfNames(
78
__in_ecount(cNames) LPOLESTR * rgszNames,
81
__out_ecount(cNames) DISPID * rgdispid);
88
__in DISPPARAMS * pdispparams,
89
__out_opt VARIANT * pvarResult,
90
__out_opt EXCEPINFO * pexcepinfo,
91
__out_opt UINT * puArgErr);
95
class AM_NOVTABLE CMediaEvent :
99
CBaseDispatch m_basedisp;
103
CMediaEvent(__in_opt LPCTSTR, __in_opt LPUNKNOWN);
107
// override this to publicise our interfaces
108
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
110
/* IDispatch methods */
111
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
113
STDMETHODIMP GetTypeInfo(
116
__deref_out ITypeInfo ** pptinfo);
118
STDMETHODIMP GetIDsOfNames(
120
__in_ecount(cNames) LPOLESTR * rgszNames,
123
__out_ecount(cNames) DISPID * rgdispid);
130
__in DISPPARAMS * pdispparams,
131
__out_opt VARIANT * pvarResult,
132
__out_opt EXCEPINFO * pexcepinfo,
133
__out_opt UINT * puArgErr);
137
class AM_NOVTABLE CMediaPosition :
138
public IMediaPosition,
141
CBaseDispatch m_basedisp;
146
CMediaPosition(__in_opt LPCTSTR, __in_opt LPUNKNOWN);
147
CMediaPosition(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT *phr);
151
// override this to publicise our interfaces
152
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
154
/* IDispatch methods */
155
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
157
STDMETHODIMP GetTypeInfo(
160
__deref_out ITypeInfo ** pptinfo);
162
STDMETHODIMP GetIDsOfNames(
164
__in_ecount(cNames) LPOLESTR * rgszNames,
167
__out_ecount(cNames) DISPID * rgdispid);
174
__in DISPPARAMS * pdispparams,
175
__out_opt VARIANT * pvarResult,
176
__out_opt EXCEPINFO * pexcepinfo,
177
__out_opt UINT * puArgErr);
182
// OA-compatibility means that we must use double as the RefTime value,
183
// and REFERENCE_TIME (essentially a LONGLONG) within filters.
184
// this class converts between the two
186
class COARefTime : public CRefTime {
192
COARefTime(CRefTime t)
197
COARefTime(REFERENCE_TIME t)
202
COARefTime(double d) {
203
m_time = (LONGLONG) (d * 10000000);
207
return double(m_time) / 10000000;
210
operator REFERENCE_TIME() {
214
COARefTime& operator=(const double& rd) {
215
m_time = (LONGLONG) (rd * 10000000);
219
COARefTime& operator=(const REFERENCE_TIME& rt) {
224
inline BOOL operator==(const COARefTime& rt)
226
return m_time == rt.m_time;
229
inline BOOL operator!=(const COARefTime& rt)
231
return m_time != rt.m_time;
234
inline BOOL operator < (const COARefTime& rt)
236
return m_time < rt.m_time;
239
inline BOOL operator > (const COARefTime& rt)
241
return m_time > rt.m_time;
244
inline BOOL operator >= (const COARefTime& rt)
246
return m_time >= rt.m_time;
249
inline BOOL operator <= (const COARefTime& rt)
251
return m_time <= rt.m_time;
254
inline COARefTime operator+(const COARefTime& rt)
256
return COARefTime(m_time + rt.m_time);
259
inline COARefTime operator-(const COARefTime& rt)
261
return COARefTime(m_time - rt.m_time);
264
inline COARefTime operator*(LONG l)
266
return COARefTime(m_time * l);
269
inline COARefTime operator/(LONG l)
271
return COARefTime(m_time / l);
275
// Prevent bugs from constructing from LONG (which gets
276
// converted to double and then multiplied by 10000000
278
LONG operator=(LONG);
282
// A utility class that handles IMediaPosition and IMediaSeeking on behalf
283
// of single-input pin renderers, or transform filters.
285
// Renderers will expose this from the filter; transform filters will
286
// expose it from the output pin and not the renderer.
288
// Create one of these, giving it your IPin* for your input pin, and delegate
289
// all IMediaPosition methods to it. It will query the input pin for
290
// IMediaPosition and respond appropriately.
292
// Call ForceRefresh if the pin connection changes.
294
// This class no longer caches the upstream IMediaPosition or IMediaSeeking
295
// it acquires it on each method call. This means ForceRefresh is not needed.
296
// The method is kept for source compatibility and to minimise the changes
297
// if we need to put it back later for performance reasons.
299
class CPosPassThru : public IMediaSeeking, public CMediaPosition
303
HRESULT GetPeer(__deref_out IMediaPosition **ppMP);
304
HRESULT GetPeerSeeking(__deref_out IMediaSeeking **ppMS);
308
CPosPassThru(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, IPin *);
311
HRESULT ForceRefresh() {
315
// override to return an accurate current position
316
virtual HRESULT GetMediaTime(__out LONGLONG *pStartTime, __out_opt LONGLONG *pEndTime) {
320
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid,__deref_out void **ppv);
322
// IMediaSeeking methods
323
STDMETHODIMP GetCapabilities( __out DWORD * pCapabilities );
324
STDMETHODIMP CheckCapabilities( __inout DWORD * pCapabilities );
325
STDMETHODIMP SetTimeFormat(const GUID * pFormat);
326
STDMETHODIMP GetTimeFormat(__out GUID *pFormat);
327
STDMETHODIMP IsUsingTimeFormat(const GUID * pFormat);
328
STDMETHODIMP IsFormatSupported( const GUID * pFormat);
329
STDMETHODIMP QueryPreferredFormat( __out GUID *pFormat);
330
STDMETHODIMP ConvertTimeFormat(__out LONGLONG * pTarget,
331
__in_opt const GUID * pTargetFormat,
333
__in_opt const GUID * pSourceFormat );
334
STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags
335
, __inout_opt LONGLONG * pStop, DWORD StopFlags );
337
STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop );
338
STDMETHODIMP GetCurrentPosition( __out LONGLONG * pCurrent );
339
STDMETHODIMP GetStopPosition( __out LONGLONG * pStop );
340
STDMETHODIMP SetRate( double dRate);
341
STDMETHODIMP GetRate( __out double * pdRate);
342
STDMETHODIMP GetDuration( __out LONGLONG *pDuration);
343
STDMETHODIMP GetAvailable( __out_opt LONGLONG *pEarliest, __out_opt LONGLONG *pLatest );
344
STDMETHODIMP GetPreroll( __out LONGLONG *pllPreroll );
346
// IMediaPosition properties
347
STDMETHODIMP get_Duration(__out REFTIME * plength);
348
STDMETHODIMP put_CurrentPosition(REFTIME llTime);
349
STDMETHODIMP get_StopTime(__out REFTIME * pllTime);
350
STDMETHODIMP put_StopTime(REFTIME llTime);
351
STDMETHODIMP get_PrerollTime(__out REFTIME * pllTime);
352
STDMETHODIMP put_PrerollTime(REFTIME llTime);
353
STDMETHODIMP get_Rate(__out double * pdRate);
354
STDMETHODIMP put_Rate(double dRate);
355
STDMETHODIMP get_CurrentPosition(__out REFTIME * pllTime);
356
STDMETHODIMP CanSeekForward(__out LONG *pCanSeekForward);
357
STDMETHODIMP CanSeekBackward(__out LONG *pCanSeekBackward);
360
HRESULT GetSeekingLongLong( HRESULT (__stdcall IMediaSeeking::*pMethod)( LONGLONG * ),
361
__out LONGLONG * pll );
365
// Adds the ability to return a current position
367
class CRendererPosPassThru : public CPosPassThru
369
CCritSec m_PositionLock; // Locks access to our position
370
LONGLONG m_StartMedia; // Start media time last seen
371
LONGLONG m_EndMedia; // And likewise the end media
372
BOOL m_bReset; // Have media times been set
376
// Used to help with passing media times through graph
378
CRendererPosPassThru(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, IPin *);
379
HRESULT RegisterMediaTime(IMediaSample *pMediaSample);
380
HRESULT RegisterMediaTime(LONGLONG StartTime,LONGLONG EndTime);
381
HRESULT GetMediaTime(__out LONGLONG *pStartTime,__out_opt LONGLONG *pEndTime);
382
HRESULT ResetMediaTime();
386
STDAPI CreatePosPassThru(
387
__in_opt LPUNKNOWN pAgg,
390
__deref_out IUnknown **ppPassThru
393
// A class that handles the IDispatch part of IBasicAudio and leaves the
394
// properties and methods themselves pure virtual.
396
class AM_NOVTABLE CBasicAudio : public IBasicAudio, public CUnknown
398
CBaseDispatch m_basedisp;
402
CBasicAudio(__in_opt LPCTSTR, __in_opt LPUNKNOWN);
406
// override this to publicise our interfaces
407
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
409
/* IDispatch methods */
410
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
412
STDMETHODIMP GetTypeInfo(
415
__deref_out ITypeInfo ** pptinfo);
417
STDMETHODIMP GetIDsOfNames(
419
__in_ecount(cNames) LPOLESTR * rgszNames,
422
__out_ecount(cNames) DISPID * rgdispid);
429
__in DISPPARAMS * pdispparams,
430
__out_opt VARIANT * pvarResult,
431
__out_opt EXCEPINFO * pexcepinfo,
432
__out_opt UINT * puArgErr);
436
// A class that handles the IDispatch part of IBasicVideo and leaves the
437
// properties and methods themselves pure virtual.
439
class AM_NOVTABLE CBaseBasicVideo : public IBasicVideo2, public CUnknown
441
CBaseDispatch m_basedisp;
445
CBaseBasicVideo(__in_opt LPCTSTR, __in_opt LPUNKNOWN);
449
// override this to publicise our interfaces
450
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
452
/* IDispatch methods */
453
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
455
STDMETHODIMP GetTypeInfo(
458
__deref_out ITypeInfo ** pptinfo);
460
STDMETHODIMP GetIDsOfNames(
462
__in_ecount(cNames) LPOLESTR * rgszNames,
465
__out_ecount(cNames) DISPID * rgdispid);
472
__in DISPPARAMS * pdispparams,
473
__out_opt VARIANT * pvarResult,
474
__out_opt EXCEPINFO * pexcepinfo,
475
__out_opt UINT * puArgErr);
477
STDMETHODIMP GetPreferredAspectRatio(
478
__out long *plAspectX,
479
__out long *plAspectY)
486
// A class that handles the IDispatch part of IVideoWindow and leaves the
487
// properties and methods themselves pure virtual.
489
class AM_NOVTABLE CBaseVideoWindow : public IVideoWindow, public CUnknown
491
CBaseDispatch m_basedisp;
495
CBaseVideoWindow(__in_opt LPCTSTR, __in_opt LPUNKNOWN);
499
// override this to publicise our interfaces
500
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
502
/* IDispatch methods */
503
STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);
505
STDMETHODIMP GetTypeInfo(
508
__deref_out ITypeInfo ** pptinfo);
510
STDMETHODIMP GetIDsOfNames(
512
__in_ecount(cNames) LPOLESTR * rgszNames,
515
__out_ecount(cNames) DISPID * rgdispid);
522
__in DISPPARAMS * pdispparams,
523
__out_opt VARIANT * pvarResult,
524
__out_opt EXCEPINFO * pexcepinfo,
525
__out_opt UINT * puArgErr);
529
// abstract class to help source filters with their implementation
530
// of IMediaPosition. Derive from this and set the duration (and stop
531
// position). Also override NotifyChange to do something when the properties
534
class AM_NOVTABLE CSourcePosition : public CMediaPosition
538
CSourcePosition(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, __in CCritSec *);
540
// IMediaPosition methods
541
STDMETHODIMP get_Duration(__out REFTIME * plength);
542
STDMETHODIMP put_CurrentPosition(REFTIME llTime);
543
STDMETHODIMP get_StopTime(__out REFTIME * pllTime);
544
STDMETHODIMP put_StopTime(REFTIME llTime);
545
STDMETHODIMP get_PrerollTime(__out REFTIME * pllTime);
546
STDMETHODIMP put_PrerollTime(REFTIME llTime);
547
STDMETHODIMP get_Rate(__out double * pdRate);
548
STDMETHODIMP put_Rate(double dRate);
549
STDMETHODIMP CanSeekForward(__out LONG *pCanSeekForward);
550
STDMETHODIMP CanSeekBackward(__out LONG *pCanSeekBackward);
552
// override if you can return the data you are actually working on
553
STDMETHODIMP get_CurrentPosition(__out REFTIME * pllTime) {
559
// we call this to notify changes. Override to handle them
560
virtual HRESULT ChangeStart() PURE;
561
virtual HRESULT ChangeStop() PURE;
562
virtual HRESULT ChangeRate() PURE;
564
COARefTime m_Duration;
572
class AM_NOVTABLE CSourceSeeking :
573
public IMediaSeeking,
580
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);
582
// IMediaSeeking methods
584
STDMETHODIMP IsFormatSupported(const GUID * pFormat);
585
STDMETHODIMP QueryPreferredFormat(__out GUID *pFormat);
586
STDMETHODIMP SetTimeFormat(const GUID * pFormat);
587
STDMETHODIMP IsUsingTimeFormat(const GUID * pFormat);
588
STDMETHODIMP GetTimeFormat(__out GUID *pFormat);
589
STDMETHODIMP GetDuration(__out LONGLONG *pDuration);
590
STDMETHODIMP GetStopPosition(__out LONGLONG *pStop);
591
STDMETHODIMP GetCurrentPosition(__out LONGLONG *pCurrent);
592
STDMETHODIMP GetCapabilities( __out DWORD * pCapabilities );
593
STDMETHODIMP CheckCapabilities( __inout DWORD * pCapabilities );
594
STDMETHODIMP ConvertTimeFormat( __out LONGLONG * pTarget,
595
__in_opt const GUID * pTargetFormat,
597
__in_opt const GUID * pSourceFormat );
599
STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags
600
, __inout_opt LONGLONG * pStop, DWORD StopFlags );
602
STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop );
604
STDMETHODIMP GetAvailable( __out_opt LONGLONG * pEarliest, __out_opt LONGLONG * pLatest );
605
STDMETHODIMP SetRate( double dRate);
606
STDMETHODIMP GetRate( __out double * pdRate);
607
STDMETHODIMP GetPreroll(__out LONGLONG *pPreroll);
613
CSourceSeeking(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, __in CCritSec *);
615
// we call this to notify changes. Override to handle them
616
virtual HRESULT ChangeStart() PURE;
617
virtual HRESULT ChangeStop() PURE;
618
virtual HRESULT ChangeRate() PURE;
620
CRefTime m_rtDuration; // length of stream
621
CRefTime m_rtStart; // source will start here
622
CRefTime m_rtStop; // source will stop here
623
double m_dRateSeeking;
625
// seeking capabilities
626
DWORD m_dwSeekingCaps;
632
// Base classes supporting Deferred commands.
634
// Deferred commands are queued by calls to methods on the IQueueCommand
635
// interface, exposed by the filtergraph and by some filters. A successful
636
// call to one of these methods will return an IDeferredCommand interface
637
// representing the queued command.
639
// A CDeferredCommand object represents a single deferred command, and exposes
640
// the IDeferredCommand interface as well as other methods permitting time
641
// checks and actual execution. It contains a reference to the CCommandQueue
642
// object on which it is queued.
644
// CCommandQueue is a base class providing a queue of CDeferredCommand
645
// objects, and methods to add, remove, check status and invoke the queued
646
// commands. A CCommandQueue object would be part of an object that
647
// implemented IQueueCommand.
651
// take a copy of the params and store them. Release any allocated
652
// memory in destructor
654
class CDispParams : public DISPPARAMS
657
CDispParams(UINT nArgs, __in_ecount(nArgs) VARIANT* pArgs, __inout_opt HRESULT *phr = NULL);
662
// CDeferredCommand lifetime is controlled by refcounts. Caller of
663
// InvokeAt.. gets a refcounted interface pointer, and the CCmdQueue
664
// object also holds a refcount on us. Calling Cancel or Invoke takes
665
// us off the CCmdQueue and thus reduces the refcount by 1. Once taken
666
// off the queue we cannot be put back on the queue.
668
class CDeferredCommand
670
public IDeferredCommand
675
__inout CCmdQueue * pQ,
676
__in_opt LPUNKNOWN pUnk, // aggregation outer unk
677
__inout HRESULT * phr,
678
__in LPUNKNOWN pUnkExecutor, // object that will execute this cmd
684
__in_ecount(cArgs) VARIANT* pDispParams,
685
__out VARIANT* pvarResult,
686
__out short* puArgErr,
692
// override this to publicise our interfaces
693
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __out void **ppv);
695
// IDeferredCommand methods
696
STDMETHODIMP Cancel();
697
STDMETHODIMP Confidence(
698
__out LONG* pConfidence);
699
STDMETHODIMP Postpone(
701
STDMETHODIMP GetHResult(
702
__out HRESULT* phrResult);
704
// other public methods
710
// returns TRUE if streamtime, FALSE if presentation time
711
BOOL IsStreamTime() {
724
return m_dispidMethod;
731
DISPPARAMS* GetParams() {
732
return &m_DispParams;
735
VARIANT* GetResult() {
743
// pUnk for the interface that we will execute the command on
746
// stored command data
747
REFERENCE_TIME m_time;
751
VARIANT* m_pvarResult;
753
CDispParams m_DispParams;
754
DISPID m_DispId; // For get and put
756
// we use this for ITypeInfo access
757
CBaseDispatch m_Dispatch;
764
// a list of CDeferredCommand objects. this is a base class providing
765
// the basics of access to the list. If you want to use CDeferredCommand
766
// objects then your queue needs to be derived from this class.
768
class AM_NOVTABLE CCmdQueue
771
CCmdQueue(__inout_opt HRESULT *phr = NULL);
772
virtual ~CCmdQueue();
774
// returns a new CDeferredCommand object that will be initialised with
775
// the parameters and will be added to the queue during construction.
776
// returns S_OK if successfully created otherwise an error and
777
// no object has been queued.
779
__out CDeferredCommand **ppCmd,
786
__in_ecount(cArgs) VARIANT* pDispParams,
787
__out VARIANT* pvarResult,
788
__out short* puArgErr,
792
// called by the CDeferredCommand object to add and remove itself
794
virtual HRESULT Insert(__in CDeferredCommand* pCmd);
795
virtual HRESULT Remove(__in CDeferredCommand* pCmd);
797
// Command-Due Checking
799
// There are two schemes of synchronisation: coarse and accurate. In
800
// coarse mode, you wait till the time arrives and then execute the cmd.
801
// In accurate mode, you wait until you are processing the sample that
802
// will appear at the time, and then execute the command. It's up to the
803
// filter which one it will implement. The filtergraph will always
804
// implement coarse mode for commands queued at the filtergraph.
806
// If you want coarse sync, you probably want to wait until there is a
807
// command due, and then execute it. You can do this by calling
808
// GetDueCommand. If you have several things to wait for, get the
809
// event handle from GetDueHandle() and when this is signalled then call
810
// GetDueCommand. Stream time will only advance between calls to Run and
811
// EndRun. Note that to avoid an extra thread there is no guarantee that
812
// if the handle is set there will be a command ready. Each time the
813
// event is signalled, call GetDueCommand (probably with a 0 timeout);
814
// This may return E_ABORT.
816
// If you want accurate sync, you must call GetCommandDueFor, passing
817
// as a parameter the stream time of the samples you are about to process.
819
// -- a stream-time command due at or before that stream time
820
// -- a presentation-time command due at or before the
821
// time that stream time will be presented (only between Run
822
// and EndRun calls, since outside of this, the mapping from
823
// stream time to presentation time is not known.
824
// -- any presentation-time command due now.
825
// This means that if you want accurate synchronisation on samples that
826
// might be processed during Paused mode, you need to use
827
// stream-time commands.
829
// In all cases, commands remain queued until Invoked or Cancelled. The
830
// setting and resetting of the event handle is managed entirely by this
833
// set the clock used for timing
834
virtual HRESULT SetSyncSource(__in_opt IReferenceClock*);
836
// switch to run mode. Streamtime to Presentation time mapping known.
837
virtual HRESULT Run(REFERENCE_TIME tStreamTimeOffset);
839
// switch to Stopped or Paused mode. Time mapping not known.
840
virtual HRESULT EndRun();
842
// return a pointer to the next due command. Blocks for msTimeout
843
// milliseconds until there is a due command.
844
// Stream-time commands will only become due between Run and Endrun calls.
845
// The command remains queued until invoked or cancelled.
846
// Returns E_ABORT if timeout occurs, otherwise S_OK (or other error).
847
// Returns an AddRef-ed object
848
virtual HRESULT GetDueCommand(__out CDeferredCommand ** ppCmd, long msTimeout);
850
// return the event handle that will be signalled whenever
851
// there are deferred commands due for execution (when GetDueCommand
853
HANDLE GetDueHandle() {
854
return HANDLE(m_evDue);
857
// return a pointer to a command that will be due for a given time.
858
// Pass in a stream time here. The stream time offset will be passed
859
// in via the Run method.
860
// Commands remain queued until invoked or cancelled.
861
// This method will not block. It will report VFW_E_NOT_FOUND if there
862
// are no commands due yet.
863
// Returns an AddRef-ed object
864
virtual HRESULT GetCommandDueFor(REFERENCE_TIME tStream, __out CDeferredCommand**ppCmd);
866
// check if a given time is due (TRUE if it is due yet)
867
BOOL CheckTime(CRefTime time, BOOL bStream) {
869
// if no clock, nothing is due!
877
// not valid if not running
881
// add on known stream time offset to get presentation time
882
time += m_StreamTimeOffset;
886
m_pClock->GetTime((REFERENCE_TIME*)&Now);
887
return (time <= Now);
892
// protect access to lists etc
895
// commands queued in presentation time are stored here
896
CGenericList<CDeferredCommand> m_listPresentation;
898
// commands queued in stream time are stored here
899
CGenericList<CDeferredCommand> m_listStream;
901
// set when any commands are due
904
// creates an advise for the earliest time required, if any
905
void SetTimeAdvise(void);
907
// advise id from reference clock (0 if no outstanding advise)
908
DWORD_PTR m_dwAdvise;
910
// advise time is for this presentation time
911
CRefTime m_tCurrentAdvise;
913
// the reference clock we are using (addrefed)
914
IReferenceClock* m_pClock;
919
// contains stream time offset when m_bRunning is true
920
CRefTime m_StreamTimeOffset;
923
#endif // __CTLUTIL__