DVBCore  22.3.0
Open Source DVB Engine
Enumerations | Functions
stbcc.h File Reference

Header file - Function prototypes for CC subtitles API. More...

#include "techtype.h"
#include "stbhwav.h"

Go to the source code of this file.

Enumerations

enum  E_CC_FONT_STYLE {
  CC_FONT_STYLE_DEFAULT = 0, CC_FONT_STYLE_MONOSPACE_SERIFS = 1, CC_FONT_STYLE_PROPORTIONAL_SERIFS = 2, CC_FONT_STYLE_MONOSPACE_NO_SERIFS = 3,
  CC_FONT_STYLE_PROPORTIONAL_NO_SERIFS = 4, CC_FONT_STYLE_CASUAL = 5, CC_FONT_STYLE_CURSIVE = 6, CC_FONT_STYLE_SMALL_CAPITALS = 7,
  CC_FONT_STYLE_BROADCAST = 255
}
 
enum  E_CC_TEXT_SIZE { CC_TEXT_SIZE_SMALL = 0, CC_TEXT_SIZE_STANDARD = 1, CC_TEXT_SIZE_LARGE = 2, CC_TEXT_SIZE_BROADCAST = 3 }
 

Functions

void STB_CCInitialise (void)
 Initialises closed caption subtitling control.
 
void STB_CCSetDisplayInfo (E_STB_AV_ASPECT_RATIO tv_aspect_ratio, U16BIT screen_width, U16BIT screen_height)
 The TV aspect ratio and size in pixels are needed for closed captions so the safe area can be determined, as well as the number of rows and columns. This information should be provided before closed captions are started and whenever the display changes. More...
 
void STB_CCSetFont (E_CC_FONT_STYLE font_style, U8BIT *font_data, U32BIT font_size)
 Closed captions can use a number of defined font styles: monospaced serif, proportional serif, monospace sans serif, proportional sans serif, casual, cursive, small capitals, and a default font. The font data for each of these needs to be provided and the CC renderer will use whichever ones are provided. More...
 
void STB_CCSetUserFontStyle (E_CC_FONT_STYLE font_style)
 Sets the user defined font style that will be used to display caption text, overriding the style defined by the broadcast. Set as CC_FONT_STYLE_BROADCAST to revert back to having caption text rendered using the broadcast defined font style. More...
 
E_CC_FONT_STYLE STB_CCGetUserFontStyle (void)
 Returns the user defined font style for rendering caption text. More...
 
void STB_CCSetUserTextSize (E_CC_TEXT_SIZE text_size)
 Sets the user defined text size of the caption text, overriding the broadcast text size. Use CC_TEXT_SIZE_BROADCAST to revert to using the broadcast size. Note that this may not take effect if it results in the caption window being too large to be displayed, in which case the next size down will be used. More...
 
E_CC_TEXT_SIZE STB_CCGetUserTextSize (void)
 Returns the user defined text size for rendering caption text. More...
 
BOOLEAN STB_CCStart (U8BIT path, BOOLEAN digital_cc, U8BIT caption_service_number)
 Starts processing closed caption subtitling. More...
 
void STB_CCEnable (BOOLEAN enable)
 Enables or disables display of CC subtitles. If the CC service to be used hasn't been set then service 1 will be selected by default. More...
 
void STB_CCStop (U8BIT path)
 Stops subtitling display. More...
 
void STB_CCStatus (BOOLEAN *started, BOOLEAN *enabled)
 Returns the current status of CC subtitling. More...
 

Detailed Description

Header file - Function prototypes for CC subtitles API.

Date
14/10/2020

Function Documentation

void STB_CCEnable ( BOOLEAN  enable)

Enables or disables display of CC subtitles. If the CC service to be used hasn't been set then service 1 will be selected by default.

Parameters
enableTRUE to enable display of closed captions, FALSE to disable
E_CC_FONT_STYLE STB_CCGetUserFontStyle ( void  )

Returns the user defined font style for rendering caption text.

Returns
User defined font style
E_CC_TEXT_SIZE STB_CCGetUserTextSize ( void  )

Returns the user defined text size for rendering caption text.

Returns
User defined text size
void STB_CCSetDisplayInfo ( E_STB_AV_ASPECT_RATIO  tv_aspect_ratio,
U16BIT  screen_width,
U16BIT  screen_height 
)

The TV aspect ratio and size in pixels are needed for closed captions so the safe area can be determined, as well as the number of rows and columns. This information should be provided before closed captions are started and whenever the display changes.

Parameters
tv_aspect_ratioAspect ratio of the screen, either 4:3 or 16:9
screen_widthWidth of the screen in pixels
screen_heightHeight of the screen in pixels
void STB_CCSetFont ( E_CC_FONT_STYLE  font_style,
U8BIT *  font_data,
U32BIT  font_size 
)

Closed captions can use a number of defined font styles: monospaced serif, proportional serif, monospace sans serif, proportional sans serif, casual, cursive, small capitals, and a default font. The font data for each of these needs to be provided and the CC renderer will use whichever ones are provided.

Parameters
font_styleThe font style of the font data being set (not CC_FONT_STYLE_BROADCAST)
font_dataData for the font. This is not copied and so must remain in memory
font_sizeNumber of bytes in the font data
void STB_CCSetUserFontStyle ( E_CC_FONT_STYLE  font_style)

Sets the user defined font style that will be used to display caption text, overriding the style defined by the broadcast. Set as CC_FONT_STYLE_BROADCAST to revert back to having caption text rendered using the broadcast defined font style.

Parameters
font_styleFont style to be used to render caption text
void STB_CCSetUserTextSize ( E_CC_TEXT_SIZE  text_size)

Sets the user defined text size of the caption text, overriding the broadcast text size. Use CC_TEXT_SIZE_BROADCAST to revert to using the broadcast size. Note that this may not take effect if it results in the caption window being too large to be displayed, in which case the next size down will be used.

Parameters
text_sizeSize to be used to render the caption text.
BOOLEAN STB_CCStart ( U8BIT  path,
BOOLEAN  digital_cc,
U8BIT  caption_service_number 
)

Starts processing closed caption subtitling.

Parameters
pathDecode path
digital_ccTRUE if 708 captions are to be decoded, FALSE for 608
caption_service_numberservice number to be decoded if digital (708) captions are selected
Returns
TRUE if closed caption processing is started, FALSE otherwise
void STB_CCStatus ( BOOLEAN *  started,
BOOLEAN *  enabled 
)

Returns the current status of CC subtitling.

Parameters
startedReturns the started state
enabledReturns the enabled state
void STB_CCStop ( U8BIT  path)

Stops subtitling display.

Parameters
pathDecode path