Commit 8d7d79f9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

MVK: update libvlc

parent b559e85a
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
---
......
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
---
......
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
---
......
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 ++
......
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 ++---
......
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 -
......
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 +-
......
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 ++++
......
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
---
......
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 +
......
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 +
......
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 ++++++++++++++++
......
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 ++--
......
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 ++++++++++++++++++++
......
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
......
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 ++++-----------
......
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 ++++++++++++++++++++-
......
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 ++++++++++++++++++++++++++
......
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);
}
......
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 );
+
+/**