2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
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.
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.
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.
36 #define NEW_DS_MECHANISMENS
38 #ifdef NEW_DS_MECHANISMENS
39 struct VideoFilterDesc {
46 typedef vector<VideoFilterDesc> VideoFilterDescList;
52 class VideoWin : public Video
58 int init(UCHAR format);
61 int setFormat(UCHAR format);
62 int setConnection(UCHAR connection);
63 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
64 UCHAR getAspectRatio(){return aspectRatio;};
65 UCHAR getMode(){return mode;};
66 UCHAR getPseudoTVsize() {return pseudotvsize;};
67 int setMode(UCHAR mode);
68 int setTVsize(UCHAR size); // Is the TV a widescreen?
69 int setDefaultAspect();
71 int setPosition(int x, int y);
75 bool InIframemode() {return iframemode;};
89 int attachFrameBuffer(); // What does this do?
90 // ULONG timecodeToFrameNumber(ULLONG timecode);
91 // ULLONG frameNumberToTimecode(ULONG framenumber);
92 ULLONG getCurrentTimestamp();
94 bool loadOptionsfromServer(VDR* vdr);
95 bool saveOptionstoServer();
96 bool addOptionPagesToWTB(WTabBar *wtb);
97 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
98 bool handleOptionChanges(Option* option);
100 //Writing Data to Videodevice
101 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
102 virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
103 UINT DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
105 virtual bool supportsh264();
108 virtual bool supportsAc3();
110 enum VideoPresenter {
118 MediaPacket mediapacket;
121 int getCurrentAudioMediaSample(IMediaSample** ms);
122 int DeliverAudioMediaSample();
124 int getCurrentVideoMediaSample(IMediaSample** ms);
125 int DeliverVideoMediaSample();
126 int setAudioStreamType(UCHAR type);
128 virtual long long SetStartOffset(long long curreftime, bool *rsync);
129 long long SetStartAudioOffset(long long curreftime, bool *rsync);
130 virtual void ResetTimeOffsets();
132 void SetAudioState(bool state){audioon=state;};
133 void SetAudioVolume(long volume);
135 void turnVideoOn(){videoon=true;};
136 void turnVideoOff(){videoon=false;};
138 virtual void displayIFrame(const UCHAR* buffer, UINT length);
140 unsigned int getPosx() {return videoposx;};
141 unsigned int getPosy() {return videoposy;};
142 bool isVideoOn() {return videoon;};
143 bool isdsinited() {return dsinited;};
144 int lastAType() {return lastaudiomode;};
145 bool changeAType(int type,IMediaSample* ms);
148 const VideoFilterDescList *getVideoFilterList(int &selected);
149 bool selectVideoFilter(int filter);
150 DsSourceFilter* getSourceFilter() {return sourcefilter;};
152 const VideoFilterDescList *getVideoH264FilterList(int &selected);
153 bool selectVideoH264Filter(int filter);
161 int EnterIframePlayback();
162 #ifdef NEW_DS_MECHANISMENS
164 void initFilterDatabase();
165 IBaseFilter *getVideoFilter();
166 VideoFilterDescList videofilterlist;
167 int videofilterselected;
169 void initH264FilterDatabase();
170 IBaseFilter *getVideoH264Filter();
171 VideoFilterDescList videoH264filterlist;
172 int videoH264filterselected;
174 int dsInitVideoFilter();
175 IMediaControl* dsmediacontrol;
177 IGraphBuilder* dsgraphbuilder;
178 IMediaSample* cur_audio_media_sample;
179 IMediaSample* cur_video_media_sample;
180 IBaseFilter* dsrenderer;
181 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
182 IReferenceClock *dsrefclock;
183 IMediaFilter* dsmediafilter;
184 IBasicAudio* dsbasicaudio;
185 REFERENCE_TIME cr_time;
187 DsSourceFilter* sourcefilter;
188 DsAllocator* allocatorvmr;
192 bool offsetvideonotset;
193 bool offsetaudionotset;
194 long long startoffset;
195 long long lastrefvideotime;
196 long long lastrefaudiotime;
203 REFERENCE_TIME lastreftimeRT;
204 ULLONG lastreftimePTS;
205 unsigned int videoposx;
206 unsigned int videoposy;
210 unsigned int vmrdeinterlacing;
211 VideoPresenter currentpresenter;
213 DWORD graphidentifier;