[vlc-devel] [PATCH 1/5] test: iosvlc: use subview for rendering

Alexandre Janniaux ajanni at videolabs.io
Thu Mar 11 17:39:30 UTC 2021


Using a subview instead of the UIWindow is useful for testing the resize
of the view and adding color markers on the views.
---
 test/iosvlc.m | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/test/iosvlc.m b/test/iosvlc.m
index fc73205c67..23b2c236b4 100644
--- a/test/iosvlc.m
+++ b/test/iosvlc.m
@@ -36,6 +36,7 @@
     @public
     libvlc_instance_t *_libvlc;
     UIWindow *window;
+    UIView *subview;
 }
 @end
 
@@ -69,6 +70,10 @@
     window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
     window.rootViewController = [UIViewController alloc];
     window.backgroundColor = [UIColor whiteColor];
+
+    subview = [[UIView alloc] initWithFrame:window.bounds];
+    subview.backgroundColor = [UIColor blueColor];
+    [window addSubview:subview];
     [window makeKeyAndVisible];
 
     /* Start glue interface, see code below */
@@ -91,9 +96,9 @@ int main(int argc, char * argv[]) {
 static int Open(vlc_object_t *obj)
 {
     AppDelegate *d = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    assert(d != nil && d->window != nil);
+    assert(d != nil && d->subview != nil);
     var_SetAddress(vlc_object_instance(obj), "drawable-nsobject",
-                   (__bridge void *)d->window);
+                   (__bridge void *)d->subview);
 
     return VLC_SUCCESS;
 }
-- 
2.30.2



More information about the vlc-devel mailing list