正在显示
6 个修改的文件
包含
8 行增加
和
148 行删除
@@ -388,8 +388,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then | @@ -388,8 +388,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then | ||
388 | "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" | 388 | "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" |
389 | "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks" | 389 | "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks" |
390 | "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge" | 390 | "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge" |
391 | - "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac" | ||
392 | - "srs_app_poll") | 391 | + "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac") |
393 | APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh | 392 | APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh |
394 | APP_OBJS="${MODULE_OBJS[@]}" | 393 | APP_OBJS="${MODULE_OBJS[@]}" |
395 | fi | 394 | fi |
trunk/src/app/srs_app_poll.cpp
已删除
100644 → 0
1 | -/* | ||
2 | -The MIT License (MIT) | ||
3 | - | ||
4 | -Copyright (c) 2013-2014 winlin | ||
5 | - | ||
6 | -Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
7 | -this software and associated documentation files (the "Software"), to deal in | ||
8 | -the Software without restriction, including without limitation the rights to | ||
9 | -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
10 | -the Software, and to permit persons to whom the Software is furnished to do so, | ||
11 | -subject to the following conditions: | ||
12 | - | ||
13 | -The above copyright notice and this permission notice shall be included in all | ||
14 | -copies or substantial portions of the Software. | ||
15 | - | ||
16 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
18 | -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
19 | -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
20 | -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
21 | -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
22 | -*/ | ||
23 | - | ||
24 | -#include <srs_app_poll.hpp> | ||
25 | - | ||
26 | -#include <srs_kernel_error.hpp> | ||
27 | -#include <srs_kernel_log.hpp> | ||
28 | - | ||
29 | -SrsPoll::SrsPoll() | ||
30 | -{ | ||
31 | - _stfd = NULL; | ||
32 | - _active = false; | ||
33 | -} | ||
34 | - | ||
35 | -SrsPoll::~SrsPoll() | ||
36 | -{ | ||
37 | -} | ||
38 | - | ||
39 | -int SrsPoll::initialize(st_netfd_t stfd) | ||
40 | -{ | ||
41 | - int ret = ERROR_SUCCESS; | ||
42 | - | ||
43 | - _stfd = stfd; | ||
44 | - | ||
45 | - return ret; | ||
46 | -} | ||
47 | - | ||
48 | -bool SrsPoll::active() | ||
49 | -{ | ||
50 | - return _active; | ||
51 | -} | ||
52 | - | ||
53 | -void SrsPoll::set_active(bool v) | ||
54 | -{ | ||
55 | - _active = v; | ||
56 | -} | ||
57 | - |
trunk/src/app/srs_app_poll.hpp
已删除
100644 → 0
1 | -/* | ||
2 | -The MIT License (MIT) | ||
3 | - | ||
4 | -Copyright (c) 2013-2014 winlin | ||
5 | - | ||
6 | -Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
7 | -this software and associated documentation files (the "Software"), to deal in | ||
8 | -the Software without restriction, including without limitation the rights to | ||
9 | -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
10 | -the Software, and to permit persons to whom the Software is furnished to do so, | ||
11 | -subject to the following conditions: | ||
12 | - | ||
13 | -The above copyright notice and this permission notice shall be included in all | ||
14 | -copies or substantial portions of the Software. | ||
15 | - | ||
16 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
18 | -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
19 | -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
20 | -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
21 | -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
22 | -*/ | ||
23 | - | ||
24 | -#ifndef SRS_APP_POLL_HPP | ||
25 | -#define SRS_APP_POLL_HPP | ||
26 | - | ||
27 | -/* | ||
28 | -#include <srs_app_poll.hpp> | ||
29 | -*/ | ||
30 | - | ||
31 | -#include <srs_core.hpp> | ||
32 | - | ||
33 | -#include <map> | ||
34 | - | ||
35 | -#include <srs_app_st.hpp> | ||
36 | -#include <srs_app_thread.hpp> | ||
37 | - | ||
38 | -/** | ||
39 | -* the poll fd to check whether the specified fd is active. | ||
40 | -* we start new thread to covert the fd status to async. | ||
41 | -* for performance issue, @see: https://github.com/winlinvip/simple-rtmp-server/issues/194 | ||
42 | -*/ | ||
43 | -class SrsPoll | ||
44 | -{ | ||
45 | -private: | ||
46 | - st_netfd_t _stfd; | ||
47 | - // whether current fd is active. | ||
48 | - bool _active; | ||
49 | -public: | ||
50 | - SrsPoll(); | ||
51 | - virtual ~SrsPoll(); | ||
52 | -public: | ||
53 | - /** | ||
54 | - * initialize the poll. | ||
55 | - * @param stfd the fd to poll. | ||
56 | - */ | ||
57 | - virtual int initialize(st_netfd_t stfd); | ||
58 | - /** | ||
59 | - * whether fd is active. | ||
60 | - */ | ||
61 | - virtual bool active(); | ||
62 | - /** | ||
63 | - * the poll will set to fd active when got data to read, | ||
64 | - * the connection will set to deactive when data read. | ||
65 | - */ | ||
66 | - virtual void set_active(bool v); | ||
67 | -}; | ||
68 | - | ||
69 | -#endif | ||
70 | - |
@@ -48,7 +48,6 @@ using namespace std; | @@ -48,7 +48,6 @@ using namespace std; | ||
48 | #include <srs_app_utility.hpp> | 48 | #include <srs_app_utility.hpp> |
49 | #include <srs_protocol_msg_array.hpp> | 49 | #include <srs_protocol_msg_array.hpp> |
50 | #include <srs_protocol_amf0.hpp> | 50 | #include <srs_protocol_amf0.hpp> |
51 | -#include <srs_app_poll.hpp> | ||
52 | 51 | ||
53 | // when stream is busy, for example, streaming is already | 52 | // when stream is busy, for example, streaming is already |
54 | // publishing, when a new client to request to publish, | 53 | // publishing, when a new client to request to publish, |
@@ -517,16 +516,10 @@ int SrsRtmpConn::playing(SrsSource* source) | @@ -517,16 +516,10 @@ int SrsRtmpConn::playing(SrsSource* source) | ||
517 | SrsAutoFree(SrsConsumer, consumer); | 516 | SrsAutoFree(SrsConsumer, consumer); |
518 | srs_verbose("consumer created success."); | 517 | srs_verbose("consumer created success."); |
519 | 518 | ||
520 | - // use poll fd to manage the connection, read when active. | ||
521 | - SrsPoll poll_fd; | ||
522 | - if ((ret = poll_fd.initialize(stfd)) != ERROR_SUCCESS) { | ||
523 | - return ret; | ||
524 | - } | ||
525 | - | ||
526 | // TODO: FIXME: remove following. | 519 | // TODO: FIXME: remove following. |
527 | - //rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); | ||
528 | - rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT); | ||
529 | - rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT); | 520 | + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); |
521 | + //rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT); | ||
522 | + //rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT); | ||
530 | 523 | ||
531 | // initialize other components | 524 | // initialize other components |
532 | SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER); | 525 | SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER); |
@@ -539,9 +532,7 @@ int SrsRtmpConn::playing(SrsSource* source) | @@ -539,9 +532,7 @@ int SrsRtmpConn::playing(SrsSource* source) | ||
539 | pithy_print.elapse(); | 532 | pithy_print.elapse(); |
540 | 533 | ||
541 | // read from client. | 534 | // read from client. |
542 | - if (poll_fd.active()) { | ||
543 | - poll_fd.set_active(false); | ||
544 | - | 535 | + if (true) { |
545 | SrsMessage* msg = NULL; | 536 | SrsMessage* msg = NULL; |
546 | ret = rtmp->recv_message(&msg); | 537 | ret = rtmp->recv_message(&msg); |
547 | srs_verbose("play loop recv message. ret=%d", ret); | 538 | srs_verbose("play loop recv message. ret=%d", ret); |
@@ -574,9 +565,9 @@ int SrsRtmpConn::playing(SrsSource* source) | @@ -574,9 +565,9 @@ int SrsRtmpConn::playing(SrsSource* source) | ||
574 | // no data, sleep a while. | 565 | // no data, sleep a while. |
575 | // for the poll_fd maybe not active, and no message. | 566 | // for the poll_fd maybe not active, and no message. |
576 | // @see: https://github.com/winlinvip/simple-rtmp-server/issues/194 | 567 | // @see: https://github.com/winlinvip/simple-rtmp-server/issues/194 |
577 | - if (count <= 0) { | ||
578 | - st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); | ||
579 | - } | 568 | + //if (count <= 0) { |
569 | + // st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); | ||
570 | + //} | ||
580 | 571 | ||
581 | // reportable | 572 | // reportable |
582 | if (pithy_print.can_print()) { | 573 | if (pithy_print.can_print()) { |
@@ -185,7 +185,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -185,7 +185,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
185 | #define ERROR_EDGE_VHOST_REMOVED 3039 | 185 | #define ERROR_EDGE_VHOST_REMOVED 3039 |
186 | #define ERROR_HLS_AVC_TRY_OTHERS 3040 | 186 | #define ERROR_HLS_AVC_TRY_OTHERS 3040 |
187 | #define ERROR_H264_API_NO_PREFIXED 3041 | 187 | #define ERROR_H264_API_NO_PREFIXED 3041 |
188 | -#define ERROR_RTMP_POLL_FD_DUPLICATED 3042 | ||
189 | 188 | ||
190 | /** | 189 | /** |
191 | * whether the error code is an system control error. | 190 | * whether the error code is an system control error. |
@@ -92,8 +92,6 @@ file | @@ -92,8 +92,6 @@ file | ||
92 | ..\app\srs_app_kbps.cpp, | 92 | ..\app\srs_app_kbps.cpp, |
93 | ..\app\srs_app_log.hpp, | 93 | ..\app\srs_app_log.hpp, |
94 | ..\app\srs_app_log.cpp, | 94 | ..\app\srs_app_log.cpp, |
95 | - ..\app\srs_app_poll.hpp, | ||
96 | - ..\app\srs_app_poll.cpp, | ||
97 | ..\app\srs_app_refer.hpp, | 95 | ..\app\srs_app_refer.hpp, |
98 | ..\app\srs_app_refer.cpp, | 96 | ..\app\srs_app_refer.cpp, |
99 | ..\app\srs_app_reload.hpp, | 97 | ..\app\srs_app_reload.hpp, |
-
请 注册 或 登录 后发表评论