Mercurial > mplayer.hg
annotate subreader.h @ 24374:8591a357eb36
Fix warnings:
cfg-common.h:386: warning: redundant redeclaration of 'audio_stream'
stream/stream.h:301: warning: previous declaration of 'audio_stream' was here
author | voroshil |
---|---|
date | Mon, 10 Sep 2007 01:13:13 +0000 |
parents | 3f0d00abc073 |
children | e36efda34616 |
rev | line source |
---|---|
23689
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
22805
diff
changeset
|
1 #ifndef MPLAYER_SUBREADER_H |
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
22805
diff
changeset
|
2 #define MPLAYER_SUBREADER_H |
258 | 3 |
12910 | 4 #include <stdio.h> |
5 | |
8361
2202c00001e3
overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
arpi
parents:
7982
diff
changeset
|
6 extern int suboverlap_enabled; |
9126
7a06258271d6
Add a command line option (-sub-no-text-pp) to disable subtitles
arpi
parents:
8733
diff
changeset
|
7 extern int sub_no_text_pp; // disable text post-processing |
9893 | 8 extern int sub_match_fuzziness; |
2912 | 9 |
10 // subtitle formats | |
11 #define SUB_INVALID -1 | |
12 #define SUB_MICRODVD 0 | |
13 #define SUB_SUBRIP 1 | |
14 #define SUB_SUBVIEWER 2 | |
15 #define SUB_SAMI 3 | |
16 #define SUB_VPLAYER 4 | |
17 #define SUB_RT 5 | |
18 #define SUB_SSA 6 | |
11873 | 19 #define SUB_PJS 7 |
2912 | 20 #define SUB_MPSUB 8 |
21 #define SUB_AQTITLE 9 | |
6012 | 22 #define SUB_SUBVIEWER2 10 |
6076
eff64fb1ffea
patch fixes broken detecniou of AQTitle subtiles and adds support for subtitles created by subrip 0.9 - by Jiri.Svoboda@seznam.cz
arpi
parents:
6012
diff
changeset
|
23 #define SUB_SUBRIP09 11 |
7982
eac680483e6c
JACOSub is another subtitling format, whose specifications are at:
arpi
parents:
7460
diff
changeset
|
24 #define SUB_JACOSUB 12 |
12138
eb3ad04675e1
MPL2 subreader, patch by Cezary Jackiewicz (cjackiewicz@poczta.onet.pl)
alex
parents:
11873
diff
changeset
|
25 #define SUB_MPL2 13 |
2912 | 26 |
27 // One of the SUB_* constant above | |
28 extern int sub_format; | |
29 | |
9870
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
30 #define MAX_SUBTITLE_FILES 128 |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
31 |
17308
59452efe579c
Improved handling of text subs in Matroska files with adjacent newlines (\N) resulting in more than SUB_MAX_TEXT lines to display. Patch by Robert Henney (robh () rut ! org).
mosu
parents:
13679
diff
changeset
|
32 #define SUB_MAX_TEXT 12 |
13343
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
33 #define SUB_ALIGNMENT_BOTTOMLEFT 1 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
34 #define SUB_ALIGNMENT_BOTTOMCENTER 2 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
35 #define SUB_ALIGNMENT_BOTTOMRIGHT 3 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
36 #define SUB_ALIGNMENT_MIDDLELEFT 4 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
37 #define SUB_ALIGNMENT_MIDDLECENTER 5 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
38 #define SUB_ALIGNMENT_MIDDLERIGHT 6 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
39 #define SUB_ALIGNMENT_TOPLEFT 7 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
40 #define SUB_ALIGNMENT_TOPCENTER 8 |
1a4b6e575484
This time is a patch to improve subtitle alignment management. It
faust3
parents:
12930
diff
changeset
|
41 #define SUB_ALIGNMENT_TOPRIGHT 9 |
258 | 42 |
43 typedef struct { | |
44 | |
45 int lines; | |
46 | |
47 unsigned long start; | |
48 unsigned long end; | |
49 | |
50 char *text[SUB_MAX_TEXT]; | |
21827
b0bc0d81f91b
Subtitle handling cleanup: factor out code for parsing embedded subtitles
reimar
parents:
18980
diff
changeset
|
51 double endpts[SUB_MAX_TEXT]; |
10916
c36db88bfbc4
Subtitle alignment & smart splitting by Salvatore Falco
henry
parents:
9893
diff
changeset
|
52 unsigned char alignment; |
258 | 53 } subtitle; |
54 | |
9870
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
55 typedef struct { |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
56 subtitle *subtitles; |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
57 char *filename; |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
58 int sub_uses_time; |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
59 int sub_num; // number of subtitle structs |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
60 int sub_errs; |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
61 } sub_data; |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
62 |
13679
59bb11213d11
correctly display the commas of most hebrew subtitles on the left side
faust3
parents:
13343
diff
changeset
|
63 #ifdef USE_FRIBIDI |
59bb11213d11
correctly display the commas of most hebrew subtitles on the left side
faust3
parents:
13343
diff
changeset
|
64 extern char *fribidi_charset; |
59bb11213d11
correctly display the commas of most hebrew subtitles on the left side
faust3
parents:
13343
diff
changeset
|
65 extern int flip_hebrew; |
59bb11213d11
correctly display the commas of most hebrew subtitles on the left side
faust3
parents:
13343
diff
changeset
|
66 extern int fribidi_flip_commas; |
59bb11213d11
correctly display the commas of most hebrew subtitles on the left side
faust3
parents:
13343
diff
changeset
|
67 #endif |
59bb11213d11
correctly display the commas of most hebrew subtitles on the left side
faust3
parents:
13343
diff
changeset
|
68 |
9870
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
69 sub_data* sub_read_file (char *filename, float pts); |
22805 | 70 subtitle* subcp_recode (subtitle *sub); |
12909
dc8eba991005
fixes a crash and unchecked string-handling in ENCA code.
reimar
parents:
12443
diff
changeset
|
71 // enca_fd is the file enca uses to determine the codepage. |
dc8eba991005
fixes a crash and unchecked string-handling in ENCA code.
reimar
parents:
12443
diff
changeset
|
72 // setting to NULL disables enca. |
17879 | 73 struct stream_st; |
74 void subcp_open (struct stream_st *st); /* for demux_ogg.c */ | |
8733
478561617705
compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents:
8618
diff
changeset
|
75 void subcp_close (void); /* for demux_ogg.c */ |
12930
b200b94ebc4b
missing guess_cp declaration (patch by Ismail D«Ónmez)
henry
parents:
12910
diff
changeset
|
76 #ifdef HAVE_ENCA |
18936 | 77 void* guess_buffer_cp(unsigned char* buffer, int buflen, char *preferred_language, char *fallback); |
17879 | 78 void* guess_cp(struct stream_st *st, char *preferred_language, char *fallback); |
12930
b200b94ebc4b
missing guess_cp declaration (patch by Ismail D«Ónmez)
henry
parents:
12910
diff
changeset
|
79 #endif |
18980
ed69754aa58d
Marks several string parameters as const when they are not modified in the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents:
18936
diff
changeset
|
80 char ** sub_filenames(const char *path, char *fname); |
9870
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
81 void list_sub_file(sub_data* subd); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
82 void dump_srt(sub_data* subd, float fps); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
83 void dump_mpsub(sub_data* subd, float fps); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
84 void dump_microdvd(sub_data* subd, float fps); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
85 void dump_jacosub(sub_data* subd, float fps); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
86 void dump_sami(sub_data* subd, float fps); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
87 void sub_free( sub_data * subd ); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
88 void find_sub(sub_data* subd,int key); |
09d630a4f991
support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents:
9126
diff
changeset
|
89 void step_sub(sub_data *subd, float pts, int movement); |
21827
b0bc0d81f91b
Subtitle handling cleanup: factor out code for parsing embedded subtitles
reimar
parents:
18980
diff
changeset
|
90 void sub_add_text(subtitle *sub, const char *txt, int len, double endpts); |
b0bc0d81f91b
Subtitle handling cleanup: factor out code for parsing embedded subtitles
reimar
parents:
18980
diff
changeset
|
91 int sub_clear_text(subtitle *sub, double pts); |
818 | 92 #endif |