xine-lib  1.2.9
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;
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 {
52 
53 typedef 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 */
61 } cc_state_t;
62 
64 void cc_decoder_close(cc_decoder_t *this_obj);
65 
66 void 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. */
75 void cc_renderer_close(cc_renderer_t *this_obj);
76 
77 /* Updates the renderer configuration variables */
78 void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width,
79  int video_height);
80 
cc_renderer_t * renderer
Definition: cc_decoder.h:60
Definition: osd.h:82
Definition: cc_decoder.h:36
struct cc_config_s cc_config_t
struct cc_state_s cc_state_t
int config_version
Definition: cc_decoder.h:45
Definition: cc_decoder.h:53
struct spucc_class_s spucc_class_t
int center
Definition: cc_decoder.h:41
int cc_enabled
Definition: cc_decoder.h:37
void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width, int video_height)
Definition: cc_decoder.c:991
void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, int64_t pts)
Definition: cc_decoder.c:1369
Definition: metronom.h:71
cc_config_t * cc_cfg
Definition: cc_decoder.h:54
cc_decoder_t * cc_decoder_open(cc_state_t *cc_state)
Definition: cc_decoder.c:1482
int font_size
Definition: cc_decoder.h:39
Definition: spu_decoder.h:43
cc_config_t cc_cfg
Definition: cc_decoder.h:50
Definition: cc_decoder.c:336
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_decoder_close(cc_decoder_t *this_obj)
Definition: cc_decoder.c:1511
spu_decoder_class_t spu_class
Definition: cc_decoder.h:49
char italic_font[256]
Definition: cc_decoder.h:40
#define CC_FONT_MAX
Definition: cc_decoder.h:34
int cc_scheme
Definition: cc_decoder.h:43
int can_cc
Definition: cc_decoder.h:58
Definition: cc_decoder.c:418
Definition: cc_decoder.h:48
void cc_renderer_close(cc_renderer_t *this_obj)
Definition: cc_decoder.c:980
char font[256]
Definition: cc_decoder.h:38