[vlc-devel] [PATCH 1/3] subpicture: add a zoom factor in horizontal and vertical

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 23 09:42:12 CET 2018


So it can be scaled virtually without altering the actual data.
(provided the vout can handle it)

This should only be used for picture based SPU. Text should always
be rendered at full resolution.
---
 include/vlc_subpicture.h | 3 +++
 src/misc/subpicture.c    | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/include/vlc_subpicture.h b/include/vlc_subpicture.h
index f001df0894..3271671c30 100644
--- a/include/vlc_subpicture.h
+++ b/include/vlc_subpicture.h
@@ -74,6 +74,9 @@ struct subpicture_region_t
     int             i_max_width;     /** horizontal rendering/cropping target/limit */
     int             i_max_height;    /** vertical rendering/cropping target/limit */
 
+    vlc_rational_t  zoom_h;
+    vlc_rational_t  zoom_v;
+
     subpicture_region_t *p_next;                /**< next region in the list */
     subpicture_region_private_t *p_private;  /**< Private data for spu_t *only* */
 };
diff --git a/src/misc/subpicture.c b/src/misc/subpicture.c
index dd9fafe3eb..287717eb89 100644
--- a/src/misc/subpicture.c
+++ b/src/misc/subpicture.c
@@ -209,6 +209,9 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
     if( !p_region )
         return NULL;
 
+    p_region->zoom_h.den = p_region->zoom_h.num = 1;
+    p_region->zoom_v.den = p_region->zoom_v.num = 1;
+
     if ( p_fmt->i_chroma == VLC_CODEC_YUVP )
     {
         video_format_Copy( &p_region->fmt, p_fmt );
-- 
2.17.1



More information about the vlc-devel mailing list