Go to the documentation of this file.
49 #define DEFAULT_ICE_USER "source"
51 #define NOT_EMPTY(s) (s && s[0])
53 #define OFFSET(x) offsetof(IcecastContext, x)
54 #define E AV_OPT_FLAG_ENCODING_PARAM
65 {
"legacy_icecast",
"use legacy SOURCE method, for Icecast < v2.4",
OFFSET(legacy_icecast),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
E },
92 char h_url[1024], host[1024], auth[1024], path[1024];
104 cat_header(&bp,
"Ice-Description",
s->description);
107 cat_header(&bp,
"Ice-Public",
s->public ?
"1" :
"0");
116 av_dict_set(&opt_dict,
"method",
s->legacy_icecast ?
"SOURCE" :
"PUT", 0);
120 av_dict_set(&opt_dict,
"send_expect_100",
s->legacy_icecast ?
"-1" :
"1", 0);
122 av_dict_set(&opt_dict,
"content_type",
s->content_type, 0);
124 av_dict_set(&opt_dict,
"content_type",
"audio/mpeg", 0);
130 &port, path,
sizeof(path), uri);
134 char *sep = strchr(auth,
':');
157 s->pass ?
s->pass :
"");
160 if (!path[0] || strcmp(path,
"/") == 0) {
168 s->tls ?
"https" :
"http",
169 auth, host, port,
"%s", path);
172 &opt_dict,
h->protocol_whitelist,
h->protocol_blacklist,
h);
184 if (!
s->send_started) {
186 if (!
s->content_type &&
size >= 8) {
187 static const uint8_t oggs[4] = { 0x4F, 0x67, 0x67, 0x53 };
188 static const uint8_t webm[4] = { 0x1A, 0x45, 0xDF, 0xA3 };
189 static const uint8_t opus[8] = { 0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64 };
190 if (memcmp(buf, oggs,
sizeof(oggs)) == 0) {
193 }
else if (memcmp(buf, opus,
sizeof(opus)) == 0) {
196 }
else if (memcmp(buf, webm,
sizeof(webm)) == 0) {
static const AVOption options[]
#define AV_LOG_WARNING
Something somehow does not look correct.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define URL_PROTOCOL_FLAG_NETWORK
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
static int ffurl_write(URLContext *h, const uint8_t *buf, int size)
Write size bytes from buf to the resource accessed by h.
static av_cold void cleanup(FlashSV2Context *s)
static int icecast_write(URLContext *h, const uint8_t *buf, int size)
static int icecast_close(URLContext *h)
#define AV_BPRINT_SIZE_AUTOMATIC
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const URLProtocol ff_icecast_protocol
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
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.
static const AVClass icecast_context_class
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
void av_bprintf(AVBPrint *buf, const char *fmt,...)
FFmpeg currently uses a custom build this text attempts to document some of its obscure features and options Makefile the full command issued by make and its output will be shown on the screen DBG Preprocess x86 external assembler files to a dbg asm file in the object which then gets compiled Helps in developing those assembler files DESTDIR Destination directory for the install useful to prepare packages or install FFmpeg in cross environments GEN Set to ‘1’ to generate the missing or mismatched references Makefile builds all the libraries and the executables fate Run the fate test note that you must have installed it fate list List all fate regression test targets install Install headers
#define AVIO_FLAG_READ
read-only
char * av_strdup(const char *s)
Duplicate a string.
static int icecast_open(URLContext *h, const char *uri, int flags)
static void cat_header(AVBPrint *bp, const char key[], const char value[])
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define flags(name, subs,...)