MythTV  master
format.h
Go to the documentation of this file.
1 /* format.h rh */
2 
3 #ifndef FORMAT_H
4 #define FORMAT_H
5 
6 #ifdef __GNUC__
7 #define MYTH_PACKED __attribute__((packed))
8 #else
9 #define MYTH_PACKED
10 #endif
11 
13 {
14  char finfo[12]; // "NuppelVideo" + \0
15  char version[5]; // "0.05" + \0
16  int width;
17  int height;
18  int desiredwidth; // 0 .. as it is
19  int desiredheight; // 0 .. as it is
20  char pimode; // P .. progressive
21  // I .. interlaced (2 half pics) [NI]
22  double aspect; // physical aspect ratio
23  double fps;
24  int videoblocks; // count of video-blocks -1 .. unknown 0 .. no video
25  int audioblocks; // count of audio-blocks -1 .. unknown 0 .. no audio
26  int textsblocks; // count of text-blocks -1 .. unknown 0 .. no text
28 };
29 
31 {
32  char frametype; // A .. Audio, V .. Video, S .. Sync, T .. Text
33  // R .. Seekpoint: String RTjjjjjjjj (use full packet)
34  // D .. Addition Data for Compressors
35  // ct: R .. RTjpeg Tables, F .. FFMpeg extradata
36  // X .. eXtended data, Q .. SeekTable
37  // K .. KFA table
38 
39  char comptype; // V: 0 .. raw YUV420
40  // 1 .. RTJpeg
41  // 2 .. RTJpeg with lzo afterwards
42  // 3 .. raw YUV420 with lzo afterwards
43  // 4 .. avcodec (fourcc in the extendeddata)
44  // N .. black frame
45  // L .. simply copy last frame (if lost frames)
46  // A: 0 .. Uncompressed (44100/sec 16bit 2ch)
47  // 1 .. lzo compression [NI]
48  // 2 .. layer2 (packet) [NI]
49  // 3 .. layer3 (packet)
50  // F .. flac (lossless) [NI]
51  // S .. shorten (lossless) [NI]
52  // A .. AC3 (packet)
53  // N .. null frame loudless
54  // L .. simply copy last frame (may sound bad) NI
55  // S: B .. Audio and Video sync point [NI]
56  // A .. Audio Sync Information
57  // timecode == effective dsp-frequency*100
58  // when reaching this audio sync point
59  // because many cheap soundcards are unexact
60  // and have a range from 44000 to 44250
61  // instead of the expected exact 44100 S./sec
62  // V .. Next Video Sync
63  // timecode == next video framenumber
64  // S .. Audio,Video,Text Correlation [NI]
65  // M .. New Header - format changed (only aspect now)
66  // T: C .. Closed Caption (US)
67  // T .. Teletext Subtitles (Europe)
68  char keyframe; // 0 .. keyframe
69  // 1 .. nr of frame in gop => no keyframe
70 
71  char filters; // Every bit stands for one type of filter
72  // 1 .. Gauss 5 Pixel (8*m+2*l+2*r+2*a+2*b)/16 [NYI]
73  // 2 .. Gauss 5 Pixel (8*m+1*l+1*r+1*a+1*b)/12 [NYI]
74  // 4 .. Cartoon Filter [NI]
75  // 8 .. Reserverd Filter [NI]
76  // 16 .. Reserverd Filter [NI]
77  // 32 .. Reserverd Filter [NI]
78  // 64 .. Reserverd Filter [NI]
79  // 128 .. Reserverd Filter [NI]
80 
81  int timecode; // Timecodeinformation sec*1000 + msecs
82 
83  int packetlength; // V,A,T: length of following data in stream
84  // S: length of packet correl. information [NI]
85  // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj')
86 } MYTH_PACKED;
87 
88 // The fourcc's here are for the most part taken from libavcodec.
89 // As to their correctness, I have no idea. The audio ones are surely wrong,
90 // but I suppose it doesn't really matter as long as I'm consistant.
91 
93 {
94  int version; // yes, this is repeated from the file header
95  int video_fourcc; // video encoding method used
96  int audio_fourcc; // audio encoding method used
97  // generic data
101  // codec specific
102  // mp3lame
105  // rtjpeg
109  // libavcodec
114  // seek table offset
115  long long seektable_offset;
116  // key frame adjust offset
118  // unused for later -- total size of 128 integers.
119  // new fields must be added at the end, above this comment.
120  int expansion[109];
121 } MYTH_PACKED;
122 
124 {
125  long long file_offset;
127 } MYTH_PACKED;
128 
130 {
131  int adjust;
133 } MYTH_PACKED;
134 
135 #define FRAMEHEADERSIZE sizeof(rtframeheader)
136 #define FILEHEADERSIZE sizeof(rtfileheader)
137 #define EXTENDEDSIZE sizeof(extendeddata)
138 
140 {
141  int sample;
142  int timecode;
145  unsigned char *buffer;
147  bool forcekey;
148 };
149 
151 {
152  int sample;
153  int timecode;
156  unsigned char *buffer;
157 };
158 
160 {
161  int timecode;
162  int pagenr;
165  unsigned char *buffer;
167 };
168 
170 {
171  unsigned char row;
172  unsigned char col;
173  unsigned char dbl;
174  unsigned char fg;
175  unsigned char bg;
176  unsigned char len;
177 };
178 
180 {
181  unsigned char row;
182  unsigned char rowcount;
183  unsigned char resumedirect;
184  unsigned char resumetext;
185  unsigned char clr; // clear the display
186  unsigned char len; //length of string to follow
187 };
188 
189 // resumedirect codes
190 #define CC_STYLE_POPUP 0x00
191 #define CC_STYLE_PAINT 0x01
192 #define CC_STYLE_ROLLUP 0x02
193 
194 // resumetext special codes
195 #define CC_LINE_CONT 0x02
196 #define CC_MODE_MASK 0xf0
197 #define CC_TXT_MASK 0x20
198 #define CC_CC1 0x00
199 #define CC_CC2 0x10
200 #define CC_TXT1 0x20
201 #define CC_TXT2 0x30
202 #define CC_CC3 0x40
203 #define CC_CC4 0x50
204 #define CC_TXT3 0x60
205 #define CC_TXT4 0x70
206 
207 #endif
rtframeheader
Definition: format.h:30
extendeddata::version
int version
Definition: format.h:94
rtfileheader::fps
double fps
Definition: format.h:23
teletextsubtitle::row
unsigned char row
Definition: format.h:171
vidbuffertype::buffer
unsigned char * buffer
Definition: format.h:145
rtfileheader::height
int height
Definition: format.h:17
vidbuffertype::bufferlen
int bufferlen
Definition: format.h:146
vidbuffertype::freeToEncode
int freeToEncode
Definition: format.h:143
extendeddata::lavc_maxqdiff
int lavc_maxqdiff
Definition: format.h:113
seektable_entry::file_offset
long long file_offset
Definition: format.h:125
rtfileheader::width
int width
Definition: format.h:16
extendeddata::audio_channels
int audio_channels
Definition: format.h:100
kfatable_entry::keyframe_number
int keyframe_number
Definition: format.h:132
rtfileheader::textsblocks
int textsblocks
Definition: format.h:26
rtfileheader::desiredheight
int desiredheight
Definition: format.h:19
rtframeheader::timecode
int timecode
Definition: format.h:81
seektable_entry
Definition: format.h:123
txtbuffertype::freeToEncode
int freeToEncode
Definition: format.h:163
kfatable_entry
Definition: format.h:129
ccsubtitle::len
unsigned char len
Definition: format.h:186
ccsubtitle::clr
unsigned char clr
Definition: format.h:185
extendeddata::audio_fourcc
int audio_fourcc
Definition: format.h:96
rtfileheader::desiredwidth
int desiredwidth
Definition: format.h:18
extendeddata::rtjpeg_chroma_filter
int rtjpeg_chroma_filter
Definition: format.h:108
vidbuffertype::timecode
int timecode
Definition: format.h:142
audbuffertype
Definition: format.h:150
rtfileheader
Definition: format.h:12
ccsubtitle::resumetext
unsigned char resumetext
Definition: format.h:184
rtframeheader::keyframe
char keyframe
Definition: format.h:68
txtbuffertype::buffer
unsigned char * buffer
Definition: format.h:165
txtbuffertype::bufferlen
int bufferlen
Definition: format.h:166
txtbuffertype
Definition: format.h:159
MYTH_PACKED
#define MYTH_PACKED
Definition: format.h:9
rtfileheader::videoblocks
int videoblocks
Definition: format.h:24
extendeddata::audio_compression_ratio
int audio_compression_ratio
Definition: format.h:103
extendeddata::expansion
int expansion[109]
Definition: format.h:120
teletextsubtitle
Definition: format.h:169
rtframeheader::comptype
char comptype
Definition: format.h:39
audbuffertype::timecode
int timecode
Definition: format.h:153
rtfileheader::pimode
char pimode
Definition: format.h:20
rtfileheader::finfo
char finfo[12]
Definition: format.h:14
extendeddata::video_fourcc
int video_fourcc
Definition: format.h:95
rtfileheader::audioblocks
int audioblocks
Definition: format.h:25
extendeddata::audio_bits_per_sample
int audio_bits_per_sample
Definition: format.h:99
extendeddata::lavc_bitrate
int lavc_bitrate
Definition: format.h:110
vidbuffertype::freeToBuffer
int freeToBuffer
Definition: format.h:144
teletextsubtitle::dbl
unsigned char dbl
Definition: format.h:173
extendeddata::lavc_qmin
int lavc_qmin
Definition: format.h:111
vidbuffertype::sample
int sample
Definition: format.h:141
extendeddata::keyframeadjust_offset
long long keyframeadjust_offset
Definition: format.h:117
teletextsubtitle::len
unsigned char len
Definition: format.h:176
rtframeheader::filters
char filters
Definition: format.h:71
txtbuffertype::timecode
int timecode
Definition: format.h:161
vidbuffertype::forcekey
bool forcekey
Definition: format.h:147
audbuffertype::sample
int sample
Definition: format.h:152
audbuffertype::freeToBuffer
int freeToBuffer
Definition: format.h:155
txtbuffertype::pagenr
int pagenr
Definition: format.h:162
ccsubtitle::rowcount
unsigned char rowcount
Definition: format.h:182
extendeddata::audio_sample_rate
int audio_sample_rate
Definition: format.h:98
rtframeheader::packetlength
int packetlength
Definition: format.h:83
teletextsubtitle::col
unsigned char col
Definition: format.h:172
rtfileheader::aspect
double aspect
Definition: format.h:22
extendeddata
Definition: format.h:92
extendeddata::rtjpeg_quality
int rtjpeg_quality
Definition: format.h:106
extendeddata::audio_quality
int audio_quality
Definition: format.h:104
ccsubtitle::row
unsigned char row
Definition: format.h:181
extendeddata::rtjpeg_luma_filter
int rtjpeg_luma_filter
Definition: format.h:107
rtfileheader::version
char version[5]
Definition: format.h:15
audbuffertype::buffer
unsigned char * buffer
Definition: format.h:156
seektable_entry::keyframe_number
int keyframe_number
Definition: format.h:126
extendeddata::lavc_qmax
int lavc_qmax
Definition: format.h:112
ccsubtitle
Definition: format.h:179
vidbuffertype
Definition: format.h:139
teletextsubtitle::bg
unsigned char bg
Definition: format.h:175
kfatable_entry::adjust
int adjust
Definition: format.h:131
audbuffertype::freeToEncode
int freeToEncode
Definition: format.h:154
rtframeheader::frametype
char frametype
Definition: format.h:32
rtfileheader::keyframedist
int keyframedist
Definition: format.h:27
txtbuffertype::freeToBuffer
int freeToBuffer
Definition: format.h:164
extendeddata::seektable_offset
long long seektable_offset
Definition: format.h:115
ccsubtitle::resumedirect
unsigned char resumedirect
Definition: format.h:183
teletextsubtitle::fg
unsigned char fg
Definition: format.h:174