xine-lib 1.2.11
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
32
33#define NUM_CC_PALETTES 2
34#define CC_FONT_MAX 256
35
36typedef struct cc_config_s {
37 int cc_enabled; /* true if closed captions are enabled */
38 char font[CC_FONT_MAX]; /* standard captioning 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 */
47
48typedef struct spucc_class_s {
52
53typedef struct cc_state_s {
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 */
62
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. */
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
void cc_decoder_close(cc_decoder_t *this_obj)
Definition: cc_decoder.c:1517
void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, int64_t pts)
Definition: cc_decoder.c:1375
void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width, int video_height)
Definition: cc_decoder.c:991
#define CC_FONT_MAX
Definition: cc_decoder.h:34
struct spucc_class_s spucc_class_t
struct cc_state_s cc_state_t
cc_decoder_t * cc_decoder_open(cc_state_t *cc_state)
Definition: cc_decoder.c:1488
struct cc_config_s cc_config_t
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
void cc_renderer_close(cc_renderer_t *this_obj)
Definition: cc_decoder.c:980
Definition: cc_decoder.h:36
int font_size
Definition: cc_decoder.h:39
char italic_font[256]
Definition: cc_decoder.h:40
int config_version
Definition: cc_decoder.h:45
int center
Definition: cc_decoder.h:41
int cc_enabled
Definition: cc_decoder.h:37
char font[256]
Definition: cc_decoder.h:38
int cc_scheme
Definition: cc_decoder.h:43
Definition: cc_decoder.c:417
Definition: cc_decoder.c:335
Definition: cc_decoder.h:53
cc_renderer_t * renderer
Definition: cc_decoder.h:60
int can_cc
Definition: cc_decoder.h:58
cc_config_t * cc_cfg
Definition: cc_decoder.h:54
Definition: metronom.h:71
Definition: osd.h:82
Definition: spu_decoder.h:42
Definition: cc_decoder.h:48
cc_config_t cc_cfg
Definition: cc_decoder.h:50
spu_decoder_class_t spu_class
Definition: cc_decoder.h:49