...
 
Commits (26)
......@@ -42,6 +42,8 @@
/* Notification Messages */
extern NSString *const VLCMediaPlayerTimeChanged;
extern NSString *const VLCMediaPlayerStateChanged;
extern NSString *const VLCMediaPlayerTitleChanged;
extern NSString *const VLCMediaPlayerChapterChanged;
/**
* VLCMediaPlayerState describes the state of the media player.
......@@ -85,6 +87,21 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
*/
- (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
/**
* Sent by the default notification center whenever the player's title has changed (if any).
* \details Discussion The value of aNotification is always an VLCMediaPlayerTitleChanged notification. You can retrieve
* the VLCMediaPlayer object in question by sending object to aNotification.
* \note this is about a title in the navigation sense, not about metadata
*/
- (void)mediaPlayerTitleChanged:(NSNotification *)aNotification;
/**
* Sent by the default notification center whenever the player's chapter has changed (if any).
* \details Discussion The value of aNotification is always an VLCMediaPlayerChapterChanged notification. You can retrieve
* the VLCMediaPlayer object in question by sending object to aNotification.
*/
- (void)mediaPlayerChapterChanged:(NSNotification *)aNotification;
#if TARGET_OS_PHONE
/**
* Sent by the default notification center whenever a new snapshot is taken.
......@@ -239,9 +256,11 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/**
* Frames per second
* \return current media's frames per second value
* \note Deprecated, provided for API compatibility only
* \note To retrieve a media's FPS, use VLCMediaTracksInformationFrameRate.
* \returns 0
*/
@property (NS_NONATOMIC_IOSONLY, readonly) float framesPerSecond;
@property (NS_NONATOMIC_IOSONLY, readonly) float framesPerSecond __attribute__((deprecated));
#pragma mark -
#pragma mark time
......
......@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.public_header_files = 'MobileVLCKit-binary/MobileVLCKit.framework/Headers/*.h'
s.ios.deployment_target = '7.0'
s.frameworks = 'QuartzCore', 'CoreText', 'AVFoundation', 'Security', 'CFNetwork', 'AudioToolbox', 'OpenGLES', 'CoreGraphics', 'VideoToolbox', 'CoreMedia'
s.libraries = 'libc++', 'xml2', 'z', 'bz2', 'iconv'
s.libraries = 'c++', 'xml2', 'z', 'bz2', 'iconv'
s.requires_arc = false
s.xcconfig = {
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11',
......
......@@ -48,6 +48,8 @@
7D1329741BA305A200BE647E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D1329731BA305A200BE647E /* Foundation.framework */; };
7D5F800A185B72EB00C2CD75 /* VLCMediaListPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5F8009185B72EB00C2CD75 /* VLCMediaListPlayer.m */; };
7D5F800C185B733800C2CD75 /* VLCMediaListPlayer.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 7D5F800B185B730F00C2CD75 /* VLCMediaListPlayer.h */; };
7D6C89201C0CA81F00321894 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D6C891F1C0CA81F00321894 /* AVFoundation.framework */; };
7D6C89211C0CA90000321894 /* VLCAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49C5FB1BC3D7870052D40C /* VLCAudio.m */; };
7D89392C1B500D1C008F2B14 /* DynamicMobileVLCKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D89392B1B500D1C008F2B14 /* DynamicMobileVLCKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
7D8939401B500D50008F2B14 /* VLCEventManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A5ECAC411DE8F7300F66AF3 /* VLCEventManager.m */; };
7D8939411B500D50008F2B14 /* VLCLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A5ECAC511DE8F7300F66AF3 /* VLCLibrary.m */; };
......@@ -169,6 +171,7 @@
7D1329791BA3074100BE647E /* vlc-plugins-iPhone.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "vlc-plugins-iPhone.xcconfig"; path = "MobileVLCKit/vlc-plugins-iPhone.xcconfig"; sourceTree = "<group>"; };
7D5F8009185B72EB00C2CD75 /* VLCMediaListPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCMediaListPlayer.m; path = Sources/VLCMediaListPlayer.m; sourceTree = "<group>"; };
7D5F800B185B730F00C2CD75 /* VLCMediaListPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCMediaListPlayer.h; path = Headers/Public/VLCMediaListPlayer.h; sourceTree = "<group>"; };
7D6C891F1C0CA81F00321894 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
7D8938BB1B5008E9008F2B14 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7D8938E81B500984008F2B14 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
7D8938EA1B50098C008F2B14 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
......@@ -207,6 +210,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7D6C89201C0CA81F00321894 /* AVFoundation.framework in Frameworks */,
7D8939651B500F13008F2B14 /* libStaticLibVLC.a in Frameworks */,
7D8939661B500F38008F2B14 /* libiconv.dylib in Frameworks */,
7D8939671B500F38008F2B14 /* CoreFoundation.framework in Frameworks */,
......@@ -274,6 +278,7 @@
0867D69AFE84028FC02AAC07 /* Frameworks */ = {
isa = PBXGroup;
children = (
7D6C891F1C0CA81F00321894 /* AVFoundation.framework */,
7D1329731BA305A200BE647E /* Foundation.framework */,
7D8939031B5009E2008F2B14 /* libiconv.dylib */,
7D8939011B5009DD008F2B14 /* CoreFoundation.framework */,
......@@ -563,6 +568,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6C89211C0CA90000321894 /* VLCAudio.m in Sources */,
7D8939401B500D50008F2B14 /* VLCEventManager.m in Sources */,
7D8939411B500D50008F2B14 /* VLCLibrary.m in Sources */,
7D8939421B500D50008F2B14 /* VLCMedia.m in Sources */,
......@@ -933,7 +939,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "-ObjC";
OTHER_LIBTOOLFLAGS = "$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios/core/libvlc.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios/core/libvlccore.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios/core/libcompat.a $(VLC_PLUGINS_LDFLAGS)";
OTHER_LIBTOOLFLAGS = "$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/core/libvlc.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/core/libvlccore.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/core/libcompat.a $(VLC_PLUGINS_LDFLAGS)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALIDATE_PRODUCT = YES;
......@@ -979,7 +985,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
OTHER_LIBTOOLFLAGS = "$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios/core/libvlc.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios/core/libvlccore.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios/core/libcompat.a $(VLC_PLUGINS_LDFLAGS)";
OTHER_LIBTOOLFLAGS = "$(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/core/libvlc.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/core/libvlccore.a $(PROJECT_DIR)/MobileVLCKit/ImportedSources/vlc/install-ios-iPhone/core/libcompat.a $(VLC_PLUGINS_LDFLAGS)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
......
From b47ac179b55ebfea3101ac291ff3cb980c8bd663 Mon Sep 17 00:00:00 2001
From 150fe8d8cd5262be1f4b8cb23c666fea8966e5eb 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/14] arm_neon: added function macro to handle the underscore
Subject: [PATCH 01/19] arm_neon: added function macro to handle the underscore
prefix for the iOS ARM ABI
---
......
From 9ffdd233d5ef6b0d36277be04fe90a24a9cf53e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Tue, 17 Apr 2012 16:41:19 +0200
Subject: [PATCH 02/19] progress dialog: add missing sanity check
---
src/interface/dialog.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/interface/dialog.c b/src/interface/dialog.c
index f90e7c8..dcfb5dd 100644
--- a/src/interface/dialog.c
+++ b/src/interface/dialog.c
@@ -251,7 +251,11 @@ void dialog_ProgressDestroy (dialog_progress_bar_t *dialog)
{
assert (dialog);
- dialog->pf_destroy (dialog->p_sys);
+ if (dialog->pf_destroy != NULL)
+ {
+ dialog->pf_destroy (dialog->p_sys);
+ }
+
free (dialog);
}
--
2.6.0
From a67fa298de4471d6490a7d1c2dbde481b38560d1 Mon Sep 17 00:00:00 2001
From f168be843a12ec88568178ba5b68459be764f605 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/14] deinterlace/merge: use a macro to fix compilation for
Subject: [PATCH 03/19] deinterlace/merge: use a macro to fix compilation for
iOS
---
......
From 2832892893d2124a1559d6be538f4c3c948de922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Wed, 29 May 2013 13:25:54 +0200
Subject: [PATCH 03/14] libass: fix text rendering on iOS by providing a font
lookup mechanism for the font shipped with Aspen
---
modules/codec/libass.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 5cd48bc..40f45ac 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -29,6 +29,13 @@
# include "config.h"
#endif
+#if defined (__APPLE__)
+#include <TargetConditionals.h>
+#if TARGET_OS_IPHONE
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+#endif
+
#include <string.h>
#include <limits.h>
#include <assert.h>
@@ -213,6 +220,37 @@ static int Create( vlc_object_t *p_this )
#if defined( __ANDROID__ )
const char *psz_font = "/system/fonts/DroidSans-Bold.ttf";
const char *psz_family = "Droid Sans Bold";
+#elif defined (__APPLE__)
+#if !TARGET_OS_IPHONE
+ const char *psz_font = NULL; /* We don't ship a default font with VLC */
+ const char *psz_family = "Arial"; /* Use Arial if we can't find anything more suitable */
+#else
+ CFURLRef fileURL;
+ fileURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("OpenSans-Regular.ttf"),
+ NULL,
+ NULL);
+ if (!fileURL)
+ return VLC_EGENERIC;
+
+ CFStringRef urlString = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
+ CFRelease(fileURL);
+
+ if (!urlString)
+ return VLC_EGENERIC;
+
+ CFIndex length = CFStringGetLength(urlString);
+ if (!length)
+ return VLC_EGENERIC;
+ length++;
+
+ char *psz_path = (char *)malloc(length);
+ CFStringGetCString(urlString, psz_path, length, kCFStringEncodingUTF8);
+ CFRelease(urlString);
+
+ const char *psz_font = (const char *)strdup(psz_path);
+ free(psz_path);
+ const char *psz_family = "Open Sans";
+#endif
#else
const char *psz_font = NULL; /* We don't ship a default font with VLC */
const char *psz_family = "Arial"; /* Use Arial if we can't find anything more suitable */
--
2.6.0
From 0f9caf58c96ae4027eb0fcb395ccaab7f212dbf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Wed, 22 Jan 2014 13:55:16 +0100
Subject: [PATCH 04/14] freetype: added a fake font lookup mechanism for iOS to
use the packaged demo fonts
---
modules/text_renderer/freetype.c | 2 ++
modules/text_renderer/platform_fonts.c | 40 ++++++++++++++++++++++++++++++++++
modules/text_renderer/platform_fonts.h | 3 +++
3 files changed, 45 insertions(+)
diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index f55e23a..bc508c6 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1206,6 +1206,8 @@ static int Create( vlc_object_t *p_this )
#elif defined( __APPLE__ )
#if !TARGET_OS_IPHONE
p_sys->pf_select = MacLegacy_Select;
+#else
+ p_sys->pf_select = iOSFake_Select;
#endif
#elif defined( _WIN32 ) && defined( HAVE_GET_FONT_BY_FAMILY_NAME )
p_sys->pf_select = Win32_Select;
diff --git a/modules/text_renderer/platform_fonts.c b/modules/text_renderer/platform_fonts.c
index 7869dba..deeaa7d 100644
--- a/modules/text_renderer/platform_fonts.c
+++ b/modules/text_renderer/platform_fonts.c
@@ -42,6 +42,9 @@
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
#include <Carbon/Carbon.h>
+#else
+#include <CoreFoundation/CoreFoundation.h>
+#include <vlc_url.h>
#endif
#include <sys/param.h> /* for MAXPATHLEN */
#undef HAVE_FONTCONFIG
@@ -405,6 +408,43 @@ char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
return psz_path;
}
+#else
+char *iOSFake_Select( filter_t *p_filter, const char* psz_fontname,
+ bool b_bold, bool b_italic, int i_size, int *i_idx )
+{
+ VLC_UNUSED(p_filter);
+ VLC_UNUSED(psz_fontname);
+ VLC_UNUSED(b_bold);
+ VLC_UNUSED(b_italic);
+ VLC_UNUSED(i_size);
+ VLC_UNUSED(i_idx);
+
+ CFURLRef fileURL;
+ fileURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(),
+ CFSTR("OpenSans-Regular.ttf"),
+ NULL,
+ NULL);
+ if (!fileURL)
+ return NULL;
+ CFStringRef urlString = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
+ CFRelease(fileURL);
+
+ if (!urlString)
+ return NULL;
+
+ CFIndex length = CFStringGetLength(urlString);
+ if (!length)
+ return NULL;
+ length++;
+
+ char *psz_path = (char *)malloc(length);
+ CFStringGetCString(urlString, psz_path, length, kCFStringEncodingUTF8);
+ CFRelease(urlString);
+
+ psz_path = strdup(psz_path);
+
+ return psz_path;
+}
#endif
#endif
diff --git a/modules/text_renderer/platform_fonts.h b/modules/text_renderer/platform_fonts.h
index cff52b1..40b25fb 100644
--- a/modules/text_renderer/platform_fonts.h
+++ b/modules/text_renderer/platform_fonts.h
@@ -95,6 +95,9 @@ char* Win32_Select( filter_t *p_filter, const char* family,
#if !TARGET_OS_IPHONE
char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
bool b_bold, bool b_italic, int i_size, int *i_idx );
+#else
+char *iOSFake_Select( filter_t *p_filter, const char* psz_fontname,
+ bool b_bold, bool b_italic, int i_size, int *i_idx );
#endif
#endif
--
2.6.0
From 9ff2994e5399414687b2bea3717b5d7cce3d285f Mon Sep 17 00:00:00 2001
From 5ca13f0ca73e302a91248bb61f555a18bb67b838 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 05/14] lib/media player: inherit deinterlace variable to
Subject: [PATCH 04/19] lib/media player: inherit deinterlace variable to
achieve correct value on first use
---
......@@ -9,10 +9,10 @@ Subject: [PATCH 05/14] lib/media player: inherit deinterlace variable to
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/media_player.c b/lib/media_player.c
index 2136ab8..fc5a82f 100644
index 2dee2d7..3ff4b8a 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -595,7 +595,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
@@ -610,7 +610,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create (mp, "zoom", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
var_Create (mp, "aspect-ratio", VLC_VAR_STRING);
var_Create (mp, "crop", VLC_VAR_STRING);
......
From af4ed742f7c2084f0b78647bbbd7442e391182f1 Mon Sep 17 00:00:00 2001
From 27d09b9a6654d7acecc52294e387a4f5a6192c7c 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 06/14] arm_neon: work-around libtool issue
Subject: [PATCH 05/19] arm_neon: work-around libtool issue
---
modules/arm_neon/Makefile.am | 2 ++
......
From f83d7ed601d02bfe25afbe591473ec072df157aa Mon Sep 17 00:00:00 2001
From 7728ca5c568be20e5b2f5f097ad51f891215eaac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Fri, 19 Dec 2014 22:14:55 +0100
Subject: [PATCH 07/14] libvlc/media: re-parse if flags changed
Subject: [PATCH 06/19] libvlc/media: re-parse if flags changed
---
lib/media.c | 6 ++++++
......@@ -9,10 +9,10 @@ Subject: [PATCH 07/14] libvlc/media: re-parse if flags changed
2 files changed, 7 insertions(+)
diff --git a/lib/media.c b/lib/media.c
index 3b717c7..1b1c033 100644
index 20266ae..fda7ba9 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -716,6 +716,12 @@ static int media_parse(libvlc_media_t *media, bool b_async,
@@ -719,6 +719,12 @@ static int media_parse(libvlc_media_t *media, bool b_async,
vlc_mutex_lock(&media->parsed_lock);
needed = !media->has_asked_preparse;
media->has_asked_preparse = true;
......
From 51bb789836a81edff3b4f2a9dcc77dd621fc29f2 Mon Sep 17 00:00:00 2001
From 48f2bcf02f918c7f9d3282d6f426d3dbe73a38f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Mon, 10 Mar 2014 17:54:01 +0200
Subject: [PATCH 09/14] arm_neon: fix iOS linking
Date: Wed, 10 Dec 2014 22:14:55 +0100
Subject: [PATCH 07/19] arm_neon: fix iOS linking
---
modules/arm_neon/amplify.S | 7 ++---
......
From 25d2cd4c8d4074c53de8a843f33802ff9bafd67b Mon Sep 17 00:00:00 2001
From 3686622b1911f6e31c9a82ab3312ce3dd1d97bf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Mon, 10 Mar 2014 17:54:01 +0200
Subject: [PATCH 10/14] disable neon volume plugin
Date: Wed, 10 Dec 2014 22:14:55 +0100
Subject: [PATCH 08/19] disable neon volume plugin
---
modules/arm_neon/Makefile.am | 1 -
......
From 62d9bc8078db9b97a335ed838d540d164f690e07 Mon Sep 17 00:00:00 2001
From 247206a891554f30673870c3ddb76797762b858d 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/14] contrib/gcrypt: work-around a libtool limitation
Subject: [PATCH 09/19] contrib/gcrypt: work-around a libtool limitation
---
contrib/src/gcrypt/rules.mak | 1 +
......@@ -10,7 +10,7 @@ Subject: [PATCH 11/14] contrib/gcrypt: work-around a libtool limitation
create mode 100644 contrib/src/gcrypt/work-around-libtool-limitation.patch
diff --git a/contrib/src/gcrypt/rules.mak b/contrib/src/gcrypt/rules.mak
index d817a13..5000488 100644
index 2fed2cd..0471522 100644
--- a/contrib/src/gcrypt/rules.mak
+++ b/contrib/src/gcrypt/rules.mak
@@ -15,6 +15,7 @@ libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2 .sum-gcrypt
......
From e68fc29a7335edd9948171bd55a84a459bdb7e50 Mon Sep 17 00:00:00 2001
From af2d272b6b2c40b55bc30518f8aea8569ffcd280 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 12/14] src/misc: fix compilation for OS without fork()
Subject: [PATCH 10/19] src/misc: fix compilation for OS without fork()
---
src/misc/cpu.c | 2 +-
......
From 8dbcb912c9c4a2012f546f596cf4f62b3ff01ba8 Mon Sep 17 00:00:00 2001
From 8a77ad7233ce8b5d4493ae7997f26df665c38e2a 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 13/14] libvlc: hack to disable daemon mode
Subject: [PATCH 11/19] libvlc: hack to disable daemon mode
---
src/libvlc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/libvlc.c b/src/libvlc.c
index 34824da..6bad336 100644
index a7d9a69..c8b5c7a 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -199,6 +199,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
......
From a97ba7e78370b7130299773761b6b218c5a6291c Mon Sep 17 00:00:00 2001
From 99727e9053a815919704699e4756dbad9b2e9bf2 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 14/14] contrib/gcrypt: fix tvOS compilation
Subject: [PATCH 12/19] contrib/gcrypt: fix tvOS compilation
---
contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch | 16 ++++++++++++++++
......@@ -32,7 +32,7 @@ index 0000000..f1d3ccc
+ * %rdi: ctx, CTX
+ * %rsi: data (64 bytes)
diff --git a/contrib/src/gcrypt/rules.mak b/contrib/src/gcrypt/rules.mak
index 5000488..6de232b 100644
index 0471522..ac20d02 100644
--- a/contrib/src/gcrypt/rules.mak
+++ b/contrib/src/gcrypt/rules.mak
@@ -16,6 +16,7 @@ libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2 .sum-gcrypt
......
From eb0d9857947deef28cee80e8b3bddcd522c0aaae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Mon, 26 Oct 2015 10:47:56 +0100
Subject: [PATCH 13/19] disable videotoolbox
---
extras/package/ios/build.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh
index c2a1462..90a338b 100755
--- a/extras/package/ios/build.sh
+++ b/extras/package/ios/build.sh
@@ -481,6 +481,8 @@ output_http
output_livehttp
libmux
stream_out
+videotoolbox
+cvpx_i420
"
if [ "$SCARY" = "no" ]; then
--
2.6.0
From b92a7eb4730633b9a39a7079c176749f4b34da7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Mon, 26 Oct 2015 10:50:26 +0100
Subject: [PATCH 14/19] Revert "libvlc: refactor sfilter enabling/disabling"
This reverts commit 93900cd71aff74d4eec617d8f87be97427f83101.
---
lib/video.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 51 insertions(+), 16 deletions(-)
diff --git a/lib/video.c b/lib/video.c
index b2c9b34..167f76a 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -613,32 +613,33 @@ void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
/* module helpers */
/* ************** */
-static bool find_sub_source_by_name( libvlc_media_player_t *p_mi, const char *restrict name )
+
+static vlc_object_t *get_object( libvlc_media_player_t * p_mi,
+ const char *name )
{
+ vlc_object_t *object;
vout_thread_t *vout = GetVout( p_mi, 0 );
- if (!vout)
- return false;
- char *psz_sources = var_GetString( vout, "sub-source" );
- if( !psz_sources )
+ if( vout )
{
- libvlc_printerr( "%s not enabled", name );
- vlc_object_release( vout );
- return false;
+ object = vlc_object_find_name( vout, name );
+ vlc_object_release(vout);
}
+ else
+ object = NULL;
- /* Find 'name' */
- char *p = strstr( psz_sources, name );
- free( psz_sources );
- vlc_object_release( vout );
- return (p != NULL);
+ if( !object )
+ libvlc_printerr( "%s not enabled", name );
+ return object;
}
+
typedef const struct {
const char name[20];
unsigned type;
} opt_t;
+
static void
set_int( libvlc_media_player_t *p_mi, const char *restrict name,
const opt_t *restrict opt, int value )
@@ -668,8 +669,17 @@ set_int( libvlc_media_player_t *p_mi, const char *restrict name,
libvlc_printerr( "Invalid argument to %s in %s", name, "set int" );
return;
}
+
+ var_SetInteger(p_mi, opt->name, value);
+ vlc_object_t *object = get_object( p_mi, name );
+ if( object )
+ {
+ var_SetInteger(object, opt->name, value);
+ vlc_object_release( object );
+ }
}
+
static int
get_int( libvlc_media_player_t *p_mi, const char *restrict name,
const opt_t *restrict opt )
@@ -680,8 +690,9 @@ get_int( libvlc_media_player_t *p_mi, const char *restrict name,
{
case 0: /* the enabler */
{
- bool b_enabled = find_sub_source_by_name( p_mi, name );
- return b_enabled ? 1 : 0;
+ vlc_object_t *object = get_object( p_mi, name );
+ vlc_object_release( object );
+ return object != NULL;
}
case VLC_VAR_INTEGER:
return var_GetInteger(p_mi, opt->name);
@@ -693,6 +704,7 @@ get_int( libvlc_media_player_t *p_mi, const char *restrict name,
}
}
+
static void
set_float( libvlc_media_player_t *p_mi, const char *restrict name,
const opt_t *restrict opt, float value )
@@ -706,14 +718,23 @@ set_float( libvlc_media_player_t *p_mi, const char *restrict name,
}
var_SetFloat( p_mi, opt->name, value );
+
+ vlc_object_t *object = get_object( p_mi, name );
+ if( object )
+ {
+ var_SetFloat(object, opt->name, value );
+ vlc_object_release( object );
+ }
}
+
static float
get_float( libvlc_media_player_t *p_mi, const char *restrict name,
const opt_t *restrict opt )
{
if( !opt ) return 0.0;
+
if( opt->type != VLC_VAR_FLOAT )
{
libvlc_printerr( "Invalid argument to %s in %s", name, "get float" );
@@ -723,6 +744,7 @@ get_float( libvlc_media_player_t *p_mi, const char *restrict name,
return var_GetFloat( p_mi, opt->name );
}
+
static void
set_string( libvlc_media_player_t *p_mi, const char *restrict name,
const opt_t *restrict opt, const char *restrict psz_value )
@@ -736,8 +758,16 @@ set_string( libvlc_media_player_t *p_mi, const char *restrict name,
}
var_SetString( p_mi, opt->name, psz_value );
+
+ vlc_object_t *object = get_object( p_mi, name );
+ if( object )
+ {
+ var_SetString(object, opt->name, psz_value );
+ vlc_object_release( object );
+ }
}
+
static char *
get_string( libvlc_media_player_t *p_mi, const char *restrict name,
const opt_t *restrict opt )
@@ -753,6 +783,7 @@ get_string( libvlc_media_player_t *p_mi, const char *restrict name,
return var_GetString( p_mi, opt->name );
}
+
static const opt_t *
marq_option_bynumber(unsigned option)
{
@@ -777,6 +808,8 @@ marq_option_bynumber(unsigned option)
return r;
}
+static vlc_object_t *get_object( libvlc_media_player_t *, const char *);
+
/*****************************************************************************
* libvlc_video_get_marquee_int : get a marq option value
*****************************************************************************/
@@ -816,6 +849,7 @@ void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
/* logo module support */
+
static const opt_t *
logo_option_bynumber( unsigned option )
{
@@ -839,10 +873,11 @@ logo_option_bynumber( unsigned option )
return r;
}
+
void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
unsigned option, const char *psz_value )
{
- set_string( p_mi,"logo",logo_option_bynumber(option), psz_value );
+ set_string( p_mi,"logo",logo_option_bynumber(option),psz_value );
}
--
2.6.0
From ecf3e6ac72677c50a43d841f9cfb330fed41f040 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:46:27 +0100
Subject: [PATCH 16/19] contrib/harfbuzz: fix iOS compilation when CoreText is
enabled
---
contrib/src/harfbuzz/harfbuzz-coretext.patch | 32 ++++++++++++++++++++++++++++
contrib/src/harfbuzz/rules.mak | 1 +
2 files changed, 33 insertions(+)
create mode 100644 contrib/src/harfbuzz/harfbuzz-coretext.patch
diff --git a/contrib/src/harfbuzz/harfbuzz-coretext.patch b/contrib/src/harfbuzz/harfbuzz-coretext.patch
new file mode 100644
index 0000000..555e851
--- /dev/null
+++ b/contrib/src/harfbuzz/harfbuzz-coretext.patch
@@ -0,0 +1,32 @@
+diff -ru harfbuzz/configure.ac harfbuzz/configure.ac
+--- harfbuzz/configure.ac 2015-11-23 15:00:52.000000000 +0100
++++ harfbuzz-fixed/configure.ac 2015-11-23 14:59:43.000000000 +0100
+@@ -354,22 +354,21 @@
+ [with_coretext=no])
+ have_coretext=false
+ if test "x$with_coretext" = "xyes" -o "x$with_coretext" = "xauto"; then
+- AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <ApplicationServices/ApplicationServices.h>])
++ if test "x$have_coretext" != "xtrue"; then
++ AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <CoreText/CoreText.h>])
++ fi
+
+ if $have_coretext; then
+ CORETEXT_CFLAGS=
+- CORETEXT_LIBS="-framework ApplicationServices"
++ CORETEXT_LIBS="-framework CoreText -framework CoreGraphics -framework CoreFoundation"
+ AC_SUBST(CORETEXT_CFLAGS)
+ AC_SUBST(CORETEXT_LIBS)
+ else
+- # On iOS CoreText and CoreGraphics are stand-alone frameworks
+- if test "x$have_coretext" != "xtrue"; then
+- AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <CoreText/CoreText.h>])
+- fi
++ AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include <ApplicationServices/ApplicationServices.h>])
+
+ if $have_coretext; then
+ CORETEXT_CFLAGS=
+- CORETEXT_LIBS="-framework CoreText -framework CoreGraphics"
++ CORETEXT_LIBS="-framework ApplicationServices"
+ AC_SUBST(CORETEXT_CFLAGS)
+ AC_SUBST(CORETEXT_LIBS)
+ fi
diff --git a/contrib/src/harfbuzz/rules.mak b/contrib/src/harfbuzz/rules.mak
index f21917c..2058b4a 100644
--- a/contrib/src/harfbuzz/rules.mak
+++ b/contrib/src/harfbuzz/rules.mak
@@ -23,6 +23,7 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.bz2 .sum-harfbuzz
$(UPDATE_AUTOCONFIG)
$(APPLY) $(SRC)/harfbuzz/harfbuzz-aarch64.patch
$(APPLY) $(SRC)/harfbuzz/harfbuzz-clang.patch
+ $(APPLY) $(SRC)/harfbuzz/harfbuzz-coretext.patch
$(MOVE)
DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
--
2.6.0
From 730eefed8be9bc079070ff4795789a712c8ee0db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Fri, 20 Nov 2015 13:27:09 +0100
Subject: [PATCH 17/19] contrib/lua: add tvOS support
---
contrib/src/lua/lua-tvos-support.patch | 26 ++++++++++++++++++++++++++
contrib/src/lua/rules.mak | 4 ++++
2 files changed, 30 insertions(+)
create mode 100644 contrib/src/lua/lua-tvos-support.patch
diff --git a/contrib/src/lua/lua-tvos-support.patch b/contrib/src/lua/lua-tvos-support.patch
new file mode 100644
index 0000000..c84dc34
--- /dev/null
+++ b/contrib/src/lua/lua-tvos-support.patch
@@ -0,0 +1,26 @@
+diff -ru lua/src/loslib.c lua/src/loslib.c
+--- lua/src/loslib.c 2008-01-18 17:38:18.000000000 +0100
++++ lua-fixed/src/loslib.c 2015-11-20 12:21:35.000000000 +0100
+@@ -4,6 +4,9 @@
+ ** See Copyright Notice in lua.h
+ */
+
++#ifdef __APPLE__
++#include <TargetConditionals.h>
++#endif
+
+ #include <errno.h>
+ #include <locale.h>
+@@ -36,8 +39,12 @@
+
+
+ static int os_execute (lua_State *L) {
++#if TARGET_OS_TV
++ return 3;
++#else
+ lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
+ return 1;
++#endif
+ }
+
+
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 8be4af2..d68e8b6 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -45,6 +45,7 @@ lua: lua-$(LUA_VERSION).tar.gz .sum-lua
$(APPLY) $(SRC)/lua/luac-32bits.patch
$(APPLY) $(SRC)/lua/no-localeconv.patch
$(APPLY) $(SRC)/lua/lua-ios-support.patch
+ $(APPLY) $(SRC)/lua/lua-tvos-support.patch
ifdef HAVE_DARWIN_OS
(cd $(UNPACK_DIR) && \
sed -e 's%gcc%$(CC)%' \
@@ -81,4 +82,7 @@ ifdef HAVE_CROSS_COMPILE
cd $</src && $(MAKE) clean && $(MAKE) liblua.a && ranlib liblua.a && $(MAKE) luac
cp $</src/luac $(PREFIX)/bin
endif
+ifdef HAVE_IOS
+ cd $(PREFIX)/bin && rm lua*
+endif
touch $@
--
2.6.0
From abb61b0dc11a5465cbe9da481d287bd844da1602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Fri, 20 Nov 2015 14:46:23 +0100
Subject: [PATCH 18/19] Enable lua for tvOS
---
extras/package/ios/build.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh
index 90a338b..be82e5c 100755
--- a/extras/package/ios/build.sh
+++ b/extras/package/ios/build.sh
@@ -242,9 +242,9 @@ else
fi
if [ "$TVOS" = "yes" ]; then
- TVOSOPTIONS="--disable-libarchive"
+ TVOSOPTIONS="--disable-libarchive --enable-lua"
else
- TVOSOPTIONS=""
+ TVOSOPTIONS="--disable-lua"
fi
../bootstrap --build=x86_64-apple-darwin11 --host=${TARGET} --prefix=${VLCROOT}/contrib/${OSSTYLE}-${TARGET}-${ARCH} --disable-gpl \
@@ -276,7 +276,6 @@ fi
--enable-ass \
--disable-fontconfig \
--disable-gpg-error \
- --disable-lua \
--disable-protobuf \
--disable-aribb24 \
--disable-aribb25 \
@@ -326,9 +325,9 @@ else
fi
if [ "$TVOS" = "yes" ]; then
- TVOSOPTIONS="--disable-neon"
+ TVOSOPTIONS="--disable-neon --enable-lua"
else
- TVOSOPTIONS="--enable-neon"
+ TVOSOPTIONS="--enable-neon --disable-lua"
fi
# Run configure only upon changes.
@@ -354,7 +353,6 @@ ${VLCROOT}/configure \
--enable-mkv \
--enable-opus \
--disable-faad \
- --disable-lua \
--disable-a52 \
--enable-fribidi \
--disable-qt --disable-skins2 \
--
2.6.0
From a1d303613cb3942fbb47a5f76e1447819072196e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Fri, 20 Nov 2015 14:45:50 +0100
Subject: [PATCH 19/19] configure: don't fail if there is no lua compiler, just
don't compile lua
---
configure.ac | 4 +---
share/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2a45941..696a5b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1545,13 +1545,11 @@ then
fi
AC_ARG_VAR([LUAC], [LUA byte compiler])
AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
- AS_IF([test "${LUAC}" = "false"], [
- AC_MSG_ERROR([Could not find the LUA byte compiler.])
- ])
AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [
AC_MSG_ERROR([You need 32-bits luac when using using lua from contrib.])
])
fi
+AM_CONDITIONAL(COMPILE_LUA_BYTECODE, [test "${LUAC}" = "true"])
AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
diff --git a/share/Makefile.am b/share/Makefile.am
index 98f745f..77b4bf0 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -101,7 +101,7 @@ luac_verbose_0 = @echo " LUAC $@";
$(AM_V_at)mkdir -p "$$(dirname '$@')"
$(luac_verbose)$(LUAC) -o $@ $<
-if BUILD_LUA
+if COMPILE_LUA_BYTECODE
nobase_vlclib_DATA = \
lua/extensions/VLSub.luac \
lua/intf/cli.luac \
--
2.6.0
......@@ -14,6 +14,7 @@ New APIs:
snapshots, lastSnapshot
- added selectors: chaptersForTitleIndex:
numberOfChaptersForTitle:
- added notifications: VLCMediaPlayerTitleChanged, VLCMediaPlayerChapterChanged
- VLCMedia
- added keys: VLCMetaInformationTrackTotal, VLCMetaInformationDirector,
......@@ -34,7 +35,7 @@ New APIs:
Deprecated APIs:
- VLCMediaPlayer
- titles, chaptersForTitleIndex:, countOfTitles
- titles, chaptersForTitleIndex:, countOfTitles, framesPerSecond
- VLCAudio
- setMute:
......
......@@ -113,7 +113,7 @@ static VLCLibrary * sharedLibrary = nil;
#ifndef NOSCARYCODECS
@"--avcodec-fast",
#endif
@"--text-renderer=quartztext",
@"--text-renderer=freetype",
@"--avi-index=3",
@"--extraintf=ios_dialog_provider"];
}
......@@ -126,7 +126,7 @@ static VLCLibrary * sharedLibrary = nil;
[defaultParams addObject:@"--verbose=4"]; // Let's not wreck the logs
[defaultParams addObject:@"--no-sout-keep"];
[defaultParams addObject:@"--vout=macosx"]; // Select Mac OS X video output
[defaultParams addObject:@"--text-renderer=quartztext"]; // our CoreText-based renderer
[defaultParams addObject:@"--text-renderer=freetype"];
[defaultParams addObject:@"--extraintf=macosx_dialog_provider"]; // Some extra dialog (login, progress) may come up from here
[[NSUserDefaults standardUserDefaults] setObject:defaultParams forKey:@"VLCParams"];
......@@ -204,7 +204,7 @@ static void HandleMessage(void *data,
return;
}
if (!str)
if (str == NULL)
return;
VKLog(@"%@", [NSString stringWithUTF8String:str]);
......
......@@ -217,10 +217,18 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
- (instancetype)initWithURL:(NSURL *)anURL
{
if (self = [super init]) {
const char *url;
VLCLibrary *library = [VLCLibrary sharedLibrary];
NSAssert(library.instance, @"no library instance when creating media");
p_md = libvlc_media_new_location(library.instance, [[anURL absoluteString] UTF8String]);
if (([[anURL absoluteString] hasPrefix:@"sftp://"]) ||
([[anURL absoluteString] hasPrefix:@"smb://"])) {
url = [[[anURL absoluteString] stringByRemovingPercentEncoding] UTF8String];
} else {
url = [[anURL absoluteString] UTF8String];
}
p_md = libvlc_media_new_location(library.instance, url);
_metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
......@@ -281,7 +289,7 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
- (NSString *)description
{
NSString * result = _metaDictionary[VLCMetaInformationTitle];
return [NSString stringWithFormat:@"<%@ %p> %@", [self class], self, (result ? result : [_url absoluteString])];
return [NSString stringWithFormat:@"<%@ %p> %@", [self class], self, (result ? result : [[_url absoluteString] stringByRemovingPercentEncoding])];
}
- (NSComparisonResult)compare:(VLCMedia *)media
......@@ -814,9 +822,10 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
if (!p_url)
return;
_url = [NSURL URLWithString:@(p_url)];
if (!_url) /* Attempt to interpret as a file path then */
_url = [NSURL URLWithString:[[NSString stringWithUTF8String:p_url] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
if (!_url) /* Attempt to interpret as a file path then */ {
_url = [NSURL fileURLWithPath:@(p_url)];
}
free(p_url);
libvlc_media_set_user_data(p_md, (__bridge void*)self);
......
......@@ -50,6 +50,8 @@
/* Notification Messages */
NSString *const VLCMediaPlayerTimeChanged = @"VLCMediaPlayerTimeChanged";
NSString *const VLCMediaPlayerStateChanged = @"VLCMediaPlayerStateChanged";
NSString *const VLCMediaPlayerTitleChanged = @"VLCMediaPlayerTitleChanged";
NSString *const VLCMediaPlayerChapterChanged = @"VLCMediaPlayerChapterChanged";
NSString *const VLCMediaPlayerSnapshotTaken = @"VLCMediaPlayerSnapshotTaken";
/* title keys */
......@@ -144,6 +146,24 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
}
}
static void HandleMediaTitleChanged(const libvlc_event_t * event, void * self)
{
@autoreleasepool {
[[VLCEventManager sharedManager] callOnMainThreadDelegateOfObject:(__bridge id)(self)
withDelegateMethod:@selector(mediaPlayerTimeChanged:)
withNotificationName:VLCMediaPlayerTitleChanged];
}
}
static void HandleMediaChapterChanged(const libvlc_event_t * event, void * self)
{
@autoreleasepool {
[[VLCEventManager sharedManager] callOnMainThreadDelegateOfObject:(__bridge id)(self)
withDelegateMethod:@selector(mediaPlayerChapterChanged:)
withNotificationName:VLCMediaPlayerChapterChanged];
}
}
#if TARGET_OS_IPHONE
static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
{
......@@ -172,6 +192,9 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
- (void)mediaPlayerPositionChanged:(NSNumber *)newTime;
- (void)mediaPlayerStateChanged:(NSNumber *)newState;
- (void)mediaPlayerMediaChanged:(VLCMedia *)media;
- (void)mediaPlayerTitleChanged:(NSNumber *)newTitle;
- (void)mediaPlayerChapterChanged:(NSNumber *)newChapter;
#if TARGET_OS_IPHONE
- (void)mediaPlayerSnapshot:(NSString *)fileName;
#endif
......@@ -462,20 +485,21 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
{
libvlc_video_set_textrenderer_int(_playerInstance, libvlc_textrender_fontsize, [fontSize intValue]);
}
#endif
#if TARGET_OS_IPHONE
- (void)setTextRendererFont:(NSString *)fontname
{
libvlc_video_set_textrenderer_string(_playerInstance, libvlc_textrender_font, [fontname UTF8String]);
}
#endif
#if TARGET_OS_IPHONE
- (void)setTextRendererFontColor:(NSNumber *)fontColor
{
libvlc_video_set_textrenderer_int(_playerInstance, libvlc_textrender_fontcolor, [fontColor intValue]);
}
- (void)setTextRendererFontForceBold:(NSNumber *)fontForceBold
{
libvlc_video_set_textrenderer_bool(_playerInstance, libvlc_textrender_fontforcebold, [fontForceBold boolValue]);
}
#endif
#pragma mark -
......@@ -623,7 +647,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
- (float)framesPerSecond
{
return libvlc_media_player_get_fps(_playerInstance);
return .0;
}
- (void)setTime:(VLCTime *)value
......@@ -1261,6 +1285,9 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, (__bridge void *)(self));
libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, (__bridge void *)(self));
libvlc_event_attach(p_em, libvlc_MediaPlayerTitleChanged, HandleMediaTitleChanged, (__bridge void *)(self));
libvlc_event_attach(p_em, libvlc_MediaPlayerChapterChanged, HandleMediaChapterChanged, (__bridge void *)(self));
#if TARGET_OS_IPHONE
libvlc_event_attach(p_em, libvlc_MediaPlayerSnapshotTaken, HandleMediaPlayerSnapshot, (__bridge void *)(self));
#endif
......@@ -1284,6 +1311,9 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
libvlc_event_detach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, (__bridge void *)(self));
libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, (__bridge void *)(self));
libvlc_event_detach(p_em, libvlc_MediaPlayerTitleChanged, HandleMediaTitleChanged, (__bridge void *)(self));
libvlc_event_detach(p_em, libvlc_MediaPlayerChapterChanged, HandleMediaChapterChanged, (__bridge void *)(self));
#if TARGET_OS_IPHONE
libvlc_event_detach(p_em, libvlc_MediaPlayerSnapshotTaken, HandleMediaPlayerSnapshot, (__bridge void *)(self));
#endif
......@@ -1295,7 +1325,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
[self willChangeValueForKey:@"remainingTime"];
_cachedTime = [VLCTime timeWithNumber:newTime];
double currentTime = [[_cachedTime numberValue] doubleValue];
if (currentTime > 0) {
if (currentTime > 0 && _position > 0.) {
double remaining = currentTime / _position * (1 - _position);
_cachedRemainingTime = [VLCTime timeWithNumber:@(-remaining)];
} else
......
......@@ -79,7 +79,12 @@
- (NSString *)stringValue
{
if (_value) {
long long duration = [_value longLongValue] / 1000;
long long duration = [_value longLongValue];
if (duration == INT_MAX || duration == INT_MIN) {
// Return a string that represents an undefined time.
return @"--:--";
}
duration = duration / 1000;
long long positiveDuration = llabs(duration);
if (positiveDuration > 3600)
return [NSString stringWithFormat:@"%s%01ld:%02ld:%02ld",
......
......@@ -16,7 +16,7 @@ SKIPLIBVLCCOMPILATION=no
SCARY=yes
TVOS=no
TESTEDHASH=601832ac
TESTEDHASH=138e3534
usage()
{
......