視頻會議訂閱問題:
- 除了video_floor_holder成員能read到視頻,其他成員都不能。
- 視頻會議訂閱模式那邊,
conference_thread_run函數(shù)中第一個for循環(huán)獲取每一個成員視頻包有問題,其中只有當(dāng)前是vid_floor的成員才能從session中read到數(shù)據(jù)(switch_core_session_read_video_frame函數(shù))。其他所有成員都read不到任何數(shù)據(jù)。 - 具體read執(zhí)行,是轉(zhuǎn)到了
switch_core_media.c中的switch_core_media_read_frame函數(shù),
除video_floor_holder外的成員會執(zhí)行到第1800行:
switch_media_handle_t *smh = session->media_handle;
switch_rtp_engine_t *engine = &smh->engines[type];
if (engine->read_mutex[type] && switch_mutex_trylock(engine->read_mutex[type])
!= SWITCH_STATUS_SUCCESS) {
/* return CNG, another thread is already reading. */
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
SWITCH_LOG_DEBUG1,"%s is already being read for %s\n",
switch_channel_get_name(session->channel), type2str(type));
return SWITCH_STATUS_INUSE;
}
然后就退出了函數(shù)。
而video_floor_holder成員會跳過這個if判斷,接著往后面執(zhí)行,進入一個while循環(huán)才能具體地接收數(shù)據(jù)。