FFmpeg
Loading...
Searching...
No Matches
librist.c File Reference

Reliable Internet Streaming Transport protocol. More...

#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)
 

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.

Referenced by librist_open(), and librist_read().

◆ 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)
Value:
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.

◆ 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, .unit = "profile" },
{ "simple", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_SIMPLE}, 0, 0, .flags = D|E, .unit = "profile" },
{ "main", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_MAIN}, 0, 0, .flags = D|E, .unit = "profile" },
{ "advanced", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_ADVANCED}, 0, 0, .flags = D|E, .unit = "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 }
}
#define E
Definition avdct.c:34
#define D
Definition avdct.c:35
#define NULL
Definition coverity.c:32
size_t fifo_size
Definition dts2pts.c:611
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
#define MAX_PAYLOAD_SIZE
Definition librist.c:40
#define FIFO_SIZE_DEFAULT
Definition librist.c:41
int profile
Definition mxfenc.c:2299

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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const AVOption librist_options[]
Definition librist.c:65

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,
}
#define flags(name, subs,...)
Definition cbs_h264.c:74
static int librist_open(URLContext *h, const char *uri, int flags)
Definition librist.c:123
static int librist_read(URLContext *h, uint8_t *buf, int size)
Definition librist.c:200
static int librist_write(URLContext *h, const uint8_t *buf, int size)
Definition librist.c:236
static const AVClass librist_class
Definition librist.c:253
static int librist_close(URLContext *h)
Definition librist.c:109
#define URL_PROTOCOL_FLAG_NETWORK
Definition url.h:33

Definition at line 260 of file librist.c.