Go to the documentation of this file.
48 #define DEFAULT_ICE_USER "source"
50 #define NOT_EMPTY(s) (s && s[0])
52 #define OFFSET(x) offsetof(IcecastContext, x)
53 #define E AV_OPT_FLAG_ENCODING_PARAM
64 {
"legacy_icecast",
"use legacy SOURCE method, for Icecast < v2.4",
OFFSET(legacy_icecast),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
E },
91 char h_url[1024], host[1024], auth[1024], path[1024];
103 cat_header(&bp,
"Ice-Description",
s->description);
106 cat_header(&bp,
"Ice-Public",
s->public ?
"1" :
"0");
114 av_dict_set(&opt_dict,
"method",
s->legacy_icecast ?
"SOURCE" :
"PUT", 0);
118 av_dict_set(&opt_dict,
"send_expect_100",
s->legacy_icecast ?
"-1" :
"1", 0);
120 av_dict_set(&opt_dict,
"content_type",
s->content_type, 0);
122 av_dict_set(&opt_dict,
"content_type",
"audio/mpeg", 0);
128 &port, path,
sizeof(path), uri);
132 char *sep = strchr(auth,
':');
155 s->pass ?
s->pass :
"");
158 if (!path[0] || strcmp(path,
"/") == 0) {
165 ff_url_join(h_url,
sizeof(h_url),
"http", auth, host, port,
"%s", path);
168 &opt_dict,
h->protocol_whitelist,
h->protocol_blacklist,
h);
181 if (!
s->send_started) {
183 if (!
s->content_type &&
size >= 8) {
184 static const uint8_t oggs[4] = { 0x4F, 0x67, 0x67, 0x53 };
185 static const uint8_t webm[4] = { 0x1A, 0x45, 0xDF, 0xA3 };
186 static const uint8_t opus[8] = { 0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64 };
187 if (memcmp(
buf, oggs,
sizeof(oggs)) == 0) {
190 }
else if (memcmp(
buf, opus,
sizeof(opus)) == 0) {
193 }
else if (memcmp(
buf, webm,
sizeof(webm)) == 0) {
static const AVOption options[]
#define AV_LOG_WARNING
Something somehow does not look correct.
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
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#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 av_cold void cleanup(FlashSV2Context *s)
static int icecast_write(URLContext *h, const uint8_t *buf, int size)
int ffurl_close(URLContext *h)
static int icecast_close(URLContext *h)
#define AV_BPRINT_SIZE_AUTOMATIC
#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.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
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.
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
static const AVClass icecast_context_class
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,...)
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
#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,...)