Browse Source

MVK: update libvlc

Felix Paul Kühne 8 years ago
parent
commit
8d7d79f94d
22 changed files with 387 additions and 113 deletions
  1. 2 2
      MobileVLCKit/patches/0001-arm_neon-added-function-macro-to-handle-the-undersco.patch
  2. 2 2
      MobileVLCKit/patches/0002-deinterlace-merge-use-a-macro-to-fix-compilation-for.patch
  3. 2 2
      MobileVLCKit/patches/0003-lib-media-player-inherit-deinterlace-variable-to-ach.patch
  4. 2 2
      MobileVLCKit/patches/0004-arm_neon-work-around-libtool-issue.patch
  5. 2 2
      MobileVLCKit/patches/0005-arm_neon-fix-iOS-linking.patch
  6. 2 2
      MobileVLCKit/patches/0006-disable-neon-volume-plugin.patch
  7. 2 2
      MobileVLCKit/patches/0007-src-misc-fix-compilation-for-OS-without-fork.patch
  8. 2 2
      MobileVLCKit/patches/0008-libvlc-hack-to-disable-daemon-mode.patch
  9. 2 2
      MobileVLCKit/patches/0009-libvlc-expose-a-base-set-of-freetype-options-to-over.patch
  10. 2 2
      MobileVLCKit/patches/0010-libvlc-create-VT-zero-copy-variable.patch
  11. 2 2
      MobileVLCKit/patches/0011-contrib-gcrypt-work-around-a-libtool-limitation.patch
  12. 2 2
      MobileVLCKit/patches/0012-contrib-gcrypt-fix-tvOS-compilation.patch
  13. 2 2
      MobileVLCKit/patches/0013-contrib-avcodec-enforce-use-of-FFmpeg.patch
  14. 2 2
      MobileVLCKit/patches/0014-Enable-System-DL.patch
  15. 2 2
      MobileVLCKit/patches/0015-Add-AC-3-pass-through.patch
  16. 2 2
      MobileVLCKit/patches/0016-taglib-DO-NOT-PUSH-works-with-networks-accesses.patch
  17. 2 2
      MobileVLCKit/patches/0017-contrib-gcrypt-update-patches.patch
  18. 2 2
      MobileVLCKit/patches/0018-deinterlace-merge-arm64-fix-linking-on-appleOS.patch
  19. 114 76
      MobileVLCKit/patches/0019-ios2-vout-add-subpicture-rendering-in-the-zero-copy-.patch
  20. 168 0
      MobileVLCKit/patches/0020-libvlc_media-add-cookie_jar-API.patch
  21. 68 0
      MobileVLCKit/patches/0021-http-add-vlc_http_cookies_clear.patch
  22. 1 1
      buildMobileVLCKit.sh

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

@@ -1,7 +1,7 @@
-From f055c1f8dc684e9c987fddc2c5240b8d8e0c0390 Mon Sep 17 00:00:00 2001
+From b77e2c6c9bc14ee1581739ee72de8b529963a895 Mon Sep 17 00:00:00 2001
 From: David Geldreich <david.geldreich@free.fr>
 Date: Fri, 20 Apr 2012 16:41:19 +0200
-Subject: [PATCH 01/19] arm_neon: added function macro to handle the underscore
+Subject: [PATCH 01/21] arm_neon: added function macro to handle the underscore
  prefix for the iOS ARM ABI
 
 ---

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

@@ -1,7 +1,7 @@
-From a0b9482684aaa98f169c93189cea903ae0977fc3 Mon Sep 17 00:00:00 2001
+From 1f9dcbd160033a3b7691822e2c6da046cba4e9a8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 10 Aug 2012 16:02:07 +0200
-Subject: [PATCH 02/19] deinterlace/merge: use a macro to fix compilation for
+Subject: [PATCH 02/21] deinterlace/merge: use a macro to fix compilation for
  iOS
 
 ---

+ 2 - 2
MobileVLCKit/patches/0003-lib-media-player-inherit-deinterlace-variable-to-ach.patch

@@ -1,7 +1,7 @@
-From db56c4bb86896a1c88e5f34e6223550c0324dbf5 Mon Sep 17 00:00:00 2001
+From 568faded72bc4202dcd9b385ef19376390b918bb Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Tue, 9 Dec 2014 22:14:55 +0100
-Subject: [PATCH 03/19] lib/media player: inherit deinterlace variable to
+Subject: [PATCH 03/21] lib/media player: inherit deinterlace variable to
  achieve correct value on first use
 
 ---

+ 2 - 2
MobileVLCKit/patches/0004-arm_neon-work-around-libtool-issue.patch

@@ -1,7 +1,7 @@
-From 10ceb20b36c49c7ebdd6b3a863215c9a85c40e0c Mon Sep 17 00:00:00 2001
+From 3ec9d85ec8a1eed10d4921cc4c0f6a106b9e60d1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 18 Dec 2014 22:14:55 +0100
-Subject: [PATCH 04/19] arm_neon: work-around libtool issue
+Subject: [PATCH 04/21] arm_neon: work-around libtool issue
 
 ---
  modules/arm_neon/Makefile.am | 2 ++

