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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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);
74 bool loadOptionsfromServer(VDR* vdr);
75 bool saveOptionstoServer();
76 bool addOptionPagesToWTB(WTabBar *wtb);
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 //Writing Data to Videodevice
98 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
99 virtual UINT DeliverMediaSample(const UCHAR* buffer, UINT *samplepos);
100 UINT DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
102 virtual bool supportsAc3();
106 MediaPacket mediapacket;
109 int getCurrentAudioMediaSample(IMediaSample** ms);
110 int DeliverAudioMediaSample();
112 int getCurrentVideoMediaSample(IMediaSample** ms);
113 int DeliverVideoMediaSample();
114 int setAudioStreamType(UCHAR type);
116 virtual long long SetStartOffset(long long curreftime, bool *rsync);
117 long long SetStartAudioOffset(long long curreftime, bool *rsync);
118 virtual void ResetTimeOffsets();
120 void SetAudioState(bool state){audioon=state;};
121 void SetAudioVolume(long volume);
123 void turnVideoOn(){videoon=true;};
124 void turnVideoOff(){videoon=false;};
126 virtual void displayIFrame(const UCHAR* buffer, UINT length);
128 unsigned int getPosx() {return videoposx;};
129 unsigned int getPosy() {return videoposy;};
130 bool isVideoOn() {return videoon;};
131 bool isdsinited() {return dsinited;};
132 int lastAType() {return lastaudiomode;};
133 bool changeAType(int type,IMediaSample* ms);
136 const VideoFilterDescList *getVideoFilterList(int &selected);
137 bool selectVideoFilter(int filter);
138 DsSourceFilter* getSourceFilter() {return sourcefilter;};
145 int EnterIframePlayback();
146 #ifdef NEW_DS_MECHANISMENS
148 void initFilterDatabase();
149 IBaseFilter *getVideoFilter(); VideoFilterDescList videofilterlist;
150 int videofilterselected;
152 int dsInitVideoFilter();
153 IMediaControl* dsmediacontrol;
155 IGraphBuilder* dsgraphbuilder;
156 IMediaSample* cur_audio_media_sample;
157 IMediaSample* cur_video_media_sample;
158 IBaseFilter* dsvmrrenderer;
159 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
160 IReferenceClock *dsrefclock;
161 IMediaFilter* dsmediafilter;
162 IBasicAudio* dsbasicaudio;
163 REFERENCE_TIME cr_time;
165 DsSourceFilter* sourcefilter;
166 DsAllocator* allocatorvmr;
170 bool offsetvideonotset;
171 bool offsetaudionotset;
172 long long startoffset;
173 long long lastrefvideotime;
174 long long lastrefaudiotime;
181 REFERENCE_TIME lastreftimeRT;
182 ULLONG lastreftimePTS;
183 unsigned int videoposx;
184 unsigned int videoposy;
189 DWORD graphidentifier;