Skip to content

Commit e2f3967

Browse files
committed
avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx()
Signed-off-by: softworkz <[email protected]>
1 parent 34bb7f5 commit e2f3967

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
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 2025-03-28
22

33
API changes, most recent first:
44

5+
2025-02-xx - xxxxxxxxxx - lavfi 10.10.100 - avfilter.h
6+
Add avfilter_link_get_hw_frames_ctx().
7+
58
2025-04-21 - xxxxxxxxxx - lavu 60.2.100 - log.h
69
Add AV_CLASS_CATEGORY_HWDEVICE.
710

libavfilter/avfilter.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,15 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
989989
return pads[pad_idx].type;
990990
}
991991

992+
AVBufferRef *avfilter_link_get_hw_frames_ctx(AVFilterLink *link)
993+
{
994+
FilterLink *plink = ff_filter_link(link);
995+
if (plink->hw_frames_ctx)
996+
return av_buffer_ref(plink->hw_frames_ctx);
997+
998+
return NULL;
999+
}
1000+
9921001
static int default_filter_frame(AVFilterLink *link, AVFrame *frame)
9931002
{
9941003
return ff_filter_frame(link->dst->outputs[0], frame);

libavfilter/avfilter.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx);
9696
*/
9797
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx);
9898

99+
/**
100+
* Get the hardware frames context of a filter link.
101+
*
102+
* @param link an AVFilterLink
103+
*
104+
* @return a ref-counted copy of the link's hw_frames_ctx field if there is
105+
* a hardware frames context associated with the link or NULL otherwise.
106+
* The returned AVBufferRef needs to be released with av_buffer_unref()
107+
* when it is no longer used.
108+
*/
109+
AVBufferRef* avfilter_link_get_hw_frames_ctx(AVFilterLink *link);
110+
99111
/**
100112
* Lists of formats / etc. supported by an end of a link.
101113
*

0 commit comments

Comments
 (0)