demux_demuxers: Fix crash with -audiofile and audio disabled
[mplayer/glamo.git] / libmpcodecs / dec_teletext.h
blob9cbeae813dfc56a061299a6a1b6aceebb30d2de8
1 /*
2 * Teletext support
4 * Copyright (C) 2007 Vladimir Voroshilov <voroshil@gmail.com>
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef MPLAYER_DEC_TELETEXT_H
24 #define MPLAYER_DEC_TELETEXT_H
26 struct tt_param {
27 char *device; ///< teletext device
28 int format; ///< teletext display format
29 int page; ///< start teletext page
30 int lang; ///< primary language code
33 #define VBI_CONTROL_FALSE 0
34 #define VBI_CONTROL_TRUE 1
35 #define VBI_CONTROL_UNKNOWN -1
37 int teletext_control(void* p, int cmd, void *arg);
40 TELETEXT controls (through teletext_control() )
41 NOTE:
42 _SET_ should be _GET_ +1
43 _STEP_ should be _GET_ +2
45 #define TV_VBI_CONTROL_GET_MODE 0x510 ///< get current mode teletext
46 #define TV_VBI_CONTROL_SET_MODE 0x511 ///< on/off grab teletext
48 #define TV_VBI_CONTROL_GET_PAGE 0x513 ///< get grabbed teletext page
49 #define TV_VBI_CONTROL_SET_PAGE 0x514 ///< set grab teletext page number
50 #define TV_VBI_CONTROL_STEP_PAGE 0x515 ///< step grab teletext page number
52 #define TV_VBI_CONTROL_GET_SUBPAGE 0x516 ///< get grabbed teletext page
53 #define TV_VBI_CONTROL_SET_SUBPAGE 0x517 ///< set grab teletext page number
55 #define TV_VBI_CONTROL_GET_FORMAT 0x519 ///< get teletext format
56 #define TV_VBI_CONTROL_SET_FORMAT 0x51a ///< set teletext format
58 #define TV_VBI_CONTROL_GET_HALF_PAGE 0x51c ///< get current half page
59 #define TV_VBI_CONTROL_SET_HALF_PAGE 0x51d ///< switch half page
61 #define TV_VBI_CONTROL_IS_CHANGED 0x540 ///< teletext page is changed
62 #define TV_VBI_CONTROL_MARK_UNCHANGED 0x541 ///< teletext page is changed
64 #define TV_VBI_CONTROL_ADD_DEC 0x550 ///< add page number with dec
65 #define TV_VBI_CONTROL_GO_LINK 0x551 ///< go link (1..6) NYI
66 #define TV_VBI_CONTROL_GET_VBIPAGE 0x552 ///< get vbi_image for grabbed teletext page
67 #define TV_VBI_CONTROL_RESET 0x553 ///< vbi reset
68 #define TV_VBI_CONTROL_START 0x554 ///< vbi start
69 #define TV_VBI_CONTROL_STOP 0x555 ///< vbi stop
70 #define TV_VBI_CONTROL_DECODE_PAGE 0x556 ///< decode vbi page
71 #define TV_VBI_CONTROL_GET_NETWORKNAME 0x557 ///< get current network name
72 #define TV_VBI_CONTROL_DECODE_DVB 0x558 ///< decode DVB teletext
74 #define VBI_TFORMAT_TEXT 0 ///< text mode
75 #define VBI_TFORMAT_BW 1 ///< black&white mode
76 #define VBI_TFORMAT_GRAY 2 ///< grayscale mode
77 #define VBI_TFORMAT_COLOR 3 ///< color mode (require color_spu patch!)
79 #define VBI_MAX_PAGES 0x800 ///< max sub pages number
80 #define VBI_MAX_SUBPAGES 64 ///< max sub pages number
82 #define VBI_ROWS 25 ///< teletext page height in rows
83 #define VBI_COLUMNS 40 ///< teletext page width in chars
84 #define VBI_TIME_LINEPOS 26 ///< time line pos in page header
86 typedef
87 enum{
88 TT_FORMAT_OPAQUE=0, ///< opaque
89 TT_FORMAT_TRANSPARENT, ///< transparent
90 TT_FORMAT_OPAQUE_INV, ///< opaque with inverted colors
91 TT_FORMAT_TRANSPARENT_INV ///< transparent with inverted colors
92 } teletext_format;
94 typedef
95 enum{
96 TT_ZOOM_NORMAL=0,
97 TT_ZOOM_TOP_HALF,
98 TT_ZOOM_BOTTOM_HALF
99 } teletext_zoom;
101 typedef struct tt_char_s{
102 unsigned int unicode; ///< unicode (utf8) character
103 unsigned char fg; ///< foreground color
104 unsigned char bg; ///< background color
105 unsigned char gfx; ///< 0-no gfx, 1-solid gfx, 2-separated gfx
106 unsigned char flh; ///< 0-no flash, 1-flash
107 unsigned char hidden; ///< char is hidden (for subtitle pages)
108 unsigned char ctl; ///< control character
109 unsigned char lng; ///< lang: 0-secondary language,1-primary language
110 unsigned char raw; ///< raw character (as received from device)
111 } tt_char;
113 typedef struct tt_link_s{
114 int pagenum; ///< page number
115 int subpagenum; ///< subpage number
116 } tt_link_t;
118 typedef struct tt_page_s{
119 int pagenum; ///< page number
120 int subpagenum; ///< subpage number
121 unsigned char primary_lang; ///< primary language code
122 unsigned char secondary_lang; ///< secondary language code
123 unsigned char active; ///< page is complete and ready for rendering
124 unsigned char flags; ///< page flags
125 unsigned char raw[VBI_ROWS*VBI_COLUMNS]; ///< page data
126 struct tt_page_s* next_subpage;
127 struct tt_link_s links[6];
128 } tt_page;
130 #define TT_PGFL_SUPPRESS_HEADER 0x01
131 #define TT_PGFL_UPDATE_INDICATOR 0x02
132 #define TT_PGFL_INTERRUPTED_SEQ 0x04
133 #define TT_PGFL_INHIBIT_DISPLAY 0x08
134 #define TT_PGFL_NEWFLASH 0x10
135 #define TT_PGFL_SUBTITLE 0x20
136 #define TT_PGFL_ERASE_PAGE 0x40
137 #define TT_PGFL_MAGAZINE_SERIAL 0x80
139 typedef struct tt_stream_props_s{
140 int sampling_rate;
141 int samples_per_line;
142 int offset;
143 int count[2]; ///< number of lines in first and second fields
144 int interlaced; ///< vbi data are interlaced
145 int bufsize; ///< required buffer size
146 } tt_stream_props;
148 #endif /* MPLAYER_DEC_TELETEXT_H */