Skip to content

Commit

Permalink
Squash: Support CLion
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jul 17, 2021
1 parent 12ba584 commit 97c627f
Show file tree
Hide file tree
Showing 22 changed files with 135 additions and 2,322 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ on:
# The branches below must be a subset of the branches above
branches: [ 4.0release, develop ]
schedule:
- cron: '43 11 * * 0'
# '20 19 * * 6' means 'At 19:20, only on Saturday' @see https://crontab.cronhub.io/
- cron: '20 19 * * 6'

jobs:
analyze:
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
.idea
.DS_Store

/cmake-build-debug/
/CMakeLists.txt
cmake-build-debug
/trunk/ide/srs_clion/CMakeCache.txt
/trunk/ide/srs_clion/CMakeFiles
/trunk/ide/srs_clion/Makefile
/trunk/ide/srs_clion/cmake_install.cmake
/trunk/ide/srs_clion/srs
/trunk/ide/srs_clion/Testing/
7 changes: 7 additions & 0 deletions .run/srs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="srs" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c conf/clion.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ The changelog for SRS.

## SRS 4.0 Changelog

* v4.0, 2021-07-17, Fix bugs and enhance code. 4.0.142
* v4.0, 2021-07-16, Support [CLion and cmake](https://github.com/ossrs/srs/wiki/v4_CN_IDE#clion) to build and debug SRS. 4.0.141
* v4.0, 2021-07-08, For [#2403](https://github.com/ossrs/srs/issues/2403), fix padding packets for RTMP2RTC. 4.0.140
* v4.0, 2021-07-04, For [#2424](https://github.com/ossrs/srs/issues/2424), use srandom/random to generate. 4.0.139
* v4.0, 2021-07-01, Merge [#2452](https://github.com/ossrs/srs/pull/2452), fix FFmpeg bug by updating channel_layout. 4.0.138
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Other API used by [ossrs.net](https://ossrs.net):
* `/service/v1/` The latest available version API.
* `/ws-service/v1/` The latest available version API, by websocket.
* `/im-service/v1/` The latest available version API, by IM.
* `/code-service/v1/` The latest available version API, by Code verification.

## Features

Expand Down
1 change: 0 additions & 1 deletion trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ bug
/research/thread-model/thread-local
*.gcp
*.svg

41 changes: 41 additions & 0 deletions trunk/conf/clion.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;

http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}

http_api {
enabled on;
listen 1985;
}
stats {
network 0;
}
rtc_server {
enabled on;
# Listen at udp://8000
listen 8000;
#
# The $CANDIDATE means fetch from env, if not configed, use * as default.
#
# The * means retrieving server IP automatically, from all network interfaces,
# @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
candidate $CANDIDATE;
}

vhost __defaultVhost__ {
rtc {
enabled on;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}

5 changes: 0 additions & 5 deletions trunk/ide/readme.txt

This file was deleted.

95 changes: 56 additions & 39 deletions trunk/ide/srs_clion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,66 @@
cmake_minimum_required(VERSION 2.6.4)
cmake_minimum_required(VERSION 2.8.12)
project(srs CXX)

INCLUDE_DIRECTORIES(../../objs
../../objs/st
../../objs/hp
../../objs/openssl/include
../../src/core
../../src/kernel
../../src/protocol
../../src/app
../../src/service
../../objs/srtp2/include
../../objs/opus/include
../../objs/ffmpeg/include)

set(SOURCE_FILES ../../src/main/srs_main_server.cpp)
AUX_SOURCE_DIRECTORY(../../src/core SOURCE_FILES)
AUX_SOURCE_DIRECTORY(../../src/kernel SOURCE_FILES)
AUX_SOURCE_DIRECTORY(../../src/protocol SOURCE_FILES)
AUX_SOURCE_DIRECTORY(../../src/app SOURCE_FILES)
AUX_SOURCE_DIRECTORY(../../src/service SOURCE_FILES)
###########################################################
execute_process(
COMMAND bash -c "cd ${PROJECT_SOURCE_DIR}/../../ && pwd"
OUTPUT_VARIABLE SRS_DIR
)
string(STRIP ${SRS_DIR} SRS_DIR)
message("SRS home is ${SRS_DIR}")

###########################################################
# Start to configure SRS with jobs of number of CPUs.
include(ProcessorCount)
ProcessorCount(JOBS)

set(DEPS_LIBS ${SRS_DIR}/objs/st/libst.a
${SRS_DIR}/objs/openssl/lib/libssl.a
${SRS_DIR}/objs/openssl/lib/libcrypto.a
${SRS_DIR}/objs/srtp2/lib/libsrtp2.a
${SRS_DIR}/objs/opus/lib/libopus.a
${SRS_DIR}/objs/ffmpeg/lib/libavutil.a
${SRS_DIR}/objs/ffmpeg/lib/libavcodec.a
${SRS_DIR}/objs/ffmpeg/lib/libswresample.a)
foreach(DEPS_LIB ${DEPS_LIBS})
IF (NOT EXISTS ${DEPS_LIB})
MESSAGE("${DEPS_LIB} not found")
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
EXEC_PROGRAM("cd ${SRS_DIR} && ./configure --osx --jobs=${JOBS}")
ELSE ()
EXEC_PROGRAM("cd ${SRS_DIR} && ./configure --jobs=${JOBS}")
ENDIF ()
ELSE ()
MESSAGE("${DEPS_LIB} is ok")
ENDIF ()
endforeach()

###########################################################
# Setup SRS project
INCLUDE_DIRECTORIES(${SRS_DIR}/objs
${SRS_DIR}/objs/st
${SRS_DIR}/objs/openssl/include
${SRS_DIR}/objs/srtp2/include
${SRS_DIR}/objs/opus/include
${SRS_DIR}/objs/ffmpeg/include
${SRS_DIR}/src/core
${SRS_DIR}/src/kernel
${SRS_DIR}/src/protocol
${SRS_DIR}/src/app
${SRS_DIR}/src/service)

set(SOURCE_FILES ${SRS_DIR}/src/main/srs_main_server.cpp)
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/core SOURCE_FILES)
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/kernel SOURCE_FILES)
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/protocol SOURCE_FILES)
AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/app SOURCE_FILES)

ADD_DEFINITIONS("-g -O0")

ADD_EXECUTABLE(srs ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(srs dl)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/st/libst.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/openssl/lib/libssl.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/openssl/lib/libcrypto.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/srtp2/lib/libsrtp2.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/opus/lib/libopus.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/ffmpeg/lib/libavutil.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/ffmpeg/lib/libavcodec.a)
TARGET_LINK_LIBRARIES(srs ${PROJECT_SOURCE_DIR}/../../objs/ffmpeg/lib/libswresample.a)
TARGET_LINK_LIBRARIES(srs ${DEPS_LIBS})
TARGET_LINK_LIBRARIES(srs -ldl)

IF (NOT EXISTS ${PROJECT_SOURCE_DIR}/../../objs/st/libst.a)
MESSAGE("srs_libs not found")
EXEC_PROGRAM("cd .. && ./configure")
ELSE (NOT EXISTS ${PROJECT_SOURCE_DIR}/../../objs/st/libst.a)
MESSAGE("srs_libs is ok")
ENDIF (NOT EXISTS ${PROJECT_SOURCE_DIR}/../../objs/st/libst.a)

MESSAGE(STATUS "only for jetbrains IDE, @see https://github.com/ossrs/srs/wiki/v1_CN_IDE#jetbrains")
MESSAGE(STATUS "only for jetbrains IDE, @see https://github.com/ossrs/srs/wiki/v1_CN_IDE#jetbrains")
MESSAGE(STATUS "only for jetbrains IDE, @see https://github.com/ossrs/srs/wiki/v1_CN_IDE#jetbrains")
MESSAGE(STATUS "use ./configure && make, @see https://github.com/ossrs/srs#usage")
MESSAGE(STATUS "@see https://github.com/ossrs/srs/wiki/v4_CN_IDE")

35 changes: 0 additions & 35 deletions trunk/ide/srs_qt/srs-qt.pro

This file was deleted.

Loading

0 comments on commit 97c627f

Please sign in to comment.