FFmpeg
Data Structures | Macros | Functions | Variables
libamqp.c File Reference
#include <amqp.h>
#include <amqp_tcp_socket.h>
#include <sys/time.h>
#include "avformat.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "network.h"
#include "url.h"
#include "urldecode.h"

Go to the source code of this file.

Data Structures

struct  AMQPContext
 

Macros

#define STR_LEN   1024
 
#define DEFAULT_CHANNEL   1
 
#define OFFSET(x)   offsetof(AMQPContext, x)
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int amqp_proto_open (URLContext *h, const char *uri, int flags)
 
static int amqp_proto_write (URLContext *h, const unsigned char *buf, int size)
 
static int amqp_proto_read (URLContext *h, unsigned char *buf, int size)
 
static int amqp_proto_close (URLContext *h)
 

Variables

static const AVOption options []
 
static const AVClass amqp_context_class
 
const URLProtocol ff_libamqp_protocol
 

Macro Definition Documentation

◆ STR_LEN

#define STR_LEN   1024

Definition at line 45 of file libamqp.c.

◆ DEFAULT_CHANNEL

#define DEFAULT_CHANNEL   1

Definition at line 46 of file libamqp.c.

◆ OFFSET

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

Definition at line 48 of file libamqp.c.

◆ D

Definition at line 49 of file libamqp.c.

◆ E

Definition at line 50 of file libamqp.c.

Function Documentation

◆ amqp_proto_open()

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

Definition at line 62 of file libamqp.c.

◆ amqp_proto_write()

static int amqp_proto_write ( URLContext h,
const unsigned char *  buf,
int  size 
)
static

Definition at line 235 of file libamqp.c.

◆ amqp_proto_read()

static int amqp_proto_read ( URLContext h,
unsigned char *  buf,
int  size 
)
static

Definition at line 264 of file libamqp.c.

◆ amqp_proto_close()

static int amqp_proto_close ( URLContext h)
static

Definition at line 297 of file libamqp.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "pkt_size", "Maximum send/read packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT, { .i64 = 131072 }, 4096, INT_MAX, .flags = D | E },
{ "exchange", "Exchange to send/read packets", OFFSET(exchange), AV_OPT_TYPE_STRING, { .str = "amq.direct" }, 0, 0, .flags = D | E },
{ "routing_key", "Key to filter streams", OFFSET(routing_key), AV_OPT_TYPE_STRING, { .str = "amqp" }, 0, 0, .flags = D | E },
{ "connection_timeout", "Initial connection timeout", OFFSET(connection_timeout), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D | E},
{ "delivery_mode", "Delivery mode", OFFSET(delivery_mode), AV_OPT_TYPE_INT, { .i64 = AMQP_DELIVERY_PERSISTENT }, 1, 2, .flags = E, "delivery_mode"},
{ "persistent", "Persistent delivery mode", 0, AV_OPT_TYPE_CONST, { .i64 = AMQP_DELIVERY_PERSISTENT }, 0, 0, E, "delivery_mode" },
{ "non-persistent", "Non-persistent delivery mode", 0, AV_OPT_TYPE_CONST, { .i64 = AMQP_DELIVERY_NONPERSISTENT }, 0, 0, E, "delivery_mode" },
{ NULL }
}

Definition at line 51 of file libamqp.c.

◆ amqp_context_class

const AVClass amqp_context_class
static
Initial value:
= {
.class_name = "amqp",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 307 of file libamqp.c.

◆ ff_libamqp_protocol

const URLProtocol ff_libamqp_protocol
Initial value:
= {
.name = "amqp",
.url_close = amqp_proto_close,
.url_open = amqp_proto_open,
.url_read = amqp_proto_read,
.url_write = amqp_proto_write,
.priv_data_size = sizeof(AMQPContext),
.priv_data_class = &amqp_context_class,
}

Definition at line 314 of file libamqp.c.

URL_PROTOCOL_FLAG_NETWORK
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
exchange
static int exchange(MqcState *mqc, uint8_t *cxstate, int lps)
Definition: mqcdec.c:45
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:238
amqp_proto_read
static int amqp_proto_read(URLContext *h, unsigned char *buf, int size)
Definition: libamqp.c:264
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
OFFSET
#define OFFSET(x)
Definition: libamqp.c:48
amqp_proto_close
static int amqp_proto_close(URLContext *h)
Definition: libamqp.c:297
amqp_proto_open
static int amqp_proto_open(URLContext *h, const char *uri, int flags)
Definition: libamqp.c:62
amqp_context_class
static const AVClass amqp_context_class
Definition: libamqp.c:307
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
options
static const AVOption options[]
Definition: libamqp.c:51
AMQPContext
Definition: libamqp.c:33
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
E
#define E
Definition: libamqp.c:50
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
D
#define D
Definition: libamqp.c:49
amqp_proto_write
static int amqp_proto_write(URLContext *h, const unsigned char *buf, int size)
Definition: libamqp.c:235
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233