MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / rtmp_http_send_cmd

Function rtmp_http_send_cmd

libavformat/rtmphttp.c:54–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52} RTMP_HTTPContext;
53
54static int rtmp_http_send_cmd(URLContext *h, const char *cmd)
55{
56 RTMP_HTTPContext *rt = h->priv_data;
57 char uri[2048];
58 uint8_t c;
59 int ret;
60
61 ff_url_join(uri, sizeof(uri), "http", NULL, rt->host, rt->port,
62 "/%s/%s/%d", cmd, rt->client_id, rt->seq++);
63
64 av_opt_set_bin(rt->stream->priv_data, "post_data", rt->out_data,
65 rt->out_size, 0);
66
67 /* send a new request to the server */
68 if ((ret = ff_http_do_new_request(rt->stream, uri)) < 0)
69 return ret;
70
71 /* re-init output buffer */
72 rt->out_size = 0;
73
74 /* read the first byte which contains the polling interval */
75 if ((ret = ffurl_read(rt->stream, &c, 1)) < 0)
76 return ret;
77
78 /* re-init the number of bytes read */
79 rt->nb_bytes_read = 0;
80
81 return ret;
82}
83
84static int rtmp_http_write(URLContext *h, const uint8_t *buf, int size)
85{

Callers 2

rtmp_http_readFunction · 0.85
rtmp_http_closeFunction · 0.85

Calls 4

ff_url_joinFunction · 0.85
av_opt_set_binFunction · 0.85
ff_http_do_new_requestFunction · 0.85
ffurl_readFunction · 0.85

Tested by

no test coverage detected