AJA NTV2 SDK  18.0.0.2717
NTV2 SDK 18.0.0.2717
renbase.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // File: RenBase.h
3 //
4 // Desc: DirectShow base classes - defines a generic ActiveX base renderer
5 // class.
6 //
7 // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved.
8 //------------------------------------------------------------------------------
9 
10 
11 #ifndef __RENBASE__
12 #define __RENBASE__
13 
14 // Forward class declarations
15 
16 class CBaseRenderer;
17 class CBaseVideoRenderer;
18 class CRendererInputPin;
19 
20 // This is our input pin class that channels calls to the renderer
21 
23 {
24 protected:
25 
27 
28 public:
29 
30  CRendererInputPin(__inout CBaseRenderer *pRenderer,
31  __inout HRESULT *phr,
32  __in_opt LPCWSTR Name);
33 
34  // Overriden from the base pin classes
35 
36  HRESULT BreakConnect();
37  HRESULT CompleteConnect(IPin *pReceivePin);
38  HRESULT SetMediaType(const CMediaType *pmt);
39  HRESULT CheckMediaType(const CMediaType *pmt);
40  HRESULT Active();
41  HRESULT Inactive();
42 
43  // Add rendering behaviour to interface functions
44 
45  STDMETHODIMP QueryId(__deref_out LPWSTR *Id);
46  STDMETHODIMP EndOfStream();
47  STDMETHODIMP BeginFlush();
48  STDMETHODIMP EndFlush();
49  STDMETHODIMP Receive(IMediaSample *pMediaSample);
50 
51  // Helper
52  IMemAllocator inline *Allocator() const
53  {
54  return m_pAllocator;
55  }
56 };
57 
58 // Main renderer class that handles synchronisation and state changes
59 
60 class CBaseRenderer : public CBaseFilter
61 {
62 protected:
63 
64  friend class CRendererInputPin;
65 
66  friend void CALLBACK EndOfStreamTimer(UINT uID, // Timer identifier
67  UINT uMsg, // Not currently used
68  DWORD_PTR dwUser, // User information
69  DWORD_PTR dw1, // Windows reserved
70  DWORD_PTR dw2); // Is also reserved
71 
72  CRendererPosPassThru *m_pPosition; // Media seeking pass by object
73  CAMEvent m_RenderEvent; // Used to signal timer events
74  CAMEvent m_ThreadSignal; // Signalled to release worker thread
75  CAMEvent m_evComplete; // Signalled when state complete
76  BOOL m_bAbort; // Stop us from rendering more data
77  BOOL m_bStreaming; // Are we currently streaming
78  DWORD_PTR m_dwAdvise; // Timer advise cookie
79  IMediaSample *m_pMediaSample; // Current image media sample
80  BOOL m_bEOS; // Any more samples in the stream
81  BOOL m_bEOSDelivered; // Have we delivered an EC_COMPLETE
82  CRendererInputPin *m_pInputPin; // Our renderer input pin object
83  CCritSec m_InterfaceLock; // Critical section for interfaces
84  CCritSec m_RendererLock; // Controls access to internals
85  IQualityControl * m_pQSink; // QualityControl sink
86  BOOL m_bRepaintStatus; // Can we signal an EC_REPAINT
87  // Avoid some deadlocks by tracking filter during stop
88  volatile BOOL m_bInReceive; // Inside Receive between PrepareReceive
89  // And actually processing the sample
90  REFERENCE_TIME m_SignalTime; // Time when we signal EC_COMPLETE
91  UINT m_EndOfStreamTimer; // Used to signal end of stream
92  CCritSec m_ObjectCreationLock; // This lock protects the creation and
93  // of m_pPosition and m_pInputPin. It
94  // ensures that two threads cannot create
95  // either object simultaneously.
96 
97 public:
98 
99  CBaseRenderer(REFCLSID RenderClass, // CLSID for this renderer
100  __in_opt LPCTSTR pName, // Debug ONLY description
101  __inout_opt LPUNKNOWN pUnk, // Aggregated owner object
102  __inout HRESULT *phr); // General OLE return code
103 
104  ~CBaseRenderer();
105 
106  // Overriden to say what interfaces we support and where
107 
108  virtual HRESULT GetMediaPositionInterface(REFIID riid, __deref_out void **ppv);
109  STDMETHODIMP NonDelegatingQueryInterface(REFIID, __deref_out void **);
110 
111  virtual HRESULT SourceThreadCanWait(BOOL bCanWait);
112 
113 #ifdef DEBUG
114  // Debug only dump of the renderer state
115  void DisplayRendererState();
116 #endif
117  virtual HRESULT WaitForRenderTime();
118  virtual HRESULT CompleteStateChange(FILTER_STATE OldState);
119 
120  // Return internal information about this filter
121 
122  BOOL IsEndOfStream() { return m_bEOS; };
124  BOOL IsStreaming() { return m_bStreaming; };
125  void SetAbortSignal(BOOL bAbort) { m_bAbort = bAbort; };
126  virtual void OnReceiveFirstSample(IMediaSample *pMediaSample) { };
128 
129  // Permit access to the transition state
130 
131  void Ready() { m_evComplete.Set(); };
132  void NotReady() { m_evComplete.Reset(); };
133  BOOL CheckReady() { return m_evComplete.Check(); };
134 
135  virtual int GetPinCount();
136  virtual CBasePin *GetPin(int n);
137  FILTER_STATE GetRealState();
138  void SendRepaint();
139  void SendNotifyWindow(IPin *pPin,HWND hwnd);
140  BOOL OnDisplayChange();
141  void SetRepaintStatus(BOOL bRepaint);
142 
143  // Override the filter and pin interface functions
144 
145  STDMETHODIMP Stop();
146  STDMETHODIMP Pause();
147  STDMETHODIMP Run(REFERENCE_TIME StartTime);
148  STDMETHODIMP GetState(DWORD dwMSecs, __out FILTER_STATE *State);
149  STDMETHODIMP FindPin(LPCWSTR Id, __deref_out IPin **ppPin);
150 
151  // These are available for a quality management implementation
152 
153  virtual void OnRenderStart(IMediaSample *pMediaSample);
154  virtual void OnRenderEnd(IMediaSample *pMediaSample);
155  virtual HRESULT OnStartStreaming() { return NOERROR; };
156  virtual HRESULT OnStopStreaming() { return NOERROR; };
157  virtual void OnWaitStart() { };
158  virtual void OnWaitEnd() { };
159  virtual void PrepareRender() { };
160 
161 #ifdef PERF
162  REFERENCE_TIME m_trRenderStart; // Just before we started drawing
163  // Set in OnRenderStart, Used in OnRenderEnd
164  int m_idBaseStamp; // MSR_id for frame time stamp
165  int m_idBaseRenderTime; // MSR_id for true wait time
166  int m_idBaseAccuracy; // MSR_id for time frame is late (int)
167 #endif
168 
169  // Quality management implementation for scheduling rendering
170 
171  virtual BOOL ScheduleSample(IMediaSample *pMediaSample);
172  virtual HRESULT GetSampleTimes(IMediaSample *pMediaSample,
173  __out REFERENCE_TIME *pStartTime,
174  __out REFERENCE_TIME *pEndTime);
175 
176  virtual HRESULT ShouldDrawSampleNow(IMediaSample *pMediaSample,
177  __out REFERENCE_TIME *ptrStart,
178  __out REFERENCE_TIME *ptrEnd);
179 
180  // Lots of end of stream complexities
181 
182  void TimerCallback();
183  void ResetEndOfStreamTimer();
184  HRESULT NotifyEndOfStream();
185  virtual HRESULT SendEndOfStream();
186  virtual HRESULT ResetEndOfStream();
187  virtual HRESULT EndOfStream();
188 
189  // Rendering is based around the clock
190 
191  void SignalTimerFired();
192  virtual HRESULT CancelNotification();
193  virtual HRESULT ClearPendingSample();
194 
195  // Called when the filter changes state
196 
197  virtual HRESULT Active();
198  virtual HRESULT Inactive();
199  virtual HRESULT StartStreaming();
200  virtual HRESULT StopStreaming();
201  virtual HRESULT BeginFlush();
202  virtual HRESULT EndFlush();
203 
204  // Deal with connections and type changes
205 
206  virtual HRESULT BreakConnect();
207  virtual HRESULT SetMediaType(const CMediaType *pmt);
208  virtual HRESULT CompleteConnect(IPin *pReceivePin);
209 
210  // These look after the handling of data samples
211 
212  virtual HRESULT PrepareReceive(IMediaSample *pMediaSample);
213  virtual HRESULT Receive(IMediaSample *pMediaSample);
214  virtual BOOL HaveCurrentSample();
215  virtual IMediaSample *GetCurrentSample();
216  virtual HRESULT Render(IMediaSample *pMediaSample);
217 
218  // Derived classes MUST override these
219  virtual HRESULT DoRenderSample(IMediaSample *pMediaSample) PURE;
220  virtual HRESULT CheckMediaType(const CMediaType *) PURE;
221 
222  // Helper
224 };
225 
226 
227 // CBaseVideoRenderer is a renderer class (see its ancestor class) and
228 // it handles scheduling of media samples so that they are drawn at the
229 // correct time by the reference clock. It implements a degradation
230 // strategy. Possible degradation modes are:
231 // Drop frames here (only useful if the drawing takes significant time)
232 // Signal supplier (upstream) to drop some frame(s) - i.e. one-off skip.
233 // Signal supplier to change the frame rate - i.e. ongoing skipping.
234 // Or any combination of the above.
235 // In order to determine what's useful to try we need to know what's going
236 // on. This is done by timing various operations (including the supplier).
237 // This timing is done by using timeGetTime as it is accurate enough and
238 // usually cheaper than calling the reference clock. It also tells the
239 // truth if there is an audio break and the reference clock stops.
240 // We provide a number of public entry points (named OnXxxStart, OnXxxEnd)
241 // which the rest of the renderer calls at significant moments. These do
242 // the timing.
243 
244 // the number of frames that the sliding averages are averaged over.
245 // the rule is (1024*NewObservation + (AVGPERIOD-1) * PreviousAverage)/AVGPERIOD
246 #define AVGPERIOD 4
247 #define DO_MOVING_AVG(avg,obs) (avg = (1024*obs + (AVGPERIOD-1)*avg)/AVGPERIOD)
248 // Spot the bug in this macro - I can't. but it doesn't work!
249 
250 class CBaseVideoRenderer : public CBaseRenderer, // Base renderer class
251  public IQualProp, // Property page guff
252  public IQualityControl // Allow throttling
253 {
254 protected:
255 
256  // Hungarian:
257  // tFoo is the time Foo in mSec (beware m_tStart from filter.h)
258  // trBar is the time Bar by the reference clock
259 
260  //******************************************************************
261  // State variables to control synchronisation
262  //******************************************************************
263 
264  // Control of sending Quality messages. We need to know whether
265  // we are in trouble (e.g. frames being dropped) and where the time
266  // is being spent.
267 
268  // When we drop a frame we play the next one early.
269  // The frame after that is likely to wait before drawing and counting this
270  // wait as spare time is unfair, so we count it as a zero wait.
271  // We therefore need to know whether we are playing frames early or not.
272 
273  int m_nNormal; // The number of consecutive frames
274  // drawn at their normal time (not early)
275  // -1 means we just dropped a frame.
276 
277 #ifdef PERF
278  BOOL m_bDrawLateFrames; // Don't drop any frames (debug and I'm
279  // not keen on people using it!)
280 #endif
281 
282  BOOL m_bSupplierHandlingQuality;// The response to Quality messages says
283  // our supplier is handling things.
284  // We will allow things to go extra late
285  // before dropping frames. We will play
286  // very early after he has dropped one.
287 
288  // Control of scheduling, frame dropping etc.
289  // We need to know where the time is being spent so as to tell whether
290  // we should be taking action here, signalling supplier or what.
291  // The variables are initialised to a mode of NOT dropping frames.
292  // They will tell the truth after a few frames.
293  // We typically record a start time for an event, later we get the time
294  // again and subtract to get the elapsed time, and we average this over
295  // a few frames. The average is used to tell what mode we are in.
296 
297  // Although these are reference times (64 bit) they are all DIFFERENCES
298  // between times which are small. An int will go up to 214 secs before
299  // overflow. Avoiding 64 bit multiplications and divisions seems
300  // worth while.
301 
302 
303 
304  // Audio-video throttling. If the user has turned up audio quality
305  // very high (in principle it could be any other stream, not just audio)
306  // then we can receive cries for help via the graph manager. In this case
307  // we put in a wait for some time after rendering each frame.
309 
310  // The time taken to render (i.e. BitBlt) frames controls which component
311  // needs to degrade. If the blt is expensive, the renderer degrades.
312  // If the blt is cheap it's done anyway and the supplier degrades.
313  int m_trRenderAvg; // Time frames are taking to blt
314  int m_trRenderLast; // Time for last frame blt
315  int m_tRenderStart; // Just before we started drawing (mSec)
316  // derived from timeGetTime.
317 
318  // When frames are dropped we will play the next frame as early as we can.
319  // If it was a false alarm and the machine is fast we slide gently back to
320  // normal timing. To do this, we record the offset showing just how early
321  // we really are. This will normally be negative meaning early or zero.
323 
324  // Target provides slow long-term feedback to try to reduce the
325  // average sync offset to zero. Whenever a frame is actually rendered
326  // early we add a msec or two, whenever late we take off a few.
327  // We add or take off 1/32 of the error time.
328  // Eventually we should be hovering around zero. For a really bad case
329  // where we were (say) 300mSec off, it might take 100 odd frames to
330  // settle down. The rate of change of this is intended to be slower
331  // than any other mechanism in Quartz, thereby avoiding hunting.
333 
334  // The proportion of time spent waiting for the right moment to blt
335  // controls whether we bother to drop a frame or whether we reckon that
336  // we're doing well enough that we can stand a one-frame glitch.
337  int m_trWaitAvg; // Average of last few wait times
338  // (actually we just average how early
339  // we were). Negative here means LATE.
340 
341  // The average inter-frame time.
342  // This is used to calculate the proportion of the time used by the
343  // three operations (supplying us, waiting, rendering)
344  int m_trFrameAvg; // Average inter-frame time
345  int m_trDuration; // duration of last frame.
346 
347 #ifdef PERF
348  // Performance logging identifiers
349  int m_idTimeStamp; // MSR_id for frame time stamp
350  int m_idEarliness; // MSR_id for earliness fudge
351  int m_idTarget; // MSR_id for Target fudge
352  int m_idWaitReal; // MSR_id for true wait time
353  int m_idWait; // MSR_id for wait time recorded
354  int m_idFrameAccuracy; // MSR_id for time frame is late (int)
355  int m_idRenderAvg; // MSR_id for Render time recorded (int)
356  int m_idSchLateTime; // MSR_id for lateness at scheduler
357  int m_idQualityRate; // MSR_id for Quality rate requested
358  int m_idQualityTime; // MSR_id for Quality time requested
359  int m_idDecision; // MSR_id for decision code
360  int m_idDuration; // MSR_id for duration of a frame
361  int m_idThrottle; // MSR_id for audio-video throttling
362  //int m_idDebug; // MSR_id for trace style debugging
363  //int m_idSendQuality; // MSR_id for timing the notifications per se
364 #endif // PERF
365  REFERENCE_TIME m_trRememberStampForPerf; // original time stamp of frame
366  // with no earliness fudges etc.
367 #ifdef PERF
368  REFERENCE_TIME m_trRememberFrameForPerf; // time when previous frame rendered
369 
370  // debug...
371  int m_idFrameAvg;
372  int m_idWaitAvg;
373 #endif
374 
375  // PROPERTY PAGE
376  // This has edit fields that show the user what's happening
377  // These member variables hold these counts.
378 
379  int m_cFramesDropped; // cumulative frames dropped IN THE RENDERER
380  int m_cFramesDrawn; // Frames since streaming started seen BY THE
381  // RENDERER (some may be dropped upstream)
382 
383  // Next two support average sync offset and standard deviation of sync offset.
384  LONGLONG m_iTotAcc; // Sum of accuracies in mSec
385  LONGLONG m_iSumSqAcc; // Sum of squares of (accuracies in mSec)
386 
387  // Next two allow jitter calculation. Jitter is std deviation of frame time.
388  REFERENCE_TIME m_trLastDraw; // Time of prev frame (for inter-frame times)
389  LONGLONG m_iSumSqFrameTime; // Sum of squares of (inter-frame time in mSec)
390  LONGLONG m_iSumFrameTime; // Sum of inter-frame times in mSec
391 
392  // To get performance statistics on frame rate, jitter etc, we need
393  // to record the lateness and inter-frame time. What we actually need are the
394  // data above (sum, sum of squares and number of entries for each) but the data
395  // is generated just ahead of time and only later do we discover whether the
396  // frame was actually drawn or not. So we have to hang on to the data
397  int m_trLate; // hold onto frame lateness
398  int m_trFrame; // hold onto inter-frame time
399 
400  int m_tStreamingStart; // if streaming then time streaming started
401  // else time of last streaming session
402  // used for property page statistics
403 #ifdef PERF
404  LONGLONG m_llTimeOffset; // timeGetTime()*10000+m_llTimeOffset==ref time
405 #endif
406 
407 public:
408 
409 
410  CBaseVideoRenderer(REFCLSID RenderClass, // CLSID for this renderer
411  __in_opt LPCTSTR pName, // Debug ONLY description
412  __inout_opt LPUNKNOWN pUnk, // Aggregated owner object
413  __inout HRESULT *phr); // General OLE return code
414 
416 
417  // IQualityControl methods - Notify allows audio-video throttling
418 
419  STDMETHODIMP SetSink( IQualityControl * piqc);
420  STDMETHODIMP Notify( IBaseFilter * pSelf, Quality q);
421 
422  // These provide a full video quality management implementation
423 
424  void OnRenderStart(IMediaSample *pMediaSample);
425  void OnRenderEnd(IMediaSample *pMediaSample);
426  void OnWaitStart();
427  void OnWaitEnd();
428  HRESULT OnStartStreaming();
429  HRESULT OnStopStreaming();
430  void ThrottleWait();
431 
432  // Handle the statistics gathering for our quality management
433 
434  void PreparePerformanceData(int trLate, int trFrame);
435  virtual void RecordFrameLateness(int trLate, int trFrame);
436  virtual void OnDirectRender(IMediaSample *pMediaSample);
437  virtual HRESULT ResetStreamingTimes();
438  BOOL ScheduleSample(IMediaSample *pMediaSample);
439  HRESULT ShouldDrawSampleNow(IMediaSample *pMediaSample,
440  __inout REFERENCE_TIME *ptrStart,
441  __inout REFERENCE_TIME *ptrEnd);
442 
443  virtual HRESULT SendQuality(REFERENCE_TIME trLate, REFERENCE_TIME trRealStream);
444  STDMETHODIMP JoinFilterGraph(__inout_opt IFilterGraph * pGraph, __in_opt LPCWSTR pName);
445 
446  //
447  // Do estimates for standard deviations for per-frame
448  // statistics
449  //
450  // *piResult = (llSumSq - iTot * iTot / m_cFramesDrawn - 1) /
451  // (m_cFramesDrawn - 2)
452  // or 0 if m_cFramesDrawn <= 3
453  //
454  HRESULT GetStdDev(
455  int nSamples,
456  __out int *piResult,
457  LONGLONG llSumSq,
458  LONGLONG iTot
459  );
460 public:
461 
462  // IQualProp property page support
463 
464  STDMETHODIMP get_FramesDroppedInRenderer(__out int *cFramesDropped);
465  STDMETHODIMP get_FramesDrawn(__out int *pcFramesDrawn);
466  STDMETHODIMP get_AvgFrameRate(__out int *piAvgFrameRate);
467  STDMETHODIMP get_Jitter(__out int *piJitter);
468  STDMETHODIMP get_AvgSyncOffset(__out int *piAvg);
469  STDMETHODIMP get_DevSyncOffset(__out int *piDev);
470 
471  // Implement an IUnknown interface and expose IQualProp
472 
474  STDMETHODIMP NonDelegatingQueryInterface(REFIID riid,__deref_out VOID **ppv);
475 };
476 
477 #endif // __RENBASE__
478 
CBaseVideoRenderer::m_trEarliness
int m_trEarliness
Definition: renbase.h:322
DECLARE_IUNKNOWN
#define DECLARE_IUNKNOWN
Definition: combase.h:285
CBaseRenderer::ResetEndOfStream
virtual HRESULT ResetEndOfStream()
Definition: renbase.cpp:1335
CBaseRenderer::OnWaitStart
virtual void OnWaitStart()
Definition: renbase.h:157
CBaseVideoRenderer::m_iTotAcc
LONGLONG m_iTotAcc
Definition: renbase.h:384
CBaseVideoRenderer::get_FramesDrawn
STDMETHODIMP get_FramesDrawn(__out int *pcFramesDrawn)
Definition: renbase.cpp:2649
CBaseVideoRenderer::get_AvgSyncOffset
STDMETHODIMP get_AvgSyncOffset(__out int *piAvg)
Definition: renbase.cpp:2688
CBaseRenderer::StartStreaming
virtual HRESULT StartStreaming()
Definition: renbase.cpp:1366
CBaseVideoRenderer::OnRenderEnd
void OnRenderEnd(IMediaSample *pMediaSample)
Definition: renbase.cpp:2062
CBaseVideoRenderer::m_trDuration
int m_trDuration
Definition: renbase.h:345
CBaseRenderer::SetAbortSignal
void SetAbortSignal(BOOL bAbort)
Definition: renbase.h:125
CRendererInputPin::Active
HRESULT Active()
Definition: renbase.cpp:1728
CBaseVideoRenderer::m_trFrame
int m_trFrame
Definition: renbase.h:398
CRendererInputPin::QueryId
STDMETHODIMP QueryId(__deref_out LPWSTR *Id)
Definition: renbase.cpp:1703
CBaseRenderer::StopStreaming
virtual HRESULT StopStreaming()
Definition: renbase.cpp:1405
CBasePin
Definition: amfilter.h:330
CBaseRenderer::EndOfStreamTimer
friend void CALLBACK EndOfStreamTimer(UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
Definition: renbase.cpp:1216
CBaseVideoRenderer::m_trRememberStampForPerf
REFERENCE_TIME m_trRememberStampForPerf
Definition: renbase.h:365
CBaseRenderer::CBaseRenderer
CBaseRenderer(REFCLSID RenderClass, __in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr)
Definition: renbase.cpp:30
CBaseVideoRenderer::m_trRenderLast
int m_trRenderLast
Definition: renbase.h:314
CBaseRenderer::IsEndOfStream
BOOL IsEndOfStream()
Definition: renbase.h:122
CBaseRenderer::m_bEOS
BOOL m_bEOS
Definition: renbase.h:80
CBaseRenderer::m_ObjectCreationLock
CCritSec m_ObjectCreationLock
Definition: renbase.h:92
CBaseRenderer::PrepareRender
virtual void PrepareRender()
Definition: renbase.h:159
CAMEvent::Check
BOOL Check()
Definition: wxutil.h:131
CBaseRenderer::BeginFlush
virtual HRESULT BeginFlush()
Definition: renbase.cpp:698
CBaseRenderer::SendEndOfStream
virtual HRESULT SendEndOfStream()
Definition: renbase.cpp:1252
CRendererPosPassThru
Definition: ctlutil.h:367
CRendererInputPin::BeginFlush
STDMETHODIMP BeginFlush()
Definition: renbase.cpp:1606
CBaseVideoRenderer::get_AvgFrameRate
STDMETHODIMP get_AvgFrameRate(__out int *piAvgFrameRate)
Definition: renbase.cpp:2661
CBaseVideoRenderer::SendQuality
virtual HRESULT SendQuality(REFERENCE_TIME trLate, REFERENCE_TIME trRealStream)
Definition: renbase.cpp:2170
CBaseRenderer::GetRenderEvent
CAMEvent * GetRenderEvent()
Definition: renbase.h:127
CBaseVideoRenderer::m_iSumFrameTime
LONGLONG m_iSumFrameTime
Definition: renbase.h:390
CBaseVideoRenderer::NonDelegatingQueryInterface
DECLARE_IUNKNOWN STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out VOID **ppv)
Definition: renbase.cpp:2822
CBaseVideoRenderer
Definition: renbase.h:250
CBaseVideoRenderer::PreparePerformanceData
void PreparePerformanceData(int trLate, int trFrame)
Definition: renbase.cpp:1950
CBaseVideoRenderer::m_trFrameAvg
int m_trFrameAvg
Definition: renbase.h:344
CBaseRenderer::m_ThreadSignal
CAMEvent m_ThreadSignal
Definition: renbase.h:74
CMediaType
Definition: mtype.h:18
CBaseRenderer::HaveCurrentSample
virtual BOOL HaveCurrentSample()
Definition: renbase.cpp:1009
CBaseVideoRenderer::m_cFramesDrawn
int m_cFramesDrawn
Definition: renbase.h:380
CBaseVideoRenderer::OnDirectRender
virtual void OnDirectRender(IMediaSample *pMediaSample)
Definition: renbase.cpp:2033
n
unsigned int n
Definition: pstream.cpp:148
CBaseRenderer::GetRealState
FILTER_STATE GetRealState()
Definition: renbase.cpp:331
CBaseRenderer::NotifyEndOfStream
HRESULT NotifyEndOfStream()
Definition: renbase.cpp:1299
CBaseRenderer::Pause
STDMETHODIMP Pause()
Definition: renbase.cpp:454
CBaseVideoRenderer::m_tRenderStart
int m_tRenderStart
Definition: renbase.h:315
CBaseRenderer::m_SignalTime
REFERENCE_TIME m_SignalTime
Definition: renbase.h:90
CBaseRenderer::OnDisplayChange
BOOL OnDisplayChange()
Definition: renbase.cpp:1494
CRendererInputPin::EndOfStream
STDMETHODIMP EndOfStream()
Definition: renbase.cpp:1578
CBaseVideoRenderer::OnRenderStart
void OnRenderStart(IMediaSample *pMediaSample)
Definition: renbase.cpp:2050
CBaseVideoRenderer::m_trTarget
int m_trTarget
Definition: renbase.h:332
CBaseVideoRenderer::m_bSupplierHandlingQuality
BOOL m_bSupplierHandlingQuality
Definition: renbase.h:282
CBaseRenderer::SendNotifyWindow
void SendNotifyWindow(IPin *pPin, HWND hwnd)
Definition: renbase.cpp:1436
CBaseRenderer
Definition: renbase.h:60
CRendererInputPin::Allocator
IMemAllocator * Allocator() const
Definition: renbase.h:52
CAMEvent::Set
void Set()
Definition: wxutil.h:126
CBaseRenderer::FindPin
STDMETHODIMP FindPin(LPCWSTR Id, __deref_out IPin **ppPin)
Definition: renbase.cpp:640
CBaseRenderer::m_bEOSDelivered
BOOL m_bEOSDelivered
Definition: renbase.h:81
CBaseVideoRenderer::Notify
STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q)
Definition: renbase.cpp:2087
CBaseRenderer::DoRenderSample
virtual HRESULT DoRenderSample(IMediaSample *pMediaSample) PURE
CBaseRenderer::CompleteConnect
virtual HRESULT CompleteConnect(IPin *pReceivePin)
Definition: renbase.cpp:733
CBaseRenderer::GetPin
virtual CBasePin * GetPin(int n)
Definition: renbase.cpp:603
pName
CHAR * pName
Definition: amvideo.cpp:26
CBaseRenderer::m_bAbort
BOOL m_bAbort
Definition: renbase.h:76
CBaseVideoRenderer::m_tStreamingStart
int m_tStreamingStart
Definition: renbase.h:400
CBaseRenderer::CancelNotification
virtual HRESULT CancelNotification()
Definition: renbase.cpp:892
CBaseRenderer::SourceThreadCanWait
virtual HRESULT SourceThreadCanWait(BOOL bCanWait)
Definition: renbase.cpp:155
CBaseRenderer::m_pMediaSample
IMediaSample * m_pMediaSample
Definition: renbase.h:79
CBaseRenderer::ClearPendingSample
virtual HRESULT ClearPendingSample()
Definition: renbase.cpp:1203
CBaseVideoRenderer::OnWaitStart
void OnWaitStart()
Definition: renbase.cpp:1895
CBaseVideoRenderer::ResetStreamingTimes
virtual HRESULT ResetStreamingTimes()
Definition: renbase.cpp:1838
CBaseRenderer::SendRepaint
void SendRepaint()
Definition: renbase.cpp:1459
CCritSec
Definition: wxutil.h:18
CBaseRenderer::Ready
void Ready()
Definition: renbase.h:131
riid
__in REFIID riid
Definition: dllentry.cpp:192
CBaseRenderer::m_InterfaceLock
CCritSec m_InterfaceLock
Definition: renbase.h:83
CRendererInputPin::Receive
STDMETHODIMP Receive(IMediaSample *pMediaSample)
Definition: renbase.cpp:1635
CBaseRenderer::m_pInputPin
CRendererInputPin * m_pInputPin
Definition: renbase.h:82
CAMEvent
Definition: wxutil.h:108
CBaseVideoRenderer::SetSink
STDMETHODIMP SetSink(IQualityControl *piqc)
Definition: renbase.cpp:2078
CBaseRenderer::BreakConnect
virtual HRESULT BreakConnect()
Definition: renbase.cpp:793
CBaseRenderer::NotReady
void NotReady()
Definition: renbase.h:132
CBaseRenderer::OnStartStreaming
virtual HRESULT OnStartStreaming()
Definition: renbase.h:155
CBaseRenderer::m_RenderEvent
CAMEvent m_RenderEvent
Definition: renbase.h:73
CBaseRenderer::SetMediaType
virtual HRESULT SetMediaType(const CMediaType *pmt)
Definition: renbase.cpp:781
CBaseRenderer::OnRenderEnd
virtual void OnRenderEnd(IMediaSample *pMediaSample)
Definition: renbase.cpp:1546
CBaseRenderer::m_bStreaming
BOOL m_bStreaming
Definition: renbase.h:77
CBaseRenderer::m_pPosition
CRendererPosPassThru * m_pPosition
Definition: renbase.h:72
CBaseVideoRenderer::m_trThrottle
int m_trThrottle
Definition: renbase.h:308
CBaseRenderer::~CBaseRenderer
~CBaseRenderer()
Definition: renbase.cpp:70
CBaseRenderer::NonDelegatingQueryInterface
STDMETHODIMP NonDelegatingQueryInterface(REFIID, __deref_out void **)
Definition: renbase.cpp:137
CBaseRenderer::m_dwAdvise
DWORD_PTR m_dwAdvise
Definition: renbase.h:78
CBaseRenderer::Receive
virtual HRESULT Receive(IMediaSample *pMediaSample)
Definition: renbase.cpp:1126
CBaseRenderer::m_RendererLock
CCritSec m_RendererLock
Definition: renbase.h:84
CBaseVideoRenderer::get_FramesDroppedInRenderer
STDMETHODIMP get_FramesDroppedInRenderer(__out int *cFramesDropped)
Definition: renbase.cpp:2637
CBaseVideoRenderer::m_trLastDraw
REFERENCE_TIME m_trLastDraw
Definition: renbase.h:388
CBaseRenderer::IsStreaming
BOOL IsStreaming()
Definition: renbase.h:124
CBaseRenderer::m_evComplete
CAMEvent m_evComplete
Definition: renbase.h:75
CBaseRenderer::Active
virtual HRESULT Active()
Definition: renbase.cpp:758
CBaseRenderer::CompleteStateChange
virtual HRESULT CompleteStateChange(FILTER_STATE OldState)
Definition: renbase.cpp:360
CBaseVideoRenderer::m_iSumSqFrameTime
LONGLONG m_iSumSqFrameTime
Definition: renbase.h:389
CBaseRenderer::SetRepaintStatus
void SetRepaintStatus(BOOL bRepaint)
Definition: renbase.cpp:1427
CRendererInputPin::CompleteConnect
HRESULT CompleteConnect(IPin *pReceivePin)
Definition: renbase.cpp:1691
CBaseRenderer::ShouldDrawSampleNow
virtual HRESULT ShouldDrawSampleNow(IMediaSample *pMediaSample, __out REFERENCE_TIME *ptrStart, __out REFERENCE_TIME *ptrEnd)
Definition: renbase.cpp:866
CBaseVideoRenderer::RecordFrameLateness
virtual void RecordFrameLateness(int trLate, int trFrame)
Definition: renbase.cpp:1965
CBaseRenderer::GetMediaPositionInterface
virtual HRESULT GetMediaPositionInterface(REFIID riid, __deref_out void **ppv)
Definition: renbase.cpp:99
CBaseRenderer::WaitForReceiveToComplete
void WaitForReceiveToComplete()
Definition: renbase.cpp:290
CBaseRenderer::Stop
STDMETHODIMP Stop()
Definition: renbase.cpp:397
CBaseRenderer::m_bRepaintStatus
BOOL m_bRepaintStatus
Definition: renbase.h:86
CBaseRenderer::ResetEndOfStreamTimer
void ResetEndOfStreamTimer()
Definition: renbase.cpp:1350
CBaseRenderer::WaitForRenderTime
virtual HRESULT WaitForRenderTime()
Definition: renbase.cpp:254
CBaseRenderer::m_EndOfStreamTimer
UINT m_EndOfStreamTimer
Definition: renbase.h:91
CBaseRenderer::OnStopStreaming
virtual HRESULT OnStopStreaming()
Definition: renbase.h:156
CBaseVideoRenderer::m_iSumSqAcc
LONGLONG m_iSumSqAcc
Definition: renbase.h:385
CBaseVideoRenderer::ScheduleSample
BOOL ScheduleSample(IMediaSample *pMediaSample)
Definition: renbase.cpp:2612
CBaseVideoRenderer::m_trLate
int m_trLate
Definition: renbase.h:397
CBaseFilter
Definition: amfilter.h:148
CRendererInputPin::CheckMediaType
HRESULT CheckMediaType(const CMediaType *pmt)
Definition: renbase.cpp:1720
CBaseRenderer::Run
STDMETHODIMP Run(REFERENCE_TIME StartTime)
Definition: renbase.cpp:527
CBasePin::Name
LPWSTR Name()
Definition: amfilter.h:551
CBaseVideoRenderer::OnStopStreaming
HRESULT OnStopStreaming()
Definition: renbase.cpp:1885
CRendererInputPin
Definition: renbase.h:22
CBaseRenderer::OnReceiveFirstSample
virtual void OnReceiveFirstSample(IMediaSample *pMediaSample)
Definition: renbase.h:126
CBaseVideoRenderer::ThrottleWait
void ThrottleWait()
Definition: renbase.cpp:2013
CBaseInputPin
Definition: amfilter.h:819
CBaseRenderer::OnRenderStart
virtual void OnRenderStart(IMediaSample *pMediaSample)
Definition: renbase.cpp:1522
CBaseVideoRenderer::GetStdDev
HRESULT GetStdDev(int nSamples, __out int *piResult, LONGLONG llSumSq, LONGLONG iTot)
Definition: renbase.cpp:2754
CRendererInputPin::SetMediaType
HRESULT SetMediaType(const CMediaType *pmt)
Definition: renbase.cpp:1750
CBaseVideoRenderer::get_Jitter
STDMETHODIMP get_Jitter(__out int *piJitter)
Definition: renbase.cpp:2807
CRendererInputPin::m_pRenderer
CBaseRenderer * m_pRenderer
Definition: renbase.h:26
CBaseRenderer::GetPinCount
virtual int GetPinCount()
Definition: renbase.cpp:591
CBaseRenderer::ScheduleSample
virtual BOOL ScheduleSample(IMediaSample *pMediaSample)
Definition: renbase.cpp:917
CBaseVideoRenderer::get_DevSyncOffset
STDMETHODIMP get_DevSyncOffset(__out int *piDev)
Definition: renbase.cpp:2793
CBaseVideoRenderer::m_cFramesDropped
int m_cFramesDropped
Definition: renbase.h:379
CBaseRenderer::m_pQSink
IQualityControl * m_pQSink
Definition: renbase.h:85
CBaseVideoRenderer::JoinFilterGraph
STDMETHODIMP JoinFilterGraph(__inout_opt IFilterGraph *pGraph, __in_opt LPCWSTR pName)
Definition: renbase.cpp:2839
CBaseVideoRenderer::OnWaitEnd
void OnWaitEnd()
Definition: renbase.cpp:1908
CBaseRenderer::m_bInReceive
volatile BOOL m_bInReceive
Definition: renbase.h:88
CBaseRenderer::CheckReady
BOOL CheckReady()
Definition: renbase.h:133
CRendererInputPin::Inactive
HRESULT Inactive()
Definition: renbase.cpp:1736
CBaseRenderer::EndOfStream
virtual HRESULT EndOfStream()
Definition: renbase.cpp:664
CBaseVideoRenderer::ShouldDrawSampleNow
HRESULT ShouldDrawSampleNow(IMediaSample *pMediaSample, __inout REFERENCE_TIME *ptrStart, __inout REFERENCE_TIME *ptrEnd)
Definition: renbase.cpp:2300
CBaseRenderer::EndFlush
virtual HRESULT EndFlush()
Definition: renbase.cpp:718
CBaseVideoRenderer::OnStartStreaming
HRESULT OnStartStreaming()
Definition: renbase.cpp:1876
CBaseRenderer::SignalTimerFired
void SignalTimerFired()
Definition: renbase.cpp:878
CRendererInputPin::EndFlush
STDMETHODIMP EndFlush()
Definition: renbase.cpp:1620
CBaseVideoRenderer::~CBaseVideoRenderer
~CBaseVideoRenderer()
Definition: renbase.cpp:1809
CBaseRenderer::TimerCallback
void TimerCallback()
Definition: renbase.cpp:1228
CRendererInputPin::BreakConnect
HRESULT BreakConnect()
Definition: renbase.cpp:1679
CBaseVideoRenderer::CBaseVideoRenderer
CBaseVideoRenderer(REFCLSID RenderClass, __in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr)
Definition: renbase.cpp:1770
CBaseVideoRenderer::m_trRenderAvg
int m_trRenderAvg
Definition: renbase.h:313
CBaseRenderer::GetCurrentSample
virtual IMediaSample * GetCurrentSample()
Definition: renbase.cpp:1021
CRendererInputPin::CRendererInputPin
CRendererInputPin(__inout CBaseRenderer *pRenderer, __inout HRESULT *phr, __in_opt LPCWSTR Name)
Definition: renbase.cpp:1562
CBaseRenderer::PrepareReceive
virtual HRESULT PrepareReceive(IMediaSample *pMediaSample)
Definition: renbase.cpp:1039
CBaseRenderer::GetSampleTimes
virtual HRESULT GetSampleTimes(IMediaSample *pMediaSample, __out REFERENCE_TIME *pStartTime, __out REFERENCE_TIME *pEndTime)
Definition: renbase.cpp:831
CBaseRenderer::Render
virtual HRESULT Render(IMediaSample *pMediaSample)
Definition: renbase.cpp:979
CBaseRenderer::Inactive
virtual HRESULT Inactive()
Definition: renbase.cpp:766
CBaseInputPin::m_pAllocator
IMemAllocator * m_pAllocator
Definition: amfilter.h:825
CBaseRenderer::IsEndOfStreamDelivered
BOOL IsEndOfStreamDelivered()
Definition: renbase.h:123
CBaseRenderer::OnWaitEnd
virtual void OnWaitEnd()
Definition: renbase.h:158
CBaseRenderer::GetState
STDMETHODIMP GetState(DWORD dwMSecs, __out FILTER_STATE *State)
Definition: renbase.cpp:340
CBaseRenderer::CheckMediaType
virtual HRESULT CheckMediaType(const CMediaType *) PURE
CBaseVideoRenderer::m_trWaitAvg
int m_trWaitAvg
Definition: renbase.h:337
CBaseVideoRenderer::m_nNormal
int m_nNormal
Definition: renbase.h:273
CAMEvent::Reset
void Reset()
Definition: wxutil.h:130