]> git.vomp.tv Git - vompclient-marten.git/blob - dssourcepin.h
Fix bug in demuxer widescreen signaling
[vompclient-marten.git] / dssourcepin.h
1 /*
2     Copyright 2004-2006 Marten Richter
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 #ifndef DSPINFILTER_H
22 #define DSPINFILTER_H
23
24 #include <winsock2.h>
25
26 #include <dshow.h>
27
28 EXTERN_C const GUID FAR MEDIATYPE_WaveFmt_Mpeg1Layer3;
29
30
31
32 class DsSourceFilter;
33
34 [uuid("17F931AB-9A87-4c65-B99E-84F5BC5F7B09")]
35 class DsSourcePin: public IPin {
36
37 public:
38   DsSourcePin(DsSourceFilter *pFilter,HRESULT *phr,LPCWSTR pName,bool audio);
39   ~DsSourcePin();
40   BOOL IsConnected() {return (connected!=NULL);};
41   HRESULT getCurrentMediaSample(IMediaSample**ms);
42   HRESULT deliver(IMediaSample * ms);
43   void SetMsToMt(IMediaSample *ms);
44   bool supportsAc3();
45   void SetPinMode(int mode, void* details=NULL);
46
47   virtual  HRESULT DecideBufferSize(IMemAllocator *pa,ALLOCATOR_PROPERTIES *all_pp);
48
49   HRESULT Inactive();
50   HRESULT Active();
51   HRESULT Run(REFERENCE_TIME reftime);
52   /*IPin*/
53
54   virtual HRESULT STDMETHODCALLTYPE Connect(IPin *pinempf,const AM_MEDIA_TYPE *mtype);
55   virtual HRESULT STDMETHODCALLTYPE ReceiveConnection(IPin *connect,const AM_MEDIA_TYPE *mtype);
56   virtual HRESULT STDMETHODCALLTYPE Disconnect();
57   virtual HRESULT STDMETHODCALLTYPE ConnectedTo(IPin **pin);
58   virtual HRESULT STDMETHODCALLTYPE  ConnectionMediaType(AM_MEDIA_TYPE *mtype);
59   virtual HRESULT STDMETHODCALLTYPE QueryPinInfo(PIN_INFO *info);
60   virtual HRESULT STDMETHODCALLTYPE  QueryDirection(PIN_DIRECTION *dir);
61   virtual HRESULT STDMETHODCALLTYPE QueryId(LPWSTR *id);
62   virtual HRESULT STDMETHODCALLTYPE  QueryAccept(const AM_MEDIA_TYPE *mtype);
63   virtual HRESULT STDMETHODCALLTYPE EnumMediaTypes(IEnumMediaTypes **enuma);
64   virtual HRESULT STDMETHODCALLTYPE QueryInternalConnections(IPin **pin,ULONG *numpin);
65   virtual HRESULT STDMETHODCALLTYPE EndOfStream();
66   virtual HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME start,REFERENCE_TIME stop,double rate);
67   /* IUnknown */
68   virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id,void ** object);
69   virtual ULONG STDMETHODCALLTYPE AddRef();
70     virtual ULONG STDMETHODCALLTYPE Release();
71   virtual HRESULT STDMETHODCALLTYPE BeginFlush(){return E_UNEXPECTED;};
72   virtual HRESULT STDMETHODCALLTYPE EndFlush(){return E_UNEXPECTED;};
73   virtual HRESULT GetMediaType(int iPosition, AM_MEDIA_TYPE *pmt);
74
75
76
77 protected:
78   virtual  HRESULT CheckMediaType(const AM_MEDIA_TYPE *pmt);
79   HRESULT GetMediaTypeMpegAudio(int iPosition, AM_MEDIA_TYPE *pmt);
80   HRESULT GetMediaTypeMp3Audio(int iPosition, AM_MEDIA_TYPE *pmt);
81   HRESULT GetMediaTypeAc3(int iPosition, AM_MEDIA_TYPE *pmt);
82   HRESULT GetMediaTypeMpegVideo(int iPosition, AM_MEDIA_TYPE *pmt);
83   HRESULT GetMediaTypeH264Video(int iPosition, AM_MEDIA_TYPE *pmt);
84
85     int pinmode;
86   bool isaudiopin;
87   DsSourceFilter *m_pFilter;
88   IPin* connected;
89   IMemInputPin* connectedinput;
90   AM_MEDIA_TYPE medtype;
91   IMemAllocator* allocator;
92
93   int v_width;
94   int v_height;
95 };
96
97
98
99 #endif