2 Copyright 2004-2005 Chris Tallon
\r
4 This file is part of VOMP.
\r
6 VOMP is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 VOMP is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with VOMP; if not, write to the Free Software
\r
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
26 #include <winsock2.h>
\r
32 #include "defines.h"
\r
36 #define NEW_DS_MECHANISMENS
\r
38 #ifdef NEW_DS_MECHANISMENS
\r
39 struct VideoFilterDesc {
\r
41 char * friendlyname;
\r
45 using namespace std;
\r
46 typedef vector<VideoFilterDesc> VideoFilterDescList;
\r
49 class DsSourceFilter;
\r
52 class VideoWin : public Video
\r
56 virtual ~VideoWin();
\r
58 int init(UCHAR format);
\r
61 int setFormat(UCHAR format);
\r
62 UCHAR getSupportedFormats() { return 0;};
\r
63 UINT supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
\r
64 UCHAR supportedTVFormats() { return 0;};
\r
66 int setConnection(UCHAR connection);
\r
67 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
\r
68 UCHAR getAspectRatio(){return aspectRatio;};
\r
69 UCHAR getMode(){return mode;};
\r
70 UCHAR getPseudoTVsize() {return pseudotvsize;};
\r
71 int setMode(UCHAR mode);
\r
72 int setTVsize(UCHAR size); // Is the TV a widescreen?
\r
73 int setDefaultAspect();
\r
75 int setPosition(int x, int y);
\r
79 bool InIframemode() {return iframemode;};
\r
87 int unFastForward();
\r
93 int attachFrameBuffer(); // What does this do?
\r
94 // ULONG timecodeToFrameNumber(ULLONG timecode);
\r
95 // ULLONG frameNumberToTimecode(ULONG framenumber);
\r
96 ULLONG getCurrentTimestamp();
\r
98 bool loadOptionsfromServer(VDR* vdr);
\r
99 bool saveOptionstoServer();
\r
100 bool addOptionPagesToWTB(WTabBar *wtb);
\r
101 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
\r
102 bool handleOptionChanges(Option* option);
\r
104 //Writing Data to Videodevice
\r
105 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
\r
106 virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
\r
107 UINT DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
\r
108 virtual bool dtsTimefix() {if (h264)return videoH264dtsfix; else return videompeg2dtsfix;}
\r
110 virtual bool supportsh264();
\r
111 virtual int getTeletextBufferFaktor(){return 4;};
\r
114 virtual bool supportsAc3();
\r
116 enum VideoPresenter {
\r
124 MediaPacket mediapacket;
\r
127 int getCurrentAudioMediaSample(IMediaSample** ms);
\r
128 int DeliverAudioMediaSample();
\r
130 int getCurrentVideoMediaSample(IMediaSample** ms);
\r
131 int DeliverVideoMediaSample();
\r
132 int setAudioStreamType(UCHAR type);
\r
134 virtual long long SetStartOffset(long long curreftime, bool *rsync);
\r
135 long long SetStartAudioOffset(long long curreftime, bool *rsync);
\r
136 virtual void ResetTimeOffsets();
\r
138 void SetAudioState(bool state){audioon=state;};
\r
139 void SetAudioVolume(long volume);
\r
141 void turnVideoOn(){videoon=true;};
\r
142 void turnVideoOff(){videoon=false;};
\r
144 virtual bool displayIFrame(const UCHAR* buffer, UINT length);
\r
146 unsigned int getPosx() {return videoposx;};
\r
147 unsigned int getPosy() {return videoposy;};
\r
148 bool isVideoOn() {return videoon;};
\r
149 bool isdsinited() {return dsinited;};
\r
150 int lastAType() {return lastaudiomode;};
\r
151 bool changeAType(int type,IMediaSample* ms);
\r
154 const VideoFilterDescList *getVideoFilterList(int &selected);
\r
155 bool selectVideoFilter(int filter);
\r
156 DsSourceFilter* getSourceFilter() {return sourcefilter;};
\r
158 const VideoFilterDescList *getVideoH264FilterList(int &selected);
\r
159 bool selectVideoH264Filter(int filter);
\r
167 int EnterIframePlayback();
\r
168 #ifdef NEW_DS_MECHANISMENS
\r
170 void initFilterDatabase();
\r
171 IBaseFilter *getVideoFilter();
\r
172 VideoFilterDescList videofilterlist;
\r
173 int videofilterselected;
\r
175 void initH264FilterDatabase();
\r
176 IBaseFilter *getVideoH264Filter();
\r
177 VideoFilterDescList videoH264filterlist;
\r
178 int videoH264filterselected;
\r
179 bool videoH264dtsfix;
\r
180 bool videompeg2dtsfix;
\r
182 int dsInitVideoFilter();
\r
183 IMediaControl* dsmediacontrol;
\r
185 IGraphBuilder* dsgraphbuilder;
\r
186 IMediaSample* cur_audio_media_sample;
\r
187 IMediaSample* cur_video_media_sample;
\r
188 IBaseFilter* dsrenderer;
\r
189 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
\r
190 IReferenceClock *dsrefclock;
\r
191 IMediaFilter* dsmediafilter;
\r
192 IBasicAudio* dsbasicaudio;
\r
193 REFERENCE_TIME cr_time;
\r
195 DsSourceFilter* sourcefilter;
\r
196 DsAllocator* allocatorvmr;
\r
197 HANDLE filtermutex;
\r
200 bool offsetvideonotset;
\r
201 bool offsetaudionotset;
\r
202 long long startoffset;
\r
203 long long lastrefvideotime;
\r
204 long long lastrefaudiotime;
\r
210 UCHAR pseudotvsize;
\r
211 REFERENCE_TIME lastreftimeRT;
\r
212 ULLONG lastreftimePTS;
\r
213 unsigned int videoposx;
\r
214 unsigned int videoposy;
\r
218 unsigned int vmrdeinterlacing;
\r
219 VideoPresenter currentpresenter;
\r
221 DWORD graphidentifier;
\r