1 /* 2 * GStreamer Plugins 3 * Copyright (C) 2019 Matthew Waters <matthew@centricular.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef __GST_VULKAN_FULL_SCREEN_QUAD_H__ 22 #define __GST_VULKAN_FULL_SCREEN_QUAD_H__ 23 24 25 #include <gst/gst.h> 26 27 #include <gst/vulkan/vulkan.h> 28 29 G_BEGIN_DECLS 30 31 GST_VULKAN_API 32 GType gst_vulkan_full_screen_quad_get_type (void); 33 #define GST_TYPE_VULKAN_FULL_SCREEN_QUAD (gst_vulkan_full_screen_quad_get_type ()) 34 #define GST_VULKAN_FULL_SCREEN_QUAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_FULL_SCREEN_QUAD, GstVulkanFullScreenQuad)) 35 #define GST_VULKAN_FULL_SCREEN_QUAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VULKAN_FULL_SCREEN_QUAD, GstVulkanFullScreenQuadClass)) 36 #define GST_IS_VULKAN_FULL_SCREEN_QUAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_FULL_SCREEN_QUAD)) 37 #define GST_IS_VULKAN_FULL_SCREEN_QUAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VULKAN_FULL_SCREEN_QUAD)) 38 #define GST_VULKAN_FULL_SCREEN_QUAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_FULL_SCREEN_QUAD, GstVulkanFullScreenQuadClass)) 39 40 /** 41 * GstVulkanFullScreenQuad: 42 * @parent: the parent #GstObject 43 * @in_info: the configured input #GstVideoInfo 44 * @out_info: the configured output #GstVideoInfo 45 * @queue: the #GstVulkanQueue to submit #GstVulkanCommandBuffer's on 46 * @render_pass: the configured `VkRenderPass` 47 * @pipeline_layout: the configured `VkPipelineLayout` 48 * @graphics_pipeline: the configured `VkPipeline` 49 * @descriptor_set_layout: the configured `VkDescriptorSetLayout` 50 * @descriptor_cache: the configured #GstVulkanDescriptorCache 51 * @descriptor_set: the configured #GstVulkanDescriptorSet 52 * @framebuffer: the configured `VkFramebuffer` 53 * @sampler: the configured `VkSampler` 54 * @cmd_pool: the #GstVulkanCommandPool to allocate #GstVulkanCommandBuffer's from 55 * @trash_list: the #GstVulkanTrashList for freeing unused resources 56 * @last_fence: the last configured #GstVulkanFences 57 * 58 * Since: 1.18 59 */ 60 struct _GstVulkanFullScreenQuad 61 { 62 GstObject parent; 63 64 /* <protected> */ 65 GstVideoInfo out_info; 66 GstVideoInfo in_info; 67 68 GstVulkanQueue *queue; 69 70 GstVulkanHandle *render_pass; 71 GstVulkanHandle *pipeline_layout; 72 GstVulkanHandle *graphics_pipeline; 73 GstVulkanHandle *descriptor_set_layout; 74 GstVulkanDescriptorCache *descriptor_cache; 75 GstVulkanDescriptorSet *descriptor_set; 76 GstVulkanHandle *framebuffer; 77 GstVulkanHandle *sampler; 78 79 GstVulkanCommandPool *cmd_pool; 80 81 GstVulkanTrashList *trash_list; 82 GstVulkanFence *last_fence; 83 84 /* <private> */ 85 gpointer _reserved [GST_PADDING]; 86 }; 87 88 /** 89 * GstVulkanFullScreenQuadClass: 90 * @parent_class: the parent #GstObjectClass 91 * 92 * Since: 1.18 93 */ 94 struct _GstVulkanFullScreenQuadClass 95 { 96 GstObjectClass parent_class; 97 98 /* <private> */ 99 gpointer _reserved [GST_PADDING]; 100 }; 101 102 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstVulkanFullScreenQuad, gst_object_unref) 103 104 GST_VULKAN_API 105 GstVulkanFullScreenQuad * gst_vulkan_full_screen_quad_new (GstVulkanQueue * queue); 106 107 GST_VULKAN_API 108 gboolean gst_vulkan_full_screen_quad_set_info (GstVulkanFullScreenQuad * self, GstVideoInfo *in_info, GstVideoInfo * out_info); 109 GST_VULKAN_API 110 gboolean gst_vulkan_full_screen_quad_set_shaders (GstVulkanFullScreenQuad * self, GstVulkanHandle * vert, GstVulkanHandle * frag); 111 GST_VULKAN_API 112 gboolean gst_vulkan_full_screen_quad_set_uniform_buffer (GstVulkanFullScreenQuad * self, GstMemory * uniforms, GError ** error); 113 GST_VULKAN_API 114 gboolean gst_vulkan_full_screen_quad_set_vertex_buffer (GstVulkanFullScreenQuad * self, GstMemory * vertices, GError ** error); 115 GST_VULKAN_API 116 gboolean gst_vulkan_full_screen_quad_set_index_buffer (GstVulkanFullScreenQuad * self, GstMemory * indices, gsize n_indices, GError ** error); 117 118 GST_VULKAN_API 119 gboolean gst_vulkan_full_screen_quad_set_input_buffer (GstVulkanFullScreenQuad * self, GstBuffer * buffer, GError ** error); 120 GST_VULKAN_API 121 gboolean gst_vulkan_full_screen_quad_set_output_buffer (GstVulkanFullScreenQuad * self, GstBuffer * buffer, GError ** error); 122 123 GST_VULKAN_API 124 gboolean gst_vulkan_full_screen_quad_prepare_draw (GstVulkanFullScreenQuad * self, GstVulkanFence * fence, GError ** error); 125 GST_VULKAN_API 126 gboolean gst_vulkan_full_screen_quad_fill_command_buffer (GstVulkanFullScreenQuad * self, GstVulkanCommandBuffer * cmd, GstVulkanFence * fence, GError ** error); 127 GST_VULKAN_API 128 gboolean gst_vulkan_full_screen_quad_submit (GstVulkanFullScreenQuad * self, GstVulkanCommandBuffer * cmd, GstVulkanFence * fence, GError ** error); 129 GST_VULKAN_API 130 gboolean gst_vulkan_full_screen_quad_draw (GstVulkanFullScreenQuad * self, GError ** error); 131 132 GST_VULKAN_API 133 GstVulkanFence * gst_vulkan_full_screen_quad_get_last_fence (GstVulkanFullScreenQuad * self); 134 135 G_END_DECLS 136 #endif /* __GST_VULKAN_FULL_SCREEN_QUAD_H__ */ 137