Skip to content

Commit 6707d97

Browse files
committed
avfilter/buffersink: add av_buffersink_get_side_data()
This will be used to get global side data that was propagated through the filterchain. Signed-off-by: James Almer <[email protected]>
1 parent 7a025e1 commit 6707d97

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

doc/APIchanges

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
22

33
API changes, most recent first:
44

5+
2025-01-25 - xxxxxxxxxx - lavfi 10.9.100 - buffersink.h
6+
Add av_buffersink_get_side_data().
7+
58
2025-01-25 - xxxxxxxxxx - lavfi 10.8.100 - buffersrc.h
69
Add AVBufferSrcParameters.side_data and AVBufferSrcParameters.nb_side_data
710

libavfilter/buffersink.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ int av_buffersink_get_ch_layout(const AVFilterContext *ctx, AVChannelLayout *out
364364
return 0;
365365
}
366366

367+
const AVFrameSideData *const *av_buffersink_get_side_data(const AVFilterContext *ctx,
368+
int *nb_side_data)
369+
{
370+
av_assert0(fffilter(ctx->filter)->activate == activate);
371+
*nb_side_data = ctx->inputs[0]->nb_side_data;
372+
return (const AVFrameSideData *const *)ctx->inputs[0]->side_data;
373+
}
374+
367375
#if FF_API_BUFFERSINK_OPTS
368376
#define NB_ITEMS(list) (list ## _size / sizeof(*list))
369377
#endif

libavfilter/buffersink.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
* - av_buffersink_get_channels(),
4949
* - av_buffersink_get_ch_layout(),
5050
* - av_buffersink_get_sample_rate().
51+
* - av_buffersink_get_side_data().
5152
*
5253
* The layout returned by av_buffersink_get_ch_layout() must de uninitialized
5354
* by the caller.
@@ -122,6 +123,9 @@ int av_buffersink_get_sample_rate (const AVFilterContext *c
122123

123124
AVBufferRef * av_buffersink_get_hw_frames_ctx (const AVFilterContext *ctx);
124125

126+
const AVFrameSideData *const *av_buffersink_get_side_data(const AVFilterContext *ctx,
127+
int *nb_side_data);
128+
125129
/** @} */
126130

127131
/**

libavfilter/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include "version_major.h"
3333

34-
#define LIBAVFILTER_VERSION_MINOR 8
34+
#define LIBAVFILTER_VERSION_MINOR 9
3535
#define LIBAVFILTER_VERSION_MICRO 100
3636

3737

0 commit comments

Comments
 (0)