]> git.sesse.net Git - vlc/blob - modules/access/bd/mpls.h
Update LGPL license blurb, choosing v2.1+.
[vlc] / modules / access / bd / mpls.h
1 /*****************************************************************************
2  * mpls.h: BluRay Disc MPLS
3  *****************************************************************************
4  * Copyright (C) 2009 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 typedef enum
25 {
26     BD_MPLS_STREAM_TYPE_PLAY_ITEM = 0x01,
27     BD_MPLS_STREAM_TYPE_SUB_PATH = 0x02,
28     BD_MPLS_STREAM_TYPE_IN_MUX_SUB_PATH = 0x03,
29 } bd_mpls_stream_type_t;
30 typedef enum
31 {
32     BD_MPLS_STREAM_CLASS_PRIMARY_VIDEO = 0,
33     BD_MPLS_STREAM_CLASS_PRIMARY_AUDIO,
34     BD_MPLS_STREAM_CLASS_PG,
35     BD_MPLS_STREAM_CLASS_IG,
36     BD_MPLS_STREAM_CLASS_SECONDARY_AUDIO,
37     BD_MPLS_STREAM_CLASS_SECONDARY_PIP_PG,
38 } bd_mpls_stream_class_t;
39 typedef enum
40 {
41     BD_MPLS_STREAM_CHARSET_UNKNOWN = -1,
42
43     BD_MPLS_STREAM_CHARSET_UTF8 = 0x01,
44     BD_MPLS_STREAM_CHARSET_UTF16 = 0x02,
45     BD_MPLS_STREAM_CHARSET_SHIFT_JIS = 0x03,
46     BD_MPLS_STREAM_CHARSET_KSC = 0x04,
47     BD_MPLS_STREAM_CHARSET_GB18030 = 0x05,
48     BD_MPLS_STREAM_CHARSET_GB2312 = 0x06,
49     BD_MPLS_STREAM_CHARSET_BIG5 = 0x7,
50 } bd_mpls_stream_charset_t;
51
52 typedef struct
53 {
54     /* Stream entry */
55     int i_type;             /* Type of the stream entry (bd_mpls_stream_type_t) */
56     int i_class;            /* Class of the stream entry (bd_mpls_stream_class_t) */
57     union
58     {
59         struct
60         {
61             int i_pid;              /* PID of the associated stream */
62         } play_item;
63         struct
64         {
65             int i_sub_path_id;      /* Index of the sub path entry */
66             int i_sub_clip_id;      /* Index of the sub clip entry (?) */
67             int i_pid;              /* PID of the associated stream */
68         } sub_path;
69         struct
70         {
71             int i_sub_path_id;      /* Index of the sub path entry */
72             int i_pid;              /* PID of the associated stream */
73         } in_mux_sub_path;
74     };
75
76     /* Stream attributes */
77     int  i_stream_type;     /* MPEG-2 TS stream_type */
78     char psz_language[3+1]; /* ISO-639 code, empty if NA */
79     int  i_charset;         /* For text stream only (bd_mpls_stream_attributes_charset_t) */
80 } bd_mpls_stream_t;
81
82 void bd_mpls_stream_Parse( bd_mpls_stream_t *p_stream, bs_t *s, int i_class );
83
84 typedef enum
85 {
86     BD_MPLS_PLAY_ITEM_CONNECTION_NOT_SEAMLESS = 0x01,
87     BD_MPLS_PLAY_ITEM_CONNECTION_SEAMLESS_5 = 0x05,
88     BD_MPLS_PLAY_ITEM_CONNECTION_SEAMLESS_6 = 0x06,
89 } bd_mpls_play_item_connection_t;
90
91 typedef enum
92 {
93     BD_MPLS_PLAY_ITEM_STILL_NONE = 0x00,
94     BD_MPLS_PLAY_ITEM_STILL_FINITE = 0x01,
95     BD_MPLS_PLAY_ITEM_STILL_INFINITE = 0x02,
96 } bd_mpls_play_item_still_t;
97
98 typedef struct
99 {
100     int     i_id;
101     int     i_stc_id;
102 } bd_mpls_clpi_t;
103
104 typedef struct
105 {
106     int     i_connection;   /* Connection with previous play item (bd_mpls_play_item_connection_t) */
107     int64_t i_in_time;      /* Start time in 45kHz */
108     int64_t i_out_time;     /* Stop time in 45kHz */
109     int     i_still;        /* Still mode (bd_mpls_play_item_still_t) */
110     int     i_still_time;   /* Still time for BD_MPLS_PLAY_ITEM_STILL_FINITE (second?) */
111
112     /* Default clpi/angle */
113     bd_mpls_clpi_t  clpi;
114
115     /* Extra clpi (multiple angles) */
116     int             i_clpi;
117     bd_mpls_clpi_t *p_clpi;
118     bool            b_angle_different_audio;
119     bool            b_angle_seamless;
120
121
122     /* */
123     int              i_stream;
124     bd_mpls_stream_t *p_stream;
125
126 } bd_mpls_play_item_t;
127 void bd_mpls_play_item_Clean( bd_mpls_play_item_t *p_item );
128 void bd_mpls_play_item_Parse( bd_mpls_play_item_t *p_item, bs_t *s );
129
130 typedef enum
131 {
132     BD_MPLS_SUB_PATH_TYPE_PRIMARY_AUDIO = 0x02,
133     BD_MPLS_SUB_PATH_TYPE_IG = 0x03,
134     BD_MPLS_SUB_PATH_TYPE_TEXT_SUB = 0x04,
135     BD_MPLS_SUB_PATH_TYPE_OUT_OF_MUX_AND_SYNC = 0x05,
136     BD_MPLS_SUB_PATH_TYPE_OUT_OF_MUX_AND_ASYNC = 0x06,
137     BD_MPLS_SUB_PATH_TYPE_IN_OF_MUX_AND_SYNC = 0x07,
138 } bd_mpls_sub_path_type_t;
139 typedef struct
140 {
141     int  i_type;        /* Sub path type (bd_mpls_sub_path_type_t) */
142     bool b_repeat;      /* Repeated sub-path */
143
144     int  i_item;
145     /* TODO
146     bd_mpls_sub_play_item_t *p_item;
147     */
148 } bd_mpls_sub_path_t;
149 void bd_mpls_sub_path_Parse( bd_mpls_sub_path_t *p_path, bs_t *s );
150
151 typedef enum
152 {
153     BD_MPLS_MARK_TYPE_RESUME = 0x00,
154     BD_MPLS_MARK_TYPE_BOOKMARK = 0x01,
155     BD_MPLS_MARK_TYPE_SKIP = 0x02,
156 } bd_mpls_mark_type_t;
157
158 typedef struct
159 {
160     int     i_type;             /* Type of the mark (bd_mpls_mark_type_t) */
161     int     i_play_item_id;     /* Play item ID */
162     int64_t i_time;             /* Time of the mark in 45kHz */
163     int     i_entry_es_pid;     /* Entry ES PID */
164 } bd_mpls_mark_t;
165 void bd_mpls_mark_Parse( bd_mpls_mark_t *p_mark, bs_t *s );
166
167 typedef struct
168 {
169     int                 i_id;
170
171     int                 i_play_item;
172     bd_mpls_play_item_t *p_play_item;
173
174     int                 i_sub_path;
175     bd_mpls_sub_path_t  *p_sub_path;
176
177     int                 i_mark;
178     bd_mpls_mark_t      *p_mark;
179 } bd_mpls_t;
180 void bd_mpls_Clean( bd_mpls_t *p_mpls );
181 int bd_mpls_Parse( bd_mpls_t *p_mpls, bs_t *s, int i_id );
182