Commit fa35e29b authored by Stefan Pöschel's avatar Stefan Pöschel Committed by Jean-Baptiste Kempf

ZVBI: add option to select decoding Presentation Level

This commit adds an option to the ZVBI settings to select the Teletext
Presentation Level which is used for decoding. Thus one can switch to a lower
level in case of problems or can compare the rendering of a page at different
levels. The default value is Level 3.5, which already has been used each time
for decoding here.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a3d7cd5f
...@@ -76,11 +76,21 @@ static void Close( vlc_object_t * ); ...@@ -76,11 +76,21 @@ static void Close( vlc_object_t * );
#define TELX_LONGTEXT N_( "Output teletext subtitles as text " \ #define TELX_LONGTEXT N_( "Output teletext subtitles as text " \
"instead of as RGBA" ) "instead of as RGBA" )
#define LEVEL_TEXT N_("Presentation Level")
static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
static const char *const ppsz_pos_descriptions[] = static const char *const ppsz_pos_descriptions[] =
{ N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") }; N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
static const int level_values[] = { 0, 1, 2, 3 };
static const char *const level_descriptions[] =
{ N_("1"), N_("1.5"), N_("2.5"), N_("3.5") };
/* separate internal and zvbi values, as the latter could change */
static const int level_zvbi_values[] =
{ VBI_WST_LEVEL_1, VBI_WST_LEVEL_1p5, VBI_WST_LEVEL_2p5, VBI_WST_LEVEL_3p5 };
vlc_module_begin () vlc_module_begin ()
set_description( N_("VBI and Teletext decoder") ) set_description( N_("VBI and Teletext decoder") )
set_shortname( N_("VBI & Teletext") ) set_shortname( N_("VBI & Teletext") )
...@@ -97,6 +107,8 @@ vlc_module_begin () ...@@ -97,6 +107,8 @@ vlc_module_begin ()
change_integer_list( pi_pos_values, ppsz_pos_descriptions ); change_integer_list( pi_pos_values, ppsz_pos_descriptions );
add_bool( "vbi-text", false, add_bool( "vbi-text", false,
TELX_TEXT, TELX_LONGTEXT, false ) TELX_TEXT, TELX_LONGTEXT, false )
add_integer( "vbi-level", 3, LEVEL_TEXT, NULL, false )
change_integer_list( level_values, level_descriptions );
vlc_module_end () vlc_module_end ()
/**************************************************************************** /****************************************************************************
...@@ -154,6 +166,7 @@ struct decoder_sys_t ...@@ -154,6 +166,7 @@ struct decoder_sys_t
unsigned int i_wanted_subpage; unsigned int i_wanted_subpage;
/* */ /* */
bool b_opaque; bool b_opaque;
unsigned int i_level;
struct { struct {
int pgno, subno; int pgno, subno;
} nav_link[6]; } nav_link[6];
...@@ -255,6 +268,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -255,6 +268,8 @@ static int Open( vlc_object_t *p_this )
p_sys->b_text = var_CreateGetBool( p_dec, "vbi-text" ); p_sys->b_text = var_CreateGetBool( p_dec, "vbi-text" );
// var_AddCallback( p_dec, "vbi-text", Text, p_sys ); // var_AddCallback( p_dec, "vbi-text", Text, p_sys );
p_sys->i_level = var_CreateGetInteger( p_dec, "vbi-level" );
/* Listen for keys */ /* Listen for keys */
var_AddCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec ); var_AddCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
...@@ -361,13 +376,14 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) ...@@ -361,13 +376,14 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
const unsigned int i_wanted_page = p_sys->i_wanted_page; const unsigned int i_wanted_page = p_sys->i_wanted_page;
const unsigned int i_wanted_subpage = p_sys->i_wanted_subpage; const unsigned int i_wanted_subpage = p_sys->i_wanted_subpage;
const bool b_opaque = p_sys->b_opaque; const bool b_opaque = p_sys->b_opaque;
const unsigned int i_level = p_sys->i_level > 3 ? 3 : p_sys->i_level;
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
/* Try to see if the page we want is in the cache yet */ /* Try to see if the page we want is in the cache yet */
memset( &p_page, 0, sizeof(vbi_page) ); memset( &p_page, 0, sizeof(vbi_page) );
b_cached = vbi_fetch_vt_page( p_sys->p_vbi_dec, &p_page, b_cached = vbi_fetch_vt_page( p_sys->p_vbi_dec, &p_page,
vbi_dec2bcd( i_wanted_page ), vbi_dec2bcd( i_wanted_page ),
i_wanted_subpage, VBI_WST_LEVEL_3p5, i_wanted_subpage, level_zvbi_values[i_level],
25, true ); 25, true );
if( i_wanted_page == p_sys->i_last_page && !p_sys->b_update ) if( i_wanted_page == p_sys->i_last_page && !p_sys->b_update )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment