<html><head></head><body>Hi,<br><br>Why do you make a static plugin here? Can't you use the dummy interface and have a proper stand-alone window provider, essentially like CLI VLC does on Unix?<br><br><div class="gmail_quote">Le 6 mai 2020 11:51:37 GMT+03:00, Alexandre Janniaux <ajanni@videolabs.io> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">iosvlc.m provides a binary usable as an iOS application, forwarding the<br>VLC arguments just like VLC on desktop. It allows easier iteration on<br>vlccore development for iOS, without the need to test in a VLCKit<br>application like VLC for iOS or new external application.<br><br>It must be built with dynamic plugins, just like --enable-vlc require<br>it already in the configure.ac file.<br><br>To develop with it, you must generate a .ipa archive containing both<br>the resulting binary as executable, a PkgInfo file, an Info.plist file<br>describing the package and the libs (libvlc.dylib, libvlccore.dylib, and<br>every plugin .dylib or additional convenience libraries that are not<br>linked statically in the Frameworks/ directory. It must then be signed<br>with a developer certificate allowed by Apple and provisionned with a<br>mobileprovision file allowing installation on the given device for the<br>same developer certificate.<br><br>Then, tools like libimobiledevice can be used to start the application<br>with additional arguments or environment variables. They can also be<br>added in XCode through the "Edit Scheme" menu.<br><br>A big part of the iOS-specific code has been originally written by<br>Marvin Scholz in a more complete libVLC ios sample.<br><br>Co-authored-by: Marvin Scholz <epirat07@gmail.com><hr> bin/Makefile.am | 10 ++++-<br> bin/iosvlc.m | 111 ++++++++++++++++++++++++++++++++++++++++++++++++<br> 2 files changed, 120 insertions(+), 1 deletion(-)<br> create mode 100644 bin/iosvlc.m<br><br>diff --git a/bin/Makefile.am b/bin/Makefile.am<br>index 699fbd4bf0b..b752d968588 100644<br>--- a/bin/Makefile.am<br>+++ b/bin/Makefile.am<br>@@ -5,10 +5,19 @@ if HAVE_OSX<br> bin_PROGRAMS = vlc-osx<br> noinst_PROGRAMS = vlc-osx-static<br> else<br>+if HAVE_IOS<br>+vlc_ios_SOURCES = iosvlc.m<br>+vlc_ios_LDFLAGS = $(LDFLAGS_vlc) -Wl,-framework,Foundation,-framework,UIKit<br>+vlc_ios_LDFLAGS += -Xlinker -rpath -Xlinker "$(libdir)"<br>+vlc_ios_CFLAGS = -fobjc-arc<br>+vlc_ios_LDADD = ../lib/libvlc.la ../src/libvlccore.la<br>+bin_PROGRAMS = vlc-ios<br>+else<br> bin_PROGRAMS = vlc<br> noinst_PROGRAMS = vlc-static<br> endif<br> endif<br>+endif<br> EXTRA_DIST = vlc_win32_rc.rc.in<br> CLEANFILES = vlc_win32_rc.rc<br> <br>@@ -70,7 +79,6 @@ vlc_osx_static_OBJCFLAGS += -F$(CONTRIB_DIR)/Frameworks<br> vlc_osx_static_CPPFLAGS = -DHAVE_BREAKPAD<br> endif<br> <br>-<br> #<br> # Static (debug) VLC executable<br> #<br>diff --git a/bin/iosvlc.m b/bin/iosvlc.m<br>new file mode 100644<br>index 00000000000..f671615e602<br>--- /dev/null<br>+++ b/bin/iosvlc.m<br>@@ -0,0 +1,111 @@<br>+/*****************************************************************************<br>+ * iosvlc.m: iOS specific development main executable for VLC media player<br>+ *****************************************************************************<br>+ * Copyright (C) 2020 Videolabs<br>+ *<br>+ * Authors: Marvin Scholz <epirat07 at gmail dot com><br>+ * Alexandre Janniaux <ajanni@videolabs.io><br>+ *<br>+ * This program is free software; you can redistribute it and/or modify it<br>+ * under the terms of the GNU Lesser General Public License as published by<br>+ * the Free Software Foundation; either version 2.1 of the License, or<br>+ * (at your option) any later version.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU Lesser General Public License for more details.<br>+ *<br>+ * You should have received a copy of the GNU Lesser General Public License<br>+ * along with this program; if not, write to the Free Software Foundation,<br>+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.<br>+ *****************************************************************************/<br>+<br>+#ifdef HAVE_CONFIG_H<br>+# include "config.h"<br>+#endif<br>+<br>+#import <UIKit/UIKit.h><br>+#include <vlc/vlc.h><br>+<br>+#include <vlc_common.h><br>+#include <vlc_variables.h><br>+#include <vlc_plugin.h><br>+<br>+@interface AppDelegate : UIResponder <UIApplicationDelegate> {<br>+ @public<br>+ libvlc_instance_t *_libvlc;<br>+ UIWindow *window;<br>+}<br>+@end<br>+<br>+<br>+@implementation AppDelegate<br>+/* Called after application launch */<br>+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions<br>+{<br>+ /* Set VLC_PLUGIN_PATH for dynamic loading */<br>+ NSString *pluginsDirectory = [[NSBundle mainBundle] privateFrameworksPath];<br>+ setenv("VLC_PLUGIN_PATH", [pluginsDirectory UTF8String], 1);<br>+<br>+ /* Store startup arguments to forward them to libvlc */<br>+ NSArray *arguments = [[NSProcessInfo processInfo] arguments];<br>+ unsigned vlc_argc = [arguments count];<br>+ char **vlc_argv = (char **)malloc(vlc_argc * sizeof(char*));<br>+ if (vlc_argv == NULL)<br>+ return NO;<br>+<br>+ for (unsigned i = 0; i < vlc_argc; i++)<br>+ vlc_argv[i] = [[arguments objectAtIndex:i] UTF8String];<br>+<br>+ /* Initialize libVLC */<br>+ _libvlc = libvlc_new(vlc_argc, (const char * const*)vlc_argv);<br>+ free(vlc_argv);<br>+<br>+ if (_libvlc == NULL)<br>+ return NO;<br>+<br>+ /* Initialize main window */<br>+ window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];<br>+ window.rootViewController = [UIViewController alloc];<br>+ window.backgroundColor = [UIColor whiteColor];<br>+ [window makeKeyAndVisible];<br>+<br>+ /* Start glue interface, see code below */<br>+ libvlc_add_intf(_libvlc, "ios_interface,none");<br>+<br>+ /* Start parsing arguments and eventual playback */<br>+ libvlc_playlist_play(_libvlc);<br>+<br>+ return YES;<br>+}<br>+@end<br>+<br>+int main(int argc, char * argv[]) {<br>+ @autoreleasepool {<br>+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));<br>+ }<br>+}<br>+<br>+/* Glue interface code, define drawable-nsobject for display module */<br>+static int Open(vlc_object_t *obj)<br>+{<br>+ AppDelegate *d = (AppDelegate *)[[UIApplication sharedApplication] delegate];<br>+ assert(d != nil && d->window != nil);<br>+ var_SetAddress(vlc_object_instance(obj), "drawable-nsobject", d->window);<br>+<br>+ return VLC_SUCCESS;<br>+}<br>+<br>+#define MODULE_NAME ios_interface<br>+#define MODULE_STRING "ios_interface"<br>+vlc_module_begin()<br>+ set_capability("interface", 0)<br>+ set_callback(Open)<br>+vlc_module_end()<br>+<br>+/* Inject the glue interface as a static module */<br>+typedef int (*vlc_plugin_cb)(vlc_set_cb, void*);<br>+<br>+__attribute__((visibility("default")))<br>+vlc_plugin_cb vlc_static_modules[] = { vlc_entry__ios_interface, NULL };</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>