From 10f57b73f3afd14f3d74aaacf185f6f36cf3b0f4 Mon Sep 17 00:00:00 2001 From: "Wang,Fei" Date: Thu, 7 Jun 2018 15:31:54 -0800 Subject: [PATCH] msdk: vpp: remove mfxExtVPPDoUse from vpp filters. According to msdk spec, there are two ways to enable filters: 1: Filters can be enabled by adding a filter ID to mfxExtVPPDoUse. In this case, default filter parameters are used 2: Add filter configuration structures directly to mfxVideoParam. Using 1 with 2 is optional but legal. Unfortunately it won't work with some specific use cases like Detail/EdgeEnhancement. Let's stick with option2 which works fine for all VPP operations. https://bugzilla.gnome.org/show_bug.cgi?id=796468 --- sys/msdk/gstmsdkvpp.c | 28 ---------------------------- sys/msdk/gstmsdkvpp.h | 2 -- 2 files changed, 30 deletions(-) diff --git a/sys/msdk/gstmsdkvpp.c b/sys/msdk/gstmsdkvpp.c index 924f4e9..de4e452 100644 --- a/sys/msdk/gstmsdkvpp.c +++ b/sys/msdk/gstmsdkvpp.c @@ -769,7 +769,6 @@ gst_msdkvpp_close (GstMsdkVPP * thiz) static void ensure_filters (GstMsdkVPP * thiz) { - guint n_filters = 0; /* Denoise */ if (thiz->flags & GST_MSDK_FLAG_DENOISE) { @@ -778,8 +777,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_denoise->Header.BufferSz = sizeof (mfxExtVPPDenoise); mfx_denoise->DenoiseFactor = thiz->denoise_factor; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_denoise); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_DENOISE; - n_filters++; } /* Rotation */ @@ -789,8 +786,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_rotation->Header.BufferSz = sizeof (mfxExtVPPRotation); mfx_rotation->Angle = thiz->rotation; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_rotation); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_ROTATION; - n_filters++; } /* Deinterlace */ @@ -800,8 +795,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_deinterlace->Header.BufferSz = sizeof (mfxExtVPPDeinterlacing); mfx_deinterlace->Mode = thiz->deinterlace_method; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_deinterlace); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_DEINTERLACING; - n_filters++; } /* Colorbalance(ProcAmp) */ @@ -815,8 +808,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_procamp->Brightness = thiz->brightness; mfx_procamp->Contrast = thiz->contrast; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_procamp); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_PROCAMP; - n_filters++; } /* Detail/Edge enhancement */ @@ -826,8 +817,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_detail->Header.BufferSz = sizeof (mfxExtVPPDetail); mfx_detail->DetailFactor = thiz->detail; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_detail); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_DETAIL; - n_filters++; } /* Mirroring */ @@ -837,8 +826,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_mirroring->Header.BufferSz = sizeof (mfxExtVPPMirroring); mfx_mirroring->Type = thiz->mirroring; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_mirroring); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_MIRRORING; - n_filters++; } /* Scaling Mode */ @@ -848,8 +835,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_scaling->Header.BufferSz = sizeof (mfxExtVPPScaling); mfx_scaling->ScalingMode = thiz->scaling_mode; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_scaling); - thiz->max_filter_algorithms[n_filters] = MFX_EXTBUFF_VPP_SCALING; - n_filters++; } /* FRC */ @@ -859,19 +844,6 @@ ensure_filters (GstMsdkVPP * thiz) mfx_frc->Header.BufferSz = sizeof (mfxExtVPPFrameRateConversion); mfx_frc->Algorithm = thiz->frc_algm; gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_frc); - thiz->max_filter_algorithms[n_filters] = - MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION; - n_filters++; - } - - /* mfxExtVPPDoUse */ - if (n_filters) { - mfxExtVPPDoUse *mfx_vpp_douse = &thiz->mfx_vpp_douse; - mfx_vpp_douse->Header.BufferId = MFX_EXTBUFF_VPP_DOUSE; - mfx_vpp_douse->Header.BufferSz = sizeof (mfxExtVPPDoUse); - mfx_vpp_douse->NumAlg = n_filters; - mfx_vpp_douse->AlgList = thiz->max_filter_algorithms; - gst_msdkvpp_add_extra_param (thiz, (mfxExtBuffer *) mfx_vpp_douse); } } diff --git a/sys/msdk/gstmsdkvpp.h b/sys/msdk/gstmsdkvpp.h index 2e42819..e829259 100644 --- a/sys/msdk/gstmsdkvpp.h +++ b/sys/msdk/gstmsdkvpp.h @@ -52,7 +52,6 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MSDKVPP)) #define MAX_EXTRA_PARAMS 8 -#define MAX_FILTER_ALGORITHMS 7 typedef struct _GstMsdkVPP GstMsdkVPP; typedef struct _GstMsdkVPPClass GstMsdkVPPClass; @@ -125,7 +124,6 @@ struct _GstMsdkVPP /* MFX Filters */ mfxExtVPPDoUse mfx_vpp_douse; - mfxU32 max_filter_algorithms [MAX_FILTER_ALGORITHMS]; mfxExtVPPDenoise mfx_denoise; mfxExtVPPRotation mfx_rotation; mfxExtVPPDeinterlacing mfx_deinterlace; -- 2.7.4