mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
shapewipe: Proxy bufferalloc on the video sinkpad
This commit is contained in:
parent
80d5bd7168
commit
09094f2f3d
1 changed files with 23 additions and 0 deletions
|
@ -67,6 +67,8 @@ static gboolean gst_shape_wipe_video_sink_event (GstPad * pad,
|
||||||
static gboolean gst_shape_wipe_video_sink_setcaps (GstPad * pad,
|
static gboolean gst_shape_wipe_video_sink_setcaps (GstPad * pad,
|
||||||
GstCaps * caps);
|
GstCaps * caps);
|
||||||
static GstCaps *gst_shape_wipe_video_sink_getcaps (GstPad * pad);
|
static GstCaps *gst_shape_wipe_video_sink_getcaps (GstPad * pad);
|
||||||
|
static GstFlowReturn gst_shape_wipe_video_sink_bufferalloc (GstPad * pad,
|
||||||
|
guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf);
|
||||||
static GstFlowReturn gst_shape_wipe_mask_sink_chain (GstPad * pad,
|
static GstFlowReturn gst_shape_wipe_mask_sink_chain (GstPad * pad,
|
||||||
GstBuffer * buffer);
|
GstBuffer * buffer);
|
||||||
static gboolean gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_shape_wipe_mask_sink_event (GstPad * pad, GstEvent * event);
|
||||||
|
@ -165,6 +167,8 @@ gst_shape_wipe_init (GstShapeWipe * self, GstShapeWipeClass * g_class)
|
||||||
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_setcaps));
|
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_setcaps));
|
||||||
gst_pad_set_getcaps_function (self->video_sinkpad,
|
gst_pad_set_getcaps_function (self->video_sinkpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_getcaps));
|
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_getcaps));
|
||||||
|
gst_pad_set_bufferalloc_function (self->video_sinkpad,
|
||||||
|
GST_DEBUG_FUNCPTR (gst_shape_wipe_video_sink_bufferalloc));
|
||||||
gst_element_add_pad (GST_ELEMENT (self), self->video_sinkpad);
|
gst_element_add_pad (GST_ELEMENT (self), self->video_sinkpad);
|
||||||
|
|
||||||
self->mask_sinkpad =
|
self->mask_sinkpad =
|
||||||
|
@ -265,6 +269,25 @@ gst_shape_wipe_reset (GstShapeWipe * self)
|
||||||
gst_segment_init (&self->segment, GST_FORMAT_TIME);
|
gst_segment_init (&self->segment, GST_FORMAT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_shape_wipe_video_sink_bufferalloc (GstPad * pad, guint64 offset, guint size,
|
||||||
|
GstCaps * caps, GstBuffer ** buf)
|
||||||
|
{
|
||||||
|
GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad));
|
||||||
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (pad, "Allocating buffer with offset 0x%" G_GINT64_MODIFIER
|
||||||
|
"x and size %u with caps: %" GST_PTR_FORMAT, offset, size, caps);
|
||||||
|
|
||||||
|
*buf = NULL;
|
||||||
|
|
||||||
|
ret = gst_pad_alloc_buffer (self->srcpad, offset, size, caps, buf);
|
||||||
|
|
||||||
|
gst_object_unref (self);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_shape_wipe_video_sink_setcaps (GstPad * pad, GstCaps * caps)
|
gst_shape_wipe_video_sink_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue