History

avfilter/avfilter: add a side_data field to AVFilterLink

This will be used to propagate global side data through the filterchain.

James Almer committed 2 years ago

Commit ef1cb1c1 parent 91d96dc4 files · +25 −3Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavfilter/avfilter.c +17 −1
  3. libavfilter/avfilter.h +3 −0
  4. libavfilter/version.h +2 −2
doc/APIchanges+3−0
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line
2 2
3API changes, most recent first:3API changes, most recent first:
4 4
52025-01-25 - xxxxxxxxxx - lavfi 10.7.100 - avfilter.h
6 Add AVFilterLink.side_data and AVFilterLink.nb_side_data
7
52025-01-05 - xxxxxxxxxx - lavc 59.55.100 - frame.h82025-01-05 - xxxxxxxxxx - lavc 59.55.100 - frame.h
6 Add AV_FRAME_SIDE_DATA_FLAG_NEW_REF.9 Add AV_FRAME_SIDE_DATA_FLAG_NEW_REF.
7 10
libavfilter/avfilter.c+17−1
@@ -206,6 +206,7 @@ static void link_free(AVFilterLink **link) · 205 unmodified lines
206 ff_framequeue_free(&li->fifo);206 ff_framequeue_free(&li->fifo);
207 ff_frame_pool_uninit(&li->frame_pool);207 ff_frame_pool_uninit(&li->frame_pool);
208 av_channel_layout_uninit(&(*link)->ch_layout);208 av_channel_layout_uninit(&(*link)->ch_layout);
209 av_frame_side_data_free(&(*link)->side_data, &(*link)->nb_side_data);
209 210
210 av_buffer_unref(&li->l.hw_frames_ctx);211 av_buffer_unref(&li->l.hw_frames_ctx);
211 212
@@ -376,7 +377,22 @@ int ff_filter_config_links(AVFilterContext *filter) · 164 unmodified lines
376 "callbacks on all outputs\n");377 "callbacks on all outputs\n");
377 return AVERROR(EINVAL);378 return AVERROR(EINVAL);
378 }379 }
379 } else if ((ret = config_link(link)) < 0) {380 }
381
382 /* Copy side data before link->srcpad->config_props() is called, so the filter
383 * may remove it for the next filter in the chain */
384 if (inlink && inlink->nb_side_data && !link->nb_side_data) {
385 for (i = 0; i < inlink->nb_side_data; i++) {
386 ret = av_frame_side_data_clone(&link->side_data, &link->nb_side_data,
387 inlink->side_data[i], 0);
388 if (ret < 0) {
389 av_frame_side_data_free(&link->side_data, &link->nb_side_data);
390 return ret;
391 }
392 }
393 }
394
395 if (config_link && (ret = config_link(link)) < 0) {
380 av_log(link->src, AV_LOG_ERROR,396 av_log(link->src, AV_LOG_ERROR,
381 "Failed to configure output pad on %s\n",397 "Failed to configure output pad on %s\n",
382 link->src->name);398 link->src->name);
libavfilter/avfilter.h+3−0
@@ -413,6 +413,9 @@ struct AVFilterLink { · 412 unmodified lines
413 */413 */
414 AVRational time_base;414 AVRational time_base;
415 415
416 AVFrameSideData **side_data;
417 int nb_side_data;
418
416 /*****************************************************************419 /*****************************************************************
417 * All fields below this line are not part of the public API. They420 * All fields below this line are not part of the public API. They
418 * may not be used outside of libavfilter and can be changed and421 * may not be used outside of libavfilter and can be changed and
libavfilter/version.h+2−2
@@ -31,8 +31,8 @@ · 30 unmodified lines
31 31
32#include "version_major.h"32#include "version_major.h"
33 33
34#define LIBAVFILTER_VERSION_MINOR 634#define LIBAVFILTER_VERSION_MINOR 7
35#define LIBAVFILTER_VERSION_MICRO 10135#define LIBAVFILTER_VERSION_MICRO 100
36 36
37 37
38#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \38#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t