pjproject icon indicating copy to clipboard operation
pjproject copied to clipboard

[Question] Swift IOS PJMEDIA_TYPE_VIDEO not ACTIVE

Open YuZebra opened this issue 2 years ago • 0 comments

Describe the bug

I'm newbie for PJSIP and I wanted to implement PJSIP on IOS device.

I followed the issue #2764 and recompiled the library using openh264.

When I have a video call coming in, after picking it up.

Only the type of PJMEDIA_TYPE_AUDIO is active, PJMEDIA_TYPE_VIDEO is always none

Steps to reproduce

My config_site.h: #define PJ_CONFIG_IPHONE 1 #define PJMEDIA_HAS_VIDEO 1 #include <pj/config_site_sample.h>

And followed the issue #2764, copy all the library file to my project.

Make pjsua_acc_config var acc_cfg = pjsua_acc_config() pjsua_acc_config_default(&acc_cfg) acc_cfg.id = pj_str(id) acc_cfg.cred_count = 1; acc_cfg.cred_info.0.username = pj_str(username) acc_cfg.cred_info.0.realm = pj_str(realm) acc_cfg.cred_info.0.data = pj_str(passwd) acc_cfg.reg_uri = pj_str(registrar) acc_cfg.proxy_cnt = 1 acc_cfg.proxy.0 = pj_str(proxy) acc_cfg.vid_out_auto_transmit = pj_bool_t(PJ_TRUE.rawValue) acc_cfg.vid_in_auto_show = pj_bool_t(PJ_TRUE.rawValue) pjsua_acc_add(&acc_cfg, pj_bool_t(PJ_TRUE.rawValue), nil)

When I get a video call and answer it in CXAnswerCallAction

var call_setting = pjsua_call_setting() pjsua_call_setting_default(&call_setting) call_setting.aud_cnt = 1 call_setting.vid_cnt = 1 pjsua_call_answer2(pjsua_call_id(self.callId), &call_setting, 200, nil, nil)

And I check on_call_media_state var call_info = pjsua_call_info() pjsua_call_get_info(call_id, &call_info) if ((call_info.rem_offerer) != 0 && (call_info.rem_vid_cnt != 0)) { print("have video") }

And I check on_call_state is PJSIP_INV_STATE_CONFIRMED

But I print about this video call info, PJMEDIA_TYPE_VIDEO always none

PJSIP version

2.12

Context

Build on MacOS

Log, call stack, etc

15:37:23.251        coreaudio_dev.c  ..core audio initialized
15:37:23.253                  pjlib  ..select() I/O Queue created (0x10580be28)
15:37:23.258            pjsua_vid.c  ..Initializing video subsystem..
15:37:23.259           opengl_dev.c  ...OpenGL device initialized
15:37:23.293           darwin_dev.m  ...Darwin video initialized with 3 devices:
15:37:23.293           darwin_dev.m  ... 0: [Renderer] iOS - UIView
15:37:23.293           darwin_dev.m  ... 1: [Capturer] AVF - Front Camera
15:37:23.293           darwin_dev.m  ... 2: [Capturer] AVF - Back Camera
15:37:23.293         colorbar_dev.c  ...Colorbar video src initialized with 2 device(s):
15:37:23.293         colorbar_dev.c  ... 0: Colorbar generator
15:37:23.293         colorbar_dev.c  ... 1: Colorbar-active
15:37:23.294         sip_endpoint.c  .Module "mod-evsub" registered
15:37:23.294         sip_endpoint.c  .Module "mod-presence" registered
15:37:23.294         sip_endpoint.c  .Module "mod-mwi" registered
15:37:23.294         sip_endpoint.c  .Module "mod-refer" registered
15:37:23.294         sip_endpoint.c  .Module "mod-pjsua-pres" registered
15:37:23.294         sip_endpoint.c  .Module "mod-pjsua-im" registered
15:37:23.294         sip_endpoint.c  .Module "mod-pjsua-options" registered

---------------------------------------------------------------------------
When a video call comes in
15:39:25.648          pjsua_media.c  ..Call 0: initializing media..
15:39:25.649          pjsua_media.c  ...RTP socket reachable at 172.16.16.243:4000
15:39:25.649          pjsua_media.c  ...RTCP socket reachable at 172.16.16.243:4001
15:39:25.650          pjsua_media.c  ...RTP socket reachable at 172.16.16.243:4002
15:39:25.650          pjsua_media.c  ...RTCP socket reachable at 172.16.16.243:4003
15:39:25.650          pjsua_media.c  ...Media index 0 selected for audio call 0
15:39:25.650         udp0x102404cd0  ...UDP media transport created
15:39:25.650         udp0x102709c50  ...UDP media transport created
15:39:25.650          pjsua_media.c  ..Call 0 media 1: Disabled due to no active codec

YuZebra avatar Apr 21 '22 07:04 YuZebra