|
|
@ -148,12 +148,17 @@ srs_error_t SrsBasicRtmpClient::do_connect_app(string local_ip, bool debug)
|
|
|
|
return err;
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
srs_error_t SrsBasicRtmpClient::publish(int chunk_size, bool with_vhost)
|
|
|
|
srs_error_t SrsBasicRtmpClient::publish(int chunk_size, bool with_vhost, std::string* pstream)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srs_error_t err = srs_success;
|
|
|
|
srs_error_t err = srs_success;
|
|
|
|
|
|
|
|
|
|
|
|
// Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733
|
|
|
|
// Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733
|
|
|
|
string stream = srs_generate_stream_with_query(req->host, req->vhost, req->stream, req->param, with_vhost);
|
|
|
|
string stream = srs_generate_stream_with_query(req->host, req->vhost, req->stream, req->param, with_vhost);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return the generated stream.
|
|
|
|
|
|
|
|
if (pstream) {
|
|
|
|
|
|
|
|
*pstream = stream;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// publish.
|
|
|
|
// publish.
|
|
|
|
if ((err = client->publish(stream, stream_id, chunk_size)) != srs_success) {
|
|
|
|
if ((err = client->publish(stream, stream_id, chunk_size)) != srs_success) {
|
|
|
@ -163,12 +168,17 @@ srs_error_t SrsBasicRtmpClient::publish(int chunk_size, bool with_vhost)
|
|
|
|
return err;
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
srs_error_t SrsBasicRtmpClient::play(int chunk_size, bool with_vhost)
|
|
|
|
srs_error_t SrsBasicRtmpClient::play(int chunk_size, bool with_vhost, std::string* pstream)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srs_error_t err = srs_success;
|
|
|
|
srs_error_t err = srs_success;
|
|
|
|
|
|
|
|
|
|
|
|
// Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733
|
|
|
|
// Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733
|
|
|
|
string stream = srs_generate_stream_with_query(req->host, req->vhost, req->stream, req->param, with_vhost);
|
|
|
|
string stream = srs_generate_stream_with_query(req->host, req->vhost, req->stream, req->param, with_vhost);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return the generated stream.
|
|
|
|
|
|
|
|
if (pstream) {
|
|
|
|
|
|
|
|
*pstream = stream;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ((err = client->play(stream, stream_id, chunk_size)) != srs_success) {
|
|
|
|
if ((err = client->play(stream, stream_id, chunk_size)) != srs_success) {
|
|
|
|
return srs_error_wrap(err, "connect with server failed, stream=%s, stream_id=%d", stream.c_str(), stream_id);
|
|
|
|
return srs_error_wrap(err, "connect with server failed, stream=%s, stream_id=%d", stream.c_str(), stream_id);
|
|
|
|