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 {
45 typedef vector<VideoFilterDesc> VideoFilterDescList;
51 class VideoWin : public Video
57 int init(UCHAR format);
60 int setFormat(UCHAR format);
61 int setConnection(UCHAR connection);
62 int setAspectRatio(UCHAR aspectRatio); // This one does the pin 8 scart widescreen switching
63 UCHAR getAspectRatio(){return aspectRatio;};
64 UCHAR getMode(){return mode;};
65 UCHAR getPseudoTVsize() {return pseudotvsize;};
66 int setMode(UCHAR mode);
67 int setTVsize(UCHAR size); // Is the TV a widescreen?
68 int setDefaultAspect();
70 int setPosition(int x, int y);
74 bool InIframemode() {return iframemode;};
88 int attachFrameBuffer(); // What does this do?
89 ULONG timecodeToFrameNumber(ULLONG timecode);
90 ULLONG frameNumberToTimecode(ULONG framenumber);
91 ULLONG getCurrentTimestamp();
93 //Writing Data to Videodevice
94 virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
95 virtual UINT DeliverMediaSample(const UCHAR* buffer, UINT *samplepos);
96 UINT DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
98 virtual bool supportsAc3();
100 MediaPacket mediapacket;
103 int getCurrentAudioMediaSample(IMediaSample** ms);
104 int DeliverAudioMediaSample();
106 int getCurrentVideoMediaSample(IMediaSample** ms);
107 int DeliverVideoMediaSample();
109 virtual long long SetStartOffset(long long curreftime, bool *rsync);
110 long long SetStartAudioOffset(long long curreftime, bool *rsync);
111 virtual void ResetTimeOffsets();
113 void SetAudioState(bool state){audioon=state;};
114 void SetAudioVolume(long volume);
116 void turnVideoOn(){videoon=true;};
117 void turnVideoOff(){videoon=false;};
119 virtual void displayIFrame(const UCHAR* buffer, UINT length);
121 unsigned int getPosx() {return videoposx;};
122 unsigned int getPosy() {return videoposy;};
123 bool isVideoOn() {return videoon;};
124 bool isdsinited() {return dsinited;};
125 int lastAType() {return lastaudiomode;};
126 bool changeAType(int type,IMediaSample* ms);
133 int EnterIframePlayback();
134 #ifdef NEW_DS_MECHANISMENS
136 VideoFilterDescList videofilterlist;
137 int videofilterselected;
139 int dsInitVideoFilter();
140 IMediaControl* dsmediacontrol;
142 IGraphBuilder* dsgraphbuilder;
143 IMediaSample* cur_audio_media_sample;
144 IMediaSample* cur_video_media_sample;
145 IBaseFilter* dsvmrrenderer;
146 IVMRSurfaceAllocatorNotify9 *dsvmrsurfnotify;
147 IReferenceClock *dsrefclock;
148 IMediaFilter* dsmediafilter;
149 IBasicAudio* dsbasicaudio;
150 REFERENCE_TIME cr_time;
152 DsSourceFilter* sourcefilter;
153 DsAllocator* allocatorvmr;
157 bool offsetvideonotset;
158 bool offsetaudionotset;
159 long long startoffset;
160 long long lastrefvideotime;
161 long long lastrefaudiotime;
168 REFERENCE_TIME lastreftimeRT;
169 ULLONG lastreftimePTS;
170 unsigned int videoposx;
171 unsigned int videoposy;
175 DWORD graphidentifier;