FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
libsrt.c File Reference
#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_epoll_create (URLContext *h, int fd, int write)
 
static int libsrt_network_wait_fd (URLContext *h, int eid, int write)
 
static int libsrt_network_wait_fd_timeout (URLContext *h, int eid, 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, int64_t timeout)
 
static int libsrt_listen_connect (int eid, int fd, const struct sockaddr *addr, socklen_t addrlen, int64_t 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

◆ SRT_LIVE_DEFAULT_PAYLOAD_SIZE

#define SRT_LIVE_DEFAULT_PAYLOAD_SIZE   1316

Definition at line 39 of file libsrt.c.

◆ SRT_LIVE_MAX_PAYLOAD_SIZE

#define SRT_LIVE_MAX_PAYLOAD_SIZE   1456

Definition at line 44 of file libsrt.c.

◆ D

Definition at line 95 of file libsrt.c.

◆ E

Definition at line 96 of file libsrt.c.

◆ OFFSET

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

Definition at line 97 of file libsrt.c.

Enumeration Type Documentation

◆ SRTMode

enum SRTMode
Enumerator
SRT_MODE_CALLER 
SRT_MODE_LISTENER 
SRT_MODE_RENDEZVOUS 

Definition at line 47 of file libsrt.c.

Function Documentation

◆ libsrt_neterrno()

static int libsrt_neterrno ( URLContext h)
static

◆ libsrt_socket_nonblock()

static int libsrt_socket_nonblock ( int  socket,
int  enable 
)
static

Definition at line 156 of file libsrt.c.

Referenced by libsrt_listen(), and libsrt_setup().

◆ libsrt_epoll_create()

static int libsrt_epoll_create ( URLContext h,
int  fd,
int  write 
)
static

Definition at line 166 of file libsrt.c.

Referenced by libsrt_setup().

◆ libsrt_network_wait_fd()

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

Definition at line 179 of file libsrt.c.

Referenced by libsrt_network_wait_fd_timeout().

◆ libsrt_network_wait_fd_timeout()

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

Definition at line 203 of file libsrt.c.

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

◆ libsrt_listen()

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

Definition at line 223 of file libsrt.c.

Referenced by libsrt_setup().

◆ libsrt_listen_connect()

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

Definition at line 249 of file libsrt.c.

Referenced by libsrt_setup().

◆ libsrt_setsockopt()

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

Definition at line 270 of file libsrt.c.

Referenced by libsrt_set_options_post(), and libsrt_set_options_pre().

◆ libsrt_getsockopt()

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

Definition at line 279 of file libsrt.c.

Referenced by libsrt_setup().

◆ libsrt_set_options_post()

static int libsrt_set_options_post ( URLContext h,
int  fd 
)
static

Definition at line 292 of file libsrt.c.

Referenced by libsrt_setup().

◆ libsrt_set_options_pre()

static int libsrt_set_options_pre ( URLContext h,
int  fd 
)
static

Definition at line 306 of file libsrt.c.

Referenced by libsrt_setup().

◆ libsrt_setup()

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

Definition at line 367 of file libsrt.c.

Referenced by libsrt_open().

◆ libsrt_open()

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

Definition at line 509 of file libsrt.c.

◆ libsrt_read()

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

Definition at line 656 of file libsrt.c.

◆ libsrt_write()

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

Definition at line 675 of file libsrt.c.

◆ libsrt_close()

static int libsrt_close ( URLContext h)
static

Definition at line 694 of file libsrt.c.

◆ libsrt_get_file_handle()

static int libsrt_get_file_handle ( URLContext h)
static

Definition at line 706 of file libsrt.c.

Variable Documentation

◆ libsrt_options

const AVOption libsrt_options[]
static

Definition at line 98 of file libsrt.c.

◆ libsrt_class

const AVClass libsrt_class
static
Initial value:
= {
.class_name = "libsrt",
.item_name = av_default_item_name,
.option = libsrt_options,
}

Definition at line 712 of file libsrt.c.

◆ ff_libsrt_protocol

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,
}

Definition at line 719 of file libsrt.c.

URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
SRTContext
Definition: srtenc.c:32
libsrt_open
static int libsrt_open(URLContext *h, const char *uri, int flags)
Definition: libsrt.c:509
libsrt_get_file_handle
static int libsrt_get_file_handle(URLContext *h)
Definition: libsrt.c:706
libsrt_options
static const AVOption libsrt_options[]
Definition: libsrt.c:98
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
libsrt_write
static int libsrt_write(URLContext *h, const uint8_t *buf, int size)
Definition: libsrt.c:675
libsrt_class
static const AVClass libsrt_class
Definition: libsrt.c:712
libsrt_read
static int libsrt_read(URLContext *h, uint8_t *buf, int size)
Definition: libsrt.c:656
libsrt_close
static int libsrt_close(URLContext *h)
Definition: libsrt.c:694
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561