quicktime bites the dust, so far only with --with-external-ffmpeg, remaining build...
[cinelerra_cv/ct.git] / quicktime / vmhd.c
blobf2ffe77b844f42f7f3d92e65136e93162177f30a
1 #include "funcprotos.h"
2 #include "quicktime.h"
5 void quicktime_vmhd_init(quicktime_vmhd_t *vmhd)
7 vmhd->version = 0;
8 vmhd->flags = 1;
9 vmhd->graphics_mode = 64;
10 vmhd->opcolor[0] = 32768;
11 vmhd->opcolor[1] = 32768;
12 vmhd->opcolor[2] = 32768;
15 void quicktime_vmhd_init_video(quicktime_t *file,
16 quicktime_vmhd_t *vmhd,
17 int frame_w,
18 int frame_h,
19 float frame_rate)
23 void quicktime_vmhd_delete(quicktime_vmhd_t *vmhd)
27 void quicktime_vmhd_dump(quicktime_vmhd_t *vmhd)
29 printf(" video media header\n");
30 printf(" version %d\n", vmhd->version);
31 printf(" flags %d\n", vmhd->flags);
32 printf(" graphics_mode %d\n", vmhd->graphics_mode);
33 printf(" opcolor %d %d %d\n", vmhd->opcolor[0], vmhd->opcolor[1], vmhd->opcolor[2]);
36 void quicktime_read_vmhd(quicktime_t *file, quicktime_vmhd_t *vmhd)
38 int i;
39 vmhd->version = quicktime_read_char(file);
40 vmhd->flags = quicktime_read_int24(file);
41 vmhd->graphics_mode = quicktime_read_int16(file);
42 for(i = 0; i < 3; i++)
43 vmhd->opcolor[i] = quicktime_read_int16(file);
46 void quicktime_write_vmhd(quicktime_t *file, quicktime_vmhd_t *vmhd)
48 quicktime_atom_t atom;
49 int i;
50 quicktime_atom_write_header(file, &atom, "vmhd");
52 quicktime_write_char(file, vmhd->version);
53 quicktime_write_int24(file, vmhd->flags);
54 quicktime_write_int16(file, vmhd->graphics_mode);
56 for(i = 0; i < 3; i++)
57 quicktime_write_int16(file, vmhd->opcolor[i]);
59 quicktime_atom_write_footer(file, &atom);