+ 2 - 2
MobileVLCKit/patches/0005-arm_neon-fix-iOS-linking.patch

@@ -1,7 +1,7 @@
-From c7b9d8f602628f7a2aced2b1e1d685678d2e74f3 Mon Sep 17 00:00:00 2001
+From 2daaeba0149f65ec77fd0070c5a3c7f3c80698d8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Wed, 10 Dec 2014 22:14:55 +0100
-Subject: [PATCH 05/19] arm_neon: fix iOS linking
+Subject: [PATCH 05/21] arm_neon: fix iOS linking
 
 ---
  modules/arm_neon/amplify.S              |  7 ++---

+ 2 - 2
MobileVLCKit/patches/0006-disable-neon-volume-plugin.patch

@@ -1,7 +1,7 @@
-From d8e53c29b0787a2aa1718fe022c45d3b5d58a5a7 Mon Sep 17 00:00:00 2001
+From cfc1785694d06aeebcd479e13d4edb37a808248a Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Wed, 10 Dec 2014 22:14:55 +0100
-Subject: [PATCH 06/19] disable neon volume plugin
+Subject: [PATCH 06/21] disable neon volume plugin
 
 ---
  modules/arm_neon/Makefile.am | 1 -

+ 2 - 2
MobileVLCKit/patches/0007-src-misc-fix-compilation-for-OS-without-fork.patch

@@ -1,7 +1,7 @@
-From 55c6947c307d503699b8c81132feb959225962a9 Mon Sep 17 00:00:00 2001
+From f1dc84e88dd25c3f8be22628d16bdda50ebfd117 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 10 Sep 2015 19:58:40 +0200
-Subject: [PATCH 07/19] src/misc: fix compilation for OS without fork()
+Subject: [PATCH 07/21] src/misc: fix compilation for OS without fork()
 
 ---
  src/misc/cpu.c | 2 +-

+ 2 - 2
MobileVLCKit/patches/0008-libvlc-hack-to-disable-daemon-mode.patch

@@ -1,7 +1,7 @@
-From 2bd5fd310d804155b71a47263107d15456624627 Mon Sep 17 00:00:00 2001
+From ea0a31fbafad8c098ba0328c6ed77cce241fc675 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 11 Sep 2015 18:34:26 +0200
-Subject: [PATCH 08/19] libvlc: hack to disable daemon mode
+Subject: [PATCH 08/21] libvlc: hack to disable daemon mode
 
 ---
  src/libvlc.c | 4 ++++

+ 2 - 2
MobileVLCKit/patches/0009-libvlc-expose-a-base-set-of-freetype-options-to-over.patch

@@ -1,7 +1,7 @@
-From f6031c2bdd5aaa2248809be6bef9d55ded65360d Mon Sep 17 00:00:00 2001
+From 98acf952cd11e3c9eae16552187d8eea744cc8e7 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 23 Nov 2015 16:09:24 +0100
-Subject: [PATCH 09/19] libvlc: expose a base set of freetype options to
+Subject: [PATCH 09/21] libvlc: expose a base set of freetype options to
  overwrite the default font
 
 ---

+ 2 - 2
MobileVLCKit/patches/0010-libvlc-create-VT-zero-copy-variable.patch

@@ -1,7 +1,7 @@
-From 6aac2625e742076991348a3a8cc90497d3b65bb1 Mon Sep 17 00:00:00 2001
+From faa078203401c357439e6ca5c4a892fd9b00cad1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Wed, 4 May 2016 16:00:40 +0200
-Subject: [PATCH 10/19] libvlc: create VT-zero-copy variable
+Subject: [PATCH 10/21] libvlc: create VT-zero-copy variable
 
 ---
  lib/media_player.c | 1 +

+ 2 - 2
MobileVLCKit/patches/0011-contrib-gcrypt-work-around-a-libtool-limitation.patch

@@ -1,7 +1,7 @@
-From 297f587954d7583082bb625a4ac936a8d306be37 Mon Sep 17 00:00:00 2001
+From 34311718ed3151216ff866463b624f9b719947f4 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Sun, 7 Dec 2014 20:02:18 +0100
-Subject: [PATCH 11/19] contrib/gcrypt: work-around a libtool limitation
+Subject: [PATCH 11/21] contrib/gcrypt: work-around a libtool limitation
 
 ---
  contrib/src/gcrypt/rules.mak                       |  1 +

+ 2 - 2
MobileVLCKit/patches/0012-contrib-gcrypt-fix-tvOS-compilation.patch

@@ -1,7 +1,7 @@
-From 9c6678ce3b4554b05b5209ac906912cb2817cc62 Mon Sep 17 00:00:00 2001
+From 3d3f0547990df1d61336b9290de398a93678599a Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Sat, 3 Oct 2015 22:45:14 +0200
-Subject: [PATCH 12/19] contrib/gcrypt: fix tvOS compilation
+Subject: [PATCH 12/21] contrib/gcrypt: fix tvOS compilation
 
 ---
  contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch | 16 ++++++++++++++++

+ 2 - 2
MobileVLCKit/patches/0013-contrib-avcodec-enforce-use-of-FFmpeg.patch

