3 #include "libavutil/intfloat_readwrite.h"
5 typedef struct __attribute__((packed
)) rtfileheader
7 char finfo
[12]; // "NuppelVideo" + \0
8 char version
[5]; // "0.05" + \0
12 int desiredwidth
; // 0 .. as it is
13 int desiredheight
; // 0 .. as it is
14 char pimode
; // P .. progressive
15 // I .. interlaced (2 half pics) [NI]
17 double aspect
; // 1.0 .. square pixel (1.5 .. e.g. width=480: width*1.5=720
18 // for capturing for svcd material
20 int videoblocks
; // count of video-blocks -1 .. unknown 0 .. no video
21 int audioblocks
; // count of audio-blocks -1 .. unknown 0 .. no audio
22 int textsblocks
; // count of text-blocks -1 .. unknown 0 .. no text
26 typedef struct __attribute__((packed
)) rtframeheader
28 char frametype
; // A .. Audio, V .. Video, S .. Sync, T .. Text
29 // R .. Seekpoint: String RTjjjjjjjj (use full packet)
30 // D .. Addition Data for Compressors
31 // ct: R .. RTjpeg Tables
33 char comptype
; // V: 0 .. Uncompressed [NI]
35 // 2 .. RTJpeg with lzo afterwards
37 // L .. simply copy last frame (if lost frames)
38 // A: 0 .. Uncompressed (44100/sec 16bit 2ch)
39 // 1 .. lzo compression [NI]
40 // 2 .. layer2 (packet) [NI]
41 // 3 .. layer3 (packet) [NI]
42 // F .. flac (lossless) [NI]
43 // S .. shorten (lossless) [NI]
44 // N .. null frame loudless
45 // L .. simply copy last frame (may sound bad) NI
46 // S: B .. Audio and Video sync point [NI]
47 // A .. Audio Sync Information
48 // timecode == effective dsp-frequency*100
49 // when reaching this audio sync point
50 // because many cheap soundcards are unexact
51 // and have a range from 44000 to 44250
52 // instead of the expected exact 44100 S./sec
53 // V .. Next Video Sync
54 // timecode == next video framenumber
55 // S .. Audio,Video,Text Correlation [NI]
56 char keyframe
; // 0 .. keyframe
57 // 1 .. nr of frame in gop => no keyframe
59 char filters
; // Every bit stands for one type of filter
60 // 1 .. Gauss 5 Pixel (8*m+2*l+2*r+2*a+2*b)/16 [NYI]
61 // 2 .. Gauss 5 Pixel (8*m+1*l+1*r+1*a+1*b)/12 [NYI]
62 // 4 .. Cartoon Filter [NI]
63 // 8 .. Reserverd Filter [NI]
64 // 16 .. Reserverd Filter [NI]
65 // 32 .. Reserverd Filter [NI]
66 // 64 .. Reserverd Filter [NI]
67 // 128 .. Reserverd Filter [NI]
69 int timecode
; // Timecodeinformation sec*1000 + msecs
71 int packetlength
; // V,A,T: length of following data in stream
72 // S: length of packet correl. information [NI]
73 // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj')
77 typedef struct __attribute__((packed
)) extendeddata
79 int version
; // yes, this is repeated from the file header
80 int video_fourcc
; // video encoding method used
81 int audio_fourcc
; // audio encoding method used
83 int audio_sample_rate
;
84 int audio_bits_per_sample
;
88 int audio_compression_ratio
;
92 int rtjpeg_luma_filter
;
93 int rtjpeg_chroma_filter
;
99 // unused for later -- total size of 128 integers.
100 // new fields must be added at the end, above this comment.
104 #define FRAMEHEADERSIZE sizeof(rtframeheader)
105 #define FILEHEADERSIZE sizeof(rtfileheader)
107 typedef struct vidbuffertype
113 unsigned char *buffer_offset
;
116 typedef struct audbuffertype
122 unsigned char *buffer_offset
;
125 #define le2me_rtfileheader(h) { \
126 (h)->width = le2me_32((h)->width); \
127 (h)->height = le2me_32((h)->height); \
128 (h)->desiredwidth = le2me_32((h)->desiredwidth); \
129 (h)->desiredheight = le2me_32((h)->desiredheight); \
130 (h)->aspect = av_int2dbl(le2me_64(*(uint64_t *)&(h)->aspect));\
131 (h)->fps = av_int2dbl(le2me_64(*(uint64_t *)&(h)->fps)); \
132 (h)->videoblocks = le2me_32((h)->videoblocks); \
133 (h)->audioblocks = le2me_32((h)->audioblocks); \
134 (h)->textsblocks = le2me_32((h)->textsblocks); \
135 (h)->keyframedist = le2me_32((h)->keyframedist); \
137 #define le2me_rtframeheader(h) { \
138 (h)->timecode = le2me_32((h)->timecode); \
139 (h)->packetlength = le2me_32((h)->packetlength); \
141 #define le2me_extendeddata(h) { \
142 (h)->version = le2me_32((h)->version); \
143 (h)->video_fourcc = le2me_32((h)->video_fourcc); \
144 (h)->audio_fourcc = le2me_32((h)->audio_fourcc); \
145 (h)->audio_sample_rate = le2me_32((h)->audio_sample_rate); \
146 (h)->audio_bits_per_sample = le2me_32((h)->audio_bits_per_sample);\
147 (h)->audio_channels = le2me_32((h)->audio_channels); \
148 (h)->audio_compression_ratio = le2me_32((h)->audio_compression_ratio);\
149 (h)->audio_quality = le2me_32((h)->audio_quality); \
150 (h)->rtjpeg_quality = le2me_32((h)->rtjpeg_quality); \
151 (h)->rtjpeg_luma_filter = le2me_32((h)->rtjpeg_luma_filter); \
152 (h)->rtjpeg_chroma_filter = le2me_32((h)->rtjpeg_chroma_filter);\
153 (h)->lavc_bitrate = le2me_32((h)->lavc_bitrate); \
154 (h)->lavc_qmin = le2me_32((h)->lavc_qmin); \
155 (h)->lavc_qmax = le2me_32((h)->lavc_qmax); \
156 (h)->lavc_maxqdiff = le2me_32((h)->lavc_maxqdiff); \