msdkenc: use GST_CAPS_FEATURE_MEMORY_VA to check the feature

Add macros to protect sinkpad_is_va(), since it is not defined on
Windows.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3301>
This commit is contained in:
Tong Wu 2022-10-31 16:52:23 +08:00 committed by tong1wu
parent a92f41e0c7
commit 7b03da634b

View file

@ -1435,16 +1435,18 @@ done:
return ret; return ret;
} }
#ifndef _WIN32
static gboolean static gboolean
sinkpad_is_va (GstMsdkEnc * thiz) sinkpad_is_va (GstMsdkEnc * thiz)
{ {
GstCapsFeatures *const features = GstCapsFeatures *features =
gst_caps_get_features (thiz->input_state->caps, 0); gst_caps_get_features (thiz->input_state->caps, 0);
if (gst_caps_features_contains (features, "memory:VAMemory")) if (gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_VA))
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
#endif
static gboolean static gboolean
gst_msdkenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state) gst_msdkenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)