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.
37 #define NEW_DS_MECHANISMENS
39 #ifdef NEW_DS_MECHANISMENS
40 struct VideoFilterDesc {
46 typedef std::vector<VideoFilterDesc> VideoFilterDescList;
52 class VideoWin : public Video
61 int setFormat(u1 format);
62 u1 getSupportedFormats() { return 0;};
63 u4 supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
64 u1 supportedTVFormats() { return 0;};
66 int setConnection(u1 connection);
67 int setAspectRatio(u1 aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
68 u1 getAspectRatio(){return aspectRatio;};
69 u1 getMode(){return mode;};
70 u1 getPseudoTVsize() {return pseudotvsize;};
72 int setTVsize(u1 size); // Is the TV a widescreen?
73 int setDefaultAspect();
78 bool InIframemode() {return iframemode;};
92 int attachFrameBuffer(); // What does this do?
93 // u4 timecodeToFrameNumber(u8 timecode);
94 // u8 frameNumberToTimecode(u4 framenumber);
95 u8 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&, u4 samplepos);
105 virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos);
106 u4 DeliverMediaPacket(const MediaPacket packet, const u1* buffer, u4 *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(u1 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 u1* buffer, u4 length);
145 const VideoDisplay & getVideoDisplay() { return vd; };
146 bool isVideoOn() {return videoon;};
147 bool isdsinited() {return dsinited;};
148 int lastAType() {return lastaudiomode;};
149 bool changeAType(int type,IMediaSample* ms);
152 const VideoFilterDescList *getVideoFilterList(int &selected);
153 bool selectVideoFilter(int filter);
154 DsSourceFilter* getSourceFilter() {return sourcefilter;};
156 const VideoFilterDescList *getVideoH264FilterList(int &selected);
157 bool selectVideoH264Filter(int filter);
165 bool setVideoDisplay(VideoDisplay display) { vd = display; return true; };
171 int EnterIframePlayback();
172 #ifdef NEW_DS_MECHANISMENS
174 void initFilterDatabase();
175 IBaseFilter *getVideoFilter();
176 VideoFilterDescList videofilterlist;
177 int videofilterselected;
179 void initH264FilterDatabase();
180 IBaseFilter *getVideoH264Filter();
181 VideoFilterDescList videoH264filterlist;
182 int videoH264filterselected;
183 bool videoH264dtsfix;
184 bool videompeg2dtsfix;
186 int dsInitVideoFilter();
187 IMediaControl* dsmediacontrol;
189 IGraphBuilder* dsgraphbuilder;
190 IMediaSample* cur_audio_media_sample;
191 IMediaSample* cur_video_media_sample;
192 IBaseFilter* dsrenderer;
193 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
194 IReferenceClock *dsrefclock;
195 IMediaFilter* dsmediafilter;
196 IBasicAudio* dsbasicaudio;
197 REFERENCE_TIME cr_time;
199 DsSourceFilter* sourcefilter;
200 DsAllocator* allocatorvmr;
201 std::mutex filtermutex;
204 bool offsetvideonotset;
205 bool offsetaudionotset;
206 long long startoffset;
207 long long lastrefvideotime;
208 long long lastrefaudiotime;
215 REFERENCE_TIME lastreftimeRT;
220 unsigned int vmrdeinterlacing;
221 VideoPresenter currentpresenter;
223 DWORD graphidentifier;