66 char host[1024], path[1024], url[1024];
76 path,
sizeof(path),
s->url);
82 av_strlcpy(host,
"224.2.127.254",
sizeof(host));
88 &
s->interrupt_callback,
NULL,
89 s->protocol_whitelist,
s->protocol_blacklist,
NULL);
94 int addr_type, auth_len;
108 if ((recvbuf[0] & 0xe0) != 0x20) {
114 if (recvbuf[0] & 0x04) {
119 addr_type = recvbuf[0] & 0x10;
120 auth_len = recvbuf[1];
128 if (
pos + 4 >= ret) {
132 #define MIME "application/sdp"
133 if (strcmp(&recvbuf[
pos],
MIME) == 0) {
135 }
else if (strncmp(&recvbuf[
pos],
"v=0\r\n", 5) == 0) {
198 struct pollfd p = {fd, POLLIN, 0};
209 if (n <= 0 || !(p.revents & POLLIN))
215 if (recvbuf[0] & 0x04 &&
hash == sap->
hash) {
227 int i =
s->nb_streams;
243 .priv_data_size =
sizeof(
struct SAPState),
simple assert() macros that are a bit more flexible than ISO C assert().
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.
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 ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
#define AVIO_FLAG_READ
read-only
int ffio_init_context(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
ff_const59 AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
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.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
char * av_strdup(const char *s)
Duplicate a string.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_network_init(void)
void ff_network_close(void)
miscellaneous OS support macros and functions.
#define RTP_MAX_PACKET_LENGTH
static int sap_probe(const AVProbeData *p)
static int sap_read_header(AVFormatContext *s)
AVInputFormat ff_sap_demuxer
static int sap_read_close(AVFormatContext *s)
static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
AVIOContext * pb
I/O context.
int ctx_flags
Flags signalling stream properties.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
AVStream ** streams
A list of all streams in the file.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int id
Format-specific stream ID.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
AVFormatContext * sdp_ctx
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
unbuffered private I/O API