home *** CD-ROM | disk | FTP | other *** search
/ Geek 6 / Geek-006.iso / linux / video / xmovie-1.5.3.tar.gz / xmovie-1.5.3.tar / xmovie-1.5.3 / quicktime / hdlr.c < prev    next >
C/C++ Source or Header  |  2000-11-29  |  3KB  |  96 lines

  1. #include "quicktime.h"
  2.  
  3.  
  4.  
  5. void quicktime_hdlr_init(quicktime_hdlr_t *hdlr)
  6. {
  7.     hdlr->version = 0;
  8.     hdlr->flags = 0;
  9.     hdlr->component_type[0] = 'm';
  10.     hdlr->component_type[1] = 'h';
  11.     hdlr->component_type[2] = 'l';
  12.     hdlr->component_type[3] = 'r';
  13.     hdlr->component_subtype[0] = 'v';
  14.     hdlr->component_subtype[1] = 'i';
  15.     hdlr->component_subtype[2] = 'd';
  16.     hdlr->component_subtype[3] = 'e';
  17.     hdlr->component_manufacturer = 0;
  18.     hdlr->component_flags = 0;
  19.     hdlr->component_flag_mask = 0;
  20.     strcpy(hdlr->component_name, "Linux Media Handler");
  21. }
  22.  
  23. void quicktime_hdlr_init_video(quicktime_hdlr_t *hdlr)
  24. {
  25.     hdlr->component_subtype[0] = 'v';
  26.     hdlr->component_subtype[1] = 'i';
  27.     hdlr->component_subtype[2] = 'd';
  28.     hdlr->component_subtype[3] = 'e';
  29.     strcpy(hdlr->component_name, "Linux Video Media Handler");
  30. }
  31.  
  32. void quicktime_hdlr_init_audio(quicktime_hdlr_t *hdlr)
  33. {
  34.     hdlr->component_subtype[0] = 's';
  35.     hdlr->component_subtype[1] = 'o';
  36.     hdlr->component_subtype[2] = 'u';
  37.     hdlr->component_subtype[3] = 'n';
  38.     strcpy(hdlr->component_name, "Linux Sound Media Handler");
  39. }
  40.  
  41. void quicktime_hdlr_init_data(quicktime_hdlr_t *hdlr)
  42. {
  43.     hdlr->component_type[0] = 'd';
  44.     hdlr->component_type[1] = 'h';
  45.     hdlr->component_type[2] = 'l';
  46.     hdlr->component_type[3] = 'r';
  47.     hdlr->component_subtype[0] = 'a';
  48.     hdlr->component_subtype[1] = 'l';
  49.     hdlr->component_subtype[2] = 'i';
  50.     hdlr->component_subtype[3] = 's';
  51.     strcpy(hdlr->component_name, "Linux Alias Data Handler");
  52. }
  53.  
  54. void quicktime_hdlr_delete(quicktime_hdlr_t *hdlr)
  55. {
  56. }
  57.  
  58. void quicktime_hdlr_dump(quicktime_hdlr_t *hdlr)
  59. {
  60.     printf("   handler reference (hdlr)\n");
  61.     printf("    version %d\n", hdlr->version);
  62.     printf("    flags %d\n", hdlr->flags);
  63.     printf("    component_type %c%c%c%c\n", hdlr->component_type[0], hdlr->component_type[1], hdlr->component_type[2], hdlr->component_type[3]);
  64.     printf("    component_subtype %c%c%c%c\n", hdlr->component_subtype[0], hdlr->component_subtype[1], hdlr->component_subtype[2], hdlr->component_subtype[3]);
  65.     printf("    component_name %s\n", hdlr->component_name);
  66. }
  67.  
  68. void quicktime_read_hdlr(quicktime_t *file, quicktime_hdlr_t *hdlr)
  69. {
  70.     hdlr->version = quicktime_read_char(file);
  71.     hdlr->flags = quicktime_read_int24(file);
  72.     quicktime_read_char32(file, hdlr->component_type);
  73.     quicktime_read_char32(file, hdlr->component_subtype);
  74.     hdlr->component_manufacturer = quicktime_read_int32(file);
  75.     hdlr->component_flags = quicktime_read_int32(file);
  76.     hdlr->component_flag_mask = quicktime_read_int32(file);
  77.     quicktime_read_pascal(file, hdlr->component_name);
  78. }
  79.  
  80. void quicktime_write_hdlr(quicktime_t *file, quicktime_hdlr_t *hdlr)
  81. {
  82.     quicktime_atom_t atom;
  83.     quicktime_atom_write_header(file, &atom, "hdlr");
  84.  
  85.     quicktime_write_char(file, hdlr->version);
  86.     quicktime_write_int24(file, hdlr->flags);
  87.     quicktime_write_char32(file, hdlr->component_type);
  88.     quicktime_write_char32(file, hdlr->component_subtype);
  89.     quicktime_write_int32(file, hdlr->component_manufacturer);
  90.     quicktime_write_int32(file, hdlr->component_flags);
  91.     quicktime_write_int32(file, hdlr->component_flag_mask);
  92.     quicktime_write_pascal(file, hdlr->component_name);
  93.  
  94.     quicktime_atom_write_footer(file, &atom);
  95. }
  96.