@@ -1,7 +1,7 @@
-From 73b3e9b96af1060079928ad86158cd66a4f1df5d Mon Sep 17 00:00:00 2001
+From 03be2bff27bce5ad365003f940fccf0f3cf9a5a3 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Tue, 12 Jul 2016 13:50:54 +0200
-Subject: [PATCH 13/19] contrib/avcodec: enforce use of FFmpeg
+Subject: [PATCH 13/21] contrib/avcodec: enforce use of FFmpeg
 
 ---
  contrib/src/ffmpeg/rules.mak | 4 ++--

+ 2 - 2
MobileVLCKit/patches/0014-Enable-System-DL.patch

@@ -1,7 +1,7 @@
-From 7f9294a28333031d110a12f11e03ebf2a2963247 Mon Sep 17 00:00:00 2001
+From 04af09993b0eff92d048d1094768f6fb0c4af8d8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 22 Jul 2016 11:11:44 +0200
-Subject: [PATCH 14/19] Enable System DL
+Subject: [PATCH 14/21] Enable System DL
 
 ---
  contrib/src/ffmpeg/patch-as-patch-can.patch | 20 ++++++++++++++++++++

+ 2 - 2
MobileVLCKit/patches/0015-Add-AC-3-pass-through.patch

@@ -1,7 +1,7 @@
-From 77d9e27e1b168b81aafec847d62b9be94b89a753 Mon Sep 17 00:00:00 2001
+From afe7c3f18438fe0451bfd9f07b914ed1ba8b412a Mon Sep 17 00:00:00 2001
 From: Aman Gupta <aman@tmm1.net>
 Date: Tue, 1 Mar 2016 16:31:13 +0100
-Subject: [PATCH 15/19] Add AC-3 pass-through
+Subject: [PATCH 15/21] Add AC-3 pass-through
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit

+ 2 - 2
MobileVLCKit/patches/0016-taglib-DO-NOT-PUSH-works-with-networks-accesses.patch

@@ -1,7 +1,7 @@
-From 41c1fd071f18424edc260862f0db01cbe2922914 Mon Sep 17 00:00:00 2001
+From 8878842c49a19614da381274e55baca79931fc03 Mon Sep 17 00:00:00 2001
 From: Thomas Guillem <thomas@gllm.fr>
 Date: Fri, 22 Jul 2016 11:20:24 +0200
-Subject: [PATCH 16/19] taglib: DO NOT PUSH: works with networks accesses
+Subject: [PATCH 16/21] taglib: DO NOT PUSH: works with networks accesses
 
 ---
  modules/meta_engine/taglib.cpp | 15 ++++-----------

+ 2 - 2
MobileVLCKit/patches/0017-contrib-gcrypt-update-patches.patch

@@ -1,7 +1,7 @@
-From c77322f5671e144ff03a54ff7ce5d80ecfb99647 Mon Sep 17 00:00:00 2001
+From c330ccd238758e4eb2572b8b57b43ac7299de655 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 12 Sep 2016 17:03:37 +0200
-Subject: [PATCH 17/19] contrib/gcrypt: update patches
+Subject: [PATCH 17/21] contrib/gcrypt: update patches
 
 ---
  contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch  | 308 ++++++++++++++++++++-

+ 2 - 2
MobileVLCKit/patches/0018-deinterlace-merge-arm64-fix-linking-on-appleOS.patch

@@ -1,7 +1,7 @@
-From b19b7792926ef1376893545cefadacd965c6224a Mon Sep 17 00:00:00 2001
+From 868843d553c2659555050d0639d53d64a0e10abe Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 12 Sep 2016 17:04:05 +0200
-Subject: [PATCH 18/19] deinterlace-merge-arm64: fix linking on appleOS
+Subject: [PATCH 18/21] deinterlace-merge-arm64: fix linking on appleOS
 
 ---
  modules/arm_neon/asm64.S                       | 46 ++++++++++++++++++++++++++

+ 114 - 76
MobileVLCKit/patches/0019-ios2-vout-add-subpicture-rendering-in-the-zero-copy-.patch

@@ -1,15 +1,15 @@
-From 6c787c63d5cacf5983b7a94e5bddff076a7cb48b Mon Sep 17 00:00:00 2001
+From b446f7dfd3e2fbd981b8cbb075a255cf99a8984b Mon Sep 17 00:00:00 2001
 From: Adrien Maglo <magsoft@videolan.org>
 Date: Fri, 16 Sep 2016 14:00:21 +0200
-Subject: [PATCH 19/19] ios2 vout: add subpicture rendering in the zero copy
+Subject: [PATCH 19/21] ios2 vout: add subpicture rendering in the zero copy
  pipeline
 
 ---
- modules/video_output/ios2.m | 301 ++++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 291 insertions(+), 10 deletions(-)
+ modules/video_output/ios2.m | 338 +++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 304 insertions(+), 34 deletions(-)
 
 diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
-index 5e56ca5..75d9f9c 100644
+index 5e56ca5..6d4f1f1 100644
 --- a/modules/video_output/ios2.m
 +++ b/modules/video_output/ios2.m
 @@ -46,6 +46,7 @@
