display: add an option to display SPUs in black bars

To do that we need the video to fill the entire window.
This commit is contained in:
Steve Lhomme 2023-07-26 14:28:02 +02:00
parent 8b09d72394
commit c7f0adde2b
6 changed files with 14 additions and 0 deletions

View File

@ -99,6 +99,7 @@ struct vout_display_placement {
vlc_video_align_t align; /**< Alignment within the window */
enum vlc_video_fitting fitting; /**< Scaling/fitting mode */
vlc_rational_t zoom; /**< Zoom ratio (if fitting is disabled) */
bool full_fill; /**< whether the rendering will take the whole display */
};
/**

View File

@ -703,6 +703,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create (mp, "sub-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
var_Create (mp, "osd", VLC_VAR_BOOL); // off
var_Create (mp, "spu-fill", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
doinherit = module_exists("marq") ? VLC_VAR_DOINHERIT : 0;
var_Create(mp, "marq-marquee", VLC_VAR_STRING);

View File

@ -287,6 +287,7 @@ static int vlc_vidsplit_Open(vout_display_t *vd,
.align = { 0, 0 } /* TODO */,
.fitting = VLC_VIDEO_FIT_SMALLER,
.zoom = { 1, 1 },
.full_fill = true,
},
};
const char *modname = output->psz_module;

View File

@ -787,6 +787,10 @@ static const char* const ppsz_restore_playback_desc[] = {
#define SPU_LONGTEXT N_( \
"You can completely disable the sub-picture processing.")
#define SPU_FULL_TEXT N_("Display sub-pictures on full window")
#define SPU_FULL_LONGTEXT N_( \
"It allows showing subtitles in black bars.")
#define SECONDARY_SUB_POSITION_TEXT N_("Position of secondary subtitles")
#define SECONDARY_SUB_POSITION_LONGTEXT N_( \
"Place on video where to display secondary subtitles (default bottom center).")
@ -1748,6 +1752,8 @@ vlc_module_begin ()
add_bool( "spu", true, SPU_TEXT, SPU_LONGTEXT )
change_safe ()
add_bool( "spu-fill", true, SPU_FULL_TEXT, SPU_FULL_LONGTEXT )
change_safe ()
add_bool( "osd", true, OSD_TEXT, OSD_LONGTEXT )
add_module("text-renderer", "text renderer", "any",
TEXTRENDERER_TEXT, TEXTRENDERER_LONGTEXT)

View File

@ -682,6 +682,7 @@ static void VoutGetDisplayCfg(vout_thread_sys_t *p_vout, const video_format_t *f
const int display_height = var_GetInteger(vout, "height");
cfg->display.width = display_width > 0 ? display_width : 0;
cfg->display.height = display_height > 0 ? display_height : 0;
cfg->display.full_fill = var_GetBool(vout, "spu-fill");
cfg->display.fitting = var_GetBool(vout, "autoscale")
? var_InheritFit(VLC_OBJECT(vout)) : VLC_VIDEO_FIT_NONE;
unsigned msar_num, msar_den;

View File

@ -298,6 +298,10 @@ void vout_CreateVars( vout_thread_t *p_vout )
/* Viewpoint */
var_Create( p_vout, "viewpoint", VLC_VAR_ADDRESS );
var_Create( p_vout, "viewpoint-changeable", VLC_VAR_BOOL );
/* SPU in full window */
var_Create( p_vout, "spu-fill", VLC_VAR_BOOL | VLC_VAR_DOINHERIT
| VLC_VAR_ISCOMMAND );
}
void vout_IntfInit( vout_thread_t *p_vout )