FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
libsrt.c File Reference

Haivision Open SRT (Secure Reliable Transport) protocol. More...

#include <srt/srt.h>
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/time.h"
#include "avformat.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  SRTContext
 

Macros

#define SRT_LIVE_DEFAULT_PAYLOAD_SIZE   1316
 
#define SRT_LIVE_MAX_PAYLOAD_SIZE   1456
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 
#define OFFSET(x)   offsetof(SRTContext, x)
 

Enumerations

enum  SRTMode { SRT_MODE_CALLER = 0, SRT_MODE_LISTENER = 1, SRT_MODE_RENDEZVOUS = 2 }
 

Functions

static int libsrt_neterrno (URLContext *h)
 
static int libsrt_socket_nonblock (int socket, int enable)
 
static int libsrt_network_wait_fd (URLContext *h, int eid, int fd, int write)
 
static int libsrt_network_wait_fd_timeout (URLContext *h, int eid, int fd, int write, int64_t timeout, AVIOInterruptCB *int_cb)
 
static int libsrt_listen (int eid, int fd, const struct sockaddr *addr, socklen_t addrlen, URLContext *h, int timeout)
 
static int libsrt_listen_connect (int eid, int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h, int will_try_next)
 
static int libsrt_setsockopt (URLContext *h, int fd, SRT_SOCKOPT optname, const char *optnamestr, const void *optval, int optlen)
 
static int libsrt_getsockopt (URLContext *h, int fd, SRT_SOCKOPT optname, const char *optnamestr, void *optval, int *optlen)
 
static int libsrt_set_options_post (URLContext *h, int fd)
 
static int libsrt_set_options_pre (URLContext *h, int fd)
 
static int libsrt_setup (URLContext *h, const char *uri, int flags)
 
static int libsrt_open (URLContext *h, const char *uri, int flags)
 
static int libsrt_read (URLContext *h, uint8_t *buf, int size)
 
static int libsrt_write (URLContext *h, const uint8_t *buf, int size)
 
static int libsrt_close (URLContext *h)
 
static int libsrt_get_file_handle (URLContext *h)
 

Variables

static const AVOption libsrt_options []
 
static const AVClass libsrt_class
 
const URLProtocol ff_libsrt_protocol
 

Detailed Description

Haivision Open SRT (Secure Reliable Transport) protocol.

Definition in file libsrt.c.

Macro Definition Documentation

#define SRT_LIVE_DEFAULT_PAYLOAD_SIZE   1316

Definition at line 39 of file libsrt.c.

#define SRT_LIVE_MAX_PAYLOAD_SIZE   1456

Definition at line 44 of file libsrt.c.

Definition at line 89 of file libsrt.c.

Definition at line 90 of file libsrt.c.

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

Definition at line 91 of file libsrt.c.

Enumeration Type Documentation

enum SRTMode
Enumerator
SRT_MODE_CALLER 
SRT_MODE_LISTENER 
SRT_MODE_RENDEZVOUS 

Definition at line 47 of file libsrt.c.

Function Documentation

static int libsrt_neterrno ( URLContext h)
static
static int libsrt_socket_nonblock ( int  socket,
int  enable 
)
static

Definition at line 143 of file libsrt.c.

Referenced by libsrt_listen(), and libsrt_listen_connect().

static int libsrt_network_wait_fd ( URLContext h,
int  eid,
int  fd,
int  write 
)
static

Definition at line 151 of file libsrt.c.

Referenced by libsrt_network_wait_fd_timeout().

static int libsrt_network_wait_fd_timeout ( URLContext h,
int  eid,
int  fd,
int  write,
int64_t  timeout,
AVIOInterruptCB int_cb 
)
static

Definition at line 179 of file libsrt.c.

Referenced by libsrt_listen(), libsrt_listen_connect(), libsrt_read(), and libsrt_write().

static int libsrt_listen ( int  eid,
int  fd,
const struct sockaddr *  addr,
socklen_t  addrlen,
URLContext h,
int  timeout 
)
static

Definition at line 199 of file libsrt.c.

Referenced by libsrt_setup().

static int libsrt_listen_connect ( int  eid,
int  fd,
const struct sockaddr *  addr,
socklen_t  addrlen,
int  timeout,
URLContext h,
int  will_try_next 
)
static

Definition at line 232 of file libsrt.c.

Referenced by libsrt_setup().

static int libsrt_setsockopt ( URLContext h,
int  fd,
SRT_SOCKOPT  optname,
const char *  optnamestr,
const void optval,
int  optlen 
)
static

Definition at line 272 of file libsrt.c.

Referenced by libsrt_set_options_post(), and libsrt_set_options_pre().

static int libsrt_getsockopt ( URLContext h,
int  fd,
SRT_SOCKOPT  optname,
const char *  optnamestr,
void optval,
int optlen 
)
static

Definition at line 281 of file libsrt.c.

Referenced by libsrt_setup().

static int libsrt_set_options_post ( URLContext h,
int  fd 
)
static

Definition at line 294 of file libsrt.c.

Referenced by libsrt_setup().

static int libsrt_set_options_pre ( URLContext h,
int  fd 
)
static

Definition at line 308 of file libsrt.c.

Referenced by libsrt_setup().

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

Definition at line 347 of file libsrt.c.

Referenced by libsrt_open().

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

Definition at line 476 of file libsrt.c.

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

Definition at line 602 of file libsrt.c.

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

Definition at line 621 of file libsrt.c.

static int libsrt_close ( URLContext h)
static

Definition at line 640 of file libsrt.c.

static int libsrt_get_file_handle ( URLContext h)
static

Definition at line 653 of file libsrt.c.

Variable Documentation

const AVOption libsrt_options[]
static

Definition at line 92 of file libsrt.c.

const AVClass libsrt_class
static
Initial value:
= {
.class_name = "libsrt",
.item_name = av_default_item_name,
.option = libsrt_options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption libsrt_options[]
Definition: libsrt.c:92

Definition at line 659 of file libsrt.c.

const URLProtocol ff_libsrt_protocol
Initial value:
= {
.name = "srt",
.url_open = libsrt_open,
.url_read = libsrt_read,
.url_write = libsrt_write,
.url_close = libsrt_close,
.url_get_file_handle = libsrt_get_file_handle,
.priv_data_size = sizeof(SRTContext),
.priv_data_class = &libsrt_class,
}
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
static int libsrt_open(URLContext *h, const char *uri, int flags)
Definition: libsrt.c:476
static const AVClass libsrt_class
Definition: libsrt.c:659
static int libsrt_read(URLContext *h, uint8_t *buf, int size)
Definition: libsrt.c:602
static int libsrt_get_file_handle(URLContext *h)
Definition: libsrt.c:653
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static int libsrt_write(URLContext *h, const uint8_t *buf, int size)
Definition: libsrt.c:621
static int libsrt_close(URLContext *h)
Definition: libsrt.c:640

Definition at line 666 of file libsrt.c.