@@ -20,7 +20,7 @@ index 5e56ca5..75d9f9c 100644
  #import "opengl.h"
  
  /**
-@@ -110,6 +111,19 @@ static NSString *const fragmentShaderString = @" \
+@@ -110,6 +111,20 @@ static NSString *const fragmentShaderString = @" \
   } \
  ";
  
@@ -29,10 +29,11 @@ index 5e56ca5..75d9f9c 100644
 +precision mediump float; \
 +\
 +uniform sampler2D Texture; \
++uniform vec4 FillColor; \
 +\
 +void main() \
 +{ \
-+    gl_FragColor = texture2D(Texture, texCoordVarying); \
++    gl_FragColor = texture2D(Texture, texCoordVarying) * FillColor; \
 +} \
 +";
 +
@@ -40,7 +41,7 @@ index 5e56ca5..75d9f9c 100644
  static NSString *const vertexShaderString = @" \
   attribute vec4 position; \
   attribute vec2 texCoord; \
-@@ -139,7 +153,7 @@ static void OpenglESSwap(vlc_gl_t *);
+@@ -139,7 +154,7 @@ static void OpenglESSwap(vlc_gl_t *);
  
  static picture_pool_t *ZeroCopyPicturePool(vout_display_t *, unsigned);
  static void DestroyZeroCopyPoolPicture(picture_t *);
@@ -49,15 +50,15 @@ index 5e56ca5..75d9f9c 100644
  static void ZeroCopyDisplay(vout_display_t *, picture_t *, subpicture_t *);
  
  /**
-@@ -178,6 +192,7 @@ vlc_module_end ()
+@@ -178,6 +193,7 @@ vlc_module_end ()
  @property (readonly) EAGLContext* eaglContext;
  @property (readonly) BOOL isAppActive;
  @property GLuint shaderProgram;
-+@property GLuint shaderProgramSub;
++@property GLuint shaderProgramSubpictures;
  
  - (id)initWithFrame:(CGRect)frame zeroCopy:(bool)zero_copy voutDisplay:(vout_display_t *)vd;
  
-@@ -191,6 +206,24 @@ vlc_module_end ()
+@@ -191,6 +207,24 @@ vlc_module_end ()
  - (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer;
  @end
  
@@ -82,7 +83,7 @@ index 5e56ca5..75d9f9c 100644
  struct vout_display_sys_t
  {
      VLCOpenGLES2VideoView *glESView;
-@@ -205,8 +238,22 @@ struct vout_display_sys_t
+@@ -205,8 +239,22 @@ struct vout_display_sys_t
      bool zero_copy;
  
      vout_display_place_t place;
@@ -105,7 +106,7 @@ index 5e56ca5..75d9f9c 100644
  static void *OurGetProcAddress(vlc_gl_t *gl, const char *name)
  {
      VLC_UNUSED(gl);
-@@ -281,7 +328,7 @@ static int Open(vlc_object_t *this)
+@@ -281,7 +329,7 @@ static int Open(vlc_object_t *this)
  
          if (sys->zero_copy) {
              vd->pool = ZeroCopyPicturePool;
@@ -114,12 +115,12 @@ index 5e56ca5..75d9f9c 100644
              vd->display = ZeroCopyDisplay;
          } else {
              vd->pool = PicturePool;
-@@ -325,6 +372,15 @@ void Close (vlc_object_t *this)
+@@ -325,6 +373,15 @@ void Close (vlc_object_t *this)
      vout_display_sys_t *sys = vd->sys;
  
      @autoreleasepool {
 +        glDeleteProgram(sys->glESView.shaderProgram);
-+        glDeleteProgram(sys->glESView.shaderProgramSub);
++        glDeleteProgram(sys->glESView.shaderProgramSubpictures);
 +
 +        for (int i = 0; i < sys->region_count; i++) {
 +            if (sys->region[i].texture)
@@ -130,7 +131,7 @@ index 5e56ca5..75d9f9c 100644
          if (sys->tapRecognizer) {
              [sys->tapRecognizer.view removeGestureRecognizer:sys->tapRecognizer];
              [sys->tapRecognizer release];
-@@ -356,7 +412,8 @@ void Close (vlc_object_t *this)
+@@ -356,7 +413,8 @@ void Close (vlc_object_t *this)
                  picture_pool_Release(sys->picturePool);
              sys->picturePool = NULL;
          }
@@ -140,7 +141,7 @@ index 5e56ca5..75d9f9c 100644
          free(sys);
      }
  }
-@@ -548,11 +605,154 @@ static void DestroyZeroCopyPoolPicture(picture_t *picture)
+@@ -548,11 +606,154 @@ static void DestroyZeroCopyPoolPicture(picture_t *picture)
      free(picture);
  }
  
@@ -296,7 +297,7 @@ index 5e56ca5..75d9f9c 100644
  }
  
  static void ZeroCopyDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
-@@ -961,6 +1161,8 @@ static void ZeroCopyDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *su
+@@ -961,6 +1162,8 @@ static void ZeroCopyDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *su
  
      glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  
@@ -305,7 +306,7 @@ index 5e56ca5..75d9f9c 100644
      glBindRenderbuffer(GL_RENDERBUFFER, _renderBuffer);
      [_eaglContext presentRenderbuffer:GL_RENDERBUFFER];
  
-@@ -971,6 +1173,54 @@ done:
+@@ -971,6 +1174,54 @@ done:
      [EAGLContext setCurrentContext:previousContext];
  }
  
@@ -315,13 +316,13 @@ index 5e56ca5..75d9f9c 100644
 +
 +    /* Draw the subpictures */
 +
