mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
srs-librtmp add rtmp prefix for rtmp apis. 2.0.29
This commit is contained in:
parent
180106ce70
commit
aa69f6197a
13 changed files with 95 additions and 95 deletions
|
@ -116,19 +116,19 @@ int main(int argc, char** argv)
|
|||
// connect rtmp context
|
||||
srs_rtmp_t rtmp = srs_rtmp_create(rtmp_url);
|
||||
|
||||
if (srs_simple_handshake(rtmp) != 0) {
|
||||
if (srs_rtmp_handshake(rtmp) != 0) {
|
||||
srs_human_trace("simple handshake failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("simple handshake success");
|
||||
|
||||
if (srs_connect_app(rtmp) != 0) {
|
||||
if (srs_rtmp_connect_app(rtmp) != 0) {
|
||||
srs_human_trace("connect vhost/app failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("connect vhost/app success");
|
||||
|
||||
if (srs_publish_stream(rtmp) != 0) {
|
||||
if (srs_rtmp_publish_stream(rtmp) != 0) {
|
||||
srs_human_trace("publish stream failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
gcc srs_bandwidth_check.c ../../objs/lib/srs_librtmp.a -g -O0 -lstdc++ -o srs_bandwidth_check
|
||||
gcc srs_rtmp_bandwidth_check.c ../../objs/lib/srs_librtmp.a -g -O0 -lstdc++ -o srs_rtmp_bandwidth_check
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -83,20 +83,20 @@ int main(int argc, char** argv)
|
|||
|
||||
srs_human_trace("bandwidth check/test url: %s", argv[1]);
|
||||
|
||||
if ((ret = srs_simple_handshake(rtmp)) != 0) {
|
||||
if ((ret = srs_rtmp_handshake(rtmp)) != 0) {
|
||||
srs_human_trace("simple handshake failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("simple handshake success");
|
||||
|
||||
if ((ret = srs_connect_app2(rtmp,
|
||||
if ((ret = srs_rtmp_connect_app2(rtmp,
|
||||
srs_server_ip, srs_server, srs_primary_authors, srs_version, &srs_id, &srs_pid)) != 0) {
|
||||
srs_human_trace("connect vhost/app failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("connect vhost/app success");
|
||||
|
||||
if ((ret = srs_bandwidth_check(rtmp,
|
||||
if ((ret = srs_rtmp_bandwidth_check(rtmp,
|
||||
&start_time, &end_time, &play_kbps, &publish_kbps,
|
||||
&play_bytes, &publish_bytes, &play_duration, &publish_duration)) != 0
|
||||
) {
|
||||
|
|
|
@ -90,33 +90,33 @@ int main(int argc, char** argv)
|
|||
|
||||
rtmp = srs_rtmp_create(rtmp_url);
|
||||
|
||||
if ((ret = __srs_dns_resolve(rtmp)) != 0) {
|
||||
if ((ret = __srs_rtmp_dns_resolve(rtmp)) != 0) {
|
||||
srs_human_trace("dns resolve failed. ret=%d", ret);
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("dns resolve success");
|
||||
time_dns_resolve = srs_utils_get_time_ms();
|
||||
|
||||
if ((ret = __srs_connect_server(rtmp)) != 0) {
|
||||
if ((ret = __srs_rtmp_connect_server(rtmp)) != 0) {
|
||||
srs_human_trace("socket connect failed. ret=%d", ret);
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("socket connect success");
|
||||
time_socket_connect = srs_utils_get_time_ms();
|
||||
|
||||
if ((ret = __srs_do_simple_handshake(rtmp)) != 0) {
|
||||
if ((ret = __srs_rtmp_do_simple_handshake(rtmp)) != 0) {
|
||||
srs_human_trace("do simple handshake failed. ret=%d", ret);
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("do simple handshake success");
|
||||
|
||||
if ((ret = srs_connect_app(rtmp)) != 0) {
|
||||
if ((ret = srs_rtmp_connect_app(rtmp)) != 0) {
|
||||
srs_human_trace("connect vhost/app failed. ret=%d", ret);
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("connect vhost/app success");
|
||||
|
||||
if ((ret = srs_play_stream(rtmp)) != 0) {
|
||||
if ((ret = srs_rtmp_play_stream(rtmp)) != 0) {
|
||||
srs_human_trace("play stream failed. ret=%d", ret);
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ int main(int argc, char** argv)
|
|||
time_play_stream = srs_utils_get_time_ms();
|
||||
|
||||
for (;;) {
|
||||
if ((ret = srs_read_packet(rtmp, &type, ×tamp, &data, &size)) != 0) {
|
||||
if ((ret = srs_rtmp_read_packet(rtmp, &type, ×tamp, &data, &size)) != 0) {
|
||||
srs_human_trace("read packet failed. ret=%d", ret);
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
|
|
@ -128,19 +128,19 @@ int main(int argc, char** argv)
|
|||
// connect rtmp context
|
||||
srs_rtmp_t rtmp = srs_rtmp_create(rtmp_url);
|
||||
|
||||
if (srs_simple_handshake(rtmp) != 0) {
|
||||
if (srs_rtmp_handshake(rtmp) != 0) {
|
||||
srs_human_trace("simple handshake failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("simple handshake success");
|
||||
|
||||
if (srs_connect_app(rtmp) != 0) {
|
||||
if (srs_rtmp_connect_app(rtmp) != 0) {
|
||||
srs_human_trace("connect vhost/app failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("connect vhost/app success");
|
||||
|
||||
if (srs_publish_stream(rtmp) != 0) {
|
||||
if (srs_rtmp_publish_stream(rtmp) != 0) {
|
||||
srs_human_trace("publish stream failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, int32_t* pstarttime, u
|
|||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = srs_write_packet(ortmp, type, *ptimestamp, data, size)) != 0) {
|
||||
if ((ret = srs_rtmp_write_packet(ortmp, type, *ptimestamp, data, size)) != 0) {
|
||||
srs_human_trace("irtmp get packet failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -191,19 +191,19 @@ int connect_oc(srs_rtmp_t ortmp)
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if ((ret = srs_simple_handshake(ortmp)) != 0) {
|
||||
if ((ret = srs_rtmp_handshake(ortmp)) != 0) {
|
||||
srs_human_trace("ortmp simple handshake failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_human_trace("ortmp simple handshake success");
|
||||
|
||||
if ((ret = srs_connect_app(ortmp)) != 0) {
|
||||
if ((ret = srs_rtmp_connect_app(ortmp)) != 0) {
|
||||
srs_human_trace("ortmp connect vhost/app failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_human_trace("ortmp connect vhost/app success");
|
||||
|
||||
if ((ret = srs_publish_stream(ortmp)) != 0) {
|
||||
if ((ret = srs_rtmp_publish_stream(ortmp)) != 0) {
|
||||
srs_human_trace("ortmp publish stream failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ int proxy(srs_rtmp_t irtmp, srs_rtmp_t ortmp)
|
|||
|
||||
srs_human_trace("start proxy RTMP stream");
|
||||
for (;;) {
|
||||
if ((ret = srs_read_packet(irtmp, &type, ×tamp, &data, &size)) != 0) {
|
||||
if ((ret = srs_rtmp_read_packet(irtmp, &type, ×tamp, &data, &size)) != 0) {
|
||||
srs_human_trace("irtmp get packet failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ int proxy(srs_rtmp_t irtmp, srs_rtmp_t ortmp)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = srs_write_packet(ortmp, type, timestamp, data, size)) != 0) {
|
||||
if ((ret = srs_rtmp_write_packet(ortmp, type, timestamp, data, size)) != 0) {
|
||||
srs_human_trace("irtmp get packet failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -133,19 +133,19 @@ int connect_ic(srs_rtmp_t irtmp)
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if ((ret = srs_simple_handshake(irtmp)) != 0) {
|
||||
if ((ret = srs_rtmp_handshake(irtmp)) != 0) {
|
||||
srs_human_trace("irtmp simple handshake failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_human_trace("irtmp simple handshake success");
|
||||
|
||||
if ((ret = srs_connect_app(irtmp)) != 0) {
|
||||
if ((ret = srs_rtmp_connect_app(irtmp)) != 0) {
|
||||
srs_human_trace("irtmp connect vhost/app failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_human_trace("irtmp connect vhost/app success");
|
||||
|
||||
if ((ret = srs_play_stream(irtmp)) != 0) {
|
||||
if ((ret = srs_rtmp_play_stream(irtmp)) != 0) {
|
||||
srs_human_trace("irtmp play stream failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -158,19 +158,19 @@ int connect_oc(srs_rtmp_t ortmp)
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if ((ret = srs_simple_handshake(ortmp)) != 0) {
|
||||
if ((ret = srs_rtmp_handshake(ortmp)) != 0) {
|
||||
srs_human_trace("ortmp simple handshake failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_human_trace("ortmp simple handshake success");
|
||||
|
||||
if ((ret = srs_connect_app(ortmp)) != 0) {
|
||||
if ((ret = srs_rtmp_connect_app(ortmp)) != 0) {
|
||||
srs_human_trace("ortmp connect vhost/app failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_human_trace("ortmp connect vhost/app success");
|
||||
|
||||
if ((ret = srs_publish_stream(ortmp)) != 0) {
|
||||
if ((ret = srs_rtmp_publish_stream(ortmp)) != 0) {
|
||||
srs_human_trace("ortmp publish stream failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -47,19 +47,19 @@ int main(int argc, char** argv)
|
|||
srs_human_trace("rtmp url: %s", argv[1]);
|
||||
srs_rtmp_t rtmp = srs_rtmp_create(argv[1]);
|
||||
|
||||
if (srs_simple_handshake(rtmp) != 0) {
|
||||
if (srs_rtmp_handshake(rtmp) != 0) {
|
||||
srs_human_trace("simple handshake failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("simple handshake success");
|
||||
|
||||
if (srs_connect_app(rtmp) != 0) {
|
||||
if (srs_rtmp_connect_app(rtmp) != 0) {
|
||||
srs_human_trace("connect vhost/app failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("connect vhost/app success");
|
||||
|
||||
if (srs_play_stream(rtmp) != 0) {
|
||||
if (srs_rtmp_play_stream(rtmp) != 0) {
|
||||
srs_human_trace("play stream failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ int main(int argc, char** argv)
|
|||
char* data;
|
||||
u_int32_t timestamp;
|
||||
|
||||
if (srs_read_packet(rtmp, &type, ×tamp, &data, &size) != 0) {
|
||||
if (srs_rtmp_read_packet(rtmp, &type, ×tamp, &data, &size) != 0) {
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,19 +55,19 @@ int main(int argc, char** argv)
|
|||
srs_human_trace("rtmp url: %s", argv[1]);
|
||||
srs_rtmp_t rtmp = srs_rtmp_create(argv[1]);
|
||||
|
||||
if (srs_simple_handshake(rtmp) != 0) {
|
||||
if (srs_rtmp_handshake(rtmp) != 0) {
|
||||
srs_human_trace("simple handshake failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("simple handshake success");
|
||||
|
||||
if (srs_connect_app(rtmp) != 0) {
|
||||
if (srs_rtmp_connect_app(rtmp) != 0) {
|
||||
srs_human_trace("connect vhost/app failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("connect vhost/app success");
|
||||
|
||||
if (srs_publish_stream(rtmp) != 0) {
|
||||
if (srs_rtmp_publish_stream(rtmp) != 0) {
|
||||
srs_human_trace("publish stream failed.");
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ int main(int argc, char** argv)
|
|||
|
||||
timestamp += 40;
|
||||
|
||||
if (srs_write_packet(rtmp, type, timestamp, data, size) != 0) {
|
||||
if (srs_rtmp_write_packet(rtmp, type, timestamp, data, size) != 0) {
|
||||
goto rtmp_destroy;
|
||||
}
|
||||
srs_human_trace("sent packet: type=%s, time=%d, size=%d",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue