mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
qsv: Add GPU description to element long-name on Windows
Would be useful for a multi-Intel-GPU system Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2249>
This commit is contained in:
parent
8f2d347559
commit
6a3776c527
7 changed files with 92 additions and 36 deletions
|
@ -43,6 +43,7 @@ typedef struct _GstQsvDecoderClassData
|
||||||
guint impl_index;
|
guint impl_index;
|
||||||
gint64 adapter_luid;
|
gint64 adapter_luid;
|
||||||
gchar *display_path;
|
gchar *display_path;
|
||||||
|
gchar *description;
|
||||||
|
|
||||||
GstCaps *sink_caps;
|
GstCaps *sink_caps;
|
||||||
GstCaps *src_caps;
|
GstCaps *src_caps;
|
||||||
|
|
|
@ -74,11 +74,21 @@ gst_qsv_h264_dec_class_init (GstQsvH264DecClass * klass, gpointer data)
|
||||||
|
|
||||||
parent_class = (GTypeClass *) g_type_class_peek_parent (klass);
|
parent_class = (GTypeClass *) g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
std::string long_name = "Intel Quick Sync Video " +
|
||||||
|
std::string (cdata->description) + " H.264 Decoder";
|
||||||
|
|
||||||
|
gst_element_class_set_metadata (element_class, long_name.c_str (),
|
||||||
|
"Codec/Decoder/Video/Hardware",
|
||||||
|
"Intel Quick Sync Video H.264 Decoder",
|
||||||
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#else
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel Quick Sync Video H.264 Decoder",
|
"Intel Quick Sync Video H.264 Decoder",
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"Intel Quick Sync Video H.264 Decoder",
|
"Intel Quick Sync Video H.264 Decoder",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||||
|
@ -101,6 +111,7 @@ gst_qsv_h264_dec_class_init (GstQsvH264DecClass * klass, gpointer data)
|
||||||
|
|
||||||
gst_caps_unref (cdata->sink_caps);
|
gst_caps_unref (cdata->sink_caps);
|
||||||
gst_caps_unref (cdata->src_caps);
|
gst_caps_unref (cdata->src_caps);
|
||||||
|
g_free (cdata->description);
|
||||||
g_free (cdata);
|
g_free (cdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,13 +535,10 @@ gst_qsv_h264_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
|
||||||
cdata->impl_index = impl_index;
|
cdata->impl_index = impl_index;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gint64 device_luid;
|
g_object_get (device, "adapter-luid", &cdata->adapter_luid,
|
||||||
g_object_get (device, "adapter-luid", &device_luid, nullptr);
|
"description", &cdata->description, nullptr);
|
||||||
cdata->adapter_luid = device_luid;
|
|
||||||
#else
|
#else
|
||||||
gchar *display_path;
|
g_object_get (device, "path", &cdata->display_path, nullptr);
|
||||||
g_object_get (device, "path", &display_path, nullptr);
|
|
||||||
cdata->display_path = display_path;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GType type;
|
GType type;
|
||||||
|
|
|
@ -178,6 +178,7 @@ typedef struct _GstQsvH264EncClassData
|
||||||
guint impl_index;
|
guint impl_index;
|
||||||
gint64 adapter_luid;
|
gint64 adapter_luid;
|
||||||
gchar *display_path;
|
gchar *display_path;
|
||||||
|
gchar *description;
|
||||||
} GstQsvH264EncClassData;
|
} GstQsvH264EncClassData;
|
||||||
|
|
||||||
typedef struct _GstQsvH264Enc
|
typedef struct _GstQsvH264Enc
|
||||||
|
@ -429,11 +430,22 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data)
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
std::string long_name = "Intel Quick Sync Video " +
|
||||||
|
std::string (cdata->description) + " H.264 Encoder";
|
||||||
|
|
||||||
|
gst_element_class_set_metadata (element_class, long_name.c_str (),
|
||||||
|
"Codec/Encoder/Video/Hardware",
|
||||||
|
"Intel Quick Sync Video H.264 Encoder",
|
||||||
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#else
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel Quick Sync Video H.264 Encoder",
|
"Intel Quick Sync Video H.264 Encoder",
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Intel Quick Sync Video H.264 Encoder",
|
"Intel Quick Sync Video H.264 Encoder",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||||
|
@ -459,6 +471,7 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data)
|
||||||
|
|
||||||
gst_caps_unref (cdata->sink_caps);
|
gst_caps_unref (cdata->sink_caps);
|
||||||
gst_caps_unref (cdata->src_caps);
|
gst_caps_unref (cdata->src_caps);
|
||||||
|
g_free (cdata->description);
|
||||||
g_free (cdata);
|
g_free (cdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1878,13 +1891,10 @@ gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
||||||
cdata->impl_index = impl_index;
|
cdata->impl_index = impl_index;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gint64 device_luid;
|
g_object_get (device, "adapter-luid", &cdata->adapter_luid,
|
||||||
g_object_get (device, "adapter-luid", &device_luid, nullptr);
|
"description", &cdata->description, nullptr);
|
||||||
cdata->adapter_luid = device_luid;
|
|
||||||
#else
|
#else
|
||||||
gchar *display_path;
|
g_object_get (device, "path", &cdata->display_path, nullptr);
|
||||||
g_object_get (device, "path", &display_path, nullptr);
|
|
||||||
cdata->display_path = display_path;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GType type;
|
GType type;
|
||||||
|
|
|
@ -76,11 +76,21 @@ gst_qsv_h265_dec_class_init (GstQsvH265DecClass * klass, gpointer data)
|
||||||
|
|
||||||
parent_class = (GTypeClass *) g_type_class_peek_parent (klass);
|
parent_class = (GTypeClass *) g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
std::string long_name = "Intel Quick Sync Video " +
|
||||||
|
std::string (cdata->description) + " H.265 Decoder";
|
||||||
|
|
||||||
|
gst_element_class_set_metadata (element_class, long_name.c_str (),
|
||||||
|
"Codec/Decoder/Video/Hardware",
|
||||||
|
"Intel Quick Sync Video H.265 Decoder",
|
||||||
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#else
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel Quick Sync Video H.265 Decoder",
|
"Intel Quick Sync Video H.265 Decoder",
|
||||||
"Codec/Decoder/Video/Hardware",
|
"Codec/Decoder/Video/Hardware",
|
||||||
"Intel Quick Sync Video H.265 Decoder",
|
"Intel Quick Sync Video H.265 Decoder",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||||
|
@ -588,13 +598,10 @@ gst_qsv_h265_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
|
||||||
cdata->impl_index = impl_index;
|
cdata->impl_index = impl_index;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gint64 device_luid;
|
g_object_get (device, "adapter-luid", &cdata->adapter_luid,
|
||||||
g_object_get (device, "adapter-luid", &device_luid, nullptr);
|
"description", &cdata->description, nullptr);
|
||||||
cdata->adapter_luid = device_luid;
|
|
||||||
#else
|
#else
|
||||||
gchar *display_path;
|
g_object_get (device, "path", &cdata->display_path, nullptr);
|
||||||
g_object_get (device, "path", &display_path, nullptr);
|
|
||||||
cdata->display_path = display_path;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GType type;
|
GType type;
|
||||||
|
|
|
@ -138,6 +138,7 @@ typedef struct _GstQsvH265EncClassData
|
||||||
guint impl_index;
|
guint impl_index;
|
||||||
gint64 adapter_luid;
|
gint64 adapter_luid;
|
||||||
gchar *display_path;
|
gchar *display_path;
|
||||||
|
gchar *description;
|
||||||
gboolean hdr10_aware;
|
gboolean hdr10_aware;
|
||||||
} GstQsvH265EncClassData;
|
} GstQsvH265EncClassData;
|
||||||
|
|
||||||
|
@ -361,11 +362,22 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data)
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
std::string long_name = "Intel Quick Sync Video " +
|
||||||
|
std::string (cdata->description) + " H.265 Encoder";
|
||||||
|
|
||||||
|
gst_element_class_set_metadata (element_class, long_name.c_str (),
|
||||||
|
"Codec/Encoder/Video/Hardware",
|
||||||
|
"Intel Quick Sync Video H.265 Encoder",
|
||||||
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#else
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel Quick Sync Video H.265 Encoder",
|
"Intel Quick Sync Video H.265 Encoder",
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Intel Quick Sync Video H.265 Encoder",
|
"Intel Quick Sync Video H.265 Encoder",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||||
|
@ -393,6 +405,7 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data)
|
||||||
|
|
||||||
gst_caps_unref (cdata->sink_caps);
|
gst_caps_unref (cdata->sink_caps);
|
||||||
gst_caps_unref (cdata->src_caps);
|
gst_caps_unref (cdata->src_caps);
|
||||||
|
g_free (cdata->description);
|
||||||
g_free (cdata);
|
g_free (cdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1551,13 +1564,10 @@ gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
||||||
cdata->hdr10_aware = hdr10_aware;
|
cdata->hdr10_aware = hdr10_aware;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gint64 device_luid;
|
g_object_get (device, "adapter-luid", &cdata->adapter_luid,
|
||||||
g_object_get (device, "adapter-luid", &device_luid, nullptr);
|
"description", &cdata->description, nullptr);
|
||||||
cdata->adapter_luid = device_luid;
|
|
||||||
#else
|
#else
|
||||||
gchar *display_path;
|
g_object_get (device, "path", &cdata->display_path, nullptr);
|
||||||
g_object_get (device, "path", &display_path, nullptr);
|
|
||||||
cdata->display_path = display_path;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GType type;
|
GType type;
|
||||||
|
|
|
@ -53,6 +53,7 @@ typedef struct _GstQsvJpegEncClassData
|
||||||
guint impl_index;
|
guint impl_index;
|
||||||
gint64 adapter_luid;
|
gint64 adapter_luid;
|
||||||
gchar *display_path;
|
gchar *display_path;
|
||||||
|
gchar *description;
|
||||||
gboolean interlaved;
|
gboolean interlaved;
|
||||||
} GstQsvJpegEncClassData;
|
} GstQsvJpegEncClassData;
|
||||||
|
|
||||||
|
@ -134,11 +135,22 @@ gst_qsv_jpeg_enc_class_init (GstQsvJpegEncClass * klass, gpointer data)
|
||||||
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
std::string long_name = "Intel Quick Sync Video " +
|
||||||
|
std::string (cdata->description) + " JPEG Encoder";
|
||||||
|
|
||||||
|
gst_element_class_set_metadata (element_class, long_name.c_str (),
|
||||||
|
"Codec/Encoder/Video/Hardware",
|
||||||
|
"Intel Quick Sync Video JPEG Encoder",
|
||||||
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#else
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel Quick Sync Video JPEG Encoder",
|
"Intel Quick Sync Video JPEG Encoder",
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Intel Quick Sync Video JPEG Encoder",
|
"Intel Quick Sync Video JPEG Encoder",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||||
|
@ -157,6 +169,7 @@ gst_qsv_jpeg_enc_class_init (GstQsvJpegEncClass * klass, gpointer data)
|
||||||
|
|
||||||
gst_caps_unref (cdata->sink_caps);
|
gst_caps_unref (cdata->sink_caps);
|
||||||
gst_caps_unref (cdata->src_caps);
|
gst_caps_unref (cdata->src_caps);
|
||||||
|
g_free (cdata->description);
|
||||||
g_free (cdata);
|
g_free (cdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,13 +497,10 @@ gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
||||||
cdata->interlaved = interlaved;
|
cdata->interlaved = interlaved;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gint64 device_luid;
|
g_object_get (device, "adapter-luid", &cdata->adapter_luid,
|
||||||
g_object_get (device, "adapter-luid", &device_luid, nullptr);
|
"description", &cdata->description, nullptr);
|
||||||
cdata->adapter_luid = device_luid;
|
|
||||||
#else
|
#else
|
||||||
gchar *display_path;
|
g_object_get (device, "path", &cdata->display_path, nullptr);
|
||||||
g_object_get (device, "path", &display_path, nullptr);
|
|
||||||
cdata->display_path = display_path;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GType type;
|
GType type;
|
||||||
|
|
|
@ -88,6 +88,7 @@ typedef struct _GstQsvVP9EncClassData
|
||||||
guint impl_index;
|
guint impl_index;
|
||||||
gint64 adapter_luid;
|
gint64 adapter_luid;
|
||||||
gchar *display_path;
|
gchar *display_path;
|
||||||
|
gchar *description;
|
||||||
} GstQsvVP9EncClassData;
|
} GstQsvVP9EncClassData;
|
||||||
|
|
||||||
typedef struct _GstQsvVP9Enc
|
typedef struct _GstQsvVP9Enc
|
||||||
|
@ -220,11 +221,22 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data)
|
||||||
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
|
||||||
|
|
||||||
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
parent_class = (GstElementClass *) g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
std::string long_name = "Intel Quick Sync Video " +
|
||||||
|
std::string (cdata->description) + " VP9 Encoder";
|
||||||
|
|
||||||
|
gst_element_class_set_metadata (element_class, long_name.c_str (),
|
||||||
|
"Codec/Encoder/Video/Hardware",
|
||||||
|
"Intel Quick Sync Video VP9 Encoder",
|
||||||
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#else
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel Quick Sync Video VP9 Encoder",
|
"Intel Quick Sync Video VP9 Encoder",
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
"Intel Quick Sync Video VP9 Encoder",
|
"Intel Quick Sync Video VP9 Encoder",
|
||||||
"Seungha Yang <seungha@centricular.com>");
|
"Seungha Yang <seungha@centricular.com>");
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||||
|
@ -243,6 +255,7 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data)
|
||||||
|
|
||||||
gst_caps_unref (cdata->sink_caps);
|
gst_caps_unref (cdata->sink_caps);
|
||||||
gst_caps_unref (cdata->src_caps);
|
gst_caps_unref (cdata->src_caps);
|
||||||
|
g_free (cdata->description);
|
||||||
g_free (cdata);
|
g_free (cdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -993,13 +1006,10 @@ gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
|
||||||
cdata->impl_index = impl_index;
|
cdata->impl_index = impl_index;
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gint64 device_luid;
|
g_object_get (device, "adapter-luid", &cdata->adapter_luid,
|
||||||
g_object_get (device, "adapter-luid", &device_luid, nullptr);
|
"description", &cdata->description, nullptr);
|
||||||
cdata->adapter_luid = device_luid;
|
|
||||||
#else
|
#else
|
||||||
gchar *display_path;
|
g_object_get (device, "path", &cdata->display_path, nullptr);
|
||||||
g_object_get (device, "path", &display_path, nullptr);
|
|
||||||
cdata->display_path = display_path;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GType type;
|
GType type;
|
||||||
|
|
Loading…
Reference in a new issue