Lines Matching refs:rt

57     RTMP_HTTPContext *rt = h->priv_data;
62 ff_url_join(uri, sizeof(uri), "http", NULL, rt->host, rt->port,
63 "/%s/%s/%d", cmd, rt->client_id, rt->seq++);
65 av_opt_set_bin(rt->stream->priv_data, "post_data", rt->out_data,
66 rt->out_size, 0);
69 if ((ret = ff_http_do_new_request(rt->stream, uri)) < 0)
73 rt->out_size = 0;
76 if ((ret = ffurl_read(rt->stream, &c, 1)) < 0)
80 rt->nb_bytes_read = 0;
87 RTMP_HTTPContext *rt = h->priv_data;
89 if (rt->out_size + size > rt->out_capacity) {
91 rt->out_capacity = (rt->out_size + size) * 2;
92 if ((err = av_reallocp(&rt->out_data, rt->out_capacity)) < 0) {
93 rt->out_size = 0;
94 rt->out_capacity = 0;
99 memcpy(rt->out_data + rt->out_size, buf, size);
100 rt->out_size += size;
107 RTMP_HTTPContext *rt = h->priv_data;
112 ret = ffurl_read(rt->stream, buf + off, size);
117 if (rt->finishing) {
126 if (rt->out_size > 0) {
130 if (rt->nb_bytes_read == 0) {
150 rt->nb_bytes_read += ret;
159 RTMP_HTTPContext *rt = h->priv_data;
163 if (rt->initialized) {
165 rt->finishing = 1;
172 rt->out_size = 0;
178 av_freep(&rt->out_data);
179 ffurl_closep(&rt->stream);
186 RTMP_HTTPContext *rt = h->priv_data;
190 av_url_split(NULL, 0, NULL, 0, rt->host, sizeof(rt->host), &rt->port,
200 if (rt->tls) {
201 if (rt->port < 0)
202 rt->port = RTMPTS_DEFAULT_PORT;
203 ff_url_join(url, sizeof(url), "https", NULL, rt->host, rt->port, "/open/1");
205 if (rt->port < 0)
206 rt->port = RTMPT_DEFAULT_PORT;
207 ff_url_join(url, sizeof(url), "http", NULL, rt->host, rt->port, "/open/1");
211 if ((ret = ffurl_alloc(&rt->stream, url, AVIO_FLAG_READ_WRITE, &h->interrupt_callback)) < 0)
219 av_opt_set(rt->stream->priv_data, "headers", headers, 0);
220 av_opt_set(rt->stream->priv_data, "multiple_requests", "1", 0);
221 av_opt_set_bin(rt->stream->priv_data, "post_data", "", 1, 0);
223 if (!rt->stream->protocol_whitelist && h->protocol_whitelist) {
224 rt->stream->protocol_whitelist = av_strdup(h->protocol_whitelist);
225 if (!rt->stream->protocol_whitelist) {
232 if ((ret = ffurl_connect(rt->stream, NULL)) < 0)
237 ret = ffurl_read(rt->stream, rt->client_id + off, sizeof(rt->client_id) - off);
243 if (off == sizeof(rt->client_id)) {
248 while (off > 0 && av_isspace(rt->client_id[off - 1]))
250 rt->client_id[off] = '\0';
253 rt->initialized = 1;