正在显示
4 个修改的文件
包含
39 行增加
和
22 行删除
| @@ -86,7 +86,7 @@ Supported operating systems and hardware: | @@ -86,7 +86,7 @@ Supported operating systems and hardware: | ||
| 86 | ## Summary | 86 | ## Summary |
| 87 | 01. Simple: also stable enough.<br/> | 87 | 01. Simple: also stable enough.<br/> |
| 88 | 02. [High-performance](https://github.com/winlinvip/simple-rtmp-server/wiki/Performance): single-thread, async socket, event/st-thread driven.<br/> | 88 | 02. [High-performance](https://github.com/winlinvip/simple-rtmp-server/wiki/Performance): single-thread, async socket, event/st-thread driven.<br/> |
| 89 | -03. With RTMP edge server, support origin server.<br/> | 89 | +03. With RTMP edge server(plan), support origin server.<br/> |
| 90 | 04. RTMP without vod streaming, live streaming only.<br/> | 90 | 04. RTMP without vod streaming, live streaming only.<br/> |
| 91 | 05. With multiple processes, support single process.<br/> | 91 | 05. With multiple processes, support single process.<br/> |
| 92 | 06. Support vhost, support \_\_defaultVhost\_\_.<br/> | 92 | 06. Support vhost, support \_\_defaultVhost\_\_.<br/> |
| @@ -32,6 +32,9 @@ SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12 | @@ -32,6 +32,9 @@ SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12 | ||
| 32 | SRS_PREFIX=/usr/local/srs | 32 | SRS_PREFIX=/usr/local/srs |
| 33 | SRS_JOBS=1 | 33 | SRS_JOBS=1 |
| 34 | SRS_STATIC=RESERVED | 34 | SRS_STATIC=RESERVED |
| 35 | +# private internal | ||
| 36 | +# dev, open all features for dev, no gperf/prof/arm. | ||
| 37 | +SRS_DEV=NO | ||
| 35 | 38 | ||
| 36 | ##################################################################################### | 39 | ##################################################################################### |
| 37 | # parse options | 40 | # parse options |
| @@ -88,6 +91,7 @@ do | @@ -88,6 +91,7 @@ do | ||
| 88 | --jobs) SRS_JOBS=${value} ;; | 91 | --jobs) SRS_JOBS=${value} ;; |
| 89 | --prefix) SRS_PREFIX=${value} ;; | 92 | --prefix) SRS_PREFIX=${value} ;; |
| 90 | --static) SRS_STATIC=YES ;; | 93 | --static) SRS_STATIC=YES ;; |
| 94 | + --dev) SRS_DEV=YES ;; | ||
| 91 | 95 | ||
| 92 | *) | 96 | *) |
| 93 | echo "$0: error: invalid option \"$option\"" | 97 | echo "$0: error: invalid option \"$option\"" |
| @@ -116,6 +120,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then | @@ -116,6 +120,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then | ||
| 116 | if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi | 120 | if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi |
| 117 | if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi | 121 | if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi |
| 118 | if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi | 122 | if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi |
| 123 | + if [ $SRS_DEV = RESERVED ]; then SRS_DEV=NO; fi | ||
| 119 | # for arm, always set to static link. | 124 | # for arm, always set to static link. |
| 120 | SRS_STATIC=YES | 125 | SRS_STATIC=YES |
| 121 | else | 126 | else |
| @@ -135,6 +140,28 @@ else | @@ -135,6 +140,28 @@ else | ||
| 135 | if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi | 140 | if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi |
| 136 | if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi | 141 | if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi |
| 137 | if [ $SRS_STATIC = RESERVED ]; then SRS_STATIC=NO; fi | 142 | if [ $SRS_STATIC = RESERVED ]; then SRS_STATIC=NO; fi |
| 143 | + if [ $SRS_DEV = RESERVED ]; then SRS_DEV=NO; fi | ||
| 144 | +fi | ||
| 145 | + | ||
| 146 | +# if dev specified, open features if possible. | ||
| 147 | +if [ $SRS_DEV = YES ]; then | ||
| 148 | + SRS_HLS=YES | ||
| 149 | + SRS_NGINX=YES | ||
| 150 | + SRS_SSL=YES | ||
| 151 | + SRS_FFMPEG=YES | ||
| 152 | + SRS_HTTP_CALLBACK=YES | ||
| 153 | + SRS_LIBRTMP=YES | ||
| 154 | + SRS_BWTC=YES | ||
| 155 | + SRS_RESEARCH=YES | ||
| 156 | + SRS_UTEST=YES | ||
| 157 | + SRS_GPERF=NO | ||
| 158 | + SRS_GPERF_MC=NO | ||
| 159 | + SRS_GPERF_MP=NO | ||
| 160 | + SRS_GPERF_CP=NO | ||
| 161 | + SRS_GPROF=NO | ||
| 162 | + SRS_ARM_UBUNTU12=NO | ||
| 163 | + # for arm, always set to static link. | ||
| 164 | + SRS_STATIC=NO | ||
| 138 | fi | 165 | fi |
| 139 | 166 | ||
| 140 | # parse the jobs for make | 167 | # parse the jobs for make |
| @@ -190,7 +217,8 @@ if [ $help = yes ]; then | @@ -190,7 +217,8 @@ if [ $help = yes ]; then | ||
| 190 | --static whether add '-static' to link options. always set this option for arm. | 217 | --static whether add '-static' to link options. always set this option for arm. |
| 191 | --jobs[=N] Allow N jobs at once; infinite jobs with no arg. | 218 | --jobs[=N] Allow N jobs at once; infinite jobs with no arg. |
| 192 | used for make in the configure, for example, to make ffmpeg. | 219 | used for make in the configure, for example, to make ffmpeg. |
| 193 | - --prefix=<path> the absolute install path for srs. | 220 | + --prefix=<path> the absolute install path for srs. |
| 221 | + --dev for dev, open all features, no gperf/gprof/arm. | ||
| 194 | 222 | ||
| 195 | END | 223 | END |
| 196 | exit 0 | 224 | exit 0 |
| @@ -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 "30" | 34 | +#define VERSION_REVISION "31" |
| 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" |
| @@ -469,7 +469,7 @@ int SrsBandCheckClient::send_pub_data() | @@ -469,7 +469,7 @@ int SrsBandCheckClient::send_pub_data() | ||
| 469 | std::stringstream seq; | 469 | std::stringstream seq; |
| 470 | seq << i; | 470 | seq << i; |
| 471 | std::string play_data = "SrS band check data from client's publishing......"; | 471 | std::string play_data = "SrS band check data from client's publishing......"; |
| 472 | - pkt->data->set(seq.str(), new SrsAmf0String(play_data.c_str())); | 472 | + pkt->data->set(seq.str(), SrsAmf0Any::str(play_data.c_str())); |
| 473 | } | 473 | } |
| 474 | data_count += 100; | 474 | data_count += 100; |
| 475 | 475 | ||
| @@ -545,8 +545,9 @@ int SrsBandCheckClient::expect_finished() | @@ -545,8 +545,9 @@ int SrsBandCheckClient::expect_finished() | ||
| 545 | return ret; | 545 | return ret; |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | - SrsAmf0Object* object; | ||
| 549 | - if ((ret = srs_amf0_read_object(stream, object)) != ERROR_SUCCESS) { | 548 | + SrsAmf0Object* object = SrsAmf0Any::object(); |
| 549 | + if ((ret = object->read(stream)) != ERROR_SUCCESS) { | ||
| 550 | + srs_freep(object); | ||
| 550 | srs_error("amfo read object error. ret=%d", ret); | 551 | srs_error("amfo read object error. ret=%d", ret); |
| 551 | return ret; | 552 | return ret; |
| 552 | } | 553 | } |
| @@ -556,36 +557,24 @@ int SrsBandCheckClient::expect_finished() | @@ -556,36 +557,24 @@ int SrsBandCheckClient::expect_finished() | ||
| 556 | 557 | ||
| 557 | SrsAmf0Any* start_time_any = object->get_property("start_time"); | 558 | SrsAmf0Any* start_time_any = object->get_property("start_time"); |
| 558 | if (start_time_any && start_time_any->is_number()) { | 559 | if (start_time_any && start_time_any->is_number()) { |
| 559 | - SrsAmf0Number* start_time_number = dynamic_cast<SrsAmf0Number*> (start_time_any); | ||
| 560 | - if (start_time_number) { | ||
| 561 | - start_time = start_time_number->value; | ||
| 562 | - } | 560 | + start_time = start_time_any->to_number(); |
| 563 | } | 561 | } |
| 564 | 562 | ||
| 565 | SrsAmf0Any* end_time_any = object->get_property("end_time"); | 563 | SrsAmf0Any* end_time_any = object->get_property("end_time"); |
| 566 | if (end_time_any && end_time_any->is_number()) { | 564 | if (end_time_any && end_time_any->is_number()) { |
| 567 | - SrsAmf0Number* end_time_number = dynamic_cast<SrsAmf0Number*> (end_time_any); | ||
| 568 | - if (end_time_number) { | ||
| 569 | - end_time = end_time_number->value; | ||
| 570 | - } | 565 | + end_time = end_time_any->to_number(); |
| 571 | } | 566 | } |
| 572 | 567 | ||
| 573 | int play_kbps = 0; | 568 | int play_kbps = 0; |
| 574 | int pub_kbps = 0; | 569 | int pub_kbps = 0; |
| 575 | SrsAmf0Any* play_kbp_any = object->get_property("play_kbps"); | 570 | SrsAmf0Any* play_kbp_any = object->get_property("play_kbps"); |
| 576 | if (play_kbp_any && play_kbp_any->is_number()) { | 571 | if (play_kbp_any && play_kbp_any->is_number()) { |
| 577 | - SrsAmf0Number* play_kbps_number = dynamic_cast<SrsAmf0Number*> (play_kbp_any); | ||
| 578 | - if (play_kbps_number) { | ||
| 579 | - play_kbps = play_kbps_number->value; | ||
| 580 | - } | 572 | + play_kbps = play_kbp_any->to_number(); |
| 581 | } | 573 | } |
| 582 | 574 | ||
| 583 | SrsAmf0Any* pub_kbp_any = object->get_property("publish_kbps"); | 575 | SrsAmf0Any* pub_kbp_any = object->get_property("publish_kbps"); |
| 584 | if (pub_kbp_any && pub_kbp_any->is_number()) { | 576 | if (pub_kbp_any && pub_kbp_any->is_number()) { |
| 585 | - SrsAmf0Number* pub_kbps_number = dynamic_cast<SrsAmf0Number*> (pub_kbp_any); | ||
| 586 | - if (pub_kbps_number) { | ||
| 587 | - pub_kbps = pub_kbps_number->value; | ||
| 588 | - } | 577 | + pub_kbps = pub_kbp_any->to_number(); |
| 589 | } | 578 | } |
| 590 | 579 | ||
| 591 | float time_elapsed; | 580 | float time_elapsed; |
-
请 注册 或 登录 后发表评论