FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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

#define DEFAULT_ICE_USER   "source"

Definition at line 48 of file icecast.c.

Referenced by icecast_open().

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

Definition at line 50 of file icecast.c.

Referenced by cat_header(), and icecast_open().

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

Definition at line 52 of file icecast.c.

Definition at line 53 of file icecast.c.

Function Documentation

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

Definition at line 69 of file icecast.c.

Referenced by icecast_open().

static int icecast_close ( URLContext h)
static

Definition at line 75 of file icecast.c.

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

Definition at line 83 of file icecast.c.

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

Definition at line 178 of file icecast.c.

Variable Documentation

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 },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: icecast.c:52
#define pass
Definition: fft_template.c:532
#define E
Definition: icecast.c:53
const char * name
Definition: opengl_enc.c:103

Definition at line 55 of file icecast.c.

const AVClass icecast_context_class
static
Initial value:
= {
.class_name = "icecast",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: icecast.c:55
av_default_item_name

Definition at line 205 of file icecast.c.

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,
}
static int icecast_open(URLContext *h, const char *uri, int flags)
Definition: icecast.c:83
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
static int icecast_write(URLContext *h, const uint8_t *buf, int size)
Definition: icecast.c:178
static int icecast_close(URLContext *h)
Definition: icecast.c:75
static const AVClass icecast_context_class
Definition: icecast.c:205
static int flags
Definition: cpu.c:47

Definition at line 212 of file icecast.c.