48#define FREI0R_SLIBSUF ".so"
50#define FREI0R_SLIBSUF SLIBSUF
59typedef void (*
f0r_update_f)(f0r_instance_t instance,
double time,
const uint32_t *inframe, uint32_t *outframe);
60typedef void (*
f0r_update2_f)(f0r_instance_t instance,
double time,
const uint32_t *inframe1,
const uint32_t *inframe2,
const uint32_t *inframe3, uint32_t *outframe);
91 void *sym = dlsym(
s->dl_handle, sym_name);
102 f0r_param_color_t col;
103 f0r_param_position_t
pos;
104 f0r_param_string str;
111 if (!strcmp(param,
"y"))
val.d = 1.0;
112 else if (!strcmp(param,
"n"))
val.d = 0.0;
116 case F0R_PARAM_DOUBLE:
118 if (*tail ||
val.d == HUGE_VAL)
122 case F0R_PARAM_COLOR:
123 if (sscanf(param,
"%f/%f/%f", &
val.col.r, &
val.col.g, &
val.col.b) != 3) {
126 val.col.r = rgba[0] / 255.0;
127 val.col.g = rgba[1] / 255.0;
128 val.col.b = rgba[2] / 255.0;
132 case F0R_PARAM_POSITION:
133 if (sscanf(param,
"%lf/%lf", &
val.pos.x, &
val.pos.y) != 2)
137 case F0R_PARAM_STRING:
147 param, info.name ? info.name :
"(null)");
159 for (
i = 0;
i <
s->plugin_info.num_params;
i++) {
160 f0r_param_info_t info = { 0 };
164 s->get_param_info(&info,
i);
187 *handle_ptr = dlopen(path, RTLD_NOW|RTLD_LOCAL);
193 const char *dl_name,
int type)
198 f0r_plugin_info_t *pi;
202 static const char*
const frei0r_pathlist[] = {
203 "/usr/local/lib/frei0r-1/",
204 "/usr/lib/frei0r-1/",
205 "/usr/local/lib64/frei0r-1/",
206 "/usr/lib64/frei0r-1/"
221 char *p, *ptr =
NULL;
267 !(f0r_get_plugin_info =
load_sym(
ctx,
"f0r_get_plugin_info")) ||
268 !(
s->get_param_info =
load_sym(
ctx,
"f0r_get_param_info" )) ||
269 !(
s->get_param_value =
load_sym(
ctx,
"f0r_get_param_value")) ||
270 !(
s->set_param_value =
load_sym(
ctx,
"f0r_set_param_value")) ||
277 if (f0r_init() < 0) {
282 f0r_get_plugin_info(&
s->plugin_info);
283 pi = &
s->plugin_info;
284 if (pi->plugin_type !=
type) {
286 "Invalid type '%s' for this plugin\n",
287 pi->plugin_type == F0R_PLUGIN_TYPE_FILTER ?
"filter" :
288 pi->plugin_type == F0R_PLUGIN_TYPE_SOURCE ?
"source" :
289 pi->plugin_type == F0R_PLUGIN_TYPE_MIXER2 ?
"mixer2" :
290 pi->plugin_type == F0R_PLUGIN_TYPE_MIXER3 ?
"mixer3" :
"unknown");
295 "name:%s author:'%s' explanation:'%s' color_model:%s "
296 "frei0r_version:%d version:%d.%d num_params:%d\n",
297 pi->name ? pi->name :
"(null)", pi->author ? pi->author :
"(null)",
298 pi->explanation ? pi->explanation :
"(null)",
299 pi->color_model == F0R_COLOR_MODEL_BGRA8888 ?
"bgra8888" :
300 pi->color_model == F0R_COLOR_MODEL_RGBA8888 ?
"rgba8888" :
301 pi->color_model == F0R_COLOR_MODEL_PACKED32 ?
"packed32" :
"unknown",
302 pi->frei0r_version, pi->major_version, pi->minor_version, pi->num_params);
318 if (
s->destruct &&
s->instance)
319 s->destruct(
s->instance);
323 dlclose(
s->dl_handle);
331 if (
s->destruct &&
s->instance)
332 s->destruct(
s->instance);
333 if (!(
s->instance =
s->construct(inlink->
w, inlink->
h))) {
349 if (
s->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) {
352 }
else if (
s->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) {
395 (
const uint32_t *)in->
data[0],
396 (uint32_t *)
out->data[0]);
408 char *res,
int res_len,
int flags)
420#define OFFSET(x) offsetof(Frei0rContext, x)
421#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
422#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
443 .p.priv_class = &frei0r_class,
458 s->time_base.num =
s->framerate.den;
459 s->time_base.den =
s->framerate.num;
478 if (
s->destruct &&
s->instance)
479 s->destruct(
s->instance);
480 if (!(
s->instance =
s->construct(outlink->
w, outlink->
h))) {
530 .p.name =
"frei0r_src",
532 .p.priv_class = &frei0r_src_class,
SwsAArch64OpImplParams params
static double val(void *priv, double ch)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
const FFFilter ff_vf_frei0r
const FFFilter ff_vsrc_frei0r_src
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Main libavfilter public API header.
char * av_asprintf(const char *fmt,...)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
common internal and external API header
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
simple arithmetic expression evaluator
static char separator(CheckasmFormat format)
static char * getenv_dup(const char *varname)
static char * getenv_utf8(const char *varname)
static void freeenv_utf8(char *var)
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
@ 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...
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
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)
static FilterLink * ff_filter_link(AVFilterLink *link)
#define AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
Memory handling functions.
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define FF_ARRAY_ELEMS(a)
Describe the class of an AVClass context structure.
void * priv
private data for use by the filter
AVFilterLink ** outputs
array of pointers to output links
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Rational number (pair of numerator and denominator).
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
f0r_construct_f construct
f0r_set_param_value_f set_param_value
f0r_get_param_info_f get_param_info
f0r_plugin_info_t plugin_info
f0r_get_param_value_f get_param_value
static AVFormatContext * ctx
static const AVFilterPad avfilter_vf_frei0r_inputs[]
void(* f0r_get_param_info_f)(f0r_param_info_t *info, int param_index)
void(* f0r_update_f)(f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe)
void(* f0r_get_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index)
void(* f0r_set_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index)
f0r_instance_t(* f0r_construct_f)(unsigned int width, unsigned int height)
static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, char *param)
static const AVOption frei0r_options[]
static int set_params(AVFilterContext *ctx, const char *params)
static int config_input_props(AVFilterLink *inlink)
static int load_path(AVFilterContext *ctx, void **handle_ptr, const char *prefix, const char *name)
void(* f0r_deinit_f)(void)
static av_cold int source_init(AVFilterContext *ctx)
static av_cold int frei0r_init(AVFilterContext *ctx, const char *dl_name, int type)
void(* f0r_get_plugin_info_f)(f0r_plugin_info_t *info)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static void * load_sym(AVFilterContext *ctx, const char *sym_name)
static const AVOption frei0r_src_options[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static av_cold void uninit(AVFilterContext *ctx)
static int source_request_frame(AVFilterLink *outlink)
void(* f0r_update2_f)(f0r_instance_t instance, double time, const uint32_t *inframe1, const uint32_t *inframe2, const uint32_t *inframe3, uint32_t *outframe)
static av_cold int filter_init(AVFilterContext *ctx)
static int source_config_props(AVFilterLink *outlink)
void(* f0r_destruct_f)(f0r_instance_t instance)
static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[]
AVFrame * ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align)
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.