libavformat/rtpproto.c File Reference

RTP protocol. More...

#include "libavutil/avstring.h"
#include "avformat.h"
#include "rtpdec.h"
#include <unistd.h>
#include <stdarg.h>
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include <fcntl.h>
#include <sys/time.h>

Go to the source code of this file.

Data Structures

struct  RTPContext

Defines

#define RTP_TX_BUF_SIZE   (64 * 1024)
#define RTP_RX_BUF_SIZE   (128 * 1024)

Functions

int rtp_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.
static void url_add_option (char *buf, int buf_size, const char *fmt,...)
 add option to url of the form: "http://host:port/path?option1=val1&option2=val2.
static void build_udp_url (char *buf, int buf_size, const char *hostname, int port, int local_port, int ttl, int max_packet_size)
static int rtp_open (URLContext *h, const char *uri, int flags)
 url syntax: rtp://host:port[?option=val.
static int rtp_read (URLContext *h, uint8_t *buf, int size)
static int rtp_write (URLContext *h, uint8_t *buf, int size)
static int rtp_close (URLContext *h)
int rtp_get_local_rtp_port (URLContext *h)
 Return the local rtp port used by the RTP connection.
int rtp_get_local_port (URLContext *h)
 Return the local rtp port used by the RTP connection.
int rtp_get_local_rtcp_port (URLContext *h)
 Return the local rtcp port used by the RTP connection.
void rtp_get_file_handles (URLContext *h, int *prtp_fd, int *prtcp_fd)
 Return the rtp and rtcp file handles for select() usage to wait for several RTP streams at the same time.
static int rtp_get_file_handle (URLContext *h)

Variables

URLProtocol rtp_protocol


Detailed Description

RTP protocol.

Definition in file rtpproto.c.


Define Documentation

#define RTP_RX_BUF_SIZE   (128 * 1024)

Definition at line 43 of file rtpproto.c.

#define RTP_TX_BUF_SIZE   (64 * 1024)

Definition at line 42 of file rtpproto.c.


Function Documentation

static void build_udp_url ( char *  buf,
int  buf_size,
const char *  hostname,
int  port,
int  local_port,
int  ttl,
int  max_packet_size 
) [static]

Definition at line 101 of file rtpproto.c.

Referenced by rtp_open().

static int rtp_close ( URLContext h  )  [static]

Definition at line 308 of file rtpproto.c.

static int rtp_get_file_handle ( URLContext h  )  [static]

Definition at line 370 of file rtpproto.c.

void rtp_get_file_handles ( URLContext h,
int *  prtp_fd,
int *  prtcp_fd 
)

Return the rtp and rtcp file handles for select() usage to wait for several RTP streams at the same time.

Parameters:
h media file context

Definition at line 361 of file rtpproto.c.

int rtp_get_local_port ( URLContext h  ) 

Return the local rtp port used by the RTP connection.

Parameters:
s1 media file context
Returns:
the local port number

Definition at line 336 of file rtpproto.c.

int rtp_get_local_rtcp_port ( URLContext h  ) 

Return the local rtcp port used by the RTP connection.

Parameters:
s1 media file context
Returns:
the local port number

Definition at line 348 of file rtpproto.c.

Referenced by rtsp_cmd_setup().

int rtp_get_local_rtp_port ( URLContext h  ) 

Return the local rtp port used by the RTP connection.

Parameters:
s1 media file context
Returns:
the local port number

Definition at line 324 of file rtpproto.c.

Referenced by rtsp_cmd_setup().

static int rtp_open ( URLContext h,
const char *  uri,
int  flags 
) [static]

url syntax: rtp://host:port[?option=val.

..] option: 'ttl=n' : set the ttl value (for multicast only) 'rtcpport=n' : set the remote rtcp port to n 'localrtpport=n' : set the local rtp port to n 'localrtcpport=n' : set the local rtcp port to n 'pkt_size=n' : set max packet size deprecated option: 'localport=n' : set the local port to n

if rtcpport isn't set the rtcp port will be the rtp port + 1 if local rtp port isn't set any available port will be used for the local rtp and rtcp ports if the local rtcp port is not set it will be the local rtp port + 1

Definition at line 131 of file rtpproto.c.

static int rtp_read ( URLContext h,
uint8_t *  buf,
int  size 
) [static]

Definition at line 210 of file rtpproto.c.

int rtp_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.

Parameters:
s1 media file context
uri of the remote server
Returns:
zero if no error.

Definition at line 60 of file rtpproto.c.

static int rtp_write ( URLContext h,
uint8_t *  buf,
int  size 
) [static]

Definition at line 282 of file rtpproto.c.

static void url_add_option ( char *  buf,
int  buf_size,
const char *  fmt,
  ... 
) [static]

add option to url of the form: "http://host:port/path?option1=val1&option2=val2.

..

Definition at line 86 of file rtpproto.c.

Referenced by build_udp_url().


Variable Documentation

Initial value:

 {
    "rtp",
    rtp_open,
    rtp_read,
    rtp_write,
    NULL, 
    rtp_close,
    .url_get_file_handle = rtp_get_file_handle,
}

Definition at line 376 of file rtpproto.c.


Generated on Fri Oct 26 02:36:55 2012 for FFmpeg by  doxygen 1.5.8