-+    glUseProgram(self.shaderProgramSub);
++    glUseProgram(self.shaderProgramSubpictures);
 +
 +    GLfloat transformMatrix[16];
 +    orientationTransformMatrix(transformMatrix, _voutDisplay->fmt.orientation);
-+    glUniformMatrix4fv(glGetUniformLocation(self.shaderProgramSub, "transformMatrix"), 1, GL_FALSE, transformMatrix);
++    glUniformMatrix4fv(glGetUniformLocation(self.shaderProgramSubpictures, "transformMatrix"), 1, GL_FALSE, transformMatrix);
 +
-+    glUniform1i(glGetUniformLocation(self.shaderProgramSub, "Texture"), 0);
++    glUniform1i(glGetUniformLocation(self.shaderProgramSubpictures, "Texture"), 0);
 +
 +    glEnable(GL_BLEND);
 +    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -343,7 +344,7 @@ index 5e56ca5..75d9f9c 100644
 +        };
 +
 +        glBindTexture(GL_TEXTURE_2D, glr->texture);
-+        glUniform4f(glGetUniformLocation(self.shaderProgramSub, "FillColor"), 1.0f, 1.0f, 1.0f, glr->alpha);
++        glUniform4f(glGetUniformLocation(self.shaderProgramSubpictures, "FillColor"), 1.0f, 1.0f, 1.0f, glr->alpha);
 +
 +        glVertexAttribPointer(ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, vertexCoord);
 +        glEnableVertexAttribArray(ATTRIB_VERTEX);
@@ -360,92 +361,129 @@ index 5e56ca5..75d9f9c 100644
  - (void)setupZeroCopyGL
  {
      EAGLContext *previousContext = [EAGLContext currentContext];
-@@ -1017,11 +1267,11 @@ done:
+@@ -1017,55 +1268,59 @@ done:
  
  - (BOOL)loadShaders
  {
 -    GLuint vertShader, fragShader;
 -    NSURL *vertShaderURL, *fragShaderURL;
-+    GLuint vertShader, fragShader, fragShaderSub;
++    GLuint vertShader = 0;
++    GLuint fragShader = 0;
++    GLuint fragShaderSub = 0;
  
      // Create the shader program.
      self.shaderProgram = glCreateProgram();
-+    self.shaderProgramSub = glCreateProgram();
++    self.shaderProgramSubpictures = glCreateProgram();
  
      // Create and compile the vertex shader.
      if (![self compileShader:&vertShader type:GL_VERTEX_SHADER sourceString:vertexShaderString]) {
-@@ -1037,15 +1287,25 @@ done:
-         return NO;
+         if (_voutDisplay)
+             msg_Err(_voutDisplay, "Failed to compile vertex shader");
+-        return NO;
++        goto error;
      }
  
-+    if (![self compileShader:&fragShaderSub type:GL_FRAGMENT_SHADER sourceString:fragmentShaderRGBAString]) {
-+        if (_voutDisplay)
-+            msg_Err(_voutDisplay, "Failed to compile the RGB fragment shader");
-+        return NO;
+     // Create and compile fragment shader.
+     if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER sourceString:fragmentShaderString]) {
+         if (_voutDisplay)
+             msg_Err(_voutDisplay, "Failed to compile fragment shader");
+-        return NO;
++        goto error;
 +    }
 +
++    if (![self compileShader:&fragShaderSub type:GL_FRAGMENT_SHADER sourceString:fragmentShaderRGBAString]) {
++        if (_voutDisplay)
++            msg_Err(_voutDisplay, "Failed to compile the RGBA fragment shader");
++        goto error;
+     }
+ 
      // Attach vertex shader to program.
      glAttachShader(self.shaderProgram, vertShader);
-+    glAttachShader(self.shaderProgramSub, vertShader);
++    glAttachShader(self.shaderProgramSubpictures, vertShader);
  
      // Attach fragment shader to program.
      glAttachShader(self.shaderProgram, fragShader);
-+    glAttachShader(self.shaderProgramSub, fragShaderSub);
++    glAttachShader(self.shaderProgramSubpictures, fragShaderSub);
  
      // Bind attribute locations. This needs to be done prior to linking.
      glBindAttribLocation(self.shaderProgram, ATTRIB_VERTEX, "position");
      glBindAttribLocation(self.shaderProgram, ATTRIB_TEXCOORD, "texCoord");
-+    glBindAttribLocation(self.shaderProgramSub, ATTRIB_VERTEX, "position");
-+    glBindAttribLocation(self.shaderProgramSub, ATTRIB_TEXCOORD, "texCoord");
++    glBindAttribLocation(self.shaderProgramSubpictures, ATTRIB_VERTEX, "position");
++    glBindAttribLocation(self.shaderProgramSubpictures, ATTRIB_TEXCOORD, "texCoord");
  
      // Link the program.
      if (![self linkProgram:self.shaderProgram]) {
-@@ -1068,6 +1328,26 @@ done:
-         return NO;
-     }
+         if (_voutDisplay)
+-            msg_Err(_voutDisplay, "Failed to link program: %d", self.shaderProgram);
+-
+-        if (vertShader) {
+-            glDeleteShader(vertShader);
+-            vertShader = 0;
+-        }
+-        if (fragShader) {
+-            glDeleteShader(fragShader);
+-            fragShader = 0;
+-        }
+-        if (self.shaderProgram) {
+-            glDeleteProgram(self.shaderProgram);
+-            self.shaderProgram = 0;
+-        }
++            msg_Err(_voutDisplay, "Failed to link program for main pictures: %d", self.shaderProgram);
++        goto error;
++    }
  
