mpls.h
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:6k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*****************************************************************************
  2.  * mpls.h: BluRay Disc MPLS
  3.  *****************************************************************************
  4.  * Copyright (C) 2009 the VideoLAN team
  5.  * $Id: dfeb3f7f04c350dd130f5017404f2b0252d2cee2 $
  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. typedef enum
  24. {
  25.     BD_MPLS_STREAM_TYPE_PLAY_ITEM = 0x01,
  26.     BD_MPLS_STREAM_TYPE_SUB_PATH = 0x02,
  27.     BD_MPLS_STREAM_TYPE_IN_MUX_SUB_PATH = 0x03,
  28. } bd_mpls_stream_type_t;
  29. typedef enum
  30. {
  31.     BD_MPLS_STREAM_CLASS_PRIMARY_VIDEO = 0,
  32.     BD_MPLS_STREAM_CLASS_PRIMARY_AUDIO,
  33.     BD_MPLS_STREAM_CLASS_PG,
  34.     BD_MPLS_STREAM_CLASS_IG,
  35.     BD_MPLS_STREAM_CLASS_SECONDARY_AUDIO,
  36.     BD_MPLS_STREAM_CLASS_SECONDARY_PIP_PG,
  37. } bd_mpls_stream_class_t;
  38. typedef enum
  39. {
  40.     BD_MPLS_STREAM_CHARSET_UNKNOWN = -1,
  41.     BD_MPLS_STREAM_CHARSET_UTF8 = 0x01,
  42.     BD_MPLS_STREAM_CHARSET_UTF16 = 0x02,
  43.     BD_MPLS_STREAM_CHARSET_SHIFT_JIS = 0x03,
  44.     BD_MPLS_STREAM_CHARSET_KSC = 0x04,
  45.     BD_MPLS_STREAM_CHARSET_GB18030 = 0x05,
  46.     BD_MPLS_STREAM_CHARSET_GB2312 = 0x06,
  47.     BD_MPLS_STREAM_CHARSET_BIG5 = 0x7,
  48. } bd_mpls_stream_charset_t;
  49. typedef struct
  50. {
  51.     /* Stream entry */
  52.     int i_type;             /* Type of the stream entry (bd_mpls_stream_type_t) */
  53.     int i_class;            /* Class of the stream entry (bd_mpls_stream_class_t) */
  54.     union
  55.     {
  56.         struct
  57.         {
  58.             int i_pid;              /* PID of the associated stream */
  59.         } play_item;
  60.         struct
  61.         {
  62.             int i_sub_path_id;      /* Index of the sub path entry */
  63.             int i_sub_clip_id;      /* Index of the sub clip entry (?) */
  64.             int i_pid;              /* PID of the associated stream */
  65.         } sub_path;
  66.         struct
  67.         {
  68.             int i_sub_path_id;      /* Index of the sub path entry */
  69.             int i_pid;              /* PID of the associated stream */
  70.         } in_mux_sub_path;
  71.     };
  72.     /* Stream attributes */
  73.     int  i_stream_type;     /* MPEG-2 TS stream_type */
  74.     char psz_language[3+1]; /* ISO-639 code, empty if NA */
  75.     int  i_charset;         /* For text stream only (bd_mpls_stream_attributes_charset_t) */
  76. } bd_mpls_stream_t;
  77. void bd_mpls_stream_Parse( bd_mpls_stream_t *p_stream, bs_t *s, int i_class );
  78. typedef enum
  79. {
  80.     BD_MPLS_PLAY_ITEM_CONNECTION_NOT_SEAMLESS = 0x01,
  81.     BD_MPLS_PLAY_ITEM_CONNECTION_SEAMLESS_5 = 0x05,
  82.     BD_MPLS_PLAY_ITEM_CONNECTION_SEAMLESS_6 = 0x06,
  83. } bd_mpls_play_item_connection_t;
  84. typedef enum
  85. {
  86.     BD_MPLS_PLAY_ITEM_STILL_NONE = 0x00,
  87.     BD_MPLS_PLAY_ITEM_STILL_FINITE = 0x01,
  88.     BD_MPLS_PLAY_ITEM_STILL_INFINITE = 0x02,
  89. } bd_mpls_play_item_still_t;
  90. typedef struct
  91. {
  92.     int     i_id;
  93.     int     i_stc_id;
  94. } bd_mpls_clpi_t;
  95. typedef struct
  96. {
  97.     int     i_connection;   /* Connection with previous play item (bd_mpls_play_item_connection_t) */
  98.     int64_t i_in_time;      /* Start time in 45kHz */
  99.     int64_t i_out_time;     /* Stop time in 45kHz */
  100.     int     i_still;        /* Still mode (bd_mpls_play_item_still_t) */
  101.     int     i_still_time;   /* Still time for BD_MPLS_PLAY_ITEM_STILL_FINITE (second?) */
  102.     /* Default clpi/angle */
  103.     bd_mpls_clpi_t  clpi;
  104.     /* Extra clpi (multiple angles) */
  105.     int             i_clpi;
  106.     bd_mpls_clpi_t *p_clpi;
  107.     bool            b_angle_different_audio;
  108.     bool            b_angle_seamless;
  109.     /* */
  110.     int              i_stream;
  111.     bd_mpls_stream_t *p_stream;
  112. } bd_mpls_play_item_t;
  113. void bd_mpls_play_item_Clean( bd_mpls_play_item_t *p_item );
  114. void bd_mpls_play_item_Parse( bd_mpls_play_item_t *p_item, bs_t *s );
  115. typedef enum
  116. {
  117.     BD_MPLS_SUB_PATH_TYPE_PRIMARY_AUDIO = 0x02,
  118.     BD_MPLS_SUB_PATH_TYPE_IG = 0x03,
  119.     BD_MPLS_SUB_PATH_TYPE_TEXT_SUB = 0x04,
  120.     BD_MPLS_SUB_PATH_TYPE_OUT_OF_MUX_AND_SYNC = 0x05,
  121.     BD_MPLS_SUB_PATH_TYPE_OUT_OF_MUX_AND_ASYNC = 0x06,
  122.     BD_MPLS_SUB_PATH_TYPE_IN_OF_MUX_AND_SYNC = 0x07,
  123. } bd_mpls_sub_path_type_t;
  124. typedef struct
  125. {
  126.     int  i_type;        /* Sub path type (bd_mpls_sub_path_type_t) */
  127.     bool b_repeat;      /* Repeated sub-path */
  128.     int  i_item;
  129.     /* TODO
  130.     bd_mpls_sub_play_item_t *p_item;
  131.     */
  132. } bd_mpls_sub_path_t;
  133. void bd_mpls_sub_path_Parse( bd_mpls_sub_path_t *p_path, bs_t *s );
  134. typedef enum
  135. {
  136.     BD_MPLS_MARK_TYPE_RESUME = 0x00,
  137.     BD_MPLS_MARK_TYPE_BOOKMARK = 0x01,
  138.     BD_MPLS_MARK_TYPE_SKIP = 0x02,
  139. } bd_mpls_mark_type_t;
  140. typedef struct
  141. {
  142.     int     i_type;             /* Type of the mark (bd_mpls_mark_type_t) */
  143.     int     i_play_item_id;     /* Play item ID */
  144.     int64_t i_time;             /* Time of the mark in 45kHz */
  145.     int     i_entry_es_pid;     /* Entry ES PID */
  146. } bd_mpls_mark_t;
  147. void bd_mpls_mark_Parse( bd_mpls_mark_t *p_mark, bs_t *s );
  148. typedef struct
  149. {
  150.     int                 i_id;
  151.     int                 i_play_item;
  152.     bd_mpls_play_item_t *p_play_item;
  153.     int                 i_sub_path;
  154.     bd_mpls_sub_path_t  *p_sub_path;
  155.     int                 i_mark;
  156.     bd_mpls_mark_t      *p_mark;
  157. } bd_mpls_t;
  158. void bd_mpls_Clean( bd_mpls_t *p_mpls );
  159. int bd_mpls_Parse( bd_mpls_t *p_mpls, bs_t *s, int i_id );