1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

update PRIMARY, AUTHORS, CONTRIBUTORS rule. 2.0.32.

This commit is contained in:
winlin 2014-11-25 10:41:55 +08:00
parent 3c46bcbddc
commit e7ccbce472
22 changed files with 119 additions and 63 deletions

View file

@ -43,7 +43,8 @@ int main(int argc, char** argv)
// srs debug info.
char srs_server_ip[128];
char srs_server[128];
char srs_primary_authors[128];
char srs_primary[128];
char srs_authors[128];
char srs_version[32];
int srs_id = 0;
int srs_pid = 0;
@ -60,7 +61,8 @@ int main(int argc, char** argv)
// set to zero.
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;
printf("RTMP bandwidth check/test with server.\n");
@ -90,7 +92,8 @@ int main(int argc, char** argv)
srs_human_trace("simple handshake success");
if ((ret = srs_rtmp_connect_app2(rtmp,
srs_server_ip, srs_server, srs_primary_authors, srs_version, &srs_id, &srs_pid)) != 0) {
srs_server_ip, srs_server, srs_primary, srs_authors, srs_version,
&srs_id, &srs_pid)) != 0) {
srs_human_trace("connect vhost/app failed.");
goto rtmp_destroy;
}
@ -105,12 +108,12 @@ int main(int argc, char** argv)
}
srs_human_trace("bandwidth check/test success");
srs_human_trace("\n%s, %s\n"
srs_human_trace("\n%s, %s, %s\n"
"%s, %s, srs_pid=%d, srs_id=%d\n"
"duration: %dms(%d+%d)\n"
"play: %dkbps\n"
"publish: %dkbps",
(char*)srs_server, (char*)srs_primary_authors,
(char*)srs_server, (char*)srs_primary, (char*)srs_authors,
(char*)srs_server_ip, (char*)srs_version, srs_pid, srs_id,
(int)(end_time - start_time), play_duration, publish_duration,
play_kbps,
@ -121,7 +124,8 @@ rtmp_destroy:
fprintf(stderr, "{\"code\":%d,"
"\"srs_server\":\"%s\", "
"\"srs_primary_authors\":\"%s\", "
"\"srs_primary\":\"%s\", "
"\"srs_authors\":\"%s\", "
"\"srs_server_ip\":\"%s\", "
"\"srs_version\":\"%s\", "
"\"srs_pid\":%d, "
@ -132,7 +136,7 @@ rtmp_destroy:
"\"publish_kbps\":%d"
"}",
ret,
(char*)srs_server, (char*)srs_primary_authors,
(char*)srs_server, (char*)srs_primary, (char*)srs_authors,
(char*)srs_server_ip, (char*)srs_version, srs_pid, srs_id,
(int)(end_time - start_time), play_duration, publish_duration,
play_kbps, publish_kbps);

View file

@ -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) {

View file

@ -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);

View file

@ -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));

View file

@ -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;

View file

@ -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;