From ffa8aff6b1e00b55e26a04c49db78c19f57531e3 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 23 Nov 2021 00:25:07 +0900 Subject: [PATCH] d3d11: Update comments Remove copy & paste mistake (this is not GstGL) and add more description. Part-of: --- .../gst-libs/gst/d3d11/gstd3d11bufferpool.cpp | 13 ++++++++----- .../gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp | 11 +++-------- 2 files changed, 11 insertions(+), 13 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 64336a1..14cc8b1 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp @@ -370,9 +370,11 @@ gst_d3d11_buffer_pool_alloc_buffer (GstBufferPool * pool, GstBuffer ** buffer, GstFlowReturn ret = GST_FLOW_OK; buf = gst_buffer_new (); - /* For texture-array case, we release memory in reset_buffer() so that it can - * be returned to allocator. So our acquire_buffer() method is expecting - * empty buffer in that case. Don't fill memory here for non-texture-array */ + /* In case of texture-array, we are releasing memory objects in + * the GstBufferPool::reset_buffer() so that GstD3D11Memory objects can be + * returned to the GstD3D11PoolAllocator. So, underlying GstD3D11Memory + * will be filled in the later GstBufferPool::acquire_buffer() call. + * Don't fill memory here for non-texture-array therefore */ if (!priv->texture_array_pool) { ret = gst_d3d11_buffer_pool_fill_buffer (self, buf); if (ret != GST_FLOW_OK) { @@ -421,8 +423,9 @@ gst_d3d11_buffer_pool_reset_buffer (GstBufferPool * pool, GstBuffer * buffer) GstD3D11BufferPool *self = GST_D3D11_BUFFER_POOL (pool); GstD3D11BufferPoolPrivate *priv = self->priv; - /* if we are using texture array, return memory to allocator, so that - * memory pool allocator can wake up if it's waiting for available memory */ + /* If we are using texture array, we should return GstD3D11Memory to + * to the GstD3D11PoolAllocator, so that the allocator can wake up + * if it's waiting for available memory object */ if (priv->texture_array_pool) { GST_LOG_OBJECT (self, "Returning memory to allocator"); gst_buffer_remove_all_memory (buffer); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp index ecc21ae..033e052 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp @@ -327,8 +327,9 @@ run_d3d11_context_query (GstElement * element, GstD3D11Device ** device) } } - /* 2) although we found d3d11 device context above, the element does not want - * to use the context. Then try to find from the other direction */ + /* 2) although we found d3d11 device context above, the context might not be + * expected/wanted one by the element (e.g., belongs to the other GPU). + * Then try to find it from the other direction */ if (*device == NULL && run_query (element, query, GST_PAD_SINK)) { gst_query_parse_context (query, &ctxt); if (ctxt) { @@ -354,12 +355,6 @@ run_d3d11_context_query (GstElement * element, GstD3D11Device ** device) gst_element_post_message (element, msg); } - /* - * Whomever responds to the need-context message performs a - * GstElement::set_context() with the required context in which the element - * is required to update the display_ptr or call gst_gl_handle_set_context(). - */ - gst_query_unref (query); } -- 2.7.4