]> git.sesse.net Git - vlc/blob - modules/demux/mpeg4_iod.h
demux: ts: parse SL config
[vlc] / modules / demux / mpeg4_iod.h
1 /*****************************************************************************
2  * mpeg4_iod.h: ISO 14496-1 IOD and parsers
3  *****************************************************************************
4  * Copyright (C) 2004-2015 VLC authors and VideoLAN
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  *****************************************************************************/
20
21 #define ES_DESCRIPTOR_COUNT 255
22 typedef enum
23 {
24     USE_ACCESS_UNIT_START_FLAG = 1 << 7,
25     USE_ACCESS_UNIT_END_FLAG   = 1 << 6,
26     USE_RANDOM_ACCESS_POINT_FLAG  = 1 << 5,
27     HAS_RANDOM_ACCESS_UNITS_ONLY_FLAG  = 1 << 4,
28     USE_PADDING_FLAG  = 1 << 3,
29     USE_TIMESTAMPS_FLAG  = 1 << 2,
30     USE_IDLE_FLAG  = 1 << 1,
31     USE_DURATION_FLAG  = 1
32 } sl_config_flags;
33
34 typedef struct
35 {
36     uint32_t i_timestamp_resolution;
37     uint32_t i_OCR_resolution;
38     uint8_t i_flags;
39     uint8_t i_timestamp_length;
40     uint8_t i_OCR_length;
41     uint8_t i_AU_length;
42     uint8_t i_instant_bitrate_length;
43     uint8_t i_degradation_priority_length;
44     uint8_t i_AU_seqnum_length;
45     uint8_t i_packet_seqnum_length;
46
47     uint32_t i_timescale;
48     uint16_t i_accessunit_duration;
49     uint16_t i_compositionunit_duration;
50
51     uint64_t i_startdecoding_timestamp;
52     uint64_t i_startcomposition_timestamp;
53 } sl_config_descriptor_t;
54
55 typedef struct
56 {
57     uint8_t                 i_objectTypeIndication;
58     uint8_t                 i_streamType;
59
60     unsigned                i_extra;
61     uint8_t                 *p_extra;
62
63 } decoder_config_descriptor_t;
64
65 typedef struct
66 {
67     bool                    b_ok;
68     uint16_t                i_es_id;
69
70     char                    *psz_url;
71
72     decoder_config_descriptor_t    dec_descr;
73     sl_config_descriptor_t         sl_descr;
74
75 } es_mpeg4_descriptor_t;
76
77 typedef struct
78 {
79     /* IOD */
80     char                    *psz_url;
81
82     es_mpeg4_descriptor_t   es_descr[ES_DESCRIPTOR_COUNT];
83
84 } iod_descriptor_t;
85
86 iod_descriptor_t *IODNew( vlc_object_t *p_object, unsigned i_data, const uint8_t *p_data );
87 void IODFree( iod_descriptor_t *p_iod );