forked from duiniuluantanqin/mp4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hnti.c
56 lines (39 loc) · 1.14 KB
/
hnti.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "funcprotos.h"
#include "quicktime.h"
int quicktime_hnti_init(quicktime_hnti_t *hnti)
{
return quicktime_rtp_init(&(hnti->rtp));
}
int quicktime_hnti_delete(quicktime_hnti_t *hnti)
{
return quicktime_rtp_delete(&(hnti->rtp));
}
int quicktime_hnti_dump(quicktime_hnti_t *hnti)
{
printf(" hnti\n");
return quicktime_rtp_dump(&hnti->rtp);
}
int quicktime_read_hnti(quicktime_t *file, quicktime_hnti_t *hnti, quicktime_atom_t *parent_atom)
{
quicktime_atom_t leaf_atom;
do {
quicktime_atom_read_header(file, &leaf_atom);
if (quicktime_atom_is(&leaf_atom, "rtp ")) {
quicktime_read_rtp(file, &(hnti->rtp), &leaf_atom);
} else {
quicktime_atom_skip(file, &leaf_atom);
}
} while (quicktime_position(file) < parent_atom->end);
return 0;
}
int quicktime_write_hnti(quicktime_t *file, quicktime_hnti_t *hnti)
{
quicktime_atom_t atom;
if (hnti->rtp.string == NULL) {
return -1;
}
quicktime_atom_write_header(file, &atom, "hnti");
quicktime_write_rtp(file, &(hnti->rtp));
quicktime_atom_write_footer(file, &atom);
return 0;
}