FFmpeg
Data Structures | Macros | Functions | Variables
rtmphttp.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "http.h"
#include "rtmp.h"

Go to the source code of this file.

Data Structures

struct  RTMP_HTTPContext
 

Macros

#define RTMPT_DEFAULT_PORT   80
 
#define RTMPTS_DEFAULT_PORT   RTMPS_DEFAULT_PORT
 
#define OFFSET(x)   offsetof(RTMP_HTTPContext, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int rtmp_http_send_cmd (URLContext *h, const char *cmd)
 
static int rtmp_http_write (URLContext *h, const uint8_t *buf, int size)
 
static int rtmp_http_read (URLContext *h, uint8_t *buf, int size)
 
static int rtmp_http_close (URLContext *h)
 
static int rtmp_http_open (URLContext *h, const char *uri, int flags)
 

Variables

static const AVOption ffrtmphttp_options []
 
static const AVClass ffrtmphttp_class
 
const URLProtocol ff_ffrtmphttp_protocol
 

Detailed Description

RTMP HTTP protocol

Definition in file rtmphttp.c.

Macro Definition Documentation

◆ RTMPT_DEFAULT_PORT

#define RTMPT_DEFAULT_PORT   80

Definition at line 34 of file rtmphttp.c.

◆ RTMPTS_DEFAULT_PORT

#define RTMPTS_DEFAULT_PORT   RTMPS_DEFAULT_PORT

Definition at line 35 of file rtmphttp.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(RTMP_HTTPContext, x)

Definition at line 260 of file rtmphttp.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 261 of file rtmphttp.c.

Function Documentation

◆ rtmp_http_send_cmd()

static int rtmp_http_send_cmd ( URLContext h,
const char *  cmd 
)
static

Definition at line 54 of file rtmphttp.c.

Referenced by rtmp_http_close(), and rtmp_http_read().

◆ rtmp_http_write()

static int rtmp_http_write ( URLContext h,
const uint8_t *  buf,
int  size 
)
static

Definition at line 84 of file rtmphttp.c.

Referenced by rtmp_http_close(), and rtmp_http_read().

◆ rtmp_http_read()

static int rtmp_http_read ( URLContext h,
uint8_t *  buf,
int  size 
)
static

Definition at line 104 of file rtmphttp.c.

Referenced by rtmp_http_close().

◆ rtmp_http_close()

static int rtmp_http_close ( URLContext h)
static

Definition at line 156 of file rtmphttp.c.

Referenced by rtmp_http_open().

◆ rtmp_http_open()

static int rtmp_http_open ( URLContext h,
const char *  uri,
int  flags 
)
static

Definition at line 183 of file rtmphttp.c.

Variable Documentation

◆ ffrtmphttp_options

const AVOption ffrtmphttp_options[]
static
Initial value:
= {
{"ffrtmphttp_tls", "Use a HTTPS tunneling connection (RTMPTS).", OFFSET(tls), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC},
{ NULL },
}

Definition at line 263 of file rtmphttp.c.

◆ ffrtmphttp_class

const AVClass ffrtmphttp_class
static
Initial value:
= {
.class_name = "ffrtmphttp",
.item_name = av_default_item_name,
.option = ffrtmphttp_options,
}

Definition at line 268 of file rtmphttp.c.

◆ ff_ffrtmphttp_protocol

const URLProtocol ff_ffrtmphttp_protocol
Initial value:
= {
.name = "ffrtmphttp",
.url_open = rtmp_http_open,
.url_read = rtmp_http_read,
.url_write = rtmp_http_write,
.url_close = rtmp_http_close,
.priv_data_size = sizeof(RTMP_HTTPContext),
.priv_data_class= &ffrtmphttp_class,
.default_whitelist = "https,http,tcp,tls",
}

Definition at line 275 of file rtmphttp.c.

OFFSET
#define OFFSET(x)
Definition: rtmphttp.c:260
URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:33
ffrtmphttp_options
static const AVOption ffrtmphttp_options[]
Definition: rtmphttp.c:263
rtmp_http_close
static int rtmp_http_close(URLContext *h)
Definition: rtmphttp.c:156
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
rtmp_http_open
static int rtmp_http_open(URLContext *h, const char *uri, int flags)
Definition: rtmphttp.c:183
rtmp_http_write
static int rtmp_http_write(URLContext *h, const uint8_t *buf, int size)
Definition: rtmphttp.c:84
ffrtmphttp_class
static const AVClass ffrtmphttp_class
Definition: rtmphttp.c:268
RTMP_HTTPContext
Definition: rtmphttp.c:38
rtmp_http_read
static int rtmp_http_read(URLContext *h, uint8_t *buf, int size)
Definition: rtmphttp.c:104
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
DEC
#define DEC
Definition: rtmphttp.c:261