正在显示
6 个修改的文件
包含
62 行增加
和
57 行删除
| @@ -43,7 +43,7 @@ using namespace std; | @@ -43,7 +43,7 @@ using namespace std; | ||
| 43 | #include <srs_app_bandwidth.hpp> | 43 | #include <srs_app_bandwidth.hpp> |
| 44 | #include <srs_app_socket.hpp> | 44 | #include <srs_app_socket.hpp> |
| 45 | 45 | ||
| 46 | -SrsClient::SrsClient(SrsServer* srs_server, st_netfd_t client_stfd) | 46 | +SrsRtmpConn::SrsRtmpConn(SrsServer* srs_server, st_netfd_t client_stfd) |
| 47 | : SrsConnection(srs_server, client_stfd) | 47 | : SrsConnection(srs_server, client_stfd) |
| 48 | { | 48 | { |
| 49 | ip = NULL; | 49 | ip = NULL; |
| @@ -60,7 +60,7 @@ SrsClient::SrsClient(SrsServer* srs_server, st_netfd_t client_stfd) | @@ -60,7 +60,7 @@ SrsClient::SrsClient(SrsServer* srs_server, st_netfd_t client_stfd) | ||
| 60 | _srs_config->subscribe(this); | 60 | _srs_config->subscribe(this); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | -SrsClient::~SrsClient() | 63 | +SrsRtmpConn::~SrsRtmpConn() |
| 64 | { | 64 | { |
| 65 | _srs_config->unsubscribe(this); | 65 | _srs_config->unsubscribe(this); |
| 66 | 66 | ||
| @@ -77,7 +77,7 @@ SrsClient::~SrsClient() | @@ -77,7 +77,7 @@ SrsClient::~SrsClient() | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | // TODO: return detail message when error for client. | 79 | // TODO: return detail message when error for client. |
| 80 | -int SrsClient::do_cycle() | 80 | +int SrsRtmpConn::do_cycle() |
| 81 | { | 81 | { |
| 82 | int ret = ERROR_SUCCESS; | 82 | int ret = ERROR_SUCCESS; |
| 83 | 83 | ||
| @@ -139,7 +139,7 @@ int SrsClient::do_cycle() | @@ -139,7 +139,7 @@ int SrsClient::do_cycle() | ||
| 139 | return ret; | 139 | return ret; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | -int SrsClient::on_reload_vhost_removed(string vhost) | 142 | +int SrsRtmpConn::on_reload_vhost_removed(string vhost) |
| 143 | { | 143 | { |
| 144 | int ret = ERROR_SUCCESS; | 144 | int ret = ERROR_SUCCESS; |
| 145 | 145 | ||
| @@ -156,7 +156,7 @@ int SrsClient::on_reload_vhost_removed(string vhost) | @@ -156,7 +156,7 @@ int SrsClient::on_reload_vhost_removed(string vhost) | ||
| 156 | return ret; | 156 | return ret; |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | -int SrsClient::service_cycle() | 159 | +int SrsRtmpConn::service_cycle() |
| 160 | { | 160 | { |
| 161 | int ret = ERROR_SUCCESS; | 161 | int ret = ERROR_SUCCESS; |
| 162 | 162 | ||
| @@ -232,11 +232,11 @@ int SrsClient::service_cycle() | @@ -232,11 +232,11 @@ int SrsClient::service_cycle() | ||
| 232 | return ret; | 232 | return ret; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | -int SrsClient::stream_service_cycle() | 235 | +int SrsRtmpConn::stream_service_cycle() |
| 236 | { | 236 | { |
| 237 | int ret = ERROR_SUCCESS; | 237 | int ret = ERROR_SUCCESS; |
| 238 | 238 | ||
| 239 | - SrsClientType type; | 239 | + SrsRtmpConnType type; |
| 240 | if ((ret = rtmp->identify_client(res->stream_id, type, req->stream)) != ERROR_SUCCESS) { | 240 | if ((ret = rtmp->identify_client(res->stream_id, type, req->stream)) != ERROR_SUCCESS) { |
| 241 | srs_error("identify client failed. ret=%d", ret); | 241 | srs_error("identify client failed. ret=%d", ret); |
| 242 | return ret; | 242 | return ret; |
| @@ -262,7 +262,7 @@ int SrsClient::stream_service_cycle() | @@ -262,7 +262,7 @@ int SrsClient::stream_service_cycle() | ||
| 262 | srs_assert(source != NULL); | 262 | srs_assert(source != NULL); |
| 263 | 263 | ||
| 264 | // check publish available. | 264 | // check publish available. |
| 265 | - if (type != SrsClientPlay && !source->can_publish()) { | 265 | + if (type != SrsRtmpConnPlay && !source->can_publish()) { |
| 266 | ret = ERROR_SYSTEM_STREAM_BUSY; | 266 | ret = ERROR_SYSTEM_STREAM_BUSY; |
| 267 | srs_warn("stream %s is already publishing. ret=%d", | 267 | srs_warn("stream %s is already publishing. ret=%d", |
| 268 | req->get_stream_url().c_str(), ret); | 268 | req->get_stream_url().c_str(), ret); |
| @@ -276,7 +276,7 @@ int SrsClient::stream_service_cycle() | @@ -276,7 +276,7 @@ int SrsClient::stream_service_cycle() | ||
| 276 | source->set_cache(enabled_cache); | 276 | source->set_cache(enabled_cache); |
| 277 | 277 | ||
| 278 | switch (type) { | 278 | switch (type) { |
| 279 | - case SrsClientPlay: { | 279 | + case SrsRtmpConnPlay: { |
| 280 | srs_verbose("start to play stream %s.", req->stream.c_str()); | 280 | srs_verbose("start to play stream %s.", req->stream.c_str()); |
| 281 | 281 | ||
| 282 | if ((ret = rtmp->start_play(res->stream_id)) != ERROR_SUCCESS) { | 282 | if ((ret = rtmp->start_play(res->stream_id)) != ERROR_SUCCESS) { |
| @@ -292,7 +292,7 @@ int SrsClient::stream_service_cycle() | @@ -292,7 +292,7 @@ int SrsClient::stream_service_cycle() | ||
| 292 | on_stop(); | 292 | on_stop(); |
| 293 | return ret; | 293 | return ret; |
| 294 | } | 294 | } |
| 295 | - case SrsClientFMLEPublish: { | 295 | + case SrsRtmpConnFMLEPublish: { |
| 296 | srs_verbose("FMLE start to publish stream %s.", req->stream.c_str()); | 296 | srs_verbose("FMLE start to publish stream %s.", req->stream.c_str()); |
| 297 | 297 | ||
| 298 | if ((ret = rtmp->start_fmle_publish(res->stream_id)) != ERROR_SUCCESS) { | 298 | if ((ret = rtmp->start_fmle_publish(res->stream_id)) != ERROR_SUCCESS) { |
| @@ -309,7 +309,7 @@ int SrsClient::stream_service_cycle() | @@ -309,7 +309,7 @@ int SrsClient::stream_service_cycle() | ||
| 309 | on_unpublish(); | 309 | on_unpublish(); |
| 310 | return ret; | 310 | return ret; |
| 311 | } | 311 | } |
| 312 | - case SrsClientFlashPublish: { | 312 | + case SrsRtmpConnFlashPublish: { |
| 313 | srs_verbose("flash start to publish stream %s.", req->stream.c_str()); | 313 | srs_verbose("flash start to publish stream %s.", req->stream.c_str()); |
| 314 | 314 | ||
| 315 | if ((ret = rtmp->start_flash_publish(res->stream_id)) != ERROR_SUCCESS) { | 315 | if ((ret = rtmp->start_flash_publish(res->stream_id)) != ERROR_SUCCESS) { |
| @@ -336,7 +336,7 @@ int SrsClient::stream_service_cycle() | @@ -336,7 +336,7 @@ int SrsClient::stream_service_cycle() | ||
| 336 | return ret; | 336 | return ret; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | -int SrsClient::check_vhost() | 339 | +int SrsRtmpConn::check_vhost() |
| 340 | { | 340 | { |
| 341 | int ret = ERROR_SUCCESS; | 341 | int ret = ERROR_SUCCESS; |
| 342 | 342 | ||
| @@ -373,7 +373,7 @@ int SrsClient::check_vhost() | @@ -373,7 +373,7 @@ int SrsClient::check_vhost() | ||
| 373 | return ret; | 373 | return ret; |
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | -int SrsClient::playing(SrsSource* source) | 376 | +int SrsRtmpConn::playing(SrsSource* source) |
| 377 | { | 377 | { |
| 378 | int ret = ERROR_SUCCESS; | 378 | int ret = ERROR_SUCCESS; |
| 379 | 379 | ||
| @@ -462,7 +462,7 @@ int SrsClient::playing(SrsSource* source) | @@ -462,7 +462,7 @@ int SrsClient::playing(SrsSource* source) | ||
| 462 | return ret; | 462 | return ret; |
| 463 | } | 463 | } |
| 464 | 464 | ||
| 465 | -int SrsClient::fmle_publish(SrsSource* source) | 465 | +int SrsRtmpConn::fmle_publish(SrsSource* source) |
| 466 | { | 466 | { |
| 467 | int ret = ERROR_SUCCESS; | 467 | int ret = ERROR_SUCCESS; |
| 468 | 468 | ||
| @@ -531,7 +531,7 @@ int SrsClient::fmle_publish(SrsSource* source) | @@ -531,7 +531,7 @@ int SrsClient::fmle_publish(SrsSource* source) | ||
| 531 | return ret; | 531 | return ret; |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | -int SrsClient::flash_publish(SrsSource* source) | 534 | +int SrsRtmpConn::flash_publish(SrsSource* source) |
| 535 | { | 535 | { |
| 536 | int ret = ERROR_SUCCESS; | 536 | int ret = ERROR_SUCCESS; |
| 537 | 537 | ||
| @@ -595,7 +595,7 @@ int SrsClient::flash_publish(SrsSource* source) | @@ -595,7 +595,7 @@ int SrsClient::flash_publish(SrsSource* source) | ||
| 595 | return ret; | 595 | return ret; |
| 596 | } | 596 | } |
| 597 | 597 | ||
| 598 | -int SrsClient::process_publish_message(SrsSource* source, SrsCommonMessage* msg) | 598 | +int SrsRtmpConn::process_publish_message(SrsSource* source, SrsCommonMessage* msg) |
| 599 | { | 599 | { |
| 600 | int ret = ERROR_SUCCESS; | 600 | int ret = ERROR_SUCCESS; |
| 601 | 601 | ||
| @@ -639,7 +639,7 @@ int SrsClient::process_publish_message(SrsSource* source, SrsCommonMessage* msg) | @@ -639,7 +639,7 @@ int SrsClient::process_publish_message(SrsSource* source, SrsCommonMessage* msg) | ||
| 639 | return ret; | 639 | return ret; |
| 640 | } | 640 | } |
| 641 | 641 | ||
| 642 | -int SrsClient::get_peer_ip() | 642 | +int SrsRtmpConn::get_peer_ip() |
| 643 | { | 643 | { |
| 644 | int ret = ERROR_SUCCESS; | 644 | int ret = ERROR_SUCCESS; |
| 645 | 645 | ||
| @@ -674,7 +674,7 @@ int SrsClient::get_peer_ip() | @@ -674,7 +674,7 @@ int SrsClient::get_peer_ip() | ||
| 674 | return ret; | 674 | return ret; |
| 675 | } | 675 | } |
| 676 | 676 | ||
| 677 | -int SrsClient::process_play_control_msg(SrsConsumer* consumer, SrsCommonMessage* msg) | 677 | +int SrsRtmpConn::process_play_control_msg(SrsConsumer* consumer, SrsCommonMessage* msg) |
| 678 | { | 678 | { |
| 679 | int ret = ERROR_SUCCESS; | 679 | int ret = ERROR_SUCCESS; |
| 680 | 680 | ||
| @@ -722,7 +722,7 @@ int SrsClient::process_play_control_msg(SrsConsumer* consumer, SrsCommonMessage* | @@ -722,7 +722,7 @@ int SrsClient::process_play_control_msg(SrsConsumer* consumer, SrsCommonMessage* | ||
| 722 | return ret; | 722 | return ret; |
| 723 | } | 723 | } |
| 724 | 724 | ||
| 725 | -int SrsClient::on_connect() | 725 | +int SrsRtmpConn::on_connect() |
| 726 | { | 726 | { |
| 727 | int ret = ERROR_SUCCESS; | 727 | int ret = ERROR_SUCCESS; |
| 728 | 728 | ||
| @@ -746,7 +746,7 @@ int SrsClient::on_connect() | @@ -746,7 +746,7 @@ int SrsClient::on_connect() | ||
| 746 | return ret; | 746 | return ret; |
| 747 | } | 747 | } |
| 748 | 748 | ||
| 749 | -void SrsClient::on_close() | 749 | +void SrsRtmpConn::on_close() |
| 750 | { | 750 | { |
| 751 | #ifdef SRS_HTTP_CALLBACK | 751 | #ifdef SRS_HTTP_CALLBACK |
| 752 | // whatever the ret code, notify the api hooks. | 752 | // whatever the ret code, notify the api hooks. |
| @@ -764,7 +764,7 @@ void SrsClient::on_close() | @@ -764,7 +764,7 @@ void SrsClient::on_close() | ||
| 764 | #endif | 764 | #endif |
| 765 | } | 765 | } |
| 766 | 766 | ||
| 767 | -int SrsClient::on_publish() | 767 | +int SrsRtmpConn::on_publish() |
| 768 | { | 768 | { |
| 769 | int ret = ERROR_SUCCESS; | 769 | int ret = ERROR_SUCCESS; |
| 770 | 770 | ||
| @@ -788,7 +788,7 @@ int SrsClient::on_publish() | @@ -788,7 +788,7 @@ int SrsClient::on_publish() | ||
| 788 | return ret; | 788 | return ret; |
| 789 | } | 789 | } |
| 790 | 790 | ||
| 791 | -void SrsClient::on_unpublish() | 791 | +void SrsRtmpConn::on_unpublish() |
| 792 | { | 792 | { |
| 793 | #ifdef SRS_HTTP_CALLBACK | 793 | #ifdef SRS_HTTP_CALLBACK |
| 794 | // whatever the ret code, notify the api hooks. | 794 | // whatever the ret code, notify the api hooks. |
| @@ -806,7 +806,7 @@ void SrsClient::on_unpublish() | @@ -806,7 +806,7 @@ void SrsClient::on_unpublish() | ||
| 806 | #endif | 806 | #endif |
| 807 | } | 807 | } |
| 808 | 808 | ||
| 809 | -int SrsClient::on_play() | 809 | +int SrsRtmpConn::on_play() |
| 810 | { | 810 | { |
| 811 | int ret = ERROR_SUCCESS; | 811 | int ret = ERROR_SUCCESS; |
| 812 | 812 | ||
| @@ -830,7 +830,7 @@ int SrsClient::on_play() | @@ -830,7 +830,7 @@ int SrsClient::on_play() | ||
| 830 | return ret; | 830 | return ret; |
| 831 | } | 831 | } |
| 832 | 832 | ||
| 833 | -void SrsClient::on_stop() | 833 | +void SrsRtmpConn::on_stop() |
| 834 | { | 834 | { |
| 835 | #ifdef SRS_HTTP_CALLBACK | 835 | #ifdef SRS_HTTP_CALLBACK |
| 836 | // whatever the ret code, notify the api hooks. | 836 | // whatever the ret code, notify the api hooks. |
| @@ -50,7 +50,7 @@ class SrsBandwidth; | @@ -50,7 +50,7 @@ class SrsBandwidth; | ||
| 50 | /** | 50 | /** |
| 51 | * the client provides the main logic control for RTMP clients. | 51 | * the client provides the main logic control for RTMP clients. |
| 52 | */ | 52 | */ |
| 53 | -class SrsClient : public SrsConnection, public ISrsReloadHandler | 53 | +class SrsRtmpConn : public SrsConnection, public ISrsReloadHandler |
| 54 | { | 54 | { |
| 55 | private: | 55 | private: |
| 56 | char* ip; | 56 | char* ip; |
| @@ -64,8 +64,8 @@ private: | @@ -64,8 +64,8 @@ private: | ||
| 64 | #endif | 64 | #endif |
| 65 | SrsBandwidth* bandwidth; | 65 | SrsBandwidth* bandwidth; |
| 66 | public: | 66 | public: |
| 67 | - SrsClient(SrsServer* srs_server, st_netfd_t client_stfd); | ||
| 68 | - virtual ~SrsClient(); | 67 | + SrsRtmpConn(SrsServer* srs_server, st_netfd_t client_stfd); |
| 68 | + virtual ~SrsRtmpConn(); | ||
| 69 | protected: | 69 | protected: |
| 70 | virtual int do_cycle(); | 70 | virtual int do_cycle(); |
| 71 | // interface ISrsReloadHandler | 71 | // interface ISrsReloadHandler |
| @@ -296,7 +296,7 @@ int SrsServer::listen() | @@ -296,7 +296,7 @@ int SrsServer::listen() | ||
| 296 | close_listeners(); | 296 | close_listeners(); |
| 297 | 297 | ||
| 298 | for (int i = 0; i < (int)conf->args.size(); i++) { | 298 | for (int i = 0; i < (int)conf->args.size(); i++) { |
| 299 | - SrsListener* listener = new SrsListener(this, SrsListenerStream); | 299 | + SrsListener* listener = new SrsListener(this, SrsListenerRtmpStream); |
| 300 | listeners.push_back(listener); | 300 | listeners.push_back(listener); |
| 301 | 301 | ||
| 302 | int port = ::atoi(conf->args.at(i).c_str()); | 302 | int port = ::atoi(conf->args.at(i).c_str()); |
| @@ -433,8 +433,8 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd) | @@ -433,8 +433,8 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd) | ||
| 433 | } | 433 | } |
| 434 | 434 | ||
| 435 | SrsConnection* conn = NULL; | 435 | SrsConnection* conn = NULL; |
| 436 | - if (type == SrsListenerStream) { | ||
| 437 | - conn = new SrsClient(this, client_stfd); | 436 | + if (type == SrsListenerRtmpStream) { |
| 437 | + conn = new SrsRtmpConn(this, client_stfd); | ||
| 438 | } else if (type == SrsListenerHttpApi) { | 438 | } else if (type == SrsListenerHttpApi) { |
| 439 | } else if (type == SrsListenerHttpStream) { | 439 | } else if (type == SrsListenerHttpStream) { |
| 440 | } else { | 440 | } else { |
| @@ -39,11 +39,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -39,11 +39,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 39 | class SrsServer; | 39 | class SrsServer; |
| 40 | class SrsConnection; | 40 | class SrsConnection; |
| 41 | 41 | ||
| 42 | +// listener type for server to identify the connection, | ||
| 43 | +// that is, use different type to process the connection. | ||
| 42 | enum SrsListenerType | 44 | enum SrsListenerType |
| 43 | { | 45 | { |
| 44 | - SrsListenerStream = 0, | ||
| 45 | - SrsListenerHttpApi, | ||
| 46 | - SrsListenerHttpStream | 46 | + // RTMP client, |
| 47 | + SrsListenerRtmpStream = 0, | ||
| 48 | + // HTTP api, | ||
| 49 | + SrsListenerHttpApi = 1, | ||
| 50 | + // HTTP stream, HDS/HLS/DASH | ||
| 51 | + SrsListenerHttpStream = 2 | ||
| 47 | }; | 52 | }; |
| 48 | 53 | ||
| 49 | class SrsListener : public ISrsThreadHandler | 54 | class SrsListener : public ISrsThreadHandler |
| @@ -178,12 +178,12 @@ SrsResponse::~SrsResponse() | @@ -178,12 +178,12 @@ SrsResponse::~SrsResponse() | ||
| 178 | { | 178 | { |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | -string srs_client_type_string(SrsClientType type) | 181 | +string srs_client_type_string(SrsRtmpConnType type) |
| 182 | { | 182 | { |
| 183 | switch (type) { | 183 | switch (type) { |
| 184 | - case SrsClientPlay: return "Play"; | ||
| 185 | - case SrsClientFlashPublish: return "FlashPublish"; | ||
| 186 | - case SrsClientFMLEPublish: return "FMLEPublish"; | 184 | + case SrsRtmpConnPlay: return "Play"; |
| 185 | + case SrsRtmpConnFlashPublish: return "FlashPublish"; | ||
| 186 | + case SrsRtmpConnFMLEPublish: return "FMLEPublish"; | ||
| 187 | default: return "Unknown"; | 187 | default: return "Unknown"; |
| 188 | } | 188 | } |
| 189 | return "Unknown"; | 189 | return "Unknown"; |
| @@ -947,9 +947,9 @@ int SrsRtmpServer::on_bw_done() | @@ -947,9 +947,9 @@ int SrsRtmpServer::on_bw_done() | ||
| 947 | return ret; | 947 | return ret; |
| 948 | } | 948 | } |
| 949 | 949 | ||
| 950 | -int SrsRtmpServer::identify_client(int stream_id, SrsClientType& type, string& stream_name) | 950 | +int SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type, string& stream_name) |
| 951 | { | 951 | { |
| 952 | - type = SrsClientUnknown; | 952 | + type = SrsRtmpConnUnknown; |
| 953 | int ret = ERROR_SUCCESS; | 953 | int ret = ERROR_SUCCESS; |
| 954 | 954 | ||
| 955 | while (true) { | 955 | while (true) { |
| @@ -1380,7 +1380,7 @@ int SrsRtmpServer::start_flash_publish(int stream_id) | @@ -1380,7 +1380,7 @@ int SrsRtmpServer::start_flash_publish(int stream_id) | ||
| 1380 | return ret; | 1380 | return ret; |
| 1381 | } | 1381 | } |
| 1382 | 1382 | ||
| 1383 | -int SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, SrsClientType& type, string& stream_name) | 1383 | +int SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, SrsRtmpConnType& type, string& stream_name) |
| 1384 | { | 1384 | { |
| 1385 | int ret = ERROR_SUCCESS; | 1385 | int ret = ERROR_SUCCESS; |
| 1386 | 1386 | ||
| @@ -1433,11 +1433,11 @@ int SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int | @@ -1433,11 +1433,11 @@ int SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int | ||
| 1433 | return ret; | 1433 | return ret; |
| 1434 | } | 1434 | } |
| 1435 | 1435 | ||
| 1436 | -int SrsRtmpServer::identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsClientType& type, string& stream_name) | 1436 | +int SrsRtmpServer::identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsRtmpConnType& type, string& stream_name) |
| 1437 | { | 1437 | { |
| 1438 | int ret = ERROR_SUCCESS; | 1438 | int ret = ERROR_SUCCESS; |
| 1439 | 1439 | ||
| 1440 | - type = SrsClientFMLEPublish; | 1440 | + type = SrsRtmpConnFMLEPublish; |
| 1441 | stream_name = req->stream_name; | 1441 | stream_name = req->stream_name; |
| 1442 | 1442 | ||
| 1443 | // releaseStream response | 1443 | // releaseStream response |
| @@ -1457,21 +1457,21 @@ int SrsRtmpServer::identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsClie | @@ -1457,21 +1457,21 @@ int SrsRtmpServer::identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsClie | ||
| 1457 | return ret; | 1457 | return ret; |
| 1458 | } | 1458 | } |
| 1459 | 1459 | ||
| 1460 | -int SrsRtmpServer::identify_flash_publish_client(SrsPublishPacket* req, SrsClientType& type, string& stream_name) | 1460 | +int SrsRtmpServer::identify_flash_publish_client(SrsPublishPacket* req, SrsRtmpConnType& type, string& stream_name) |
| 1461 | { | 1461 | { |
| 1462 | int ret = ERROR_SUCCESS; | 1462 | int ret = ERROR_SUCCESS; |
| 1463 | 1463 | ||
| 1464 | - type = SrsClientFlashPublish; | 1464 | + type = SrsRtmpConnFlashPublish; |
| 1465 | stream_name = req->stream_name; | 1465 | stream_name = req->stream_name; |
| 1466 | 1466 | ||
| 1467 | return ret; | 1467 | return ret; |
| 1468 | } | 1468 | } |
| 1469 | 1469 | ||
| 1470 | -int SrsRtmpServer::identify_play_client(SrsPlayPacket* req, SrsClientType& type, string& stream_name) | 1470 | +int SrsRtmpServer::identify_play_client(SrsPlayPacket* req, SrsRtmpConnType& type, string& stream_name) |
| 1471 | { | 1471 | { |
| 1472 | int ret = ERROR_SUCCESS; | 1472 | int ret = ERROR_SUCCESS; |
| 1473 | 1473 | ||
| 1474 | - type = SrsClientPlay; | 1474 | + type = SrsRtmpConnPlay; |
| 1475 | stream_name = req->stream_name; | 1475 | stream_name = req->stream_name; |
| 1476 | 1476 | ||
| 1477 | srs_trace("identity client type=play, stream_name=%s", stream_name.c_str()); | 1477 | srs_trace("identity client type=play, stream_name=%s", stream_name.c_str()); |
| @@ -101,14 +101,14 @@ struct SrsResponse | @@ -101,14 +101,14 @@ struct SrsResponse | ||
| 101 | /** | 101 | /** |
| 102 | * the rtmp client type. | 102 | * the rtmp client type. |
| 103 | */ | 103 | */ |
| 104 | -enum SrsClientType | 104 | +enum SrsRtmpConnType |
| 105 | { | 105 | { |
| 106 | - SrsClientUnknown, | ||
| 107 | - SrsClientPlay, | ||
| 108 | - SrsClientFMLEPublish, | ||
| 109 | - SrsClientFlashPublish, | 106 | + SrsRtmpConnUnknown, |
| 107 | + SrsRtmpConnPlay, | ||
| 108 | + SrsRtmpConnFMLEPublish, | ||
| 109 | + SrsRtmpConnFlashPublish, | ||
| 110 | }; | 110 | }; |
| 111 | -std::string srs_client_type_string(SrsClientType type); | 111 | +std::string srs_client_type_string(SrsRtmpConnType type); |
| 112 | 112 | ||
| 113 | /** | 113 | /** |
| 114 | * store the handshake bytes, | 114 | * store the handshake bytes, |
| @@ -223,7 +223,7 @@ public: | @@ -223,7 +223,7 @@ public: | ||
| 223 | * the stream_id used to response the createStream request. | 223 | * the stream_id used to response the createStream request. |
| 224 | * @type, output the client type. | 224 | * @type, output the client type. |
| 225 | */ | 225 | */ |
| 226 | - virtual int identify_client(int stream_id, SrsClientType& type, std::string& stream_name); | 226 | + virtual int identify_client(int stream_id, SrsRtmpConnType& type, std::string& stream_name); |
| 227 | /** | 227 | /** |
| 228 | * set the chunk size when client type identified. | 228 | * set the chunk size when client type identified. |
| 229 | */ | 229 | */ |
| @@ -267,11 +267,11 @@ public: | @@ -267,11 +267,11 @@ public: | ||
| 267 | */ | 267 | */ |
| 268 | virtual int start_flash_publish(int stream_id); | 268 | virtual int start_flash_publish(int stream_id); |
| 269 | private: | 269 | private: |
| 270 | - virtual int identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, SrsClientType& type, std::string& stream_name); | ||
| 271 | - virtual int identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsClientType& type, std::string& stream_name); | ||
| 272 | - virtual int identify_flash_publish_client(SrsPublishPacket* req, SrsClientType& type, std::string& stream_name); | 270 | + virtual int identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, SrsRtmpConnType& type, std::string& stream_name); |
| 271 | + virtual int identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsRtmpConnType& type, std::string& stream_name); | ||
| 272 | + virtual int identify_flash_publish_client(SrsPublishPacket* req, SrsRtmpConnType& type, std::string& stream_name); | ||
| 273 | private: | 273 | private: |
| 274 | - virtual int identify_play_client(SrsPlayPacket* req, SrsClientType& type, std::string& stream_name); | 274 | + virtual int identify_play_client(SrsPlayPacket* req, SrsRtmpConnType& type, std::string& stream_name); |
| 275 | }; | 275 | }; |
| 276 | 276 | ||
| 277 | #endif | 277 | #endif |
-
请 注册 或 登录 后发表评论