OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / internal / vobsub.h
1 /*\r
2  *                      GPAC - Multimedia Framework C SDK\r
3  *\r
4  *                      Copyright (c) by  Falco (Ivan Vecera) 2006\r
5  *                                      All rights reserved\r
6  *\r
7  *  This file is part of GPAC / Media Tools sub-project\r
8  *\r
9  *  GPAC is free software; you can redistribute it and/or modify\r
10  *  it under the terms of the GNU Lesser General Public License as published by\r
11  *  the Free Software Foundation; either version 2, or (at your option)\r
12  *  any later version.\r
13  *   \r
14  *  GPAC is distributed in the hope that it will be useful,\r
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  *  GNU Lesser General Public License for more details.\r
18  *   \r
19  *  You should have received a copy of the GNU Lesser General Public\r
20  *  License along with this library; see the file COPYING.  If not, write to\r
21  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
22  *\r
23  */\r
24 \r
25 \r
26 #ifndef _GF_VOBSUB_H_\r
27 #define _GF_VOBSUB_H_\r
28 \r
29 #include <gpac/tools.h>\r
30 \r
31 #ifdef __cplusplus\r
32 extern "C" {\r
33 #endif\r
34 \r
35 #define VOBSUBIDXVER 7\r
36 \r
37 typedef struct _tag_vobsub_pos\r
38 {\r
39         u64  filepos;\r
40         u64  start;\r
41         u64  stop;\r
42 } vobsub_pos;\r
43 \r
44 typedef struct _tag_vobsub_lang\r
45 {\r
46         u32      id;\r
47         char    *name;\r
48         GF_List *subpos;\r
49 } vobsub_lang;\r
50 \r
51 typedef struct _tag_vobsub_file\r
52 {\r
53         u32         width;\r
54         u32         height;\r
55         u8          palette[16][4];\r
56         u32         num_langs;\r
57         vobsub_lang langs[32];\r
58 } vobsub_file;\r
59 \r
60 GFINLINE static void vobsub_trim_ext(char *filename)\r
61 {\r
62         char *pos = strchr(filename, '.');\r
63 \r
64         if (pos != NULL) {\r
65                 if (!stricmp(pos, ".idx") || !stricmp(pos, ".sub")) {\r
66                         *pos = '\0';\r
67                 }\r
68         }\r
69 }\r
70 \r
71 s32    vobsub_lang_name(u16 id);\r
72 char  *vobsub_lang_id(char *name);\r
73 GF_Err vobsub_read_idx(FILE *file, vobsub_file *vobsub, int *version);\r
74 void   vobsub_free(vobsub_file *vobsub);\r
75 GF_Err vobsub_get_subpic_duration(char *data, u32 psize, u32 dsize, u32 *duration);\r
76 GF_Err vobsub_packetize_subpicture(FILE *fsub, u64 pts, char *data, u32 dataSize);\r
77 \r
78 #ifdef __cplusplus\r
79 }\r
80 #endif\r
81 \r
82 #endif /* _GF_VOBSUB_H_ */\r