mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge service to protocol
This commit is contained in:
parent
f86706e0a2
commit
95f656b46d
17 changed files with 21 additions and 35 deletions
14
README.md
14
README.md
|
@ -1090,14 +1090,12 @@ SRS always use the simplest architecture to solve complex domain problems.
|
|||
## Modularity Architecture
|
||||
|
||||
```
|
||||
+----------------+-------------------------------------+
|
||||
| SRS/SRT server | Programs in Main or Research |
|
||||
+----------------+--+------------+---------------------+
|
||||
| App(For SRS) | Modules(1) | research/librtmp |
|
||||
+-------------------+------------+---------------------+
|
||||
| Service(C/S apps over ST) | srs-librtmp |
|
||||
+--------------------------------+---------------------+
|
||||
| Protocol Stack(RTMP/HTTP/RTSP/JSON/AMF/Format) |
|
||||
+--------------------+---------------------------------+
|
||||
| SRS/SRT server | Programs in Main |
|
||||
+--------------------+-------+-------------------------+
|
||||
| App(For SRS) | Modules(1) |
|
||||
+----------------------------+-------------------------+
|
||||
| Protocol Stack(RTMP/HTTP/RTSP/JSON/AMF/Service) |
|
||||
+------------------------------------------------------+
|
||||
| Kernel(File, Codec, Stream, LB services) |
|
||||
+------------------------------------------------------+
|
||||
|
|
|
@ -80,8 +80,9 @@ for item in ${MODULE_FILES[*]}; do
|
|||
if [ -f ${CPP_FILE} ]; then
|
||||
echo "${OBJ_FILE}: \$(${DEPS_NAME}) ${CPP_FILE} " >> ${FILE}
|
||||
echo " \$(CXX) -c \$(CXXFLAGS) ${DEFINES}\\" >> ${FILE}
|
||||
echo " \$(${INCS_NAME})\\" >> ${FILE}
|
||||
echo " -o ${OBJ_FILE} ${CPP_FILE}" >> ${FILE}
|
||||
echo " \$(${INCS_NAME})\\" >> ${FILE}
|
||||
echo " -o ${OBJ_FILE} \\" >> ${FILE}
|
||||
echo " ${CPP_FILE}" >> ${FILE}
|
||||
fi
|
||||
done
|
||||
echo "" >> ${FILE}
|
||||
|
|
37
trunk/configure
vendored
37
trunk/configure
vendored
|
@ -211,13 +211,15 @@ KERNEL_OBJS="${MODULE_OBJS[@]}"
|
|||
#RTMP/HTTP/Raw Protocol, depends on core/kernel, provides rtmp/htttp protocol features.
|
||||
MODULE_ID="PROTOCOL"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL")
|
||||
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
|
||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibSSLRoot})
|
||||
MODULE_FILES=("srs_protocol_amf0" "srs_protocol_io" "srs_rtmp_stack"
|
||||
"srs_rtmp_handshake" "srs_protocol_utility" "srs_rtmp_msg_array" "srs_protocol_stream"
|
||||
"srs_raw_avc" "srs_rtsp_stack" "srs_sip_stack" "srs_http_stack" "srs_protocol_kbps" "srs_protocol_json"
|
||||
"srs_protocol_format")
|
||||
"srs_protocol_format" "srs_service_log" "srs_service_st" "srs_service_http_client" "srs_service_http_conn"
|
||||
"srs_service_rtmp_conn" "srs_service_utility" "srs_service_conn")
|
||||
if [[ $SRS_RTC == YES ]]; then
|
||||
MODULE_FILES+=("srs_rtc_stun_stack")
|
||||
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
||||
fi
|
||||
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
|
||||
PROTOCOL_OBJS="${MODULE_OBJS[@]}"
|
||||
|
@ -225,32 +227,17 @@ PROTOCOL_OBJS="${MODULE_OBJS[@]}"
|
|||
#srt protocol features.
|
||||
if [ $SRS_SRT = YES ]; then
|
||||
MODULE_ID="SRT"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE" "APP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
||||
ModuleLibIncs=(${SRS_OBJS_DIR})
|
||||
MODULE_FILES=("srt_server" "srt_handle" "srt_conn" "srt_to_rtmp" "ts_demux" "srt_data")
|
||||
SRT_INCS=${LibSRTRoot}; MODULE_DIR=${LibSRTRoot} . auto/modules.sh
|
||||
SRT_OBJS="${MODULE_OBJS[@]}"
|
||||
fi
|
||||
|
||||
#
|
||||
#Service Module, for both Server and Client Modules.
|
||||
# TODO: FIXME: Remove service module, https://github.com/ossrs/srs/issues/1535#issuecomment-633907655
|
||||
MODULE_ID="SERVICE"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibSSLRoot})
|
||||
if [[ $SRS_RTC == YES ]]; then
|
||||
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
||||
fi
|
||||
MODULE_FILES=("srs_service_log" "srs_service_st" "srs_service_http_client"
|
||||
"srs_service_http_conn" "srs_service_rtmp_conn" "srs_service_utility"
|
||||
"srs_service_conn")
|
||||
DEFINES=""
|
||||
SERVICE_INCS="src/service"; MODULE_DIR=${SERVICE_INCS} . auto/modules.sh
|
||||
SERVICE_OBJS="${MODULE_OBJS[@]}"
|
||||
#
|
||||
#App Module, for SRS server only.
|
||||
MODULE_ID="APP"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibSSLRoot} ${LibGperfRoot})
|
||||
if [[ $SRS_RTC == YES ]]; then
|
||||
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
||||
|
@ -285,7 +272,7 @@ APP_OBJS="${MODULE_OBJS[@]}"
|
|||
#
|
||||
#Server Module, for SRS only.
|
||||
MODULE_ID="SERVER"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE" "APP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
||||
if [[ $SRS_SRT == YES ]]; then
|
||||
MODULE_DEPENDS+=("SRT")
|
||||
fi
|
||||
|
@ -302,7 +289,7 @@ SERVER_OBJS="${MODULE_OBJS[@]}"
|
|||
#
|
||||
#Main Module, for app from modules.
|
||||
MODULE_ID="MAIN"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot})
|
||||
if [[ $SRS_RTC == YES ]]; then
|
||||
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
||||
|
@ -338,7 +325,7 @@ if [[ $SRS_SRT == YES ]]; then
|
|||
ModuleLibFiles+=("${LibSRTfile[*]}")
|
||||
fi
|
||||
# all depends objects
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${SERVER_OBJS[@]}"
|
||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot})
|
||||
if [[ $SRS_RTC == YES ]]; then
|
||||
ModuleLibIncs+=("${LibFfmpegRoot[*]}" ${LibSrtpRoot})
|
||||
|
@ -352,7 +339,7 @@ LINK_OPTIONS="${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}"
|
|||
BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh
|
||||
#
|
||||
# For modules, without the app module.
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${MAIN_OBJS[@]}"
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}"
|
||||
ModuleLibFiles=(${LibSTfile} ${LibSSLfile} ${LibGperfFile})
|
||||
if [[ $SRS_RTC == YES ]]; then
|
||||
ModuleLibFiles+=("${LibFfmpegFile[*]}" ${LibSrtpFile})
|
||||
|
@ -389,11 +376,11 @@ if [ $SRS_UTEST = YES ]; then
|
|||
if [[ $SRS_SRT == YES ]]; then
|
||||
ModuleLibFiles+=("${LibSRTfile[*]}")
|
||||
fi
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE" "APP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
||||
if [[ $SRS_SRT == YES ]]; then
|
||||
MODULE_DEPENDS+=("SRT")
|
||||
fi
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${SERVICE_OBJS[@]} ${APP_OBJS[@]} ${SRT_OBJS[@]}"
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${APP_OBJS[@]} ${SRT_OBJS[@]}"
|
||||
LINK_OPTIONS="-lpthread ${SrsLinkOptions}" MODULE_DIR="src/utest" APP_NAME="srs_utest" . auto/utest.sh
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue