winlin

update PRIMARY, AUTHORS, CONTRIBUTORS rule

... ... @@ -88,9 +88,10 @@ package
* "", otherwise empty string.
* @param as_on_progress_change, function(percent:Number):void, where:
* percent, the progress percent, 0 means 0%, 100 means 100%.
* @param as_on_srs_info, function(srs_server:String, srs_primary_authors:String, srs_id:String, srs_pid:String, srs_server_ip:String):void, where:
* @param as_on_srs_info, function(srs_server:String, srs_primary:String, srs_authors:String, srs_id:String, srs_pid:String, srs_server_ip:String):void, where:
* srs_server: the srs server info.
* srs_primary_authors: the srs version info.
* srs_primary: the srs primary authors info.
* srs_authors: the srs authors info.
* srs_id: the tracable log id, to direclty grep the log..
* srs_pid: the srs process id, to direclty grep the log.
* srs_server_ip: the srs server ip, where client connected at.
... ... @@ -112,7 +113,7 @@ package
* @param js_on_ready, function(js_id:String):void, callback when bandwidth tool is ready to run.
* @param js_on_status_change, function(js_id:String, code:String, data:String):void
* @param as_on_progress_change, function(js_id:String, percent:Number):void
* @param as_on_srs_info, function(js_id:String, srs_server:String, srs_primary_authors:String, srs_id:String, srs_pid:String, srs_server_ip:String):void
* @param as_on_srs_info, function(js_id:String, srs_server:String, srs_primary:String, srs_authors:String, srs_id:String, srs_pid:String, srs_server_ip:String):void
* @param as_on_complete, function(js_id:String, start_time:Number, end_time:Number, play_kbps:Number, publish_kbps:Number, play_bytes:Number, publish_bytes:Number, play_time:Number, publish_time:Number):void
*
* the js export functions.
... ... @@ -268,7 +269,8 @@ package
* srs debug infos
*/
private var srs_server:String = null;
private var srs_primary_authors:String = null;
private var srs_primary:String = null;
private var srs_authors:String = null;
private var srs_id:String = null;
private var srs_pid:String = null;
private var srs_server_ip:String = null;
... ... @@ -486,8 +488,11 @@ package
if (evt.info.data.hasOwnProperty("srs_server")) {
srs_server = evt.info.data.srs_server;
}
if (evt.info.data.hasOwnProperty("srs_primary_authors")) {
srs_primary_authors = evt.info.data.srs_primary_authors;
if (evt.info.data.hasOwnProperty("srs_primary")) {
srs_primary = evt.info.data.srs_primary;
}
if (evt.info.data.hasOwnProperty("srs_authors")) {
srs_authors = evt.info.data.srs_authors;
}
if (evt.info.data.hasOwnProperty("srs_id")) {
srs_id = evt.info.data.srs_id;
... ... @@ -500,11 +505,11 @@ package
}
if (this.as_on_srs_info != null) {
this.as_on_srs_info(srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip);
this.as_on_srs_info(srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip);
}
if (this.js_on_srs_info != null) {
flash.external.ExternalInterface.call(this.js_on_srs_info, this.js_id,
srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip);
srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip);
}
}
if (evt.info.code) {
... ...
... ... @@ -39,9 +39,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bandwidth.on_update_status = function(status) {
// console.log(status);
}
bandwidth.on_srs_info = function(srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip) {
bandwidth.on_srs_info = function(srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip) {
// console.log(
// "server:" + srs_server + ", authors:" + srs_primary_authors +
// "server:" + srs_server + ", primary:" + srs_primary + ", authors:" + srs_authors +
// ", srs_id:" + srs_id + ", srs_pid:" + srs_pid + ", ip:" + srs_server_ip
//);
}
... ... @@ -160,7 +160,7 @@ SrsBandwidth.prototype.on_update_progress = function(percent) {
}
SrsBandwidth.prototype.on_update_status = function(status) {
}
SrsBandwidth.prototype.on_srs_info = function(srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip) {
SrsBandwidth.prototype.on_srs_info = function(srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip) {
}
SrsBandwidth.prototype.on_complete = function(start_time, end_time, play_kbps, publish_kbps, play_bytes, publish_bytes, play_time, publish_time) {
}
... ... @@ -233,11 +233,11 @@ function __srs_on_update_status(id, code, data) {
bandwidth.status = status;
bandwidth.on_update_status(status);
}
function __srs_on_srs_info(id, srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip) {
function __srs_on_srs_info(id, srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip) {
var bandwidth = __srs_find_bandwidth(id);
bandwidth.status = status;
bandwidth.server = srs_server_ip;
bandwidth.on_srs_info(srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip);
bandwidth.on_srs_info(srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip);
}
function __srs_on_complete(id, start_time, end_time, play_kbps, publish_kbps, play_bytes, publish_bytes, play_time, publish_time) {
var bandwidth = __srs_find_bandwidth(id);
... ...
... ... @@ -101,8 +101,8 @@ package
var as_on_progress_change:Function = function(percent:Number):void {
self.on_progress(percent);
};
var as_on_srs_info:Function = function(srs_server:String, srs_primary_authors:String, srs_id:String, srs_pid:String, srs_server_ip:String):void {
self.update_context_items(srs_server, srs_primary_authors, srs_id, srs_pid, srs_server_ip);
var as_on_srs_info:Function = function(srs_server:String, srs_primary, srs_authors:String, srs_id:String, srs_pid:String, srs_server_ip:String):void {
self.update_context_items(srs_server, srs_primary, srs_authors, srs_id, srs_pid, srs_server_ip);
};
var as_on_complete:Function = function(start_time:Number, end_time:Number, play_kbps:Number, publish_kbps:Number, play_bytes:Number, publish_bytes:Number, play_time:Number, publish_time:Number):void {
self.on_complete(start_time, end_time, play_kbps, publish_kbps, play_bytes, publish_bytes, play_time, publish_time);
... ... @@ -130,7 +130,7 @@ package
trace("progress:" + percent + "%");
}
private function update_context_items(
srs_server:String, srs_primary_authors:String,
srs_server:String, srs_primary:String, srs_authors:String,
srs_id:String, srs_pid:String, srs_server_ip:String
):void {
// for context menu
... ... @@ -138,8 +138,11 @@ package
if (srs_server != null) {
customItems.push(new ContextMenuItem("Server: " + srs_server));
}
if (srs_primary_authors != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors));
if (srs_primary != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary));
}
if (srs_authors != null) {
customItems.push(new ContextMenuItem("Authors: " + srs_authors));
}
if (srs_server_ip != null) {
customItems.push(new ContextMenuItem("SrsIp: " + srs_server_ip));
... ...
... ... @@ -152,8 +152,11 @@ package
if (srs_server != null) {
obj.server = srs_server;
}
if (srs_primary_authors != null) {
obj.contributor = srs_primary_authors;
if (srs_primary != null) {
obj.contributor = srs_primary;
}
if (srs_authors != null) {
obj.contributor = srs_authors;
}
var code:int = flash.external.ExternalInterface.call(js_on_player_metadata, js_id, obj);
... ... @@ -267,7 +270,8 @@ package
// srs infos
private var srs_server:String = null;
private var srs_primary_authors:String = null;
private var srs_primary:String = null;
private var srs_authors:String = null;
private var srs_id:String = null;
private var srs_pid:String = null;
private var srs_server_ip:String = null;
... ... @@ -277,8 +281,11 @@ package
if (srs_server != null) {
customItems.push(new ContextMenuItem("Server: " + srs_server));
}
if (srs_primary_authors != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors));
if (srs_primary != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary));
}
if (srs_authors != null) {
customItems.push(new ContextMenuItem("Authors: " + srs_authors));
}
if (srs_server_ip != null) {
customItems.push(new ContextMenuItem("SrsIp: " + srs_server_ip));
... ... @@ -318,8 +325,11 @@ package
if (evt.info.data.hasOwnProperty("srs_server")) {
srs_server = evt.info.data.srs_server;
}
if (evt.info.data.hasOwnProperty("srs_primary_authors")) {
srs_primary_authors = evt.info.data.srs_primary_authors;
if (evt.info.data.hasOwnProperty("srs_primary")) {
srs_primary = evt.info.data.srs_primary;
}
if (evt.info.data.hasOwnProperty("srs_authors")) {
srs_authors = evt.info.data.srs_authors;
}
if (evt.info.data.hasOwnProperty("srs_id")) {
srs_id = evt.info.data.srs_id;
... ...
... ... @@ -136,7 +136,8 @@ package
// srs infos
private var srs_server:String = null;
private var srs_primary_authors:String = null;
private var srs_primary:String = null;
private var srs_authors:String = null;
private var srs_id:String = null;
private var srs_pid:String = null;
private var srs_server_ip:String = null;
... ... @@ -146,8 +147,11 @@ package
if (srs_server != null) {
customItems.push(new ContextMenuItem("Server: " + srs_server));
}
if (srs_primary_authors != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors));
if (srs_primary != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary));
}
if (srs_authors != null) {
customItems.push(new ContextMenuItem("Authors: " + srs_authors));
}
if (srs_server_ip != null) {
customItems.push(new ContextMenuItem("SrsIp: " + srs_server_ip));
... ... @@ -217,8 +221,11 @@ package
if (evt.info.data.hasOwnProperty("srs_server")) {
srs_server = evt.info.data.srs_server;
}
if (evt.info.data.hasOwnProperty("srs_primary_authors")) {
srs_primary_authors = evt.info.data.srs_primary_authors;
if (evt.info.data.hasOwnProperty("srs_primary")) {
srs_primary = evt.info.data.srs_primary;
}
if (evt.info.data.hasOwnProperty("srs_authors")) {
srs_authors = evt.info.data.srs_authors;
}
if (evt.info.data.hasOwnProperty("srs_id")) {
srs_id = evt.info.data.srs_id;
... ...
... ... @@ -264,12 +264,14 @@ int srs_connect_app(srs_rtmp_t rtmp)
}
int srs_connect_app2(srs_rtmp_t rtmp,
char srs_server_ip[128],char srs_server[128], char srs_primary_authors[128],
char srs_server_ip[128],char srs_server[128],
char srs_primary[128], char srs_authors[128],
char srs_version[32], int* srs_id, int* srs_pid
) {
srs_server_ip[0] = 0;
srs_server[0] = 0;
srs_primary_authors[0] = 0;
srs_primary[0] = 0;
srs_authors[0] = 0;
srs_version[0] = 0;
*srs_id = 0;
*srs_pid = 0;
... ... @@ -284,16 +286,17 @@ int srs_connect_app2(srs_rtmp_t rtmp,
context->param
);
std::string sip, sserver, sauthors, sversion;
std::string sip, sserver, sprimary, sauthors, sversion;
if ((ret = context->rtmp->connect_app2(context->app, tcUrl, NULL, true,
sip, sserver, sauthors, sversion, *srs_id, *srs_pid)) != ERROR_SUCCESS) {
sip, sserver, sprimary, sauthors, sversion, *srs_id, *srs_pid)) != ERROR_SUCCESS) {
return ret;
}
snprintf(srs_server_ip, 128, "%s", sip.c_str());
snprintf(srs_server, 128, "%s", sserver.c_str());
snprintf(srs_primary_authors, 128, "%s", sauthors.c_str());
snprintf(srs_primary, 128, "%s", sprimary.c_str());
snprintf(srs_authors, 128, "%s", sauthors.c_str());
snprintf(srs_version, 32, "%s", sversion.c_str());
return ret;
... ...
... ... @@ -107,13 +107,15 @@ int srs_connect_app(srs_rtmp_t rtmp);
* SRS debug info:
* @param srs_server_ip, 128bytes, debug info, server ip client connected at.
* @param srs_server, 128bytes, server info.
* @param srs_primary_authors, 128bytes, primary authors.
* @param srs_primary, 128bytes, primary authors.
* @param srs_authors, 128bytes, authors.
* @param srs_version, 32bytes, server version.
* @param srs_id, int, debug info, client id in server log.
* @param srs_pid, int, debug info, server pid in log.
*/
int srs_connect_app2(srs_rtmp_t rtmp,
char srs_server_ip[128], char srs_server[128], char srs_primary_authors[128],
char srs_server_ip[128], char srs_server[128],
char srs_primary[128], char srs_authors[128],
char srs_version[32], int* srs_id, int* srs_pid
);
... ...
... ... @@ -447,8 +447,9 @@ int SrsRtmpClient::connect_app(string app, string tc_url,
int SrsRtmpClient::connect_app2(
string app, string tc_url, SrsRequest* req, bool debug_srs_upnode,
string& srs_server_ip, string& srs_server, string& srs_primary_authors,
string& srs_version, int& srs_id, int& srs_pid
string& srs_server_ip, string& srs_server, string& srs_primary,
string& srs_authors, string& srs_version, int& srs_id,
int& srs_pid
){
int ret = ERROR_SUCCESS;
... ... @@ -513,8 +514,11 @@ int SrsRtmpClient::connect_app2(
SrsAmf0EcmaArray* arr = data->to_ecma_array();
SrsAmf0Any* prop = NULL;
if ((prop = arr->ensure_property_string("srs_primary_authors")) != NULL) {
srs_primary_authors = prop->to_str();
if ((prop = arr->ensure_property_string("srs_primary")) != NULL) {
srs_primary = prop->to_str();
}
if ((prop = arr->ensure_property_string("srs_authors")) != NULL) {
srs_authors = prop->to_str();
}
if ((prop = arr->ensure_property_string("srs_version")) != NULL) {
srs_version = prop->to_str();
... ...
... ... @@ -259,14 +259,16 @@ public:
* SRS debug info:
* @param srs_server_ip, debug info, server ip client connected at.
* @param srs_server, server info.
* @param srs_primary_authors, primary authors.
* @param srs_primary, primary authors.
* @param srs_authors, authors.
* @param srs_id, int, debug info, client id in server log.
* @param srs_pid, int, debug info, server pid in log.
*/
virtual int connect_app2(
std::string app, std::string tc_url, SrsRequest* req, bool debug_srs_upnode,
std::string& srs_server_ip, std::string& srs_server, std::string& srs_primary_authors,
std::string& srs_version, int& srs_id, int& srs_pid
std::string& srs_server_ip, std::string& srs_server, std::string& srs_primary,
std::string& srs_authors, std::string& srs_version, int& srs_id,
int& srs_pid
);
/**
* create a stream, then play/publish data over this stream.
... ...