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

Unified · Split

libavfilter/vf_vpp_qsv.c+14−0
@@ -259,6 +259,19 @@ release: · 258 unmodified lines
259 return ret;259 return ret;
260}260}
261 261
262static 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
262static av_cold int vpp_init(AVFilterContext *ctx)275static av_cold int vpp_init(AVFilterContext *ctx)
263{276{
264 VPPContext *vpp = ctx->priv;277 VPPContext *vpp = ctx->priv;
@@ -683,6 +696,7 @@ const AVFilter ff_vf_vpp_qsv = { · 418 unmodified lines
683 .name = "vpp_qsv",696 .name = "vpp_qsv",
684 .description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."),697 .description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."),
685 .priv_size = sizeof(VPPContext),698 .priv_size = sizeof(VPPContext),
699 .preinit = vpp_preinit,
686 .init = vpp_init,700 .init = vpp_init,
687 .uninit = vpp_uninit,701 .uninit = vpp_uninit,
688 FILTER_INPUTS(vpp_inputs),702 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