read: Fix a possible infinite loop of isom_read_skip_box_extra_bytes().
[L-SMASH.git] / core / timeline.h
blobeb7ebb40fe63451877efb6bd8fef2c672fb58c5e
1 /*****************************************************************************
2 * timeline.h:
3 *****************************************************************************
4 * Copyright (C) 2011-2015 L-SMASH project
6 * Authors: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 *****************************************************************************/
21 /* This file is available under an ISC license. */
23 #ifndef LSMASH_TIMELINE_H
24 #define LSMASH_TIMELINE_H
26 typedef struct isom_timeline_tag isom_timeline_t;
28 typedef struct
30 uint64_t data_offset;
31 uint64_t length;
32 uint32_t number; /* useless at present */
33 lsmash_file_t *file;
34 } isom_portable_chunk_t;
36 typedef struct
38 uint64_t pos; /* position of the first sample in this bunch */
39 uint32_t duration; /* duration in media timescale each sample has */
40 uint32_t offset; /* offset between composition time and decoding time each sample has */
41 uint32_t length; /* data size each sample has */
42 uint32_t index; /* sample_description_index applied to each sample */
43 isom_portable_chunk_t *chunk; /* chunk samples belong to */
44 lsmash_sample_property_t prop; /* property applied to each sample */
45 uint32_t sample_count; /* number of samples in this bunch */
46 } isom_lpcm_bunch_t;
48 isom_timeline_t *isom_timeline_create( void );
50 void isom_timeline_destroy
52 isom_timeline_t *timeline
55 int isom_timeline_set_track_ID
57 isom_timeline_t *timeline,
58 uint32_t track_ID
61 int isom_timeline_set_movie_timescale
63 isom_timeline_t *timeline,
64 uint32_t movie_timescale
67 int isom_timeline_set_media_timescale
69 isom_timeline_t *timeline,
70 uint32_t media_timescale
73 int isom_timeline_set_sample_count
75 isom_timeline_t *timeline,
76 uint32_t sample_count
79 int isom_timeline_set_max_sample_size
81 isom_timeline_t *timeline,
82 uint32_t max_sample_size
85 int isom_timeline_set_media_duration
87 isom_timeline_t *timeline,
88 uint32_t media_duration
91 int isom_timeline_set_track_duration
93 isom_timeline_t *timeline,
94 uint32_t track_duration
97 void isom_timeline_set_lpcm_sample_getter_funcs
99 isom_timeline_t *timeline
102 isom_timeline_t *isom_get_timeline
104 lsmash_root_t *root,
105 uint32_t track_ID
108 void isom_remove_timelines
110 lsmash_file_t *file
113 int isom_timeline_construct
115 lsmash_root_t *root,
116 uint32_t track_ID
119 int isom_add_lpcm_bunch_entry
121 isom_timeline_t *timeline,
122 isom_lpcm_bunch_t *src_bunch
125 isom_elst_entry_t *isom_timelime_get_explicit_timeline_map
127 lsmash_root_t *root,
128 uint32_t track_ID,
129 uint32_t edit_number
132 uint32_t isom_timelime_count_explicit_timeline_map
134 lsmash_root_t *root,
135 uint32_t track_ID
138 #endif /* LSMASH_TIMELINE_H */