-+    if (![self linkProgram:self.shaderProgramSub]) {
+-        return NO;
++    if (![self linkProgram:self.shaderProgramSubpictures]) {
 +        if (_voutDisplay)
-+            msg_Err(_voutDisplay, "Failed to link program: %d", self.shaderProgramSub);
++            msg_Err(_voutDisplay, "Failed to link program for subpictures: %d", self.shaderProgramSubpictures);
++        goto error;
+     }
+ 
+     // Get uniform locations.
+@@ -1075,16 +1330,35 @@ done:
+     uniforms[UNIFORM_TRANSFORM_MATRIX] = glGetUniformLocation(self.shaderProgram, "transformMatrix");
+ 
+     // Release vertex and fragment shaders.
+-    if (vertShader) {
+-        glDetachShader(self.shaderProgram, vertShader);
++    glDetachShader(self.shaderProgram, vertShader);
++    glDetachShader(self.shaderProgramSubpictures, vertShader);
++    glDeleteShader(vertShader);
 +
-+        if (vertShader) {
-+            glDeleteShader(vertShader);
-+            vertShader = 0;
-+        }
-+        if (fragShaderSub) {
-+            glDeleteShader(fragShaderSub);
-+            fragShaderSub = 0;
-+        }
-+        if (self.shaderProgramSub) {
-+            glDeleteProgram(self.shaderProgramSub);
-+            self.shaderProgramSub = 0;
-+        }
++    glDetachShader(self.shaderProgram, fragShader);
++    glDeleteShader(fragShader);
 +
-+        return NO;
-+    }
++    glDetachShader(self.shaderProgramSubpictures, fragShaderSub);
++    glDeleteShader(fragShaderSub);
 +
-     // Get uniform locations.
-     uniforms[UNIFORM_Y] = glGetUniformLocation(self.shaderProgram, "SamplerY");
-     uniforms[UNIFORM_UV] = glGetUniformLocation(self.shaderProgram, "SamplerUV");
-@@ -1077,12 +1357,17 @@ done:
-     // Release vertex and fragment shaders.
-     if (vertShader) {
-         glDetachShader(self.shaderProgram, vertShader);
-+        glDetachShader(self.shaderProgramSub, vertShader);
++    return YES;
++
++error:
++    if (vertShader)
          glDeleteShader(vertShader);
-     }
-     if (fragShader) {
-         glDetachShader(self.shaderProgram, fragShader);
+-    }
+-    if (fragShader) {
+-        glDetachShader(self.shaderProgram, fragShader);
++
++    if (fragShader)
          glDeleteShader(fragShader);
-     }
-+    if (fragShaderSub) {
-+        glDetachShader(self.shaderProgramSub, fragShaderSub);
-+        glDeleteShader(fragShaderSub);
-+    }
+-    }
  
-     return YES;
+-    return YES;
++    if (fragShaderSub)
++        glDeleteShader(fragShaderSub);
++
++    if (self.shaderProgram)
++        glDeleteProgram(self.shaderProgram);
++
++    if (self.shaderProgramSubpictures)
++        glDeleteProgram(self.shaderProgramSubpictures);
++
++    return NO;
  }
-@@ -1097,7 +1382,6 @@ done:
+ 
+ - (BOOL)compileShader:(GLuint *)shader type:(GLenum)type sourceString:sourceString
+@@ -1097,7 +1371,6 @@ done:
      glShaderSource(*shader, 1, &source, NULL);
      glCompileShader(*shader);
  
@@ -453,7 +491,7 @@ index 5e56ca5..75d9f9c 100644
      GLint logLength;
      glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength);
      if (logLength > 0) {
-@@ -1107,7 +1391,6 @@ done:
+@@ -1107,7 +1380,6 @@ done:
              msg_Dbg(_voutDisplay, "Shader compile log:\n%s", log);
          free(log);
      }
@@ -461,7 +499,7 @@ index 5e56ca5..75d9f9c 100644
  
      glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);
      if (status == 0) {
-@@ -1123,7 +1406,6 @@ done:
+@@ -1123,7 +1395,6 @@ done:
      GLint status;
      glLinkProgram(prog);
  
@@ -469,7 +507,7 @@ index 5e56ca5..75d9f9c 100644
      GLint logLength;
      glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength);
      if (logLength > 0) {
-@@ -1133,7 +1415,6 @@ done:
+@@ -1133,7 +1404,6 @@ done:
              msg_Dbg(_voutDisplay, "Program link log:\n%s", log);
          free(log);
      }

