浏览代码

iOS/tvOS: reimplement private VLCKit-API to change SPU font, color, size and boldness on-the-fly

(cherry picked from commit 2ce0d3b6132e60a9a050d11d851f9f74e916e47a)
Felix Paul Kühne 7 年之前
父节点
当前提交
ce2c7d149b

+ 2 - 2
Resources/MobileVLCKit/patches/0001-arm_neon-added-function-macro-to-handle-the-undersco.patch

@@ -1,7 +1,7 @@
 From b263d52c5a75a582b829ac3384e2901ad46c06d7 Mon Sep 17 00:00:00 2001
 From b263d52c5a75a582b829ac3384e2901ad46c06d7 Mon Sep 17 00:00:00 2001
 From: David Geldreich <david.geldreich@free.fr>
 From: David Geldreich <david.geldreich@free.fr>
 Date: Fri, 20 Apr 2012 16:41:19 +0200
 Date: Fri, 20 Apr 2012 16:41:19 +0200
-Subject: [PATCH 01/14] arm_neon: added function macro to handle the underscore
+Subject: [PATCH 01/15] arm_neon: added function macro to handle the underscore
  prefix for the iOS ARM ABI
  prefix for the iOS ARM ABI
 
 
 ---
 ---
@@ -65,5 +65,5 @@ index 0000000000..d853255fec
 +.endm
 +.endm
 +
 +
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0002-deinterlace-merge-use-a-macro-to-fix-compilation-for.patch

@@ -1,7 +1,7 @@
-From 26f5a2b1ad9aafde480806a88d03d5d10bf7f6e1 Mon Sep 17 00:00:00 2001
+From 26f1d48e8cec53109d6bb2c0aab44f63353a74c1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 10 Aug 2012 16:02:07 +0200
 Date: Fri, 10 Aug 2012 16:02:07 +0200
-Subject: [PATCH 02/14] deinterlace/merge: use a macro to fix compilation for
+Subject: [PATCH 02/15] deinterlace/merge: use a macro to fix compilation for
  iOS
  iOS
 
 
 ---
 ---
@@ -82,5 +82,5 @@ index dd779029ae..03e5042b28 100644
  	b		1b
  	b		1b
 +endfunc
 +endfunc
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0003-arm_neon-work-around-libtool-issue.patch

@@ -1,7 +1,7 @@
-From e0aaacfb19be2cbd14d89af273ca54107ed33635 Mon Sep 17 00:00:00 2001
+From f01a21b2a6ddeceabeb1b4e54ac74fad42b70215 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 18 Dec 2014 22:14:55 +0100
 Date: Thu, 18 Dec 2014 22:14:55 +0100
-Subject: [PATCH 03/14] arm_neon: work-around libtool issue
+Subject: [PATCH 03/15] arm_neon: work-around libtool issue
 
 
 ---
 ---
  modules/arm_neon/Makefile.am | 2 ++
  modules/arm_neon/Makefile.am | 2 ++
@@ -18,5 +18,5 @@ index db81ec0b84..e67e07e61c 100644
  
  
  libchroma_yuv_neon_plugin_la_SOURCES = \
  libchroma_yuv_neon_plugin_la_SOURCES = \
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0004-arm_neon-fix-iOS-linking.patch

@@ -1,7 +1,7 @@
-From 354579cf5140d01f5f944e0de92cb91c4813bdad Mon Sep 17 00:00:00 2001
+From 3c4f8c60437c4561d762682d5baebce97426e2ad Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Wed, 10 Dec 2014 22:14:55 +0100
 Date: Wed, 10 Dec 2014 22:14:55 +0100
-Subject: [PATCH 04/14] arm_neon: fix iOS linking
+Subject: [PATCH 04/15] arm_neon: fix iOS linking
 
 
 ---
 ---
  modules/arm_neon/amplify.S              |  7 ++---
  modules/arm_neon/amplify.S              |  7 ++---
@@ -194,5 +194,5 @@ index a94ae8539f..54b43a79e3 100644
  	pop {r4,pc}
  	pop {r4,pc}
 +endfunc
 +endfunc
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0005-disable-neon-volume-plugin.patch

@@ -1,7 +1,7 @@
-From c3f4477dae5a5aff8d54d6c30cf14067c5aae1e0 Mon Sep 17 00:00:00 2001
+From 578973507783bb5fc030559e932e41361b241802 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Wed, 10 Dec 2014 22:14:55 +0100
 Date: Wed, 10 Dec 2014 22:14:55 +0100
