1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine configure, add cubieboard. use IProtocolStatistic in kbps.

This commit is contained in:
winlin 2014-06-19 11:22:24 +08:00
parent 46c1367fe8
commit 46611ac062
3 changed files with 41 additions and 10 deletions

View file

@ -62,6 +62,8 @@ SRS_MIPS_UBUNTU12=NO
SRS_DEV=NO SRS_DEV=NO
# raspberry-pi, open hls/ssl/static # raspberry-pi, open hls/ssl/static
SRS_PI=NO SRS_PI=NO
# cubieboard, donot open ffmpeg/nginx.
SRS_CUBIE=NO
# the most fast compile, nothing, only support vp6 RTMP. # the most fast compile, nothing, only support vp6 RTMP.
SRS_FAST=NO SRS_FAST=NO
# only support RTMP with ssl. # only support RTMP with ssl.
@ -141,8 +143,9 @@ Options:
Presets: Presets:
--x86-x64 [default] for x86/x64 cpu, common pc and servers. --x86-x64 [default] for x86/x64 cpu, common pc and servers.
--pi for raspberry-pi(directly build), open features hls/ssl/static. --pi for raspberry-pi(directly build), open features hls/ssl/static.
--arm alias for --with-arm-ubuntu12 --cubie for cubieboard(directly build), open features except ffmpeg/nginx.
--mips alias for --with-mips-ubuntu12 --arm alias for --with-arm-ubuntu12, for ubuntu12, arm crossbuild
--mips alias for --with-mips-ubuntu12, for ubuntu12, mips crossbuild
--fast the most fast compile, nothing, only support vp6 RTMP. --fast the most fast compile, nothing, only support vp6 RTMP.
--pure-rtmp only support RTMP with ssl. --pure-rtmp only support RTMP with ssl.
--rtmp-hls only support RTMP+HLS with ssl. --rtmp-hls only support RTMP+HLS with ssl.
@ -227,6 +230,7 @@ function parse_user_option() {
--arm) SRS_ARM_UBUNTU12=YES ;; --arm) SRS_ARM_UBUNTU12=YES ;;
--mips) SRS_MIPS_UBUNTU12=YES ;; --mips) SRS_MIPS_UBUNTU12=YES ;;
--pi) SRS_PI=YES ;; --pi) SRS_PI=YES ;;
--cubie) SRS_CUBIE=YES ;;
--dev) SRS_DEV=YES ;; --dev) SRS_DEV=YES ;;
--fast) SRS_FAST=YES ;; --fast) SRS_FAST=YES ;;
--disable-all) SRS_DISABLE_ALL=YES ;; --disable-all) SRS_DISABLE_ALL=YES ;;
@ -281,6 +285,7 @@ function apply_user_presets() {
if [ $SRS_ARM_UBUNTU12 = NO ]; then if [ $SRS_ARM_UBUNTU12 = NO ]; then
if [ $SRS_MIPS_UBUNTU12 = NO ]; then if [ $SRS_MIPS_UBUNTU12 = NO ]; then
if [ $SRS_PI = NO ]; then if [ $SRS_PI = NO ]; then
if [ $SRS_CUBIE = NO ]; then
if [ $SRS_X86_X64 = NO ]; then if [ $SRS_X86_X64 = NO ]; then
SRS_X86_X64=YES; opt="--x86-x64 $opt"; SRS_X86_X64=YES; opt="--x86-x64 $opt";
fi fi
@ -293,6 +298,7 @@ function apply_user_presets() {
fi fi
fi fi
fi fi
fi
# whether embeded cpu. # whether embeded cpu.
if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_ARM_UBUNTU12 = YES ]; then
@ -552,6 +558,31 @@ function apply_user_presets() {
SRS_GPROF=NO SRS_GPROF=NO
SRS_STATIC=NO SRS_STATIC=NO
fi fi
# if cubieboard specified, open features except ffmpeg/nginx.
if [ $SRS_CUBIE = YES ]; then
SRS_HLS=YES
SRS_DVR=YES
SRS_NGINX=NO
SRS_SSL=YES
SRS_FFMPEG_TOOL=YES
SRS_TRANSCODE=YES
SRS_INGEST=YES
SRS_HTTP_PARSER=YES
SRS_HTTP_CALLBACK=YES
SRS_HTTP_SERVER=YES
SRS_HTTP_API=YES
SRS_LIBRTMP=YES
SRS_BWTC=NO
SRS_RESEARCH=NO
SRS_UTEST=NO
SRS_GPERF=NO
SRS_GPERF_MC=NO
SRS_GPERF_MP=NO
SRS_GPERF_CP=NO
SRS_GPROF=NO
SRS_STATIC=NO
fi
} }
apply_user_presets apply_user_presets

View file

@ -106,7 +106,7 @@ SrsKbps::~SrsKbps()
{ {
} }
void SrsKbps::set_io(ISrsProtocolReader* in, ISrsProtocolWriter* out) void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
{ {
// set input stream // set input stream
// now, set start time. // now, set start time.

View file

@ -30,8 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp> #include <srs_core.hpp>
class ISrsProtocolReader; class ISrsProtocolStatistic;
class ISrsProtocolWriter; class ISrsProtocolStatistic;
/** /**
* a kbps sample, for example, 1minute kbps, * a kbps sample, for example, 1minute kbps,
@ -65,8 +65,8 @@ class SrsKbpsSlice
{ {
private: private:
union slice_io { union slice_io {
ISrsProtocolReader* in; ISrsProtocolStatistic* in;
ISrsProtocolWriter* out; ISrsProtocolStatistic* out;
}; };
public: public:
slice_io io; slice_io io;
@ -121,7 +121,7 @@ public:
* @param out the output stream statistic. can be NULL. * @param out the output stream statistic. can be NULL.
* @remark if in/out is NULL, use the cached data for kbps. * @remark if in/out is NULL, use the cached data for kbps.
*/ */
virtual void set_io(ISrsProtocolReader* in, ISrsProtocolWriter* out); virtual void set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out);
public: public:
/** /**
* get total kbps, duration is from the startup of io. * get total kbps, duration is from the startup of io.