History

avfilter: Temporary hack to fix format negotiation for hw formats

hw_frames_ctx on the input link is only set when the input link is configured, which hasn't happened yet. This temporarily hacks around the problem (in a way no worse than before the format negotiation changes) until a proper fix can be applied.

Mark Thompson committed 2 years ago

Commit 8b76bae1 parent d1785391 file · +6 −2Browse files

Unified · Split

libavfilter/avfiltergraph.c+6−2
@@ -667,8 +667,12 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 666 unmodified lines
667 if (link->type == AVMEDIA_TYPE_VIDEO) {667 if (link->type == AVMEDIA_TYPE_VIDEO) {
668 enum AVPixelFormat swfmt = link->format;668 enum AVPixelFormat swfmt = link->format;
669 if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) {669 if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) {
670 av_assert1(link->hw_frames_ctx);670 // FIXME: this is a hack - we'd like to use the sw_format of
671 swfmt = ((AVHWFramesContext *) link->hw_frames_ctx->data)->sw_format;671 // link->hw_frames_ctx here, but it is not yet available.
672 // To make this work properly we will need to either reorder
673 // things so that it is available here or somehow negotiate
674 // sw_format separately.
675 swfmt = AV_PIX_FMT_YUV420P;
672 }676 }
673 677
674 if (!ff_fmt_is_regular_yuv(swfmt)) {678 if (!ff_fmt_is_regular_yuv(swfmt)) {

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