mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +00:00
Loop in pullregion until the desired buffer has been pulled.
Original commit message from CVS: Loop in pullregion until the desired buffer has been pulled.
This commit is contained in:
parent
20e8b7939d
commit
8eaa39e111
1 changed files with 22 additions and 9 deletions
31
gst/gstpad.c
31
gst/gstpad.c
|
@ -1520,21 +1520,34 @@ gst_pad_pull (GstPad *pad)
|
|||
GstBuffer*
|
||||
gst_pad_pullregion (GstPad *pad, GstRegionType type, guint64 offset, guint64 len)
|
||||
{
|
||||
GstRealPad *peer = GST_RPAD_PEER(pad);
|
||||
GstRealPad *peer;
|
||||
GstBuffer *result = NULL;
|
||||
|
||||
g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SINK, NULL);
|
||||
g_return_val_if_fail (peer != NULL, NULL);
|
||||
|
||||
GST_DEBUG_ENTER("(%s:%s,%d,%lld,%lld)",GST_DEBUG_PAD_NAME(pad),type,offset,len);
|
||||
do {
|
||||
peer = GST_RPAD_PEER(pad);
|
||||
g_return_val_if_fail (peer != NULL, NULL);
|
||||
|
||||
if (peer->pullregionfunc) {
|
||||
GST_DEBUG (GST_CAT_DATAFLOW,"calling pullregionfunc &%s of peer pad %s:%s\n",
|
||||
if (result)
|
||||
gst_buffer_unref (result);
|
||||
|
||||
GST_DEBUG_ENTER("(%s:%s,%d,%lld,%lld)",GST_DEBUG_PAD_NAME(pad),type,offset,len);
|
||||
|
||||
if (peer->pullregionfunc) {
|
||||
GST_DEBUG (GST_CAT_DATAFLOW,"calling pullregionfunc &%s of peer pad %s:%s\n",
|
||||
GST_DEBUG_FUNCPTR_NAME(peer->pullregionfunc),GST_DEBUG_PAD_NAME(((GstPad*)peer)));
|
||||
return (peer->pullregionfunc)(((GstPad*)peer),type,offset,len);
|
||||
} else {
|
||||
GST_DEBUG (GST_CAT_DATAFLOW,"no pullregionfunc\n");
|
||||
return NULL;
|
||||
result = (peer->pullregionfunc)(((GstPad*)peer),type,offset,len);
|
||||
} else {
|
||||
GST_DEBUG (GST_CAT_DATAFLOW,"no pullregionfunc\n");
|
||||
result = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (!(GST_BUFFER_OFFSET (result) == offset &&
|
||||
GST_BUFFER_SIZE (result) == len));
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue