Mercurial > mplayer.hg
annotate libmpdemux/nuppelvideo.h @ 26733:99458e732ebd
Add detection code for abnormal pts jump when seeking previous.
This patch make the vobsub works more accurately according to the requested pts.
author | ulion |
---|---|
date | Wed, 14 May 2008 03:43:45 +0000 |
parents | 4129c8cfa742 |
children | e67b783d7289 |
rev | line source |
---|---|
3807 | 1 /* nuppelvideo.h rh */ |
2 | |
26029 | 3 #ifndef MPLAYER_NUPPELVIDEO_H |
4 #define MPLAYER_NUPPELVIDEO_H | |
25553
6ac1ece1f9fe
Add multiple inclusion guards to all header files that lack them.
diego
parents:
21347
diff
changeset
|
5 |
21347
2d5ad5048952
Use av_int2dbl to read doubles instead of our somewhat broken le2me_dbl
reimar
parents:
16164
diff
changeset
|
6 #include "libavutil/intfloat_readwrite.h" |
2d5ad5048952
Use av_int2dbl to read doubles instead of our somewhat broken le2me_dbl
reimar
parents:
16164
diff
changeset
|
7 |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
8 typedef struct __attribute__((packed)) rtfileheader |
3807 | 9 { |
10 char finfo[12]; // "NuppelVideo" + \0 | |
11 char version[5]; // "0.05" + \0 | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
12 char pad1[3]; |
3807 | 13 int width; |
14 int height; | |
15 int desiredwidth; // 0 .. as it is | |
16 int desiredheight; // 0 .. as it is | |
17 char pimode; // P .. progressive | |
18 // I .. interlaced (2 half pics) [NI] | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
19 char pad2[3]; |
3807 | 20 double aspect; // 1.0 .. square pixel (1.5 .. e.g. width=480: width*1.5=720 |
21 // for capturing for svcd material | |
22 double fps; | |
23 int videoblocks; // count of video-blocks -1 .. unknown 0 .. no video | |
24 int audioblocks; // count of audio-blocks -1 .. unknown 0 .. no audio | |
25 int textsblocks; // count of text-blocks -1 .. unknown 0 .. no text | |
26 int keyframedist; | |
27 } rtfileheader; | |
28 | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
29 typedef struct __attribute__((packed)) rtframeheader |
3807 | 30 { |
31 char frametype; // A .. Audio, V .. Video, S .. Sync, T .. Text | |
32 // R .. Seekpoint: String RTjjjjjjjj (use full packet) | |
33 // D .. Addition Data for Compressors | |
34 // ct: R .. RTjpeg Tables | |
35 | |
36 char comptype; // V: 0 .. Uncompressed [NI] | |
37 // 1 .. RTJpeg | |
38 // 2 .. RTJpeg with lzo afterwards | |
39 // N .. black frame | |
40 // L .. simply copy last frame (if lost frames) | |
41 // A: 0 .. Uncompressed (44100/sec 16bit 2ch) | |
42 // 1 .. lzo compression [NI] | |
43 // 2 .. layer2 (packet) [NI] | |
44 // 3 .. layer3 (packet) [NI] | |
45 // F .. flac (lossless) [NI] | |
46 // S .. shorten (lossless) [NI] | |
47 // N .. null frame loudless | |
48 // L .. simply copy last frame (may sound bad) NI | |
49 // S: B .. Audio and Video sync point [NI] | |
50 // A .. Audio Sync Information | |
51 // timecode == effective dsp-frequency*100 | |
52 // when reaching this audio sync point | |
53 // because many cheap soundcards are unexact | |
54 // and have a range from 44000 to 44250 | |
55 // instead of the expected exact 44100 S./sec | |
56 // V .. Next Video Sync | |
57 // timecode == next video framenumber | |
58 // S .. Audio,Video,Text Correlation [NI] | |
59 char keyframe; // 0 .. keyframe | |
60 // 1 .. nr of frame in gop => no keyframe | |
61 | |
62 char filters; // Every bit stands for one type of filter | |
63 // 1 .. Gauss 5 Pixel (8*m+2*l+2*r+2*a+2*b)/16 [NYI] | |
64 // 2 .. Gauss 5 Pixel (8*m+1*l+1*r+1*a+1*b)/12 [NYI] | |
65 // 4 .. Cartoon Filter [NI] | |
66 // 8 .. Reserverd Filter [NI] | |
67 // 16 .. Reserverd Filter [NI] | |
68 // 32 .. Reserverd Filter [NI] | |
69 // 64 .. Reserverd Filter [NI] | |
70 // 128 .. Reserverd Filter [NI] | |
71 | |
72 int timecode; // Timecodeinformation sec*1000 + msecs | |
73 | |
74 int packetlength; // V,A,T: length of following data in stream | |
75 // S: length of packet correl. information [NI] | |
76 // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj') | |
77 } rtframeheader; | |
78 | |
16164
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
79 /* for MythTV */ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
80 typedef struct __attribute__((packed)) extendeddata |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
81 { |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
82 int version; // yes, this is repeated from the file header |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
83 int video_fourcc; // video encoding method used |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
84 int audio_fourcc; // audio encoding method used |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
85 // generic data |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
86 int audio_sample_rate; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
87 int audio_bits_per_sample; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
88 int audio_channels; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
89 // codec specific |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
90 // mp3lame |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
91 int audio_compression_ratio; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
92 int audio_quality; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
93 // rtjpeg |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
94 int rtjpeg_quality; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
95 int rtjpeg_luma_filter; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
96 int rtjpeg_chroma_filter; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
97 // libavcodec |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
98 int lavc_bitrate; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
99 int lavc_qmin; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
100 int lavc_qmax; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
101 int lavc_maxqdiff; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
102 // unused for later -- total size of 128 integers. |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
103 // new fields must be added at the end, above this comment. |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
104 int expansion[113]; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
105 } extendeddata; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
106 |
3807 | 107 #define FRAMEHEADERSIZE sizeof(rtframeheader) |
108 #define FILEHEADERSIZE sizeof(rtfileheader) | |
109 | |
110 typedef struct vidbuffertype | |
111 { | |
112 int sample; | |
113 int timecode; | |
114 int freeToEncode; | |
115 int freeToBuffer; | |
116 unsigned char *buffer_offset; | |
117 } vidbuffertyp; | |
118 | |
119 typedef struct audbuffertype | |
120 { | |
121 int sample; | |
122 int timecode; | |
123 int freeToEncode; | |
124 int freeToBuffer; | |
125 unsigned char *buffer_offset; | |
126 } audbuffertyp; | |
127 | |
14896
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
128 #define le2me_rtfileheader(h) { \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
129 (h)->width = le2me_32((h)->width); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
130 (h)->height = le2me_32((h)->height); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
131 (h)->desiredwidth = le2me_32((h)->desiredwidth); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
132 (h)->desiredheight = le2me_32((h)->desiredheight); \ |
21347
2d5ad5048952
Use av_int2dbl to read doubles instead of our somewhat broken le2me_dbl
reimar
parents:
16164
diff
changeset
|
133 (h)->aspect = av_int2dbl(le2me_64(*(uint64_t *)&(h)->aspect));\ |
2d5ad5048952
Use av_int2dbl to read doubles instead of our somewhat broken le2me_dbl
reimar
parents:
16164
diff
changeset
|
134 (h)->fps = av_int2dbl(le2me_64(*(uint64_t *)&(h)->fps)); \ |
14896
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
135 (h)->videoblocks = le2me_32((h)->videoblocks); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
136 (h)->audioblocks = le2me_32((h)->audioblocks); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
137 (h)->textsblocks = le2me_32((h)->textsblocks); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
138 (h)->keyframedist = le2me_32((h)->keyframedist); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
139 } |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
140 #define le2me_rtframeheader(h) { \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
141 (h)->timecode = le2me_32((h)->timecode); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
142 (h)->packetlength = le2me_32((h)->packetlength); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
143 } |
16164
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
144 #define le2me_extendeddata(h) { \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
145 (h)->version = le2me_32((h)->version); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
146 (h)->video_fourcc = le2me_32((h)->video_fourcc); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
147 (h)->audio_fourcc = le2me_32((h)->audio_fourcc); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
148 (h)->audio_sample_rate = le2me_32((h)->audio_sample_rate); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
149 (h)->audio_bits_per_sample = le2me_32((h)->audio_bits_per_sample);\ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
150 (h)->audio_channels = le2me_32((h)->audio_channels); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
151 (h)->audio_compression_ratio = le2me_32((h)->audio_compression_ratio);\ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
152 (h)->audio_quality = le2me_32((h)->audio_quality); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
153 (h)->rtjpeg_quality = le2me_32((h)->rtjpeg_quality); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
154 (h)->rtjpeg_luma_filter = le2me_32((h)->rtjpeg_luma_filter); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
155 (h)->rtjpeg_chroma_filter = le2me_32((h)->rtjpeg_chroma_filter);\ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
156 (h)->lavc_bitrate = le2me_32((h)->lavc_bitrate); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
157 (h)->lavc_qmin = le2me_32((h)->lavc_qmin); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
158 (h)->lavc_qmax = le2me_32((h)->lavc_qmax); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
159 (h)->lavc_maxqdiff = le2me_32((h)->lavc_maxqdiff); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
160 } |
14896
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
161 |
26029 | 162 #endif /* MPLAYER_NUPPELVIDEO_H */ |