diff options
author | Christian Vogler <cvogler@users.sourceforge.net> | 2002-01-07 19:30:09 +0000 |
---|---|---|
committer | Christian Vogler <cvogler@users.sourceforge.net> | 2002-01-07 19:30:09 +0000 |
commit | 16be79073dc84a67b72f7e1a5cac93a5b34782aa (patch) | |
tree | 14071f2a3a8e5a59b5208ec1bd7bd684a6342df8 /src/libspucc/cc_decoder.h | |
parent | d984be942f5a0d4601ff791683050ca36bd5c4cb (diff) | |
download | xine-lib-16be79073dc84a67b72f7e1a5cac93a5b34782aa.tar.gz xine-lib-16be79073dc84a67b72f7e1a5cac93a5b34782aa.tar.bz2 |
move all configuration responsibilities to xine_decoder.c.
cc decoder is now initialized only if CC events arrive.
clean up cc_config_t by moving out renderer specific parts to new
cc_renderer_t.
fix event race conditions and simplify code by using one global lock
for cc decoder that stays locked for the entire duration of a CC function
call.
CVS patchset: 1368
CVS date: 2002/01/07 19:30:09
Diffstat (limited to 'src/libspucc/cc_decoder.h')
-rw-r--r-- | src/libspucc/cc_decoder.h | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/src/libspucc/cc_decoder.h b/src/libspucc/cc_decoder.h index bf8210ad7..80553a80d 100644 --- a/src/libspucc/cc_decoder.h +++ b/src/libspucc/cc_decoder.h @@ -1,44 +1,40 @@ typedef struct cc_decoder_s cc_decoder_t; +typedef struct cc_renderer_s cc_renderer_t; #define CC_FONT_MAX 256 -typedef struct cc_confvar_s { +typedef struct cc_config_s { int cc_enabled; /* true if closed captions are enabled */ - char font[CC_FONT_MAX + 1]; /* standard captioning font & size */ + char font[CC_FONT_MAX]; /* standard captioning font & size */ int font_size; - char italic_font[CC_FONT_MAX + 1]; /* italic captioning font & size */ + char italic_font[CC_FONT_MAX]; /* italic captioning font & size */ int center; /* true if captions should be centered */ /* according to text width */ /* the following variables are not controlled by configuration files; they */ /* are intrinsic to the properties of the configuration options and the */ /* currently played video */ - int x; /* coordinates of the captioning area */ - int y; - int width; - int height; - int max_char_height; /* captioning font properties */ - int max_char_width; - int video_width; /* video dimensions */ - int video_height; int can_cc; /* true if captions can be displayed */ - /* (i.e., font fits on screen) */ - - cc_decoder_t *decoder; /* back pointer to decoder (necessary for */ - /* sending some messages after config changes) */ -} cc_confvar_t; - + /* (e.g., font fits on screen) */ -typedef struct cc_config_s { - cc_confvar_t vars; - pthread_mutex_t cc_mutex; + cc_renderer_t *renderer; /* closed captioning renderer */ } cc_config_t; - -cc_decoder_t *cc_decoder_open(osd_renderer_t *renderer, metronom_t *metronom, - config_values_t *cfg, cc_config_t *cc_cfg); +cc_decoder_t *cc_decoder_open(cc_config_t *cc_cfg); void cc_decoder_close(cc_decoder_t *this_obj); -void cc_decoder_init(config_values_t *cfg, cc_config_t *cc_cfg); -void cc_notify_frame_change(cc_decoder_t *this, int width, int height); +void cc_decoder_init(void); + void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, uint32_t pts, uint32_t scr); + +/* Instantiates a new closed captioning renderer. */ +cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer, + metronom_t *metronom, cc_config_t *cc_cfg, + int video_width, int video_height); + +/* Destroys a closed captioning renderer. */ +void cc_renderer_close(cc_renderer_t *this_obj); + +/* Updates the renderer configuration variables */ +void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width, + int video_height); |