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
 
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 177 of file icecast.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "ice_genre", "set stream genre", OFFSET(genre), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "ice_name", "set stream description", OFFSET(name), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "ice_description", "set stream description", OFFSET(description), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "ice_url", "set stream website", OFFSET(url), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "ice_public", "set if stream is public", OFFSET(public), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
{ "user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "content_type", "set content-type, MUST be set if not audio/mpeg", OFFSET(content_type), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E },
{ "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", OFFSET(legacy_icecast), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, E },
{ NULL }
}

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,
}

Definition at line 204 of file icecast.c.

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,
}

Definition at line 211 of file icecast.c.