69 char host[1024], path[1024], url[1024];
85 av_strlcpy(host,
"224.2.127.254",
sizeof(host));
103 int addr_type, auth_len;
117 if ((recvbuf[0] & 0xe0) != 0x20) {
123 if (recvbuf[0] & 0x04) {
128 addr_type = recvbuf[0] & 0x10;
129 auth_len = recvbuf[1];
137 if (pos + 4 >= ret) {
141 #define MIME "application/sdp" 142 if (strcmp(&recvbuf[pos],
MIME) == 0) {
143 pos += strlen(
MIME) + 1;
144 }
else if (strncmp(&recvbuf[pos],
"v=0\r\n", 5) == 0) {
199 struct pollfd p = {fd, POLLIN, 0};
207 if (n <= 0 || !(p.revents & POLLIN))
213 if (recvbuf[0] & 0x04 && hash == sap->
hash) {
242 .priv_data_size =
sizeof(
struct SAPState),
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 int sap_read_close(AVFormatContext *s)
#define RTP_MAX_PACKET_LENGTH
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
#define AV_LOG_WARNING
Something somehow does not look correct.
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
AVInputFormat ff_sap_demuxer
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
#define AVIO_FLAG_READ
read-only
void ff_network_close(void)
int ctx_flags
Flags signalling stream properties.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int ff_network_init(void)
miscellaneous OS support macros and functions.
int id
Format-specific stream ID.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
char * protocol_whitelist
A comma-separated list of protocol names that can be used internally by libavformat.
#define AVERROR_EOF
End of file.
#define AV_LOG_VERBOSE
Detailed information.
int ffurl_open(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const URLProtocol **protocols, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it. ...
static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
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.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
char filename[1024]
input or output filename
AVFormatContext * sdp_ctx
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
const URLProtocol ** protocols
char * av_strdup(const char *s)
Duplicate the string s.
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
This structure contains the data a format has to probe a file.
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
static int sap_read_header(AVFormatContext *s)
static int sap_probe(AVProbeData *p)
int ffurl_close(URLContext *h)
Close the resource accessed by the URLContext h, and free the memory used by it.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
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))
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
void * priv_data
Format private data.
char * protocol_blacklist
A comma-separated list of protocol names that will not be used internally by libavformat.
unbuffered private I/O API
AVCodecParameters * codecpar
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
const URLProtocol ** ffurl_get_protocols(const char *whitelist, const char *blacklist)
Construct a list of protocols matching a given whitelist and/or blacklist.
This structure stores compressed data.
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...