Skip to content

Commit

Permalink
v1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
“Edward.Wu” committed Apr 3, 2020
1 parent 9c113c2 commit b609dcd
Show file tree
Hide file tree
Showing 16 changed files with 396 additions and 44 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,6 @@ v1.4.4
1. OBS streaming compatible, OBS support the srt protocol which is later than v25.0.
(https://obsproject.com/forum/threads/obs-studio-25-0-release-candidate.116067/)


v1.4.5
------
1. add hls record feature.
146 changes: 146 additions & 0 deletions logs/error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
2020-04-03 11:34:29:893 SLS INFO: [0x7ff0aec029a0]CSLSManager::start, new m_list_role=0x7ff0aed00050.
2020-04-03 11:34:29:894 SLS INFO: [0x1102eb000]CSLSListener::start...
2020-04-03 11:34:29:894 SLS INFO: [0x1102eb000]CSLSListener::init_conf_app, m_back_log=100, m_idle_streams_timeout=10.
2020-04-03 11:34:29:894 SLS INFO: [0x1102eb000]CSLSListener::init_conf_app, add app push 'uplive.sls.com/live'.
2020-04-03 11:34:29:894 SLS INFO: [0x1102eb000]CSLSListener::init_conf_app, add app live='live.sls.com/live', app push='uplive.sls.com/live'.
2020-04-03 11:34:29:894 SLS INFO: [0x1102eb000]CSLSListener::init_conf_app, add app live='live-1.sls.com/live', app push='uplive.sls.com/live'.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0b0000000]CSLSSrt::libsrt_setup, fd=1048655853.
2020-04-03 11:34:29:895 SLS INFO: [0x1102eb000]CSLSListener::start, libsrt_setup ok.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0b0000000]CSLSSrt::libsrt_listen, ok, fd=1048655853, at port=8080.
2020-04-03 11:34:29:895 SLS INFO: [0x1102eb000]CSLSListener::start, m_list_role=0x7ff0aed00050.
2020-04-03 11:34:29:895 SLS INFO: [0x1102eb000]CSLSListener::start, push to m_list_role=0x7ff0aed00050.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0aec029a0]CSLSManager::start, init listeners, count=1.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0af01c800]CSLSGroup::start, worker_number=0.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0af01c800]CSLSEpollThread::work, begin th_id=0.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0af01c800]CSLSThread::start, pthread_create ok, m_th_id=123145466294272.
2020-04-03 11:34:29:895 SLS INFO: [0x7ff0aec029a0]CSLSManager::start, init worker, count=1.
2020-04-03 11:34:29:906 SLS INFO: [0x1102eb000]CSLSRole::add_to_epoll, listener, sock=1048655853, m_is_write=0, ret=0.
2020-04-03 11:34:29:906 SLS INFO: [0x7ff0af01c800]CSLSGroup::check_new_role, worker_number=0, listener=0x1102eb000, add_to_epoll fd=1048655853, role_map.size=1.
2020-04-03 11:34:39:071 SLS INFO: [0x7ff0b0000000]CSLSSrt::libsrt_accept ok, new sock=1048655852, 127.0.0.1:50576.
2020-04-03 11:34:39:071 SLS INFO: [0x1102eb000]CSLSListener::handler, new client[127.0.0.1:50576], fd=1048655852.
2020-04-03 11:34:39:071 SLS INFO: [0x1102eb000]CSLSListener::handler, [127.0.0.1:50576], sid 'uplive.sls.com/live/test123'
2020-04-03 11:34:39:071 SLS INFO: [0x1102eb000]CSLSListener::handler, new pub=0x1103a2000, key_stream_name=uplive.sls.com/live/test123.
2020-04-03 11:34:39:071 SLS INFO: [0x7ff0aed00478]CSLSMapData::add ok, key='uplive.sls.com/live/test123'.
2020-04-03 11:34:39:071 SLS INFO: [0x7ff0aed00588]CSLSMapPublisher::set_push_2_pushlisher, ok, publisher=0x1103a2000, app_streamname=uplive.sls.com/live/test123, m_map_push_2_pushlisher.size()=1.
2020-04-03 11:34:39:071 SLS INFO: [0x1102eb000]CSLSListener::handler, new publisher[127.0.0.1:50576], key_stream_name=uplive.sls.com/live/test123.
2020-04-03 11:34:39:071 SLS INFO: [0x7ff0aed007c8]CSLSMapRelay::add_relay_manager, no relay conf info, app_uplive=uplive.sls.com/live, stream_name=test123.
2020-04-03 11:34:39:071 SLS INFO: [0x1102eb000]CSLSListener::handler, m_map_pusher->add_relay_manager failed, new role[127.0.0.1:50576], key_stream_name=uplive.sls.com/live/test123.
2020-04-03 11:34:39:071 SLS INFO: [0x1103a2000]CSLSRole::add_to_epoll, publisher, sock=1048655852, m_is_write=0, ret=0.
2020-04-03 11:34:39:071 SLS INFO: [0x7ff0af01c800]CSLSGroup::check_new_role, worker_number=0, publisher=0x1103a2000, add_to_epoll fd=1048655852, role_map.size=2.
2020-04-03 11:34:45:923 SLS ERROR: CSLSSrt::libsrt_neterrno, err=2001, Connection was broken.
2020-04-03 11:34:45:923 SLS WARNING: [0x7ff0af034000]CSLSSrt::libsrt_read failed, sock=1048655852, ret=-1, err_no=2001.
2020-04-03 11:34:45:923 SLS ERROR: [0x1103a2000]CSLSRole::handler_read_data, libsrt_read failure, n=-1.
2020-04-03 11:34:45:923 SLS INFO: [0x1103a2000]CSLSRole::invalid_srt, close sock=1048655852, m_state=1.
2020-04-03 11:34:45:923 SLS INFO: [0x7ff0af034000]CSLSSrt::libsrt_close, fd=1048655852.
2020-04-03 11:34:45:923 SLS ERROR: [0x1103a2000]CSLSRole::handler_read_data, m_srt is null.
2020-04-03 11:34:45:923 SLS INFO: [0x1103a2000]CSLSRole::get_state, get_sock_state, ret=-16777216, call invalid_srt.
2020-04-03 11:34:45:923 SLS INFO: [0x7ff0af01c800]CSLSGroup::check_invalid_sock, worker_number=0, publisher=0x1103a2000, invalid sock=0, state=2, role_map.size=2.
2020-04-03 11:34:45:923 SLS INFO: [0x7ff0aed00478]CSLSMapData::remove, key='uplive.sls.com/live/test123' delete array_data=0x7ff0aec04410.
2020-04-03 11:34:45:923 SLS INFO: [0x1103a2000]CSLSPublisher::uninit, removed publisher from m_map_data, ret=0.
2020-04-03 11:34:45:923 SLS INFO: [0x7ff0aed00588]CSLSMapPublisher::remove, publisher=0x1103a2000, live_key=uplive.sls.com/live/test123.
2020-04-03 11:34:45:923 SLS INFO: [0x1103a2000]CSLSPublisher::uninit, removed publisher from m_map_publisher, ret=0.
2020-04-03 11:34:45:923 SLS INFO: [0x7ff0af01c800]CSLSGroup::check_invalid_sock, worker_number=0, publisher=0x1103a2000, delete.
2020-04-03 11:34:46:650 SLS INFO: exit, stop srt live server...
2020-04-03 11:34:46:650 SLS INFO: [0x7ff0aec029a0]CSLSManager::stop.
2020-04-03 11:34:46:651 SLS INFO: [0x1102eb000]CSLSListener::stop.
2020-04-03 11:34:46:651 SLS INFO: [0x1102eb000]CSLSRole::remove_from_epoll, listener, sock=1048655853, ret=0.
2020-04-03 11:34:46:651 SLS INFO: [0x1102eb000]CSLSRole::invalid_srt, close sock=1048655853, m_state=0.
2020-04-03 11:34:46:651 SLS INFO: [0x7ff0b0000000]CSLSSrt::libsrt_close, fd=1048655853.
2020-04-03 11:34:46:651 SLS INFO: [0x7ff0af01c800]CSLSGroup::stop, worker_number=0.
2020-04-03 11:34:46:651 SLS INFO: [0x7ff0af01c800]CSLSThread::stop, m_th_id=123145466294272.
2020-04-03 11:34:46:653 SLS INFO: [0x1102eb000]CSLSRole::get_state, get_sock_state, ret=-16777216, call invalid_srt.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSGroup::check_invalid_sock, worker_number=0, listener=0x1102eb000, invalid sock=0, state=2, role_map.size=1.
2020-04-03 11:34:46:653 SLS INFO: [0x1102eb000]CSLSListener::stop.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSGroup::check_invalid_sock, worker_number=0, listener=0x1102eb000, delete.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSGroup::clear, worker_number=0, role_map.size=0.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSEpollThread::work, end th_id=123145466294272.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSGroup::clear, worker_number=0, role_map.size=0.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSGroup::stop, m_list_wait_http_role.clear, worker_number=0.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0af01c800]CSLSEpollThread::work, srt_epoll_release ok, m_th_id=0.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0aed00588]CSLSMapPublisher::clear.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0aed006b8]CSLSMapRelay::clear.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0aed007c8]CSLSMapRelay::clear.
2020-04-03 11:34:46:653 SLS INFO: [0x7ff0aec029a0]CSLSManager::stop, release rolelist, size=0.
2020-04-03 11:34:46:653 SLS INFO: exit, release sls_manager ok.
2020-04-03 11:34:46:653 SLS INFO: exit, release reload_manager_list begin,count=0.
2020-04-03 11:34:46:653 SLS INFO: exit, release reload_manager_list ok.
2020-04-03 11:34:46:653 SLS INFO: exit, release http_stat_client.
2020-04-03 11:34:46:653 SLS INFO: exit, uninit srt .
2020-04-03 11:34:46:662 SLS INFO: exit, close conf.
2020-04-03 11:35:10:910 SLS INFO: [0x7ff47e5001a0]CSLSManager::start, new m_list_role=0x7ff47e700220.
2020-04-03 11:35:10:910 SLS INFO: [0x106d5f000]CSLSListener::start...
2020-04-03 11:35:10:910 SLS INFO: [0x106d5f000]CSLSListener::init_conf_app, m_back_log=100, m_idle_streams_timeout=10.
2020-04-03 11:35:10:910 SLS INFO: [0x106d5f000]CSLSListener::init_conf_app, add app push 'uplive.sls.com/live'.
2020-04-03 11:35:10:910 SLS INFO: [0x106d5f000]CSLSListener::init_conf_app, add app live='live.sls.com/live', app push='uplive.sls.com/live'.
2020-04-03 11:35:10:910 SLS INFO: [0x106d5f000]CSLSListener::init_conf_app, add app live='live-1.sls.com/live', app push='uplive.sls.com/live'.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e81c800]CSLSSrt::libsrt_setup, fd=115487778.
2020-04-03 11:35:10:911 SLS INFO: [0x106d5f000]CSLSListener::start, libsrt_setup ok.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e81c800]CSLSSrt::libsrt_listen, ok, fd=115487778, at port=8080.
2020-04-03 11:35:10:911 SLS INFO: [0x106d5f000]CSLSListener::start, m_list_role=0x7ff47e700220.
2020-04-03 11:35:10:911 SLS INFO: [0x106d5f000]CSLSListener::start, push to m_list_role=0x7ff47e700220.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e5001a0]CSLSManager::start, init listeners, count=1.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e824200]CSLSGroup::start, worker_number=0.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e824200]CSLSThread::start, pthread_create ok, m_th_id=123145556434944.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e5001a0]CSLSManager::start, init worker, count=1.
2020-04-03 11:35:10:911 SLS INFO: [0x7ff47e824200]CSLSEpollThread::work, begin th_id=123145556434944.
2020-04-03 11:35:10:923 SLS INFO: [0x106d5f000]CSLSRole::add_to_epoll, listener, sock=115487778, m_is_write=0, ret=0.
2020-04-03 11:35:10:923 SLS INFO: [0x7ff47e824200]CSLSGroup::check_new_role, worker_number=0, listener=0x106d5f000, add_to_epoll fd=115487778, role_map.size=1.
2020-04-03 11:35:14:516 SLS INFO: [0x7ff47e81c800]CSLSSrt::libsrt_accept ok, new sock=115487777, 127.0.0.1:53232.
2020-04-03 11:35:14:516 SLS INFO: [0x106d5f000]CSLSListener::handler, new client[127.0.0.1:53232], fd=115487777.
2020-04-03 11:35:14:516 SLS INFO: [0x106d5f000]CSLSListener::handler, [127.0.0.1:53232], sid 'uplive.sls.com/live/test123'
2020-04-03 11:35:14:516 SLS INFO: [0x106d5f000]CSLSListener::handler, new pub=0x106e16000, key_stream_name=uplive.sls.com/live/test123.
2020-04-03 11:35:14:516 SLS INFO: [0x7ff47e500478]CSLSMapData::add ok, key='uplive.sls.com/live/test123'.
2020-04-03 11:35:14:516 SLS INFO: [0x7ff47e500588]CSLSMapPublisher::set_push_2_pushlisher, ok, publisher=0x106e16000, app_streamname=uplive.sls.com/live/test123, m_map_push_2_pushlisher.size()=1.
2020-04-03 11:35:14:516 SLS INFO: [0x106d5f000]CSLSListener::handler, new publisher[127.0.0.1:53232], key_stream_name=uplive.sls.com/live/test123.
2020-04-03 11:35:14:516 SLS INFO: [0x7ff47e700118]CSLSMapRelay::add_relay_manager, no relay conf info, app_uplive=uplive.sls.com/live, stream_name=test123.
2020-04-03 11:35:14:516 SLS INFO: [0x106d5f000]CSLSListener::handler, m_map_pusher->add_relay_manager failed, new role[127.0.0.1:53232], key_stream_name=uplive.sls.com/live/test123.
2020-04-03 11:35:14:516 SLS INFO: [0x106e16000]CSLSRole::add_to_epoll, publisher, sock=115487777, m_is_write=0, ret=0.
2020-04-03 11:35:14:516 SLS INFO: [0x7ff47e824200]CSLSGroup::check_new_role, worker_number=0, publisher=0x106e16000, add_to_epoll fd=115487777, role_map.size=2.
2020-04-03 11:35:14:550 SLS INFO: [0x106e16000]CSLSRole::check_hls_file, '/tmp/mov/sls/8080/uplive.sls.com/live/test123' exist.

