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");
261 #define OFFSET(x) offsetof(RTMP_HTTPContext, x)
262 #define DEC AV_OPT_FLAG_DECODING_PARAM
277 .
name =
"ffrtmphttp",
284 .priv_data_class= &ffrtmphttp_class,
285 .default_whitelist =
"https,http,tcp,tls",
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
const URLProtocol ff_ffrtmphttp_protocol
#define LIBAVUTIL_VERSION_INT
int ffurl_connect(URLContext *uc, AVDictionary **options)
Connect an URLContext that has been allocated by ffurl_alloc.
AVIOInterruptCB interrupt_callback
int out_capacity
current output buffer capacity
const char * av_default_item_name(void *ptr)
Return the context name.
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
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 out_size
current output buffer size
static const AVOption ffrtmphttp_options[]
int nb_bytes_read
number of bytes read since the last request
#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)
const char * protocol_whitelist
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)
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
char * av_strdup(const char *s)
Duplicate a string.
#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
#define flags(name, subs,...)
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...