xine-lib: xine-lib-1.2.12/src/spu_dec/cc_decoder.h Source File

xine-lib 1.2.12

cc_decoder.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2009 the xine project
3 *
4 * Copyright (C) Christian Vogler
5 * cvogler@gradient.cis.upenn.edu - December 2001
6 *
7 * This file is part of xine, a free video player.
8 *
9 * xine 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 * xine 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, USA
22 *
23 * stuff needed to provide closed captioning decoding and display
24 *
25 * Some small bits and pieces of the EIA-608 captioning decoder were
26 * adapted from CCDecoder 0.9.1 by Mike Baker. The latest version is
27 * available at http://sourceforge.net/projects/ccdecoder/.
28 */
29
30 typedef struct cc_decoder_s cc_decoder_t;
31 typedef struct cc_renderer_s cc_renderer_t;
32
33#define NUM_CC_PALETTES 2
34#define CC_FONT_MAX 256
35
36 typedef struct cc_config_s {
37 int cc_enabled; /* true if closed captions are enabled */
38 char font[CC_FONT_MAX]; /* standard captioning font & size */
39 int font_size;
40 char italic_font[CC_FONT_MAX]; /* italic captioning font & size */
41 int center; /* true if captions should be centered */
42 /* according to text width */
43 int cc_scheme; /* which captioning scheme to use */
44
45 int config_version; /* the decoder should be updated when this is increased */
46} cc_config_t;
47
48 typedef struct spucc_class_s {
49 spu_decoder_class_t spu_class;
50 cc_config_t cc_cfg;
51} spucc_class_t;
52
53 typedef struct cc_state_s {
54 cc_config_t *cc_cfg;
55 /* the following variables are not controlled by configuration files; they */
56 /* are intrinsic to the properties of the configuration options and the */
57 /* currently played video */
58 int can_cc; /* true if captions can be displayed */
59 /* (e.g., font fits on screen) */
60 cc_renderer_t *renderer; /* closed captioning renderer */
61} cc_state_t;
62
63 cc_decoder_t *cc_decoder_open(cc_state_t *cc_state);
64void cc_decoder_close(cc_decoder_t *this_obj);
65
66void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len,
67 int64_t pts);
68
69/* Instantiates a new closed captioning renderer. */
70 cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer,
71 metronom_t *metronom, cc_state_t *cc_state,
72 int video_width, int video_height);
73
74/* Destroys a closed captioning renderer. */
75void cc_renderer_close(cc_renderer_t *this_obj);
76
77/* Updates the renderer configuration variables */
78void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width,
79 int video_height);
80
cc_decoder_close
void cc_decoder_close(cc_decoder_t *this_obj)
Definition: cc_decoder.c:1517
decode_cc
void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, int64_t pts)
Definition: cc_decoder.c:1375
cc_renderer_update_cfg
void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width, int video_height)
Definition: cc_decoder.c:991
CC_FONT_MAX
#define CC_FONT_MAX
Definition: cc_decoder.h:34
spucc_class_t
struct spucc_class_s spucc_class_t
cc_state_t
struct cc_state_s cc_state_t
cc_decoder_open
cc_decoder_t * cc_decoder_open(cc_state_t *cc_state)
Definition: cc_decoder.c:1488
cc_config_t
struct cc_config_s cc_config_t
cc_renderer_open
cc_renderer_t * cc_renderer_open(osd_renderer_t *osd_renderer, metronom_t *metronom, cc_state_t *cc_state, int video_width, int video_height)
Definition: cc_decoder.c:959
cc_renderer_close
void cc_renderer_close(cc_renderer_t *this_obj)
Definition: cc_decoder.c:980
cc_config_s
Definition: cc_decoder.h:36
cc_config_s::font_size
int font_size
Definition: cc_decoder.h:39
cc_config_s::italic_font
char italic_font[256]
Definition: cc_decoder.h:40
cc_config_s::config_version
int config_version
Definition: cc_decoder.h:45
cc_config_s::center
int center
Definition: cc_decoder.h:41
cc_config_s::cc_enabled
int cc_enabled
Definition: cc_decoder.h:37
cc_config_s::font
char font[256]
Definition: cc_decoder.h:38
cc_config_s::cc_scheme
int cc_scheme
Definition: cc_decoder.h:43
cc_decoder_s
Definition: cc_decoder.c:417
cc_renderer_s
Definition: cc_decoder.c:335
cc_state_s
Definition: cc_decoder.h:53
cc_state_s::renderer
cc_renderer_t * renderer
Definition: cc_decoder.h:60
cc_state_s::can_cc
int can_cc
Definition: cc_decoder.h:58
cc_state_s::cc_cfg
cc_config_t * cc_cfg
Definition: cc_decoder.h:54
metronom_s
Definition: metronom.h:71
osd_renderer_s
Definition: osd.h:82
spu_decoder_class_s
Definition: spu_decoder.h:42
spucc_class_s
Definition: cc_decoder.h:48
spucc_class_s::cc_cfg
cc_config_t cc_cfg
Definition: cc_decoder.h:50
spucc_class_s::spu_class
spu_decoder_class_t spu_class
Definition: cc_decoder.h:49