+ 168 - 0
MobileVLCKit/patches/0020-libvlc_media-add-cookie_jar-API.patch

@@ -0,0 +1,168 @@
+From fd5f77fbb997bfff3fa4de2e0a0cf5a9bfa12b92 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <thomas@gllm.fr>
+Date: Fri, 16 Sep 2016 15:51:11 +0200
+Subject: [PATCH 20/21] libvlc_media: add cookie_jar API
+
+---
+ include/vlc/libvlc_media.h | 35 +++++++++++++++++++++++++++++++++++
+ lib/libvlc.sym             |  2 ++
+ lib/media.c                | 26 ++++++++++++++++++++++++++
+ lib/media_internal.h       |  2 ++
+ lib/media_player.c         |  7 +++++++
+ 5 files changed, 72 insertions(+)
+
+diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
+index 15933c5..beb1dd5 100644
+--- a/include/vlc/libvlc_media.h
++++ b/include/vlc/libvlc_media.h
+@@ -846,6 +846,41 @@ LIBVLC_API
+ void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
+                                   unsigned int i_count );
+ 
++/**
++ * Parse a value of an incoming Set-Cookie header (see RFC 6265) and append the
++ * cookie to the cookie jar if appropriate. The "secure" attribute can be added
++ * to psz_cookie to limit the scope of the cookie to secured channels (https).
++ *
++ * \note must be called before the first call of libvlc_media_player_play() to
++ * take effect. The cookie jar is only used for http/https accesses.
++ *
++ * \version LibVLC 3.0.0 and later.
++ *
++ * \param p_md media descriptor object
++ * \param psz_cookie header field value of Set-Cookie:
++ * "name=value<;attributes>" (must not be NULL)
++ * \param psz_host host to which the cookie will be sent (must not be NULL)
++ * \param psz_path scope of the cookie (must not be NULL)
++ *
++ * \return 0 on success, -1 on error.
++ */
++LIBVLC_API int
++libvlc_media_cookie_jar_store( libvlc_media_t *p_md, const char *psz_cookie,
++                               const char *psz_host, const char *psz_path );
++
++/**
++ * Clear the cookie jar of a media.
++ *
++ * \note must be called before the first call of libvlc_media_player_play() to
++ * take effect.
++ *
++ * \version LibVLC 3.0.0 and later.
++ *
++ * \param p_md media descriptor object
++ */
++LIBVLC_API void
++libvlc_media_cookie_jar_clear( libvlc_media_t *p_md );
++
+ /** @}*/
+ 
+ # ifdef __cplusplus
+diff --git a/lib/libvlc.sym b/lib/libvlc.sym
+index f297970..4dda39b 100644
+--- a/lib/libvlc.sym
++++ b/lib/libvlc.sym
+@@ -215,6 +215,8 @@ libvlc_media_set_user_data
+ libvlc_media_subitems
+ libvlc_media_tracks_get
+ libvlc_media_tracks_release
++libvlc_media_cookie_jar_store
++libvlc_media_cookie_jar_clear
+ libvlc_new
+ libvlc_playlist_play
+ libvlc_release
+diff --git a/lib/media.c b/lib/media.c
+index e01beed..0c56ca0 100644
+--- a/lib/media.c
++++ b/lib/media.c
+@@ -379,6 +379,8 @@ libvlc_media_t * libvlc_media_new_from_input_item(
+      * It can give a bunch of item to read. */
+     p_md->p_subitems        = NULL;
+ 
++    p_md->p_cookie_jar      = NULL;
++
+     p_md->p_event_manager = libvlc_event_manager_new( p_md );
+     if( unlikely(p_md->p_event_manager == NULL) )
+     {
+@@ -541,6 +543,9 @@ void libvlc_media_release( libvlc_media_t *p_md )
+ 
+     vlc_gc_decref( p_md->p_input_item );
+ 
++    if( p_md->p_cookie_jar )
++        vlc_http_cookies_destroy( p_md->p_cookie_jar );
++
+     vlc_cond_destroy( &p_md->parsed_cond );
+     vlc_mutex_destroy( &p_md->parsed_lock );
+     vlc_mutex_destroy( &p_md->subitems_lock );
+@@ -1237,3 +1242,24 @@ void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
+         free( pp_slaves );
+     }
+ }
++
++int
++libvlc_media_cookie_jar_store( libvlc_media_t *p_md, const char *psz_cookie,
++                               const char *psz_host, const char *psz_path )
++{
++    if( !p_md->p_cookie_jar )
++    {
++        p_md->p_cookie_jar = vlc_http_cookies_new();
++        if( !p_md->p_cookie_jar )
++            return -1;
++    }
++    return vlc_http_cookies_store( p_md->p_cookie_jar, psz_cookie, psz_host,
++                                   psz_path ) ? 0 : -1;
++}
++
++void
++libvlc_media_cookie_jar_clear( libvlc_media_t *p_md )
++{
++    if( p_md->p_cookie_jar )
++        vlc_http_cookies_clear( p_md->p_cookie_jar );
++}
+diff --git a/lib/media_internal.h b/lib/media_internal.h
+index f063ddb..17bbd84 100644
+--- a/lib/media_internal.h
++++ b/lib/media_internal.h
+@@ -30,6 +30,7 @@
+ 
+ #include <vlc_common.h>
+ #include <vlc_input.h>
++#include <vlc_http.h>
+ 
+ struct libvlc_media_t
+ {
+@@ -48,6 +49,7 @@ struct libvlc_media_t
+     libvlc_media_parsed_status_t parsed_status;
+     bool is_parsed;
+     bool has_asked_preparse;
++    vlc_http_cookie_jar_t *p_cookie_jar;
+ };
+ 
+ /* Media Descriptor */
+diff --git a/lib/media_player.c b/lib/media_player.c
+index ac30787..fdda68a 100644
+--- a/lib/media_player.c
++++ b/lib/media_player.c
+@@ -601,6 +601,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
+ 
+     /* Input */
+     var_Create (mp, "rate", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT);
++    var_Create (mp, "http-cookies", VLC_VAR_ADDRESS);
+ 
+     /* Video */
+     var_Create (mp, "vout", VLC_VAR_STRING|VLC_VAR_DOINHERIT);
+@@ -954,6 +955,12 @@ int libvlc_media_player_play( libvlc_media_player_t *p_mi )
+         return -1;
+     }
+ 
++    if( p_mi->p_md->p_cookie_jar )
++    {
++        vlc_value_t cookies = { .p_address = p_mi->p_md->p_cookie_jar };
++        var_SetChecked( p_mi, "http-cookies", VLC_VAR_ADDRESS, cookies );
++    }
++
+     media_attach_preparsed_event( p_mi->p_md );
+ 
+     p_input_thread = input_Create( p_mi, p_mi->p_md->p_input_item, NULL,
+-- 
+2.9.3
+

+ 68 - 0
MobileVLCKit/patches/0021-http-add-vlc_http_cookies_clear.patch

@@ -0,0 +1,68 @@
+From 70b8d428132968df8e40e4edb6741e03dcf78de3 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <thomas@gllm.fr>
+Date: Fri, 16 Sep 2016 15:51:10 +0200
+Subject: [PATCH 21/21] http: add vlc_http_cookies_clear
+
+Clear all cookies without deleting the jar.
+---
+ include/vlc_http.h     |  1 +
+ src/libvlccore.sym     |  1 +
+ src/misc/httpcookies.c | 10 ++++++----
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/include/vlc_http.h b/include/vlc_http.h
+index ed7e161..da1fe4e 100644
+--- a/include/vlc_http.h
++++ b/include/vlc_http.h
+@@ -71,6 +71,7 @@ VLC_API char *vlc_http_auth_FormatAuthorizationHeader
+ typedef struct vlc_http_cookie_jar_t vlc_http_cookie_jar_t;
+ 
+ VLC_API vlc_http_cookie_jar_t * vlc_http_cookies_new( void ) VLC_USED;
++VLC_API void vlc_http_cookies_clear( vlc_http_cookie_jar_t * p_jar );
+ VLC_API void vlc_http_cookies_destroy( vlc_http_cookie_jar_t * p_jar );
+ 
+ /**
+diff --git a/src/libvlccore.sym b/src/libvlccore.sym
+index 5a7de9e..bbf6ff8 100644
+--- a/src/libvlccore.sym
++++ b/src/libvlccore.sym
+@@ -137,6 +137,7 @@ vlc_http_auth_ParseAuthenticationInfoHeader
+ vlc_http_auth_FormatAuthorizationHeader
+ vlc_http_cookies_new
+ vlc_http_cookies_destroy
++vlc_http_cookies_clear
+ vlc_http_cookies_store
+ vlc_http_cookies_fetch
+ httpd_ClientIP
+diff --git a/src/misc/httpcookies.c b/src/misc/httpcookies.c
+index b6d174b..2090f69 100644
+--- a/src/misc/httpcookies.c
++++ b/src/misc/httpcookies.c
+@@ -281,18 +281,20 @@ vlc_http_cookie_jar_t * vlc_http_cookies_new(void)
+     return jar;
+ }
+ 
+-void vlc_http_cookies_destroy( vlc_http_cookie_jar_t * p_jar )
++void vlc_http_cookies_clear( vlc_http_cookie_jar_t * p_jar )
+ {
+     if ( !p_jar )
+         return;
+ 
+-    int i;
+-    for( i = 0; i < vlc_array_count( &p_jar->cookies ); i++ )
++    for( int i = 0; i < vlc_array_count( &p_jar->cookies ); i++ )
+         cookie_destroy( vlc_array_item_at_index( &p_jar->cookies, i ) );
+ 
+     vlc_array_clear( &p_jar->cookies );
+-    vlc_mutex_destroy( &p_jar->lock );
++}
+ 
++void vlc_http_cookies_destroy( vlc_http_cookie_jar_t * p_jar )
++{
++    vlc_http_cookies_clear( p_jar );
+     free( p_jar );
+ }
+ 
+-- 
+2.9.3
+

+ 1 - 1
buildMobileVLCKit.sh

@@ -17,7 +17,7 @@ SCARY=yes
 TVOS=no
 BITCODE=no
 
-TESTEDHASH=4894beeb
+TESTEDHASH=11174e3a
 
 usage()
 {