mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
video: convertframe: Add support for d3d12 conversion
Use d3d12convert in case of d3d12 memory Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7095>
This commit is contained in:
parent
76fd732d42
commit
fca7e5aa23
1 changed files with 20 additions and 6 deletions
|
@ -138,7 +138,7 @@ fail:
|
|||
static GstElement *
|
||||
build_convert_frame_pipeline_d3d11 (GstElement ** src_element,
|
||||
GstElement ** sink_element, GstCaps * from_caps, GstCaps * to_caps,
|
||||
GError ** err)
|
||||
gboolean is_d3d12, GError ** err)
|
||||
{
|
||||
GstElement *pipeline = NULL;
|
||||
GstElement *appsrc = NULL;
|
||||
|
@ -148,10 +148,17 @@ build_convert_frame_pipeline_d3d11 (GstElement ** src_element,
|
|||
GstElement *enc = NULL;
|
||||
GstElement *appsink = NULL;
|
||||
GError *error = NULL;
|
||||
const gchar *d3d_conv_name = "d3d11convert";
|
||||
const gchar *d3d_download_name = "d3d11download";
|
||||
|
||||
if (is_d3d12) {
|
||||
d3d_conv_name = "d3d12convert";
|
||||
d3d_download_name = "d3d12download";
|
||||
}
|
||||
|
||||
if (!create_element ("appsrc", &appsrc, &error) ||
|
||||
!create_element ("d3d11convert", &d3d11_convert, &error) ||
|
||||
!create_element ("d3d11download", &d3d11_download, &error) ||
|
||||
!create_element (d3d_conv_name, &d3d11_convert, &error) ||
|
||||
!create_element (d3d_download_name, &d3d11_download, &error) ||
|
||||
!create_element ("videoconvert", &convert, &error) ||
|
||||
!create_element ("appsink", &appsink, &error)) {
|
||||
GST_ERROR ("Could not create element");
|
||||
|
@ -224,9 +231,16 @@ build_convert_frame_pipeline (GstElement ** src_element,
|
|||
GstCapsFeatures *features;
|
||||
|
||||
features = gst_caps_get_features (from_caps, 0);
|
||||
if (features && gst_caps_features_contains (features, "memory:D3D11Memory")) {
|
||||
return build_convert_frame_pipeline_d3d11 (src_element, sink_element,
|
||||
from_caps, to_caps, err);
|
||||
if (features && !gst_caps_features_is_any (features)) {
|
||||
gboolean is_d3d11 =
|
||||
gst_caps_features_contains (features, "memory:D3D11Memory");
|
||||
gboolean is_d3d12 =
|
||||
gst_caps_features_contains (features, "memory:D3D12Memory");
|
||||
|
||||
if (is_d3d11 || is_d3d12) {
|
||||
return build_convert_frame_pipeline_d3d11 (src_element, sink_element,
|
||||
from_caps, to_caps, is_d3d12, err);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_GL
|
||||
if (features &&
|
||||
|
|
Loading…
Reference in a new issue