Alexandre Janniaux 5 роки тому
батько
коміт
1ed11cd80f

+ 11 - 0
Examples/iOS/SwiftSimplePlayback/SwiftSimplePlayback/Sources/VLCPlugins.m

@@ -0,0 +1,11 @@
+//
+//  VLCPluginManifest.m
+//  VLC-iOS
+//
+//  Created by Alexandre Janniaux on 12/03/2020.
+//  Copyright © 2020 VideoLAN. All rights reserved.
+//
+
+#include <MobileVLCKit/VLCPlugin.h>
+
+VLCKIT_DECLARE_PLUGINS(NULL)

+ 20 - 0
MobileVLCKit.xcodeproj/project.pbxproj

@@ -9,6 +9,9 @@
 /* Begin PBXBuildFile section */
 		0E159EC41BC6B2890015BA7C /* VLCAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49C5FB1BC3D7870052D40C /* VLCAudio.m */; };
 		0E159EC51BC6B2930015BA7C /* VLCAudio.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 4B49C5FD1BC3D7960052D40C /* VLCAudio.h */; };
+		0EE80C7B241683030035EC7F /* libvlc.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EE80C7A241683020035EC7F /* libvlc.framework */; };
+		0EE80C7C241687340035EC7F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D8938FB1B5009CB008F2B14 /* UIKit.framework */; };
+		0EE80C7D241687470035EC7F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D8938EC1B500991008F2B14 /* CoreGraphics.framework */; };
 		3F7CC79921D69DEA0094B074 /* module.modulemap in Copy Modulemap */ = {isa = PBXBuildFile; fileRef = 3F7CC79721D69D9A0094B074 /* module.modulemap */; };
 		3F7CC79A21D69E090094B074 /* module.modulemap in Copy Modulemap */ = {isa = PBXBuildFile; fileRef = 3F7CC79621D69CB40094B074 /* module.modulemap */; };
 		41E1959721BEA28F00F10277 /* VLCTranscoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 41E1959621BEA28F00F10277 /* VLCTranscoder.m */; };
@@ -425,6 +428,7 @@
 
 /* Begin PBXFileReference section */
 		0EE528B3241BE7D400050373 /* VLCPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCPlugin.h; path = Headers/Public/VLCPlugin.h; sourceTree = "<group>"; };
+		0EE80C7A241683020035EC7F /* libvlc.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libvlc.framework; path = "libvlc/vlc/build-iphonesimulator-x86_64/static-lib/libvlc.framework"; sourceTree = "<group>"; };
 		3F7CC79621D69CB40094B074 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = Resources/TVVLCKit/module.modulemap; sourceTree = SOURCE_ROOT; };
 		3F7CC79721D69D9A0094B074 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = Resources/MobileVLCKit/module.modulemap; sourceTree = "<group>"; };
 		41E1959621BEA28F00F10277 /* VLCTranscoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCTranscoder.m; path = Sources/VLCTranscoder.m; sourceTree = "<group>"; };
@@ -656,6 +660,9 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				0EE80C7D241687470035EC7F /* CoreGraphics.framework in Frameworks */,
+				0EE80C7B241683030035EC7F /* libvlc.framework in Frameworks */,
+				0EE80C7C241687340035EC7F /* UIKit.framework in Frameworks */,
 				AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -716,6 +723,7 @@
 		0867D69AFE84028FC02AAC07 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				0EE80C7A241683020035EC7F /* libvlc.framework */,
 				CAA03D2420C8DE7A001764DA /* CoreMedia.framework */,
 				CAA03D2220C8DE73001764DA /* VideoToolbox.framework */,
 				CAA03D2020C8DE6D001764DA /* AudioToolbox.framework */,
@@ -1589,6 +1597,10 @@
 				DSTROOT = /tmp/MobileVLCKit.dst;
 				ENABLE_BITCODE = YES;
 				ENABLE_NS_ASSERTIONS = NO;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)/libvlc/vlc/build-iphonesimulator-x86_64/static-lib",
+				);
 				GCC_C_LANGUAGE_STANDARD = gnu11;
 				GCC_OPTIMIZATION_LEVEL = s;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1597,6 +1609,8 @@
 				HEADER_SEARCH_PATHS = "$(SRCROOT)/libvlc/vlc/include";
 				INSTALL_PATH = /usr/local/lib;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.4;
+				MACH_O_TYPE = mh_dylib;
+				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LIBTOOLFLAGS = "$(PROJECT_DIR)/libvlc/vlc/install-iPhone/libvlc-full-static.a $(OTHER_CFLAGS)";
 				PRODUCT_NAME = MobileVLCKit;
 			};
@@ -1735,6 +1749,10 @@
 				DSTROOT = /tmp/MobileVLCKit.dst;
 				ENABLE_BITCODE = YES;
 				ENABLE_NS_ASSERTIONS = NO;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)/libvlc/vlc/build-iphonesimulator-x86_64/static-lib",
