问题
When I recieve incoming Video Call, my application got crashed.
Here is the code for Video Configuration:
acc_cfg.vid_in_auto_show = 1;
acc_cfg.vid_out_auto_transmit = 1;
acc_cfg.vid_wnd_flags = PJMEDIA_VID_DEV_WND_BORDER.rawValue | PJMEDIA_VID_DEV_WND_RESIZABLE.rawValue;
acc_cfg.vid_cap_dev = PJMEDIA_VID_DEFAULT_CAPTURE_DEV.rawValue;
acc_cfg.vid_rend_dev = PJMEDIA_VID_DEFAULT_RENDER_DEV.rawValue;
Here is the code I used when I accept the call:
call_opt.aud_cnt = 1;
call_opt.vid_cnt = self.isVideoPossible(callId: id)
print("video count", call_opt.vid_cnt)
pjsua_call_answer2(id, &call_opt, 200, nil, nil) // 200 PJSIP_SC_OK
I have gone thorugh the logs and found that camera opened and then suddenly my app got crashed.
19:05:14.563 pjsua_call.c !Answering call 0: code=200
19:05:14.563 sip_transport.c ..Tx data Response msg 180/INVITE/cseq=102 (tdta0x117146aa8) cloned
19:05:14.564 inv0x11614bea8 ..SDP negotiation done: Success
19:05:14.564 pjsua_call.c ...Call 0: remote NAT type is 0 (Unknown)
19:05:14.564 pjsua_media.c ...Call 0: updating media..
19:05:14.565 pjsua_media.c .....Media stream call00:0 is destroyed
19:05:14.565 pjsua_aud.c ....Audio channel update..
19:05:14.566 strm0x1171d4628 .....VAD temporarily disabled
19:05:14.574 rtp.c .....pjmedia_rtp_session_init: ses=0x116226318, default_pt=0, ssrc=0x271afe9c
19:05:14.574 rtp.c .....pjmedia_rtp_session_init: ses=0x1160f6010, default_pt=0, ssrc=0x271afe9c
19:05:14.576 stream.c .....Stream strm0x1171d4628 created
19:05:14.576 strm0x1171d4628 .....Encoder stream started
19:05:14.576 strm0x1171d4628 .....Decoder stream started
19:05:14.578 resample.c .....resample created: high qualiy, small filter, in/out rate=8000/16000
19:05:14.578 resample.c .....resample created: high qualiy, small filter, in/out rate=16000/8000
19:05:14.578 pjsua_media.c ....Audio updated, stream #0: PCMU (sendrecv)
19:05:14.580 pjsua_media.c .....Media stream call00:1 is destroyed
19:05:14.580 pjsua_vid.c ....Video channel update..
19:05:14.581 vid_toolbox.m .....Opening codec..
19:05:14.684 rtp.c .....pjmedia_rtp_session_init: ses=0x11622838c, default_pt=97, ssrc=0x5d41c7d2
19:05:14.685 vstdec0x116227c28 .....Decoding channel created 720x1280 I420<-H264 22/1(~22)fps
19:05:14.685 rtp.c .....pjmedia_rtp_session_init: ses=0x11622795c, default_pt=97, ssrc=0x5d41c7d2
19:05:14.685 vstenc0x116227c28 .....Encoding channel created 720x1280 I420->H264 15/1(~15)fps
19:05:14.688 vid_stream.c .....Video stream vstrm0x116227c28 created
19:05:14.688 vstenc0x116227c28 .....Encoder stream started
19:05:14.688 vstdec0x116227c28 .....Decoder stream started
19:05:14.688 pjsua_vid.c .....Setting up RX..
19:05:14.688 pjsua_vid.c ......Creating video window: type=stream, cap_id=-1, rend_id=0
19:05:14.688 vid_port.c .......Opening device OpenGL renderer [OpenGL] for render: format=I420, size=720x1280 @22:1 fps
19:05:15.568 ios_opengl_dev.c .......iOS OpenGL ES renderer successfully created
19:05:15.568 vid_port.c .......Device OpenGL renderer [OpenGL] opened: format=BGRA, size=720x1280 @22:1 fps
19:05:15.574 vid_conf.c .......Added port 0 (OpenGL renderer)
19:05:15.574 pjsua_vid.c .......stream window id 0 created for cap_dev=-1 rend_dev=0
19:05:15.574 pjsua_vid.c .......Window 0 created
19:05:15.576 vid_conf.c ......Added port 1 (vstdec0x116227c28)
19:05:15.576 vid_conf.c ......Updating render state for port id 0 (1 sources)..
19:05:15.576 vid_conf.c ......This port only has single source with matched format & size, no conversion needed
19:05:15.577 vid_conf.c ......Port 1 (vstdec0x116227c28) transmitting to port 0 (OpenGL renderer)
19:05:15.577 ios_opengl_dev.c ......Starting ios opengl stream
19:05:15.577 pjsua_vid.c .....Setting up TX..
19:05:15.580 vid_conf.c ......Added port 2 (vstenc0x116227c28)
19:05:15.580 pjsua_vid.c ......Creating video window: type=preview, cap_id=2, rend_id=0
19:05:15.580 vid_port.c .......Opening device Front Camera [AVF] for capture: format=I420, size=720x1280 @15:1 fps
19:05:15.650 vid_util.c .......Orientation converter created: 1280x720 to 720x408, maintain aspect ratio=yes
19:05:15.650 darwin_dev.m .......Video capture orientation set to 1
19:05:15.650 vid_port.c .......Device Front Camera [AVF] opened: format=I420, size=720x1280 @15:1 fps
Can anyone help me with this?
Thanks in advance!!
来源:https://stackoverflow.com/questions/57917496/ios-pjsip-incoming-video-call-crash