tcp.c File Reference
#include "avformat.h"
#include "libavutil/parseutils.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include "url.h"
Include dependency graph for tcp.c:

Go to the source code of this file.

Data Structures

struct  TCPContext
 

Macros

#define OFFSET(x)   offsetof(TCPContext, x)
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Typedefs

typedef struct TCPContext TCPContext
 

Functions

static int tcp_open (URLContext *h, const char *uri, int flags)
 
static int tcp_read (URLContext *h, uint8_t *buf, int size)
 
static int tcp_write (URLContext *h, const uint8_t *buf, int size)
 
static int tcp_shutdown (URLContext *h, int flags)
 
static int tcp_close (URLContext *h)
 
static int tcp_get_file_handle (URLContext *h)
 

Variables

static const AVOption options []
 
static const AVClass tcp_context_class
 
URLProtocol ff_tcp_protocol
 

Macro Definition Documentation

Definition at line 42 of file tcp.c.

Definition at line 43 of file tcp.c.

#define OFFSET (   x)    offsetof(TCPContext, x)

Definition at line 41 of file tcp.c.

Typedef Documentation

typedef struct TCPContext TCPContext

Function Documentation

static int tcp_close ( URLContext h)
static

Definition at line 258 of file tcp.c.

static int tcp_get_file_handle ( URLContext h)
static

Definition at line 265 of file tcp.c.

static int tcp_open ( URLContext h,
const char *  uri,
int  flags 
)
static

Definition at line 59 of file tcp.c.

static int tcp_read ( URLContext h,
uint8_t buf,
int  size 
)
static

Definition at line 214 of file tcp.c.

static int tcp_shutdown ( URLContext h,
int  flags 
)
static

Definition at line 242 of file tcp.c.

static int tcp_write ( URLContext h,
const uint8_t buf,
int  size 
)
static

Definition at line 228 of file tcp.c.

Variable Documentation

URLProtocol ff_tcp_protocol
Initial value:
= {
.name = "tcp",
.url_open = tcp_open,
.url_read = tcp_read,
.url_write = tcp_write,
.url_close = tcp_close,
.url_get_file_handle = tcp_get_file_handle,
.url_shutdown = tcp_shutdown,
.priv_data_size = sizeof(TCPContext),
.priv_data_class = &tcp_context_class,
}
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:35
static int tcp_open(URLContext *h, const char *uri, int flags)
Definition: tcp.c:59
static const AVClass tcp_context_class
Definition: tcp.c:51
static int tcp_read(URLContext *h, uint8_t *buf, int size)
Definition: tcp.c:214
struct TCPContext TCPContext
static int tcp_close(URLContext *h)
Definition: tcp.c:258
static int tcp_shutdown(URLContext *h, int flags)
Definition: tcp.c:242
static int flags
Definition: cpu.c:23
static int tcp_write(URLContext *h, const uint8_t *buf, int size)
Definition: tcp.c:228
static int tcp_get_file_handle(URLContext *h)
Definition: tcp.c:265

Definition at line 271 of file tcp.c.

const AVOption options[]
static
Initial value:
= {
{"listen", "listen on port instead of connecting", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
{"timeout", "timeout of socket i/o operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
{"listen_timeout", "connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
}
#define E
Definition: tcp.c:43
#define D
Definition: tcp.c:42
#define OFFSET(x)
Definition: tcp.c:41
NULL
Definition: eval.c:55

Definition at line 44 of file tcp.c.

const AVClass tcp_context_class
static
Initial value:
= {
.class_name = "tcp",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
static const AVOption options[]
Definition: tcp.c:44
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 51 of file tcp.c.