[vlc-commits] test: iosvlc: use subview for rendering

Alexandre Janniaux git at videolan.org
Sat Mar 13 13:06:31 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Tue Feb 16 15:53:57 2021 +0100| [96bee41831849597448a2414aa06faa1ee837a38] | committer: Alexandre Janniaux

test: iosvlc: use subview for rendering

Using a subview instead of the UIWindow is useful for testing the resize
of the view and adding color markers on the views.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=96bee41831849597448a2414aa06faa1ee837a38
---

 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;
 }



More information about the vlc-commits mailing list