35 #define RTMPT_DEFAULT_PORT 80
36 #define RTMPTS_DEFAULT_PORT RTMPS_DEFAULT_PORT
187 char headers[1024], url[1024];
216 "Cache-Control: no-cache\r\n"
217 "Content-type: application/x-fcs\r\n"
218 "User-Agent: Shockwave Flash\r\n");
253 #define OFFSET(x) offsetof(RTMP_HTTPContext, x)
254 #define DEC AV_OPT_FLAG_DECODING_PARAM
257 {
"ffrtmphttp_tls",
"Use a HTTPS tunneling connection (RTMPTS).",
OFFSET(tls),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1,
DEC},
269 .
name =
"ffrtmphttp",
276 .priv_data_class= &ffrtmphttp_class,
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
int tls
use Transport Security Layer (RTMPTS)
URLContext * stream
HTTP stream.
#define URL_PROTOCOL_FLAG_NETWORK
#define LIBAVUTIL_VERSION_INT
int ffurl_connect(URLContext *uc, AVDictionary **options)
Connect an URLContext that has been allocated by ffurl_alloc.
int out_capacity
current output buffer capacity
int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
uint8_t * out_data
output buffer
int av_usleep(unsigned usec)
Sleep for a period of time.
#define RTMPTS_DEFAULT_PORT
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
int out_size
current output buffer size
static const AVOption ffrtmphttp_options[]
int nb_bytes_read
number of bytes read since the last request
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
#define AVERROR_EOF
End of file.
char client_id[64]
client ID used for all requests except the first one
int ffurl_alloc(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb)
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connectio...
static int rtmp_http_send_cmd(URLContext *h, const char *cmd)
int seq
sequence ID used for all requests
static int rtmp_http_open(URLContext *h, const char *uri, int flags)
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
#define RTMPT_DEFAULT_PORT
static int rtmp_http_close(URLContext *h)
#define AVIO_FLAG_NONBLOCK
Use non-blocking mode.
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
static int rtmp_http_write(URLContext *h, const uint8_t *buf, int size)
Describe the class of an AVClass context structure.
static const AVClass ffrtmphttp_class
int finishing
flag indicating when the client closes the connection
URLProtocol ff_ffrtmphttp_protocol
int ffurl_close(URLContext *h)
int ff_http_do_new_request(URLContext *h, const char *uri)
Send a new HTTP request, reusing the old connection.
static int rtmp_http_read(URLContext *h, uint8_t *buf, int size)
int port
port to connect (default is 80)
int initialized
flag indicating when the http context is initialized
char host[256]
hostname of the server
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf...