mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge branch 'develop' into min
This commit is contained in:
commit
3bcac375fb
11 changed files with 89 additions and 33 deletions
|
|
@ -329,7 +329,7 @@ fi
|
|||
# Affected users should upgrade to OpenSSL 1.1.0e. Users unable to immediately
|
||||
# upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS.
|
||||
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then
|
||||
OPENSSL_HOTFIX="-DOPENSSL_NO_HEARTBEATS"
|
||||
OPENSSL_OPTIONS="-no-shared -no-threads -no-asm -DOPENSSL_NO_HEARTBEATS"
|
||||
OPENSSL_CONFIG="./config"
|
||||
# https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain
|
||||
if [[ $SRS_CROSS_BUILD == YES ]]; then
|
||||
|
|
@ -351,7 +351,7 @@ if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then
|
|||
(
|
||||
rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} &&
|
||||
unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e &&
|
||||
${OPENSSL_CONFIG} --prefix=`pwd`/_release -no-shared -no-threads -no-asm $OPENSSL_HOTFIX &&
|
||||
${OPENSSL_CONFIG} --prefix=`pwd`/_release $OPENSSL_OPTIONS &&
|
||||
make CC=${SRS_TOOL_CC} AR="${SRS_TOOL_AR} -rs" LD=${SRS_TOOL_LD} RANDLIB=${SRS_TOOL_RANDLIB} && make install_sw &&
|
||||
cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl
|
||||
)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ SRS_FFMPEG_STUB=NO
|
|||
SRS_PREFIX=/usr/local/srs
|
||||
SRS_JOBS=1
|
||||
SRS_STATIC=NO
|
||||
# If enabled, link shared libraries for libst.so which uses MPL license.
|
||||
SRS_SHARED_ST=NO
|
||||
# If enabled, link shared libraries for libsrt.so which uses MPL license.
|
||||
SRS_SHARED_SRT=NO
|
||||
# whether enable the gcov
|
||||
SRS_GCOV=NO
|
||||
# whether enable the log verbose/info/trace level.
|
||||
|
|
@ -183,6 +187,8 @@ Conflicts:
|
|||
|
||||
Experts:
|
||||
--use-sys-ssl Do not compile ssl, use system ssl(-lssl) if required.
|
||||
--use-shared-st Use link shared libraries for ST which uses MPL license.
|
||||
--use-shared-srt Use link shared libraries for SRT which uses MPL license.
|
||||
--export-librtmp-project=<path> Export srs-librtmp to specified project in path.
|
||||
--export-librtmp-single=<path> Export srs-librtmp to a single file(.h+.cpp) in path.
|
||||
|
||||
|
|
@ -272,6 +278,9 @@ function parse_user_option() {
|
|||
--full) SRS_ENABLE_ALL=YES ;;
|
||||
|
||||
--use-sys-ssl) SRS_USE_SYS_SSL=YES ;;
|
||||
--use-shared-st) SRS_SHARED_ST=YES ;;
|
||||
--use-shared-srt) SRS_SHARED_SRT=YES ;;
|
||||
|
||||
--memory-watch) SRS_MEM_WATCH=YES ;;
|
||||
--export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;;
|
||||
--export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;;
|
||||
|
|
@ -535,6 +544,8 @@ function regenerate_options() {
|
|||
if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi
|
||||
if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi
|
||||
if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
|
||||
if [ $SRS_SHARED_ST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --use-shared-st"; fi
|
||||
if [ $SRS_SHARED_SRT = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --use-shared-srt"; fi
|
||||
if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi
|
||||
if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi
|
||||
if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi
|
||||
|
|
|
|||
|
|
@ -167,7 +167,11 @@ echo "" >> ${FILE}
|
|||
echo "# link all depends libraries" >> ${FILE}
|
||||
echo -n "DEPS_LIBRARIES_FILES = " >> ${FILE}
|
||||
for item in ${ModuleLibFiles[*]}; do
|
||||
echo -n "${SRS_TRUNK_PREFIX}/${item} " >> ${FILE}
|
||||
if [[ -f ${item} ]]; then
|
||||
echo -n "${SRS_TRUNK_PREFIX}/${item} " >> ${FILE}
|
||||
else
|
||||
echo -n "${item} " >> ${FILE}
|
||||
fi
|
||||
done
|
||||
echo "" >> ${FILE}; echo "" >> ${FILE}
|
||||
#
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ stream_caster {
|
|||
# the caster type of stream, the casters:
|
||||
# mpegts_over_udp, MPEG-TS over UDP caster.
|
||||
# rtsp, Real Time Streaming Protocol (RTSP).
|
||||
# flv, FLV over HTTP POST.
|
||||
# flv, FLV over HTTP by POST.
|
||||
caster mpegts_over_udp;
|
||||
# the output rtmp url.
|
||||
# for mpegts_over_udp caster, the typically output url:
|
||||
|
|
|
|||
2
trunk/configure
vendored
2
trunk/configure
vendored
|
|
@ -147,6 +147,7 @@ END
|
|||
#
|
||||
# st(state-threads) the basic network library for SRS.
|
||||
LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a"
|
||||
if [[ $SRS_SHARED_ST == YES ]]; then LibSTfile="-lst"; fi
|
||||
# openssl-1.1.0e, for the RTMP complex handshake.
|
||||
LibSSLRoot="";LibSSLfile=""
|
||||
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == NO ]]; then
|
||||
|
|
@ -163,6 +164,7 @@ fi
|
|||
# srt code path
|
||||
if [[ $SRS_SRT == YES ]]; then
|
||||
LibSRTRoot="${SRS_WORKDIR}/src/srt"; LibSRTfile="${SRS_OBJS_DIR}/srt/lib/libsrt.a"
|
||||
if [[ $SRS_SHARED_SRT == YES ]]; then LibSRTfile="-lsrt"; fi
|
||||
fi
|
||||
# the link options, always use static link
|
||||
SrsLinkOptions="-ldl";
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@
|
|||
1. [ICE, rfc5245-2010-ice.pdf](http://github.com/ossrs/srs/wiki/doc/rfc5245-2010-ice.pdf): https://tools.ietf.org/html/rfc5245
|
||||
1. [SIP, rfc3261-2002-sip.pdf](http://github.com/ossrs/srs/wiki/doc/rfc3261-2002-sip.pdf): https://tools.ietf.org/html/rfc3261
|
||||
|
||||
## SRT
|
||||
|
||||
1. [Haivision_SRT_Open_Source_White_Paper.pdf](http://github.com/ossrs/srs/wiki/doc/Haivision_SRT_Open_Source_White_Paper.pdf)
|
||||
1. [SRT_Alliance_Deployment_Guide.pdf](http://github.com/ossrs/srs/wiki/doc/SRT_Alliance_Deployment_Guide.pdf)
|
||||
1. [SRT_Protocol_TechnicalOverview_DRAFT_2018-10-17.pdf](http://github.com/ossrs/srs/wiki/doc/SRT_Protocol_TechnicalOverview_DRAFT_2018-10-17.pdf)
|
||||
|
||||
## Others
|
||||
|
||||
1. [kafka-160915-0553-82964.pdf](http://github.com/ossrs/srs/wiki/doc/kafka-160915-0553-82964.pdf), https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol
|
||||
|
|
|
|||
|
|
@ -751,11 +751,9 @@ srs_error_t SrsHlsMuxer::_refresh_m3u8(string m3u8_file)
|
|||
|
||||
// #EXTM3U\n
|
||||
// #EXT-X-VERSION:3\n
|
||||
// #EXT-X-ALLOW-CACHE:YES\n
|
||||
std::stringstream ss;
|
||||
ss << "#EXTM3U" << SRS_CONSTS_LF
|
||||
<< "#EXT-X-VERSION:3" << SRS_CONSTS_LF
|
||||
<< "#EXT-X-ALLOW-CACHE:YES" << SRS_CONSTS_LF;
|
||||
ss << "#EXTM3U" << SRS_CONSTS_LF;
|
||||
ss << "#EXT-X-VERSION:3" << SRS_CONSTS_LF;
|
||||
|
||||
// #EXT-X-MEDIA-SEQUENCE:4294967295\n
|
||||
SrsHlsSegment* first = dynamic_cast<SrsHlsSegment*>(segments->first());
|
||||
|
|
|
|||
|
|
@ -903,6 +903,11 @@ srs_error_t SrsOriginHub::cycle()
|
|||
return err;
|
||||
}
|
||||
|
||||
bool SrsOriginHub::active()
|
||||
{
|
||||
return is_active;
|
||||
}
|
||||
|
||||
srs_error_t SrsOriginHub::on_meta_data(SrsSharedPtrMessage* shared_metadata, SrsOnMetaDataPacket* packet)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
|
@ -1047,6 +1052,12 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se
|
|||
srs_avc_level2str(c->avc_level).c_str(), c->width, c->height,
|
||||
c->video_data_rate / 1000, c->frame_rate, c->duration);
|
||||
}
|
||||
|
||||
// Ignore video data when no sps/pps
|
||||
// @bug https://github.com/ossrs/srs/issues/703#issuecomment-578393155
|
||||
if (format->vcodec && !format->vcodec->is_avc_codec_ok()) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if ((err = hls->on_video(msg, format)) != srs_success) {
|
||||
// apply the error strategy for hls.
|
||||
|
|
@ -2452,10 +2463,10 @@ srs_error_t SrsSource::create_consumer(SrsConnection* conn, SrsConsumer*& consum
|
|||
|
||||
consumer = new SrsConsumer(this, conn);
|
||||
consumers.push_back(consumer);
|
||||
|
||||
|
||||
srs_utime_t queue_size = _srs_config->get_queue_length(req->vhost);
|
||||
consumer->set_queue_size(queue_size);
|
||||
|
||||
|
||||
// if atc, update the sequence header to gop cache time.
|
||||
if (atc && !gop_cache->empty()) {
|
||||
if (meta->data()) {
|
||||
|
|
@ -2468,22 +2479,25 @@ srs_error_t SrsSource::create_consumer(SrsConnection* conn, SrsConsumer*& consum
|
|||
meta->ash()->timestamp = srsu2ms(gop_cache->start_time());
|
||||
}
|
||||
}
|
||||
|
||||
// Copy metadata and sequence header to consumer.
|
||||
if ((err = meta->dumps(consumer, atc, jitter_algorithm, dm, ds)) != srs_success) {
|
||||
return srs_error_wrap(err, "meta dumps");
|
||||
|
||||
// If stream is publishing, dumps the sequence header and gop cache.
|
||||
if (hub->active()) {
|
||||
// Copy metadata and sequence header to consumer.
|
||||
if ((err = meta->dumps(consumer, atc, jitter_algorithm, dm, ds)) != srs_success) {
|
||||
return srs_error_wrap(err, "meta dumps");
|
||||
}
|
||||
|
||||
// copy gop cache to client.
|
||||
if (dg && (err = gop_cache->dump(consumer, atc, jitter_algorithm)) != srs_success) {
|
||||
return srs_error_wrap(err, "gop cache dumps");
|
||||
}
|
||||
}
|
||||
|
||||
// copy gop cache to client.
|
||||
if (dg && (err = gop_cache->dump(consumer, atc, jitter_algorithm)) != srs_success) {
|
||||
return srs_error_wrap(err, "gop cache dumps");
|
||||
}
|
||||
|
||||
|
||||
// print status.
|
||||
if (dg) {
|
||||
srs_trace("create consumer, queue_size=%.2f, jitter=%d", queue_size, jitter_algorithm);
|
||||
srs_trace("create consumer, active=%d, queue_size=%.2f, jitter=%d", hub->active(), queue_size, jitter_algorithm);
|
||||
} else {
|
||||
srs_trace("create consumer, ignore gop cache, jitter=%d", jitter_algorithm);
|
||||
srs_trace("create consumer, active=%d, ignore gop cache, jitter=%d", hub->active(), jitter_algorithm);
|
||||
}
|
||||
|
||||
// for edge, when play edge stream, check the state
|
||||
|
|
|
|||
|
|
@ -330,7 +330,6 @@ class SrsOriginHub : public ISrsReloadHandler
|
|||
private:
|
||||
SrsSource* source;
|
||||
SrsRequest* req;
|
||||
// Whether the stream hub is active, or stream is publishing.
|
||||
bool is_active;
|
||||
private:
|
||||
// The format, codec information.
|
||||
|
|
@ -364,6 +363,8 @@ public:
|
|||
// Cycle the hub, process some regular events,
|
||||
// For example, dispose hls in cycle.
|
||||
virtual srs_error_t cycle();
|
||||
// Whether the stream hub is active, or stream is publishing.
|
||||
virtual bool active();
|
||||
public:
|
||||
// When got a parsed metadata.
|
||||
virtual srs_error_t on_meta_data(SrsSharedPtrMessage* shared_metadata, SrsOnMetaDataPacket* packet);
|
||||
|
|
@ -376,7 +377,7 @@ public:
|
|||
virtual srs_error_t on_publish();
|
||||
// When stop publish stream.
|
||||
virtual void on_unpublish();
|
||||
// Internal callback.
|
||||
// Internal callback.
|
||||
public:
|
||||
// For the SrsForwarder to callback to request the sequence headers.
|
||||
virtual srs_error_t on_forwarder_start(SrsForwarder* forwarder);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
// The version config.
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 1
|
||||
#define VERSION_REVISION 2
|
||||
|
||||
// The macros generated by configure script.
|
||||
#include <srs_auto_headers.hpp>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue