History

lavfi/vf_vpp_qsv: add vpp_preinit callback

Set the expected default value for options in this callback, hence we have the right values even if these options are not included in the option arrray. This is in preparation for reusing the code for other QSV filters.

Haihao Xiang committed 3 years ago

Commit a1b3e8f1 parent eb71c671 file · +14 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_vpp_qsv.c+14−0
@@ -259,6 +259,19 @@ release: · 258 unmodified lines
259259 return ret;
260260 }
261261
262+static av_cold int vpp_preinit(AVFilterContext *ctx)
263+{
264+ VPPContext *vpp = ctx->priv;
265+ /* For AV_OPT_TYPE_STRING options, NULL is handled in other way so
266+ * we needn't set default value here
267+ */
268+ vpp->saturation = 1.0;
269+ vpp->contrast = 1.0;
270+ vpp->transpose = -1;
271+
272+ return 0;
273+}
274+
262275 static av_cold int vpp_init(AVFilterContext *ctx)
263276 {
264277 VPPContext *vpp = ctx->priv;
@@ -683,6 +696,7 @@ const AVFilter ff_vf_vpp_qsv = { · 418 unmodified lines
683696 .name = "vpp_qsv",
684697 .description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."),
685698 .priv_size = sizeof(VPPContext),
699+ .preinit = vpp_preinit,
686700 .init = vpp_init,
687701 .uninit = vpp_uninit,
688702 FILTER_INPUTS(vpp_inputs),

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