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 FF_LIBRIST_MAKE_VERSION(major, minor, patch)   ((patch) + ((minor)* 0x100) + ((major) *0x10000))
 
#define FF_LIBRIST_VERSION   FF_LIBRIST_MAKE_VERSION(LIBRIST_API_VERSION_MAJOR, LIBRIST_API_VERSION_MINOR, LIBRIST_API_VERSION_PATCH)
 
#define FF_LIBRIST_VERSION_41   FF_LIBRIST_MAKE_VERSION(4, 1, 0)
 
#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.

◆ FF_LIBRIST_MAKE_VERSION

#define FF_LIBRIST_MAKE_VERSION (   major,
  minor,
  patch 
)    ((patch) + ((minor)* 0x100) + ((major) *0x10000))

Definition at line 42 of file librist.c.

◆ FF_LIBRIST_VERSION

#define FF_LIBRIST_VERSION   FF_LIBRIST_MAKE_VERSION(LIBRIST_API_VERSION_MAJOR, LIBRIST_API_VERSION_MINOR, LIBRIST_API_VERSION_PATCH)

Definition at line 44 of file librist.c.

◆ FF_LIBRIST_VERSION_41

#define FF_LIBRIST_VERSION_41   FF_LIBRIST_MAKE_VERSION(4, 1, 0)

Definition at line 45 of file librist.c.

◆ D

Definition at line 64 of file librist.c.

◆ E

Definition at line 65 of file librist.c.

◆ OFFSET

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

Definition at line 66 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 libplacebo_init(), and 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 198 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 },
{ "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 67 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:34
librist_class
static const AVClass librist_class
Definition: librist.c:253
E
#define E
Definition: librist.c:65
OFFSET
#define OFFSET(x)
Definition: librist.c:66
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:198
librist_options
static const AVOption librist_options[]
Definition: librist.c:67
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:40
D
#define D
Definition: librist.c:64
profile
int profile
Definition: mxfenc.c:2003
RISTContext
Definition: librist.c:47
librist_close
static int librist_close(URLContext *h)
Definition: librist.c:109
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:236
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:123
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233