[FFmpeg-devel] [PATCH] avfilter/vf_xcam: add xcam video filter
Zane van Iperen
zane at zanevaniperen.com
Thu Jul 30 15:16:57 EEST 2020
On Fri, 31 Jul 2020 00:55:56 +0800
"zongwave" <wei.zong at intel.com> wrote:
> ++static int xcam_query_formats(AVFilterContext *ctx)
> ++{
> ++ XCAMContext *s = ctx->priv;
> ++ AVFilterFormats *formats = NULL;
> ++
> ++ static const enum AVPixelFormat nv12_fmts[] = {AV_PIX_FMT_NV12, AV_PIX_FMT_NONE};
> ++ static const enum AVPixelFormat yuv420_fmts[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE};
> ++ static const enum AVPixelFormat auto_fmts[] = {AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE};
Would these be better above the function instead of inside it?
> ++static av_cold int xcam_init(AVFilterContext *ctx)
> ++{
> ++ XCAMContext *s = ctx->priv;
> ++ int ret = 0;
> ++
> ++ s->handle = xcam_create_handle(s->name);
> ++ if (!s->handle) {
Style nitpick, I'd tend to prefer inlining the assignment:
if (!(s->handle = xcam_create_handle(s->name)))
but I guess that's personal preference.
Overall looks fine, but someone more familiar with
libavfilter should probably double-check.
More information about the ffmpeg-devel
mailing list