~ubuntu-branches/ubuntu/saucy/ogmtools/saucy

« back to all changes in this revision

Viewing changes to avilib/avilib.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Leeman
  • Date: 2005-03-07 09:31:25 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050307093125-sx176ww54zi0shin
Tags: 1:1.5-2
* When using -v and -s together, the verbose output is removed (Closes: #296741)
* Fix of wrong length reporting (Closes: #296739)
* depend on dpatch for patches
* Upload sponsored by Luigi Gangitano <luigi@debian.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 *
26
26
 */
27
27
 
28
 
#include "os.h"
29
 
 
30
28
#include <sys/types.h>
31
29
#include <sys/stat.h>
32
30
#include <stdio.h>
33
31
#include <fcntl.h>
34
32
 
35
 
#if !defined(COMP_MSC)
36
33
#include <unistd.h>
37
34
#include <inttypes.h>
38
 
#endif
39
35
 
40
36
#include <limits.h>
41
37
#include <stdlib.h>
45
41
#ifndef AVILIB_H
46
42
#define AVILIB_H
47
43
 
 
44
#define COMP_GCC
 
45
#define SYS_LINUX
 
46
#define SYS_UNIX
 
47
 
48
48
#define AVI_MAX_TRACKS 8
49
49
 
50
50
typedef struct
51
51
{
52
 
  off_t key;
53
 
  off_t pos;
54
 
  off_t len;
 
52
  int64_t key;
 
53
  int64_t pos;
 
54
  int64_t len;
55
55
} video_index_entry;
56
56
 
57
57
typedef struct
58
58
{
59
 
   off_t pos;
60
 
   off_t len;
61
 
   off_t tot;
 
59
   int64_t pos;
 
60
   int64_t len;
 
61
   int64_t tot;
62
62
} audio_index_entry;
63
63
 
64
64
 
133
133
    long   padrate;           /* byte rate used for zero padding */
134
134
 
135
135
    long   audio_strn;        /* Audio stream number */
136
 
    off_t  audio_bytes;       /* Total number of bytes of audio data */
 
136
    int64_t  audio_bytes;       /* Total number of bytes of audio data */
137
137
    long   audio_chunks;      /* Chunks of audio data in the file */
138
138
 
139
139
    char   audio_tag[4];      /* Tag of audio data */
140
140
    long   audio_posc;        /* Audio position: chunk */
141
141
    long   audio_posb;        /* Audio position: byte within chunk */
142
142
 
143
 
    off_t  a_codech_off;       /* absolut offset of audio codec information */ 
144
 
    off_t  a_codecf_off;       /* absolut offset of audio codec information */ 
 
143
    int64_t  a_codech_off;       /* absolut offset of audio codec information */ 
 
144
    int64_t  a_codecf_off;       /* absolut offset of audio codec information */ 
145
145
 
146
146
    audio_index_entry *audio_index;
147
147
    avisuperindex_chunk *audio_superindex;
190
190
  uint32_t dw_suggested_buffer_size;
191
191
  uint32_t dw_quality;
192
192
  uint32_t dw_sample_size;
193
 
  uint32_t dw_left;
194
 
  uint32_t dw_top;
195
 
  uint32_t dw_right;
196
 
  uint32_t dw_bottom;
197
 
  uint32_t dw_edit_count;
198
 
  uint32_t dw_format_change_count;
199
 
  char     sz_name[64];
200
 
} alAVISTREAMINFO;
 
193
  uint16_t dw_left;
 
194
  uint16_t dw_top;
 
195
  uint16_t dw_right;
 
196
  uint16_t dw_bottom;
 
197
} alAVISTREAMHEADER;
201
198
 
202
199
typedef struct
203
200
{
215
212
  char   video_tag[4];      /* Tag of video data */
216
213
  long   video_pos;         /* Number of next frame to be read
217
214
                               (if index present) */
 
215
  alAVISTREAMHEADER video_stream_header;
218
216
  
219
217
  uint32_t max_len;    /* maximum video chunk present */
220
218
  
221
219
  track_t track[AVI_MAX_TRACKS];  // up to AVI_MAX_TRACKS audio tracks supported
222
220
  
223
 
  off_t  pos;               /* position in file */
 
221
  int64_t  pos;               /* position in file */
224
222
  long   n_idx;             /* number of index entries actually filled */
225
223
  long   max_idx;           /* number of index entries actually allocated */
226
224
  
227
 
  off_t  v_codech_off;      /* absolut offset of video codec (strh) info */ 
228
 
  off_t  v_codecf_off;      /* absolut offset of video codec (strf) info */ 
 
225
  int64_t  v_codech_off;      /* absolut offset of video codec (strh) info */ 
 
226
  int64_t  v_codecf_off;      /* absolut offset of video codec (strf) info */ 
229
227
  
230
228
  uint8_t (*idx)[16]; /* index entries (AVI idx1 tag) */
231
229
 
233
231
  avisuperindex_chunk *video_superindex;  /* index of indices */
234
232
  int is_opendml;           /* set to 1 if this is an odml file with multiple index chunks */
235
233
  
236
 
  off_t  last_pos;          /* Position of last frame written */
 
234
  int64_t  last_pos;          /* Position of last frame written */
237
235
  uint32_t last_len;   /* Length of last frame written */
238
236
  int must_use_index;       /* Flag if frames are duplicated */
239
 
  off_t  movi_start;
 
237
  int64_t  movi_start;
240
238
  int total_frames;         /* total number of frames if dmlh is present */
241
239
  
242
240
  int anum;            // total number of audio tracks 
246
244
  
247
245
  alBITMAPINFOHEADER *bitmap_info_header;
248
246
  alWAVEFORMATEX *wave_format_ex[AVI_MAX_TRACKS];
 
247
  alAVISTREAMHEADER stream_headers[AVI_MAX_TRACKS];
249
248
 
250
249
  void*         extradata;
251
250
  unsigned long extradata_size;