FFmpeg
Data Structures | Macros | Functions | Variables
librist.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/avstring.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"
#include <librist/librist.h>
#include <librist/version.h>

Go to the source code of this file.

Data Structures

struct  RISTContext
 

Macros

#define MAX_PAYLOAD_SIZE   (10000-28)
 
#define FIFO_SIZE_DEFAULT   8192
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 
#define OFFSET(x)   offsetof(RISTContext, x)
 

Functions

static int risterr2ret (int err)
 
static int log_cb (void *arg, enum rist_log_level log_level, const char *msg)
 
static int librist_close (URLContext *h)
 
static int librist_open (URLContext *h, const char *uri, int flags)
 
static int librist_read (URLContext *h, uint8_t *buf, int size)
 
static int librist_write (URLContext *h, const uint8_t *buf, int size)
 

Variables

static const AVOption librist_options []
 
static const AVClass librist_class
 
const URLProtocol ff_librist_protocol
 

Detailed Description

Reliable Internet Streaming Transport protocol

Definition in file librist.c.

Macro Definition Documentation

◆ MAX_PAYLOAD_SIZE

#define MAX_PAYLOAD_SIZE   (10000-28)

Definition at line 40 of file librist.c.

◆ FIFO_SIZE_DEFAULT

#define FIFO_SIZE_DEFAULT   8192

Definition at line 41 of file librist.c.

◆ D

Definition at line 62 of file librist.c.

◆ E

Definition at line 63 of file librist.c.

◆ OFFSET

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

Definition at line 64 of file librist.c.

Function Documentation

◆ risterr2ret()

static int risterr2ret ( int  err)
static

Definition at line 80 of file librist.c.

Referenced by librist_close(), librist_open(), librist_read(), and librist_write().

◆ log_cb()

static int log_cb ( void *  arg,
enum rist_log_level  log_level,
const char *  msg 
)
static

Definition at line 90 of file librist.c.

Referenced by librist_open().

◆ librist_close()

static int librist_close ( URLContext h)
static

Definition at line 109 of file librist.c.

Referenced by librist_open().

◆ librist_open()

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

Definition at line 123 of file librist.c.

◆ librist_read()

static int librist_read ( URLContext h,
uint8_t *  buf,
int  size 
)
static

Definition at line 200 of file librist.c.

◆ librist_write()

static int librist_write ( URLContext h,
const uint8_t *  buf,
int  size 
)
static

Definition at line 236 of file librist.c.

Variable Documentation

◆ librist_options

const AVOption librist_options[]
static
Initial value:
= {
{ "rist_profile","set profile", OFFSET(profile), AV_OPT_TYPE_INT, {.i64=RIST_PROFILE_MAIN}, 0, 2, .flags = D|E, "profile" },
{ "simple", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_SIMPLE}, 0, 0, .flags = D|E, "profile" },
{ "main", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_MAIN}, 0, 0, .flags = D|E, "profile" },
{ "advanced", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_ADVANCED}, 0, 0, .flags = D|E, "profile" },
{ "buffer_size", "set buffer_size in ms", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64=0}, 0, 30000, .flags = D|E },
{ "fifo_size", "set fifo buffer size, must be a power of 2", OFFSET(fifo_size), AV_OPT_TYPE_INT, {.i64=FIFO_SIZE_DEFAULT}, 32, 262144, .flags = D|E },
{ "overrun_nonfatal", "survive in case of receiving fifo buffer overrun", OFFSET(overrun_nonfatal), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D },
{ "pkt_size", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64=1316}, 1, MAX_PAYLOAD_SIZE, .flags = D|E },
{ "log_level", "set loglevel", OFFSET(log_level), AV_OPT_TYPE_INT, {.i64=RIST_LOG_INFO}, -1, INT_MAX, .flags = D|E },
{ "secret", "set encryption secret",OFFSET(secret), AV_OPT_TYPE_STRING,{.str=NULL}, 0, 0, .flags = D|E },
{ "encryption","set encryption type",OFFSET(encryption), AV_OPT_TYPE_INT ,{.i64=0}, 0, INT_MAX, .flags = D|E },
{ NULL }
}

Definition at line 65 of file librist.c.

◆ librist_class

const AVClass librist_class
static
Initial value:
= {
.class_name = "librist",
.item_name = av_default_item_name,
.option = librist_options,
}

Definition at line 253 of file librist.c.

◆ ff_librist_protocol

const URLProtocol ff_librist_protocol
Initial value:
= {
.name = "rist",
.url_open = librist_open,
.url_read = librist_read,
.url_write = librist_write,
.url_close = librist_close,
.priv_data_size = sizeof(RISTContext),
.priv_data_class = &librist_class,
}

Definition at line 260 of file librist.c.

URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:33
librist_class
static const AVClass librist_class
Definition: librist.c:253
E
#define E
Definition: librist.c:63
OFFSET
#define OFFSET(x)
Definition: librist.c:64
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
librist_read
static int librist_read(URLContext *h, uint8_t *buf, int size)
Definition: librist.c:200
librist_options
static const AVOption librist_options[]
Definition: librist.c:65
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
MAX_PAYLOAD_SIZE
#define MAX_PAYLOAD_SIZE
Definition: librist.c:40
fifo_size
size_t fifo_size
Definition: dts2pts_bsf.c:368
D
#define D
Definition: librist.c:62
profile
int profile
Definition: mxfenc.c:2115
RISTContext
Definition: librist.c:43
librist_close
static int librist_close(URLContext *h)
Definition: librist.c:109
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
librist_write
static int librist_write(URLContext *h, const uint8_t *buf, int size)
Definition: librist.c:236
FIFO_SIZE_DEFAULT
#define FIFO_SIZE_DEFAULT
Definition: librist.c:41
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
librist_open
static int librist_open(URLContext *h, const char *uri, int flags)
Definition: librist.c:123
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234