1 //------------------------------------------------------------------------------
2 // File: AMExtra.h
3 //
4 // Desc: DirectShow base classes.
5 //
6 // Copyright (c) 1992-2002 Microsoft Corporation.  All rights reserved.
7 //------------------------------------------------------------------------------
8 
9 
10 #ifndef __AMEXTRA__
11 #define __AMEXTRA__
12 
13 // Simple rendered input pin
14 //
15 // NOTE if your filter queues stuff before rendering then it may not be
16 // appropriate to use this class
17 //
18 // In that case queue the end of stream condition until the last sample
19 // is actually rendered and flush the condition appropriately
20 
21 class CRenderedInputPin : public CBaseInputPin
22 {
23 public:
24 
25     CRenderedInputPin(TCHAR *pObjectName,
26                       CBaseFilter *pFilter,
27                       CCritSec *pLock,
28                       HRESULT *phr,
29                       LPCWSTR pName);
30 #ifdef UNICODE
31     CRenderedInputPin(CHAR *pObjectName,
32                       CBaseFilter *pFilter,
33                       CCritSec *pLock,
34                       HRESULT *phr,
35                       LPCWSTR pName);
36 #endif
37 
38     // Override methods to track end of stream state
39     STDMETHODIMP EndOfStream();
40     STDMETHODIMP EndFlush();
41 
42     HRESULT Active();
43     HRESULT Run(REFERENCE_TIME tStart);
44 
45 protected:
46 
47     // Member variables to track state
48     BOOL m_bAtEndOfStream;      // Set by EndOfStream
49     BOOL m_bCompleteNotified;   // Set when we notify for EC_COMPLETE
50 
51 private:
52     void DoCompleteHandling();
53 };
54 
55 #endif // __AMEXTRA__
56 
57