annotate subreader.h @ 13252:7dfd84faaa09

Some minor vo_jpeg fixes: Removed unused variable dst. MPlayer now exits if it is unable to create a file for JPEG output and prints an appropriate message, instead of going on if all is right (which is not). Added line to authors file.
author ivo
date Sun, 05 Sep 2004 17:54:09 +0000
parents b200b94ebc4b
children 1a4b6e575484
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
616
41d6eec69b60 clean up
pontscho
parents: 509
diff changeset
1 #ifndef __MPLAYER_SUBREADER_H
41d6eec69b60 clean up
pontscho
parents: 509
diff changeset
2 #define __MPLAYER_SUBREADER_H
258
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
3
12910
12fd6739ecce 10l, FILE is defined in stdio.h
reimar
parents: 12909
diff changeset
4 #include <stdio.h>
12fd6739ecce 10l, FILE is defined in stdio.h
reimar
parents: 12909
diff changeset
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
eb274fd5e84e option for sub match fuzziness level
henry
parents: 9884
diff changeset
8 extern int sub_match_fuzziness;
2912
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
9
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
10 // subtitle formats
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
11 #define SUB_INVALID -1
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
12 #define SUB_MICRODVD 0
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
13 #define SUB_SUBRIP 1
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
14 #define SUB_SUBVIEWER 2
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
15 #define SUB_SAMI 3
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
16 #define SUB_VPLAYER 4
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
17 #define SUB_RT 5
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
18 #define SUB_SSA 6
11873
9c66ef56b1b1 Fix the PJS (aka dunnowhat) subtitles
attila
parents: 10916
diff changeset
19 #define SUB_PJS 7
2912
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
20 #define SUB_MPSUB 8
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
21 #define SUB_AQTITLE 9
6012
89c87be7a248 patch by Didier <did-c-debian@ifrance.com>:
pl
parents: 4064
diff changeset
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
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
26
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
27 // One of the SUB_* constant above
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
28 extern int sub_format;
2f04b5f9a615 minor cleanups:
pl
parents: 2050
diff changeset
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
7215
065387d29573 increased SUB_MAX_TEXT by Piotr Krukowiecki <piotr@pingu.ii.uj.edu.pl>
alex
parents: 6792
diff changeset
32 #define SUB_MAX_TEXT 10
10916
c36db88bfbc4 Subtitle alignment & smart splitting by Salvatore Falco
henry
parents: 9893
diff changeset
33 #define SUB_ALIGNMENT_HLEFT 1
c36db88bfbc4 Subtitle alignment & smart splitting by Salvatore Falco
henry
parents: 9893
diff changeset
34 #define SUB_ALIGNMENT_HCENTER 0
c36db88bfbc4 Subtitle alignment & smart splitting by Salvatore Falco
henry
parents: 9893
diff changeset
35 #define SUB_ALIGNMENT_HRIGHT 2
258
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
36
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
37 typedef struct {
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
38
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
39 int lines;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
40
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
41 unsigned long start;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
42 unsigned long end;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
43
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
44 char *text[SUB_MAX_TEXT];
10916
c36db88bfbc4 Subtitle alignment & smart splitting by Salvatore Falco
henry
parents: 9893
diff changeset
45 unsigned char alignment;
258
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
46 } subtitle;
66017e126280 subtitles (.sub files) support
arpi_esp
parents:
diff changeset
47
9870
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
48 typedef struct {
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
49 subtitle *subtitles;
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
50 char *filename;
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
51 int sub_uses_time;
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
52 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
53 int sub_errs;
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
54 } sub_data;
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
55
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
56 sub_data* sub_read_file (char *filename, float pts);
8618
a879b231b7e3 This patch adds a call to subcp_recode1(), so this subtitles too are
arpi
parents: 8451
diff changeset
57 subtitle* subcp_recode1 (subtitle *sub);
12909
dc8eba991005 fixes a crash and unchecked string-handling in ENCA code.
reimar
parents: 12443
diff changeset
58 // 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
59 // setting to NULL disables enca.
dc8eba991005 fixes a crash and unchecked string-handling in ENCA code.
reimar
parents: 12443
diff changeset
60 void subcp_open (FILE *enca_fd); /* for demux_ogg.c */
8733
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8618
diff changeset
61 void subcp_close (void); /* for demux_ogg.c */
12930
b200b94ebc4b missing guess_cp declaration (patch by Ismail D«Ónmez)
henry
parents: 12910
diff changeset
62 #ifdef HAVE_ENCA
b200b94ebc4b missing guess_cp declaration (patch by Ismail D«Ónmez)
henry
parents: 12910
diff changeset
63 void* guess_cp(FILE *enca_fd, char *preferred_language, char *fallback);
b200b94ebc4b missing guess_cp declaration (patch by Ismail D«Ónmez)
henry
parents: 12910
diff changeset
64 #endif
9870
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
65 char ** sub_filenames(char *path, char *fname);
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
66 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
67 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
68 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
69 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
70 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
71 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
72 void sub_free( sub_data * subd );
09d630a4f991 support for multiple subtitle files by Marcin Wojdyr <wojdyr@unipress.waw.pl>
henry
parents: 9126
diff changeset
73 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
74 void step_sub(sub_data *subd, float pts, int movement);
818
16ba80b47ec4 Support for vplayer subtitles
eyck
parents: 624
diff changeset
75 #endif