445
|
1 |
diff -ur dvgrab-3.0.orig/avi.cc dvgrab-3.0/avi.cc
|
|
2 |
--- dvgrab-3.0.orig/avi.cc 2007-07-07 01:47:26.000000000 +0700
|
|
3 |
+++ dvgrab-3.0/avi.cc 2007-09-04 13:10:15.407408980 +0700
|
|
4 |
@@ -341,8 +341,8 @@
|
|
5 |
int frameNumIndex = 0;
|
|
6 |
for ( int i = 0; i < idx1->nEntriesInUse; ++i )
|
|
7 |
{
|
|
8 |
- FOURCC chunkID1 = make_fourcc( "00dc" );
|
|
9 |
- FOURCC chunkID2 = make_fourcc( "00db" );
|
|
10 |
+ FOURCC chunkID1 = make_fourcc((char *)"00dc" );
|
|
11 |
+ FOURCC chunkID2 = make_fourcc((char *)"00db" );
|
|
12 |
if ( idx1->aIndex[ i ].dwChunkId == chunkID1 ||
|
|
13 |
idx1->aIndex[ i ].dwChunkId == chunkID2 )
|
|
14 |
{
|
|
15 |
@@ -418,9 +418,9 @@
|
|
16 |
|
|
17 |
void AVIFile::PrintDirectoryEntryData( const RIFFDirEntry &entry )
|
|
18 |
{
|
|
19 |
- static FOURCC lastStreamType = make_fourcc( " " );
|
|
20 |
+ static FOURCC lastStreamType = make_fourcc((char *)" " );
|
|
21 |
|
|
22 |
- if ( entry.type == make_fourcc( "avih" ) )
|
|
23 |
+ if ( entry.type == make_fourcc((char *)"avih" ) )
|
|
24 |
{
|
|
25 |
|
|
26 |
int i;
|
|
27 |
@@ -443,7 +443,7 @@
|
|
28 |
cout << " dwReserved[" << i << "]: " << ( int ) main_avi_header.dwReserved[ i ] << endl;
|
|
29 |
|
|
30 |
}
|
|
31 |
- else if ( entry.type == make_fourcc( "strh" ) )
|
|
32 |
+ else if ( entry.type == make_fourcc((char *)"strh" ) )
|
|
33 |
{
|
|
34 |
|
|
35 |
AVIStreamHeader avi_stream_header;
|
|
36 |
@@ -476,7 +476,7 @@
|
|
37 |
<< " dwSampleSize: " << ( int ) avi_stream_header.dwSampleSize << endl;
|
|
38 |
|
|
39 |
}
|
|
40 |
- else if ( entry.type == make_fourcc( "indx" ) )
|
|
41 |
+ else if ( entry.type == make_fourcc((char *)"indx" ) )
|
|
42 |
{
|
|
43 |
|
|
44 |
int i;
|
|
45 |
@@ -507,9 +507,9 @@
|
|
46 |
<< " dwDuration : " << dec << avi_super_index.aIndex[ i ].dwDuration << endl;
|
|
47 |
}
|
|
48 |
}
|
|
49 |
- else if ( entry.type == make_fourcc( "strf" ) )
|
|
50 |
+ else if ( entry.type == make_fourcc((char *)"strf" ) )
|
|
51 |
{
|
|
52 |
- if ( lastStreamType == make_fourcc( "auds" ) )
|
|
53 |
+ if ( lastStreamType == make_fourcc((char *)"auds" ) )
|
|
54 |
{
|
|
55 |
WAVEFORMATEX waveformatex;
|
|
56 |
fail_if( lseek( fd, entry.offset, SEEK_SET ) == ( off_t ) - 1 );
|
|
57 |
@@ -522,7 +522,7 @@
|
|
58 |
cout << " waveformatex.wBitsPerSample : " << waveformatex.wBitsPerSample << endl;
|
|
59 |
cout << " waveformatex.cbSize : " << waveformatex.cbSize << endl;
|
|
60 |
}
|
|
61 |
- else if ( lastStreamType == make_fourcc( "vids" ) )
|
|
62 |
+ else if ( lastStreamType == make_fourcc((char *)"vids" ) )
|
|
63 |
{
|
|
64 |
BITMAPINFOHEADER bitmapinfo;
|
|
65 |
fail_if( lseek( fd, entry.offset, SEEK_SET ) == ( off_t ) - 1 );
|
|
66 |
@@ -539,7 +539,7 @@
|
|
67 |
cout << " bitmapinfo.biClrUsed : " << bitmapinfo.biClrUsed << endl;
|
|
68 |
cout << " bitmapinfo.biClrImportant : " << bitmapinfo.biClrImportant << endl;
|
|
69 |
}
|
|
70 |
- else if ( lastStreamType == make_fourcc( "iavs" ) )
|
|
71 |
+ else if ( lastStreamType == make_fourcc((char *)"iavs" ) )
|
|
72 |
{
|
|
73 |
DVINFO dvinfo;
|
|
74 |
fail_if( lseek( fd, entry.offset, SEEK_SET ) == ( off_t ) - 1 );
|
|
75 |
@@ -556,7 +556,7 @@
|
|
76 |
/* This is the Standard Index. It is an array of offsets and
|
|
77 |
sizes relative to some start offset. */
|
|
78 |
|
|
79 |
- else if ( ( entry.type == make_fourcc( "ix00" ) ) || ( entry.type == make_fourcc( "ix01" ) ) )
|
|
80 |
+ else if ( ( entry.type == make_fourcc((char *)"ix00" ) ) || ( entry.type == make_fourcc((char *)"ix01" ) ) )
|
|
81 |
{
|
|
82 |
|
|
83 |
int i;
|
|
84 |
@@ -587,13 +587,13 @@
|
|
85 |
}
|
|
86 |
|
|
87 |
}
|
|
88 |
- else if ( entry.type == make_fourcc( "idx1" ) )
|
|
89 |
+ else if ( entry.type == make_fourcc((char *)"idx1" ) )
|
|
90 |
{
|
|
91 |
|
|
92 |
int i;
|
|
93 |
int numEntries = entry.length / sizeof( int ) / 4;
|
|
94 |
DWORD *idx1 = new DWORD[ numEntries * 4 ];
|
|
95 |
- // FOURCC movi_list = FindDirectoryEntry(make_fourcc("movi"));
|
|
96 |
+ // FOURCC movi_list = FindDirectoryEntry(make_fourcc((char *)"movi"));
|
|
97 |
|
|
98 |
fail_if( lseek( fd, entry.offset, SEEK_SET ) == ( off_t ) - 1 );
|
|
99 |
fail_neg( read( fd, idx1, entry.length ) );
|
|
100 |
@@ -615,7 +615,7 @@
|
|
101 |
|
|
102 |
delete[] idx1;
|
|
103 |
}
|
|
104 |
- else if ( entry.type == make_fourcc( "dmlh" ) )
|
|
105 |
+ else if ( entry.type == make_fourcc((char *)"dmlh" ) )
|
|
106 |
{
|
|
107 |
int i;
|
|
108 |
int numEntries = entry.length / sizeof( int );
|
|
109 |
@@ -664,7 +664,7 @@
|
|
110 |
/* if we encounter a movi list, do not read it. It takes too much time
|
|
111 |
and we don't need it anyway. */
|
|
112 |
|
|
113 |
- if ( name != make_fourcc( "movi" ) )
|
|
114 |
+ if ( name != make_fourcc((char *)"movi" ) )
|
|
115 |
{
|
|
116 |
// if (1) {
|
|
117 |
|
|
118 |
@@ -698,7 +698,7 @@
|
|
119 |
{
|
|
120 |
RIFFFile::ParseRIFF();
|
|
121 |
|
|
122 |
- avih_chunk = FindDirectoryEntry( make_fourcc( "avih" ) );
|
|
123 |
+ avih_chunk = FindDirectoryEntry( make_fourcc((char *)"avih" ) );
|
|
124 |
if ( avih_chunk != -1 )
|
|
125 |
ReadChunk( avih_chunk, ( void* ) & mainHdr );
|
|
126 |
}
|
|
127 |
@@ -706,7 +706,7 @@
|
|
128 |
|
|
129 |
void AVIFile::ReadIndex()
|
|
130 |
{
|
|
131 |
- indx_chunk[ 0 ] = FindDirectoryEntry( make_fourcc( "indx" ) );
|
|
132 |
+ indx_chunk[ 0 ] = FindDirectoryEntry( make_fourcc((char *)"indx" ) );
|
|
133 |
if ( indx_chunk[ 0 ] != -1 )
|
|
134 |
{
|
|
135 |
ReadChunk( indx_chunk[ 0 ], ( void* ) indx[ 0 ] );
|
|
136 |
@@ -720,7 +720,7 @@
|
|
137 |
;
|
|
138 |
return ;
|
|
139 |
}
|
|
140 |
- idx1_chunk = FindDirectoryEntry( make_fourcc( "idx1" ) );
|
|
141 |
+ idx1_chunk = FindDirectoryEntry( make_fourcc((char *)"idx1" ) );
|
|
142 |
if ( idx1_chunk != -1 )
|
|
143 |
{
|
|
144 |
ReadChunk( idx1_chunk, ( void* ) idx1 );
|
|
145 |
@@ -729,8 +729,8 @@
|
|
146 |
|
|
147 |
/* recalc number of frames from the simple index */
|
|
148 |
int frameNumIndex = 0;
|
|
149 |
- FOURCC chunkID1 = make_fourcc( "00dc" );
|
|
150 |
- FOURCC chunkID2 = make_fourcc( "00db" );
|
|
151 |
+ FOURCC chunkID1 = make_fourcc((char *)"00dc" );
|
|
152 |
+ FOURCC chunkID2 = make_fourcc((char *)"00db" );
|
|
153 |
for ( int i = 0; i < idx1->nEntriesInUse; ++i )
|
|
154 |
{
|
|
155 |
if ( idx1->aIndex[ i ].dwChunkId == chunkID1 ||
|
|
156 |
@@ -766,9 +766,9 @@
|
|
157 |
/* make a new ix chunk. */
|
|
158 |
|
|
159 |
if ( stream == 0 )
|
|
160 |
- type = make_fourcc( "ix00" );
|
|
161 |
+ type = make_fourcc((char *)"ix00" );
|
|
162 |
else
|
|
163 |
- type = make_fourcc( "ix01" );
|
|
164 |
+ type = make_fourcc((char *)"ix01" );
|
|
165 |
ix_chunk[ stream ] = AddDirectoryEntry( type, 0, sizeof( AVIStdIndex ), movi_list );
|
|
166 |
GetDirectoryEntry( ix_chunk[ stream ], type, name, length, offset, parent );
|
|
167 |
|
|
168 |
@@ -853,8 +853,8 @@
|
|
169 |
int i, j = 0;
|
|
170 |
AVIStreamHeader avi_stream_header;
|
|
171 |
BITMAPINFOHEADER bih;
|
|
172 |
- FOURCC strh = make_fourcc( "strh" );
|
|
173 |
- FOURCC strf = make_fourcc( "strf" );
|
|
174 |
+ FOURCC strh = make_fourcc((char *)"strh" );
|
|
175 |
+ FOURCC strf = make_fourcc((char *)"strf" );
|
|
176 |
|
|
177 |
while ( ( i = FindDirectoryEntry( strh, j++ ) ) != -1 )
|
|
178 |
{
|
|
179 |
@@ -877,7 +877,7 @@
|
|
180 |
{
|
|
181 |
int i, j = 0;
|
|
182 |
AVIStreamHeader avi_stream_header;
|
|
183 |
- FOURCC strh = make_fourcc( "strh" );
|
|
184 |
+ FOURCC strh = make_fourcc((char *)"strh" );
|
|
185 |
|
|
186 |
while ( ( i = FindDirectoryEntry( strh, j++ ) ) != -1 )
|
|
187 |
{
|
|
188 |
@@ -891,7 +891,7 @@
|
|
189 |
bool AVIFile::isOpenDML( void )
|
|
190 |
{
|
|
191 |
int i, j = 0;
|
|
192 |
- FOURCC dmlh = make_fourcc( "dmlh" );
|
|
193 |
+ FOURCC dmlh = make_fourcc((char *)"dmlh" );
|
|
194 |
|
|
195 |
while ( ( i = FindDirectoryEntry( dmlh, j++ ) ) != -1 )
|
|
196 |
{
|
|
197 |
@@ -1000,12 +1000,12 @@
|
|
198 |
break;
|
|
199 |
}
|
|
200 |
|
|
201 |
- indx[ 0 ] ->dwChunkId = make_fourcc( "00__" );
|
|
202 |
+ indx[ 0 ] ->dwChunkId = make_fourcc((char *)"00__" );
|
|
203 |
|
|
204 |
/* Initialize the 'strh' chunk */
|
|
205 |
|
|
206 |
- streamHdr[ 0 ].fccType = make_fourcc( "iavs" );
|
|
207 |
- streamHdr[ 0 ].fccHandler = make_fourcc( "dvsd" );
|
|
208 |
+ streamHdr[ 0 ].fccType = make_fourcc((char *)"iavs" );
|
|
209 |
+ streamHdr[ 0 ].fccHandler = make_fourcc((char *)"dvsd" );
|
|
210 |
streamHdr[ 0 ].dwFlags = 0;
|
|
211 |
streamHdr[ 0 ].wPriority = 0;
|
|
212 |
streamHdr[ 0 ].wLanguage = 0;
|
|
213 |
@@ -1046,29 +1046,29 @@
|
|
214 |
|
|
215 |
/* Create the container directory entry */
|
|
216 |
|
|
217 |
- file_list = AddDirectoryEntry( make_fourcc( "FILE" ), make_fourcc( "FILE" ), 0, RIFF_NO_PARENT );
|
|
218 |
+ file_list = AddDirectoryEntry( make_fourcc((char *)"FILE" ), make_fourcc((char *)"FILE" ), 0, RIFF_NO_PARENT );
|
|
219 |
|
|
220 |
/* Create a basic directory structure. Only chunks defined from here on will be written to the AVI file. */
|
|
221 |
|
|
222 |
- riff_list = AddDirectoryEntry( make_fourcc( "RIFF" ), make_fourcc( "AVI " ), RIFF_LISTSIZE, file_list );
|
|
223 |
- hdrl_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "hdrl" ), RIFF_LISTSIZE, riff_list );
|
|
224 |
- avih_chunk = AddDirectoryEntry( make_fourcc( "avih" ), 0, sizeof( MainAVIHeader ), hdrl_list );
|
|
225 |
- strl_list[ 0 ] = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "strl" ), RIFF_LISTSIZE, hdrl_list );
|
|
226 |
- strh_chunk[ 0 ] = AddDirectoryEntry( make_fourcc( "strh" ), 0, sizeof( AVIStreamHeader ), strl_list[ 0 ] );
|
|
227 |
- strf_chunk[ 0 ] = AddDirectoryEntry( make_fourcc( "strf" ), 0, sizeof( dvinfo ), strl_list[ 0 ] );
|
|
228 |
+ riff_list = AddDirectoryEntry( make_fourcc((char *)"RIFF" ), make_fourcc((char *)"AVI " ), RIFF_LISTSIZE, file_list );
|
|
229 |
+ hdrl_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"hdrl" ), RIFF_LISTSIZE, riff_list );
|
|
230 |
+ avih_chunk = AddDirectoryEntry( make_fourcc((char *)"avih" ), 0, sizeof( MainAVIHeader ), hdrl_list );
|
|
231 |
+ strl_list[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"strl" ), RIFF_LISTSIZE, hdrl_list );
|
|
232 |
+ strh_chunk[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"strh" ), 0, sizeof( AVIStreamHeader ), strl_list[ 0 ] );
|
|
233 |
+ strf_chunk[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"strf" ), 0, sizeof( dvinfo ), strl_list[ 0 ] );
|
|
234 |
if ( index_type & AVI_LARGE_INDEX )
|
|
235 |
- indx_chunk[ 0 ] = AddDirectoryEntry( make_fourcc( "indx" ), 0, sizeof( AVISuperIndex ), strl_list[ 0 ] );
|
|
236 |
+ indx_chunk[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"indx" ), 0, sizeof( AVISuperIndex ), strl_list[ 0 ] );
|
|
237 |
|
|
238 |
- odml_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "odml" ), RIFF_LISTSIZE, hdrl_list );
|
|
239 |
- dmlh_chunk = AddDirectoryEntry( make_fourcc( "dmlh" ), 0, 0x00f8, odml_list );
|
|
240 |
+ odml_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"odml" ), RIFF_LISTSIZE, hdrl_list );
|
|
241 |
+ dmlh_chunk = AddDirectoryEntry( make_fourcc((char *)"dmlh" ), 0, 0x00f8, odml_list );
|
|
242 |
|
|
243 |
/* align movi list to block */
|
|
244 |
GetDirectoryEntry( hdrl_list, type, name, length, offset, parent );
|
|
245 |
num_blocks = length / PADDING_SIZE + 1;
|
|
246 |
length = num_blocks * PADDING_SIZE - length - 5 * RIFF_HEADERSIZE; // why 5?
|
|
247 |
- junk_chunk = AddDirectoryEntry( make_fourcc( "JUNK" ), 0, length, riff_list );
|
|
248 |
+ junk_chunk = AddDirectoryEntry( make_fourcc((char *)"JUNK" ), 0, length, riff_list );
|
|
249 |
|
|
250 |
- movi_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "movi" ), RIFF_LISTSIZE, riff_list );
|
|
251 |
+ movi_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"movi" ), RIFF_LISTSIZE, riff_list );
|
|
252 |
|
|
253 |
/* The ix00 chunk will be added dynamically to the movi_list in avi_write_frame
|
|
254 |
as needed */
|
|
255 |
@@ -1108,7 +1108,7 @@
|
|
256 |
frame, then add a JUNK chunk which is sized such that we
|
|
257 |
end up on a 512 bytes boundary. */
|
|
258 |
|
|
259 |
- frame_chunk = AddDirectoryEntry( make_fourcc( "00__" ), 0, frame->GetDataLen(), movi_list );
|
|
260 |
+ frame_chunk = AddDirectoryEntry( make_fourcc((char *)"00__" ), 0, frame->GetDataLen(), movi_list );
|
|
261 |
if ( ( index_type & AVI_LARGE_INDEX ) && ( streamHdr[ 0 ].dwLength % IX00_INDEX_SIZE ) == 0 )
|
|
262 |
{
|
|
263 |
GetDirectoryEntry( frame_chunk, type, name, length, offset, parent );
|
|
264 |
@@ -1117,7 +1117,7 @@
|
|
265 |
WriteChunk( frame_chunk, frame->data );
|
|
266 |
// num_blocks = (frame->GetDataLen() + RIFF_HEADERSIZE) / PADDING_SIZE + 1;
|
|
267 |
// length = num_blocks * PADDING_SIZE - frame->GetDataLen() - 2 * RIFF_HEADERSIZE;
|
|
268 |
- // junk_chunk = AddDirectoryEntry(make_fourcc("JUNK"), 0, length, movi_list);
|
|
269 |
+ // junk_chunk = AddDirectoryEntry(make_fourcc((char *)"JUNK"), 0, length, movi_list);
|
|
270 |
// WriteChunk(junk_chunk, g_zeroes);
|
|
271 |
|
|
272 |
if ( index_type & AVI_LARGE_INDEX )
|
|
273 |
@@ -1143,7 +1143,7 @@
|
|
274 |
/* write idx1 only once and before end of first GB */
|
|
275 |
if ( ( index_type & AVI_SMALL_INDEX ) && isUpdateIdx1 )
|
|
276 |
{
|
|
277 |
- int idx1_chunk = AddDirectoryEntry( make_fourcc( "idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
278 |
+ int idx1_chunk = AddDirectoryEntry( make_fourcc((char *)"idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
279 |
WriteChunk( idx1_chunk, ( void* ) idx1 );
|
|
280 |
}
|
|
281 |
isUpdateIdx1 = false;
|
|
282 |
@@ -1152,7 +1152,7 @@
|
|
283 |
{
|
|
284 |
/* pad out to 1GB */
|
|
285 |
//GetDirectoryEntry(riff_list, type, name, length, offset, parent);
|
|
286 |
- //junk_chunk = AddDirectoryEntry(make_fourcc("JUNK"), 0, PADDING_1GB - length - 5 * RIFF_HEADERSIZE, riff_list);
|
|
287 |
+ //junk_chunk = AddDirectoryEntry(make_fourcc((char *)"JUNK"), 0, PADDING_1GB - length - 5 * RIFF_HEADERSIZE, riff_list);
|
|
288 |
//WriteChunk(junk_chunk, g_zeroes);
|
|
289 |
|
|
290 |
/* padding for alignment */
|
|
291 |
@@ -1161,12 +1161,12 @@
|
|
292 |
length = ( num_blocks * PADDING_SIZE ) - length - 4 * RIFF_HEADERSIZE - 2 * RIFF_LISTSIZE;
|
|
293 |
if ( length > 0 )
|
|
294 |
{
|
|
295 |
- junk_chunk = AddDirectoryEntry( make_fourcc( "JUNK" ), 0, length, riff_list );
|
|
296 |
+ junk_chunk = AddDirectoryEntry( make_fourcc((char *)"JUNK" ), 0, length, riff_list );
|
|
297 |
WriteChunk( junk_chunk, g_zeroes );
|
|
298 |
}
|
|
299 |
|
|
300 |
- riff_list = AddDirectoryEntry( make_fourcc( "RIFF" ), make_fourcc( "AVIX" ), RIFF_LISTSIZE, file_list );
|
|
301 |
- movi_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "movi" ), RIFF_LISTSIZE, riff_list );
|
|
302 |
+ riff_list = AddDirectoryEntry( make_fourcc((char *)"RIFF" ), make_fourcc((char *)"AVIX" ), RIFF_LISTSIZE, file_list );
|
|
303 |
+ movi_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"movi" ), RIFF_LISTSIZE, riff_list );
|
|
304 |
}
|
|
305 |
}
|
|
306 |
return true;
|
|
307 |
@@ -1189,7 +1189,7 @@
|
|
308 |
|
|
309 |
if ( ( index_type & AVI_SMALL_INDEX ) && isUpdateIdx1 )
|
|
310 |
{
|
|
311 |
- int idx1_chunk = AddDirectoryEntry( make_fourcc( "idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
312 |
+ int idx1_chunk = AddDirectoryEntry( make_fourcc((char *)"idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
313 |
WriteChunk( idx1_chunk, ( void* ) idx1 );
|
|
314 |
}
|
|
315 |
|
|
316 |
@@ -1231,8 +1231,8 @@
|
|
317 |
|
|
318 |
/* Initialize the 'strh' chunk */
|
|
319 |
|
|
320 |
- streamHdr[ 0 ].fccType = make_fourcc( "vids" );
|
|
321 |
- streamHdr[ 0 ].fccHandler = make_fourcc( "dvsd" );
|
|
322 |
+ streamHdr[ 0 ].fccType = make_fourcc((char *)"vids" );
|
|
323 |
+ streamHdr[ 0 ].fccHandler = make_fourcc((char *)"dvsd" );
|
|
324 |
streamHdr[ 0 ].dwFlags = 0;
|
|
325 |
streamHdr[ 0 ].wPriority = 0;
|
|
326 |
streamHdr[ 0 ].wLanguage = 0;
|
|
327 |
@@ -1254,14 +1254,14 @@
|
|
328 |
bitmapinfo.biHeight = 576;
|
|
329 |
bitmapinfo.biPlanes = 1;
|
|
330 |
bitmapinfo.biBitCount = 24;
|
|
331 |
- bitmapinfo.biCompression = make_fourcc( "dvsd" );
|
|
332 |
+ bitmapinfo.biCompression = make_fourcc((char *)"dvsd" );
|
|
333 |
bitmapinfo.biSizeImage = 144000;
|
|
334 |
bitmapinfo.biXPelsPerMeter = 0;
|
|
335 |
bitmapinfo.biYPelsPerMeter = 0;
|
|
336 |
bitmapinfo.biClrUsed = 0;
|
|
337 |
bitmapinfo.biClrImportant = 0;
|
|
338 |
|
|
339 |
- streamHdr[ 1 ].fccType = make_fourcc( "auds" );
|
|
340 |
+ streamHdr[ 1 ].fccType = make_fourcc((char *)"auds" );
|
|
341 |
streamHdr[ 1 ].fccHandler = 0;
|
|
342 |
streamHdr[ 1 ].dwFlags = 0;
|
|
343 |
streamHdr[ 1 ].wPriority = 0;
|
|
344 |
@@ -1289,8 +1289,8 @@
|
|
345 |
|
|
346 |
/* Initialize the 'strh' chunk */
|
|
347 |
|
|
348 |
- streamHdr[ 0 ].fccType = make_fourcc( "vids" );
|
|
349 |
- streamHdr[ 0 ].fccHandler = make_fourcc( "dvsd" );
|
|
350 |
+ streamHdr[ 0 ].fccType = make_fourcc((char *)"vids" );
|
|
351 |
+ streamHdr[ 0 ].fccHandler = make_fourcc((char *)"dvsd" );
|
|
352 |
streamHdr[ 0 ].dwFlags = 0;
|
|
353 |
streamHdr[ 0 ].wPriority = 0;
|
|
354 |
streamHdr[ 0 ].wLanguage = 0;
|
|
355 |
@@ -1312,14 +1312,14 @@
|
|
356 |
bitmapinfo.biHeight = 480;
|
|
357 |
bitmapinfo.biPlanes = 1;
|
|
358 |
bitmapinfo.biBitCount = 24;
|
|
359 |
- bitmapinfo.biCompression = make_fourcc( "dvsd" );
|
|
360 |
+ bitmapinfo.biCompression = make_fourcc((char *)"dvsd" );
|
|
361 |
bitmapinfo.biSizeImage = 120000;
|
|
362 |
bitmapinfo.biXPelsPerMeter = 0;
|
|
363 |
bitmapinfo.biYPelsPerMeter = 0;
|
|
364 |
bitmapinfo.biClrUsed = 0;
|
|
365 |
bitmapinfo.biClrImportant = 0;
|
|
366 |
|
|
367 |
- streamHdr[ 1 ].fccType = make_fourcc( "auds" );
|
|
368 |
+ streamHdr[ 1 ].fccType = make_fourcc((char *)"auds" );
|
|
369 |
streamHdr[ 1 ].fccHandler = 0;
|
|
370 |
streamHdr[ 1 ].dwFlags = 0;
|
|
371 |
streamHdr[ 1 ].wPriority = 0;
|
|
372 |
@@ -1347,47 +1347,47 @@
|
|
373 |
waveformatex.wBitsPerSample = 16;
|
|
374 |
waveformatex.cbSize = 0;
|
|
375 |
|
|
376 |
- file_list = AddDirectoryEntry( make_fourcc( "FILE" ), make_fourcc( "FILE" ), 0, RIFF_NO_PARENT );
|
|
377 |
+ file_list = AddDirectoryEntry( make_fourcc((char *)"FILE" ), make_fourcc((char *)"FILE" ), 0, RIFF_NO_PARENT );
|
|
378 |
|
|
379 |
/* Create a basic directory structure. Only chunks defined from here on will be written to the AVI file. */
|
|
380 |
|
|
381 |
- riff_list = AddDirectoryEntry( make_fourcc( "RIFF" ), make_fourcc( "AVI " ), RIFF_LISTSIZE, file_list );
|
|
382 |
- hdrl_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "hdrl" ), RIFF_LISTSIZE, riff_list );
|
|
383 |
- avih_chunk = AddDirectoryEntry( make_fourcc( "avih" ), 0, sizeof( MainAVIHeader ), hdrl_list );
|
|
384 |
-
|
|
385 |
- strl_list[ 0 ] = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "strl" ), RIFF_LISTSIZE, hdrl_list );
|
|
386 |
- strh_chunk[ 0 ] = AddDirectoryEntry( make_fourcc( "strh" ), 0, sizeof( AVIStreamHeader ), strl_list[ 0 ] );
|
|
387 |
- strf_chunk[ 0 ] = AddDirectoryEntry( make_fourcc( "strf" ), 0, sizeof( BITMAPINFOHEADER ), strl_list[ 0 ] );
|
|
388 |
+ riff_list = AddDirectoryEntry( make_fourcc((char *)"RIFF" ), make_fourcc((char *)"AVI " ), RIFF_LISTSIZE, file_list );
|
|
389 |
+ hdrl_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"hdrl" ), RIFF_LISTSIZE, riff_list );
|
|
390 |
+ avih_chunk = AddDirectoryEntry( make_fourcc((char *)"avih" ), 0, sizeof( MainAVIHeader ), hdrl_list );
|
|
391 |
+
|
|
392 |
+ strl_list[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"strl" ), RIFF_LISTSIZE, hdrl_list );
|
|
393 |
+ strh_chunk[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"strh" ), 0, sizeof( AVIStreamHeader ), strl_list[ 0 ] );
|
|
394 |
+ strf_chunk[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"strf" ), 0, sizeof( BITMAPINFOHEADER ), strl_list[ 0 ] );
|
|
395 |
if ( index_type & AVI_LARGE_INDEX )
|
|
396 |
{
|
|
397 |
- indx_chunk[ 0 ] = AddDirectoryEntry( make_fourcc( "indx" ), 0, sizeof( AVISuperIndex ), strl_list[ 0 ] );
|
|
398 |
+ indx_chunk[ 0 ] = AddDirectoryEntry( make_fourcc((char *)"indx" ), 0, sizeof( AVISuperIndex ), strl_list[ 0 ] );
|
|
399 |
ix_chunk[ 0 ] = -1;
|
|
400 |
- indx[ 0 ] ->dwChunkId = make_fourcc( "00dc" );
|
|
401 |
+ indx[ 0 ] ->dwChunkId = make_fourcc((char *)"00dc" );
|
|
402 |
}
|
|
403 |
|
|
404 |
- strl_list[ 1 ] = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "strl" ), RIFF_LISTSIZE, hdrl_list );
|
|
405 |
- strh_chunk[ 1 ] = AddDirectoryEntry( make_fourcc( "strh" ), 0, sizeof( AVIStreamHeader ), strl_list[ 1 ] );
|
|
406 |
- strf_chunk[ 1 ] = AddDirectoryEntry( make_fourcc( "strf" ), 0, sizeof( WAVEFORMATEX ) - 2, strl_list[ 1 ] );
|
|
407 |
- junk_chunk = AddDirectoryEntry( make_fourcc( "JUNK" ), 0, 2, strl_list[ 1 ] );
|
|
408 |
+ strl_list[ 1 ] = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"strl" ), RIFF_LISTSIZE, hdrl_list );
|
|
409 |
+ strh_chunk[ 1 ] = AddDirectoryEntry( make_fourcc((char *)"strh" ), 0, sizeof( AVIStreamHeader ), strl_list[ 1 ] );
|
|
410 |
+ strf_chunk[ 1 ] = AddDirectoryEntry( make_fourcc((char *)"strf" ), 0, sizeof( WAVEFORMATEX ) - 2, strl_list[ 1 ] );
|
|
411 |
+ junk_chunk = AddDirectoryEntry( make_fourcc((char *)"JUNK" ), 0, 2, strl_list[ 1 ] );
|
|
412 |
if ( index_type & AVI_LARGE_INDEX )
|
|
413 |
{
|
|
414 |
- indx_chunk[ 1 ] = AddDirectoryEntry( make_fourcc( "indx" ), 0, sizeof( AVISuperIndex ), strl_list[ 1 ] );
|
|
415 |
+ indx_chunk[ 1 ] = AddDirectoryEntry( make_fourcc((char *)"indx" ), 0, sizeof( AVISuperIndex ), strl_list[ 1 ] );
|
|
416 |
ix_chunk[ 1 ] = -1;
|
|
417 |
- indx[ 1 ] ->dwChunkId = make_fourcc( "01wb" );
|
|
418 |
+ indx[ 1 ] ->dwChunkId = make_fourcc((char *)"01wb" );
|
|
419 |
|
|
420 |
- odml_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "odml" ), RIFF_LISTSIZE, hdrl_list );
|
|
421 |
- dmlh_chunk = AddDirectoryEntry( make_fourcc( "dmlh" ), 0, 0x00f8, odml_list );
|
|
422 |
+ odml_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"odml" ), RIFF_LISTSIZE, hdrl_list );
|
|
423 |
+ dmlh_chunk = AddDirectoryEntry( make_fourcc((char *)"dmlh" ), 0, 0x00f8, odml_list );
|
|
424 |
}
|
|
425 |
|
|
426 |
/* align movi list to block */
|
|
427 |
GetDirectoryEntry( hdrl_list, type, name, length, offset, parent );
|
|
428 |
num_blocks = length / PADDING_SIZE + 1;
|
|
429 |
length = num_blocks * PADDING_SIZE - length - 5 * RIFF_HEADERSIZE; // why 5 headers?
|
|
430 |
- junk_chunk = AddDirectoryEntry( make_fourcc( "JUNK" ), 0, length, riff_list );
|
|
431 |
+ junk_chunk = AddDirectoryEntry( make_fourcc((char *)"JUNK" ), 0, length, riff_list );
|
|
432 |
|
|
433 |
- movi_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "movi" ), RIFF_LISTSIZE, riff_list );
|
|
434 |
+ movi_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"movi" ), RIFF_LISTSIZE, riff_list );
|
|
435 |
|
|
436 |
- idx1->aIndex[ idx1->nEntriesInUse ].dwChunkId = make_fourcc( "7Fxx" );
|
|
437 |
+ idx1->aIndex[ idx1->nEntriesInUse ].dwChunkId = make_fourcc((char *)"7Fxx" );
|
|
438 |
idx1->aIndex[ idx1->nEntriesInUse ].dwFlags = 0;
|
|
439 |
idx1->aIndex[ idx1->nEntriesInUse ].dwOffset = 0;
|
|
440 |
idx1->aIndex[ idx1->nEntriesInUse ].dwSize = 0;
|
|
441 |
@@ -1416,7 +1416,7 @@
|
|
442 |
|
|
443 |
if ( ( index_type & AVI_SMALL_INDEX ) && isUpdateIdx1 )
|
|
444 |
{
|
|
445 |
- int idx1_chunk = AddDirectoryEntry( make_fourcc( "idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
446 |
+ int idx1_chunk = AddDirectoryEntry( make_fourcc((char *)"idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
447 |
WriteChunk( idx1_chunk, ( void* ) idx1 );
|
|
448 |
}
|
|
449 |
RIFFFile::WriteRIFF();
|
|
450 |
@@ -1463,7 +1463,7 @@
|
|
451 |
audio_size = ((DVFrame*)frame)->ExtractAudio( soundbuf );
|
|
452 |
if ( audio_size > 0 )
|
|
453 |
{
|
|
454 |
- audio_chunk = AddDirectoryEntry( make_fourcc( "01wb" ), 0, audio_size, movi_list );
|
|
455 |
+ audio_chunk = AddDirectoryEntry( make_fourcc((char *)"01wb" ), 0, audio_size, movi_list );
|
|
456 |
if ( ( index_type & AVI_LARGE_INDEX ) && ( streamHdr[ 0 ].dwLength % IX00_INDEX_SIZE ) == 0 )
|
|
457 |
{
|
|
458 |
GetDirectoryEntry( audio_chunk, type, name, length, offset, parent );
|
|
459 |
@@ -1472,7 +1472,7 @@
|
|
460 |
WriteChunk( audio_chunk, soundbuf );
|
|
461 |
// num_blocks = (audio_size + RIFF_HEADERSIZE) / PADDING_SIZE + 1;
|
|
462 |
// length = num_blocks * PADDING_SIZE - audio_size - 2 * RIFF_HEADERSIZE;
|
|
463 |
- // junk_chunk = AddDirectoryEntry(make_fourcc("JUNK"), 0, length, movi_list);
|
|
464 |
+ // junk_chunk = AddDirectoryEntry(make_fourcc((char *)"JUNK"), 0, length, movi_list);
|
|
465 |
// WriteChunk(junk_chunk, g_zeroes);
|
|
466 |
if ( index_type & AVI_LARGE_INDEX )
|
|
467 |
UpdateIndx( 1, audio_chunk, audio_size / waveformatex.nChannels / 2 );
|
|
468 |
@@ -1484,7 +1484,7 @@
|
|
469 |
|
|
470 |
/* Write video data */
|
|
471 |
|
|
472 |
- frame_chunk = AddDirectoryEntry( make_fourcc( "00dc" ), 0, frame->GetDataLen(), movi_list );
|
|
473 |
+ frame_chunk = AddDirectoryEntry( make_fourcc((char *)"00dc" ), 0, frame->GetDataLen(), movi_list );
|
|
474 |
if ( ( index_type & AVI_LARGE_INDEX ) && ( streamHdr[ 0 ].dwLength % IX00_INDEX_SIZE ) == 0 )
|
|
475 |
{
|
|
476 |
GetDirectoryEntry( frame_chunk, type, name, length, offset, parent );
|
|
477 |
@@ -1493,7 +1493,7 @@
|
|
478 |
WriteChunk( frame_chunk, frame->data );
|
|
479 |
// num_blocks = (frame->GetDataLen() + RIFF_HEADERSIZE) / PADDING_SIZE + 1;
|
|
480 |
// length = num_blocks * PADDING_SIZE - frame->GetDataLen() - 2 * RIFF_HEADERSIZE;
|
|
481 |
- // junk_chunk = AddDirectoryEntry(make_fourcc("JUNK"), 0, length, movi_list);
|
|
482 |
+ // junk_chunk = AddDirectoryEntry(make_fourcc((char *)"JUNK"), 0, length, movi_list);
|
|
483 |
// WriteChunk(junk_chunk, g_zeroes);
|
|
484 |
if ( index_type & AVI_LARGE_INDEX )
|
|
485 |
UpdateIndx( 0, frame_chunk, 1 );
|
|
486 |
@@ -1519,7 +1519,7 @@
|
|
487 |
/* write idx1 only once and before end of first GB */
|
|
488 |
if ( ( index_type & AVI_SMALL_INDEX ) && isUpdateIdx1 )
|
|
489 |
{
|
|
490 |
- int idx1_chunk = AddDirectoryEntry( make_fourcc( "idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
491 |
+ int idx1_chunk = AddDirectoryEntry( make_fourcc((char *)"idx1" ), 0, idx1->nEntriesInUse * 16, riff_list );
|
|
492 |
WriteChunk( idx1_chunk, ( void* ) idx1 );
|
|
493 |
}
|
|
494 |
isUpdateIdx1 = false;
|
|
495 |
@@ -1532,12 +1532,12 @@
|
|
496 |
length = ( num_blocks * PADDING_SIZE ) - length - 4 * RIFF_HEADERSIZE - 2 * RIFF_LISTSIZE;
|
|
497 |
if ( length > 0 )
|
|
498 |
{
|
|
499 |
- junk_chunk = AddDirectoryEntry( make_fourcc( "JUNK" ), 0, length, riff_list );
|
|
500 |
+ junk_chunk = AddDirectoryEntry( make_fourcc((char *)"JUNK" ), 0, length, riff_list );
|
|
501 |
WriteChunk( junk_chunk, g_zeroes );
|
|
502 |
}
|
|
503 |
|
|
504 |
- riff_list = AddDirectoryEntry( make_fourcc( "RIFF" ), make_fourcc( "AVIX" ), RIFF_LISTSIZE, file_list );
|
|
505 |
- movi_list = AddDirectoryEntry( make_fourcc( "LIST" ), make_fourcc( "movi" ), RIFF_LISTSIZE, riff_list );
|
|
506 |
+ riff_list = AddDirectoryEntry( make_fourcc((char *)"RIFF" ), make_fourcc((char *)"AVIX" ), RIFF_LISTSIZE, file_list );
|
|
507 |
+ movi_list = AddDirectoryEntry( make_fourcc((char *)"LIST" ), make_fourcc((char *)"movi" ), RIFF_LISTSIZE, riff_list );
|
|
508 |
}
|
|
509 |
}
|
|
510 |
return true;
|
|
511 |
@@ -1568,7 +1568,7 @@
|
|
512 |
if ( streamHdr[ i ].fccType == type )
|
|
513 |
{
|
|
514 |
int k, j = 0;
|
|
515 |
- FOURCC strf = make_fourcc( "strf" );
|
|
516 |
+ FOURCC strf = make_fourcc((char *)"strf" );
|
|
517 |
BITMAPINFOHEADER bih;
|
|
518 |
|
|
519 |
streamHdr[ i ].fccHandler = handler;
|
|
520 |
diff -ur dvgrab-3.0.orig/avi.h dvgrab-3.0/avi.h
|
|
521 |
--- dvgrab-3.0.orig/avi.h 2007-07-07 01:47:26.000000000 +0700
|
|
522 |
+++ dvgrab-3.0/avi.h 2007-09-04 13:06:50.888773270 +0700
|
|
523 |
@@ -31,7 +31,15 @@
|
|
524 |
#include "riff.h"
|
|
525 |
#include "dvframe.h"
|
|
526 |
|
|
527 |
+#if !defined(__ASSERT_FUNCTION)
|
|
528 |
+#define __ASSERT_FUNCTION __func__
|
|
529 |
+#endif
|
|
530 |
+
|
|
531 |
+#if defined(__SUNPRO_CC)
|
|
532 |
+#define PACKED(x) x
|
|
533 |
+#else
|
|
534 |
#define PACKED(x) __attribute__((packed)) x
|
|
535 |
+#endif
|
|
536 |
|
|
537 |
#define AVI_SMALL_INDEX (0x01)
|
|
538 |
#define AVI_LARGE_INDEX (0x02)
|
|
539 |
@@ -45,6 +53,9 @@
|
|
540 |
|
|
541 |
The contents of this struct goes into the 'avih' chunk. */
|
|
542 |
|
|
543 |
+#if defined(__SUNPRO_CC)
|
|
544 |
+#pragma packed(1)
|
|
545 |
+#endif
|
|
546 |
typedef struct
|
|
547 |
{
|
|
548 |
/// frame display rate (or 0L)
|
|
549 |
@@ -71,17 +82,29 @@
|
|
550 |
DWORD dwReserved[ 4 ];
|
|
551 |
}
|
|
552 |
PACKED(MainAVIHeader);
|
|
553 |
+#if defined(__SUNPRO_CC)
|
|
554 |
+#pragma packed
|
|
555 |
+#endif
|
|
556 |
|
|
557 |
+#if defined(__SUNPRO_CC)
|
|
558 |
+#pragma packed(1)
|
|
559 |
+#endif
|
|
560 |
typedef struct
|
|
561 |
{
|
|
562 |
WORD top, bottom, left, right;
|
|
563 |
}
|
|
564 |
PACKED(RECT);
|
|
565 |
+#if defined(__SUNPRO_CC)
|
|
566 |
+#pragma packed
|
|
567 |
+#endif
|
|
568 |
|
|
569 |
/** Declaration of a stream header
|
|
570 |
|
|
571 |
The contents of this struct goes into the 'strh' header. */
|
|
572 |
|
|
573 |
+#if defined(__SUNPRO_CC)
|
|
574 |
+#pragma packed(1)
|
|
575 |
+#endif
|
|
576 |
typedef struct
|
|
577 |
{
|
|
578 |
FOURCC fccType;
|
|
579 |
@@ -100,7 +123,13 @@
|
|
580 |
RECT rcFrame;
|
|
581 |
}
|
|
582 |
PACKED(AVIStreamHeader);
|
|
583 |
+#if defined(__SUNPRO_CC)
|
|
584 |
+#pragma packed
|
|
585 |
+#endif
|
|
586 |
|
|
587 |
+#if defined(__SUNPRO_CC)
|
|
588 |
+#pragma packed(1)
|
|
589 |
+#endif
|
|
590 |
typedef struct
|
|
591 |
{
|
|
592 |
DWORD dwDVAAuxSrc;
|
|
593 |
@@ -112,7 +141,13 @@
|
|
594 |
DWORD dwDVReserved[ 2 ];
|
|
595 |
}
|
|
596 |
PACKED(DVINFO);
|
|
597 |
+#if defined(__SUNPRO_CC)
|
|
598 |
+#pragma packed
|
|
599 |
+#endif
|
|
600 |
|
|
601 |
+#if defined(__SUNPRO_CC)
|
|
602 |
+#pragma packed(1)
|
|
603 |
+#endif
|
|
604 |
typedef struct
|
|
605 |
{
|
|
606 |
DWORD biSize;
|
|
607 |
@@ -128,7 +163,13 @@
|
|
608 |
DWORD biClrImportant;
|
|
609 |
}
|
|
610 |
PACKED(BITMAPINFOHEADER);
|
|
611 |
+#if defined(__SUNPRO_CC)
|
|
612 |
+#pragma packed
|
|
613 |
+#endif
|
|
614 |
|
|
615 |
+#if defined(__SUNPRO_CC)
|
|
616 |
+#pragma packed(1)
|
|
617 |
+#endif
|
|
618 |
typedef struct
|
|
619 |
{
|
|
620 |
WORD wFormatTag;
|
|
621 |
@@ -141,7 +182,13 @@
|
|
622 |
WORD dummy;
|
|
623 |
}
|
|
624 |
PACKED(WAVEFORMATEX);
|
|
625 |
+#if defined(__SUNPRO_CC)
|
|
626 |
+#pragma packed
|
|
627 |
+#endif
|
|
628 |
|
|
629 |
+#if defined(__SUNPRO_CC)
|
|
630 |
+#pragma packed(1)
|
|
631 |
+#endif
|
|
632 |
typedef struct
|
|
633 |
{
|
|
634 |
WORD wLongsPerEntry;
|
|
635 |
@@ -159,7 +206,13 @@
|
|
636 |
aIndex[ 2014 ];
|
|
637 |
}
|
|
638 |
PACKED(AVISuperIndex);
|
|
639 |
+#if defined(__SUNPRO_CC)
|
|
640 |
+#pragma packed
|
|
641 |
+#endif
|
|
642 |
|
|
643 |
+#if defined(__SUNPRO_CC)
|
|
644 |
+#pragma packed(1)
|
|
645 |
+#endif
|
|
646 |
typedef struct
|
|
647 |
{
|
|
648 |
WORD wLongsPerEntry;
|
|
649 |
@@ -177,7 +230,13 @@
|
|
650 |
aIndex[ 4028 ];
|
|
651 |
}
|
|
652 |
PACKED(AVIStdIndex);
|
|
653 |
+#if defined(__SUNPRO_CC)
|
|
654 |
+#pragma packed
|
|
655 |
+#endif
|
|
656 |
|
|
657 |
+#if defined(__SUNPRO_CC)
|
|
658 |
+#pragma packed(1)
|
|
659 |
+#endif
|
|
660 |
typedef struct
|
|
661 |
{
|
|
662 |
struct avisimpleindex_entry
|
|
663 |
@@ -191,6 +250,9 @@
|
|
664 |
DWORD nEntriesInUse;
|
|
665 |
}
|
|
666 |
PACKED(AVISimpleIndex);
|
|
667 |
+#if defined(__SUNPRO_CC)
|
|
668 |
+#pragma packed
|
|
669 |
+#endif
|
|
670 |
|
|
671 |
typedef struct
|
|
672 |
{
|
|
673 |
diff -ur dvgrab-3.0.orig/dvgrab.cc dvgrab-3.0/dvgrab.cc
|
|
674 |
--- dvgrab-3.0.orig/dvgrab.cc 2007-08-07 10:00:43.000000000 +0700
|
|
675 |
+++ dvgrab-3.0/dvgrab.cc 2007-09-04 13:06:50.889447865 +0700
|
|
676 |
@@ -291,50 +291,50 @@
|
|
677 |
|
|
678 |
void DVgrab::getargs( int argc, char *argv[] )
|
|
679 |
{
|
|
680 |
- char *opts = "d:hif:F:I:s:tVv-";
|
|
681 |
+ char *opts = (char *)"d:hif:F:I:s:tVv-";
|
|
682 |
int optindex = 0;
|
|
683 |
int c;
|
|
684 |
struct option long_opts[] = {
|
|
685 |
// all these use sscanf for int conversion, use val == 0xff to indicate
|
|
686 |
- { "autosplit", no_argument, &m_autosplit, true },
|
|
687 |
- { "buffers", required_argument, &m_buffers, 0xff },
|
|
688 |
- { "card", required_argument, &m_port, 0xff },
|
|
689 |
- { "channel", required_argument, &m_channel, 0xff },
|
|
690 |
- { "cmincutsize", required_argument, &m_collection_min_cut_file_size, 0xff },
|
|
691 |
- { "csize", required_argument, &m_collection_size, 0xff },
|
|
692 |
- { "debug", required_argument, 0, 0 },
|
|
693 |
- { "duration", required_argument, 0, 0 },
|
|
694 |
- { "every", required_argument, &m_frame_every, 0xff },
|
|
695 |
- { "format", required_argument, 0, 'f' },
|
|
696 |
- { "frames", required_argument, &m_frame_count, 0xff },
|
|
697 |
- { "guid", required_argument, 0, 0 },
|
|
698 |
- { "help", no_argument, 0, 'h' },
|
|
699 |
- { "input", required_argument, 0, 'I' },
|
|
700 |
- { "interactive", no_argument, 0, 'i'},
|
|
701 |
+ { (char *)"autosplit", no_argument, &m_autosplit, true },
|
|
702 |
+ { (char *)"buffers", required_argument, &m_buffers, 0xff },
|
|
703 |
+ { (char *)"card", required_argument, &m_port, 0xff },
|
|
704 |
+ { (char *)"channel", required_argument, &m_channel, 0xff },
|
|
705 |
+ { (char *)"cmincutsize", required_argument, &m_collection_min_cut_file_size, 0xff },
|
|
706 |
+ { (char *)"csize", required_argument, &m_collection_size, 0xff },
|
|
707 |
+ { (char *)"debug", required_argument, 0, 0 },
|
|
708 |
+ { (char *)"duration", required_argument, 0, 0 },
|
|
709 |
+ { (char *)"every", required_argument, &m_frame_every, 0xff },
|
|
710 |
+ { (char *)"format", required_argument, 0, 'f' },
|
|
711 |
+ { (char *)"frames", required_argument, &m_frame_count, 0xff },
|
|
712 |
+ { (char *)"guid", required_argument, 0, 0 },
|
|
713 |
+ { (char *)"help", no_argument, 0, 'h' },
|
|
714 |
+ { (char *)"input", required_argument, 0, 'I' },
|
|
715 |
+ { (char *)"interactive", no_argument, 0, 'i'},
|
|
716 |
#if defined(HAVE_LIBJPEG) && defined(HAVE_LIBDV)
|
|
717 |
- { "jpeg-deinterlace", no_argument, &m_jpeg_deinterlace, true },
|
|
718 |
- { "jpeg-height", required_argument, &m_jpeg_height, 0xff },
|
|
719 |
- { "jpeg-overwrite", no_argument, &m_jpeg_overwrite, true },
|
|
720 |
- { "jpeg-quality", required_argument, &m_jpeg_quality, 0xff },
|
|
721 |
- { "jpeg-temp", required_argument, &m_jpeg_usetemp, true },
|
|
722 |
- { "jpeg-width", required_argument, &m_jpeg_width, 0xff },
|
|
723 |
+ { (char *)"jpeg-deinterlace", no_argument, &m_jpeg_deinterlace, true },
|
|
724 |
+ { (char *)"jpeg-height", required_argument, &m_jpeg_height, 0xff },
|
|
725 |
+ { (char *)"jpeg-overwrite", no_argument, &m_jpeg_overwrite, true },
|
|
726 |
+ { (char *)"jpeg-quality", required_argument, &m_jpeg_quality, 0xff },
|
|
727 |
+ { (char *)"jpeg-temp", required_argument, &m_jpeg_usetemp, true },
|
|
728 |
+ { (char *)"jpeg-width", required_argument, &m_jpeg_width, 0xff },
|
|
729 |
#endif
|
|
730 |
- { "lockstep", no_argument, &m_lockstep, true },
|
|
731 |
- { "lockstep_maxdrops", required_argument, &m_lockstep_maxdrops, 0xff },
|
|
732 |
- { "lockstep_totaldrops", required_argument, &m_lockstep_totaldrops, 0xff },
|
|
733 |
- { "noavc", no_argument, &m_noavc, true },
|
|
734 |
- { "nostop", no_argument, &m_no_stop, true },
|
|
735 |
- { "opendml", no_argument, &m_open_dml, true },
|
|
736 |
- { "showstatus", no_argument, &m_showstatus, true },
|
|
737 |
- { "size", required_argument, &m_max_file_size, 0xff },
|
|
738 |
- { "stdin", no_argument, 0, 0 },
|
|
739 |
- { "timecode", no_argument, &m_timecode, true },
|
|
740 |
- { "timestamp", no_argument, &m_timestamp, true },
|
|
741 |
- { "timesys", no_argument, &m_timesys, true },
|
|
742 |
+ { (char *)"lockstep", no_argument, &m_lockstep, true },
|
|
743 |
+ { (char *)"lockstep_maxdrops", required_argument, &m_lockstep_maxdrops, 0xff },
|
|
744 |
+ { (char *)"lockstep_totaldrops", required_argument, &m_lockstep_totaldrops, 0xff },
|
|
745 |
+ { (char *)"noavc", no_argument, &m_noavc, true },
|
|
746 |
+ { (char *)"nostop", no_argument, &m_no_stop, true },
|
|
747 |
+ { (char *)"opendml", no_argument, &m_open_dml, true },
|
|
748 |
+ { (char *)"showstatus", no_argument, &m_showstatus, true },
|
|
749 |
+ { (char *)"size", required_argument, &m_max_file_size, 0xff },
|
|
750 |
+ { (char *)"stdin", no_argument, 0, 0 },
|
|
751 |
+ { (char *)"timecode", no_argument, &m_timecode, true },
|
|
752 |
+ { (char *)"timestamp", no_argument, &m_timestamp, true },
|
|
753 |
+ { (char *)"timesys", no_argument, &m_timesys, true },
|
|
754 |
#ifdef HAVE_LINUX_VIDEODEV2_H
|
|
755 |
- { "v4l2", no_argument, 0, 'V' },
|
|
756 |
+ { (char *)"v4l2", no_argument, 0, 'V' },
|
|
757 |
#endif
|
|
758 |
- { "version", no_argument, 0, 'v' },
|
|
759 |
+ { (char *)"version", no_argument, 0, 'v' },
|
|
760 |
{ 0, 0, 0, 0 }
|
|
761 |
};
|
|
762 |
|
|
763 |
diff -ur dvgrab-3.0.orig/endian_types.h dvgrab-3.0/endian_types.h
|
|
764 |
--- dvgrab-3.0.orig/endian_types.h 2005-04-18 21:24:48.000000000 +0700
|
|
765 |
+++ dvgrab-3.0/endian_types.h 2007-09-04 13:06:50.889699833 +0700
|
|
766 |
@@ -100,6 +100,9 @@
|
|
767 |
#endif
|
|
768 |
}
|
|
769 |
|
|
770 |
+#if defined(__SUNPRO_CC)
|
|
771 |
+#pragma packed(1)
|
|
772 |
+#endif
|
|
773 |
template <class T> class le_t {
|
|
774 |
T m;
|
|
775 |
T read() const {
|
|
776 |
@@ -150,10 +153,19 @@
|
|
777 |
m |= t.m;
|
|
778 |
return *this;
|
|
779 |
};
|
|
780 |
+#if defined(__SUNPRO_CC)
|
|
781 |
+};
|
|
782 |
+#pragma packed
|
|
783 |
+#else
|
|
784 |
} __attribute__((packed));
|
|
785 |
+#endif
|
|
786 |
+
|
|
787 |
|
|
788 |
/* Just copy-and-pasted from le_t. Too lazy to do it right. */
|
|
789 |
|
|
790 |
+#if defined(__SUNPRO_CC)
|
|
791 |
+#pragma packed(1)
|
|
792 |
+#endif
|
|
793 |
template <class T> class be_t {
|
|
794 |
T m;
|
|
795 |
T read() const {
|
|
796 |
@@ -204,7 +216,12 @@
|
|
797 |
m |= t.m;
|
|
798 |
return *this;
|
|
799 |
};
|
|
800 |
+#if defined(__SUNPRO_CC)
|
|
801 |
+};
|
|
802 |
+#pragma packed
|
|
803 |
+#else
|
|
804 |
} __attribute__((packed));
|
|
805 |
+#endif
|
|
806 |
|
|
807 |
/* Define types of native endianness similar to the little and big endian
|
|
808 |
* versions below. Not really necessary but useful occasionally to emphasize
|
|
809 |
diff -ur dvgrab-3.0.orig/ieee1394io.cc dvgrab-3.0/ieee1394io.cc
|
|
810 |
--- dvgrab-3.0.orig/ieee1394io.cc 2007-07-07 14:10:12.000000000 +0700
|
|
811 |
+++ dvgrab-3.0/ieee1394io.cc 2007-09-04 13:06:50.890098559 +0700
|
|
812 |
@@ -47,6 +47,10 @@
|
|
813 |
#include <config.h>
|
|
814 |
#endif
|
|
815 |
|
|
816 |
+#if !defined(__ASSERT_FUNCTION)
|
|
817 |
+#define __ASSERT_FUNCTION __func__
|
|
818 |
+#endif
|
|
819 |
+
|
|
820 |
#include <deque>
|
|
821 |
#include <iostream>
|
|
822 |
|