104 s->output_format = inlink->
format;
108 s->channels =
desc->nb_components;
111 "Configuring OCIO for %s (bit depth: %d, channels: %d), output "
120 "Failed to finalize OCIO processor for bit depth\n");
130 if (
s->out_format_string !=
NULL)
135 if (
s->filetransform && strlen(
s->filetransform) > 0) {
137 ctx,
s->filetransform,
s->inverse);
139 "Creating OCIO processor with FileTransform: %s, Inverse: %d\n",
140 s->filetransform,
s->inverse);
141 }
else if (
s->output_space && strlen(
s->output_space) > 0) {
143 ctx,
s->config_path,
s->input_space,
s->output_space,
s->context_params);
145 "Creating OCIO processor with config: %s, input: %s, output: %s\n",
146 s->config_path,
s->input_space,
s->output_space);
149 ctx,
s->config_path,
s->input_space,
s->display,
s->view,
s->inverse,
s->context_params);
151 "Creating OCIO processor with config: %s, input: %s, display: %s, "
152 "view: %s, Inverse: %d\n",
153 s->config_path,
s->input_space,
s->display,
s->view,
s->inverse);
176 if (
s->output_format == inlink->
format) {
251#define OFFSET(x) offsetof(OCIOContext, x)
252#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
260 {
"view",
"View, output view transform, used in combination with display.",
OFFSET(view),
AV_OPT_TYPE_STRING, {.str=
NULL}, 0, 0,
FLAGS },
283 .p.priv_class = &ocio_class,
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
const FFFilter ff_vf_ocio
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
@ 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_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#define AVERROR_EXTERNAL
Generic error in an external library.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
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.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
#define FILTER_QUERY_FUNC(func)
#define AVFILTER_DEFINE_CLASS(fname)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
void ocio_destroy_processor(AVFilterContext *ctx, OCIOHandle handle)
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)
OCIOHandle ocio_create_output_colorspace_processor(AVFilterContext *ctx, const char *config_path, const char *input_color_space, const char *output_color_space, AVDictionary *params)
int ocio_finalize_processor(AVFilterContext *ctx, OCIOHandle handle, int input_format, int output_format)
OCIOHandle ocio_create_file_transform_processor(AVFilterContext *ctx, const char *file_transform, int inverse)
int ocio_apply(AVFilterContext *ctx, OCIOHandle handle, AVFrame *input_frame, AVFrame *output_frame, int y_start, int height)
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.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_FLOAT
The pixel format contains IEEE-754 floating point values.
#define AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRPF32
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRAPF16
#define AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_GBRP12
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_PIX_FMT_GBRPF16
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAPF32
static int config_props(AVBitStreamFilterLink *link)
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVDictionary * context_params
Used for passing data between threads.
static int query_formats(AVFilterContext *ctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static const AVOption ocio_options[]
static int config_props(AVFilterLink *inlink)
static av_cold void uninit(AVFilterContext *ctx)
static int ocio_filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)