]> git.vomp.tv Git - vompclient.git/blob - dssourcefilter.h
Display channel name, duration, resume point and size on recording info screen
[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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 #ifndef DSSOURCEFILTER_H
22 #define DSSOURCEFILTER_H
23
24
25 #include "mutex.h"
26 #include "dssourcepin.h"
27
28 struct mptype_video_detail{ //here should be all information added the Video Draintarget needs for rendering, to be extended in the future
29     UINT width;
30     UINT height;
31 };
32
33 [uuid("EB87AB22-7A95-49c3-8CCE-2F6D61A87009")]
34 class DsSourceFilter: public IBaseFilter {
35 friend class DsSourcePin; 
36 public:
37         DsSourceFilter();
38         ~DsSourceFilter();
39         virtual int GetPinCount();
40         int getCurrentAudioMediaSample(IMediaSample** ms);
41         int DeliverAudioMediaSample(IMediaSample* ms);
42         int getCurrentVideoMediaSample(IMediaSample** ms);
43         int DeliverVideoMediaSample(IMediaSample* ms);
44         REFERENCE_TIME getStartOffset(){return laststart;};
45         BOOL IsActive() {EnterCriticalSection(&filterlock);
46         FILTER_STATE tempstate=mystate;LeaveCriticalSection(&filterlock); 
47         return (tempstate==State_Running) || (tempstate==State_Paused);};
48
49 /* IUnknown */
50         virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id,void ** object);
51         virtual ULONG STDMETHODCALLTYPE AddRef();
52     virtual ULONG STDMETHODCALLTYPE Release();
53 /*IPersist*/
54         virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *clsid);
55
56 /*IBaseFilter*/
57         virtual HRESULT STDMETHODCALLTYPE EnumPins(IEnumPins **enumar);
58         virtual HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR iden,IPin **pin);
59         virtual HRESULT STDMETHODCALLTYPE QueryFilterInfo(FILTER_INFO *info);
60         virtual HRESULT STDMETHODCALLTYPE JoinFilterGraph(IFilterGraph *graph,LPCWSTR name);
61         virtual HRESULT STDMETHODCALLTYPE QueryVendorInfo(LPWSTR *vendinf);
62 /*IMediaFilter*/
63         virtual HRESULT STDMETHODCALLTYPE GetState(DWORD timeout,FILTER_STATE *state);
64         virtual HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock *uhr);
65         virtual HRESULT STDMETHODCALLTYPE GetSyncSource(IReferenceClock **uhr);
66         virtual HRESULT STDMETHODCALLTYPE Stop();
67         virtual HRESULT STDMETHODCALLTYPE Pause();
68         virtual HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME start);
69
70         DsSourcePin *GetAudioPin() {return audiopin;};
71         DsSourcePin *GetVideoPin() {return videopin;};
72
73     bool supportsAc3();
74     bool changeAType(int type,IMediaSample* ms);
75     bool changeVType(int type,IMediaSample* ms, void *details);
76
77
78 protected:
79         DsSourcePin *audiopin;
80         DsSourcePin *videopin;
81         IFilterGraph* filtergraph;
82         IReferenceClock* clock;
83         FILTER_STATE mystate;
84         REFERENCE_TIME laststart;
85         CRITICAL_SECTION filterlock;
86
87         volatile long refs;
88
89
90 };
91
92 #endif
93