From d4c75f32ddde2d9a3297ee88dacc28dba7c58527 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 24 Aug 2019 17:14:09 +0900 Subject: [PATCH] d3d11: Add method for querying d3d11 memory type ... and fix misreading "private" annotation. --- sys/d3d11/gstd3d11memory.c | 7 +++++++ sys/d3d11/gstd3d11memory.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/d3d11/gstd3d11memory.c b/sys/d3d11/gstd3d11memory.c index 0350d0f5e0..99a47227f7 100644 --- a/sys/d3d11/gstd3d11memory.c +++ b/sys/d3d11/gstd3d11memory.c @@ -403,3 +403,10 @@ error: gst_d3d11_device_release_texture (device, staging); return NULL; } + +gboolean +gst_is_d3d11_memory (GstMemory * mem) +{ + return mem != NULL && mem->allocator != NULL && + GST_IS_D3D11_ALLOCATOR (mem->allocator); +} diff --git a/sys/d3d11/gstd3d11memory.h b/sys/d3d11/gstd3d11memory.h index 406dd1ec44..4ebe8e449d 100644 --- a/sys/d3d11/gstd3d11memory.h +++ b/sys/d3d11/gstd3d11memory.h @@ -87,9 +87,9 @@ struct _GstD3D11Allocator { GstAllocator parent; - /*< private >*/ GstD3D11Device *device; + /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; @@ -118,6 +118,9 @@ GstD3D11Allocator * gst_d3d11_allocator_new (GstD3D11Device *device); GstMemory * gst_d3d11_allocator_alloc (GstD3D11Allocator * allocator, GstD3D11AllocationParams * params); +gboolean gst_is_d3d11_memory (GstMemory * mem); + + G_END_DECLS #endif /* __GST_D3D11_MEMORY_H__ */