From aca71fd692df783a3de62d61880022f14dcff604 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 24 Jun 2022 01:21:48 +0900 Subject: [PATCH] d3d11: Update gst_d3d11_allocation_params_new() interface Define GST_D3D11_ALLOCATION_FLAG_DEFAULT (0) value instead of casting enum type everywhere. And pass D3D11_RESOURCE_MISC_FLAG value Part-of: --- .../gst-libs/gst/d3d11/gstd3d11bufferpool.cpp | 2 +- .../gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp | 7 +++++-- .../gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.h | 5 ++++- subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp | 2 +- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp | 12 +++++++----- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11convert.cpp | 4 ++-- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp | 6 +++--- .../gst-plugins-bad/sys/d3d11/gstd3d11deinterlace.cpp | 8 ++++---- .../gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp | 6 +++--- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11testsrc.cpp | 10 +++++----- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11upload.cpp | 2 +- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11videosink.cpp | 5 +++-- subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp | 3 +-- .../gst-plugins-bad/sys/qsv/gstqsvallocator_d3d11.cpp | 2 +- subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp | 9 +++++---- subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp | 4 ++-- 16 files changed, 48 insertions(+), 39 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp index eb21608..628f6c1 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp @@ -177,7 +177,7 @@ gst_d3d11_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) /* allocate memory with resource format by default */ priv->d3d11_params = gst_d3d11_allocation_params_new (self->device, - &info, (GstD3D11AllocationFlags) 0, 0); + &info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, 0); } desc = priv->d3d11_params->desc; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp index 8a5c5bf..a47ae7b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp @@ -46,7 +46,8 @@ G_DEFINE_BOXED_TYPE_WITH_CODE (GstD3D11AllocationParams, * @device: a #GstD3D11Device * @info: a #GstVideoInfo * @flags: a #GstD3D11AllocationFlags - * @bind_flags: D3D11_BIND_FLAG value used for creating Direct3D11 texture + * @bind_flags: D3D11_BIND_FLAG value used for creating texture + * @misc_flags: D3D11_RESOURCE_MISC_FLAG value used for creating texture * * Create #GstD3D11AllocationParams object which is used by #GstD3D11BufferPool * and #GstD3D11Allocator in order to allocate new ID3D11Texture2D @@ -58,7 +59,7 @@ G_DEFINE_BOXED_TYPE_WITH_CODE (GstD3D11AllocationParams, */ GstD3D11AllocationParams * gst_d3d11_allocation_params_new (GstD3D11Device * device, GstVideoInfo * info, - GstD3D11AllocationFlags flags, guint bind_flags) + GstD3D11AllocationFlags flags, guint bind_flags, guint misc_flags) { GstD3D11AllocationParams *ret; GstD3D11Format d3d11_format; @@ -105,6 +106,7 @@ gst_d3d11_allocation_params_new (GstD3D11Device * device, GstVideoInfo * info, ret->desc[i].SampleDesc.Quality = 0; ret->desc[i].Usage = D3D11_USAGE_DEFAULT; ret->desc[i].BindFlags = bind_flags; + ret->desc[i].MiscFlags = misc_flags; } } else { ret->desc[0].Width = GST_VIDEO_INFO_WIDTH (info); @@ -116,6 +118,7 @@ gst_d3d11_allocation_params_new (GstD3D11Device * device, GstVideoInfo * info, ret->desc[0].SampleDesc.Quality = 0; ret->desc[0].Usage = D3D11_USAGE_DEFAULT; ret->desc[0].BindFlags = bind_flags; + ret->desc[0].MiscFlags = misc_flags; } ret->flags = flags; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.h b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.h index 3b4a300..c026c16 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.h @@ -78,6 +78,7 @@ G_BEGIN_DECLS /** * GstD3D11AllocationFlags: + * @GST_D3D11_ALLOCATION_FLAG_DEFAULT: Default allocation behavior * @GST_D3D11_ALLOCATION_FLAG_TEXTURE_ARRAY: Indicates each allocated texture * should be array type. This type of * is used for D3D11/DXVA decoders @@ -87,6 +88,7 @@ G_BEGIN_DECLS */ typedef enum { + GST_D3D11_ALLOCATION_FLAG_DEFAULT = 0, GST_D3D11_ALLOCATION_FLAG_TEXTURE_ARRAY = (1 << 0), } GstD3D11AllocationFlags; @@ -142,7 +144,8 @@ GST_D3D11_API GstD3D11AllocationParams * gst_d3d11_allocation_params_new (GstD3D11Device * device, GstVideoInfo * info, GstD3D11AllocationFlags flags, - guint bind_flags); + guint bind_flags, + guint misc_flags); GST_D3D11_API GstD3D11AllocationParams * gst_d3d11_allocation_params_copy (GstD3D11AllocationParams * src); diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp index 9ce5b4b..0fdd78c 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp @@ -464,7 +464,7 @@ gst_amf_encoder_prepare_internal_pool (GstAmfEncoder * self) GST_VIDEO_INFO_SIZE (info), 0, 0); params = gst_d3d11_allocation_params_new (priv->device, info, - (GstD3D11AllocationFlags) 0, 0); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, 0); params->desc[0].MiscFlags = D3D11_RESOURCE_MISC_SHARED; gst_buffer_pool_config_set_d3d11_allocation_params (config, params); diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp index 5ef48d0..3a3abf4 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp @@ -726,7 +726,7 @@ gst_d3d11_compositor_pad_ensure_fallback_buffer (GstD3D11Compositor * self, } d3d11_params = gst_d3d11_allocation_params_new (self->device, - info, (GstD3D11AllocationFlags) 0, D3D11_BIND_SHADER_RESOURCE); + info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0); pool = gst_d3d11_buffer_pool_new_with_options (self->device, caps, d3d11_params, 0, 0); @@ -1743,8 +1743,8 @@ gst_d3d11_compositor_negotiated_src_caps (GstAggregator * agg, GstCaps * caps) GstFlowReturn flow_ret; d3d11_params = gst_d3d11_allocation_params_new (self->device, - &info, (GstD3D11AllocationFlags) 0, - D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET); + &info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, + D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, 0); pool = gst_d3d11_buffer_pool_new_with_options (self->device, caps, d3d11_params, 0, 0); @@ -1825,7 +1825,8 @@ gst_d3d11_compositor_propose_allocation (GstAggregator * agg, d3d11_params = gst_d3d11_allocation_params_new (self->device, - &info, (GstD3D11AllocationFlags) 0, D3D11_BIND_SHADER_RESOURCE); + &info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_SHADER_RESOURCE, + 0); gst_buffer_pool_config_set_d3d11_allocation_params (config, d3d11_params); gst_d3d11_allocation_params_free (d3d11_params); @@ -1925,7 +1926,8 @@ gst_d3d11_compositor_decide_allocation (GstAggregator * agg, GstQuery * query) d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (self->device, - &info, (GstD3D11AllocationFlags) 0, D3D11_BIND_RENDER_TARGET); + &info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_RENDER_TARGET, + 0); } else { guint i; diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11convert.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11convert.cpp index d65699c..40eb9d7 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11convert.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11convert.cpp @@ -1236,7 +1236,7 @@ gst_d3d11_base_convert_propose_allocation (GstBaseTransform * trans, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (filter->device, &info, - (GstD3D11AllocationFlags) 0, bind_flags); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, bind_flags, 0); } else { /* Set bind flag */ for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&info); i++) { @@ -1354,7 +1354,7 @@ gst_d3d11_base_convert_decide_allocation (GstBaseTransform * trans, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (filter->device, &info, - (GstD3D11AllocationFlags) 0, bind_flags); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, bind_flags, 0); } else { /* Set bind flag */ for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&info); i++) { diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp index d5e4c25..7f332d6 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp @@ -444,7 +444,7 @@ gst_d3d11_decoder_prepare_output_view_pool (GstD3D11Decoder * self) GstBufferPool *pool = NULL; GstCaps *caps = NULL; GstVideoAlignment align; - GstD3D11AllocationFlags alloc_flags = (GstD3D11AllocationFlags) 0; + GstD3D11AllocationFlags alloc_flags = GST_D3D11_ALLOCATION_FLAG_DEFAULT; gint bind_flags = D3D11_BIND_DECODER; GstVideoInfo *info = &self->info; guint pool_size; @@ -464,7 +464,7 @@ gst_d3d11_decoder_prepare_output_view_pool (GstD3D11Decoder * self) } alloc_params = gst_d3d11_allocation_params_new (self->device, info, - alloc_flags, bind_flags); + alloc_flags, bind_flags, 0); if (!alloc_params) { GST_ERROR_OBJECT (self, "Failed to create allocation param"); @@ -1792,7 +1792,7 @@ gst_d3d11_decoder_decide_allocation (GstD3D11Decoder * decoder, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) d3d11_params = gst_d3d11_allocation_params_new (decoder->device, &vinfo, - (GstD3D11AllocationFlags) 0, 0); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, 0); width = GST_VIDEO_INFO_WIDTH (&vinfo); height = GST_VIDEO_INFO_HEIGHT (&vinfo); diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11deinterlace.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11deinterlace.cpp index 8dbecf1..2ff2b29 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11deinterlace.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11deinterlace.cpp @@ -891,7 +891,7 @@ gst_d3d11_deinterlace_propose_allocation (GstBaseTransform * trans, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (self->device, &info, - (GstD3D11AllocationFlags) 0, D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_RENDER_TARGET, 0); } else { d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; } @@ -996,7 +996,7 @@ gst_d3d11_deinterlace_decide_allocation (GstBaseTransform * trans, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (self->device, &info, - (GstD3D11AllocationFlags) 0, D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_RENDER_TARGET, 0); } else { d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; } @@ -1052,7 +1052,7 @@ gst_d3d11_deinterlace_prepare_fallback_pool (GstD3D11Deinterlace * self, /* Empty bind flag is allowed for video processor input */ d3d11_params = gst_d3d11_allocation_params_new (self->device, in_info, - (GstD3D11AllocationFlags) 0, 0); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, 0); self->fallback_in_pool = gst_d3d11_buffer_pool_new_with_options (self->device, in_caps, d3d11_params, 0, 0); gst_d3d11_allocation_params_free (d3d11_params); @@ -1064,7 +1064,7 @@ gst_d3d11_deinterlace_prepare_fallback_pool (GstD3D11Deinterlace * self, /* For processor output, render target bind flag is required */ d3d11_params = gst_d3d11_allocation_params_new (self->device, out_info, - (GstD3D11AllocationFlags) 0, D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_RENDER_TARGET, 0); self->fallback_out_pool = gst_d3d11_buffer_pool_new_with_options (self->device, out_caps, d3d11_params, 0, 0); diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp index 4b4477c..ae5d854 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp @@ -527,8 +527,8 @@ gst_d3d11_screen_capture_src_decide_allocation (GstBaseSrc * bsrc, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (self->device, &vinfo, - (GstD3D11AllocationFlags) 0, - D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, + D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, 0); } else { d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; } @@ -560,7 +560,7 @@ gst_d3d11_screen_capture_src_decide_allocation (GstBaseSrc * bsrc, d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (self->device, &vinfo, - (GstD3D11AllocationFlags) 0, D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_RENDER_TARGET, 0); } else { d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; } diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11testsrc.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11testsrc.cpp index 9354382..1b0cd0e 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11testsrc.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11testsrc.cpp @@ -1306,8 +1306,8 @@ gst_d3d11_test_src_setup_resource (GstD3D11TestSrc * self, GstCaps * caps) draw_caps = gst_video_info_to_caps (&draw_info); params = gst_d3d11_allocation_params_new (self->device, &draw_info, - (GstD3D11AllocationFlags) 0, - D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, + D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, 0); self->render_pool = gst_d3d11_buffer_pool_new_with_options (self->device, draw_caps, params, 0, 0); @@ -1321,7 +1321,7 @@ gst_d3d11_test_src_setup_resource (GstD3D11TestSrc * self, GstCaps * caps) } params = gst_d3d11_allocation_params_new (self->device, &self->info, - (GstD3D11AllocationFlags) 0, D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_RENDER_TARGET, 0); self->convert_pool = gst_d3d11_buffer_pool_new_with_options (self->device, caps, params, 0, 0); gst_d3d11_allocation_params_free (params); @@ -1479,8 +1479,8 @@ gst_d3d11_test_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query) d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (self->device, &vinfo, - (GstD3D11AllocationFlags) 0, - D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, + D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, 0); } else { d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; } diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11upload.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11upload.cpp index 42505ca..c3fa1ea 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11upload.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11upload.cpp @@ -378,7 +378,7 @@ gst_d3d11_upload_decide_allocation (GstBaseTransform * trans, GstQuery * query) d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (filter->device, &vinfo, - (GstD3D11AllocationFlags) 0, bind_flags); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, bind_flags, 0); } else { /* Set bind flag */ for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&vinfo); i++) { diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11videosink.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11videosink.cpp index 2a8a97a..d20abcd 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11videosink.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11videosink.cpp @@ -635,7 +635,7 @@ gst_d3d11_video_sink_update_window (GstD3D11VideoSink * self, GstCaps * caps) } d3d11_params = gst_d3d11_allocation_params_new (self->device, - &self->info, (GstD3D11AllocationFlags) 0, bind_flags); + &self->info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, bind_flags, 0); self->fallback_pool = gst_d3d11_buffer_pool_new_with_options (self->device, caps, d3d11_params, 2, 0); @@ -908,7 +908,8 @@ gst_d3d11_video_sink_propose_allocation (GstBaseSink * sink, GstQuery * query) d3d11_params = gst_d3d11_allocation_params_new (self->device, - &info, (GstD3D11AllocationFlags) 0, D3D11_BIND_SHADER_RESOURCE); + &info, GST_D3D11_ALLOCATION_FLAG_DEFAULT, D3D11_BIND_SHADER_RESOURCE, + 0); gst_buffer_pool_config_set_d3d11_allocation_params (config, d3d11_params); gst_d3d11_allocation_params_free (d3d11_params); diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp index de1b1c8..99de903 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvencoder.cpp @@ -1000,8 +1000,7 @@ gst_nv_encoder_create_d3d11_pool (GstNvEncoder * self, GstD3D11AllocationParams *params; params = gst_d3d11_allocation_params_new (priv->device, &state->info, - (GstD3D11AllocationFlags) 0, 0); - params->desc[0].MiscFlags = D3D11_RESOURCE_MISC_SHARED; + GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, D3D11_RESOURCE_MISC_SHARED); pool = gst_d3d11_buffer_pool_new (priv->device); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator_d3d11.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator_d3d11.cpp index 33be0fa..e9c289e 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator_d3d11.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator_d3d11.cpp @@ -222,7 +222,7 @@ gst_qsv_d3d11_allocator_alloc (GstQsvAllocator * allocator, pool = gst_d3d11_buffer_pool_new (self->device); params = gst_d3d11_allocation_params_new (self->device, &info, - (GstD3D11AllocationFlags) 0, bind_flags); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, bind_flags, 0); gst_d3d11_allocation_params_alignment (params, &align); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp index a98f9dc..7e9630d 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.cpp @@ -880,8 +880,8 @@ gst_qsv_decoder_prepare_d3d11_pool (GstQsvDecoder * self, /* Bind to shader resource as well for this texture can be used * in generic pixel shader */ params = gst_d3d11_allocation_params_new (device, info, - (GstD3D11AllocationFlags) 0, - D3D11_BIND_DECODER | D3D11_BIND_SHADER_RESOURCE); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, + D3D11_BIND_DECODER | D3D11_BIND_SHADER_RESOURCE, 0); gst_d3d11_allocation_params_alignment (params, align); gst_buffer_pool_config_set_d3d11_allocation_params (config, params); gst_d3d11_allocation_params_free (params); @@ -1232,9 +1232,10 @@ gst_qsv_decoder_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) * copying in case of reverse playback */ if (use_d3d11_pool) { d3d11_params = gst_buffer_pool_config_get_d3d11_allocation_params (config); - if (!d3d11_params) + if (!d3d11_params) { d3d11_params = gst_d3d11_allocation_params_new (device, &vinfo, - (GstD3D11AllocationFlags) 0, 0); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, 0); + } /* Use both render target (for videoprocessor) and shader resource * for (pixel shader) bind flags for downstream to be able to use consistent * conversion path even when we copy textures */ diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp index 093b0f5..12ad492 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.cpp @@ -915,7 +915,7 @@ gst_qsv_encoder_prepare_d3d11_pool (GstQsvEncoder * self, priv->internal_pool = gst_d3d11_buffer_pool_new (device); config = gst_buffer_pool_get_config (priv->internal_pool); params = gst_d3d11_allocation_params_new (device, aligned_info, - (GstD3D11AllocationFlags) 0, bind_flags); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, bind_flags, 0); gst_buffer_pool_config_set_d3d11_allocation_params (config, params); gst_d3d11_allocation_params_free (params); @@ -1487,7 +1487,7 @@ gst_qsv_encoder_propose_allocation (GstVideoEncoder * encoder, GstQuery * query) GST_VIDEO_INFO_HEIGHT (&info); d3d11_params = gst_d3d11_allocation_params_new (device, &info, - (GstD3D11AllocationFlags) 0, 0); + GST_D3D11_ALLOCATION_FLAG_DEFAULT, 0, 0); gst_d3d11_allocation_params_alignment (d3d11_params, &align); gst_buffer_pool_config_set_d3d11_allocation_params (config, d3d11_params); -- 2.7.4