mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
support gmd. change work_dir. hourglass. add utilies.
This commit is contained in:
parent
c9b977d337
commit
f1e7e9d933
33 changed files with 702 additions and 73 deletions
|
@ -467,6 +467,8 @@ int srs_librtmp_context_parse_uri(Context* context)
|
|||
std::string schema;
|
||||
|
||||
srs_parse_rtmp_url(context->url, context->tcUrl, context->stream);
|
||||
|
||||
// when connect, we only need to parse the tcUrl
|
||||
srs_discovery_tc_url(context->tcUrl,
|
||||
schema, context->host, context->vhost, context->app, context->port,
|
||||
context->param);
|
||||
|
@ -688,11 +690,11 @@ int srs_rtmp_connect_app(srs_rtmp_t rtmp)
|
|||
|
||||
srs_assert(rtmp != NULL);
|
||||
Context* context = (Context*)rtmp;
|
||||
|
||||
|
||||
string tcUrl = srs_generate_tc_url(
|
||||
context->ip, context->vhost, context->app, context->port,
|
||||
context->param
|
||||
);
|
||||
context->ip, context->vhost, context->app, context->port,
|
||||
context->param
|
||||
);
|
||||
|
||||
if ((ret = context->rtmp->connect_app(
|
||||
context->app, tcUrl, context->req, true)) != ERROR_SUCCESS)
|
||||
|
@ -742,6 +744,38 @@ int srs_rtmp_connect_app2(srs_rtmp_t rtmp,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int srs_rtmp_connect_app3(srs_rtmp_t rtmp, enum srs_url_schema sus)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_assert(rtmp != NULL);
|
||||
Context* context = (Context*)rtmp;
|
||||
|
||||
string tcUrl;
|
||||
switch(sus) {
|
||||
case srs_url_schema_normal:
|
||||
tcUrl=srs_generate_normal_tc_url(context->ip, context->vhost, context->app, context->port);
|
||||
break;
|
||||
case srs_url_schema_via:
|
||||
tcUrl=srs_generate_via_tc_url(context->ip, context->vhost, context->app, context->port);
|
||||
break;
|
||||
case srs_url_schema_vis:
|
||||
case srs_url_schema_vis2:
|
||||
tcUrl=srs_generate_vis_tc_url(context->ip, context->vhost, context->app, context->port);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ret = context->rtmp->connect_app(
|
||||
context->app, tcUrl, context->req, true)) != ERROR_SUCCESS)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int srs_rtmp_play_stream(srs_rtmp_t rtmp)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
|
|
@ -68,6 +68,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
extern "C"{
|
||||
#endif
|
||||
|
||||
/**
|
||||
* the schema of url, now bravo support 4 kinds of url:
|
||||
* srs_url_schema_normal: rtmp://vhost:port/app/stream
|
||||
* srs_url_schema_via : rtmp://ip:port/vhost/app/stream
|
||||
* srs_url_schema_vis : rtmp://ip:port/app/stream?vhost=xxx
|
||||
* srs_url_schema_vis2 : rtmp://ip:port/app/stream?domain=xxx
|
||||
*/
|
||||
enum srs_url_schema{
|
||||
srs_url_schema_normal = 0,
|
||||
srs_url_schema_via,
|
||||
srs_url_schema_vis,
|
||||
srs_url_schema_vis2
|
||||
};
|
||||
|
||||
// typedefs
|
||||
typedef int srs_bool;
|
||||
|
||||
|
@ -187,6 +201,16 @@ extern int srs_rtmp_connect_app2(srs_rtmp_t rtmp,
|
|||
char srs_version[32], int* srs_id, int* srs_pid
|
||||
);
|
||||
|
||||
/**
|
||||
* connect to rtmp vhost/app
|
||||
* category: publish/play
|
||||
* previous: handshake
|
||||
* next: publish or play
|
||||
*
|
||||
* @return 0, success; otherswise, failed.
|
||||
*/
|
||||
extern int srs_rtmp_connect_app3(srs_rtmp_t rtmp, enum srs_url_schema sus);
|
||||
|
||||
/**
|
||||
* play a live/vod stream.
|
||||
* category: play
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue