vmhd.c
上传用户:luping1608
上传日期:2007-01-06
资源大小:38k
文件大小:1k
- #include "quicktime.h"
- int quicktime_vmhd_init(quicktime_vmhd_t *vmhd)
- {
- vmhd->version = 0;
- vmhd->flags = 1;
- vmhd->graphics_mode = 64;
- vmhd->opcolor[0] = 32768;
- vmhd->opcolor[1] = 32768;
- vmhd->opcolor[2] = 32768;
- }
- int quicktime_vmhd_init_video(quicktime_t *file,
- quicktime_vmhd_t *vmhd,
- int frame_w,
- int frame_h,
- float frame_rate)
- {
- }
- int quicktime_vmhd_delete(quicktime_vmhd_t *vmhd)
- {
- }
- int quicktime_vmhd_dump(quicktime_vmhd_t *vmhd)
- {
- printf(" video media headern");
- printf(" version %dn", vmhd->version);
- printf(" flags %dn", vmhd->flags);
- printf(" graphics_mode %dn", vmhd->graphics_mode);
- printf(" opcolor %d %d %dn", vmhd->opcolor[0], vmhd->opcolor[1], vmhd->opcolor[2]);
- }
- int quicktime_read_vmhd(quicktime_t *file, quicktime_vmhd_t *vmhd)
- {
- int i;
- vmhd->version = quicktime_read_char(file);
- vmhd->flags = quicktime_read_int24(file);
- vmhd->graphics_mode = quicktime_read_int16(file);
- for(i = 0; i < 3; i++)
- vmhd->opcolor[i] = quicktime_read_int16(file);
- }
- int quicktime_write_vmhd(quicktime_t *file, quicktime_vmhd_t *vmhd)
- {
- quicktime_atom_t atom;
- int i;
- quicktime_atom_write_header(file, &atom, "vmhd");
- quicktime_write_char(file, vmhd->version);
- quicktime_write_int24(file, vmhd->flags);
- quicktime_write_int16(file, vmhd->graphics_mode);
-
- for(i = 0; i < 3; i++)
- quicktime_write_int16(file, vmhd->opcolor[i]);
- quicktime_atom_write_footer(file, &atom);
- }