-Subject: [PATCH 05/14] disable neon volume plugin
+Subject: [PATCH 05/15] disable neon volume plugin
 
 
 ---
 ---
  modules/arm_neon/Makefile.am | 1 -
  modules/arm_neon/Makefile.am | 1 -
@@ -19,5 +19,5 @@ index e67e07e61c..690975235f 100644
  	libyuv_rgb_neon_plugin.la
  	libyuv_rgb_neon_plugin.la
  endif
  endif
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 4 - 4
Resources/MobileVLCKit/patches/0006-Enable-System-DL.patch

@@ -1,7 +1,7 @@
-From 4ee714e761c1ec2c59bdbaf72dbacf6b4e88fb3d Mon Sep 17 00:00:00 2001
+From 537532411de986ae47410c2670d37b6044241f80 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 22 Jul 2016 11:11:44 +0200
 Date: Fri, 22 Jul 2016 11:11:44 +0200
-Subject: [PATCH] Enable System DL
+Subject: [PATCH 06/15] Enable System DL
 
 
 ---
 ---
  contrib/src/ffmpeg/patch-as-patch-can.patch | 20 ++++++++++++++++++++
  contrib/src/ffmpeg/patch-as-patch-can.patch | 20 ++++++++++++++++++++
@@ -36,7 +36,7 @@ index 0000000000..2d60cf7140
 +         in_format.mSampleRate = avctx->sample_rate ? avctx->sample_rate : 44100;
 +         in_format.mSampleRate = avctx->sample_rate ? avctx->sample_rate : 44100;
 +         in_format.mChannelsPerFrame = avctx->channels ? avctx->channels : 1;
 +         in_format.mChannelsPerFrame = avctx->channels ? avctx->channels : 1;
 diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
 diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
-index b5ad263ec7..e245b75de1 100644
+index e99d9dfb7c..16217f1285 100644
 --- a/contrib/src/ffmpeg/rules.mak
 --- a/contrib/src/ffmpeg/rules.mak
 +++ b/contrib/src/ffmpeg/rules.mak
 +++ b/contrib/src/ffmpeg/rules.mak
 @@ -26,6 +26,9 @@ FFMPEGCONF = \
 @@ -26,6 +26,9 @@ FFMPEGCONF = \
@@ -58,5 +58,5 @@ index b5ad263ec7..e245b75de1 100644
  
  
  .ffmpeg: ffmpeg
  .ffmpeg: ffmpeg
 -- 
 -- 
-2.13.5 (Apple Git-94)
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0007-deinterlace-merge-arm64-fix-linking-on-appleOS.patch

@@ -1,7 +1,7 @@
-From b08ebe442bbf6c27e53ef176b537cb1d32d78239 Mon Sep 17 00:00:00 2001
+From f45aeb40a46a370c2d52d039a507ef8d90229d09 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 12 Sep 2016 17:04:05 +0200
 Date: Mon, 12 Sep 2016 17:04:05 +0200
-Subject: [PATCH 07/14] deinterlace-merge-arm64: fix linking on appleOS
+Subject: [PATCH 07/15] deinterlace-merge-arm64: fix linking on appleOS
 
 
 ---
 ---
  modules/arm_neon/asm64.S                       | 46 ++++++++++++++++++++++++++
  modules/arm_neon/asm64.S                       | 46 ++++++++++++++++++++++++++
@@ -107,5 +107,5 @@ index db19e54caf..63c04d3fdd 100644
  	ret
  	ret
 +endfunc
 +endfunc
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 4 - 4
Resources/MobileVLCKit/patches/0008-http-add-vlc_http_cookies_clear.patch

@@ -1,7 +1,7 @@
-From d7dc0f73174cd1be9080d561c2ee1b0e3c21815a Mon Sep 17 00:00:00 2001
+From 4b8743bcf22bd35d4c1fb3ecf6c2ad2a3f4fbb42 Mon Sep 17 00:00:00 2001
 From: Thomas Guillem <thomas@gllm.fr>
 From: Thomas Guillem <thomas@gllm.fr>
 Date: Fri, 16 Sep 2016 15:51:10 +0200
 Date: Fri, 16 Sep 2016 15:51:10 +0200
