mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
gst/elements/: (gst_fakesink_loop, gst_fakesrc_loop, gst_fakesink_chain)
Original commit message from CVS: 2005-02-21 Andy Wingo <wingo@pobox.com> * gst/elements/gstfakesink.c: * gst/elements/gstfakesrc.c: (gst_fakesink_loop, gst_fakesrc_loop, gst_fakesink_chain) (gst_fakesrc_get_range): Assert the pad has been activated in the proper mode. This will fail right now for fakesrc ! identity ! fakesink. (gst_fakesrc_activate, gst_fakesink_activate): Record the pad activation mode. * gst/elements/gstfakesrc.h: Add a pad_mode instance variable.
This commit is contained in:
parent
8479cbc3fa
commit
6664bebb6d
7 changed files with 47 additions and 0 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,5 +1,16 @@
|
||||||
2005-02-21 Andy Wingo <wingo@pobox.com>
|
2005-02-21 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* gst/elements/gstfakesink.c:
|
||||||
|
* gst/elements/gstfakesrc.c:
|
||||||
|
(gst_fakesink_loop, gst_fakesrc_loop, gst_fakesink_chain)
|
||||||
|
(gst_fakesrc_get_range): Assert the pad has been activated in the
|
||||||
|
proper mode. This will fail right now for fakesrc ! identity !
|
||||||
|
fakesink.
|
||||||
|
(gst_fakesrc_activate, gst_fakesink_activate): Record the pad
|
||||||
|
activation mode.
|
||||||
|
|
||||||
|
* gst/elements/gstfakesrc.h: Add a pad_mode instance variable.
|
||||||
|
|
||||||
* gst/gstpad.c (gst_real_pad_dispose): Free the stream lock (it
|
* gst/gstpad.c (gst_real_pad_dispose): Free the stream lock (it
|
||||||
wasn't being freed before).
|
wasn't being freed before).
|
||||||
(gst_real_pad_init): Allocate and initialize the stream lock.
|
(gst_real_pad_init): Allocate and initialize the stream lock.
|
||||||
|
|
|
@ -400,6 +400,9 @@ gst_fakesink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fakesink->pad_mode = mode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,6 +497,9 @@ gst_fakesink_chain (GstPad * pad, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
|
|
||||||
|
g_assert (GST_FAKESINK (GST_OBJECT_PARENT (pad))->pad_mode ==
|
||||||
|
GST_ACTIVATE_PUSH);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
||||||
result = gst_fakesink_chain_unlocked (pad, buf);
|
result = gst_fakesink_chain_unlocked (pad, buf);
|
||||||
|
@ -512,6 +518,8 @@ gst_fakesink_loop (GstPad * pad)
|
||||||
|
|
||||||
fakesink = GST_FAKESINK (GST_OBJECT_PARENT (pad));
|
fakesink = GST_FAKESINK (GST_OBJECT_PARENT (pad));
|
||||||
|
|
||||||
|
g_assert (fakesink->pad_mode == GST_ACTIVATE_PULL);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
||||||
result = gst_pad_pull_range (pad, fakesink->offset, DEFAULT_SIZE, &buf);
|
result = gst_pad_pull_range (pad, fakesink->offset, DEFAULT_SIZE, &buf);
|
||||||
|
|
|
@ -328,6 +328,7 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
|
||||||
fakesrc->last_message = NULL;
|
fakesrc->last_message = NULL;
|
||||||
fakesrc->datarate = DEFAULT_DATARATE;
|
fakesrc->datarate = DEFAULT_DATARATE;
|
||||||
fakesrc->sync = DEFAULT_SYNC;
|
fakesrc->sync = DEFAULT_SYNC;
|
||||||
|
fakesrc->pad_mode = GST_ACTIVATE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -869,6 +870,9 @@ gst_fakesrc_get_range (GstPad * pad, guint64 offset, guint length,
|
||||||
{
|
{
|
||||||
GstFlowReturn fret;
|
GstFlowReturn fret;
|
||||||
|
|
||||||
|
g_assert (GST_FAKESRC (GST_OBJECT_PARENT (pad))->pad_mode ==
|
||||||
|
GST_ACTIVATE_PULL);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
||||||
fret = gst_fakesrc_get_range_unlocked (pad, offset, length, ret);
|
fret = gst_fakesrc_get_range_unlocked (pad, offset, length, ret);
|
||||||
|
@ -887,6 +891,8 @@ gst_fakesrc_loop (GstPad * pad)
|
||||||
|
|
||||||
src = GST_FAKESRC (GST_OBJECT_PARENT (pad));
|
src = GST_FAKESRC (GST_OBJECT_PARENT (pad));
|
||||||
|
|
||||||
|
g_assert (src->pad_mode == GST_ACTIVATE_PUSH);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
if (src->need_flush) {
|
if (src->need_flush) {
|
||||||
src->need_flush = FALSE;
|
src->need_flush = FALSE;
|
||||||
|
@ -956,6 +962,9 @@ gst_fakesrc_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fakesrc->pad_mode = mode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ struct _GstFakeSrc {
|
||||||
GstFakeSrcDataType data;
|
GstFakeSrcDataType data;
|
||||||
GstFakeSrcSizeType sizetype;
|
GstFakeSrcSizeType sizetype;
|
||||||
GstFakeSrcFillType filltype;
|
GstFakeSrcFillType filltype;
|
||||||
|
GstActivateMode pad_mode;
|
||||||
|
|
||||||
guint sizemin;
|
guint sizemin;
|
||||||
guint sizemax;
|
guint sizemax;
|
||||||
|
|
|
@ -400,6 +400,9 @@ gst_fakesink_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fakesink->pad_mode = mode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,6 +497,9 @@ gst_fakesink_chain (GstPad * pad, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
|
|
||||||
|
g_assert (GST_FAKESINK (GST_OBJECT_PARENT (pad))->pad_mode ==
|
||||||
|
GST_ACTIVATE_PUSH);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
||||||
result = gst_fakesink_chain_unlocked (pad, buf);
|
result = gst_fakesink_chain_unlocked (pad, buf);
|
||||||
|
@ -512,6 +518,8 @@ gst_fakesink_loop (GstPad * pad)
|
||||||
|
|
||||||
fakesink = GST_FAKESINK (GST_OBJECT_PARENT (pad));
|
fakesink = GST_FAKESINK (GST_OBJECT_PARENT (pad));
|
||||||
|
|
||||||
|
g_assert (fakesink->pad_mode == GST_ACTIVATE_PULL);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
||||||
result = gst_pad_pull_range (pad, fakesink->offset, DEFAULT_SIZE, &buf);
|
result = gst_pad_pull_range (pad, fakesink->offset, DEFAULT_SIZE, &buf);
|
||||||
|
|
|
@ -328,6 +328,7 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
|
||||||
fakesrc->last_message = NULL;
|
fakesrc->last_message = NULL;
|
||||||
fakesrc->datarate = DEFAULT_DATARATE;
|
fakesrc->datarate = DEFAULT_DATARATE;
|
||||||
fakesrc->sync = DEFAULT_SYNC;
|
fakesrc->sync = DEFAULT_SYNC;
|
||||||
|
fakesrc->pad_mode = GST_ACTIVATE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -869,6 +870,9 @@ gst_fakesrc_get_range (GstPad * pad, guint64 offset, guint length,
|
||||||
{
|
{
|
||||||
GstFlowReturn fret;
|
GstFlowReturn fret;
|
||||||
|
|
||||||
|
g_assert (GST_FAKESRC (GST_OBJECT_PARENT (pad))->pad_mode ==
|
||||||
|
GST_ACTIVATE_PULL);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
|
|
||||||
fret = gst_fakesrc_get_range_unlocked (pad, offset, length, ret);
|
fret = gst_fakesrc_get_range_unlocked (pad, offset, length, ret);
|
||||||
|
@ -887,6 +891,8 @@ gst_fakesrc_loop (GstPad * pad)
|
||||||
|
|
||||||
src = GST_FAKESRC (GST_OBJECT_PARENT (pad));
|
src = GST_FAKESRC (GST_OBJECT_PARENT (pad));
|
||||||
|
|
||||||
|
g_assert (src->pad_mode == GST_ACTIVATE_PUSH);
|
||||||
|
|
||||||
GST_STREAM_LOCK (pad);
|
GST_STREAM_LOCK (pad);
|
||||||
if (src->need_flush) {
|
if (src->need_flush) {
|
||||||
src->need_flush = FALSE;
|
src->need_flush = FALSE;
|
||||||
|
@ -956,6 +962,9 @@ gst_fakesrc_activate (GstPad * pad, GstActivateMode mode)
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fakesrc->pad_mode = mode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ struct _GstFakeSrc {
|
||||||
GstFakeSrcDataType data;
|
GstFakeSrcDataType data;
|
||||||
GstFakeSrcSizeType sizetype;
|
GstFakeSrcSizeType sizetype;
|
||||||
GstFakeSrcFillType filltype;
|
GstFakeSrcFillType filltype;
|
||||||
|
GstActivateMode pad_mode;
|
||||||
|
|
||||||
guint sizemin;
|
guint sizemin;
|
||||||
guint sizemax;
|
guint sizemax;
|
||||||
|
|
Loading…
Reference in a new issue