45 #define OFFSET(x) offsetof(UnixContext, x)
46 #define ED AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM
51 {
"stream",
"Stream (reliable stream-oriented)", 0,
AV_OPT_TYPE_CONST, { .i64 = SOCK_STREAM }, INT_MIN, INT_MAX,
ED,
"type" },
52 {
"datagram",
"Datagram (unreliable packet-oriented)", 0,
AV_OPT_TYPE_CONST, { .i64 = SOCK_DGRAM }, INT_MIN, INT_MAX,
ED,
"type" },
53 {
"seqpacket",
"Seqpacket (reliable packet-oriented", 0,
AV_OPT_TYPE_CONST, { .i64 = SOCK_SEQPACKET }, INT_MIN, INT_MAX,
ED,
"type" },
70 s->
addr.sun_family = AF_UNIX;
95 unlink(s->
addr.sun_path);
111 ret = recv(s->
fd, buf, size, 0);
133 unlink(s->
addr.sun_path);
152 .priv_data_class = &unix_class,
static const AVClass unix_class
#define URL_PROTOCOL_FLAG_NETWORK
#define LIBAVUTIL_VERSION_INT
static int unix_write(URLContext *h, const uint8_t *buf, int size)
static int unix_get_file_handle(URLContext *h)
int ff_socket(int af, int type, int proto)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h)
Bind to a file descriptor and poll for a connection.
miscellaneous OS support macros and functions.
int ff_listen_connect(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h, int will_try_next)
Connect to a file descriptor and poll for result.
static int unix_close(URLContext *h)
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.
#define AVIO_FLAG_NONBLOCK
Use non-blocking mode.
Describe the class of an AVClass context structure.
static const AVOption unix_options[]
static int unix_read(URLContext *h, uint8_t *buf, int size)
static int unix_open(URLContext *h, const char *filename, int flags)
URLProtocol ff_unix_protocol
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
int ff_network_wait_fd(int fd, int write)
unbuffered private I/O API