-Subject: [PATCH 08/14] http: add vlc_http_cookies_clear
+Subject: [PATCH 08/15] http: add vlc_http_cookies_clear
 
 
 Clear all cookies without deleting the jar.
 Clear all cookies without deleting the jar.
 ---
 ---
@@ -23,7 +23,7 @@ index ed7e1613da..da1fe4ef1a 100644
  
  
  /**
  /**
 diff --git a/src/libvlccore.sym b/src/libvlccore.sym
 diff --git a/src/libvlccore.sym b/src/libvlccore.sym
-index 7c99021ae4..250f14da5a 100644
+index a15ba0d923..db7f4030b9 100644
 --- a/src/libvlccore.sym
 --- a/src/libvlccore.sym
 +++ b/src/libvlccore.sym
 +++ b/src/libvlccore.sym
 @@ -128,6 +128,7 @@ vlc_http_auth_ParseAuthenticationInfoHeader
 @@ -128,6 +128,7 @@ vlc_http_auth_ParseAuthenticationInfoHeader
@@ -61,5 +61,5 @@ index 77ab852b15..f229b85dea 100644
  }
  }
  
  
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 7 - 7
Resources/MobileVLCKit/patches/0009-libvlc_media-add-cookie_jar-API.patch

@@ -1,7 +1,7 @@
-From 7ff53222824c4e61f8db548dd28b50f2b86a9921 Mon Sep 17 00:00:00 2001
+From 2ed0f231c6665b39e914bee1130f0efabb0ed9e2 Mon Sep 17 00:00:00 2001
 From: Thomas Guillem <thomas@gllm.fr>
 From: Thomas Guillem <thomas@gllm.fr>
 Date: Fri, 16 Sep 2016 15:51:11 +0200
 Date: Fri, 16 Sep 2016 15:51:11 +0200
-Subject: [PATCH 09/14] libvlc_media: add cookie_jar API
+Subject: [PATCH 09/15] libvlc_media: add cookie_jar API
 
 
 ---
 ---
  include/vlc/libvlc_media.h | 35 +++++++++++++++++++++++++++++++++++
  include/vlc/libvlc_media.h | 35 +++++++++++++++++++++++++++++++++++
@@ -58,10 +58,10 @@ index 383f366b69..2a5666688d 100644
  
  
  # ifdef __cplusplus
  # ifdef __cplusplus
 diff --git a/lib/libvlc.sym b/lib/libvlc.sym
 diff --git a/lib/libvlc.sym b/lib/libvlc.sym
-index caa55981bf..c0d5754abf 100644
+index 7c7fea02e6..9dbf0efa4e 100644
 --- a/lib/libvlc.sym
 --- a/lib/libvlc.sym
 +++ b/lib/libvlc.sym
 +++ b/lib/libvlc.sym
-@@ -216,6 +216,8 @@ libvlc_media_set_user_data
+@@ -218,6 +218,8 @@ libvlc_media_set_user_data
  libvlc_media_subitems
  libvlc_media_subitems
  libvlc_media_tracks_get
  libvlc_media_tracks_get
  libvlc_media_tracks_release
  libvlc_media_tracks_release
@@ -71,7 +71,7 @@ index caa55981bf..c0d5754abf 100644
  libvlc_playlist_play
  libvlc_playlist_play
  libvlc_release
  libvlc_release
 diff --git a/lib/media.c b/lib/media.c
 diff --git a/lib/media.c b/lib/media.c
-index af246c6c7e..4004dbc1eb 100644
+index 54875d6a0e..e1d23caaf5 100644
 --- a/lib/media.c
 --- a/lib/media.c
 +++ b/lib/media.c
 +++ b/lib/media.c
 @@ -406,6 +406,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
 @@ -406,6 +406,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
@@ -92,7 +92,7 @@ index af246c6c7e..4004dbc1eb 100644
      vlc_cond_destroy( &p_md->parsed_cond );
      vlc_cond_destroy( &p_md->parsed_cond );
      vlc_mutex_destroy( &p_md->parsed_lock );
      vlc_mutex_destroy( &p_md->parsed_lock );
      vlc_mutex_destroy( &p_md->subitems_lock );
      vlc_mutex_destroy( &p_md->subitems_lock );
-@@ -1277,3 +1281,24 @@ void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
+@@ -1288,3 +1292,24 @@ void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
      }
      }
      free( pp_slaves );
      free( pp_slaves );
  }
  }
@@ -163,5 +163,5 @@ index daef2faedd..4a6cf0cb0e 100644
  
  
      p_input_thread = input_Create( p_mi, p_mi->p_md->p_input_item, NULL,
      p_input_thread = input_Create( p_mi, p_mi->p_md->p_input_item, NULL,
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0010-contrib-gcrypt-work-around-a-libtool-limitation.patch

@@ -1,7 +1,7 @@
-From 99e5fd5479e463e9fed6e616fcaff8d9e3f1e434 Mon Sep 17 00:00:00 2001
+From 43681d842ba377f6a4eff434d5bd5d81775fce7f Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Sun, 7 Dec 2014 20:02:18 +0100
 Date: Sun, 7 Dec 2014 20:02:18 +0100
-Subject: [PATCH 10/14] contrib/gcrypt: work-around a libtool limitation
+Subject: [PATCH 10/15] contrib/gcrypt: work-around a libtool limitation
 
 
 ---
 ---
  contrib/src/gcrypt/rules.mak                       |  1 +
  contrib/src/gcrypt/rules.mak                       |  1 +
@@ -53,5 +53,5 @@ index 0000000000..df97ffb488
 + AM_CFLAGS = $(GPG_ERROR_CFLAGS)
 + AM_CFLAGS = $(GPG_ERROR_CFLAGS)
 + 
 + 
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0011-contrib-gcrypt-fix-tvOS-compilation.patch

@@ -1,7 +1,7 @@
-From 0ea9497b2392046e13fbe9d91992b1c5e246ea77 Mon Sep 17 00:00:00 2001
+From b15a3081c13c1f7487695292905e80fec4708ec6 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Sat, 3 Oct 2015 22:45:14 +0200
 Date: Sat, 3 Oct 2015 22:45:14 +0200
-Subject: [PATCH 11/14] contrib/gcrypt: fix tvOS compilation
+Subject: [PATCH 11/15] contrib/gcrypt: fix tvOS compilation
 
 
 ---
 ---
  contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch | 16 ++++++++++++++++
  contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch | 16 ++++++++++++++++
@@ -56,5 +56,5 @@ index c2d4b934f4..dbd556be61 100644
  GCRYPT_CONF += --disable-aesni-support
  GCRYPT_CONF += --disable-aesni-support
  else
  else
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0012-contrib-gcrypt-update-patches.patch

@@ -1,7 +1,7 @@
-From 4b2f48db45888f8f388805da5cb2964728405fcd Mon Sep 17 00:00:00 2001
+From be3c74bb2d7ab28e21f4c8270392f553579ff867 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 12 Sep 2016 17:03:37 +0200
 Date: Mon, 12 Sep 2016 17:03:37 +0200
-Subject: [PATCH 12/14] contrib/gcrypt: update patches
+Subject: [PATCH 12/15] contrib/gcrypt: update patches
 
 
 ---
 ---
  contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch  | 308 ++++++++++++++++++++-
  contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch  | 308 ++++++++++++++++++++-
@@ -363,5 +363,5 @@ index df97ffb488..957f268ad2 100644
   
   
   # Need to include ../src in addition to top_srcdir because gcrypt.h is
   # Need to include ../src in addition to top_srcdir because gcrypt.h is
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0013-Replace-thread-local-with-pthread-TSD.patch

@@ -1,7 +1,7 @@
-From a26045e6d1d33c23d3227173b34f34ae2527218d Mon Sep 17 00:00:00 2001
+From 823adc6b13806e57deb4f6fc5c3e3a2d1869a8e9 Mon Sep 17 00:00:00 2001
 From: Thomas Guillem <thomas@gllm.fr>
 From: Thomas Guillem <thomas@gllm.fr>
 Date: Mon, 17 Jul 2017 17:03:24 +0200
 Date: Mon, 17 Jul 2017 17:03:24 +0200
-Subject: [PATCH 13/14] Replace thread local with pthread TSD
+Subject: [PATCH 13/15] Replace thread local with pthread TSD
 
 
 ---
 ---
  src/misc/interrupt.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
  src/misc/interrupt.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -222,5 +222,5 @@ index 810c8ffc81..3d2d2f1dc8 100644
      twalk(priv->var_root, TwalkGetNames);
      twalk(priv->var_root, TwalkGetNames);
      vlc_mutex_unlock(&priv->var_lock);
      vlc_mutex_unlock(&priv->var_lock);
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 3 - 3
Resources/MobileVLCKit/patches/0014-contrib-use-live555-version-that-is-compatible-with-.patch

@@ -1,7 +1,7 @@
-From e11038af88732b7774dc3f39393e2018406ea632 Mon Sep 17 00:00:00 2001
+From b2e9c736c7c9a7e60a16a749a44b112860ee765c Mon Sep 17 00:00:00 2001
 From: Carola Nitz <nitz.carola@googlemail.com>
 From: Carola Nitz <nitz.carola@googlemail.com>
 Date: Fri, 29 Sep 2017 14:49:02 +0200
 Date: Fri, 29 Sep 2017 14:49:02 +0200
-Subject: [PATCH 14/14] contrib: use live555 version that is compatible with
+Subject: [PATCH 14/15] contrib: use live555 version that is compatible with
  LGPL2
  LGPL2
 
 
 ---
 ---
@@ -46,5 +46,5 @@ index c389f2c33d..7a629bdee4 100644
  		echo "PREFIX = $(PREFIX)" >> $$subdir/Makefile.head && \
  		echo "PREFIX = $(PREFIX)" >> $$subdir/Makefile.head && \
  		echo "LIBDIR = $(PREFIX)/lib" >> $$subdir/Makefile.head ; done
  		echo "LIBDIR = $(PREFIX)/lib" >> $$subdir/Makefile.head ; done
 -- 
 -- 
-2.15.0
+2.15.1
 
 

+ 221 - 0
Resources/MobileVLCKit/patches/0015-libvlc-add-a-basic-API-to-change-freetype-s-color-bo.patch

@@ -0,0 +1,221 @@
+From de4d690e85b426fac18bf22acb498e96493b5852 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
+Date: Sun, 17 Dec 2017 18:05:40 +0100
+Subject: [PATCH 15/15] libvlc: add a basic API to change freetype's color,
+ bold, font and size variables on-the-fly
+
+---
+ include/vlc/libvlc_media_player.h         | 26 ++++++++++++
+ lib/libvlc.sym                            |  6 +++
+ lib/media_player.c                        |  6 +++
+ lib/video.c                               | 69 ++++++++++++++++++++++++++++++-
+ modules/text_renderer/freetype/freetype.c | 22 ++++++++--
+ 5 files changed, 124 insertions(+), 5 deletions(-)
+
+diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
+index 4336df9442..20b220448b 100644
+--- a/include/vlc/libvlc_media_player.h
++++ b/include/vlc/libvlc_media_player.h
+@@ -1567,6 +1567,32 @@ LIBVLC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
+ LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
+                                                    unsigned option, float value );
+ 
++enum libvlc_video_textrenderer_option_t {
++    libvlc_textrender_font = 0,
++    libvlc_textrender_fontsize,
++    libvlc_textrender_fontcolor,
++    libvlc_textrender_fontforcebold,
++};
++
++LIBVLC_API bool libvlc_video_get_textrenderer_bool( libvlc_media_player_t *p_mi,
++                                                    unsigned option );
++
++LIBVLC_API void libvlc_video_set_textrenderer_bool( libvlc_media_player_t *p_mi,
++                                                    unsigned option, bool value );
++
++LIBVLC_API int libvlc_video_get_textrenderer_int( libvlc_media_player_t *p_mi,
++                                                  unsigned option );
++
++LIBVLC_API void libvlc_video_set_textrenderer_int( libvlc_media_player_t *p_mi,
++                                                   unsigned option, int value );
++
++LIBVLC_API char *libvlc_video_get_textrenderer_string( libvlc_media_player_t *p_mi,
++                                                       unsigned option );
++
++LIBVLC_API void libvlc_video_set_textrenderer_string( libvlc_media_player_t *p_mi,
++                                                      unsigned option,
++                                                      const char *psz_text );
++
+ /** @} video */
+ 
+ /** \defgroup libvlc_audio LibVLC audio controls
+diff --git a/lib/libvlc.sym b/lib/libvlc.sym
+index 9dbf0efa4e..a08c67ae46 100644
+--- a/lib/libvlc.sym
++++ b/lib/libvlc.sym
+@@ -261,6 +261,9 @@ libvlc_video_get_spu_count
+ libvlc_video_get_spu_delay
+ libvlc_video_get_spu_description
+ libvlc_video_get_teletext
++libvlc_video_get_textrenderer_bool
++libvlc_video_get_textrenderer_int
++libvlc_video_get_textrenderer_string
+ libvlc_video_get_title_description
+ libvlc_video_get_track
+ libvlc_video_get_track_count
+@@ -285,6 +288,9 @@ libvlc_video_set_spu
+ libvlc_video_set_spu_delay
+ libvlc_video_set_subtitle_file
+ libvlc_video_set_teletext
++libvlc_video_set_textrenderer_bool
++libvlc_video_set_textrenderer_int
++libvlc_video_set_textrenderer_string
+ libvlc_video_set_track
+ libvlc_video_take_snapshot
+ libvlc_video_new_viewpoint
+diff --git a/lib/media_player.c b/lib/media_player.c
+index ae72bb2b95..5f167bb4ad 100644
+--- a/lib/media_player.c
++++ b/lib/media_player.c
+@@ -694,6 +694,12 @@ libvlc_media_player_new( libvlc_instance_t *instance )
+     var_Create (mp, "saturation", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
+     var_Create (mp, "gamma", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
+ 
++    /* SPU */
++    var_Create (mp, "freetype-font", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
++    var_Create (mp, "freetype-rel-fontsize", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
++    var_Create (mp, "freetype-color", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
++    var_Create (mp, "freetype-bold", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
++
+      /* Audio */
+     var_Create (mp, "aout", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
+     var_Create (mp, "audio-device", VLC_VAR_STRING);
+diff --git a/lib/video.c b/lib/video.c
+index acbba3a30f..035cc0ebf1 100644
+--- a/lib/video.c
++++ b/lib/video.c
+@@ -812,7 +812,7 @@ static bool find_sub_source_by_name( libvlc_media_player_t *p_mi, const char *re
+ }
+ 
+ typedef const struct {
+-    const char name[20];
++    const char name[25];
+     unsigned type;
+ } opt_t;
+ 
+@@ -839,6 +839,7 @@ set_value( libvlc_media_player_t *p_mi, const char *restrict name,
+         }
+         case VLC_VAR_INTEGER:
+         case VLC_VAR_FLOAT:
++        case VLC_VAR_BOOL:
+         case VLC_VAR_STRING:
+             if( i_expected_type != opt->type )
+             {
+@@ -1086,3 +1087,69 @@ float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
+ {
+     return get_float( p_mi, "adjust", adjust_option_bynumber(option) );
+ }
++
++/* SPU HACK */
++
++static const opt_t *
++textrenderer_option_bynumber( unsigned option )
++{
++    static const opt_t optlist[] =
++    {
++    { "freetype-font",            VLC_VAR_STRING },
++    { "freetype-rel-fontsize",    VLC_VAR_INTEGER },
++    { "freetype-color",           VLC_VAR_INTEGER },
++    { "freetype-bold",            VLC_VAR_BOOL },
++    };
++    enum { num_opts = sizeof(optlist) / sizeof(*optlist) };
++
++    const opt_t *r = option < num_opts ? optlist+option : NULL;
++    if( !r )
++        libvlc_printerr( "Unknown freetype option" );
++    return r;
++}
++
++/* basic text renderer support */
++
++void libvlc_video_set_textrenderer_bool( libvlc_media_player_t *p_mi,
++                                        unsigned option, bool value )
++{
++    set_value( p_mi, "freetype", textrenderer_option_bynumber(option), VLC_VAR_BOOL,
++               &(vlc_value_t) { .b_bool = value }, false );
++}
++
++
++bool libvlc_video_get_textrenderer_bool( libvlc_media_player_t *p_mi,
++                                         unsigned option )
++{
++    return get_int( p_mi, "freetype", textrenderer_option_bynumber(option) );
++}
++
++
++void libvlc_video_set_textrenderer_int( libvlc_media_player_t *p_mi,
++                                       unsigned option, int value )
++{
++    set_value( p_mi, "freetype", textrenderer_option_bynumber(option), VLC_VAR_INTEGER,
++               &(vlc_value_t) { .i_int = value }, false );
++}
++
++
++int libvlc_video_get_textrenderer_int( libvlc_media_player_t *p_mi,
++                                      unsigned option )
++{
++    return get_int( p_mi, "freetype", textrenderer_option_bynumber(option) );
++}
++
++
++void libvlc_video_set_textrenderer_string( libvlc_media_player_t *p_mi,
++                                          unsigned option, const char *psz_value )
++{
++    set_value( p_mi, "freetype", textrenderer_option_bynumber(option), VLC_VAR_STRING,
++               &(vlc_value_t){ .psz_string = (char *)psz_value }, true );
++}
++
++
++char * libvlc_video_get_textrenderer_string( libvlc_media_player_t *p_mi,
++                                            unsigned option )
++{
++    return get_string( p_mi, "freetype", textrenderer_option_bynumber(option) );
++}
+diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
+index b7e4823e38..720870e9e3 100644
+--- a/modules/text_renderer/freetype/freetype.c
++++ b/modules/text_renderer/freetype/freetype.c
+@@ -943,12 +943,26 @@ static inline int RenderAXYZ( filter_t *p_filter,
+ 
+ static void UpdateDefaultLiveStyles( filter_t *p_filter )
+ {
+-    text_style_t *p_style = p_filter->p_sys->p_default_style;
++    filter_sys_t *p_sys = p_filter->p_sys;
++
++    p_sys->p_default_style->i_background_alpha = var_InheritInteger( p_filter, "freetype-background-opacity" );
++    p_sys->p_default_style->i_background_color = var_InheritInteger( p_filter, "freetype-background-color" );
++
++    FREENULL( p_sys->p_default_style->psz_fontname );
++    p_sys->p_default_style->psz_fontname = strdup( var_InheritString( p_filter, "freetype-font" ) );
+ 
+-    p_style->i_font_color = var_InheritInteger( p_filter, "freetype-color" );
++    p_sys->p_forced_style->f_font_relsize = 1.0 / var_InheritInteger( p_filter, "freetype-rel-fontsize" );;
+ 
+-    p_style->i_background_alpha = var_InheritInteger( p_filter, "freetype-background-opacity" );
+-    p_style->i_background_color = var_InheritInteger( p_filter, "freetype-background-color" );
++    p_sys->p_default_style->i_font_color = var_InheritInteger( p_filter, "freetype-color" );
++
++    if (var_InheritBool( p_filter, "freetype-bold" )) {
++        p_sys->p_forced_style->i_style_flags |= STYLE_BOLD;
++        p_sys->p_forced_style->i_features |= STYLE_HAS_FLAGS;
++    } else {
++        p_sys->p_forced_style->i_style_flags &= ~STYLE_BOLD;
++        p_sys->p_forced_style->i_features &= ~STYLE_HAS_FLAGS;
++    }
++    text_style_Merge( p_sys->p_default_style, p_sys->p_forced_style, true );
+ }
+ 
+ static void FillDefaultStyles( filter_t *p_filter )
+-- 
+2.15.1
+

+ 4 - 4
Sources/VLCMediaPlayer.m

@@ -504,22 +504,22 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
 #if TARGET_OS_IPHONE
 #if TARGET_OS_IPHONE
 - (void)setTextRendererFontSize:(NSNumber *)fontSize
 - (void)setTextRendererFontSize:(NSNumber *)fontSize
 {
 {
-    #warning setTextRendererFontSize: NO-OP
+    libvlc_video_set_textrenderer_int(_playerInstance, libvlc_textrender_fontsize, [fontSize intValue]);
 }
 }
 
 
 - (void)setTextRendererFont:(NSString *)fontname
 - (void)setTextRendererFont:(NSString *)fontname
 {
 {
-    #warning setTextRendererFont: NO-OP
+    libvlc_video_set_textrenderer_string(_playerInstance, libvlc_textrender_font, [fontname UTF8String]);
 }
 }
 
 
 - (void)setTextRendererFontColor:(NSNumber *)fontColor
 - (void)setTextRendererFontColor:(NSNumber *)fontColor
 {
 {
-    #warning setTextRendererFontColor: NO-OP
+    libvlc_video_set_textrenderer_int(_playerInstance, libvlc_textrender_fontcolor, [fontColor intValue]);
 }
 }
 
 
 - (void)setTextRendererFontForceBold:(NSNumber *)fontForceBold
 - (void)setTextRendererFontForceBold:(NSNumber *)fontForceBold
 {
 {
-    #warning setTextRendererFontForceBold: NO-OP
+    libvlc_video_set_textrenderer_bool(_playerInstance, libvlc_textrender_fontforcebold, [fontForceBold boolValue]);
 }
 }
 #endif
 #endif