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 int setConnection(UCHAR connection);
\r
63 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
\r
64 UCHAR getAspectRatio(){return aspectRatio;};
\r
65 UCHAR getMode(){return mode;};
\r
66 UCHAR getPseudoTVsize() {return pseudotvsize;};
\r
67 int setMode(UCHAR mode);
\r
68 int setTVsize(UCHAR size); // Is the TV a widescreen?
\r
69 int setDefaultAspect();
\r
71 int setPosition(int x, int y);
\r
75 bool InIframemode() {return iframemode;};
\r
83 int unFastForward();
\r
89 int attachFrameBuffer(); // What does this do?
\r
90 // ULONG timecodeToFrameNumber(ULLONG timecode);
\r
91 // ULLONG frameNumberToTimecode(ULONG framenumber);
\r
92 ULLONG getCurrentTimestamp();
\r
94 bool loadOptionsfromServer(VDR* vdr);
\r
95 bool saveOptionstoServer();
\r
96 bool addOptionPagesToWTB(WTabBar *wtb);
\r
97 bool addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane);
\r
98 bool handleOptionChanges(Option* option);
\r
100 //Writing Data to Videodevice
\r
101 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
\r
102 virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
\r
103 UINT DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
\r
104 virtual bool dtsTimefix() {if (h264)return videoH264dtsfix; else return videompeg2dtsfix;}
\r
106 virtual bool supportsh264();
\r
109 virtual bool supportsAc3();
\r
111 enum VideoPresenter {
\r
119 MediaPacket mediapacket;
\r
122 int getCurrentAudioMediaSample(IMediaSample** ms);
\r
123 int DeliverAudioMediaSample();
\r
125 int getCurrentVideoMediaSample(IMediaSample** ms);
\r
126 int DeliverVideoMediaSample();
\r
127 int setAudioStreamType(UCHAR type);
\r
129 virtual long long SetStartOffset(long long curreftime, bool *rsync);
\r
130 long long SetStartAudioOffset(long long curreftime, bool *rsync);
\r
131 virtual void ResetTimeOffsets();
\r
133 void SetAudioState(bool state){audioon=state;};
\r
134 void SetAudioVolume(long volume);
\r
136 void turnVideoOn(){videoon=true;};
\r
137 void turnVideoOff(){videoon=false;};
\r
139 virtual bool displayIFrame(const UCHAR* buffer, UINT length);
\r
141 unsigned int getPosx() {return videoposx;};
\r
142 unsigned int getPosy() {return videoposy;};
\r
143 bool isVideoOn() {return videoon;};
\r
144 bool isdsinited() {return dsinited;};
\r
145 int lastAType() {return lastaudiomode;};
\r
146 bool changeAType(int type,IMediaSample* ms);
\r
149 const VideoFilterDescList *getVideoFilterList(int &selected);
\r
150 bool selectVideoFilter(int filter);
\r
151 DsSourceFilter* getSourceFilter() {return sourcefilter;};
\r
153 const VideoFilterDescList *getVideoH264FilterList(int &selected);
\r
154 bool selectVideoH264Filter(int filter);
\r
162 int EnterIframePlayback();
\r
163 #ifdef NEW_DS_MECHANISMENS
\r
165 void initFilterDatabase();
\r
166 IBaseFilter *getVideoFilter();
\r
167 VideoFilterDescList videofilterlist;
\r
168 int videofilterselected;
\r
170 void initH264FilterDatabase();
\r
171 IBaseFilter *getVideoH264Filter();
\r
172 VideoFilterDescList videoH264filterlist;
\r
173 int videoH264filterselected;
\r
174 bool videoH264dtsfix;
\r
175 bool videompeg2dtsfix;
\r
177 int dsInitVideoFilter();
\r
178 IMediaControl* dsmediacontrol;
\r
180 IGraphBuilder* dsgraphbuilder;
\r
181 IMediaSample* cur_audio_media_sample;
\r
182 IMediaSample* cur_video_media_sample;
\r
183 IBaseFilter* dsrenderer;
\r
184 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
\r
185 IReferenceClock *dsrefclock;
\r
186 IMediaFilter* dsmediafilter;
\r
187 IBasicAudio* dsbasicaudio;
\r
188 REFERENCE_TIME cr_time;
\r
190 DsSourceFilter* sourcefilter;
\r
191 DsAllocator* allocatorvmr;
\r
192 HANDLE filtermutex;
\r
195 bool offsetvideonotset;
\r
196 bool offsetaudionotset;
\r
197 long long startoffset;
\r
198 long long lastrefvideotime;
\r
199 long long lastrefaudiotime;
\r
205 UCHAR pseudotvsize;
\r
206 REFERENCE_TIME lastreftimeRT;
\r
207 ULLONG lastreftimePTS;
\r
208 unsigned int videoposx;
\r
209 unsigned int videoposy;
\r
213 unsigned int vmrdeinterlacing;
\r
214 VideoPresenter currentpresenter;
\r
216 DWORD graphidentifier;
\r