diff --git a/trunk/research/players/srs_bwt/release/srs_bwt.swf b/trunk/research/players/srs_bwt/release/srs_bwt.swf index f035aa6ff..6a88f3a48 100755 Binary files a/trunk/research/players/srs_bwt/release/srs_bwt.swf and b/trunk/research/players/srs_bwt/release/srs_bwt.swf differ diff --git a/trunk/research/players/srs_bwt/src/srs_bwt.as b/trunk/research/players/srs_bwt/src/srs_bwt.as index 2a671faf9..8a0036df4 100755 --- a/trunk/research/players/srs_bwt/src/srs_bwt.as +++ b/trunk/research/players/srs_bwt/src/srs_bwt.as @@ -137,6 +137,7 @@ package private var srs_server:String = null; private var srs_primary_authors:String = null; private var srs_id:String = null; + private var srs_pid:String = null; private function update_context_items():void { // for context menu var customItems:Array = [new ContextMenuItem("SrsPlayer")]; @@ -146,6 +147,9 @@ package if (srs_primary_authors != null) { customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors)); } + if (srs_pid != null) { + customItems.push(new ContextMenuItem("SrsPid: " + srs_pid)); + } if (srs_id != null) { customItems.push(new ContextMenuItem("SrsId: " + srs_id)); } @@ -166,6 +170,9 @@ package if (evt.info.data.hasOwnProperty("srs_id")) { srs_id = evt.info.data.srs_id; } + if (evt.info.data.hasOwnProperty("srs_pid")) { + srs_pid = evt.info.data.srs_pid; + } update_context_items(); } diff --git a/trunk/research/players/srs_player/release/srs_player.swf b/trunk/research/players/srs_player/release/srs_player.swf index 3402953c9..a09750e17 100755 Binary files a/trunk/research/players/srs_player/release/srs_player.swf and b/trunk/research/players/srs_player/release/srs_player.swf differ diff --git a/trunk/research/players/srs_player/src/srs_player.as b/trunk/research/players/srs_player/src/srs_player.as index 781917176..55ac327a0 100755 --- a/trunk/research/players/srs_player/src/srs_player.as +++ b/trunk/research/players/srs_player/src/srs_player.as @@ -269,6 +269,7 @@ package private var srs_server:String = null; private var srs_primary_authors:String = null; private var srs_id:String = null; + private var srs_pid:String = null; private function update_context_items():void { // for context menu var customItems:Array = [new ContextMenuItem("SrsPlayer")]; @@ -278,6 +279,9 @@ package if (srs_primary_authors != null) { customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors)); } + if (srs_pid != null) { + customItems.push(new ContextMenuItem("SrsPid: " + srs_pid)); + } if (srs_id != null) { customItems.push(new ContextMenuItem("SrsId: " + srs_id)); } @@ -316,6 +320,9 @@ package if (evt.info.data.hasOwnProperty("srs_id")) { srs_id = evt.info.data.srs_id; } + if (evt.info.data.hasOwnProperty("srs_pid")) { + srs_pid = evt.info.data.srs_pid; + } update_context_items(); } diff --git a/trunk/research/players/srs_publisher/release/srs_publisher.swf b/trunk/research/players/srs_publisher/release/srs_publisher.swf index 149e179c3..30f44ce92 100755 Binary files a/trunk/research/players/srs_publisher/release/srs_publisher.swf and b/trunk/research/players/srs_publisher/release/srs_publisher.swf differ diff --git a/trunk/research/players/srs_publisher/src/srs_publisher.as b/trunk/research/players/srs_publisher/src/srs_publisher.as index e3a14392b..d06f7cad4 100755 --- a/trunk/research/players/srs_publisher/src/srs_publisher.as +++ b/trunk/research/players/srs_publisher/src/srs_publisher.as @@ -138,6 +138,7 @@ package private var srs_server:String = null; private var srs_primary_authors:String = null; private var srs_id:String = null; + private var srs_pid:String = null; private function update_context_items():void { // for context menu var customItems:Array = [new ContextMenuItem("SrsPlayer")]; @@ -147,6 +148,9 @@ package if (srs_primary_authors != null) { customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors)); } + if (srs_pid != null) { + customItems.push(new ContextMenuItem("SrsPid: " + srs_pid)); + } if (srs_id != null) { customItems.push(new ContextMenuItem("SrsId: " + srs_id)); } @@ -215,6 +219,9 @@ package if (evt.info.data.hasOwnProperty("srs_id")) { srs_id = evt.info.data.srs_id; } + if (evt.info.data.hasOwnProperty("srs_pid")) { + srs_pid = evt.info.data.srs_pid; + } update_context_items(); } diff --git a/trunk/src/app/srs_app_log.cpp b/trunk/src/app/srs_app_log.cpp index 4465048b4..7e45ba5d5 100644 --- a/trunk/src/app/srs_app_log.cpp +++ b/trunk/src/app/srs_app_log.cpp @@ -265,26 +265,26 @@ bool SrsFastLog::generate_header(bool error, const char* tag, int context_id, co if (error) { if (tag) { log_header_size = snprintf(log_data, LOG_MAX_SIZE, - "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d][%d] ", + "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d][%d][%d] ", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(tv.tv_usec / 1000), - level_name, tag, context_id, errno); + level_name, tag, getpid(), context_id, errno); } else { log_header_size = snprintf(log_data, LOG_MAX_SIZE, - "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d][%d] ", + "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d][%d][%d] ", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(tv.tv_usec / 1000), - level_name, context_id, errno); + level_name, getpid(), context_id, errno); } } else { if (tag) { log_header_size = snprintf(log_data, LOG_MAX_SIZE, - "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d] ", + "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d][%d] ", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(tv.tv_usec / 1000), - level_name, tag, context_id); + level_name, tag, getpid(), context_id); } else { log_header_size = snprintf(log_data, LOG_MAX_SIZE, - "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d] ", + "[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d][%d] ", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(tv.tv_usec / 1000), - level_name, context_id); + level_name, getpid(), context_id); } } diff --git a/trunk/src/rtmp/srs_protocol_rtmp.cpp b/trunk/src/rtmp/srs_protocol_rtmp.cpp index d830dbc18..e278209f6 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp.cpp +++ b/trunk/src/rtmp/srs_protocol_rtmp.cpp @@ -492,7 +492,33 @@ int SrsRtmpClient::connect_app(string app, string tc_url) } SrsAutoFree(SrsMessage, msg); SrsAutoFree(SrsConnectAppResPacket, pkt); - srs_info("get connect app response message"); + + // server info + std::string srs_version; + std::string srs_server_ip; + int srs_id = 0; + int srs_pid = 0; + + SrsAmf0Any* data = pkt->info->get_property("data"); + if (data && data->is_ecma_array()) { + SrsAmf0EcmaArray* arr = data->to_ecma_array(); + + SrsAmf0Any* prop = NULL; + if ((prop = arr->ensure_property_string("srs_version")) != NULL) { + srs_version = prop->to_str(); + } + if ((prop = arr->ensure_property_string("srs_server_ip")) != NULL) { + srs_server_ip = prop->to_str(); + } + if ((prop = arr->ensure_property_number("srs_id")) != NULL) { + srs_id = (int)prop->to_number(); + } + if ((prop = arr->ensure_property_number("srs_pid")) != NULL) { + srs_pid = (int)prop->to_number(); + } + } + srs_trace("connected, version=%s, ip=%s, identity=[%d][%d]", + srs_version.c_str(), srs_server_ip.c_str(), srs_pid, srs_id); return ret; } @@ -867,6 +893,7 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip) data->set("srs_server_ip", SrsAmf0Any::str(server_ip)); } // for edge to directly get the id of client. + data->set("srs_pid", SrsAmf0Any::number(getpid())); data->set("srs_id", SrsAmf0Any::number(_srs_context->get_id())); if ((ret = protocol->send_and_free_packet(pkt, 0)) != ERROR_SUCCESS) {