正在显示
4 个修改的文件
包含
39 行增加
和
19 行删除
| @@ -678,6 +678,13 @@ else | @@ -678,6 +678,13 @@ else | ||
| 678 | echo "#undef SRS_AUTO_INGEST" >> $SRS_AUTO_HEADERS_H | 678 | echo "#undef SRS_AUTO_INGEST" >> $SRS_AUTO_HEADERS_H |
| 679 | fi | 679 | fi |
| 680 | 680 | ||
| 681 | +# for statistic. | ||
| 682 | +if [ $SRS_STAT = YES ]; then | ||
| 683 | + echo "#define SRS_AUTO_STAT" >> $SRS_AUTO_HEADERS_H | ||
| 684 | +else | ||
| 685 | + echo "#undef SRS_AUTO_STAT" >> $SRS_AUTO_HEADERS_H | ||
| 686 | +fi | ||
| 687 | + | ||
| 681 | ##################################################################################### | 688 | ##################################################################################### |
| 682 | # build research code, librtmp | 689 | # build research code, librtmp |
| 683 | ##################################################################################### | 690 | ##################################################################################### |
| @@ -808,17 +815,6 @@ echo "#define SRS_AUTO_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H | @@ -808,17 +815,6 @@ echo "#define SRS_AUTO_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H | ||
| 808 | 815 | ||
| 809 | echo "" >> $SRS_AUTO_HEADERS_H | 816 | echo "" >> $SRS_AUTO_HEADERS_H |
| 810 | 817 | ||
| 811 | -# os specified | ||
| 812 | -echo "" >> $SRS_AUTO_HEADERS_H | ||
| 813 | - | ||
| 814 | -if [ $SRS_OSX = YES ]; then | ||
| 815 | - echo "#define SRS_AUTO_OSX" >> $SRS_AUTO_HEADERS_H | ||
| 816 | -else | ||
| 817 | - echo "#undef SRS_AUTO_OSX" >> $SRS_AUTO_HEADERS_H | ||
| 818 | -fi | ||
| 819 | - | ||
| 820 | -echo "" >> $SRS_AUTO_HEADERS_H | ||
| 821 | - | ||
| 822 | ##################################################################################### | 818 | ##################################################################################### |
| 823 | # generated the contributors from AUTHORS.txt | 819 | # generated the contributors from AUTHORS.txt |
| 824 | ##################################################################################### | 820 | ##################################################################################### |
| @@ -22,6 +22,7 @@ SRS_SSL=RESERVED | @@ -22,6 +22,7 @@ SRS_SSL=RESERVED | ||
| 22 | SRS_FFMPEG_TOOL=RESERVED | 22 | SRS_FFMPEG_TOOL=RESERVED |
| 23 | SRS_TRANSCODE=RESERVED | 23 | SRS_TRANSCODE=RESERVED |
| 24 | SRS_INGEST=RESERVED | 24 | SRS_INGEST=RESERVED |
| 25 | +SRS_STAT=RESERVED | ||
| 25 | SRS_HTTP_CALLBACK=RESERVED | 26 | SRS_HTTP_CALLBACK=RESERVED |
| 26 | SRS_HTTP_SERVER=RESERVED | 27 | SRS_HTTP_SERVER=RESERVED |
| 27 | SRS_HTTP_API=RESERVED | 28 | SRS_HTTP_API=RESERVED |
| @@ -118,6 +119,7 @@ Options: | @@ -118,6 +119,7 @@ Options: | ||
| 118 | user must specifies the transcode tools in conf. | 119 | user must specifies the transcode tools in conf. |
| 119 | --with-ingest enable ingest features. | 120 | --with-ingest enable ingest features. |
| 120 | user must specifies the ingest tools in conf. | 121 | user must specifies the ingest tools in conf. |
| 122 | + --with-stat enable the data statistic, for http api. | ||
| 121 | --with-librtmp enable srs-librtmp, library for client. | 123 | --with-librtmp enable srs-librtmp, library for client. |
| 122 | --with-bwtc enable SRS bandwidth test client tool. | 124 | --with-bwtc enable SRS bandwidth test client tool. |
| 123 | --with-research build the research tools. | 125 | --with-research build the research tools. |
| @@ -139,6 +141,7 @@ Options: | @@ -139,6 +141,7 @@ Options: | ||
| 139 | --without-ffmpeg disable the ffmpeg transcode tool feature. | 141 | --without-ffmpeg disable the ffmpeg transcode tool feature. |
| 140 | --without-transcode disable the transcoding feature. | 142 | --without-transcode disable the transcoding feature. |
| 141 | --without-ingest disable the ingest feature. | 143 | --without-ingest disable the ingest feature. |
| 144 | + --without-stat disable the data statistic feature. | ||
| 142 | --without-librtmp disable srs-librtmp, library for client. | 145 | --without-librtmp disable srs-librtmp, library for client. |
| 143 | --without-bwtc disable SRS bandwidth test client tool. | 146 | --without-bwtc disable SRS bandwidth test client tool. |
| 144 | --without-research do not build the research tools. | 147 | --without-research do not build the research tools. |
| @@ -203,9 +206,10 @@ function parse_user_option() { | @@ -203,9 +206,10 @@ function parse_user_option() { | ||
| 203 | --with-hls) SRS_HLS=YES ;; | 206 | --with-hls) SRS_HLS=YES ;; |
| 204 | --with-dvr) SRS_DVR=YES ;; | 207 | --with-dvr) SRS_DVR=YES ;; |
| 205 | --with-nginx) SRS_NGINX=YES ;; | 208 | --with-nginx) SRS_NGINX=YES ;; |
| 206 | - --with-ffmpeg) SRS_FFMPEG_TOOL=YES ;; | 209 | + --with-ffmpeg) SRS_FFMPEG_TOOL=YES ;; |
| 207 | --with-transcode) SRS_TRANSCODE=YES ;; | 210 | --with-transcode) SRS_TRANSCODE=YES ;; |
| 208 | --with-ingest) SRS_INGEST=YES ;; | 211 | --with-ingest) SRS_INGEST=YES ;; |
| 212 | + --with-stat) SRS_STAT=YES ;; | ||
| 209 | --with-http-callback) SRS_HTTP_CALLBACK=YES ;; | 213 | --with-http-callback) SRS_HTTP_CALLBACK=YES ;; |
| 210 | --with-http-server) SRS_HTTP_SERVER=YES ;; | 214 | --with-http-server) SRS_HTTP_SERVER=YES ;; |
| 211 | --with-http-api) SRS_HTTP_API=YES ;; | 215 | --with-http-api) SRS_HTTP_API=YES ;; |
| @@ -224,9 +228,10 @@ function parse_user_option() { | @@ -224,9 +228,10 @@ function parse_user_option() { | ||
| 224 | --without-hls) SRS_HLS=NO ;; | 228 | --without-hls) SRS_HLS=NO ;; |
| 225 | --without-dvr) SRS_DVR=NO ;; | 229 | --without-dvr) SRS_DVR=NO ;; |
| 226 | --without-nginx) SRS_NGINX=NO ;; | 230 | --without-nginx) SRS_NGINX=NO ;; |
| 227 | - --without-ffmpeg) SRS_FFMPEG_TOOL=NO ;; | 231 | + --without-ffmpeg) SRS_FFMPEG_TOOL=NO ;; |
| 228 | --without-transcode) SRS_TRANSCODE=NO ;; | 232 | --without-transcode) SRS_TRANSCODE=NO ;; |
| 229 | --without-ingest) SRS_INGEST=NO ;; | 233 | --without-ingest) SRS_INGEST=NO ;; |
| 234 | + --without-stat) SRS_STAT=NO ;; | ||
| 230 | --without-http-callback) SRS_HTTP_CALLBACK=NO ;; | 235 | --without-http-callback) SRS_HTTP_CALLBACK=NO ;; |
| 231 | --without-http-server) SRS_HTTP_SERVER=NO ;; | 236 | --without-http-server) SRS_HTTP_SERVER=NO ;; |
| 232 | --without-http-api) SRS_HTTP_API=NO ;; | 237 | --without-http-api) SRS_HTTP_API=NO ;; |
| @@ -353,6 +358,7 @@ function apply_user_presets() { | @@ -353,6 +358,7 @@ function apply_user_presets() { | ||
| 353 | SRS_FFMPEG_TOOL=NO | 358 | SRS_FFMPEG_TOOL=NO |
| 354 | SRS_TRANSCODE=NO | 359 | SRS_TRANSCODE=NO |
| 355 | SRS_INGEST=NO | 360 | SRS_INGEST=NO |
| 361 | + SRS_STAT=NO | ||
| 356 | SRS_HTTP_PARSER=NO | 362 | SRS_HTTP_PARSER=NO |
| 357 | SRS_HTTP_CALLBACK=NO | 363 | SRS_HTTP_CALLBACK=NO |
| 358 | SRS_HTTP_SERVER=NO | 364 | SRS_HTTP_SERVER=NO |
| @@ -377,6 +383,7 @@ function apply_user_presets() { | @@ -377,6 +383,7 @@ function apply_user_presets() { | ||
| 377 | SRS_FFMPEG_TOOL=YES | 383 | SRS_FFMPEG_TOOL=YES |
| 378 | SRS_TRANSCODE=YES | 384 | SRS_TRANSCODE=YES |
| 379 | SRS_INGEST=YES | 385 | SRS_INGEST=YES |
| 386 | + SRS_STAT=YES | ||
| 380 | SRS_HTTP_PARSER=YES | 387 | SRS_HTTP_PARSER=YES |
| 381 | SRS_HTTP_CALLBACK=YES | 388 | SRS_HTTP_CALLBACK=YES |
| 382 | SRS_HTTP_SERVER=YES | 389 | SRS_HTTP_SERVER=YES |
| @@ -401,6 +408,7 @@ function apply_user_presets() { | @@ -401,6 +408,7 @@ function apply_user_presets() { | ||
| 401 | SRS_FFMPEG_TOOL=NO | 408 | SRS_FFMPEG_TOOL=NO |
| 402 | SRS_TRANSCODE=NO | 409 | SRS_TRANSCODE=NO |
| 403 | SRS_INGEST=NO | 410 | SRS_INGEST=NO |
| 411 | + SRS_STAT=NO | ||
| 404 | SRS_HTTP_PARSER=NO | 412 | SRS_HTTP_PARSER=NO |
| 405 | SRS_HTTP_CALLBACK=NO | 413 | SRS_HTTP_CALLBACK=NO |
| 406 | SRS_HTTP_SERVER=NO | 414 | SRS_HTTP_SERVER=NO |
| @@ -425,6 +433,7 @@ function apply_user_presets() { | @@ -425,6 +433,7 @@ function apply_user_presets() { | ||
| 425 | SRS_FFMPEG_TOOL=NO | 433 | SRS_FFMPEG_TOOL=NO |
| 426 | SRS_TRANSCODE=NO | 434 | SRS_TRANSCODE=NO |
| 427 | SRS_INGEST=NO | 435 | SRS_INGEST=NO |
| 436 | + SRS_STAT=NO | ||
| 428 | SRS_HTTP_PARSER=NO | 437 | SRS_HTTP_PARSER=NO |
| 429 | SRS_HTTP_CALLBACK=NO | 438 | SRS_HTTP_CALLBACK=NO |
| 430 | SRS_HTTP_SERVER=NO | 439 | SRS_HTTP_SERVER=NO |
| @@ -449,6 +458,7 @@ function apply_user_presets() { | @@ -449,6 +458,7 @@ function apply_user_presets() { | ||
| 449 | SRS_FFMPEG_TOOL=NO | 458 | SRS_FFMPEG_TOOL=NO |
| 450 | SRS_TRANSCODE=NO | 459 | SRS_TRANSCODE=NO |
| 451 | SRS_INGEST=NO | 460 | SRS_INGEST=NO |
| 461 | + SRS_STAT=NO | ||
| 452 | SRS_HTTP_PARSER=NO | 462 | SRS_HTTP_PARSER=NO |
| 453 | SRS_HTTP_CALLBACK=NO | 463 | SRS_HTTP_CALLBACK=NO |
| 454 | SRS_HTTP_SERVER=NO | 464 | SRS_HTTP_SERVER=NO |
| @@ -473,6 +483,7 @@ function apply_user_presets() { | @@ -473,6 +483,7 @@ function apply_user_presets() { | ||
| 473 | SRS_FFMPEG_TOOL=NO | 483 | SRS_FFMPEG_TOOL=NO |
| 474 | SRS_TRANSCODE=YES | 484 | SRS_TRANSCODE=YES |
| 475 | SRS_INGEST=YES | 485 | SRS_INGEST=YES |
| 486 | + SRS_STAT=YES | ||
| 476 | SRS_HTTP_PARSER=YES | 487 | SRS_HTTP_PARSER=YES |
| 477 | SRS_HTTP_CALLBACK=YES | 488 | SRS_HTTP_CALLBACK=YES |
| 478 | SRS_HTTP_SERVER=YES | 489 | SRS_HTTP_SERVER=YES |
| @@ -498,6 +509,7 @@ function apply_user_presets() { | @@ -498,6 +509,7 @@ function apply_user_presets() { | ||
| 498 | SRS_FFMPEG_TOOL=NO | 509 | SRS_FFMPEG_TOOL=NO |
| 499 | SRS_TRANSCODE=YES | 510 | SRS_TRANSCODE=YES |
| 500 | SRS_INGEST=YES | 511 | SRS_INGEST=YES |
| 512 | + SRS_STAT=YES | ||
| 501 | SRS_HTTP_PARSER=YES | 513 | SRS_HTTP_PARSER=YES |
| 502 | SRS_HTTP_CALLBACK=YES | 514 | SRS_HTTP_CALLBACK=YES |
| 503 | SRS_HTTP_SERVER=YES | 515 | SRS_HTTP_SERVER=YES |
| @@ -522,6 +534,7 @@ function apply_user_presets() { | @@ -522,6 +534,7 @@ function apply_user_presets() { | ||
| 522 | SRS_FFMPEG_TOOL=NO | 534 | SRS_FFMPEG_TOOL=NO |
| 523 | SRS_TRANSCODE=YES | 535 | SRS_TRANSCODE=YES |
| 524 | SRS_INGEST=YES | 536 | SRS_INGEST=YES |
| 537 | + SRS_STAT=YES | ||
| 525 | SRS_HTTP_PARSER=YES | 538 | SRS_HTTP_PARSER=YES |
| 526 | SRS_HTTP_CALLBACK=YES | 539 | SRS_HTTP_CALLBACK=YES |
| 527 | SRS_HTTP_SERVER=YES | 540 | SRS_HTTP_SERVER=YES |
| @@ -546,6 +559,7 @@ function apply_user_presets() { | @@ -546,6 +559,7 @@ function apply_user_presets() { | ||
| 546 | SRS_FFMPEG_TOOL=YES | 559 | SRS_FFMPEG_TOOL=YES |
| 547 | SRS_TRANSCODE=YES | 560 | SRS_TRANSCODE=YES |
| 548 | SRS_INGEST=YES | 561 | SRS_INGEST=YES |
| 562 | + SRS_STAT=YES | ||
| 549 | SRS_HTTP_PARSER=YES | 563 | SRS_HTTP_PARSER=YES |
| 550 | SRS_HTTP_CALLBACK=YES | 564 | SRS_HTTP_CALLBACK=YES |
| 551 | SRS_HTTP_SERVER=YES | 565 | SRS_HTTP_SERVER=YES |
| @@ -570,6 +584,7 @@ function apply_user_presets() { | @@ -570,6 +584,7 @@ function apply_user_presets() { | ||
| 570 | SRS_FFMPEG_TOOL=NO | 584 | SRS_FFMPEG_TOOL=NO |
| 571 | SRS_TRANSCODE=YES | 585 | SRS_TRANSCODE=YES |
| 572 | SRS_INGEST=YES | 586 | SRS_INGEST=YES |
| 587 | + SRS_STAT=YES | ||
| 573 | SRS_HTTP_PARSER=YES | 588 | SRS_HTTP_PARSER=YES |
| 574 | SRS_HTTP_CALLBACK=YES | 589 | SRS_HTTP_CALLBACK=YES |
| 575 | SRS_HTTP_SERVER=YES | 590 | SRS_HTTP_SERVER=YES |
| @@ -594,6 +609,7 @@ function apply_user_presets() { | @@ -594,6 +609,7 @@ function apply_user_presets() { | ||
| 594 | SRS_FFMPEG_TOOL=NO | 609 | SRS_FFMPEG_TOOL=NO |
| 595 | SRS_TRANSCODE=YES | 610 | SRS_TRANSCODE=YES |
| 596 | SRS_INGEST=YES | 611 | SRS_INGEST=YES |
| 612 | + SRS_STAT=NO | ||
| 597 | SRS_HTTP_PARSER=YES | 613 | SRS_HTTP_PARSER=YES |
| 598 | SRS_HTTP_CALLBACK=YES | 614 | SRS_HTTP_CALLBACK=YES |
| 599 | SRS_HTTP_SERVER=YES | 615 | SRS_HTTP_SERVER=YES |
| @@ -620,6 +636,7 @@ function apply_user_presets() { | @@ -620,6 +636,7 @@ function apply_user_presets() { | ||
| 620 | SRS_FFMPEG_TOOL=YES | 636 | SRS_FFMPEG_TOOL=YES |
| 621 | SRS_TRANSCODE=YES | 637 | SRS_TRANSCODE=YES |
| 622 | SRS_INGEST=YES | 638 | SRS_INGEST=YES |
| 639 | + SRS_STAT=YES | ||
| 623 | SRS_HTTP_PARSER=YES | 640 | SRS_HTTP_PARSER=YES |
| 624 | SRS_HTTP_CALLBACK=YES | 641 | SRS_HTTP_CALLBACK=YES |
| 625 | SRS_HTTP_SERVER=YES | 642 | SRS_HTTP_SERVER=YES |
| @@ -644,6 +661,7 @@ function apply_user_presets() { | @@ -644,6 +661,7 @@ function apply_user_presets() { | ||
| 644 | SRS_FFMPEG_TOOL=NO | 661 | SRS_FFMPEG_TOOL=NO |
| 645 | SRS_TRANSCODE=YES | 662 | SRS_TRANSCODE=YES |
| 646 | SRS_INGEST=YES | 663 | SRS_INGEST=YES |
| 664 | + SRS_STAT=YES | ||
| 647 | SRS_HTTP_PARSER=YES | 665 | SRS_HTTP_PARSER=YES |
| 648 | SRS_HTTP_CALLBACK=YES | 666 | SRS_HTTP_CALLBACK=YES |
| 649 | SRS_HTTP_SERVER=YES | 667 | SRS_HTTP_SERVER=YES |
| @@ -668,6 +686,7 @@ function apply_user_presets() { | @@ -668,6 +686,7 @@ function apply_user_presets() { | ||
| 668 | SRS_FFMPEG_TOOL=YES | 686 | SRS_FFMPEG_TOOL=YES |
| 669 | SRS_TRANSCODE=YES | 687 | SRS_TRANSCODE=YES |
| 670 | SRS_INGEST=YES | 688 | SRS_INGEST=YES |
| 689 | + SRS_STAT=YES | ||
| 671 | SRS_HTTP_PARSER=YES | 690 | SRS_HTTP_PARSER=YES |
| 672 | SRS_HTTP_CALLBACK=YES | 691 | SRS_HTTP_CALLBACK=YES |
| 673 | SRS_HTTP_SERVER=YES | 692 | SRS_HTTP_SERVER=YES |
| @@ -794,12 +813,17 @@ function check_option_conflicts() { | @@ -794,12 +813,17 @@ function check_option_conflicts() { | ||
| 794 | echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO; | 813 | echo "x86/x64 should never use static, see: ./configure --help"; __check_ok=NO; |
| 795 | fi | 814 | fi |
| 796 | fi | 815 | fi |
| 816 | + | ||
| 817 | + # for darwin, not support stat yet. | ||
| 818 | + if [ $SRS_OSX = YES ]; then | ||
| 819 | + if [ $SRS_STAT = YES ]; then | ||
| 820 | + echo "osx should never use stat, see: ./configure --help"; __check_ok=NO; | ||
| 821 | + fi | ||
| 822 | + fi | ||
| 797 | 823 | ||
| 798 | # for darwin, must use --osx, vice versa | 824 | # for darwin, must use --osx, vice versa |
| 799 | if [ $SRS_OSX = YES ]; then | 825 | if [ $SRS_OSX = YES ]; then |
| 800 | - if [ `uname -s` = Darwin ]; then | ||
| 801 | - echo "osx(darwin) is ok" | ||
| 802 | - else | 826 | + if [ `uname -s` != Darwin ]; then |
| 803 | echo "--osx is for darwin(your os is not), see: ./configure --help"; __check_ok=NO; | 827 | echo "--osx is for darwin(your os is not), see: ./configure --help"; __check_ok=NO; |
| 804 | fi | 828 | fi |
| 805 | else | 829 | else |
| @@ -672,7 +672,7 @@ int SrsServer::do_cycle() | @@ -672,7 +672,7 @@ int SrsServer::do_cycle() | ||
| 672 | // find the max loop | 672 | // find the max loop |
| 673 | int max = srs_max(0, SRS_SYS_TIME_RESOLUTION_MS_TIMES); | 673 | int max = srs_max(0, SRS_SYS_TIME_RESOLUTION_MS_TIMES); |
| 674 | 674 | ||
| 675 | -#ifndef SRS_AUTO_OSX | 675 | +#ifdef SRS_AUTO_STAT |
| 676 | max = srs_max(max, SRS_SYS_RUSAGE_RESOLUTION_TIMES); | 676 | max = srs_max(max, SRS_SYS_RUSAGE_RESOLUTION_TIMES); |
| 677 | max = srs_max(max, SRS_SYS_CPU_STAT_RESOLUTION_TIMES); | 677 | max = srs_max(max, SRS_SYS_CPU_STAT_RESOLUTION_TIMES); |
| 678 | max = srs_max(max, SRS_SYS_DISK_STAT_RESOLUTION_TIMES); | 678 | max = srs_max(max, SRS_SYS_DISK_STAT_RESOLUTION_TIMES); |
| @@ -723,7 +723,7 @@ int SrsServer::do_cycle() | @@ -723,7 +723,7 @@ int SrsServer::do_cycle() | ||
| 723 | srs_update_system_time_ms(); | 723 | srs_update_system_time_ms(); |
| 724 | } | 724 | } |
| 725 | 725 | ||
| 726 | -#ifndef SRS_AUTO_OSX | 726 | +#ifdef SRS_AUTO_STAT |
| 727 | if ((i % SRS_SYS_RUSAGE_RESOLUTION_TIMES) == 0) { | 727 | if ((i % SRS_SYS_RUSAGE_RESOLUTION_TIMES) == 0) { |
| 728 | srs_info("update resource info, rss."); | 728 | srs_info("update resource info, rss."); |
| 729 | srs_update_system_rusage(); | 729 | srs_update_system_rusage(); |
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR "0" | 32 | #define VERSION_MAJOR "0" |
| 33 | #define VERSION_MINOR "9" | 33 | #define VERSION_MINOR "9" |
| 34 | -#define VERSION_REVISION "198" | 34 | +#define VERSION_REVISION "199" |
| 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION | 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION |
| 36 | // server info. | 36 | // server info. |
| 37 | #define RTMP_SIG_SRS_KEY "SRS" | 37 | #define RTMP_SIG_SRS_KEY "SRS" |
-
请 注册 或 登录 后发表评论