To eliminate need for forward declaration
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -317,23 +317,6 @@ static void set_gamut_mode(struct pl_color_map_params *p, int gamut_mode) · 316 unmodified lines | |||
| 317 | av_assert0(0); | 317 | av_assert0(0); |
| 318 | }; | 318 | }; |
| 319 | 319 | ||
| 320 | static int update_settings(AVFilterContext *ctx); | ||
| 321 | |||
| 322 | static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len) | ||
| 323 | { | ||
| 324 | LibplaceboContext *s = avctx->priv; | ||
| 325 | const struct pl_hook *hook; | ||
| 326 | |||
| 327 | hook = pl_mpv_user_shader_parse(s->gpu, shader, len); | ||
| 328 | if (!hook) { | ||
| 329 | av_log(s, AV_LOG_ERROR, "Failed parsing custom shader!\n"); | ||
| 330 | return AVERROR(EINVAL); | ||
| 331 | } | ||
| 332 | |||
| 333 | s->hooks[s->num_hooks++] = hook; | ||
| 334 | return update_settings(avctx); | ||
| 335 | } | ||
| 336 | |||
| 337 | static int find_scaler(AVFilterContext *avctx, | 320 | static int find_scaler(AVFilterContext *avctx, |
| 338 | const struct pl_filter_config **opt, | 321 | const struct pl_filter_config **opt, |
| 339 | const char *name, int frame_mixing) | 322 | const char *name, int frame_mixing) |
| @@ -487,6 +470,21 @@ fail: · 147 unmodified lines | |||
| 487 | return err; | 470 | return err; |
| 488 | } | 471 | } |
| 489 | 472 | ||
| 473 | static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len) | ||
| 474 | { | ||
| 475 | LibplaceboContext *s = avctx->priv; | ||
| 476 | const struct pl_hook *hook; | ||
| 477 | |||
| 478 | hook = pl_mpv_user_shader_parse(s->gpu, shader, len); | ||
| 479 | if (!hook) { | ||
| 480 | av_log(s, AV_LOG_ERROR, "Failed parsing custom shader!\n"); | ||
| 481 | return AVERROR(EINVAL); | ||
| 482 | } | ||
| 483 | |||
| 484 | s->hooks[s->num_hooks++] = hook; | ||
| 485 | return update_settings(avctx); | ||
| 486 | } | ||
| 487 | |||
| 490 | static void libplacebo_uninit(AVFilterContext *avctx); | 488 | static void libplacebo_uninit(AVFilterContext *avctx); |
| 491 | 489 | ||
| 492 | static int libplacebo_init(AVFilterContext *avctx) | 490 | static int libplacebo_init(AVFilterContext *avctx) |