FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
tcp.c File Reference
#include "avformat.h"
#include "libavutil/avassert.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"

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
 

Functions

static int tcp_open (URLContext *h, const char *uri, int flags)
 
static int tcp_accept (URLContext *s, URLContext **c)
 
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_class
 
URLProtocol ff_tcp_protocol
 

Macro Definition Documentation

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

Definition at line 44 of file tcp.c.

Definition at line 45 of file tcp.c.

Definition at line 46 of file tcp.c.

Function Documentation

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

Definition at line 62 of file tcp.c.

static int tcp_accept ( URLContext s,
URLContext **  c 
)
static

Definition at line 172 of file tcp.c.

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

Definition at line 188 of file tcp.c.

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

Definition at line 202 of file tcp.c.

static int tcp_shutdown ( URLContext h,
int  flags 
)
static

Definition at line 216 of file tcp.c.

static int tcp_close ( URLContext h)
static

Definition at line 232 of file tcp.c.

static int tcp_get_file_handle ( URLContext h)
static

Definition at line 239 of file tcp.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "listen", "Listen for incoming connections", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, .flags = D|E },
{ "timeout", "set timeout (in microseconds) of socket I/O operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
{ "listen_timeout", "Connection awaiting timeout (in milliseconds)", OFFSET(listen_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define E
Definition: tcp.c:46
#define D
Definition: tcp.c:45
#define OFFSET(x)
Definition: tcp.c:44

Definition at line 47 of file tcp.c.

const AVClass tcp_class
static
Initial value:
= {
.class_name = "tcp",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
av_default_item_name
static const AVOption options[]
Definition: tcp.c:47

Definition at line 54 of file tcp.c.

URLProtocol ff_tcp_protocol
Initial value:
= {
.name = "tcp",
.url_open = tcp_open,
.url_accept = tcp_accept,
.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_class,
}
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:35
static const AVClass tcp_class
Definition: tcp.c:54
static int tcp_open(URLContext *h, const char *uri, int flags)
Definition: tcp.c:62
static int tcp_read(URLContext *h, uint8_t *buf, int size)
Definition: tcp.c:188
static int tcp_close(URLContext *h)
Definition: tcp.c:232
static int tcp_shutdown(URLContext *h, int flags)
Definition: tcp.c:216
Definition: tcp.c:35
static int flags
Definition: cpu.c:47
static int tcp_write(URLContext *h, const uint8_t *buf, int size)
Definition: tcp.c:202
static int tcp_get_file_handle(URLContext *h)
Definition: tcp.c:239
static int tcp_accept(URLContext *s, URLContext **c)
Definition: tcp.c:172

Definition at line 245 of file tcp.c.