UDP protocol. More...
#include "avformat.h"
#include <unistd.h>
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include <sys/time.h>
Go to the source code of this file.
Data Structures | |
struct | UDPContext |
Defines | |
#define | _BSD_SOURCE |
#define | IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP |
#define | IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP |
#define | IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) |
#define | IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) |
#define | UDP_TX_BUF_SIZE 32768 |
#define | UDP_MAX_PKT_SIZE 65536 |
Functions | |
static int | udp_set_multicast_ttl (int sockfd, int mcastTTL, struct sockaddr *addr) |
static int | udp_join_multicast_group (int sockfd, struct sockaddr *addr) |
static int | udp_leave_multicast_group (int sockfd, struct sockaddr *addr) |
static struct addrinfo * | udp_resolve_host (const char *hostname, int port, int type, int family, int flags) |
static int | udp_set_url (struct sockaddr_storage *addr, const char *hostname, int port) |
static int | is_multicast_address (struct sockaddr_storage *addr) |
static int | udp_socket_create (UDPContext *s, struct sockaddr_storage *addr, int *addr_len) |
static int | udp_port (struct sockaddr_storage *addr, int addr_len) |
int | udp_set_remote_url (URLContext *h, const char *uri) |
If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address. | |
int | udp_get_local_port (URLContext *h) |
Return the local port used by the UDP connexion. | |
int | udp_get_file_handle (URLContext *h) |
Return the udp file handle for select() usage to wait for several RTP streams at the same time. | |
static int | udp_open (URLContext *h, const char *uri, int flags) |
static int | udp_read (URLContext *h, uint8_t *buf, int size) |
static int | udp_write (URLContext *h, uint8_t *buf, int size) |
static int | udp_close (URLContext *h) |
Variables | |
URLProtocol | udp_protocol |
UDP protocol.
Definition in file udp.c.
#define IN6_IS_ADDR_MULTICAST | ( | a | ) | (((uint8_t *) (a))[0] == 0xff) |
Definition at line 46 of file udp.c.
Referenced by is_multicast_address().
#define IN_MULTICAST | ( | a | ) | ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) |
Definition at line 43 of file udp.c.
Referenced by is_multicast_address().
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP |
Definition at line 39 of file udp.c.
Referenced by udp_join_multicast_group().
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP |
Definition at line 40 of file udp.c.
Referenced by udp_leave_multicast_group().
#define UDP_TX_BUF_SIZE 32768 |
Definition at line 60 of file udp.c.
Referenced by udp_open().
static int is_multicast_address | ( | struct sockaddr_storage * | addr | ) | [static] |
Definition at line 185 of file udp.c.
Referenced by udp_set_remote_url().
static int udp_close | ( | URLContext * | h | ) | [static] |
int udp_get_file_handle | ( | URLContext * | h | ) |
int udp_get_local_port | ( | URLContext * | h | ) |
Return the local port used by the UDP connexion.
s1 | media file context |
Definition at line 286 of file udp.c.
Referenced by rtp_get_local_port(), rtp_get_local_rtcp_port(), rtp_get_local_rtp_port(), and rtp_open().
static int udp_join_multicast_group | ( | int | sockfd, | |
struct sockaddr * | addr | |||
) | [static] |
Definition at line 85 of file udp.c.
Referenced by udp_open().
static int udp_leave_multicast_group | ( | int | sockfd, | |
struct sockaddr * | addr | |||
) | [static] |
Definition at line 114 of file udp.c.
Referenced by udp_close().
static int udp_open | ( | URLContext * | h, | |
const char * | uri, | |||
int | flags | |||
) | [static] |
static int udp_port | ( | struct sockaddr_storage * | addr, | |
int | addr_len | |||
) | [static] |
Definition at line 235 of file udp.c.
Referenced by udp_open().
static int udp_read | ( | URLContext * | h, | |
uint8_t * | buf, | |||
int | size | |||
) | [static] |
static struct addrinfo* udp_resolve_host | ( | const char * | hostname, | |
int | port, | |||
int | type, | |||
int | family, | |||
int | flags | |||
) | [static, read] |
Definition at line 143 of file udp.c.
Referenced by udp_set_url(), and udp_socket_create().
static int udp_set_multicast_ttl | ( | int | sockfd, | |
int | mcastTTL, | |||
struct sockaddr * | addr | |||
) | [static] |
Definition at line 63 of file udp.c.
Referenced by udp_open().
int udp_set_remote_url | ( | URLContext * | h, | |
const char * | uri | |||
) |
If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address.
url syntax: udp://host:port[?option=val...] option: 'ttl=n' : set the ttl value (for multicast only) 'localport=n' : set the local port 'pkt_size=n' : set max packet size 'reuse=1' : enable reusing the socket
s1 | media file context | |
uri | of the remote server |
Definition at line 263 of file udp.c.
Referenced by rtp_set_remote_url(), and udp_open().
static int udp_set_url | ( | struct sockaddr_storage * | addr, | |
const char * | hostname, | |||
int | port | |||
) | [static] |
Definition at line 170 of file udp.c.
Referenced by udp_set_remote_url().
static int udp_socket_create | ( | UDPContext * | s, | |
struct sockaddr_storage * | addr, | |||
int * | addr_len | |||
) | [static] |
Definition at line 199 of file udp.c.
Referenced by udp_open().
static int udp_write | ( | URLContext * | h, | |
uint8_t * | buf, | |||
int | size | |||
) | [static] |