common: Use more efficient versions of GstCapsFeatures API where possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
This commit is contained in:
Sebastian Dröge 2024-09-03 12:16:19 +03:00
parent 3b9f050600
commit b7b24573ce
91 changed files with 320 additions and 188 deletions

View file

@ -228,7 +228,9 @@ dup_caps_with_alternate (GstCaps * caps)
GstCapsFeatures *features; GstCapsFeatures *features;
with_alternate = gst_caps_copy (caps); with_alternate = gst_caps_copy (caps);
features = gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL); features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL);
gst_caps_set_features_simple (with_alternate, features); gst_caps_set_features_simple (with_alternate, features);
gst_caps_set_simple (with_alternate, "interlace-mode", G_TYPE_STRING, gst_caps_set_simple (with_alternate, "interlace-mode", G_TYPE_STRING,

View file

@ -1029,12 +1029,14 @@ gst_nv_comp_video_dec_negotiate (GstVideoDecoder * decoder)
auto format = GST_VIDEO_INFO_FORMAT (&priv->info); auto format = GST_VIDEO_INFO_FORMAT (&priv->info);
if (is_cuda && is_supported_cuda_format (format)) { if (is_cuda && is_supported_cuda_format (format)) {
gst_caps_set_features_simple (state->caps, gst_caps_set_features_simple (state->caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
} }
#ifdef HAVE_GST_GL #ifdef HAVE_GST_GL
else if (is_gl && is_supported_gl_format (format)) { else if (is_gl && is_supported_gl_format (format)) {
gst_caps_set_features_simple (state->caps, gst_caps_set_features_simple (state->caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
priv->gl_interop = TRUE; priv->gl_interop = TRUE;
} }
#endif #endif

View file

@ -387,7 +387,8 @@ static GstCaps *
gst_ttml_parse_get_src_caps (GstTtmlParse * self) gst_ttml_parse_get_src_caps (GstTtmlParse * self)
{ {
GstCaps *caps; GstCaps *caps;
GstCapsFeatures *features = gst_caps_features_new ("meta:GstSubtitleMeta", GstCapsFeatures *features =
gst_caps_features_new_static_str ("meta:GstSubtitleMeta",
NULL); NULL);
caps = gst_caps_new_empty_simple ("text/x-raw"); caps = gst_caps_new_empty_simple ("text/x-raw");

View file

@ -51,7 +51,7 @@ _set_caps_features_with_passthrough (const GstCaps * caps,
GstCapsFeatures *features, *orig_features; GstCapsFeatures *features, *orig_features;
orig_features = gst_caps_get_features (caps, i); orig_features = gst_caps_get_features (caps, i);
features = gst_caps_features_new (feature_name, NULL); features = gst_caps_features_new_static_str (feature_name, NULL);
m = gst_caps_features_get_size (orig_features); m = gst_caps_features_get_size (orig_features);
for (j = 0; j < m; j++) { for (j = 0; j < m; j++) {

View file

@ -291,7 +291,8 @@ gst_vulkan_h264_decoder_negotiate (GstVideoDecoder * decoder)
self->output_state->caps = gst_video_info_to_caps (&self->output_state->info); self->output_state->caps = gst_video_info_to_caps (&self->output_state->info);
gst_caps_set_features_simple (self->output_state->caps, gst_caps_set_features_simple (self->output_state->caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
NULL));
GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT,
self->output_state->caps); self->output_state->caps);

View file

@ -286,7 +286,8 @@ gst_vulkan_h265_decoder_negotiate (GstVideoDecoder * decoder)
self->output_state->caps = gst_video_info_to_caps (&self->output_state->info); self->output_state->caps = gst_video_info_to_caps (&self->output_state->info);
gst_caps_set_features_simple (self->output_state->caps, gst_caps_set_features_simple (self->output_state->caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
NULL));
GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT,
self->output_state->caps); self->output_state->caps);

View file

@ -50,7 +50,7 @@ _set_caps_features_with_passthrough (const GstCaps * caps,
GstCapsFeatures *features, *orig_features; GstCapsFeatures *features, *orig_features;
orig_features = gst_caps_get_features (caps, i); orig_features = gst_caps_get_features (caps, i);
features = gst_caps_features_new (feature_name, NULL); features = gst_caps_features_new_static_str (feature_name, NULL);
m = gst_caps_features_get_size (orig_features); m = gst_caps_features_get_size (orig_features);
for (j = 0; j < m; j++) { for (j = 0; j < m; j++) {

View file

@ -670,7 +670,8 @@ gst_vulkan_swapper_get_supported_caps (GstVulkanSwapper * swapper,
caps = gst_caps_new_empty_simple ("video/x-raw"); caps = gst_caps_new_empty_simple ("video/x-raw");
gst_caps_set_features (caps, 0, gst_caps_set_features (caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE));
s = gst_caps_get_structure (caps, 0); s = gst_caps_get_structure (caps, 0);
{ {

View file

@ -460,7 +460,9 @@ dup_caps_with_alternate (GstCaps * caps)
GstCapsFeatures *features; GstCapsFeatures *features;
with_alternate = gst_caps_copy (caps); with_alternate = gst_caps_copy (caps);
features = gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL); features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL);
gst_caps_set_features_simple (with_alternate, features); gst_caps_set_features_simple (with_alternate, features);
gst_caps_set_simple (with_alternate, "interlace-mode", G_TYPE_STRING, gst_caps_set_simple (with_alternate, "interlace-mode", G_TYPE_STRING,

View file

@ -1742,7 +1742,8 @@ gst_amf_av1_enc_create_class_data (GstD3D11Device * device, AMFComponent * comp)
system_caps = gst_caps_from_string (sink_caps_str.c_str ()); system_caps = gst_caps_from_string (sink_caps_str.c_str ());
sink_caps = gst_caps_copy (system_caps); sink_caps = gst_caps_copy (system_caps);
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_caps_append (sink_caps, system_caps); gst_caps_append (sink_caps, system_caps);
cdata = g_new0 (GstAmfAv1EncClassData, 1); cdata = g_new0 (GstAmfAv1EncClassData, 1);

View file

@ -2261,7 +2261,8 @@ gst_amf_h264_enc_create_class_data (GstD3D11Device * device,
system_caps = gst_caps_from_string (sink_caps_str.c_str ()); system_caps = gst_caps_from_string (sink_caps_str.c_str ());
sink_caps = gst_caps_copy (system_caps); sink_caps = gst_caps_copy (system_caps);
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_caps_append (sink_caps, system_caps); gst_caps_append (sink_caps, system_caps);
cdata = g_new0 (GstAmfH264EncClassData, 1); cdata = g_new0 (GstAmfH264EncClassData, 1);

View file

@ -1954,7 +1954,8 @@ gst_amf_h265_enc_create_class_data (GstD3D11Device * device,
system_caps = gst_caps_from_string (sink_caps_str.c_str ()); system_caps = gst_caps_from_string (sink_caps_str.c_str ());
sink_caps = gst_caps_copy (system_caps); sink_caps = gst_caps_copy (system_caps);
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_caps_append (sink_caps, system_caps); gst_caps_append (sink_caps, system_caps);
cdata = g_new0 (GstAmfH265EncClassData, 1); cdata = g_new0 (GstAmfH265EncClassData, 1);

View file

@ -809,7 +809,8 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
gst_caps_unref (output_state->caps); gst_caps_unref (output_state->caps);
output_state->caps = gst_video_info_to_caps (&output_state->info); output_state->caps = gst_video_info_to_caps (&output_state->info);
gst_caps_set_features (output_state->caps, 0, gst_caps_set_features (output_state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
NULL));
gst_caps_set_simple (output_state->caps, "texture-target", G_TYPE_STRING, gst_caps_set_simple (output_state->caps, "texture-target", G_TYPE_STRING,
"external-oes", NULL); "external-oes", NULL);
GST_DEBUG_OBJECT (self, "Configuring for Surface output"); GST_DEBUG_OBJECT (self, "Configuring for Surface output");
@ -1954,7 +1955,8 @@ gst_amc_video_dec_set_format (GstVideoDecoder * decoder,
output_state->caps = gst_video_info_to_caps (&output_state->info); output_state->caps = gst_video_info_to_caps (&output_state->info);
gst_caps_set_features (output_state->caps, 0, gst_caps_set_features (output_state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
NULL));
/* gst_amc_video_dec_decide_allocation will update /* gst_amc_video_dec_decide_allocation will update
* self->downstream_supports_gl */ * self->downstream_supports_gl */

View file

@ -1593,7 +1593,7 @@ gst_av_capture_device_get_caps (AVCaptureDevice *device, AVCaptureVideoDataOutpu
gst_caps_append (result_caps, gst_caps_copy (caps)); gst_caps_append (result_caps, gst_caps_copy (caps));
/* Set GLMemory features on caps */ /* Set GLMemory features on caps */
gst_caps_set_features (caps, 0, gst_caps_set_features (caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
NULL)); NULL));
gst_caps_set_simple (caps, gst_caps_set_simple (caps,
"texture-target", G_TYPE_STRING, "texture-target", G_TYPE_STRING,

View file

@ -185,7 +185,8 @@ gst_d3d11_base_convert_caps_remove_format_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();
@ -222,7 +223,8 @@ gst_d3d11_base_convert_caps_rangify_size_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();
@ -265,7 +267,8 @@ gst_d3d11_base_convert_caps_remove_format_and_rangify_size_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();

View file

@ -1769,7 +1769,8 @@ gst_d3d11_decoder_negotiate (GstD3D11Decoder * decoder,
if (d3d11_supported) { if (d3d11_supported) {
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
NULL));
} }
decoder->downstream_supports_d3d11 = d3d11_supported; decoder->downstream_supports_d3d11 = d3d11_supported;

View file

@ -745,7 +745,8 @@ gst_d3d11_deinterlace_remove_interlace_info (GstCaps * caps,
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();
@ -2411,11 +2412,13 @@ gst_d3d11_deinterlace_register (GstPlugin * plugin, GstD3D11Device * device,
/* TODO: Add alternating deinterlace */ /* TODO: Add alternating deinterlace */
src_caps = gst_caps_copy (caps); src_caps = gst_caps_copy (caps);
caps_features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, caps_features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
NULL); NULL);
gst_caps_set_features_simple (src_caps, caps_features); gst_caps_set_features_simple (src_caps, caps_features);
caps_features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, caps_features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL); GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL);
gst_caps_set_features_simple (caps, caps_features); gst_caps_set_features_simple (caps, caps_features);
gst_caps_append (src_caps, caps); gst_caps_append (src_caps, caps);

View file

@ -142,7 +142,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
gst_caps_set_features (tmp, i, gst_caps_set_features (tmp, i,
gst_caps_features_from_string (feature_name)); gst_caps_features_new_single_static_str (feature_name));
return tmp; return tmp;
} }

View file

@ -419,7 +419,8 @@ gst_d3d11_h265_dec_register (GstPlugin * plugin, GstD3D11Device * device,
/* System memory with alternate interlace-mode */ /* System memory with alternate interlace-mode */
tmp = gst_caps_copy (src_caps_copy); tmp = gst_caps_copy (src_caps_copy);
caps_features = gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, caps_features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
nullptr); nullptr);
gst_caps_set_features_simple (tmp, caps_features); gst_caps_set_features_simple (tmp, caps_features);
gst_caps_set_simple (tmp, "interlace-mode", G_TYPE_STRING, "alternate", gst_caps_set_simple (tmp, "interlace-mode", G_TYPE_STRING, "alternate",
@ -428,7 +429,8 @@ gst_d3d11_h265_dec_register (GstPlugin * plugin, GstD3D11Device * device,
/* D3D11 memory feature */ /* D3D11 memory feature */
tmp = gst_caps_copy (src_caps_copy); tmp = gst_caps_copy (src_caps_copy);
caps_features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, caps_features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr); nullptr);
gst_caps_set_features_simple (tmp, caps_features); gst_caps_set_features_simple (tmp, caps_features);
gst_caps_append (src_caps, tmp); gst_caps_append (src_caps, tmp);
@ -438,7 +440,8 @@ gst_d3d11_h265_dec_register (GstPlugin * plugin, GstD3D11Device * device,
#if 0 #if 0
/* D3D11 memory with alternate interlace-mode */ /* D3D11 memory with alternate interlace-mode */
tmp = gst_caps_copy (src_caps_copy); tmp = gst_caps_copy (src_caps_copy);
caps_features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, caps_features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
GST_CAPS_FEATURE_FORMAT_INTERLACED, nullptr); GST_CAPS_FEATURE_FORMAT_INTERLACED, nullptr);
gst_caps_set_features_simple (tmp, caps_features); gst_caps_set_features_simple (tmp, caps_features);
gst_caps_set_simple (tmp, "interlace-mode", G_TYPE_STRING, "alternate", gst_caps_set_simple (tmp, "interlace-mode", G_TYPE_STRING, "alternate",

View file

@ -448,7 +448,8 @@ gst_d3d11_ipc_sink_set_caps (GstBaseSink * sink, GstCaps * caps)
} }
gst_caps_set_features_simple (new_caps, gst_caps_set_features_simple (new_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_clear_caps (&priv->caps); gst_clear_caps (&priv->caps);
priv->caps = new_caps; priv->caps = new_caps;

View file

@ -685,8 +685,8 @@ gst_d3d11_screen_capture_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
gst_caps_append_structure (d3d11_caps, gst_structure_copy (s)); gst_caps_append_structure (d3d11_caps, gst_structure_copy (s));
gst_caps_set_features (d3d11_caps, 0, gst_caps_set_features (d3d11_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, gst_caps_features_new_static_str
nullptr)); (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr));
break; break;
} }

View file

@ -145,7 +145,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
GstStructure *s = gst_caps_get_structure (caps, i); GstStructure *s = gst_caps_get_structure (caps, i);
orig_features = gst_caps_get_features (caps, i); orig_features = gst_caps_get_features (caps, i);
features = gst_caps_features_new (feature_name, NULL); features = gst_caps_features_new_static_str (feature_name, NULL);
if (gst_caps_features_is_any (orig_features)) { if (gst_caps_features_is_any (orig_features)) {
gst_caps_append_structure_full (tmp, gst_structure_copy (s), gst_caps_append_structure_full (tmp, gst_structure_copy (s),

View file

@ -417,7 +417,8 @@ gst_d3d11_vp9_dec_register (GstPlugin * plugin, GstD3D11Device * device,
d3d11_caps = gst_caps_copy (src_caps); d3d11_caps = gst_caps_copy (src_caps);
gst_caps_set_features_simple (d3d11_caps, gst_caps_set_features_simple (d3d11_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
src_caps = gst_caps_merge (d3d11_caps, src_caps); src_caps = gst_caps_merge (d3d11_caps, src_caps);
/* To cover both landscape and portrait, select max value */ /* To cover both landscape and portrait, select max value */

View file

@ -529,7 +529,8 @@ gst_d3d12_base_convert_caps_remove_format_and_rangify_size_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();

View file

@ -1909,12 +1909,14 @@ gst_d3d12_decoder_negotiate (GstD3D12Decoder * decoder,
switch (priv->session->output_type) { switch (priv->session->output_type) {
case GST_D3D12_DECODER_OUTPUT_D3D12: case GST_D3D12_DECODER_OUTPUT_D3D12:
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY));
break; break;
#ifdef HAVE_GST_D3D11 #ifdef HAVE_GST_D3D11
case GST_D3D12_DECODER_OUTPUT_D3D11: case GST_D3D12_DECODER_OUTPUT_D3D11:
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY));
break; break;
#endif #endif
default: default:
@ -2356,11 +2358,13 @@ gst_d3d12_decoder_check_feature_support (GstD3D12Device * device,
auto raw_caps = gst_caps_from_string (src_caps_string.c_str ()); auto raw_caps = gst_caps_from_string (src_caps_string.c_str ());
auto src_caps = gst_caps_copy (raw_caps); auto src_caps = gst_caps_copy (raw_caps);
gst_caps_set_features_simple (src_caps, gst_caps_set_features_simple (src_caps,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY));
#ifdef HAVE_GST_D3D11 #ifdef HAVE_GST_D3D11
auto d3d11_caps = gst_caps_copy (raw_caps); auto d3d11_caps = gst_caps_copy (raw_caps);
gst_caps_set_features_simple (d3d11_caps, gst_caps_set_features_simple (d3d11_caps,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY));
gst_caps_append (src_caps, d3d11_caps); gst_caps_append (src_caps, d3d11_caps);
#endif #endif
gst_caps_append (src_caps, raw_caps); gst_caps_append (src_caps, raw_caps);

View file

@ -115,7 +115,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
gst_caps_set_features (tmp, i, gst_caps_set_features (tmp, i,
gst_caps_features_from_string (feature_name)); gst_caps_features_new_single_static_str (feature_name));
} }
return tmp; return tmp;

View file

@ -2417,7 +2417,8 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
auto sysmem_caps = gst_caps_from_string (sink_caps_str.c_str ()); auto sysmem_caps = gst_caps_from_string (sink_caps_str.c_str ());
auto sink_caps = gst_caps_copy (sysmem_caps); auto sink_caps = gst_caps_copy (sysmem_caps);
gst_caps_set_features_simple (sink_caps, gst_caps_set_features_simple (sink_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr));
gst_caps_append (sink_caps, sysmem_caps); gst_caps_append (sink_caps, sysmem_caps);
auto src_caps = gst_caps_from_string (src_caps_str.c_str ()); auto src_caps = gst_caps_from_string (src_caps_str.c_str ());

View file

@ -410,7 +410,8 @@ gst_d3d12_ipc_sink_set_caps (GstBaseSink * sink, GstCaps * caps)
} }
gst_caps_set_features_simple (new_caps, gst_caps_set_features_simple (new_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr));
gst_clear_caps (&priv->caps); gst_clear_caps (&priv->caps);
priv->caps = new_caps; priv->caps = new_caps;

View file

@ -751,7 +751,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
gst_caps_set_features (tmp, i, gst_caps_set_features (tmp, i,
gst_caps_features_from_string (feature_name)); gst_caps_features_new_single_static_str (feature_name));
} }
return tmp; return tmp;

View file

@ -674,8 +674,8 @@ gst_d3d12_screen_capture_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
gst_caps_append_structure (d3d12_caps, gst_structure_copy (s)); gst_caps_append_structure (d3d12_caps, gst_structure_copy (s));
gst_caps_set_features (d3d12_caps, 0, gst_caps_set_features (d3d12_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, gst_caps_features_new_static_str
nullptr)); (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr));
break; break;
} }
} }

View file

@ -114,7 +114,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
gst_caps_set_features (tmp, i, gst_caps_set_features (tmp, i,
gst_caps_features_from_string (feature_name)); gst_caps_features_new_single_static_str (feature_name));
} }
return tmp; return tmp;

View file

@ -1742,7 +1742,8 @@ gst_mf_video_encoder_enum_internal (GstMFTransform * transform, GUID & subtype,
gst_caps_set_value (d3d11_caps, "format", &d3d11_formats); gst_caps_set_value (d3d11_caps, "format", &d3d11_formats);
g_value_unset (&d3d11_formats); g_value_unset (&d3d11_formats);
gst_caps_set_features_simple (d3d11_caps, gst_caps_set_features_simple (d3d11_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY));
device_caps->d3d11_aware = TRUE; device_caps->d3d11_aware = TRUE;
device_caps->adapter_luid = adapter_luid; device_caps->adapter_luid = adapter_luid;
} }

View file

@ -2012,7 +2012,7 @@ gst_msdkcaps_set_strings (GstCaps * caps,
if (features) { if (features) {
GstStructure *s = NULL; GstStructure *s = NULL;
GstCapsFeatures *f = gst_caps_features_from_string (features); GstCapsFeatures *f = gst_caps_features_new_single_static_str (features);
for (guint i = 0; i < size; i++) { for (guint i = 0; i < size; i++) {
if (gst_caps_features_is_equal (f, gst_caps_get_features (caps, i))) { if (gst_caps_features_is_equal (f, gst_caps_get_features (caps, i))) {

View file

@ -516,7 +516,8 @@ pad_accept_memory (GstMsdkDec * thiz, const gchar * mem_type, GstCaps ** filter)
pad = GST_VIDEO_DECODER_SRC_PAD (thiz); pad = GST_VIDEO_DECODER_SRC_PAD (thiz);
caps = gst_caps_copy (*filter); caps = gst_caps_copy (*filter);
gst_caps_set_features (caps, 0, gst_caps_features_from_string (mem_type)); gst_caps_set_features (caps, 0,
gst_caps_features_new_single_static_str (mem_type));
#ifndef _WIN32 #ifndef _WIN32
/* In dma caps case, we need to set drm-format for raw caps */ /* In dma caps case, we need to set drm-format for raw caps */
@ -1766,7 +1767,8 @@ gst_msdk_create_va_pool (GstMsdkDec * thiz, GstVideoInfo * info,
if (thiz->use_dmabuf && thiz->modifier != DRM_FORMAT_MOD_INVALID) { if (thiz->use_dmabuf && thiz->modifier != DRM_FORMAT_MOD_INVALID) {
caps = gst_msdkcaps_video_info_to_drm_caps (info, thiz->modifier); caps = gst_msdkcaps_video_info_to_drm_caps (info, thiz->modifier);
gst_caps_set_features (caps, 0, gst_caps_set_features (caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_DMABUF, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
} else { } else {
caps = gst_video_info_to_caps (info); caps = gst_video_info_to_caps (info);
} }
@ -1835,7 +1837,8 @@ gst_msdkdec_create_buffer_pool (GstMsdkDec * thiz, GstVideoInfo * info,
if (thiz->use_dmabuf) { if (thiz->use_dmabuf) {
caps = gst_msdkcaps_video_info_to_drm_caps (&vinfo, thiz->modifier); caps = gst_msdkcaps_video_info_to_drm_caps (&vinfo, thiz->modifier);
gst_caps_set_features (caps, 0, gst_caps_set_features (caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_DMABUF, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
} else { } else {
caps = gst_video_info_to_caps (&vinfo); caps = gst_video_info_to_caps (&vinfo);
} }

View file

@ -1206,7 +1206,8 @@ gst_msdk_create_va_pool (GstMsdkEnc * thiz, GstVideoInfo * info,
if (thiz->use_dmabuf && thiz->modifier != DRM_FORMAT_MOD_INVALID) { if (thiz->use_dmabuf && thiz->modifier != DRM_FORMAT_MOD_INVALID) {
aligned_caps = gst_msdkcaps_video_info_to_drm_caps (info, thiz->modifier); aligned_caps = gst_msdkcaps_video_info_to_drm_caps (info, thiz->modifier);
gst_caps_set_features (aligned_caps, 0, gst_caps_set_features (aligned_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_DMABUF, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
} else } else
aligned_caps = gst_video_info_to_caps (info); aligned_caps = gst_video_info_to_caps (info);
@ -1426,7 +1427,8 @@ gst_msdkenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)
if (!thiz->use_va && sinkpad_can_dmabuf (thiz)) { if (!thiz->use_va && sinkpad_can_dmabuf (thiz)) {
thiz->input_state->caps = gst_caps_make_writable (thiz->input_state->caps); thiz->input_state->caps = gst_caps_make_writable (thiz->input_state->caps);
gst_caps_set_features (thiz->input_state->caps, 0, gst_caps_set_features (thiz->input_state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_DMABUF, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
thiz->use_dmabuf = TRUE; thiz->use_dmabuf = TRUE;
thiz->modifier = get_msdkcaps_get_modifier (state->caps); thiz->modifier = get_msdkcaps_get_modifier (state->caps);
} }

View file

@ -439,7 +439,8 @@ gst_msdk_create_va_pool (GstMsdkVPP * thiz, GstVideoInfo * info,
usage_hint |= VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ | usage_hint |= VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ |
VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE; VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE;
gst_caps_set_features (aligned_caps, 0, gst_caps_set_features (aligned_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_DMABUF, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
} else } else
aligned_caps = gst_video_info_to_caps (info); aligned_caps = gst_video_info_to_caps (info);

View file

@ -196,15 +196,17 @@ fixate_output_format (GstMsdkVPP * thiz, GstVideoInfo * vinfo, GstCaps * caps)
#ifndef _WIN32 #ifndef _WIN32
if (is_va) if (is_va)
gst_caps_set_features (ret, 0, gst_caps_set_features (ret, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA));
#else #else
if (is_d3d) if (is_d3d)
gst_caps_set_features (ret, 0, gst_caps_set_features (ret, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY));
#endif #endif
else if (is_dma) else if (is_dma)
gst_caps_set_features (ret, 0, gst_caps_set_features (ret, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_DMABUF));
return ret; return ret;
} }

View file

@ -177,7 +177,8 @@ gst_cuda_base_convert_caps_remove_format_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();
@ -214,7 +215,8 @@ gst_cuda_base_convert_caps_rangify_size_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();
@ -257,7 +259,8 @@ gst_cuda_base_convert_caps_remove_format_and_rangify_size_info (GstCaps * caps)
gint i, n; gint i, n;
GstCaps *res; GstCaps *res;
GstCapsFeatures *feature = GstCapsFeatures *feature =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY);
res = gst_caps_new_empty (); res = gst_caps_new_empty ();

View file

@ -437,7 +437,8 @@ gst_cuda_ipc_sink_set_caps (GstBaseSink * sink, GstCaps * caps)
} }
gst_caps_set_features_simple (new_caps, gst_caps_set_features_simple (new_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
gst_clear_caps (&priv->caps); gst_clear_caps (&priv->caps);
priv->caps = new_caps; priv->caps = new_caps;

View file

@ -246,7 +246,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
gst_caps_set_features (tmp, i, gst_caps_set_features (tmp, i,
gst_caps_features_from_string (feature_name)); gst_caps_features_new_single_static_str (feature_name));
return tmp; return tmp;
} }

View file

@ -1457,13 +1457,15 @@ gst_nv_av1_encoder_create_class_data (GstObject * device, gpointer session,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (device_mode == GST_NV_ENCODER_DEVICE_D3D11) { if (device_mode == GST_NV_ENCODER_DEVICE_D3D11) {
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
} }
#endif #endif
if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) { if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) {
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
if (gst_nvcodec_is_windows_10_or_greater ()) { if (gst_nvcodec_is_windows_10_or_greater ()) {
gboolean have_interop = FALSE; gboolean have_interop = FALSE;
@ -1472,8 +1474,8 @@ gst_nv_av1_encoder_create_class_data (GstObject * device, gpointer session,
if (have_interop) { if (have_interop) {
auto d3d12_caps = gst_caps_copy (system_caps); auto d3d12_caps = gst_caps_copy (system_caps);
gst_caps_set_features_simple (d3d12_caps, gst_caps_set_features_simple (d3d12_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, gst_caps_features_new_static_str
nullptr)); (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr));
gst_caps_append (sink_caps, d3d12_caps); gst_caps_append (sink_caps, d3d12_caps);
} }
} }
@ -1481,7 +1483,8 @@ gst_nv_av1_encoder_create_class_data (GstObject * device, gpointer session,
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
GstCaps *gl_caps = gst_caps_copy (system_caps); GstCaps *gl_caps = gst_caps_copy (system_caps);
gst_caps_set_features (gl_caps, 0, gst_caps_set_features (gl_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
gst_caps_append (sink_caps, gl_caps); gst_caps_append (sink_caps, gl_caps);
#endif #endif
} }
@ -1775,14 +1778,16 @@ gst_nv_av1_encoder_register_auto_select (GstPlugin * plugin,
if (cuda_device_id_size > 0) { if (cuda_device_id_size > 0) {
GstCaps *cuda_caps = gst_caps_copy (system_caps); GstCaps *cuda_caps = gst_caps_copy (system_caps);
gst_caps_set_features (cuda_caps, 0, gst_caps_set_features (cuda_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
gst_caps_append (sink_caps, cuda_caps); gst_caps_append (sink_caps, cuda_caps);
} }
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (adapter_luid_size > 0) { if (adapter_luid_size > 0) {
GstCaps *d3d11_caps = gst_caps_copy (system_caps); GstCaps *d3d11_caps = gst_caps_copy (system_caps);
gst_caps_set_features (d3d11_caps, 0, gst_caps_set_features (d3d11_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_caps_append (sink_caps, d3d11_caps); gst_caps_append (sink_caps, d3d11_caps);
} }
#endif #endif
@ -1790,7 +1795,8 @@ gst_nv_av1_encoder_register_auto_select (GstPlugin * plugin,
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
GstCaps *gl_caps = gst_caps_copy (system_caps); GstCaps *gl_caps = gst_caps_copy (system_caps);
gst_caps_set_features (gl_caps, 0, gst_caps_set_features (gl_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
gst_caps_append (sink_caps, gl_caps); gst_caps_append (sink_caps, gl_caps);
#endif #endif

View file

@ -669,15 +669,17 @@ gst_nvdec_negotiate (GstVideoDecoder * decoder)
case GST_NVDEC_MEM_TYPE_CUDA: case GST_NVDEC_MEM_TYPE_CUDA:
GST_DEBUG_OBJECT (nvdec, "use cuda memory"); GST_DEBUG_OBJECT (nvdec, "use cuda memory");
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
NULL));
break; break;
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
case GST_NVDEC_MEM_TYPE_GL: case GST_NVDEC_MEM_TYPE_GL:
GST_DEBUG_OBJECT (nvdec, "use gl memory"); GST_DEBUG_OBJECT (nvdec, "use gl memory");
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
gst_caps_set_simple (state->caps, "texture-target", G_TYPE_STRING, NULL));
"2D", NULL); gst_caps_set_simple (state->caps, "texture-target", G_TYPE_STRING, "2D",
NULL);
break; break;
#endif #endif
default: default:

View file

@ -1249,7 +1249,8 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec,
{ {
GstCaps *cuda_caps = gst_caps_copy (src_templ); GstCaps *cuda_caps = gst_caps_copy (src_templ);
gst_caps_set_features_simple (cuda_caps, gst_caps_set_features_simple (cuda_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY));
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (is_stateless) { if (is_stateless) {
@ -1266,7 +1267,8 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec,
{ {
GstCaps *gl_caps = gst_caps_copy (src_templ); GstCaps *gl_caps = gst_caps_copy (src_templ);
gst_caps_set_features_simple (gl_caps, gst_caps_set_features_simple (gl_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
gst_caps_append (src_templ, gl_caps); gst_caps_append (src_templ, gl_caps);
} }
#endif #endif
@ -1414,7 +1416,8 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec,
src_templ = gst_caps_copy (raw_caps); src_templ = gst_caps_copy (raw_caps);
gst_caps_set_features_simple (src_templ, gst_caps_set_features_simple (src_templ,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY));
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (is_stateless) { if (is_stateless) {
@ -1438,7 +1441,8 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec,
src_caps_string = "video/x-raw, format = (string) " + format_str; src_caps_string = "video/x-raw, format = (string) " + format_str;
GstCaps *d3d11_caps = gst_caps_from_string (src_caps_string.c_str ()); GstCaps *d3d11_caps = gst_caps_from_string (src_caps_string.c_str ());
gst_caps_set_features_simple (d3d11_caps, gst_caps_set_features_simple (d3d11_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY));
gst_caps_append (src_templ, d3d11_caps); gst_caps_append (src_templ, d3d11_caps);
} }
#endif #endif
@ -1463,7 +1467,8 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec,
src_caps_string = "video/x-raw, format = (string) " + format_str; src_caps_string = "video/x-raw, format = (string) " + format_str;
GstCaps *gl_caps = gst_caps_from_string (src_caps_string.c_str ()); GstCaps *gl_caps = gst_caps_from_string (src_caps_string.c_str ());
gst_caps_set_features_simple (gl_caps, gst_caps_set_features_simple (gl_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
gst_caps_append (src_templ, gl_caps); gst_caps_append (src_templ, gl_caps);
#endif #endif
gst_caps_append (src_templ, raw_caps); gst_caps_append (src_templ, raw_caps);
@ -1853,21 +1858,24 @@ gst_nv_decoder_negotiate (GstNvDecoder * decoder,
case GST_NV_DECODER_OUTPUT_TYPE_CUDA: case GST_NV_DECODER_OUTPUT_TYPE_CUDA:
GST_DEBUG_OBJECT (videodec, "using CUDA memory"); GST_DEBUG_OBJECT (videodec, "using CUDA memory");
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY));
break; break;
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
case GST_NV_DECODER_OUTPUT_TYPE_D3D11: case GST_NV_DECODER_OUTPUT_TYPE_D3D11:
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY));
break; break;
#endif #endif
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
case GST_NV_DECODER_OUTPUT_TYPE_GL: case GST_NV_DECODER_OUTPUT_TYPE_GL:
GST_DEBUG_OBJECT (videodec, "using GL memory"); GST_DEBUG_OBJECT (videodec, "using GL memory");
gst_caps_set_features (state->caps, 0, gst_caps_set_features (state->caps, 0,
gst_caps_features_new_single (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
gst_caps_set_simple (state->caps, "texture-target", G_TYPE_STRING, (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
"2D", nullptr); gst_caps_set_simple (state->caps, "texture-target", G_TYPE_STRING, "2D",
nullptr);
break; break;
#endif #endif
default: default:

View file

@ -2196,13 +2196,15 @@ gst_nv_h264_encoder_create_class_data (GstObject * device, gpointer session,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (device_mode == GST_NV_ENCODER_DEVICE_D3D11) { if (device_mode == GST_NV_ENCODER_DEVICE_D3D11) {
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
} }
#endif #endif
if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) { if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) {
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
if (gst_nvcodec_is_windows_10_or_greater ()) { if (gst_nvcodec_is_windows_10_or_greater ()) {
gboolean have_interop = FALSE; gboolean have_interop = FALSE;
@ -2211,8 +2213,8 @@ gst_nv_h264_encoder_create_class_data (GstObject * device, gpointer session,
if (have_interop) { if (have_interop) {
auto d3d12_caps = gst_caps_copy (system_caps); auto d3d12_caps = gst_caps_copy (system_caps);
gst_caps_set_features_simple (d3d12_caps, gst_caps_set_features_simple (d3d12_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, gst_caps_features_new_static_str
nullptr)); (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr));
gst_caps_append (sink_caps, d3d12_caps); gst_caps_append (sink_caps, d3d12_caps);
} }
} }
@ -2220,7 +2222,8 @@ gst_nv_h264_encoder_create_class_data (GstObject * device, gpointer session,
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
GstCaps *gl_caps = gst_caps_copy (system_caps); GstCaps *gl_caps = gst_caps_copy (system_caps);
gst_caps_set_features (gl_caps, 0, gst_caps_set_features (gl_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
gst_caps_append (sink_caps, gl_caps); gst_caps_append (sink_caps, gl_caps);
#endif #endif
} }
@ -2544,14 +2547,16 @@ gst_nv_h264_encoder_register_auto_select (GstPlugin * plugin,
if (cuda_device_id_size > 0) { if (cuda_device_id_size > 0) {
GstCaps *cuda_caps = gst_caps_copy (system_caps); GstCaps *cuda_caps = gst_caps_copy (system_caps);
gst_caps_set_features (cuda_caps, 0, gst_caps_set_features (cuda_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
gst_caps_append (sink_caps, cuda_caps); gst_caps_append (sink_caps, cuda_caps);
} }
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (adapter_luid_size > 0) { if (adapter_luid_size > 0) {
GstCaps *d3d11_caps = gst_caps_copy (system_caps); GstCaps *d3d11_caps = gst_caps_copy (system_caps);
gst_caps_set_features (d3d11_caps, 0, gst_caps_set_features (d3d11_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_caps_append (sink_caps, d3d11_caps); gst_caps_append (sink_caps, d3d11_caps);
} }
#endif #endif
@ -2559,7 +2564,8 @@ gst_nv_h264_encoder_register_auto_select (GstPlugin * plugin,
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
GstCaps *gl_caps = gst_caps_copy (system_caps); GstCaps *gl_caps = gst_caps_copy (system_caps);
gst_caps_set_features (gl_caps, 0, gst_caps_set_features (gl_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
gst_caps_append (sink_caps, gl_caps); gst_caps_append (sink_caps, gl_caps);
#endif #endif

View file

@ -2254,13 +2254,15 @@ gst_nv_h265_encoder_create_class_data (GstObject * device, gpointer session,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (device_mode == GST_NV_ENCODER_DEVICE_D3D11) { if (device_mode == GST_NV_ENCODER_DEVICE_D3D11) {
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
} }
#endif #endif
if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) { if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) {
gst_caps_set_features (sink_caps, 0, gst_caps_set_features (sink_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
if (gst_nvcodec_is_windows_10_or_greater ()) { if (gst_nvcodec_is_windows_10_or_greater ()) {
gboolean have_interop = FALSE; gboolean have_interop = FALSE;
@ -2269,8 +2271,8 @@ gst_nv_h265_encoder_create_class_data (GstObject * device, gpointer session,
if (have_interop) { if (have_interop) {
auto d3d12_caps = gst_caps_copy (system_caps); auto d3d12_caps = gst_caps_copy (system_caps);
gst_caps_set_features_simple (d3d12_caps, gst_caps_set_features_simple (d3d12_caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, gst_caps_features_new_static_str
nullptr)); (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr));
gst_caps_append (sink_caps, d3d12_caps); gst_caps_append (sink_caps, d3d12_caps);
} }
} }
@ -2278,7 +2280,8 @@ gst_nv_h265_encoder_create_class_data (GstObject * device, gpointer session,
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
GstCaps *gl_caps = gst_caps_copy (system_caps); GstCaps *gl_caps = gst_caps_copy (system_caps);
gst_caps_set_features (gl_caps, 0, gst_caps_set_features (gl_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
gst_caps_append (sink_caps, gl_caps); gst_caps_append (sink_caps, gl_caps);
#endif #endif
} }
@ -2599,14 +2602,16 @@ gst_nv_h265_encoder_register_auto_select (GstPlugin * plugin,
if (cuda_device_id_size > 0) { if (cuda_device_id_size > 0) {
GstCaps *cuda_caps = gst_caps_copy (system_caps); GstCaps *cuda_caps = gst_caps_copy (system_caps);
gst_caps_set_features (cuda_caps, 0, gst_caps_set_features (cuda_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY,
nullptr));
gst_caps_append (sink_caps, cuda_caps); gst_caps_append (sink_caps, cuda_caps);
} }
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
if (adapter_luid_size > 0) { if (adapter_luid_size > 0) {
GstCaps *d3d11_caps = gst_caps_copy (system_caps); GstCaps *d3d11_caps = gst_caps_copy (system_caps);
gst_caps_set_features (d3d11_caps, 0, gst_caps_set_features (d3d11_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
gst_caps_append (sink_caps, d3d11_caps); gst_caps_append (sink_caps, d3d11_caps);
} }
#endif #endif
@ -2614,7 +2619,8 @@ gst_nv_h265_encoder_register_auto_select (GstPlugin * plugin,
#ifdef HAVE_CUDA_GST_GL #ifdef HAVE_CUDA_GST_GL
GstCaps *gl_caps = gst_caps_copy (system_caps); GstCaps *gl_caps = gst_caps_copy (system_caps);
gst_caps_set_features (gl_caps, 0, gst_caps_set_features (gl_caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
nullptr));
gst_caps_append (sink_caps, gl_caps); gst_caps_append (sink_caps, gl_caps);
#endif #endif

View file

@ -751,12 +751,14 @@ gst_qsv_av1_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (sink_caps); GstCaps *d3d11_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
auto d3d12_caps = gst_caps_copy (sink_caps); auto d3d12_caps = gst_caps_copy (sink_caps);
auto d3d12_feature = auto d3d12_feature =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d12_caps, d3d12_feature); gst_caps_set_features_simple (d3d12_caps, d3d12_feature);
gst_caps_append (d3d11_caps, d3d12_caps); gst_caps_append (d3d11_caps, d3d12_caps);
#endif #endif
@ -765,7 +767,7 @@ gst_qsv_av1_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#else #else
GstCaps *va_caps = gst_caps_copy (sink_caps); GstCaps *va_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VA, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VA, nullptr);
gst_caps_set_features_simple (va_caps, caps_features); gst_caps_set_features_simple (va_caps, caps_features);
gst_caps_append (va_caps, sink_caps); gst_caps_append (va_caps, sink_caps);
sink_caps = va_caps; sink_caps = va_caps;

View file

@ -1197,7 +1197,8 @@ gst_qsv_decoder_negotiate_internal (GstVideoDecoder * decoder,
if (priv->use_video_memory) { if (priv->use_video_memory) {
GST_DEBUG_OBJECT (self, "Downstream supports D3D11 memory"); GST_DEBUG_OBJECT (self, "Downstream supports D3D11 memory");
gst_caps_set_features (priv->output_state->caps, 0, gst_caps_set_features (priv->output_state->caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr));
} }
#endif #endif

View file

@ -498,7 +498,8 @@ gst_qsv_h264_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (src_caps); GstCaps *d3d11_caps = gst_caps_copy (src_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
gst_caps_append (d3d11_caps, src_caps); gst_caps_append (d3d11_caps, src_caps);
src_caps = d3d11_caps; src_caps = d3d11_caps;

View file

@ -2241,12 +2241,14 @@ gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (sink_caps); GstCaps *d3d11_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
auto d3d12_caps = gst_caps_copy (sink_caps); auto d3d12_caps = gst_caps_copy (sink_caps);
auto d3d12_feature = auto d3d12_feature =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d12_caps, d3d12_feature); gst_caps_set_features_simple (d3d12_caps, d3d12_feature);
gst_caps_append (d3d11_caps, d3d12_caps); gst_caps_append (d3d11_caps, d3d12_caps);
#endif #endif
@ -2255,7 +2257,7 @@ gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#else #else
GstCaps *va_caps = gst_caps_copy (sink_caps); GstCaps *va_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VA, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VA, nullptr);
gst_caps_set_features_simple (va_caps, caps_features); gst_caps_set_features_simple (va_caps, caps_features);
gst_caps_append (va_caps, sink_caps); gst_caps_append (va_caps, sink_caps);
sink_caps = va_caps; sink_caps = va_caps;

View file

@ -613,7 +613,8 @@ gst_qsv_h265_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (src_caps); GstCaps *d3d11_caps = gst_caps_copy (src_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
gst_caps_append (d3d11_caps, src_caps); gst_caps_append (d3d11_caps, src_caps);
src_caps = d3d11_caps; src_caps = d3d11_caps;

View file

@ -1580,12 +1580,14 @@ gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (sink_caps); GstCaps *d3d11_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
auto d3d12_caps = gst_caps_copy (sink_caps); auto d3d12_caps = gst_caps_copy (sink_caps);
auto d3d12_feature = auto d3d12_feature =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d12_caps, d3d12_feature); gst_caps_set_features_simple (d3d12_caps, d3d12_feature);
gst_caps_append (d3d11_caps, d3d12_caps); gst_caps_append (d3d11_caps, d3d12_caps);
#endif #endif
@ -1594,7 +1596,7 @@ gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#else #else
GstCaps *va_caps = gst_caps_copy (sink_caps); GstCaps *va_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VA, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VA, nullptr);
gst_caps_set_features_simple (va_caps, caps_features); gst_caps_set_features_simple (va_caps, caps_features);
gst_caps_append (va_caps, sink_caps); gst_caps_append (va_caps, sink_caps);
sink_caps = va_caps; sink_caps = va_caps;

View file

@ -228,7 +228,8 @@ gst_qsv_jpeg_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (src_caps); GstCaps *d3d11_caps = gst_caps_copy (src_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
gst_caps_append (d3d11_caps, src_caps); gst_caps_append (d3d11_caps, src_caps);
src_caps = d3d11_caps; src_caps = d3d11_caps;

View file

@ -483,12 +483,14 @@ gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (sink_caps); GstCaps *d3d11_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
auto d3d12_caps = gst_caps_copy (sink_caps); auto d3d12_caps = gst_caps_copy (sink_caps);
auto d3d12_feature = auto d3d12_feature =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d12_caps, d3d12_feature); gst_caps_set_features_simple (d3d12_caps, d3d12_feature);
gst_caps_append (d3d11_caps, d3d12_caps); gst_caps_append (d3d11_caps, d3d12_caps);
#endif #endif
@ -497,7 +499,7 @@ gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#else #else
GstCaps *va_caps = gst_caps_copy (sink_caps); GstCaps *va_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VA, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VA, nullptr);
gst_caps_set_features_simple (va_caps, caps_features); gst_caps_set_features_simple (va_caps, caps_features);
gst_caps_append (va_caps, sink_caps); gst_caps_append (va_caps, sink_caps);
sink_caps = va_caps; sink_caps = va_caps;

View file

@ -231,7 +231,8 @@ gst_qsv_vp9_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (src_caps); GstCaps *d3d11_caps = gst_caps_copy (src_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
gst_caps_append (d3d11_caps, src_caps); gst_caps_append (d3d11_caps, src_caps);
src_caps = d3d11_caps; src_caps = d3d11_caps;

View file

@ -970,12 +970,14 @@ gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
GstCaps *d3d11_caps = gst_caps_copy (sink_caps); GstCaps *d3d11_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d11_caps, caps_features); gst_caps_set_features_simple (d3d11_caps, caps_features);
#ifdef HAVE_GST_D3D12 #ifdef HAVE_GST_D3D12
auto d3d12_caps = gst_caps_copy (sink_caps); auto d3d12_caps = gst_caps_copy (sink_caps);
auto d3d12_feature = auto d3d12_feature =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY,
nullptr);
gst_caps_set_features_simple (d3d12_caps, d3d12_feature); gst_caps_set_features_simple (d3d12_caps, d3d12_feature);
gst_caps_append (d3d11_caps, d3d12_caps); gst_caps_append (d3d11_caps, d3d12_caps);
#endif #endif
@ -984,7 +986,7 @@ gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
#else #else
GstCaps *va_caps = gst_caps_copy (sink_caps); GstCaps *va_caps = gst_caps_copy (sink_caps);
GstCapsFeatures *caps_features = GstCapsFeatures *caps_features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VA, nullptr); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VA, nullptr);
gst_caps_set_features_simple (va_caps, caps_features); gst_caps_set_features_simple (va_caps, caps_features);
gst_caps_append (va_caps, sink_caps); gst_caps_append (va_caps, sink_caps);
sink_caps = va_caps; sink_caps = va_caps;

View file

@ -444,11 +444,13 @@ gst_v4l2_decoder_probe_caps_for_format (GstV4l2Decoder * self,
"DMA_DRM", "drm-format", G_TYPE_STRING, "DMA_DRM", "drm-format", G_TYPE_STRING,
gst_video_dma_drm_fourcc_to_string (drm_fourcc, 0), NULL); gst_video_dma_drm_fourcc_to_string (drm_fourcc, 0), NULL);
gst_caps_set_features_simple (drm_caps, gst_caps_set_features_simple (drm_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_DMABUF));
if (!gst_caps_is_empty (size_caps)) { if (!gst_caps_is_empty (size_caps)) {
gst_caps_set_features_simple (size_caps, gst_caps_set_features_simple (size_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_DMABUF));
tmp = drm_caps; tmp = drm_caps;
drm_caps = drm_caps =
gst_caps_intersect_full (tmp, size_caps, GST_CAPS_INTERSECT_FIRST); gst_caps_intersect_full (tmp, size_caps, GST_CAPS_INTERSECT_FIRST);

View file

@ -285,7 +285,7 @@ _create_internal_pool (GstVaAV1Dec * self, gint width, gint height)
} }
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA));
surface_formats = gst_va_decoder_get_surface_formats (base->decoder); surface_formats = gst_va_decoder_get_surface_formats (base->decoder);
allocator = gst_va_allocator_new (base->display, surface_formats); allocator = gst_va_allocator_new (base->display, surface_formats);

View file

@ -210,7 +210,7 @@ gst_va_base_convert_caps_to_va (GstCaps * caps)
} }
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA));
return TRUE; return TRUE;
} }

View file

@ -372,7 +372,7 @@ _decide_allocation_for_video_crop (GstVideoDecoder * decoder,
va_caps = gst_caps_copy (caps); va_caps = gst_caps_copy (caps);
gst_caps_set_features_simple (va_caps, gst_caps_set_features_simple (va_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA));
if (!(allocator = _create_allocator (base, va_caps))) if (!(allocator = _create_allocator (base, va_caps)))
goto cleanup; goto cleanup;

View file

@ -249,7 +249,7 @@ gst_va_create_dma_caps (GstVaDisplay * display, VAEntrypoint entrypoint,
max_height, NULL); max_height, NULL);
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF));
gst_caps_set_simple (caps, "format", G_TYPE_STRING, "DMA_DRM", NULL); gst_caps_set_simple (caps, "format", G_TYPE_STRING, "DMA_DRM", NULL);
@ -367,7 +367,8 @@ gst_va_create_raw_caps_from_config (GstVaDisplay * display, VAConfigID config)
if (mem_type & VA_SURFACE_ATTRIB_MEM_TYPE_VA) { if (mem_type & VA_SURFACE_ATTRIB_MEM_TYPE_VA) {
feature_caps = gst_caps_copy (base_caps); feature_caps = gst_caps_copy (base_caps);
features = gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA); features =
gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA);
gst_caps_set_features_simple (feature_caps, features); gst_caps_set_features_simple (feature_caps, features);
caps = gst_caps_merge (caps, feature_caps); caps = gst_caps_merge (caps, feature_caps);
} }

View file

@ -1223,7 +1223,7 @@ _caps_from_format_and_feature (GstVideoFormat format,
if (g_strcmp0 (feature, GST_CAPS_FEATURE_MEMORY_DMABUF) == 0 || if (g_strcmp0 (feature, GST_CAPS_FEATURE_MEMORY_DMABUF) == 0 ||
g_strcmp0 (feature, GST_CAPS_FEATURE_MEMORY_VA) == 0) g_strcmp0 (feature, GST_CAPS_FEATURE_MEMORY_VA) == 0)
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string (feature)); gst_caps_features_new_single_static_str (feature));
return caps; return caps;
} }
@ -1455,7 +1455,7 @@ gst_va_compositor_update_caps (GstVideoAggregator * vagg, GstCaps * src_caps)
} else { } else {
clip_caps = gst_caps_new_empty_simple ("video/x-raw"); clip_caps = gst_caps_new_empty_simple ("video/x-raw");
gst_caps_set_features_simple (clip_caps, gst_caps_set_features_simple (clip_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA));
} }
} else if (dma_formats) { } else if (dma_formats) {
g_assert (dma_formats->len == modifiers->len); g_assert (dma_formats->len == modifiers->len);
@ -1474,7 +1474,8 @@ gst_va_compositor_update_caps (GstVideoAggregator * vagg, GstCaps * src_caps)
} else { } else {
clip_caps = gst_caps_new_empty_simple ("video/x-raw"); clip_caps = gst_caps_new_empty_simple ("video/x-raw");
gst_caps_set_features_simple (clip_caps, gst_caps_set_features_simple (clip_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_DMABUF));
} }
} else if (sys_formats) { } else if (sys_formats) {
if (best_sys != GST_VIDEO_FORMAT_UNKNOWN) { if (best_sys != GST_VIDEO_FORMAT_UNKNOWN) {

View file

@ -364,7 +364,7 @@ _create_reconstruct_pool (GstVaDisplay * display, GArray * surface_formats,
caps = gst_video_info_to_caps (&info); caps = gst_video_info_to_caps (&info);
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA));
allocator = gst_va_allocator_new (display, surface_formats); allocator = gst_va_allocator_new (display, surface_formats);

View file

@ -1101,7 +1101,8 @@ gst_va_filter_get_caps (GstVaFilter * self)
if (mem_types & VA_SURFACE_ATTRIB_MEM_TYPE_VA) { if (mem_types & VA_SURFACE_ATTRIB_MEM_TYPE_VA) {
feature_caps = gst_caps_copy (base_caps); feature_caps = gst_caps_copy (base_caps);
features = gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VA); features =
gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_VA);
gst_caps_set_features_simple (feature_caps, features); gst_caps_set_features_simple (feature_caps, features);
caps = gst_caps_merge (caps, feature_caps); caps = gst_caps_merge (caps, feature_caps);
} }

View file

@ -1015,7 +1015,7 @@ gst_va_vpp_complete_caps_features (const GstCaps * caps,
continue; continue;
} }
features = gst_caps_features_new (feature_name, NULL); features = gst_caps_features_new_static_str (feature_name, NULL);
if (!gst_caps_is_subset_structure_full (tmp, s, features)) if (!gst_caps_is_subset_structure_full (tmp, s, features))
gst_caps_append_structure_full (tmp, gst_structure_copy (s), features); gst_caps_append_structure_full (tmp, gst_structure_copy (s), features);
else else

View file

@ -68,7 +68,8 @@ create_buffer_pool (const char *format, VkImageUsageFlags usage,
caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, format, caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, format,
"width", G_TYPE_INT, 1024, "height", G_TYPE_INT, 780, NULL); "width", G_TYPE_INT, 1024, "height", G_TYPE_INT, 780, NULL);
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
NULL));
pool = gst_vulkan_image_buffer_pool_new (device); pool = gst_vulkan_image_buffer_pool_new (device);

View file

@ -112,7 +112,8 @@ get_output_buffer (GstVulkanDecoder * dec, VkFormat vk_format,
GstStructure *config; GstStructure *config;
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
NULL));
profile_caps = gst_vulkan_decoder_profile_caps (dec); profile_caps = gst_vulkan_decoder_profile_caps (dec);
fail_unless (profile_caps); fail_unless (profile_caps);

View file

@ -111,7 +111,8 @@ allocate_image_buffer_pool (GstVulkanEncoder * enc, uint32_t width,
gsize frame_size = width * height * 2; //NV12 gsize frame_size = width * height * 2; //NV12
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
NULL));
fail_unless (gst_vulkan_encoder_create_dpb_pool (enc, caps)); fail_unless (gst_vulkan_encoder_create_dpb_pool (enc, caps));
gst_video_info_from_caps (&out_info, caps); gst_video_info_from_caps (&out_info, caps);
@ -147,7 +148,8 @@ allocate_buffer_pool (GstVulkanEncoder * enc, uint32_t width, uint32_t height)
GstStructure *config = gst_buffer_pool_get_config (pool); GstStructure *config = gst_buffer_pool_get_config (pool);
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER,
NULL));
gst_video_info_from_caps (&in_info, caps); gst_video_info_from_caps (&in_info, caps);

View file

@ -114,7 +114,8 @@ allocate_image_buffer_pool (GstVulkanEncoder * enc, uint32_t width,
gsize frame_size = width * height * 2; //NV12 gsize frame_size = width * height * 2; //NV12
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
NULL));
fail_unless (gst_vulkan_encoder_create_dpb_pool (enc, caps)); fail_unless (gst_vulkan_encoder_create_dpb_pool (enc, caps));
gst_video_info_from_caps (&out_info, caps); gst_video_info_from_caps (&out_info, caps);
@ -151,7 +152,8 @@ allocate_buffer_pool (GstVulkanEncoder * enc, uint32_t width, uint32_t height)
GstStructure *config = gst_buffer_pool_get_config (pool); GstStructure *config = gst_buffer_pool_get_config (pool);
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER,
NULL));
gst_video_info_from_caps (&in_info, caps); gst_video_info_from_caps (&in_info, caps);

View file

@ -348,7 +348,7 @@ create_pipelne (AppData * app_data)
/* Set d3d11 caps feature so that d3d11testsrc can output GPU memory /* Set d3d11 caps feature so that d3d11testsrc can output GPU memory
* instead of system memory */ * instead of system memory */
gst_caps_set_features (caps, 0, gst_caps_set_features (caps, 0,
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, nullptr));
g_object_set (sink, "caps", caps, nullptr); g_object_set (sink, "caps", caps, nullptr);
gst_caps_unref (caps); gst_caps_unref (caps);

View file

@ -439,7 +439,7 @@ main (gint argc, gchar ** argv)
if (use_gl) { if (use_gl) {
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string ("memory:GLMemory")); gst_caps_features_new_single_static_str ("memory:GLMemory"));
} }
g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL); g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL);

View file

@ -948,7 +948,7 @@ _set_caps_features (const GstCaps * caps, const gchar * feature_name)
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
gst_caps_set_features (tmp, i, gst_caps_set_features (tmp, i,
gst_caps_features_from_string (feature_name)); gst_caps_features_new_single_static_str (feature_name));
return tmp; return tmp;
} }

View file

@ -1612,9 +1612,10 @@ update_output_format (GstGLImageSink * glimage_sink)
out_caps = gst_video_info_to_caps (out_info); out_caps = gst_video_info_to_caps (out_info);
gst_caps_set_features (out_caps, 0, gst_caps_set_features (out_caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
gst_caps_set_simple (out_caps, "texture-target", G_TYPE_STRING, (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
target_str, NULL); gst_caps_set_simple (out_caps, "texture-target", G_TYPE_STRING, target_str,
NULL);
if (glimage_sink->convert_views) { if (glimage_sink->convert_views) {
gst_caps_set_simple (out_caps, "texture-target", G_TYPE_STRING, gst_caps_set_simple (out_caps, "texture-target", G_TYPE_STRING,

View file

@ -605,7 +605,8 @@ _update_caps (GstVideoAggregator * vagg, GstCaps * caps)
blend_caps = gst_video_info_to_caps (mix_info); blend_caps = gst_video_info_to_caps (mix_info);
gst_caps_set_features (blend_caps, 0, gst_caps_set_features (blend_caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
tmp_caps = get_converted_caps (GST_GL_STEREO_MIX (vagg), blend_caps); tmp_caps = get_converted_caps (GST_GL_STEREO_MIX (vagg), blend_caps);
gst_caps_unref (blend_caps); gst_caps_unref (blend_caps);
@ -640,7 +641,8 @@ _negotiated_caps (GstAggregator * agg, GstCaps * caps)
in_caps = gst_video_info_to_caps (&mix->mix_info); in_caps = gst_video_info_to_caps (&mix->mix_info);
gst_caps_set_features (in_caps, 0, gst_caps_set_features (in_caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
gst_caps_set_simple (in_caps, "texture-target", G_TYPE_STRING, gst_caps_set_simple (in_caps, "texture-target", G_TYPE_STRING,
GST_GL_TEXTURE_TARGET_2D_STR, NULL); GST_GL_TEXTURE_TARGET_2D_STR, NULL);

View file

@ -196,12 +196,14 @@ gst_gl_view_convert_element_set_caps (GstGLFilter * filter, GstCaps * incaps,
gst_caps_set_simple (incaps, "format", G_TYPE_STRING, "RGBA", NULL); gst_caps_set_simple (incaps, "format", G_TYPE_STRING, "RGBA", NULL);
gl_features = gl_features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
gst_caps_set_features (incaps, 0, gl_features); gst_caps_set_features (incaps, 0, gl_features);
gst_caps_set_simple (outcaps, "format", G_TYPE_STRING, "RGBA", NULL); gst_caps_set_simple (outcaps, "format", G_TYPE_STRING, "RGBA", NULL);
gl_features = gl_features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
gst_caps_set_features (outcaps, 0, gl_features); gst_caps_set_features (outcaps, 0, gl_features);
ret = gst_gl_view_convert_set_caps (viewconvert_filter->viewconvert, ret = gst_gl_view_convert_set_caps (viewconvert_filter->viewconvert,

View file

@ -198,7 +198,7 @@ _set_caps_features_with_passthrough (const GstCaps * caps,
GstStructure *s = gst_caps_get_structure (caps, i); GstStructure *s = gst_caps_get_structure (caps, i);
orig_features = gst_caps_get_features (caps, i); orig_features = gst_caps_get_features (caps, i);
features = gst_caps_features_new (feature_name, NULL); features = gst_caps_features_new_static_str (feature_name, NULL);
if (gst_caps_features_is_any (orig_features)) { if (gst_caps_features_is_any (orig_features)) {
/* if we have any features, we add both the features with and without @passthrough */ /* if we have any features, we add both the features with and without @passthrough */
@ -430,7 +430,8 @@ _gl_memory_upload_transform_caps (gpointer impl, GstGLContext * context,
GstCapsFeatures *filter_features; GstCapsFeatures *filter_features;
GstGLTextureTarget target_mask; GstGLTextureTarget target_mask;
filter_features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, filter_features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY, NULL); GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY, NULL);
if (!_filter_caps_with_features (caps, filter_features, &tmp)) { if (!_filter_caps_with_features (caps, filter_features, &tmp)) {
gst_caps_features_free (filter_features); gst_caps_features_free (filter_features);
@ -538,9 +539,12 @@ _gl_memory_upload_propose_allocation (gpointer impl, GstQuery * decide_query,
g_assert (gst_caps_is_fixed (caps)); g_assert (gst_caps_is_fixed (caps));
features_gl = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, NULL); features_gl =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
NULL);
features_sys = features_sys =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY, NULL); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY,
NULL);
/* Only offer our custom allocator if that type of memory was negotiated. */ /* Only offer our custom allocator if that type of memory was negotiated. */
if (_filter_caps_with_features (caps, features_sys, NULL)) { if (_filter_caps_with_features (caps, features_sys, NULL)) {
use_sys_mem = TRUE; use_sys_mem = TRUE;
@ -1277,7 +1281,7 @@ _dma_buf_upload_transform_caps_common (GstCaps * caps,
(!g_strcmp0 (from_feature, GST_CAPS_FEATURE_MEMORY_GL_MEMORY), NULL); (!g_strcmp0 (from_feature, GST_CAPS_FEATURE_MEMORY_GL_MEMORY), NULL);
} }
features = gst_caps_features_new (from_feature, NULL); features = gst_caps_features_new_static_str (from_feature, NULL);
if (!_filter_caps_with_features (caps, features, &caps_to_transform)) { if (!_filter_caps_with_features (caps, features, &caps_to_transform)) {
gst_caps_features_free (features); gst_caps_features_free (features);
return NULL; return NULL;
@ -1335,8 +1339,8 @@ _dma_buf_upload_transform_caps_common (GstCaps * caps,
passthrough: passthrough:
/* Change the feature name. */ /* Change the feature name. */
passthrough = gst_caps_features_from_string passthrough = gst_caps_features_new_static_str
(GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION); (GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL);
ret_caps = _set_caps_features_with_passthrough (tmp_caps, ret_caps = _set_caps_features_with_passthrough (tmp_caps,
to_feature, passthrough); to_feature, passthrough);
@ -2231,7 +2235,8 @@ _raw_data_upload_transform_caps (gpointer impl, GstGLContext * context,
GstCaps *tmp; GstCaps *tmp;
filter_features = filter_features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
if (!_filter_caps_with_features (caps, filter_features, &tmp)) { if (!_filter_caps_with_features (caps, filter_features, &tmp)) {
gst_caps_features_free (filter_features); gst_caps_features_free (filter_features);
gst_caps_features_free (passthrough); gst_caps_features_free (passthrough);
@ -2276,7 +2281,8 @@ _raw_data_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
GstCapsFeatures *features; GstCapsFeatures *features;
features = features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
/* Also consider the omited system memory feature cases, such as /* Also consider the omited system memory feature cases, such as
video/x-raw(meta:GstVideoOverlayComposition) */ video/x-raw(meta:GstVideoOverlayComposition) */
if (!_filter_caps_with_features (in_caps, features, NULL)) { if (!_filter_caps_with_features (in_caps, features, NULL)) {
@ -2438,7 +2444,8 @@ _directviv_upload_transform_caps (gpointer impl, GstGLContext * context,
GstCapsFeatures *filter_features; GstCapsFeatures *filter_features;
filter_features = filter_features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
if (!_filter_caps_with_features (caps, filter_features, &tmp)) { if (!_filter_caps_with_features (caps, filter_features, &tmp)) {
gst_caps_features_free (filter_features); gst_caps_features_free (filter_features);
gst_caps_features_free (passthrough); gst_caps_features_free (passthrough);
@ -2494,7 +2501,8 @@ _directviv_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
return FALSE; return FALSE;
features = features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
/* Also consider the omited system memory feature cases, such as /* Also consider the omited system memory feature cases, such as
video/x-raw(meta:GstVideoOverlayComposition) */ video/x-raw(meta:GstVideoOverlayComposition) */
if (!_filter_caps_with_features (in_caps, features, NULL)) { if (!_filter_caps_with_features (in_caps, features, NULL)) {
@ -2772,7 +2780,7 @@ _nvmm_upload_transform_caps (gpointer impl, GstGLContext * context,
GstCapsFeatures *filter_features; GstCapsFeatures *filter_features;
filter_features = filter_features =
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_NVMM); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_NVMM);
if (!_filter_caps_with_features (caps, filter_features, &tmp)) { if (!_filter_caps_with_features (caps, filter_features, &tmp)) {
gst_caps_features_free (filter_features); gst_caps_features_free (filter_features);
gst_caps_features_free (passthrough); gst_caps_features_free (passthrough);

View file

@ -306,7 +306,7 @@ gst_video_info_dma_drm_to_caps (const GstVideoInfoDmaDrm * drm_info)
} }
gst_caps_set_features_simple (caps, gst_caps_set_features_simple (caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_single_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF));
str = gst_video_dma_drm_fourcc_to_string (drm_info->drm_fourcc, str = gst_video_dma_drm_fourcc_to_string (drm_info->drm_fourcc,
drm_info->drm_modifier); drm_info->drm_modifier);

View file

@ -702,7 +702,9 @@ gst_video_info_to_caps (const GstVideoInfo * info)
*/ */
GstCapsFeatures *features; GstCapsFeatures *features;
features = gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL); features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL);
gst_caps_set_features (caps, 0, features); gst_caps_set_features (caps, 0, features);
} }

View file

@ -294,7 +294,8 @@ gst_video_convert_scale_class_init (GstVideoConvertScaleClass * klass)
GST_DEBUG_CATEGORY_GET (CAT_PERFORMANCE, "GST_PERFORMANCE"); GST_DEBUG_CATEGORY_GET (CAT_PERFORMANCE, "GST_PERFORMANCE");
features_format_interlaced = features_format_interlaced =
gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL); gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL);
features_format_interlaced_sysmem = features_format_interlaced_sysmem =
gst_caps_features_copy (features_format_interlaced); gst_caps_features_copy (features_format_interlaced);
gst_caps_features_add (features_format_interlaced_sysmem, gst_caps_features_add (features_format_interlaced_sysmem,

View file

@ -156,7 +156,8 @@ check_conversion (TestFrame * frames, guint size)
gst_video_info_set_format (&in_info, in_v_format, in_width, in_height); gst_video_info_set_format (&in_info, in_v_format, in_width, in_height);
in_caps = gst_video_info_to_caps (&in_info); in_caps = gst_video_info_to_caps (&in_info);
gst_caps_set_features (in_caps, 0, gst_caps_set_features (in_caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
/* create GL buffer */ /* create GL buffer */
inbuf = gst_buffer_new (); inbuf = gst_buffer_new ();
@ -204,7 +205,8 @@ check_conversion (TestFrame * frames, guint size)
out_height); out_height);
out_caps = gst_video_info_to_caps (&out_info); out_caps = gst_video_info_to_caps (&out_info);
gst_caps_set_features (out_caps, 0, gst_caps_set_features (out_caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
for (k = 0; k < GST_VIDEO_INFO_N_PLANES (&out_info); k++) { for (k = 0; k < GST_VIDEO_INFO_N_PLANES (&out_info); k++) {
out_data[k] = frames[j].data[k]; out_data[k] = frames[j].data[k];
@ -283,7 +285,7 @@ GST_START_TEST (test_passthrough)
in_caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, in_caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING,
gst_video_format_to_string (in_format), NULL); gst_video_format_to_string (in_format), NULL);
gst_caps_set_features_simple (in_caps, gst_caps_set_features_simple (in_caps,
gst_caps_features_from_string (in_feature)); gst_caps_features_new_single_static_str (in_feature));
for (l = 0; l < features_size; l++) { for (l = 0; l < features_size; l++) {
@ -293,7 +295,7 @@ GST_START_TEST (test_passthrough)
out_caps = gst_caps_new_simple ("video/x-raw", "format", out_caps = gst_caps_new_simple ("video/x-raw", "format",
G_TYPE_STRING, gst_video_format_to_string (out_format), NULL); G_TYPE_STRING, gst_video_format_to_string (out_format), NULL);
gst_caps_set_features_simple (out_caps, gst_caps_set_features_simple (out_caps,
gst_caps_features_from_string (out_feature)); gst_caps_features_new_single_static_str (out_feature));
if (gst_caps_is_equal (in_caps, out_caps)) { if (gst_caps_is_equal (in_caps, out_caps)) {
GstCaps *tmp_caps, *tmp_caps2, *tmp_caps3; GstCaps *tmp_caps, *tmp_caps2, *tmp_caps3;

View file

@ -448,7 +448,7 @@ GST_START_TEST (test_passthrough)
in_caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, in_caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING,
gst_video_format_to_string (in_format), NULL); gst_video_format_to_string (in_format), NULL);
gst_caps_set_features_simple (in_caps, gst_caps_set_features_simple (in_caps,
gst_caps_features_from_string (in_feature)); gst_caps_features_new_single_static_str (in_feature));
for (l = 0; l < features_size; l++) { for (l = 0; l < features_size; l++) {
@ -458,7 +458,7 @@ GST_START_TEST (test_passthrough)
out_caps = gst_caps_new_simple ("video/x-raw", "format", out_caps = gst_caps_new_simple ("video/x-raw", "format",
G_TYPE_STRING, gst_video_format_to_string (out_format), NULL); G_TYPE_STRING, gst_video_format_to_string (out_format), NULL);
gst_caps_set_features_simple (out_caps, gst_caps_set_features_simple (out_caps,
gst_caps_features_from_string (out_feature)); gst_caps_features_new_single_static_str (out_feature));
if (gst_caps_is_equal (in_caps, out_caps)) { if (gst_caps_is_equal (in_caps, out_caps)) {
GstCaps *tmp_caps, *tmp_caps2, *tmp_caps3; GstCaps *tmp_caps, *tmp_caps2, *tmp_caps3;

View file

@ -124,7 +124,9 @@ gst_qml6_gl_mixer_pad_prepare_frame (GstVideoAggregatorPad *vagg_pad, GstVideoAg
GstGLContext *context; GstGLContext *context;
in_caps = gst_video_info_to_caps (&vagg_pad->info); in_caps = gst_video_info_to_caps (&vagg_pad->info);
gst_caps_set_features_simple (in_caps, gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_set_features_simple (in_caps,
gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
pad->widget->setCaps (in_caps); pad->widget->setCaps (in_caps);
gst_clear_caps (&in_caps); gst_clear_caps (&in_caps);

View file

@ -447,7 +447,8 @@ qt6_gl_window_take_buffer (Qt6GLWindow * qt6_gl_window, GstCaps ** updated_caps)
if (qt6_gl_window->priv->new_caps) { if (qt6_gl_window->priv->new_caps) {
*updated_caps = gst_video_info_to_caps (&qt6_gl_window->priv->v_info); *updated_caps = gst_video_info_to_caps (&qt6_gl_window->priv->v_info);
gst_caps_set_features (*updated_caps, 0, gst_caps_set_features (*updated_caps, 0,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); gst_caps_features_new_single_static_str
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
qt6_gl_window->priv->new_caps = FALSE; qt6_gl_window->priv->new_caps = FALSE;
} }

View file

@ -2472,7 +2472,9 @@ dup_caps_with_alternate (GstCaps * caps)
GstCapsFeatures *features; GstCapsFeatures *features;
with_alternate = gst_caps_copy (caps); with_alternate = gst_caps_copy (caps);
features = gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL); features =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL);
gst_caps_set_features_simple (with_alternate, features); gst_caps_set_features_simple (with_alternate, features);
gst_caps_set_simple (with_alternate, "interlace-mode", G_TYPE_STRING, gst_caps_set_simple (with_alternate, "interlace-mode", G_TYPE_STRING,

View file

@ -1667,7 +1667,8 @@ add_alternate_variant (GstV4l2Object * v4l2object, GstCaps * caps,
gst_structure_set (alt_s, "interlace-mode", G_TYPE_STRING, "alternate", NULL); gst_structure_set (alt_s, "interlace-mode", G_TYPE_STRING, "alternate", NULL);
gst_caps_append_structure_full (caps, alt_s, gst_caps_append_structure_full (caps, alt_s,
gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL));
} }
static void static void
@ -2730,7 +2731,9 @@ check_alternate_and_append_struct (GstCaps * caps, GstStructure * s)
"alternate")) { "alternate")) {
GstCapsFeatures *feat; GstCapsFeatures *feat;
feat = gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL); feat =
gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL);
gst_caps_set_features (caps, gst_caps_get_size (caps) - 1, feat); gst_caps_set_features (caps, gst_caps_get_size (caps) - 1, feat);
} }
} else if (GST_VALUE_HOLDS_LIST (mode)) { } else if (GST_VALUE_HOLDS_LIST (mode)) {
@ -2754,7 +2757,8 @@ check_alternate_and_append_struct (GstCaps * caps, GstStructure * s)
copy = gst_structure_copy (s); copy = gst_structure_copy (s);
gst_structure_take_value (copy, "interlace-mode", &inter); gst_structure_take_value (copy, "interlace-mode", &inter);
gst_caps_append_structure_full (caps, copy, gst_caps_append_structure_full (caps, copy,
gst_caps_features_new (GST_CAPS_FEATURE_FORMAT_INTERLACED, NULL)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_FORMAT_INTERLACED,
NULL));
} }
g_value_unset (&alter); g_value_unset (&alter);
} }

View file

@ -815,7 +815,7 @@ get_featured_caps (void)
GstCaps *caps; GstCaps *caps;
GstCapsFeatures *features; GstCapsFeatures *features;
features = gst_caps_features_new ("memory:DMABuf", NULL); features = gst_caps_features_new_static_str ("memory:DMABuf", NULL);
caps = gst_caps_new_simple ("video/x-raw", caps = gst_caps_new_simple ("video/x-raw",
"format", G_TYPE_STRING, "NV12", "format", G_TYPE_STRING, "NV12",
"framerate", GST_TYPE_FRACTION, 1, 1, "framerate", GST_TYPE_FRACTION, 1, 1,

View file

@ -258,7 +258,8 @@ gst_vaapidecode_ensure_allowed_srcpad_caps (GstVaapiDecode * decode)
va_caps = gst_caps_copy (base_caps); va_caps = gst_caps_copy (base_caps);
gst_caps_set_features_simple (va_caps, gst_caps_set_features_simple (va_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
NULL));
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL) #if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode) if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode)
@ -374,7 +375,7 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
if (!structure) if (!structure)
break; break;
feature_str = gst_vaapi_caps_feature_to_string (feature); feature_str = gst_vaapi_caps_feature_to_string (feature);
features = gst_caps_features_new (feature_str, NULL); features = gst_caps_features_new_static_str (feature_str, NULL);
gst_caps_set_features (state->caps, 0, features); gst_caps_set_features (state->caps, 0, features);
break; break;
} }

View file

@ -1117,7 +1117,8 @@ gst_vaapi_build_caps_from_formats (GArray * formats, gint min_width,
va_caps = gst_caps_copy (raw_caps); va_caps = gst_caps_copy (raw_caps);
gst_caps_set_features_simple (va_caps, gst_caps_set_features_simple (va_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
NULL));
if (gst_vaapi_mem_type_supports (mem_types, if (gst_vaapi_mem_type_supports (mem_types,
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) || GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) ||
@ -1125,7 +1126,8 @@ gst_vaapi_build_caps_from_formats (GArray * formats, gint min_width,
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2)) { GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2)) {
dma_caps = gst_caps_copy (raw_caps); dma_caps = gst_caps_copy (raw_caps);
gst_caps_set_features_simple (dma_caps, gst_caps_set_features_simple (dma_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF)); gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
} }
out_caps = va_caps; out_caps = va_caps;

View file

@ -1323,7 +1323,7 @@ gst_vaapisink_get_caps_impl (GstBaseSink * base_sink)
gst_caps_append (out_caps, gst_caps_copy (raw_caps)); gst_caps_append (out_caps, gst_caps_copy (raw_caps));
feature_caps = gst_caps_copy (raw_caps); feature_caps = gst_caps_copy (raw_caps);
features = gst_caps_features_new features = gst_caps_features_new_static_str
(GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL); (GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL);
gst_caps_set_features (feature_caps, 0, features); gst_caps_set_features (feature_caps, 0, features);
gst_caps_append (out_caps, feature_caps); gst_caps_append (out_caps, feature_caps);

View file

@ -1266,7 +1266,7 @@ GST_START_TEST (test_features)
s1 = gst_structure_new ("video/x-raw", "width", G_TYPE_INT, 320, "height", s1 = gst_structure_new ("video/x-raw", "width", G_TYPE_INT, 320, "height",
GST_TYPE_INT_RANGE, 240, 260, NULL); GST_TYPE_INT_RANGE, 240, 260, NULL);
fail_unless (s1 != NULL); fail_unless (s1 != NULL);
f1 = gst_caps_features_new ("memory:EGLImage", NULL); f1 = gst_caps_features_new_static_str ("memory:EGLImage", NULL);
fail_unless (f1 != NULL); fail_unless (f1 != NULL);
gst_caps_append_structure_full (c1, s1, f1); gst_caps_append_structure_full (c1, s1, f1);
@ -1293,7 +1293,8 @@ GST_START_TEST (test_features)
s2 = gst_structure_new ("video/x-raw", "width", G_TYPE_INT, 320, "height", s2 = gst_structure_new ("video/x-raw", "width", G_TYPE_INT, 320, "height",
GST_TYPE_INT_RANGE, 240, 260, NULL); GST_TYPE_INT_RANGE, 240, 260, NULL);
fail_unless (s2 != NULL); fail_unless (s2 != NULL);
f2 = gst_caps_features_new ("memory:VASurface", "meta:VAMeta", NULL); f2 = gst_caps_features_new_static_str ("memory:VASurface", "meta:VAMeta",
NULL);
fail_unless (f2 != NULL); fail_unless (f2 != NULL);
gst_caps_append_structure_full (c2, s2, f2); gst_caps_append_structure_full (c2, s2, f2);
@ -1367,7 +1368,7 @@ GST_START_TEST (test_features)
c1 = gst_caps_from_string ("video/x-raw"); c1 = gst_caps_from_string ("video/x-raw");
f1 = gst_caps_get_features (c1, 0); f1 = gst_caps_get_features (c1, 0);
f2 = gst_caps_features_new ("memory:dmabuf", NULL); f2 = gst_caps_features_new_static_str ("memory:dmabuf", NULL);
gst_caps_set_features (c1, 0, f2); gst_caps_set_features (c1, 0, f2);
gst_caps_unref (c1); gst_caps_unref (c1);
@ -1377,7 +1378,7 @@ GST_START_TEST (test_features)
("video/x-raw, format=NV12; video/x-raw, format=NV16"); ("video/x-raw, format=NV12; video/x-raw, format=NV16");
fail_unless_equals_int (gst_caps_get_size (c1), 2); fail_unless_equals_int (gst_caps_get_size (c1), 2);
f1 = gst_caps_features_new ("memory:EGLImage", NULL); f1 = gst_caps_features_new_static_str ("memory:EGLImage", NULL);
gst_caps_set_features_simple (c1, f1); gst_caps_set_features_simple (c1, f1);
f2 = gst_caps_get_features (c1, 0); f2 = gst_caps_get_features (c1, 0);
@ -1390,7 +1391,7 @@ GST_START_TEST (test_features)
c1 = gst_caps_new_any (); c1 = gst_caps_new_any ();
fail_unless_equals_int (gst_caps_get_size (c1), 0); fail_unless_equals_int (gst_caps_get_size (c1), 0);
f1 = gst_caps_features_new ("memory:EGLImage", NULL); f1 = gst_caps_features_new_static_str ("memory:EGLImage", NULL);
/* Nothing to set the features on, but method should still take /* Nothing to set the features on, but method should still take
* ownership of the given features */ * ownership of the given features */
gst_caps_set_features_simple (c1, f1); gst_caps_set_features_simple (c1, f1);

View file

@ -30,7 +30,7 @@ GST_START_TEST (test_basic_operations)
{ {
GstCapsFeatures *a, *b; GstCapsFeatures *a, *b;
a = gst_caps_features_new ("m:abc", "m:def", "m:ghi", NULL); a = gst_caps_features_new_static_str ("m:abc", "m:def", "m:ghi", NULL);
fail_unless (a != NULL); fail_unless (a != NULL);
b = gst_caps_features_copy (a); b = gst_caps_features_copy (a);
fail_unless (b != NULL); fail_unless (b != NULL);

View file

@ -3812,7 +3812,7 @@ GST_END_TEST;
GST_START_TEST (test_serialize_deserialize_caps_features) GST_START_TEST (test_serialize_deserialize_caps_features)
{ {
GstCapsFeatures *test_feats[] = { GstCapsFeatures *test_feats[] = {
gst_caps_features_new ("abc:val1", "xyz:val2", NULL), gst_caps_features_new_static_str ("abc:val1", "xyz:val2", NULL),
gst_caps_features_new ("feat:val", NULL), gst_caps_features_new ("feat:val", NULL),
gst_caps_features_new_any (), gst_caps_features_new_any (),
gst_caps_features_new_empty () gst_caps_features_new_empty ()