[svn] / trunk / xvidcore / dshow / src / CXvidDecoder.h Repository:
ViewVC logotype

Diff of /trunk/xvidcore/dshow/src/CXvidDecoder.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1605, Mon Mar 14 01:18:20 2005 UTC revision 2103, Mon Jun 8 19:18:52 2015 UTC
# Line 3  Line 3 
3   *  XVID MPEG-4 VIDEO CODEC   *  XVID MPEG-4 VIDEO CODEC
4   *  - XviD Decoder part of the DShow Filter  -   *  - XviD Decoder part of the DShow Filter  -
5   *   *
6   *  Copyright(C) 2002-2003 Peter Ross <pross@xvid.org>   *  Copyright(C) 2002-2012 Peter Ross <pross@xvid.org>
7   *   *
8   *  This program is free software ; you can redistribute it and/or modify   *  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   *  it under the terms of the GNU General Public License as published by
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: CXvidDecoder.h,v 1.5 2005-03-14 01:18:20 Isibaar Exp $   * $Id$
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 29  Line 29 
29  #include <xvid.h>  #include <xvid.h>
30  #include "IXvidDecoder.h"  #include "IXvidDecoder.h"
31    
32    #ifndef HWND_MESSAGE
33    #define HWND_MESSAGE ((HWND)-3)
34    #endif
35    
36  #define XVID_NAME_L             L"XviD MPEG-4 Video Decoder"  #define XVID_NAME_L             L"Xvid MPEG-4 Video Decoder"
37    #define XVID_NAME_MFT_L L"Xvid MPEG-4 Video Decoder MFT"
38    
39  /* --- fourcc --- */  /* --- fourcc --- */
40    
41  #define FOURCC_XVID     mmioFOURCC('X','V','I','D')  #define FOURCC_XVID     mmioFOURCC('X','V','I','D')
42    #define FOURCC_xvid     mmioFOURCC('x','v','i','d')
43  #define FOURCC_DIVX     mmioFOURCC('D','I','V','X')  #define FOURCC_DIVX     mmioFOURCC('D','I','V','X')
44    #define FOURCC_divx     mmioFOURCC('d','i','v','x')
45  #define FOURCC_DX50     mmioFOURCC('D','X','5','0')  #define FOURCC_DX50     mmioFOURCC('D','X','5','0')
46  #define FOURCC_MP4V     mmioFOURCC('m','p','4','v')  #define FOURCC_dx50     mmioFOURCC('d','x','5','0')
47    #define FOURCC_MP4V     mmioFOURCC('M','P','4','V')
48    #define FOURCC_mp4v     mmioFOURCC('m','p','4','v')
49    #define FOURCC_3IVX     mmioFOURCC('3','I','V','X')
50    #define FOURCC_3ivx     mmioFOURCC('3','i','v','x')
51    #define FOURCC_3IV0     mmioFOURCC('3','I','V','0')
52    #define FOURCC_3iv0     mmioFOURCC('3','i','v','0')
53    #define FOURCC_3IV1     mmioFOURCC('3','I','V','1')
54    #define FOURCC_3iv1     mmioFOURCC('3','i','v','1')
55    #define FOURCC_3IV2     mmioFOURCC('3','I','V','2')
56    #define FOURCC_3iv2     mmioFOURCC('3','i','v','2')
57    #define FOURCC_LMP4     mmioFOURCC('L','M','P','4')
58    #define FOURCC_lmp4     mmioFOURCC('l','m','p','4')
59    #define FOURCC_RMP4     mmioFOURCC('R','M','P','4')
60    #define FOURCC_rmp4     mmioFOURCC('r','m','p','4')
61    #define FOURCC_SMP4     mmioFOURCC('S','M','P','4')
62    #define FOURCC_smp4     mmioFOURCC('s','m','p','4')
63    #define FOURCC_HDX4     mmioFOURCC('H','D','X','4')
64    #define FOURCC_hdx4     mmioFOURCC('h','d','x','4')
65    
66  /* --- media uids --- */  /* --- media uids --- */
67    
# Line 47  Line 71 
71  DEFINE_GUID(CLSID_DIVX_UC,      mmioFOURCC('D','I','V','X'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);  DEFINE_GUID(CLSID_DIVX_UC,      mmioFOURCC('D','I','V','X'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
72  DEFINE_GUID(CLSID_DX50,         mmioFOURCC('d','x','5','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);  DEFINE_GUID(CLSID_DX50,         mmioFOURCC('d','x','5','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
73  DEFINE_GUID(CLSID_DX50_UC,      mmioFOURCC('D','X','5','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);  DEFINE_GUID(CLSID_DX50_UC,      mmioFOURCC('D','X','5','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
74    DEFINE_GUID(CLSID_3IVX,         mmioFOURCC('3','i','v','x'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
75    DEFINE_GUID(CLSID_3IVX_UC,      mmioFOURCC('3','I','V','X'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
76    DEFINE_GUID(CLSID_3IV0,         mmioFOURCC('3','i','v','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
77    DEFINE_GUID(CLSID_3IV0_UC,      mmioFOURCC('3','I','V','0'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
78    DEFINE_GUID(CLSID_3IV1,         mmioFOURCC('3','i','v','1'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
79    DEFINE_GUID(CLSID_3IV1_UC,      mmioFOURCC('3','I','V','1'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
80    DEFINE_GUID(CLSID_3IV2,         mmioFOURCC('3','i','v','2'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
81    DEFINE_GUID(CLSID_3IV2_UC,      mmioFOURCC('3','I','V','2'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
82    DEFINE_GUID(CLSID_LMP4,         mmioFOURCC('l','m','p','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
83    DEFINE_GUID(CLSID_LMP4_UC,      mmioFOURCC('L','M','P','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
84    DEFINE_GUID(CLSID_RMP4,         mmioFOURCC('r','m','p','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
85    DEFINE_GUID(CLSID_RMP4_UC,      mmioFOURCC('R','M','P','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
86    DEFINE_GUID(CLSID_SMP4,         mmioFOURCC('s','m','p','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
87    DEFINE_GUID(CLSID_SMP4_UC,      mmioFOURCC('S','M','P','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
88    DEFINE_GUID(CLSID_HDX4,         mmioFOURCC('h','d','x','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
89    DEFINE_GUID(CLSID_HDX4_UC,      mmioFOURCC('H','D','X','4'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
90  DEFINE_GUID(CLSID_MP4V,         mmioFOURCC('m','p','4','v'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);  DEFINE_GUID(CLSID_MP4V,         mmioFOURCC('m','p','4','v'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
91    DEFINE_GUID(CLSID_MP4V_UC,              mmioFOURCC('M','P','4','V'), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
92    
93    
94  /* MEDIATYPE_IYUV is not always defined in the directx headers */  /* MEDIATYPE_IYUV is not always defined in the directx headers */
95  DEFINE_GUID(CLSID_MEDIASUBTYPE_IYUV, 0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);  DEFINE_GUID(CLSID_MEDIASUBTYPE_IYUV, 0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
96    
97    
98  class CXvidDecoder : public CVideoTransformFilter, public IXvidDecoder, public ISpecifyPropertyPages  class CXvidDecoder :
99            public CVideoTransformFilter,
100            public IXvidDecoder,
101            public ISpecifyPropertyPages
102    #if defined(XVID_USE_MFT)
103        ,public IMFTransform
104    #endif
105  {  {
106    
107  public :  public :
# Line 66  Line 113 
113          CXvidDecoder(LPUNKNOWN punk, HRESULT *phr);          CXvidDecoder(LPUNKNOWN punk, HRESULT *phr);
114          ~CXvidDecoder();          ~CXvidDecoder();
115    
116            HRESULT CompleteConnect(PIN_DIRECTION direction, IPin *pReceivePin);
117            HRESULT BreakConnect(PIN_DIRECTION dir);
118    
119          HRESULT CheckInputType(const CMediaType * mtIn);          HRESULT CheckInputType(const CMediaType * mtIn);
120          HRESULT GetMediaType(int iPos, CMediaType * pmt);          HRESULT GetMediaType(int iPos, CMediaType * pmt);
121          HRESULT SetMediaType(PIN_DIRECTION direction, const CMediaType *pmt);          HRESULT SetMediaType(PIN_DIRECTION direction, const CMediaType *pmt);
# Line 78  Line 128 
128          STDMETHODIMP GetPages(CAUUID * pPages);          STDMETHODIMP GetPages(CAUUID * pPages);
129          STDMETHODIMP FreePages(CAUUID * pPages);          STDMETHODIMP FreePages(CAUUID * pPages);
130    
131      /* IMFTransform */
132    #if defined(XVID_USE_MFT)
133            STDMETHODIMP MFTGetStreamLimits(DWORD *pdwInputMinimum, DWORD *pdwInputMaximum, DWORD *pdwOutputMinimum, DWORD *pdwOutputMaximum);
134            STDMETHODIMP MFTGetStreamCount(DWORD *pcInputStreams, DWORD *pcOutputStreams);
135            STDMETHODIMP MFTGetStreamIDs(DWORD dwInputIDArraySize, DWORD *pdwInputIDs, DWORD dwOutputIDArraySize, DWORD *pdwOutputIDs);
136            STDMETHODIMP MFTGetInputStreamInfo(DWORD dwInputStreamID, MFT_INPUT_STREAM_INFO *pStreamInfo);
137            STDMETHODIMP MFTGetOutputStreamInfo(DWORD dwOutputStreamID, MFT_OUTPUT_STREAM_INFO *pStreamInfo);
138            STDMETHODIMP GetAttributes(IMFAttributes** pAttributes);
139            STDMETHODIMP GetInputStreamAttributes(DWORD dwInputStreamID, IMFAttributes **ppAttributes);
140            STDMETHODIMP GetOutputStreamAttributes(DWORD dwOutputStreamID, IMFAttributes **ppAttributes);
141            STDMETHODIMP MFTDeleteInputStream(DWORD dwStreamID);
142            STDMETHODIMP MFTAddInputStreams(DWORD cStreams, DWORD *adwStreamIDs);
143            STDMETHODIMP MFTGetInputAvailableType(DWORD dwInputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType);
144            STDMETHODIMP MFTGetOutputAvailableType(DWORD dwOutputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType);
145            STDMETHODIMP MFTSetInputType(DWORD dwInputStreamID, IMFMediaType *pType, DWORD dwFlags);
146            STDMETHODIMP MFTSetOutputType(DWORD dwOutputStreamID, IMFMediaType *pType, DWORD dwFlags);
147            STDMETHODIMP MFTGetInputCurrentType(DWORD dwInputStreamID, IMFMediaType **ppType);
148            STDMETHODIMP MFTGetOutputCurrentType(DWORD dwOutputStreamID, IMFMediaType **ppType);
149            STDMETHODIMP MFTGetInputStatus(DWORD dwInputStreamID, DWORD *pdwFlags);
150            STDMETHODIMP MFTGetOutputStatus(DWORD *pdwFlags);
151            STDMETHODIMP MFTSetOutputBounds(LONGLONG hnsLowerBound, LONGLONG hnsUpperBound);
152            STDMETHODIMP MFTProcessEvent(DWORD dwInputStreamID, IMFMediaEvent *pEvent);
153            STDMETHODIMP MFTProcessMessage(MFT_MESSAGE_TYPE eMessage, ULONG_PTR ulParam);
154    
155            STDMETHODIMP MFTProcessInput(DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags);
156            STDMETHODIMP MFTProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount, MFT_OUTPUT_DATA_BUFFER *pOutputSamples, DWORD *pdwStatus);
157    #endif  /* XVID_USE_MFT */
158    
159  private :  private :
160    
161          HRESULT ChangeColorspace(GUID subtype, GUID formattype, void * format);          HRESULT ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip);
162          HRESULT OpenLib();          HRESULT OpenLib();
163          void CloseLib();          void CloseLib();
164    
# Line 88  Line 166 
166          xvid_dec_frame_t m_frame;          xvid_dec_frame_t m_frame;
167    
168          HINSTANCE m_hdll;          HINSTANCE m_hdll;
169          int (*xvid_global_func)(void *handle, int opt, void *param1, void *param2);          int (__cdecl *xvid_global_func)(void *handle, int opt, void *param1, void *param2);
170          int (*xvid_decore_func)(void *handle, int opt, void *param1, void *param2);          int (__cdecl *xvid_decore_func)(void *handle, int opt, void *param1, void *param2);
171          int ar_x, ar_y;          UINT ar_x, ar_y;
172          bool forced_ar;          bool forced_ar;
173    
174          int rgb_flip;          int rgb_flip;
175            int out_stride;
176    
177            /* mft stuff */
178    #if defined(XVID_USE_MFT)
179            BOOL HasPendingOutput() const { return m_frame.output.plane[1] != NULL; }
180    
181            HRESULT OnSetInputType(IMFMediaType *pmt);
182            HRESULT OnCheckInputType(IMFMediaType *pmt);
183    
184            HRESULT OnSetOutputType(IMFMediaType *pmt);
185    
186            IMFMediaType *m_pInputType;
187            IMFMediaType *m_pOutputType;
188    
189            CRITICAL_SECTION m_mft_lock;
190            REFERENCE_TIME m_timestamp;
191            REFERENCE_TIME m_timelength;
192    
193            int m_discont;
194    
195            /* Used to construct or interpolate missing timestamps */
196            REFERENCE_TIME m_rtFrame;
197            MFRatio m_frameRate;
198            UINT64 m_duration;
199    #endif
200    
201            HWND MSG_hwnd; /* message handler window */
202  };  };
203    #define WM_ICONMESSAGE (WM_USER + 1)
204    
205  static const int PARS[][2] = {  static const int PARS[][2] = {
206          {1, 1},          {1, 1},
# Line 106  Line 211 
211          {0, 0},          {0, 0},
212  };  };
213    
   
214  #endif /* _FILTER_H_ */  #endif /* _FILTER_H_ */

Legend:
Removed from v.1605  
changed lines
  Added in v.2103

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4