From 5111420fa2fbd133fcb19ea09b193ff68e0372b4 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 28 Sep 2005 13:05:12 +0000 Subject: [PATCH] gst/base/gstbasesrc.c (gst_base_src_unlock): Comment a bit in lieu of real docs... Original commit message from CVS: 2005-09-28 Andy Wingo * gst/base/gstbasesrc.c (gst_base_src_unlock): Comment a bit in lieu of real docs... * gst/elements/gstfdsrc.c: Cleaned up a bit. --- ChangeLog | 7 +++++++ gst/base/gstbasesrc.c | 3 +++ gst/elements/gstfdsrc.c | 33 ++++++++------------------------- libs/gst/base/gstbasesrc.c | 3 +++ plugins/elements/gstfdsrc.c | 33 ++++++++------------------------- 5 files changed, 29 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52639de..15109e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-09-28 Andy Wingo + + * gst/base/gstbasesrc.c (gst_base_src_unlock): Comment a bit in + lieu of real docs... + + * gst/elements/gstfdsrc.c: Cleaned up a bit. + 2005-09-28 Tim-Philipp Müller * gst/elements/gstcapsfilter.c: diff --git a/gst/base/gstbasesrc.c b/gst/base/gstbasesrc.c index 5fe1a8a..a3b350f 100644 --- a/gst/base/gstbasesrc.c +++ b/gst/base/gstbasesrc.c @@ -727,6 +727,9 @@ error: } } +/* this will always be called between start() and stop(). So you can rely on + resources allocated by start() and freed from stop(). This needs to be added + to the docs at some point. */ static gboolean gst_base_src_unlock (GstBaseSrc * basesrc) { diff --git a/gst/elements/gstfdsrc.c b/gst/elements/gstfdsrc.c index b248377..2e3b80f 100644 --- a/gst/elements/gstfdsrc.c +++ b/gst/elements/gstfdsrc.c @@ -73,19 +73,10 @@ static GstElementDetails gst_fdsrc_details = GST_ELEMENT_DETAILS ("Disk Source", "Erik Walthinsen "); -/* FdSrc signals and args */ enum { - SIGNAL_TIMEOUT, - LAST_SIGNAL -}; - -enum -{ - ARG_0, - ARG_FD, - ARG_BLOCKSIZE, - ARG_TIMEOUT + PROP_0, + PROP_FD, }; #define _do_init(bla) \ @@ -114,6 +105,7 @@ gst_fdsrc_base_init (gpointer g_class) gst_static_pad_template_get (&srctemplate)); gst_element_class_set_details (gstelement_class, &gst_fdsrc_details); } + static void gst_fdsrc_class_init (GstFdSrcClass * klass) { @@ -132,7 +124,7 @@ gst_fdsrc_class_init (GstFdSrcClass * klass) gobject_class->set_property = gst_fdsrc_set_property; gobject_class->get_property = gst_fdsrc_get_property; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD, + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FD, g_param_spec_int ("fd", "fd", "An open file descriptor to read from", 0, G_MAXINT, 0, G_PARAM_READWRITE)); @@ -154,7 +146,6 @@ gst_fdsrc_init (GstFdSrc * fdsrc, GstFdSrcClass * klass) fdsrc->curoffset = 0; } - static gboolean gst_fdsrc_start (GstBaseSrc * bsrc) { @@ -208,14 +199,10 @@ static void gst_fdsrc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstFdSrc *src; - - g_return_if_fail (GST_IS_FDSRC (object)); - - src = GST_FDSRC (object); + GstFdSrc *src = GST_FDSRC (object); switch (prop_id) { - case ARG_FD: + case PROP_FD: src->fd = g_value_get_int (value); break; default: @@ -228,14 +215,10 @@ static void gst_fdsrc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { - GstFdSrc *src; - - g_return_if_fail (GST_IS_FDSRC (object)); - - src = GST_FDSRC (object); + GstFdSrc *src = GST_FDSRC (object); switch (prop_id) { - case ARG_FD: + case PROP_FD: g_value_set_int (value, src->fd); break; default: diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 5fe1a8a..a3b350f 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -727,6 +727,9 @@ error: } } +/* this will always be called between start() and stop(). So you can rely on + resources allocated by start() and freed from stop(). This needs to be added + to the docs at some point. */ static gboolean gst_base_src_unlock (GstBaseSrc * basesrc) { diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index b248377..2e3b80f 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -73,19 +73,10 @@ static GstElementDetails gst_fdsrc_details = GST_ELEMENT_DETAILS ("Disk Source", "Erik Walthinsen "); -/* FdSrc signals and args */ enum { - SIGNAL_TIMEOUT, - LAST_SIGNAL -}; - -enum -{ - ARG_0, - ARG_FD, - ARG_BLOCKSIZE, - ARG_TIMEOUT + PROP_0, + PROP_FD, }; #define _do_init(bla) \ @@ -114,6 +105,7 @@ gst_fdsrc_base_init (gpointer g_class) gst_static_pad_template_get (&srctemplate)); gst_element_class_set_details (gstelement_class, &gst_fdsrc_details); } + static void gst_fdsrc_class_init (GstFdSrcClass * klass) { @@ -132,7 +124,7 @@ gst_fdsrc_class_init (GstFdSrcClass * klass) gobject_class->set_property = gst_fdsrc_set_property; gobject_class->get_property = gst_fdsrc_get_property; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD, + g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FD, g_param_spec_int ("fd", "fd", "An open file descriptor to read from", 0, G_MAXINT, 0, G_PARAM_READWRITE)); @@ -154,7 +146,6 @@ gst_fdsrc_init (GstFdSrc * fdsrc, GstFdSrcClass * klass) fdsrc->curoffset = 0; } - static gboolean gst_fdsrc_start (GstBaseSrc * bsrc) { @@ -208,14 +199,10 @@ static void gst_fdsrc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstFdSrc *src; - - g_return_if_fail (GST_IS_FDSRC (object)); - - src = GST_FDSRC (object); + GstFdSrc *src = GST_FDSRC (object); switch (prop_id) { - case ARG_FD: + case PROP_FD: src->fd = g_value_get_int (value); break; default: @@ -228,14 +215,10 @@ static void gst_fdsrc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { - GstFdSrc *src; - - g_return_if_fail (GST_IS_FDSRC (object)); - - src = GST_FDSRC (object); + GstFdSrc *src = GST_FDSRC (object); switch (prop_id) { - case ARG_FD: + case PROP_FD: g_value_set_int (value, src->fd); break; default: -- 2.7.4