Parent Directory | Revision Log
Revision 2014 - (view) (download)
1 : | Irhall | 2014 | /***************************************************************************** |
2 : | * | ||
3 : | * Xvid MiniConvert | ||
4 : | * - Header for helper filters - | ||
5 : | * | ||
6 : | * Copyright(C) 2011 Xvid Solutions GmbH | ||
7 : | * | ||
8 : | * This program is free software ; you can redistribute it and/or modify | ||
9 : | * it under the terms of the GNU General Public License as published by | ||
10 : | * the Free Software Foundation ; either version 2 of the License, or | ||
11 : | * (at your option) any later version. | ||
12 : | * | ||
13 : | * This program is distributed in the hope that it will be useful, | ||
14 : | * but WITHOUT ANY WARRANTY ; without even the implied warranty of | ||
15 : | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 : | * GNU General Public License for more details. | ||
17 : | * | ||
18 : | * You should have received a copy of the GNU General Public License | ||
19 : | * along with this program ; if not, write to the Free Software | ||
20 : | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 : | * | ||
22 : | * $Id$ | ||
23 : | * | ||
24 : | ****************************************************************************/ | ||
25 : | /* | ||
26 : | * Author(s): Ireneusz Hallmann | ||
27 : | * | ||
28 : | ****************************************************************************/ | ||
29 : | |||
30 : | #ifndef _FILTERS_H_ | ||
31 : | #define _FILTERS_H_ | ||
32 : | |||
33 : | // {4A4FA86F-789F-4912-B547-C4BFAA6D2D96} | ||
34 : | static const GUID CLSID_ChangeSubtypeT = | ||
35 : | { 0x4a4fa86f, 0x789f, 0x4912, { 0xb5, 0x47, 0xc4, 0xbf, 0xaa, 0x6d, 0x2d, 0x96 } }; | ||
36 : | |||
37 : | // {31550865-FA54-4019-89F4-A1A77083BD06} | ||
38 : | static const GUID IID_IRecProgressNotify = | ||
39 : | { 0x31550865, 0xfa54, 0x4019, { 0x89, 0xf4, 0xa1, 0xa7, 0x70, 0x83, 0xbd, 0x6 } }; | ||
40 : | |||
41 : | // {6C203582-9CB7-4775-81BA-CAE05D7DB9C6} | ||
42 : | static const GUID CLSID_ProgressNotifyFilter = | ||
43 : | { 0x6c203582, 0x9cb7, 0x4775, { 0x81, 0xba, 0xca, 0xe0, 0x5d, 0x7d, 0xb9, 0xc6 } }; | ||
44 : | |||
45 : | // 00000050-0000-0010-8000-00AA00389B71 MEDIASUBTYPE_MP3 | ||
46 : | static const GUID MEDIASUBTYPE_MP3 = | ||
47 : | { 0x00000055, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } }; | ||
48 : | |||
49 : | |||
50 : | DECLARE_INTERFACE_(IRecProgressNotify, IUnknown) | ||
51 : | { | ||
52 : | STDMETHOD (SetPass)(int in_Pass) PURE; | ||
53 : | STDMETHOD (SetTotalFrames)(DWORD in_TotalFrames) PURE; | ||
54 : | STDMETHOD (SetNotifyWnd)(HWND in_hWnd) PURE; | ||
55 : | STDMETHOD (GetBitrate)(DWORD &OutFramesCount, LONGLONG &OutTotalDataSize) PURE; | ||
56 : | STDMETHOD (GetDimensions)(DWORD &Width, DWORD &Height) PURE; | ||
57 : | STDMETHOD (SetTotalSize)(int nbTotal) PURE; | ||
58 : | STDMETHOD (SetElapsedSize)(int nbElapsed) PURE; | ||
59 : | STDMETHOD (SetCurSize)(int nbCur) PURE; | ||
60 : | }; | ||
61 : | |||
62 : | class CIRecProgressNotify : public IRecProgressNotify | ||
63 : | { | ||
64 : | protected: | ||
65 : | int m_Pass; | ||
66 : | HWND m_MessageWnd; | ||
67 : | DWORD m_TotalFrames; | ||
68 : | int m_SampleCnt; | ||
69 : | LONGLONG m_TotalDataSize; | ||
70 : | int m_Type; | ||
71 : | LONGLONG m_startTime; | ||
72 : | LONGLONG m_stopTime; | ||
73 : | int m_Width, m_Height; | ||
74 : | int m_curSize, m_totalSize, m_elapsedSize; | ||
75 : | |||
76 : | public: | ||
77 : | CIRecProgressNotify(); | ||
78 : | STDMETHODIMP SetPass(int in_Pass) ; | ||
79 : | STDMETHODIMP SetTotalFrames(DWORD in_TotalFrames) ; | ||
80 : | STDMETHODIMP SetNotifyWnd(HWND in_hWnd); | ||
81 : | STDMETHODIMP GetBitrate(DWORD &OutFramesCount, LONGLONG &OutTotalDataSize); | ||
82 : | STDMETHODIMP GetDimensions(DWORD &Width, DWORD &Height); | ||
83 : | STDMETHODIMP SetTotalSize(int nbTotal); | ||
84 : | STDMETHODIMP SetCurSize(int nbCur); | ||
85 : | STDMETHODIMP SetElapsedSize(int nbElapsed); | ||
86 : | }; | ||
87 : | |||
88 : | class CProgressNotifyFilter : public CTransInPlaceFilter, CIRecProgressNotify | ||
89 : | { | ||
90 : | public: | ||
91 : | static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr, int Type); | ||
92 : | CProgressNotifyFilter(LPUNKNOWN pUnk, HRESULT *phr, int Type); | ||
93 : | ~CProgressNotifyFilter(); | ||
94 : | int m_FpsNom, m_FpsDen, m_MinSampleSize; | ||
95 : | |||
96 : | virtual HRESULT CompleteConnect(PIN_DIRECTION direction, IPin *pReceivePin); | ||
97 : | LONGLONG m_AvgTimeForFrame; | ||
98 : | CMediaType m_MediaType; | ||
99 : | |||
100 : | // IUnknown | ||
101 : | DECLARE_IUNKNOWN | ||
102 : | |||
103 : | // CUnknown | ||
104 : | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv); | ||
105 : | |||
106 : | HRESULT CheckInputType(const CMediaType *mtIn); | ||
107 : | HRESULT Transform(IMediaSample *pSample); | ||
108 : | |||
109 : | HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pProperties); | ||
110 : | }; | ||
111 : | |||
112 : | class ChangeSubtypeT : | ||
113 : | public CTransformFilter, CIRecProgressNotify | ||
114 : | { | ||
115 : | public: | ||
116 : | static CUnknown * WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr); | ||
117 : | ChangeSubtypeT(LPUNKNOWN pUnk, HRESULT *phr); | ||
118 : | ~ChangeSubtypeT(void); | ||
119 : | |||
120 : | // IUnknown | ||
121 : | DECLARE_IUNKNOWN | ||
122 : | |||
123 : | // CUnknown | ||
124 : | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv); | ||
125 : | |||
126 : | HRESULT CheckInputType(const CMediaType *pmt); | ||
127 : | HRESULT CheckTransform(const CMediaType *pmtIn, const CMediaType *pmtOut); | ||
128 : | |||
129 : | virtual HRESULT GetMediaType(int iPosition, CMediaType *pMediaType); | ||
130 : | virtual HRESULT DecideBufferSize(IMemAllocator * pAlloc, ALLOCATOR_PROPERTIES * ppropInputRequest); | ||
131 : | virtual HRESULT Transform(IMediaSample *pIn, IMediaSample *pOut); | ||
132 : | virtual HRESULT CompleteConnect(PIN_DIRECTION direction, IPin *pReceivePin); | ||
133 : | |||
134 : | CMediaType m_InMediaType, m_OutMediaType; | ||
135 : | |||
136 : | GUID m_SubtypeID; | ||
137 : | int m_OutFcc; | ||
138 : | |||
139 : | int m_FpsNom, m_FpsDen; | ||
140 : | DWORD m_AvgTimeForFrame; | ||
141 : | |||
142 : | BYTE *m_pMpeg4Sequence; | ||
143 : | int m_Mpeg4SequenceSize; | ||
144 : | }; | ||
145 : | |||
146 : | #endif /* _FILTERS_H_ */ |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |