]> git.vomp.tv Git - vompclient.git/blob - videomvp.h
New player, ffwd/fbwd, iframe navigation stuff
[vompclient.git] / videomvp.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
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.
10
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.
15
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
19 */
20
21 // Thanks to Jon Gettler and BtB of the MVPMC project for all the hardware information
22
23
24 #ifndef VIDEOMVP_H
25 #define VIDEOMVP_H
26
27 // FIXME - check why so many things include unistd
28
29 #include <stdio.h>
30 #include <unistd.h>
31 #include <fcntl.h>
32 #include <sys/ioctl.h>
33 #include <string.h>
34
35 #include "defines.h"
36 #include "video.h"
37 #include "stb.h"
38
39 #define WRITE_LENGTH (32*1024) // Consume up to 32K at a time from Stream
40 #define WRITE_PACKETS 16       // But no more than 16 packets
41
42 class VideoMVP : public Video
43 {
44   public:
45     VideoMVP();
46     ~VideoMVP();
47
48     int init(UCHAR format);
49     int shutdown();
50
51     int setFormat(UCHAR format);
52     int setConnection(UCHAR connection);
53     int setAspectRatio(UCHAR aspectRatio);   // This one does the pin 8 scart widescreen switching
54     int setMode(UCHAR mode);
55     int setTVsize(UCHAR size);               // Is the TV a widescreen?
56     int setDefaultAspect();
57     int setSource();
58     int setPosition(int x, int y);
59     int sync();
60     int play();
61     int stop();
62     int pause();
63     int unPause();
64     int fastForward();
65     int unFastForward();
66     int reset();
67     int blank();
68     int signalOn();
69     int signalOff();
70     int attachFrameBuffer(); // What does this do?
71     ULONG timecodeToFrameNumber(ULLONG timecode);
72     ULLONG getCurrentTimestamp();
73     void displayIFrame(const UCHAR* buffer, UINT length);
74
75     // Writing Data to Videodevice
76     virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
77     virtual UINT DeliverMediaSample(const UCHAR* buffer, UINT* samplepos);
78     virtual long long SetStartOffset(long long curreftime, bool *rsync)
79     { return 0; };
80     virtual void ResetTimeOffsets();
81
82 #ifdef DEV
83     int test();
84     int test2();
85 #endif
86
87   private:
88     int checkSCART();
89     void setLetterboxBorder(char* border);
90
91     UINT deliver_start, deliver_length, deliver_count;
92     UINT mediapacket_len[WRITE_PACKETS];
93 };
94
95 #endif