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

support amf0 and json to convert with each other.

This commit is contained in:
winlin 2015-09-19 13:31:57 +08:00
parent 3f7e69b617
commit b59d9ba6a1
7 changed files with 181 additions and 21 deletions

View file

@ -5573,22 +5573,22 @@ vector<SrsConfDirective*> SrsConfig::get_exec_publishs(string vhost)
vector<SrsConfDirective*> SrsConfig::get_ingesters(string vhost)
{
vector<SrsConfDirective*> ingeters;
vector<SrsConfDirective*> integers;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return ingeters;
return integers;
}
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* ingester = conf->directives[i];
if (ingester->name == "ingest") {
ingeters.push_back(ingester);
integers.push_back(ingester);
}
}
return ingeters;
return integers;
}
SrsConfDirective* SrsConfig::get_ingest_by_id(string vhost, string ingest_id)

View file

@ -81,7 +81,7 @@ int srs_api_response_jsonp_code(ISrsHttpResponseWriter* w, string callback, int
SrsJsonObject* obj = SrsJsonAny::object();
SrsAutoFree(SrsJsonObject, obj);
obj->set("code", SrsJsonAny::ingeter(code));
obj->set("code", SrsJsonAny::integer(code));
return srs_api_response_jsonp(w, callback, obj->to_json());
}
@ -101,7 +101,7 @@ int srs_api_response_json_code(ISrsHttpResponseWriter* w, int code)
SrsJsonObject* obj = SrsJsonAny::object();
SrsAutoFree(SrsJsonObject, obj);
obj->set("code", SrsJsonAny::ingeter(code));
obj->set("code", SrsJsonAny::integer(code));
return srs_api_response_json(w, obj->to_json());
}