FFmpeg  4.4.4
Data Structures | Macros | Functions | Variables
icecast.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "network.h"

Go to the source code of this file.

Data Structures

struct  IcecastContext
 

Macros

#define DEFAULT_ICE_USER   "source"
 
#define NOT_EMPTY(s)   (s && s[0])
 
#define OFFSET(x)   offsetof(IcecastContext, x)
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void cat_header (AVBPrint *bp, const char key[], const char value[])
 
static int icecast_close (URLContext *h)
 
static int icecast_open (URLContext *h, const char *uri, int flags)
 
static int icecast_write (URLContext *h, const uint8_t *buf, int size)
 

Variables

static const AVOption options []
 
static const AVClass icecast_context_class
 
const URLProtocol ff_icecast_protocol
 

Macro Definition Documentation

◆ DEFAULT_ICE_USER

#define DEFAULT_ICE_USER   "source"

Definition at line 49 of file icecast.c.

◆ NOT_EMPTY

#define NOT_EMPTY (   s)    (s && s[0])

Definition at line 51 of file icecast.c.

◆ OFFSET

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

Definition at line 53 of file icecast.c.

◆ E

Definition at line 54 of file icecast.c.

Function Documentation

◆ cat_header()

static void cat_header ( AVBPrint *  bp,
const char  key[],
const char  value[] 
)
static

Definition at line 71 of file icecast.c.

Referenced by icecast_open().

◆ icecast_close()

static int icecast_close ( URLContext h)
static

Definition at line 77 of file icecast.c.

◆ icecast_open()

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

Definition at line 84 of file icecast.c.

◆ icecast_write()

static int icecast_write ( URLContext h,
const uint8_t buf,
int  size 
)
static

Definition at line 181 of file icecast.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "ice_genre", "set stream genre", OFFSET(genre), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "ice_name", "set stream description", OFFSET(name), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "ice_description", "set stream description", OFFSET(description), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "ice_url", "set stream website", OFFSET(url), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "ice_public", "set if stream is public", OFFSET(public), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
{ "user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "content_type", "set content-type, MUST be set if not audio/mpeg", OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", OFFSET(legacy_icecast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
{ "tls", "use a TLS connection", OFFSET(tls), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
{ NULL }
}
#define NULL
Definition: coverity.c:32
@ AV_OPT_TYPE_BOOL
Definition: opt.h:242
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
#define E
Definition: icecast.c:54
#define OFFSET(x)
Definition: icecast.c:53
const char * name
Definition: qsvenc.c:46
#define pass
Definition: tx_template.c:347

Definition at line 56 of file icecast.c.

◆ icecast_context_class

const AVClass icecast_context_class
static
Initial value:
= {
.class_name = "icecast",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: icecast.c:56

Definition at line 208 of file icecast.c.

◆ ff_icecast_protocol

const URLProtocol ff_icecast_protocol
Initial value:
= {
.name = "icecast",
.url_open = icecast_open,
.url_write = icecast_write,
.url_close = icecast_close,
.priv_data_size = sizeof(IcecastContext),
.priv_data_class = &icecast_context_class,
}
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static int icecast_write(URLContext *h, const uint8_t *buf, int size)
Definition: icecast.c:181
static int icecast_open(URLContext *h, const char *uri, int flags)
Definition: icecast.c:84
static const AVClass icecast_context_class
Definition: icecast.c:208
static int icecast_close(URLContext *h)
Definition: icecast.c:77
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34

Definition at line 215 of file icecast.c.