libavformat/udp.c File Reference
UDP protocol.
More...
#include "avformat.h"
#include "avio_internal.h"
#include "libavutil/parseutils.h"
#include "libavutil/fifo.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include <unistd.h>
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include "url.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 | 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 | udp_socket_create (UDPContext *s, struct sockaddr_storage *addr, int *addr_len, const char *localaddr) |
static int | udp_port (struct sockaddr_storage *addr, int addr_len) |
int | ff_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 | ff_udp_get_local_port (URLContext *h) |
| Return the local port used by the UDP connection.
|
static 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, const uint8_t *buf, int size) |
static int | udp_close (URLContext *h) |
Variables |
URLProtocol | ff_udp_protocol |
Detailed Description
UDP protocol.
Definition in file udp.c.
Define Documentation
Definition at line 27 of file udp.c.
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP |
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP |
#define UDP_MAX_PKT_SIZE 65536 |
#define UDP_TX_BUF_SIZE 32768 |
Function Documentation
int ff_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 'overrun_nonfatal=1': survive in case of circular buffer overrun
- Parameters:
-
| h | media file context |
| uri | of the remote server |
- Returns:
- zero if no error.
Definition at line 268 of file udp.c.
Referenced by ff_rtp_set_remote_url(), and udp_open().
static int udp_get_file_handle |
( |
URLContext * |
h |
) |
[static] |
Return the udp file handle for select() usage to wait for several RTP streams at the same time.
- Parameters:
-
Definition at line 318 of file udp.c.
static int udp_join_multicast_group |
( |
int |
sockfd, |
|
|
struct sockaddr * |
addr | |
|
) |
| | [static] |
static int udp_leave_multicast_group |
( |
int |
sockfd, |
|
|
struct sockaddr * |
addr | |
|
) |
| | [static] |
static int udp_open |
( |
URLContext * |
h, |
|
|
const char * |
uri, |
|
|
int |
flags | |
|
) |
| | [static] |
static struct addrinfo* udp_resolve_host |
( |
const char * |
hostname, |
|
|
int |
port, |
|
|
int |
type, |
|
|
int |
family, |
|
|
int |
flags | |
|
) |
| | [static, read] |
static int udp_set_multicast_ttl |
( |
int |
sockfd, |
|
|
int |
mcastTTL, |
|
|
struct sockaddr * |
addr | |
|
) |
| | [static] |
static int udp_set_url |
( |
struct sockaddr_storage * |
addr, |
|
|
const char * |
hostname, |
|
|
int |
port | |
|
) |
| | [static] |
Variable Documentation
Initial value:
Definition at line 669 of file udp.c.