Go to the documentation of this file.
103 s->output_format =
inlink->format;
107 s->channels =
desc->nb_components;
110 "Configuring OCIO for %s (bit depth: %d, channels: %d), output "
119 "Failed to finalize OCIO processor for bit depth\n");
129 if (
s->out_format_string !=
NULL)
134 if (
s->filetransform && strlen(
s->filetransform) > 0) {
136 ctx,
s->filetransform,
s->inverse);
138 "Creating OCIO processor with FileTransform: %s, Inverse: %d\n",
139 s->filetransform,
s->inverse);
140 }
else if (
s->output_space && strlen(
s->output_space) > 0) {
142 ctx,
s->config_path,
s->input_space,
s->output_space,
s->context_params);
144 "Creating OCIO processor with config: %s, input: %s, output: %s\n",
145 s->config_path,
s->input_space,
s->output_space);
148 ctx,
s->config_path,
s->input_space,
s->display,
s->view,
s->inverse,
s->context_params);
150 "Creating OCIO processor with config: %s, input: %s, display: %s, "
151 "view: %s, Inverse: %d\n",
152 s->config_path,
s->input_space,
s->display,
s->view,
s->inverse);
175 if (
s->output_format ==
inlink->format) {
250 #define OFFSET(x) offsetof(OCIOContext, x)
251 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
259 {
"view",
"View, output view transform, used in combination with display.",
OFFSET(view),
AV_OPT_TYPE_STRING, {.str=
NULL}, 0, 0,
FLAGS },
282 .p.priv_class = &ocio_class,
AVPixelFormat
Pixel format.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
static int ocio_filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
const FFFilter ff_vf_ocio
int ocio_apply(AVFilterContext *ctx, OCIOHandle handle, AVFrame *input_frame, AVFrame *output_frame, int y_start, int height)
static const AVFilterPad inputs[]
const char * name
Filter name.
A link between two filters.
static int config_props(AVFilterLink *inlink)
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
#define AV_PIX_FMT_GBRP10
A filter pad used for either input or output.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
OCIOHandle ocio_create_output_colorspace_processor(AVFilterContext *ctx, const char *config_path, const char *input_color_space, const char *output_color_space, AVDictionary *params)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const AVFilterPad outputs[]
#define AV_PIX_FMT_GBRAP10
static av_cold void uninit(AVFilterContext *ctx)
#define AV_PIX_FMT_GBRAP12
static enum AVPixelFormat pix_fmts[]
static AVFormatContext * ctx
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_PIX_FMT_RGBA64
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
AVFILTER_DEFINE_CLASS(ocio)
#define AV_PIX_FMT_GBRPF16
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
static int query_formats(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_PIX_FMT_GBRPF32
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
OCIOHandle ocio_create_file_transform_processor(AVFilterContext *ctx, const char *file_transform, int inverse)
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
#define AVERROR_EXTERNAL
Generic error in an external library.
AVDictionary * context_params
OCIOHandle ocio_create_display_view_processor(AVFilterContext *ctx, const char *config_path, const char *input_color_space, const char *display, const char *view, int inverse, AVDictionary *params)
#define AV_LOG_INFO
Standard information.
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
#define AV_PIX_FMT_GBRP12
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
const char * name
Pad name.
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_GBRAPF16
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
AVFilter p
The public AVFilter.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
void ocio_destroy_processor(AVFilterContext *ctx, OCIOHandle handle)
static const AVOption ocio_options[]
static av_cold int init(AVFilterContext *ctx)
@ 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 FILTER_QUERY_FUNC(func)
int ocio_finalize_processor(AVFilterContext *ctx, OCIOHandle handle, int input_format, int output_format)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.