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