mpls.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * mpls.h: BluRay Disc MPLS
00003  *****************************************************************************
00004  * Copyright (C) 2009 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 typedef enum
00025 {
00026     BD_MPLS_STREAM_TYPE_PLAY_ITEM = 0x01,
00027     BD_MPLS_STREAM_TYPE_SUB_PATH = 0x02,
00028     BD_MPLS_STREAM_TYPE_IN_MUX_SUB_PATH = 0x03,
00029 } bd_mpls_stream_type_t;
00030 typedef enum
00031 {
00032     BD_MPLS_STREAM_CLASS_PRIMARY_VIDEO = 0,
00033     BD_MPLS_STREAM_CLASS_PRIMARY_AUDIO,
00034     BD_MPLS_STREAM_CLASS_PG,
00035     BD_MPLS_STREAM_CLASS_IG,
00036     BD_MPLS_STREAM_CLASS_SECONDARY_AUDIO,
00037     BD_MPLS_STREAM_CLASS_SECONDARY_PIP_PG,
00038 } bd_mpls_stream_class_t;
00039 typedef enum
00040 {
00041     BD_MPLS_STREAM_CHARSET_UNKNOWN = -1,
00042 
00043     BD_MPLS_STREAM_CHARSET_UTF8 = 0x01,
00044     BD_MPLS_STREAM_CHARSET_UTF16 = 0x02,
00045     BD_MPLS_STREAM_CHARSET_SHIFT_JIS = 0x03,
00046     BD_MPLS_STREAM_CHARSET_KSC = 0x04,
00047     BD_MPLS_STREAM_CHARSET_GB18030 = 0x05,
00048     BD_MPLS_STREAM_CHARSET_GB2312 = 0x06,
00049     BD_MPLS_STREAM_CHARSET_BIG5 = 0x7,
00050 } bd_mpls_stream_charset_t;
00051 
00052 typedef struct
00053 {
00054     /* Stream entry */
00055     int i_type;             /* Type of the stream entry (bd_mpls_stream_type_t) */
00056     int i_class;            /* Class of the stream entry (bd_mpls_stream_class_t) */
00057     union
00058     {
00059         struct
00060         {
00061             int i_pid;              /* PID of the associated stream */
00062         } play_item;
00063         struct
00064         {
00065             int i_sub_path_id;      /* Index of the sub path entry */
00066             int i_sub_clip_id;      /* Index of the sub clip entry (?) */
00067             int i_pid;              /* PID of the associated stream */
00068         } sub_path;
00069         struct
00070         {
00071             int i_sub_path_id;      /* Index of the sub path entry */
00072             int i_pid;              /* PID of the associated stream */
00073         } in_mux_sub_path;
00074     };
00075 
00076     /* Stream attributes */
00077     int  i_stream_type;     /* MPEG-2 TS stream_type */
00078     char psz_language[3+1]; /* ISO-639 code, empty if NA */
00079     int  i_charset;         /* For text stream only (bd_mpls_stream_attributes_charset_t) */
00080 } bd_mpls_stream_t;
00081 
00082 void bd_mpls_stream_Parse( bd_mpls_stream_t *p_stream, bs_t *s, int i_class );
00083 
00084 typedef enum
00085 {
00086     BD_MPLS_PLAY_ITEM_CONNECTION_NOT_SEAMLESS = 0x01,
00087     BD_MPLS_PLAY_ITEM_CONNECTION_SEAMLESS_5 = 0x05,
00088     BD_MPLS_PLAY_ITEM_CONNECTION_SEAMLESS_6 = 0x06,
00089 } bd_mpls_play_item_connection_t;
00090 
00091 typedef enum
00092 {
00093     BD_MPLS_PLAY_ITEM_STILL_NONE = 0x00,
00094     BD_MPLS_PLAY_ITEM_STILL_FINITE = 0x01,
00095     BD_MPLS_PLAY_ITEM_STILL_INFINITE = 0x02,
00096 } bd_mpls_play_item_still_t;
00097 
00098 typedef struct
00099 {
00100     int     i_id;
00101     int     i_stc_id;
00102 } bd_mpls_clpi_t;
00103 
00104 typedef struct
00105 {
00106     int     i_connection;   /* Connection with previous play item (bd_mpls_play_item_connection_t) */
00107     int64_t i_in_time;      /* Start time in 45kHz */
00108     int64_t i_out_time;     /* Stop time in 45kHz */
00109     int     i_still;        /* Still mode (bd_mpls_play_item_still_t) */
00110     int     i_still_time;   /* Still time for BD_MPLS_PLAY_ITEM_STILL_FINITE (second?) */
00111 
00112     /* Default clpi/angle */
00113     bd_mpls_clpi_t  clpi;
00114 
00115     /* Extra clpi (multiple angles) */
00116     int             i_clpi;
00117     bd_mpls_clpi_t *p_clpi;
00118     bool            b_angle_different_audio;
00119     bool            b_angle_seamless;
00120 
00121 
00122     /* */
00123     int              i_stream;
00124     bd_mpls_stream_t *p_stream;
00125 
00126 } bd_mpls_play_item_t;
00127 void bd_mpls_play_item_Clean( bd_mpls_play_item_t *p_item );
00128 void bd_mpls_play_item_Parse( bd_mpls_play_item_t *p_item, bs_t *s );
00129 
00130 typedef enum
00131 {
00132     BD_MPLS_SUB_PATH_TYPE_PRIMARY_AUDIO = 0x02,
00133     BD_MPLS_SUB_PATH_TYPE_IG = 0x03,
00134     BD_MPLS_SUB_PATH_TYPE_TEXT_SUB = 0x04,
00135     BD_MPLS_SUB_PATH_TYPE_OUT_OF_MUX_AND_SYNC = 0x05,
00136     BD_MPLS_SUB_PATH_TYPE_OUT_OF_MUX_AND_ASYNC = 0x06,
00137     BD_MPLS_SUB_PATH_TYPE_IN_OF_MUX_AND_SYNC = 0x07,
00138 } bd_mpls_sub_path_type_t;
00139 typedef struct
00140 {
00141     int  i_type;        /* Sub path type (bd_mpls_sub_path_type_t) */
00142     bool b_repeat;      /* Repeated sub-path */
00143 
00144     int  i_item;
00145     /* TODO
00146     bd_mpls_sub_play_item_t *p_item;
00147     */
00148 } bd_mpls_sub_path_t;
00149 void bd_mpls_sub_path_Parse( bd_mpls_sub_path_t *p_path, bs_t *s );
00150 
00151 typedef enum
00152 {
00153     BD_MPLS_MARK_TYPE_RESUME = 0x00,
00154     BD_MPLS_MARK_TYPE_BOOKMARK = 0x01,
00155     BD_MPLS_MARK_TYPE_SKIP = 0x02,
00156 } bd_mpls_mark_type_t;
00157 
00158 typedef struct
00159 {
00160     int     i_type;             /* Type of the mark (bd_mpls_mark_type_t) */
00161     int     i_play_item_id;     /* Play item ID */
00162     int64_t i_time;             /* Time of the mark in 45kHz */
00163     int     i_entry_es_pid;     /* Entry ES PID */
00164 } bd_mpls_mark_t;
00165 void bd_mpls_mark_Parse( bd_mpls_mark_t *p_mark, bs_t *s );
00166 
00167 typedef struct
00168 {
00169     int                 i_id;
00170 
00171     int                 i_play_item;
00172     bd_mpls_play_item_t *p_play_item;
00173 
00174     int                 i_sub_path;
00175     bd_mpls_sub_path_t  *p_sub_path;
00176 
00177     int                 i_mark;
00178     bd_mpls_mark_t      *p_mark;
00179 } bd_mpls_t;
00180 void bd_mpls_Clean( bd_mpls_t *p_mpls );
00181 int bd_mpls_Parse( bd_mpls_t *p_mpls, bs_t *s, int i_id );
00182 

Generated on Tue May 25 08:04:52 2010 for VLC by  doxygen 1.5.6