}
/**
+ * gst_vaapi_plugin_base_pad_set_caps:
+ * @plugin: a #GstVaapiPluginBase
+ * @sinkpad: the sink pad to set @incaps on
+ * @incaps: the sink pad (input) caps
+ * @srcpad: the src pad to set @outcaps on
+ * @outcaps: the src pad (output) caps
+ *
+ * Notifies the base plugin object of the new input and output caps,
+ * obtained from the subclass on the requested pads.
+ *
+ * Returns: %TRUE if the update of caps was successful, %FALSE otherwise.
+ */
+gboolean
+gst_vaapi_plugin_base_pad_set_caps (GstVaapiPluginBase * plugin,
+ GstPad * sinkpad, GstCaps * incaps, GstPad * srcpad, GstCaps * outcaps)
+{
+ return _set_sinkpad_caps (plugin, sinkpad, incaps)
+ && _set_srcpad_caps (plugin, srcpad, outcaps);
+}
+
+/**
* gst_vaapi_plugin_base_set_caps:
* @plugin: a #GstVaapiPluginBase
* @incaps: the sink pad (input) caps
gst_vaapi_plugin_base_set_caps (GstVaapiPluginBase * plugin, GstCaps * incaps,
GstCaps * outcaps)
{
- return _set_sinkpad_caps (plugin, plugin->sinkpad, incaps)
- && _set_srcpad_caps (plugin, plugin->srcpad, outcaps);
+ return gst_vaapi_plugin_base_pad_set_caps (plugin, plugin->sinkpad, incaps,
+ plugin->srcpad, outcaps);
}
/**
- * gst_vaapi_plugin_base_propose_allocation:
+ * gst_vaapi_plugin_base_pad_propose_allocation:
* @plugin: a #GstVaapiPluginBase
+ * @sinkpad: the sinkpad to configure the allocation query on
* @query: the allocation query to configure
*
- * Proposes allocation parameters to the upstream elements on the base plugin
- * static sinkpad.
+ * Proposes allocation parameters to the upstream elements on the requested
+ * sinkpad.
*
* Returns: %TRUE if successful, %FALSE otherwise.
*/
gboolean
-gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
- GstQuery * query)
+gst_vaapi_plugin_base_pad_propose_allocation (GstVaapiPluginBase * plugin,
+ GstPad * sinkpad, GstQuery * query)
{
- GstVaapiPadPrivate *sinkpriv = GST_VAAPI_PAD_PRIVATE (plugin->sinkpad);
+ GstVaapiPadPrivate *sinkpriv = GST_VAAPI_PAD_PRIVATE (sinkpad);
GstCaps *caps = NULL;
GstBufferPool *pool = NULL;
gboolean need_pool;
if (!caps)
goto error_no_caps;
- if (!ensure_sinkpad_allocator (plugin, plugin->sinkpad, caps, &size))
+ if (!ensure_sinkpad_allocator (plugin, sinkpad, caps, &size))
return FALSE;
if (need_pool) {
}
/**
+ * gst_vaapi_plugin_base_propose_allocation:
+ * @plugin: a #GstVaapiPluginBase
+ * @query: the allocation query to configure
+ *
+ * Proposes allocation parameters to the upstream elements on the base plugin
+ * static sinkpad.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ */
+gboolean
+gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
+ GstQuery * query)
+{
+ return gst_vaapi_plugin_base_pad_propose_allocation (plugin, plugin->sinkpad,
+ query);
+}
+
+/**
* gst_vaapi_plugin_base_decide_allocation:
* @plugin: a #GstVaapiPluginBase
* @query: the allocation query to parse
}
/**
- * gst_vaapi_plugin_base_get_input_buffer:
+ * gst_vaapi_plugin_base_pad_get_input_buffer:
* @plugin: a #GstVaapiPluginBase
+ * @sinkpad: the sink pad to obtain input buffer on
* @inbuf: the sink pad (input) buffer
* @outbuf_ptr: the pointer to location to the VA surface backed buffer
*
* Returns: #GST_FLOW_OK if the buffer could be acquired
*/
GstFlowReturn
-gst_vaapi_plugin_base_get_input_buffer (GstVaapiPluginBase * plugin,
- GstBuffer * inbuf, GstBuffer ** outbuf_ptr)
+gst_vaapi_plugin_base_pad_get_input_buffer (GstVaapiPluginBase * plugin,
+ GstPad * sinkpad, GstBuffer * inbuf, GstBuffer ** outbuf_ptr)
{
- GstVaapiPadPrivate *sinkpriv = GST_VAAPI_PAD_PRIVATE (plugin->sinkpad);
+ GstVaapiPadPrivate *sinkpriv = GST_VAAPI_PAD_PRIVATE (sinkpad);
GstVaapiVideoMeta *meta;
GstBuffer *outbuf;
GstVideoFrame src_frame, out_frame;
goto error_create_buffer;
if (is_dma_buffer (inbuf)) {
- if (!plugin_bind_dma_to_vaapi_buffer (plugin, plugin->sinkpad, inbuf,
- outbuf))
+ if (!plugin_bind_dma_to_vaapi_buffer (plugin, sinkpad, inbuf, outbuf))
goto error_bind_dma_buffer;
goto done;
}
}
/**
+ * gst_vaapi_plugin_base_get_input_buffer:
+ * @plugin: a #GstVaapiPluginBase
+ * @inbuf: the sink pad (input) buffer
+ * @outbuf_ptr: the pointer to location to the VA surface backed buffer
+ *
+ * Acquires the static sink pad (input) buffer as a VA surface backed
+ * buffer. This is mostly useful for raw YUV buffers, as source
+ * buffers that are already backed as a VA surface are passed
+ * verbatim.
+ *
+ * Returns: #GST_FLOW_OK if the buffer could be acquired
+ */
+GstFlowReturn
+gst_vaapi_plugin_base_get_input_buffer (GstVaapiPluginBase * plugin,
+ GstBuffer * inbuf, GstBuffer ** outbuf_ptr)
+{
+ return gst_vaapi_plugin_base_pad_get_input_buffer (plugin, plugin->sinkpad,
+ inbuf, outbuf_ptr);
+}
+
+/**
* gst_vaapi_plugin_base_set_gl_context:
* @plugin: a #GstVaapiPluginBase
* @object: the new GL context from downstream
GstAllocationParams other_allocator_params;
};
+G_GNUC_INTERNAL
+GstVaapiPadPrivate *
+gst_vaapi_pad_private_new (void);
+
+G_GNUC_INTERNAL
+void
+gst_vaapi_pad_private_reset (GstVaapiPadPrivate * priv);
+
+G_GNUC_INTERNAL
+void
+gst_vaapi_pad_private_finalize (GstVaapiPadPrivate * priv);
+
struct _GstVaapiPluginBase
{
/*< private >*/
GstVideoEncoder encoder;
GstBaseTransform transform;
GstVideoSink sink;
+ GstVideoAggregator aggregator;
} parent_instance;
GstDebugCategory *debug_category;
GstVideoEncoderClass encoder;
GstBaseTransformClass transform;
GstVideoSinkClass sink;
+ GstVideoAggregatorClass aggregator;
} parent_class;
gboolean (*has_interface) (GstVaapiPluginBase * plugin, GType type);
G_GNUC_INTERNAL
gboolean
+gst_vaapi_plugin_base_pad_set_caps (GstVaapiPluginBase *plugin,
+ GstPad * sinkpad, GstCaps * incaps, GstPad * srcpad, GstCaps * outcaps);
+
+G_GNUC_INTERNAL
+gboolean
gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
GstQuery * query);
G_GNUC_INTERNAL
gboolean
+gst_vaapi_plugin_base_pad_propose_allocation (GstVaapiPluginBase * plugin,
+ GstPad * sinkpad, GstQuery * query);
+
+G_GNUC_INTERNAL
+gboolean
gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
GstQuery * query);
GstBuffer * inbuf, GstBuffer ** outbuf_ptr);
G_GNUC_INTERNAL
+GstFlowReturn
+gst_vaapi_plugin_base_pad_get_input_buffer (GstVaapiPluginBase * plugin,
+ GstPad * sinkpad, GstBuffer * inbuf, GstBuffer ** outbuf_ptr);
+
+G_GNUC_INTERNAL
void
gst_vaapi_plugin_base_set_context (GstVaapiPluginBase * plugin,
GstContext * context);