2020-04-03 11:35:14:552 SLS INFO: [0x106e16000]CSLSRole::check_hls_file, create ts file='/tmp/mov/sls/8080/uplive.sls.com/live/test123/1585884914.ts', fd=6.
2020-04-03 11:35:24:562 SLS INFO: [0x106e16000]CSLSRole::check_hls_file, '/tmp/mov/sls/8080/uplive.sls.com/live/test123' exist.

2020-04-03 11:35:24:562 SLS INFO: [0x106e16000]CSLSRole::check_hls_file, close ts file='1585884914.ts', fd=6.
2020-04-03 11:35:24:564 SLS INFO: [0x106e16000]CSLSRole::check_hls_file, create vod file='/tmp/mov/sls/8080/uplive.sls.com/live/test123/vod-1585884924.m3u8.extinfo', fd=6.
2020-04-03 11:35:24:564 SLS INFO: [0x106e16000]CSLSRole::check_hls_file, create ts file='/tmp/mov/sls/8080/uplive.sls.com/live/test123/1585884924.ts', fd=7.
2020-04-03 11:35:27:786 SLS INFO: [0x106e16000]CSLSRole::get_state, get_sock_state, ret=6, call invalid_srt.
2020-04-03 11:35:27:786 SLS ERROR: CSLSSrt::libsrt_neterrno, err=6003, Non-blocking call failure: transmission timed out.
2020-04-03 11:35:27:786 SLS INFO: [0x106e16000]CSLSRole::invalid_srt, close sock=115487777, m_state=2.
2020-04-03 11:35:27:786 SLS INFO: [0x7ff47e826400]CSLSSrt::libsrt_close, fd=115487777.
2020-04-03 11:35:27:786 SLS INFO: [0x7ff47e824200]CSLSGroup::check_invalid_sock, worker_number=0, publisher=0x106e16000, invalid sock=0, state=2, role_map.size=2.
2020-04-03 11:35:27:786 SLS INFO: [0x7ff47e500478]CSLSMapData::remove, key='uplive.sls.com/live/test123' delete array_data=0x7ff47e403aa0.
2020-04-03 11:35:27:786 SLS INFO: [0x106e16000]CSLSPublisher::uninit, removed publisher from m_map_data, ret=0.
2020-04-03 11:35:27:786 SLS INFO: [0x7ff47e500588]CSLSMapPublisher::remove, publisher=0x106e16000, live_key=uplive.sls.com/live/test123.
2020-04-03 11:35:27:786 SLS INFO: [0x106e16000]CSLSPublisher::uninit, removed publisher from m_map_publisher, ret=0.
2020-04-03 11:35:27:786 SLS INFO: [0x106e16000]CSLSRole::close_hls_file, close ts file='1585884924.ts', fd=7.
2020-04-03 11:35:27:787 SLS INFO: [0x106e16000]CSLSRole::close_hls_file, prepare open '/tmp/mov/sls/8080/uplive.sls.com/live/test123/vod-1585884924.m3u8.extinfo', fd=6.
2020-04-03 11:35:27:788 SLS INFO: [0x106e16000]CSLSRole::close_hls_file, read data len=30, fd=6.
2020-04-03 11:35:27:788 SLS INFO: [0x7ff47e824200]CSLSGroup::check_invalid_sock, worker_number=0, publisher=0x106e16000, delete.
2020-04-03 11:36:00:156 SLS INFO: exit, stop srt live server...
2020-04-03 11:36:00:156 SLS INFO: [0x7ff47e5001a0]CSLSManager::stop.
2020-04-03 11:36:00:156 SLS INFO: [0x106d5f000]CSLSListener::stop.
2020-04-03 11:36:00:156 SLS INFO: [0x106d5f000]CSLSRole::remove_from_epoll, listener, sock=115487778, ret=0.
2020-04-03 11:36:00:156 SLS INFO: [0x106d5f000]CSLSRole::invalid_srt, close sock=115487778, m_state=0.
2020-04-03 11:36:00:156 SLS INFO: [0x7ff47e81c800]CSLSSrt::libsrt_close, fd=115487778.
2020-04-03 11:36:00:156 SLS INFO: [0x7ff47e824200]CSLSGroup::stop, worker_number=0.
2020-04-03 11:36:00:156 SLS INFO: [0x7ff47e824200]CSLSThread::stop, m_th_id=123145556434944.
2020-04-03 11:36:00:158 SLS INFO: [0x106d5f000]CSLSRole::get_state, get_sock_state, ret=-16777216, call invalid_srt.
2020-04-03 11:36:00:158 SLS INFO: [0x7ff47e824200]CSLSGroup::check_invalid_sock, worker_number=0, listener=0x106d5f000, invalid sock=0, state=2, role_map.size=1.
2020-04-03 11:36:00:158 SLS INFO: [0x106d5f000]CSLSListener::stop.
2020-04-03 11:36:00:158 SLS INFO: [0x7ff47e824200]CSLSGroup::check_invalid_sock, worker_number=0, listener=0x106d5f000, delete.
2020-04-03 11:36:00:158 SLS INFO: [0x7ff47e824200]CSLSGroup::clear, worker_number=0, role_map.size=0.
2020-04-03 11:36:00:158 SLS INFO: [0x7ff47e824200]CSLSEpollThread::work, end th_id=123145556434944.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e824200]CSLSGroup::clear, worker_number=0, role_map.size=0.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e824200]CSLSGroup::stop, m_list_wait_http_role.clear, worker_number=0.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e824200]CSLSEpollThread::work, srt_epoll_release ok, m_th_id=0.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e500588]CSLSMapPublisher::clear.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e700008]CSLSMapRelay::clear.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e700118]CSLSMapRelay::clear.
2020-04-03 11:36:00:159 SLS INFO: [0x7ff47e5001a0]CSLSManager::stop, release rolelist, size=0.
2020-04-03 11:36:00:159 SLS INFO: exit, release sls_manager ok.
2020-04-03 11:36:00:159 SLS INFO: exit, release reload_manager_list begin,count=0.
2020-04-03 11:36:00:159 SLS INFO: exit, release reload_manager_list ok.
2020-04-03 11:36:00:159 SLS INFO: exit, release http_stat_client.
2020-04-03 11:36:00:160 SLS INFO: exit, uninit srt .
2020-04-03 11:36:00:170 SLS INFO: exit, close conf.
11 changes: 9 additions & 2 deletions sls.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
srt { #SRT
srt { #SRT
worker_threads 1;
worker_connections 300 ;

Expand All @@ -7,7 +7,10 @@ srt { #SRT

#stat_post_url http://192.168.31.106:8001/sls/stat;
#stat_post_interval 5;#s


record_hls_path_prefix /tmp/mov/sls;
#vod file name: /tmp/mov/sls/$listen/$domain_publisher/$app_publisher/$stream_name/vod.m3u8

server {
listen 8080;
latency 20; #ms
Expand All @@ -20,6 +23,10 @@ srt { #SRT
app {
app_player live ;
app_publisher live ;

record_hls off;#on, off
record_hls_segment_duration 10; #unit s

#relay {
# type pull;
# mode loop;#loop; hash;
Expand Down
14 changes: 13 additions & 1 deletion slscore/SLSListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ CSLSListener::CSLSListener()
m_idle_streams_timeout_role = 0;
m_stat_info = std::string("");
memset(m_http_url_role, 0, URL_MAX_LEN);
memset(m_record_hls_path_prefix, 0, URL_MAX_LEN);

sprintf(m_role_name, "listener");
}
Expand Down Expand Up @@ -137,6 +138,13 @@ void CSLSListener::set_map_pusher(CSLSMapRelay *map_pusher)
m_map_pusher = map_pusher;
}

void CSLSListener::set_record_hls_path_prefix(char *path)
{
if (path != NULL && strlen(path) > 0) {
strcpy(m_record_hls_path_prefix, path);
}
}

int CSLSListener::init_conf_app()
{
string strLive;
Expand Down Expand Up @@ -288,7 +296,7 @@ int CSLSListener::start()
if (latency > 0) {
ret = m_srt->libsrt_setsockopt(SRTO_LATENCY, "SRTO_LATENCY", &latency, sizeof (latency));
if (SLS_OK != ret) {
sls_log(SLS_LOG_INFO, "[%p]CSLSListener::start, libsrt_setsockopt failure.", this);
sls_log(SLS_LOG_INFO, "[%p]CSLSListener::start, libsrt_setsockopt latency=%d failure.", this, latency);
return ret;
}
}
Expand Down Expand Up @@ -502,6 +510,10 @@ int CSLSListener::handler()
std::string stat_info = std::string(tmp);
pub->set_stat_info_base(stat_info);
pub->set_http_url(m_http_url_role);
//set hls record path
sprintf(tmp, "%s/%d/%s",
m_record_hls_path_prefix, m_port, key_stream_name);
pub->set_record_hls_path(tmp);

sls_log(SLS_LOG_INFO, "[%p]CSLSListener::handler, new pub=%p, key_stream_name=%s.",
this, pub, key_stream_name);
Expand Down
2 changes: 2 additions & 0 deletions slscore/SLSListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public :
void set_map_publisher(CSLSMapPublisher * publisher);
void set_map_puller(CSLSMapRelay *map_puller);
void set_map_pusher(CSLSMapRelay *map_puller);
void set_record_hls_path_prefix(char *path);

virtual std::string get_stat_info();

Expand All @@ -100,6 +101,7 @@ public :
int m_idle_streams_timeout_role;
std::string m_stat_info;
char m_http_url_role[URL_MAX_LEN];
char m_record_hls_path_prefix[URL_MAX_LEN];

int init_conf_app();

Expand Down
2 changes: 2 additions & 0 deletions slscore/SLSManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ CSLSManager::CSLSManager()
m_map_publisher = NULL;
m_map_puller = NULL;
m_map_pusher = NULL;

}

CSLSManager::~CSLSManager()
Expand Down Expand Up @@ -101,6 +102,7 @@ int CSLSManager::start()
CSLSListener * p = new CSLSListener();//deleted by groups
p->set_role_list(m_list_role);
p->set_conf(conf);
p->set_record_hls_path_prefix(conf_srt->record_hls_path_prefix);
p->set_map_data("", &m_map_data[i]);
p->set_map_publisher(&m_map_publisher[i]);
p->set_map_puller(&m_map_puller[i]);
Expand Down
Loading

0 comments on commit b609dcd

Please sign in to comment.