Changeset 5628


Ignore:
Timestamp:
Jul 18, 2017 11:55:25 AM (7 years ago)
Author:
ming
Message:

Re #1994 (misc): Fixed warning during runtime on iOS 11:
UI API called on a background thread

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/darwin_dev.m

    r5498 r5628  
    891891        /* Create renderer stream here */ 
    892892         
    893         status = darwin_init_view(strm); 
    894         if (status != PJ_SUCCESS) 
    895             goto on_error; 
     893        dispatch_sync_on_main_queue(^{ 
     894            darwin_init_view(strm); 
     895        }); 
    896896         
    897897        if (!strm->vout_delegate) { 
     
    10001000             
    10011001#if TARGET_OS_IPHONE 
    1002             /* Create view, if none */ 
    1003             if (!strm->render_view) 
    1004                 darwin_init_view(strm); 
    1005              
    10061002            /* Preview layer instantiation should be in main thread! */ 
    10071003            dispatch_sync_on_main_queue(^{ 
     1004                /* Create view, if none */ 
     1005                if (!strm->render_view) 
     1006                    darwin_init_view(strm); 
     1007             
    10081008                /* Create preview layer */ 
    10091009                AVCaptureVideoPreviewLayer *prev_layer = 
  • pjproject/trunk/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m

    r5542 r5628  
    190190    if (dev_ori == prev_ori) return; 
    191191     
    192     NSLog(@"Device orientation changed: %d", (prev_ori = dev_ori)); 
     192    NSLog(@"Device orientation changed: %ld", (prev_ori = dev_ori)); 
    193193     
    194194    if (dev_ori >= UIDeviceOrientationPortrait && 
     
    272272        alert.alertAction = @"Activate app"; 
    273273         
    274         [[UIApplication sharedApplication] presentLocalNotificationNow:alert]; 
     274        dispatch_async(dispatch_get_main_queue(), 
     275                       ^{[[UIApplication sharedApplication] 
     276                          presentLocalNotificationNow:alert];}); 
    275277    } 
    276278     
Note: See TracChangeset for help on using the changeset viewer.