26#include "config_components.h"
45#define OFFSET(x) offsetof(ZMQContext, x)
46#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
57 zmq->
zmq = zmq_ctx_new();
60 "Could not create ZMQ context: %s\n", zmq_strerror(errno));
67 "Could not create ZMQ socket: %s\n", zmq_strerror(errno));
73 "Could not bind ZMQ socket to address '%s': %s\n",
87 zmq_ctx_destroy(zmq->
zmq);
94#define SPACES " \f\t\n\r"
98 const char **buf = &command_str;
101 if (!cmd->target || !cmd->target[0]) {
103 "No target specified in command '%s'\n", command_str);
108 if (!cmd->command || !cmd->command[0]) {
110 "No command specified in command '%s'\n", command_str);
124 if (zmq_msg_init(&msg) == -1) {
126 "Could not initialize receive message: %s\n", zmq_strerror(errno));
130 if (zmq_msg_recv(&msg, zmq->
responder, ZMQ_DONTWAIT) == -1) {
133 "Could not receive message: %s\n", zmq_strerror(errno));
138 *buf_size = zmq_msg_size(&msg) + 1;
144 memcpy(*buf, zmq_msg_data(&msg), *buf_size - 1);
145 (*buf)[*buf_size-1] = 0;
159 char *recv_buf =
NULL, *send_buf =
NULL;
177 "Processing command #%d target:%s command:%s arg:%s\n",
180 cmd.target, cmd.command, cmd.arg,
181 cmd_buf,
sizeof(cmd_buf),
184 -ret,
av_err2str(ret), cmd_buf[0] ?
"\n" :
"", cmd_buf);
190 "Sending command reply for command #%d:\n%s\n",
192 if (zmq_send(zmq->
responder, send_buf, strlen(send_buf), 0) == -1)
222 .p.description =
NULL_IF_CONFIG_SMALL(
"Receive commands through ZMQ and broker them to filters."),
223 .p.priv_class = &zmq_class,
233#if CONFIG_AZMQ_FILTER
245 .p.description =
NULL_IF_CONFIG_SMALL(
"Receive commands through ZMQ and broker them to filters."),
246 .p.priv_class = &zmq_class,
const FFFilter ff_af_azmq
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
char * av_asprintf(const char *fmt,...)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
static void av_cold uninit(AVFilterContext *ctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *ref)
static int parse_command(Command *cmd, const char *command_str, void *log_ctx)
static int recv_msg(AVFilterContext *ctx, char **buf, int *buf_size)
@ 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...
int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags)
Send a command to one or more filter instances.
#define AVFILTER_CMD_FLAG_ONE
Stop once a filter understood the command (for target=all for example), fast filters are favored auto...
#define AVERROR_EXTERNAL
Generic error in an external library.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options)
static FilterLink * ff_filter_link(AVFilterLink *link)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
static int ref[MAX_W *MAX_W]
static AVFormatContext * ctx
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.