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 UCHAR getSupportedFormats() { return 0;};
63 UINT supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
64 UCHAR supportedTVFormats() { return 0;};
66 int setConnection(UCHAR connection);
67 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
68 UCHAR getAspectRatio(){return aspectRatio;};
69 UCHAR getMode(){return mode;};
70 UCHAR getPseudoTVsize() {return pseudotvsize;};
71 int setMode(UCHAR mode);
72 int setTVsize(UCHAR size); // Is the TV a widescreen?
73 int setDefaultAspect();
75 int setPosition(int x, int y);
79 bool InIframemode() {return iframemode;};
93 int attachFrameBuffer(); // What does this do?
94 // ULONG timecodeToFrameNumber(ULLONG timecode);
95 // ULLONG frameNumberToTimecode(ULONG framenumber);
96 ULLONG getCurrentTimestamp();
98 bool loadOptionsfromServer(VDR* vdr);
99 bool saveOptionstoServer();
100 bool addOptionPagesToWTB(WTabBar *wtb);
101 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
102 bool handleOptionChanges(Option* option);
104 //Writing Data to Videodevice
105 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
106 virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
107 UINT DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
108 virtual bool dtsTimefix() {if (h264)return videoH264dtsfix; else return videompeg2dtsfix;}
110 virtual bool supportsh264();
111 virtual int getTeletextBufferFaktor(){return 4;};
114 virtual bool supportsAc3();
116 enum VideoPresenter {
124 MediaPacket mediapacket;
127 int getCurrentAudioMediaSample(IMediaSample** ms);
128 int DeliverAudioMediaSample();
130 int getCurrentVideoMediaSample(IMediaSample** ms);
131 int DeliverVideoMediaSample();
132 int setAudioStreamType(UCHAR type);
134 virtual long long SetStartOffset(long long curreftime, bool *rsync);
135 long long SetStartAudioOffset(long long curreftime, bool *rsync);
136 virtual void ResetTimeOffsets();
138 void SetAudioState(bool state){audioon=state;};
139 void SetAudioVolume(long volume);
141 void turnVideoOn(){videoon=true;};
142 void turnVideoOff(){videoon=false;};
144 virtual bool displayIFrame(const UCHAR* buffer, UINT length);
146 unsigned int getPosx() {return videoposx;};
147 unsigned int getPosy() {return videoposy;};
148 bool isVideoOn() {return videoon;};
149 bool isdsinited() {return dsinited;};
150 int lastAType() {return lastaudiomode;};
151 bool changeAType(int type,IMediaSample* ms);
154 const VideoFilterDescList *getVideoFilterList(int &selected);
155 bool selectVideoFilter(int filter);
156 DsSourceFilter* getSourceFilter() {return sourcefilter;};
158 const VideoFilterDescList *getVideoH264FilterList(int &selected);
159 bool selectVideoH264Filter(int filter);
167 int EnterIframePlayback();
168 #ifdef NEW_DS_MECHANISMENS
170 void initFilterDatabase();
171 IBaseFilter *getVideoFilter();
172 VideoFilterDescList videofilterlist;
173 int videofilterselected;
175 void initH264FilterDatabase();
176 IBaseFilter *getVideoH264Filter();
177 VideoFilterDescList videoH264filterlist;
178 int videoH264filterselected;
179 bool videoH264dtsfix;
180 bool videompeg2dtsfix;
182 int dsInitVideoFilter();
183 IMediaControl* dsmediacontrol;
185 IGraphBuilder* dsgraphbuilder;
186 IMediaSample* cur_audio_media_sample;
187 IMediaSample* cur_video_media_sample;
188 IBaseFilter* dsrenderer;
189 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
190 IReferenceClock *dsrefclock;
191 IMediaFilter* dsmediafilter;
192 IBasicAudio* dsbasicaudio;
193 REFERENCE_TIME cr_time;
195 DsSourceFilter* sourcefilter;
196 DsAllocator* allocatorvmr;
200 bool offsetvideonotset;
201 bool offsetaudionotset;
202 long long startoffset;
203 long long lastrefvideotime;
204 long long lastrefaudiotime;
211 REFERENCE_TIME lastreftimeRT;
212 ULLONG lastreftimePTS;
213 unsigned int videoposx;
214 unsigned int videoposy;
218 unsigned int vmrdeinterlacing;
219 VideoPresenter currentpresenter;
221 DWORD graphidentifier;