]> git.vomp.tv Git - vompclient.git/blob - dssourcefilter.h
Update for windows
[vompclient.git] / dssourcefilter.h
1 /*
2     Copyright 2004-2005 Chris Tallon
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef DSSOURCEFILTER_H
22 #define DSSOURCEFILTER_H
23
24
25 #include "mutex.h"
26 #include "dssourcepin.h"
27
28
29 [uuid("EB87AB22-7A95-49c3-8CCE-2F6D61A87009")]
30 class DsSourceFilter: public IBaseFilter {
31 friend class DsSourcePin; 
32 public:
33         DsSourceFilter();
34         ~DsSourceFilter();
35         virtual int GetPinCount();
36         int getCurrentAudioMediaSample(IMediaSample** ms);
37         int DeliverAudioMediaSample(IMediaSample* ms);
38         int getCurrentVideoMediaSample(IMediaSample** ms);
39         int DeliverVideoMediaSample(IMediaSample* ms);
40         REFERENCE_TIME getStartOffset(){return laststart;};
41         BOOL IsActive() {EnterCriticalSection(&filterlock);
42         FILTER_STATE tempstate=mystate;LeaveCriticalSection(&filterlock); 
43         return (tempstate==State_Running) || (tempstate==State_Paused);};
44
45 /* IUnknown */
46         virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id,void ** object);
47         virtual ULONG STDMETHODCALLTYPE AddRef();\r
48     virtual ULONG STDMETHODCALLTYPE Release();
49 /*IPersist*/
50         virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *clsid);\r
51
52 /*IBaseFilter*/
53         virtual HRESULT STDMETHODCALLTYPE EnumPins(IEnumPins **enumar);
54         virtual HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR iden,IPin **pin);\r
55         virtual HRESULT STDMETHODCALLTYPE QueryFilterInfo(FILTER_INFO *info);\r
56         virtual HRESULT STDMETHODCALLTYPE JoinFilterGraph(IFilterGraph *graph,LPCWSTR name);\r
57         virtual HRESULT STDMETHODCALLTYPE QueryVendorInfo(LPWSTR *vendinf);\r
58 /*IMediaFilter*/
59         virtual HRESULT STDMETHODCALLTYPE GetState(DWORD timeout,FILTER_STATE *state);\r
60         virtual HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock *uhr);\r
61         virtual HRESULT STDMETHODCALLTYPE GetSyncSource(IReferenceClock **uhr);\r
62         virtual HRESULT STDMETHODCALLTYPE Stop();\r
63         virtual HRESULT STDMETHODCALLTYPE Pause();\r
64         virtual HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME start);\r
65 \r
66         DsSourcePin *GetAudioPin() {return audiopin;};\r
67         DsSourcePin *GetVideoPin() {return videopin;};\r
68
69
70 protected:
71         DsSourcePin *audiopin;
72         DsSourcePin *videopin;
73         IFilterGraph* filtergraph;
74         IReferenceClock* clock;
75         FILTER_STATE mystate;
76         REFERENCE_TIME laststart;
77         CRITICAL_SECTION filterlock;
78
79         volatile long refs;
80
81
82 };
83
84 #endif\r