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, int tparx,int tpary); // 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();
78 bool InIframemode() {return iframemode;};
92 int attachFrameBuffer(); // What does this do?
93 // ULONG timecodeToFrameNumber(ULLONG timecode);
94 // ULLONG frameNumberToTimecode(ULONG framenumber);
95 ULLONG getCurrentTimestamp();
97 bool loadOptionsfromServer(VDR* vdr);
98 bool saveOptionstoServer();
99 bool addOptionPagesToWTB(WTabBar *wtb);
100 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
101 bool handleOptionChanges(Option* option);
103 //Writing Data to Videodevice
104 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
105 virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
106 UINT DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
107 virtual bool dtsTimefix() {if (h264)return videoH264dtsfix; else return videompeg2dtsfix;}
109 virtual bool supportsh264();
110 virtual int getTeletextBufferFaktor(){return 4;};
113 virtual bool supportsAc3();
115 enum VideoPresenter {
123 MediaPacket mediapacket;
126 int getCurrentAudioMediaSample(IMediaSample** ms);
127 int DeliverAudioMediaSample();
129 int getCurrentVideoMediaSample(IMediaSample** ms);
130 int DeliverVideoMediaSample();
131 int setAudioStreamType(UCHAR type);
133 virtual long long SetStartOffset(long long curreftime, bool *rsync);
134 long long SetStartAudioOffset(long long curreftime, bool *rsync);
135 virtual void ResetTimeOffsets();
137 void SetAudioState(bool state){audioon=state;};
138 void SetAudioVolume(long volume);
140 void turnVideoOn(){videoon=true;};
141 void turnVideoOff(){videoon=false;};
143 virtual bool displayIFrame(const UCHAR* buffer, UINT length);
145 unsigned int getPosx() {return videoposx;};
146 unsigned int getPosy() {return videoposy;};
147 bool isVideoOn() {return videoon;};
148 bool isdsinited() {return dsinited;};
149 int lastAType() {return lastaudiomode;};
150 bool changeAType(int type,IMediaSample* ms);
153 const VideoFilterDescList *getVideoFilterList(int &selected);
154 bool selectVideoFilter(int filter);
155 DsSourceFilter* getSourceFilter() {return sourcefilter;};
157 const VideoFilterDescList *getVideoH264FilterList(int &selected);
158 bool selectVideoH264Filter(int filter);
166 int setPosition(int x, int y); // legacy api remove
167 #error Port the new api
170 int EnterIframePlayback();
171 #ifdef NEW_DS_MECHANISMENS
173 void initFilterDatabase();
174 IBaseFilter *getVideoFilter();
175 VideoFilterDescList videofilterlist;
176 int videofilterselected;
178 void initH264FilterDatabase();
179 IBaseFilter *getVideoH264Filter();
180 VideoFilterDescList videoH264filterlist;
181 int videoH264filterselected;
182 bool videoH264dtsfix;
183 bool videompeg2dtsfix;
185 int dsInitVideoFilter();
186 IMediaControl* dsmediacontrol;
188 IGraphBuilder* dsgraphbuilder;
189 IMediaSample* cur_audio_media_sample;
190 IMediaSample* cur_video_media_sample;
191 IBaseFilter* dsrenderer;
192 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
193 IReferenceClock *dsrefclock;
194 IMediaFilter* dsmediafilter;
195 IBasicAudio* dsbasicaudio;
196 REFERENCE_TIME cr_time;
198 DsSourceFilter* sourcefilter;
199 DsAllocator* allocatorvmr;
203 bool offsetvideonotset;
204 bool offsetaudionotset;
205 long long startoffset;
206 long long lastrefvideotime;
207 long long lastrefaudiotime;
214 REFERENCE_TIME lastreftimeRT;
215 ULLONG lastreftimePTS;
216 unsigned int videoposx;
217 unsigned int videoposy;
221 unsigned int vmrdeinterlacing;
222 VideoPresenter currentpresenter;
224 DWORD graphidentifier;