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>

Go to the source code of this file.

Data Structures

struct  RISTContext
 

Macros

#define MAX_PAYLOAD_SIZE   (10000-28)
 
#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 39 of file librist.c.

◆ D

Definition at line 58 of file librist.c.

◆ E

Definition at line 59 of file librist.c.

◆ OFFSET

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

Definition at line 60 of file librist.c.

Function Documentation

◆ risterr2ret()

static int risterr2ret ( int  err)
static

Definition at line 74 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 84 of file librist.c.

Referenced by librist_open().

◆ librist_close()

static int librist_close ( URLContext h)
static

Definition at line 103 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 117 of file librist.c.

◆ librist_read()

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

Definition at line 187 of file librist.c.

◆ librist_write()

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

Definition at line 212 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 },
{ "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 61 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 229 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 236 of file librist.c.

URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
profile
mfxU16 profile
Definition: qsvenc.c:45
librist_class
static const AVClass librist_class
Definition: librist.c:229
E
#define E
Definition: librist.c:59
OFFSET
#define OFFSET(x)
Definition: librist.c:60
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:187
librist_options
static const AVOption librist_options[]
Definition: librist.c:61
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
MAX_PAYLOAD_SIZE
#define MAX_PAYLOAD_SIZE
Definition: librist.c:39
D
#define D
Definition: librist.c:58
RISTContext
Definition: librist.c:41
librist_close
static int librist_close(URLContext *h)
Definition: librist.c:103
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
librist_write
static int librist_write(URLContext *h, const uint8_t *buf, int size)
Definition: librist.c:212
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
librist_open
static int librist_open(URLContext *h, const char *uri, int flags)
Definition: librist.c:117
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233