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