| 228 | } |
| 229 | |
| 230 | static av_cold int init(AVFilterContext *ctx) |
| 231 | { |
| 232 | DrawBoxContext *s = ctx->priv; |
| 233 | |
| 234 | if (s->box_source_string) { |
| 235 | s->box_source = box_source_string_parse(s->box_source_string); |
| 236 | if ((int)s->box_source < 0) { |
| 237 | av_log(ctx, AV_LOG_ERROR, "Error box source: %s\n",s->box_source_string); |
| 238 | return AVERROR(EINVAL); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | if (!strcmp(s->color_str, "invert")) |
| 243 | s->invert_color = 1; |
| 244 | else if (av_parse_color(s->rgba_color, s->color_str, -1, ctx) < 0) |
| 245 | return AVERROR(EINVAL); |
| 246 | |
| 247 | if (!s->invert_color) { |
| 248 | s->yuv_color[Y] = RGB_TO_Y_CCIR(s->rgba_color[0], s->rgba_color[1], s->rgba_color[2]); |
| 249 | s->yuv_color[U] = RGB_TO_U_CCIR(s->rgba_color[0], s->rgba_color[1], s->rgba_color[2], 0); |
| 250 | s->yuv_color[V] = RGB_TO_V_CCIR(s->rgba_color[0], s->rgba_color[1], s->rgba_color[2], 0); |
| 251 | s->yuv_color[A] = s->rgba_color[3]; |
| 252 | } |
| 253 | |
| 254 | return 0; |
| 255 | } |
| 256 | |
| 257 | static const enum AVPixelFormat pix_fmts[] = { |
| 258 | AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, |
no test coverage detected