+				);
 				GCC_C_LANGUAGE_STANDARD = gnu11;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1743,6 +1761,8 @@
 				HEADER_SEARCH_PATHS = "$(SRCROOT)/libvlc/vlc/include";
 				INSTALL_PATH = /usr/local/lib;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.4;
+				MACH_O_TYPE = mh_dylib;
+				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LIBTOOLFLAGS = "$(PROJECT_DIR)/libvlc/vlc/install-iPhone/libvlc-full-static.a $(OTHER_CFLAGS)";
 				PRODUCT_NAME = MobileVLCKit;
 			};

+ 0 - 2
Resources/DynamicMobileVLCKit/Info.plist

@@ -16,8 +16,6 @@
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
 	<string>1.0</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
 	<key>CFBundleVersion</key>
 	<string>$(CURRENT_PROJECT_VERSION)</string>
 	<key>NSPrincipalClass</key>

+ 46 - 0
compileAndBuildVLCKit.sh

@@ -167,6 +167,12 @@ buildLibVLC() {
         --build-modules=static \
         ${DEBUGFLAG} ${VERBOSEFLAG} ${BITCODEFLAG}
 
+    # COPY to the framework:
+    #  - ${VLC_INSTALL_DIR}/lib/libvlc.dylib
+    #  - ${VLC_INSTALL_DIR}/lib/libvlccore.dylib
+    #  - ${VLC_INSTALL_DIR}/lib/libvlcmodules_plugin.dylib
+    #  - ${VLC_INSTALL_DIR}/include/vlc/plugins.manifest.h
+
     spopd # builddir
 
     info "Finished compiling libvlc for ${ARCH} with SDK version ${SDK_VERSION}, platform ${PLATFORM}"
@@ -452,6 +458,39 @@ fi
 
 info "all done"
 
+copy_libvlc_files() {
+    OUTPUT="$1"
+    ARCH="$2"
+    PLATFORM="$3"
+    info "Copy plugin manifest for $PLATFORM-$ARCH to $OUTPUT"
+
+    ACTUAL_ARCH=`get_actual_arch $ARCH`
+    BUILDDIR="${VLCROOT}/build-${PLATFORM}-${ACTUAL_ARCH}"
+
+    # HACK: find the path to VLC install directory ourselves, althoug we should
+    #       be able to explicit it ourselves instead of relying on the script to
+    #       decide for us.
+    VLC_INSTALL_DIR="${BUILDDIR}/vlc-${PLATFORM}${SDK_VERSION}-${ACTUAL_ARCH}/"
+
+    mkdir -p "${OUTPUT}/Headers"
+    mkdir -p "${OUTPUT}/Libraries"
+    cp -p "${VLC_INSTALL_DIR}/include/vlc/plugins.manifest.h" "$OUTPUT/Headers/"
+    cp -p "${VLC_INSTALL_DIR}/lib/libvlc.dylib" "$OUTPUT/Libraries/"
+    cp -p "${VLC_INSTALL_DIR}/lib/libvlccore.dylib" "$OUTPUT/Libraries/"
+    cp -p "${VLC_INSTALL_DIR}/lib/libvlcmodules_plugin.dylib" "$OUTPUT/Libraries/"
+
+    # The application has to set the run-search path to the MobileVLCKit Library folder
+    install_name_tool \
+        "$OUTPUT/Libraries/libvlc.dylib" \
+        -id "@rpath/libvlc.dylib"
+    install_name_tool \
+        "$OUTPUT/Libraries/libvlccore.dylib" \
+        -id "@rpath/libvlccore.dylib"
+    install_name_tool \
+        "$OUTPUT/Libraries/libvlcmodules_plugin.dylib" \
+        \-id "@rpath/libvlcmodules_plugin.dylib"
+}
+
 if [ "$BUILD_STATIC_FRAMEWORK" != "no" ]; then
 if [ "$TVOS" = "yes" ]; then
     info "Building static TVVLCKit.framework"
@@ -486,6 +525,7 @@ if [ "$IOS" = "yes" ]; then
 
     lipo_libs=""
     platform=""
+
     if [ "$FARCH" = "all" ] || (! is_simulator_arch $FARCH);then
         platform="iphoneos"
         buildxcodeproj MobileVLCKit "MobileVLCKit" ${platform}
@@ -505,6 +545,12 @@ if [ "$IOS" = "yes" ]; then
     chmod a+x MobileVLCKit.framework/MobileVLCKit && \
     cp -pr ${CONFIGURATION}-${platform}/MobileVLCKit MobileVLCKit.framework/Headers
     cp -pr ${CONFIGURATION}-${platform}/Modules MobileVLCKit.framework/Modules
+
+    # Only support the non-ALL case for now
+    if [ "$FARCH" != "all" ]; then
+        copy_libvlc_files MobileVLCKit.framework/ ${FARCH} ${platform}
+    fi
+
     spopd # build
 
     info "Build of static MobileVLCKit.framework completed"