vksink: Don't take vulkan buffer's as input
authorMatthew Waters <matthew@centricular.com>
Mon, 24 Jun 2019 05:32:25 +0000 (15:32 +1000)
committerMatthew Waters <matthew@centricular.com>
Mon, 24 Jun 2019 06:23:29 +0000 (16:23 +1000)
ext/vulkan/vksink.c
ext/vulkan/vkswapper.c

index 40aafdd23c7be3dd45f4d95d4036574e297deaa4..c7976a2e8863134732076187445e409895a75612 100644 (file)
@@ -70,14 +70,11 @@ static void gst_vulkan_sink_video_overlay_init (GstVideoOverlayInterface *
 
 
 static GstStaticPadTemplate gst_vulkan_sink_template =
-    GST_STATIC_PAD_TEMPLATE ("sink",
+GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
         (GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE,
-            GST_VULKAN_SWAPPER_VIDEO_FORMATS) ";"
-        GST_VIDEO_CAPS_MAKE_WITH_FEATURES
-        (GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER,
             GST_VULKAN_SWAPPER_VIDEO_FORMATS)));
 
 enum
index ef07e5859d00439e81750ec2381c031d2536d23d..272abe005408a06e1748f6ab2f4061baa952dcef 100644 (file)
@@ -515,9 +515,6 @@ gst_vulkan_swapper_get_supported_caps (GstVulkanSwapper * swapper,
         G_MAXINT, 1, NULL);
   }
 
-  gst_caps_append_structure_full (caps, gst_structure_copy (s),
-      gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER));
-
   GST_INFO_OBJECT (swapper, "Probed the following caps %" GST_PTR_FORMAT, caps);
 
   return caps;
@@ -816,49 +813,7 @@ _build_render_buffer_cmd (GstVulkanSwapper * swapper, guint32 swap_idx,
       dst.w, dst.h);
 
   in_mem = gst_buffer_peek_memory (buffer, 0);
-  if (gst_is_vulkan_buffer_memory (in_mem)) {
-    GstVulkanBufferMemory *buf_mem = (GstVulkanBufferMemory *) in_mem;
-    /* *INDENT-OFF* */
-    VkBufferImageCopy region = {
-        .bufferOffset = 0,
-        .bufferRowLength = src.w,
-        .bufferImageHeight = src.h,
-        .imageSubresource = {
-            .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
-            .mipLevel = 0,
-            .baseArrayLayer = 0,
-            .layerCount = 1,
-        },
-        .imageOffset = { .x = rslt.x, .y = rslt.y, .z = 0, },
-        .imageExtent = {
-            .width = rslt.w,
-            .height = rslt.h,
-            .depth = 1,
-        }
-    };
-    VkBufferMemoryBarrier buffer_memory_barrier = {
-        .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
-        .pNext = NULL,
-        .srcAccessMask = buf_mem->barrier.parent.access_flags,
-        .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT,
-        /* FIXME: implement exclusive transfers */
-        .srcQueueFamilyIndex = 0,
-        .dstQueueFamilyIndex = 0,
-        .buffer = buf_mem->buffer,
-        .offset = region.bufferOffset,
-        .size = region.bufferRowLength * region.bufferImageHeight
-    };
-    /* *INDENT-ON* */
-    vkCmdPipelineBarrier (cmd, buf_mem->barrier.parent.pipeline_stages,
-        VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 1, &buffer_memory_barrier,
-        0, NULL);
-
-    buf_mem->barrier.parent.pipeline_stages = VK_PIPELINE_STAGE_TRANSFER_BIT;
-    buf_mem->barrier.parent.access_flags = buffer_memory_barrier.dstAccessMask;
-
-    vkCmdCopyBufferToImage (cmd, buf_mem->buffer, swap_img->image,
-        swap_img->barrier.image_layout, 1, &region);
-  } else if (gst_is_vulkan_image_memory (in_mem)) {
+  {
     GstVulkanImageMemory *img_mem = (GstVulkanImageMemory *) in_mem;
     /* FIXME: should really be a blit to resize to the output dimensions */
     /* *INDENT-OFF* */
@@ -1127,7 +1082,7 @@ gst_vulkan_swapper_render_buffer (GstVulkanSwapper * swapper,
         "Buffer has no memory");
     return FALSE;
   }
-  if (!gst_is_vulkan_buffer_memory (mem) && !gst_is_vulkan_image_memory (mem)) {
+  if (!gst_is_vulkan_image_memory (mem)) {
     g_set_error_literal (error, GST_VULKAN_ERROR, VK_ERROR_FORMAT_NOT_SUPPORTED,
         "Incorrect memory type");
     return FALSE;