[vlc-devel] [PATCH 1/4] add vout sub-text-scale variable
Francois Cartegnie
fcvlcdev at free.fr
Fri Aug 28 13:05:51 CEST 2015
For cross renderers spu text sizing
---
src/libvlc-module.c | 5 +++++
src/video_output/video_output.c | 6 +++---
src/video_output/vout_intf.c | 3 +++
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 63ff4e0..2cb2e2a 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -694,6 +694,9 @@ static const char *const ppsz_prefres[] = {
"You can use this option to place the subtitles under the movie, " \
"instead of over the movie. Try several positions.")
+#define SUB_TEXT_SCALE_TEXT N_("Subtitles text scaling factor")
+#define SUB_TEXT_SCALE_LONGTEXT N_("Set value to alter subtitles size where possible")
+
#define SPU_TEXT N_("Enable sub-pictures")
#define SPU_LONGTEXT N_( \
"You can completely disable the sub-picture processing.")
@@ -1625,6 +1628,8 @@ vlc_module_begin ()
SUB_PATH_TEXT, SUB_PATH_LONGTEXT, true )
add_integer( "sub-margin", 0, SUB_MARGIN_TEXT,
SUB_MARGIN_LONGTEXT, true )
+ add_float( "sub-text-scale", 1.0,
+ SUB_TEXT_SCALE_TEXT, SUB_TEXT_SCALE_LONGTEXT, false )
set_section( N_( "Overlays" ) , NULL )
add_module_list( "sub-source", "sub source", NULL,
SUB_SOURCE_TEXT, SUB_SOURCE_LONGTEXT, false )
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index a87e0b7..0ce5270 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -144,12 +144,12 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
vlc_mutex_init(&vout->p->filter.lock);
vlc_mutex_init(&vout->p->spu_lock);
- /* Initialize subpicture unit */
- vout->p->spu = spu_Create(vout);
-
/* Take care of some "interface/control" related initialisations */
vout_IntfInit(vout);
+ /* Initialize subpicture unit */
+ vout->p->spu = spu_Create(vout);
+
vout->p->title.show = var_InheritBool(vout, "video-title-show");
vout->p->title.timeout = var_InheritInteger(vout, "video-title-timeout");
vout->p->title.position = var_InheritInteger(vout, "video-title-position");
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index af6d476..eb88308 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -293,6 +293,9 @@ void vout_IntfInit( vout_thread_t *p_vout )
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
var_AddCallback( p_vout, "sub-margin", SubMarginCallback, NULL );
+ var_Create( p_vout, "sub-text-scale",
+ VLC_VAR_FLOAT | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
+
/* Mouse coordinates */
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS );
--
2.4.3
More information about the vlc-devel
mailing list