title: PJSIP Video Call: No video... only blank window is appearing in iOS?
body: <p>I am trying to add a video call feature in my iOS application using pjsip 2.7.1. I have followed the steps mentioned in this link <a href="https://trac.pjsip.org/repos/wiki/Video_Users_Guide" rel="nofollow noreferrer">https://trac.pjsip.org/repos/wiki/Video_Users_Guide</a></p>
  
  <pre><code>if (pjsua_vid_win_get_info(i, &amp;wi) == PJ_SUCCESS) {
  
          dispatch_async(dispatch_get_main_queue(), ^{
  
              UIView* videoView = (__bridge UIView *)wi.hwnd.info.ios.window;                    
                  /* Resize it to fit width */
                  videoView.bounds = CGRectMake(0, 0, 375,667);
                  /* Center it horizontally */
                  videoView.center = CGPointMake(375/2.0, 667/2.0);
  
                  NSLog(@"*******  Native Window Called  ******** ");
  }
  </code></pre>
  
  <p>When I make a video call everything seems fine, I didn't find any issues in the logs. </p>
  
  <p>2018-11-01 11:16:11.980945+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.980          pjsua_media.c  .....Call 0: updating media..</p>
  
  <p>2018-11-01 11:16:11.981282+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.981          pjsua_media.c  .......Media stream call00:0 is destroyed</p>
  
  <p>2018-11-01 11:16:11.981801+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.981            pjsua_aud.c  ......Audio channel update..</p>
  
  <p>2018-11-01 11:16:11.982020+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.981        strm0x14c817228  .......VAD temporarily disabled</p>
  
  <p>2018-11-01 11:16:11.983647+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.983        strm0x14c817228  .......Encoder stream started</p>
  
  <p>2018-11-01 11:16:11.994218+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.994        strm0x14c817228  .......Decoder stream started</p>
  
  <p>2018-11-01 11:16:11.995006+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.994          pjsua_media.c  ......Audio updated, stream #0: PCMU (sendrecv)</p>
  
  <p>2018-11-01 11:16:11.995355+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.995          pjsua_media.c  .......Media stream call00:1 is destroyed</p>
  
  <p>2018-11-01 11:16:11.995506+0400 SwiftVoiceCallingApp[730:49599] 11:16:11.995            pjsua_vid.c  ......Video channel update..</p>
  
  <p>2018-11-01 11:16:12.021673+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.021      vstenc0x14c813e28  .......Encoder stream started</p>
  
  <p>2018-11-01 11:16:12.022508+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.022      vstdec0x14c813e28  .......Decoder stream started</p>
  
  <p>2018-11-01 11:16:12.023527+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.023            pjsua_vid.c  .......Setting up RX..</p>
  
  <p>2018-11-01 11:16:12.024107+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.024            pjsua_vid.c  ........Creating video window: type=stream, cap_id=-1, rend_id=0</p>
  
  <p>2018-11-01 11:16:12.024864+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.024             vid_port.c  .........Opening device OpenGL renderer [OpenGL] for render: format=I420, size=656x656 @22:1 fps</p>
  
  <p>2018-11-01 11:16:12.153215+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153       ios_opengl_dev.c  .........iOS OpenGL ES renderer successfully created</p>
  
  <p>2018-11-01 11:16:12.153426+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153             vid_port.c  .........Device OpenGL renderer [OpenGL] opened: format=BGRA, size=656x656 @22:1 fps</p>
  
  <p>2018-11-01 11:16:12.153551+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153            pjsua_vid.c  .........stream window id 0 created for cap_dev=-1 rend_dev=0</p>
  
  <p>2018-11-01 11:16:12.153590+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153            pjsua_vid.c  .........Window 0 created</p>
  
  <p>2018-11-01 11:16:12.153629+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153       ios_opengl_dev.c  ........Starting ios opengl stream</p>
  
  <p>2018-11-01 11:16:12.153758+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153            pjsua_vid.c  .......Setting up TX..</p>
  
  <p>2018-11-01 11:16:12.153805+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.153            pjsua_vid.c  ........Creating video window: type=preview, cap_id=2, rend_id=0</p>
  
  <p>2018-11-01 11:16:12.155163+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.155             vid_port.c  .........Opening device Front Camera [AVF] for capture: format=I420, size=352x288 @15:1 fps</p>
  
  <p>2018-11-01 11:16:12.175070+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.175             vid_port.c  .........Device Front Camera [AVF] opened: format=I420, size=352x288 @15:1 fps</p>
  
  <p>2018-11-01 11:16:12.179564+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.179           darwin_dev.m  .........Native preview initialized</p>
  
  <p>2018-11-01 11:16:12.179708+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.179            pjsua_vid.c  .........Preview window id 1 created for cap_dev 2, using built-in preview!</p>
  
  <p>2018-11-01 11:16:12.179743+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.179            pjsua_vid.c  .........Window 1 created</p>
  
  <p>2018-11-01 11:16:12.179818+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.179           darwin_dev.m  ........Starting Darwin video stream</p>
  
  <p>2018-11-01 11:16:12.560349+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.560          pjsua_media.c  ......Video updated, stream #1: H264 (sendrecv)</p>
  
  <p>2018-11-01 11:16:12.560565+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.560            pjsua_aud.c  .....Conf connect: 2 --> 0</p>
  
  <p>2018-11-01 11:16:12.560631+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.560           conference.c  ......Port 2 (sip:1001@192.168.100.57) transmitting to port 0 (iPhone IO device)</p>
  
  <p>2018-11-01 11:16:12.560680+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.560            pjsua_aud.c  .....Conf connect: 0 --> 2</p>
  
  <p>2018-11-01 11:16:12.560729+0400 SwiftVoiceCallingApp[730:49599] 11:16:12.560           conference.c  ......Port 0 (iPhone IO device) transmitting to port 2 (sip:1001@192.168.100.57)</p>
  
  <p>2018-11-01 11:16:12.560765+0400 SwiftVoiceCallingApp[730:49599] windows id : 0</p>
  
  <p>2018-11-01 11:16:12.560806+0400 SwiftVoiceCallingApp[730:49599] media id : 1</p>
  
  <p>2018-11-01 11:16:12.560841+0400 SwiftVoiceCallingApp[730:49599] 1. PJSUA_CALL_MEDIA_ACTIVE</p>
  
  <p>2018-11-01 11:16:12.594432+0400 SwiftVoiceCallingApp[730:49349] *******  Native Window Called  ******** </p>
  
  <p>After Hangup:</p>
  
  <p>2018-11-01 11:16:32.181814+0400 SwiftVoiceCallingApp[730:49599] Outgoing Call status Id is: 200</p>
  
  <p>2018-11-01 11:16:32.187486+0400 SwiftVoiceCallingApp[730:49599] 11:16:32.187          pjsua_media.c  ......Call 0: deinitializing media..</p>
  
  <p>2018-11-01 11:16:32.203479+0400 SwiftVoiceCallingApp[730:49599] 11:16:32.203          pjsua_media.c  ........Media stream call00:0 is destroyed</p>
  
  <p>2018-11-01 11:16:32.204868+0400 SwiftVoiceCallingApp[730:49599] 11:16:32.204            pjsua_vid.c  ........Stopping video stream..</p>
  
  <p>2018-11-01 11:16:32.232410+0400 SwiftVoiceCallingApp[730:49599] 11:16:32.232           darwin_dev.m  .........Stopping Darwin video stream</p>
  
  <p>However, I didn't find any video inside my UIView.  </p>
  
  <pre><code> UIView* videoView = (__bridge UIView *)wi.hwnd.info.ios.window;
  </code></pre>
  
  <p>I just added this videoView as a subview to my ViewController's view</p>
  
  <pre><code> self.view.addSubView:videoView
  </code></pre>
  
  <p>I feel above videoView already has Video stream. Am I missing anything else?</p>