Update of /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18850/src
Modified Files:
misc.c rbgst.c rbgst.h rbgstbin.c rbgstcaps.c rbgstclock.c
rbgstclockentry.c rbgstelement.c rbgstelementfactory.c
rbgstevent.c rbgsteventseek.c rbgstformat.c rbgstobject.c
rbgstpad.c rbgstplugin.c rbgstpluginfeature.c rbgstquerytype.c
rbgstregistry.c rbgststructure.c rbgsttagsetter.c
rbgstxoverlay.c
Removed Files:
rbgstcpu.c rbgsteventmask.c rbgsteventsegmentseek.c
rbgsteventsize.c rbgstregistrypool.c rbgstscheduler.c
rbgstschedulerfactory.c rbgstthread.c
Log Message:
* extconf.rb, README, src/: made build-able with
gstreamer-0.10. only just build-able.
* sample/gst-inspect.rb: partially worked.
Index: misc.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/misc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- misc.c 6 Oct 2005 16:42:40 -0000 1.6
+++ misc.c 29 Sep 2007 14:19:16 -0000 1.7
@@ -46,10 +46,10 @@
{
GType gtype = G_OBJECT_TYPE (o);
const gchar *gtypename = g_type_name (gtype);
- if (strncmp (gtypename, "Gst", 3) == 0)
- gtypename += 3;
- if (!rb_const_defined_at (mGst, rb_intern (gtypename)))
- G_DEF_CLASS (gtype, gtypename, mGst);
+ if (strncmp (gtypename, "Gst", 3) == 0)
+ gtypename += 3;
+ if (!rb_const_defined_at (mGst, rb_intern (gtypename)))
+ G_DEF_CLASS (gtype, gtypename, mGst);
return GOBJ2RVAL (o);
}
Index: rbgst.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgst.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- rbgst.c 5 Oct 2005 18:29:11 -0000 1.25
+++ rbgst.c 29 Sep 2007 14:19:16 -0000 1.26
@@ -32,7 +32,6 @@
extern void Init_gst_caps (void);
extern void Init_gst_clock (void);
extern void Init_gst_clock_entry (void);
- extern void Init_gst_cpu (void);
extern void Init_gst_element (void);
extern void Init_gst_elementfactory (void);
extern void Init_gst_event (void);
@@ -75,14 +74,10 @@
Init_gst_caps ();
Init_gst_clock ();
Init_gst_clock_entry ();
- Init_gst_cpu ();
Init_gst_element ();
Init_gst_elementfactory ();
- Init_gst_event ();
- Init_gst_eventmask ();
- Init_gst_eventseek ();
- Init_gst_eventsegmentseek ();
- Init_gst_eventsize ();
+ /* Init_gst_event (); */
+ /* Init_gst_eventseek (); */
Init_gst_format ();
Init_gst_index ();
Init_gst_indexentry ();
@@ -96,13 +91,9 @@
Init_gst_pluginfeature ();
Init_gst_querytype ();
Init_gst_registry ();
- Init_gst_registry_pool ();
- Init_gst_scheduler ();
- Init_gst_schedulerfactory ();
Init_gst_systemclock ();
Init_gst_tag ();
Init_gst_tag_setter ();
- Init_gst_thread ();
Init_gst_typefindfactory ();
Init_gst_xml ();
@@ -136,6 +127,12 @@
gint i, gargc;
VALUE argary;
gchar **gargv;
+ GError *error = NULL;
+ static gboolean initialized = FALSE;
+
+ if (initialized)
+ return Qtrue;
+ initialized = TRUE;
/*
* Convert arguments in a Ruby array.
@@ -168,10 +165,10 @@
gargc++;
/*
- * Now, we can initialize GStreamer.
+ * Now, we can initialize GStreamer.
*/
- if (gst_init_check (&gargc, &gargv) == FALSE)
- rb_raise (rb_eRuntimeError, "failed to initialize GStreamer");
+ if (!gst_init_check(&gargc, &gargv, &error))
+ RAISE_GERROR(error);
/*
* Initialize all included classes
@@ -187,53 +184,20 @@
* Gets the version number of the GStreamer library, in an array
* of 3 fixnums, which represent major, minor and macro numbers.
*
- * # Prints GStreamer version in a String 'major.minor.macro'
+ * # Prints GStreamer version in a String 'major.minor.macro.nano'
* p Gst.version.join('.')
*
- * Returns: an Array of 3 fixnums (major, minor and macro numbers).
+ * Returns: an Array of 4 fixnums (major, minor, macro and nano numbers).
*/
static VALUE
rb_gst_version (VALUE self)
{
- guint major, minor, micro;
- VALUE arr;
-
- gst_version (&major, &minor, µ);
- arr = rb_ary_new ();
- rb_ary_push (arr, INT2FIX (major));
- rb_ary_push (arr, INT2FIX (minor));
- rb_ary_push (arr, INT2FIX (micro));
-
- return arr;
-}
-
-/* Class method: has_threads?
- * Returns: true if GStreamer has threads enabled, false otherwise.
- */
-static VALUE
-rb_gst_has_threads (VALUE self)
-{
- return CBOOL2RVAL (gst_has_threads ());
-}
+ guint major, minor, micro, nano;
-/*
- * Class method: use_threads(state)
- * state: a boolean state.
- *
- * Instructs the core to turn on/off threading.
- *
- * When threading is turned off, all thread operations such as
- * mutexes and conditionals are turned into NOPs.
- * Use this if you want absolute minimal overhead and you don't
- * use any threads in the pipeline.
- *
- * Returns: the provided boolean value.
- */
-static VALUE
-rb_gst_use_threads (VALUE self, VALUE value)
-{
- gst_use_threads (RVAL2CBOOL (value));
- return value;
+ gst_version(&major, &minor, µ, &nano);
+ return rb_ary_new3(4,
+ INT2NUM(major), INT2NUM(minor),
+ INT2NUM(micro), INT2NUM(nano));
}
void
@@ -241,10 +205,8 @@
{
mGst = rb_define_module ("Gst");
- rb_define_module_function (mGst, "init", rb_gst_init, -1);
- rb_define_module_function (mGst, "version", rb_gst_version, 0);
- rb_define_module_function (mGst, "has_threads?", rb_gst_has_threads, 0);
- rb_define_module_function (mGst, "use_threads", rb_gst_use_threads, 1);
+ rb_define_module_function(mGst, "init", rb_gst_init, -1);
+ rb_define_module_function(mGst, "version", rb_gst_version, 0);
/*
* Constant: SECOND
Index: rbgst.h
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgst.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- rbgst.h 4 Aug 2005 15:46:38 -0000 1.19
+++ rbgst.h 29 Sep 2007 14:19:16 -0000 1.20
@@ -33,6 +33,7 @@
/* Gst module */
extern VALUE mGst;
+extern VALUE rb_cGstEvent;
/* Gst::EventSeek class (needed for inheritance) */
extern VALUE cGstEventSeek;
@@ -48,7 +49,6 @@
#define GST_TYPE_CLOCK_ENTRY (gst_clock_entry_get_type())
#define GST_TYPE_EVENT_MASK (gst_event_mask_get_type())
#define GST_TYPE_FORMAT2 (gst_format_get_type2())
-#define GST_TYPE_PLUGIN (gst_plugin_get_type())
#define GST_TYPE_QUERY_TYPE2 (gst_query_type_get_type2())
#define GST_TYPE_TYPE (gst_type_get_type())
@@ -68,7 +68,7 @@
#define RGST_PAD(o) (GST_PAD(RVAL2GOBJ(o)))
#define RGST_PAD_TEMPLATE(o) (GST_PAD_TEMPLATE(RVAL2GOBJ(o)))
#define RGST_PIPELINE(o) (GST_PIPELINE(RVAL2GOBJ(o)))
-#define RGST_PLUGIN(o) (GST_PLUGIN(RVAL2BOXED(o, GST_TYPE_PLUGIN)))
+#define RGST_PLUGIN(o) (GST_PLUGIN(RVAL2GOBJ(o)))
#define RGST_PLUGIN_FEATURE(o) (GST_PLUGIN_FEATURE(RVAL2GOBJ(o)))
#define RGST_QUERY_TYPE(o) (GST_QUERY_TYPE2(RVAL2BOXED(o, GST_TYPE_QUERY_TYPE2)))
#define RGST_REGISTRY(o) (GST_REGISTRY(RVAL2GOBJ(o)))
@@ -97,7 +97,7 @@
#define RGST_PAD_NEW(o) (RGST_GOBJ_NEW(GST_PAD(o)))
#define RGST_PAD_TEMPLATE_NEW(o) (RGST_GOBJ_NEW(GST_PAD_TEMPLATE(o)))
#define RGST_PIPELINE_NEW(o) (RGST_GOBJ_NEW(GST_PIPELINE(o)))
-#define RGST_PLUGIN_NEW(o) (BOXED2RVAL(GST_PLUGIN(o), GST_TYPE_PLUGIN))
+#define RGST_PLUGIN_NEW(o) (RGST_GOBJ_NEW(GST_PLUGIN(o)))
#define RGST_PLUGIN_FEATURE_NEW(o) (RGST_GOBJ_NEW(GST_PLUGIN_FEATURE(o)))
#define RGST_QUERY_TYPE_NEW(o) (BOXED2RVAL(GST_QUERY_TYPE2(o), GST_TYPE_QUERY_TYPE2))
#define RGST_REGISTRY_NEW(o) (RGST_GOBJ_NEW(GST_REGISTRY(o)))
@@ -110,7 +110,6 @@
GType gst_clock_entry_get_type ();
GType gst_event_mask_get_type ();
GType gst_format_get_type2 ();
-GType gst_plugin_get_type ();
GType gst_query_type_get_type2 ();
GType gst_type_get_type ();
Index: rbgstbin.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstbin.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- rbgstbin.c 29 Oct 2004 03:49:10 -0000 1.11
+++ rbgstbin.c 29 Sep 2007 14:19:16 -0000 1.12
@@ -59,27 +59,28 @@
static VALUE
rb_gst_bin_length (VALUE self)
{
- return
- INT2FIX (g_list_length ((GList *) gst_bin_get_list (RGST_BIN (self))));
+ return INT2NUM(RGST_BIN(self)->numchildren);
}
/*
- * Method: elements
+ * Method: children
*
* Returns: an array of all Gst::Element objects in the container.
*/
static VALUE
-rb_gst_bin_get_elements (VALUE self)
+rb_gst_bin_get_children (VALUE self)
{
const GList *list;
+ VALUE children;
- VALUE arr = rb_ary_new ();
-
- for (list = gst_bin_get_list (RGST_BIN (self));
- list != NULL; list = g_list_next (list))
- rb_ary_push (arr, RGST_ELEMENT_NEW (list->data));
+ children = rb_ary_new();
+ for (list = RGST_BIN(self)->children;
+ list != NULL;
+ list = g_list_next(list)) {
+ rb_ary_push(children, RGST_ELEMENT_NEW(list->data));
+ }
- return arr;
+ return children;
}
/*
@@ -103,7 +104,7 @@
}
gst_bin_add (bin, RGST_ELEMENT (argv[i]));
}
- return rb_gst_bin_get_elements (self);
+ return rb_gst_bin_get_children(self);
}
/*
@@ -122,7 +123,7 @@
for (i = 0; i < argc; i++)
gst_bin_remove (RGST_BIN (self), RGST_ELEMENT (argv[i]));
- return rb_gst_bin_get_elements (self);
+ return rb_gst_bin_get_children(self);
}
/*
@@ -138,7 +139,7 @@
VALUE arr;
int i;
- arr = rb_gst_bin_get_elements (self);
+ arr = rb_gst_bin_get_children(self);
for (i = 0; i < RARRAY (arr)->len; i++) {
VALUE element = rb_ary_entry (arr, i);
rb_gst_bin_remove (1, &element, self);
@@ -157,7 +158,7 @@
static VALUE
rb_gst_bin_each_element (VALUE self)
{
- return rb_ary_yield (rb_gst_bin_get_elements (self));
+ return rb_ary_yield (rb_gst_bin_get_children (self));
}
/*
@@ -202,54 +203,38 @@
}
/*
- * Method: iterate
+ * Method: iterate_elements
*
* Iterates over the elements in this bin.
*
* Returns: true if the bin did something useful, or false (this value can
* be used to determine if the bin is in EOS ("end of stream")).
*/
-static VALUE
-rb_gst_bin_iterate (VALUE self)
-{
- return CBOOL2RVAL (gst_bin_iterate (RGST_BIN (self)));
-}
+/* static VALUE */
+/* rb_gst_bin_iterate_elements(VALUE self) */
+/* { */
+/* return CBOOL2RVAL(gst_bin_iterate_elements(RGST_BIN(self))); */
+/* } */
/*
- * Method: clock
+ * Method: provided_clock
*
* Gets the current clock of the (scheduler of the) bin,
* as a Gst::Clock object.
- * This method overrides Gst::Element#get_clock.
*
* Returns: a Gst::Clock object, or nil.
*/
static VALUE
-rb_gst_bin_get_clock (VALUE self)
+rb_gst_bin_get_provided_clock (VALUE self)
{
GstClock *clock;
- clock = gst_bin_get_clock (RGST_BIN (self));
- return clock != NULL ? RGST_CLOCK_NEW (clock)
- : Qnil;
-}
-
-/*
- * Method: auto_clock
- *
- * Let the bin select a clock automatically.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_bin_auto_clock (VALUE self)
-{
- gst_bin_auto_clock (RGST_BIN (self));
- return self;
+ clock = RGST_BIN(self)->provided_clock;
+ return clock == NULL ? Qnil : RGST_CLOCK_NEW(clock);
}
/*
- * Method: use_clock(clock)
+ * Method: provided_clock=(clock)
* clock: a Gst::Clock.
*
* Forces the bin to use the given clock. Use nil to force it
@@ -258,10 +243,19 @@
* Returns: self.
*/
static VALUE
-rb_gst_bin_use_clock (VALUE self, VALUE clock)
+rb_gst_bin_set_provided_clock (VALUE self, VALUE clock)
{
- gst_bin_use_clock (RGST_BIN (self),
- NIL_P (clock) ? NULL : RGST_CLOCK (clock));
+ GstBin *bin;
+
+ bin = RGST_BIN(self);
+ if (bin->provided_clock)
+ g_object_unref(bin->provided_clock);
+
+ if (!NIL_P(clock)) {
+ bin->provided_clock = RGST_CLOCK(clock);
+ g_object_ref(bin->provided_clock);
+ }
+
return self;
}
@@ -285,7 +279,7 @@
}
/*
- * Method: get_all_by_interface(interface)
+ * Method: iterate_all_by_interface(interface)
* interface: an interface (Ruby class).
*
* Looks for all elements inside the bin that implements the given
@@ -294,21 +288,17 @@
* Returns: a list of elements inside the bin implementing the interface,
* as an Array of Gst::Element objects.
*/
-static VALUE
-rb_gst_bin_get_all_by_if (VALUE self, VALUE klass)
-{
- GList *list;
-
- VALUE arr = rb_ary_new ();
-
- for (list =
- gst_bin_get_all_by_interface (RGST_BIN (self), CLASS2GTYPE (klass));
- list != NULL; list = g_list_next (list))
- rb_ary_push (arr, RGST_ELEMENT_NEW (list->data));
+/* static VALUE */
+/* rb_gst_bin_iterate_all_by_if(VALUE self, VALUE klass) */
+/* { */
+/* for (list = */
+/* gst_bin_get_all_by_interface (RGST_BIN (self), CLASS2GTYPE (klass)); */
+/* list != NULL; list = g_list_next (list)) */
+/* rb_ary_push (arr, RGST_ELEMENT_NEW (list->data)); */
- g_list_free (list);
- return arr;
-}
+/* g_list_free (list); */
+/* return arr; */
+/* } */
/*
* Method: each_by_interface(interface)
@@ -320,52 +310,11 @@
*
* Returns: always nil.
*/
-static VALUE
-rb_gst_bin_each_by_if (VALUE self, VALUE klass)
-{
- return rb_ary_yield (rb_gst_bin_get_all_by_if (self, klass));
-}
-
-/*
- * Method: sync_children_state
- *
- * Tries to set the state of the children of this bin to the same state of
- * the bin by calling Gst::Element#set_state for each child not already having
- * a synchronized state.
- *
- * Returns: the worst return value of any Gst::Element#set_state (see
- * Gst::Element::State).
- */
-static VALUE
-rb_gst_bin_sync_children_state (VALUE self)
-{
- return GENUM2RVAL (gst_bin_sync_children_state (RGST_BIN (self)),
- GST_TYPE_ELEMENT_STATE_RETURN);
-}
-
-/*
- * Method: child_state_change(oldstate, newstate, child)
- * oldstate: the old child state (see Gst::Element::State).
- * newstate: the new child state (see Gst::Element::State).
- * child: a Gst::Element that signaled a changed state.
- *
- * An internal method to inform the parent bin about a state change of
- * a child.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_bin_child_state_change (VALUE self, VALUE oldstate, VALUE newstate,
- VALUE child)
-{
- gst_bin_child_state_change (RGST_BIN (self),
- RVAL2GENUM (oldstate,
- GST_TYPE_ELEMENT_STATE_RETURN),
- RVAL2GENUM (newstate,
- GST_TYPE_ELEMENT_STATE_RETURN),
- RGST_ELEMENT (child));
- return self;
-}
+/* static VALUE */
+/* rb_gst_bin_each_by_if (VALUE self, VALUE klass) */
+/* { */
+/* return rb_ary_yield (rb_gst_bin_get_all_by_if (self, klass)); */
+/* } */
void
Init_gst_bin (void)
@@ -379,7 +328,7 @@
rb_define_method (c, "remove_all", rb_gst_bin_remove_all, 0);
rb_define_alias (c, "clear", "remove_all");
- rb_define_method (c, "elements", rb_gst_bin_get_elements, 0);
+ rb_define_method(c, "children", rb_gst_bin_get_children, 0);
rb_define_method (c, "each_element", rb_gst_bin_each_element, 0);
rb_define_method (c, "get_by_name", rb_gst_bin_get_by_name, 1);
@@ -387,22 +336,16 @@
rb_gst_bin_get_by_name_recurse_up, 1);
rb_define_alias (c, "[]", "get_by_name");
rb_define_method (c, "get_by_interface", rb_gst_bin_get_by_if, 1);
- rb_define_method (c, "get_all_by_interface", rb_gst_bin_get_all_by_if, 1);
- rb_define_method (c, "each_by_interface", rb_gst_bin_each_by_if, 1);
+ /* rb_define_method(c, "iterate_all_by_interface", rb_gst_bin_iterate_all_by_if, 1); */
+ /* rb_define_method (c, "each_by_interface", rb_gst_bin_each_by_if, 1); */
rb_define_method (c, "length", rb_gst_bin_length, 0);
rb_define_alias (c, "size", "length");
- rb_define_method (c, "iterate", rb_gst_bin_iterate, 0);
-
- rb_define_method (c, "clock", rb_gst_bin_get_clock, 0);
- rb_define_method (c, "auto_clock", rb_gst_bin_auto_clock, 0);
- rb_define_method (c, "use_clock", rb_gst_bin_use_clock, 1);
+ /* rb_define_method(c, "iterate_elements", rb_gst_bin_iterate_elements, 0); */
- rb_define_method (c, "sync_children_state", rb_gst_bin_sync_children_state,
- 0);
- rb_define_method (c, "child_state_change", rb_gst_bin_child_state_change,
- 3);
+ rb_define_method(c, "provided_clock", rb_gst_bin_get_provided_clock, 0);
+ rb_define_method(c, "set_provided_clock", rb_gst_bin_set_provided_clock, 1);
G_DEF_CLASS (GST_TYPE_BIN_FLAGS, "Flags", c);
G_DEF_CONSTANTS (c, GST_TYPE_BIN_FLAGS, "GST_BIN_");
Index: rbgstcaps.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstcaps.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- rbgstcaps.c 21 Mar 2005 20:58:16 -0000 1.14
+++ rbgstcaps.c 29 Sep 2007 14:19:16 -0000 1.15
@@ -158,7 +158,7 @@
static VALUE
rb_gst_caps_is_simple (VALUE self)
{
- return CBOOL2RVAL (gst_caps_is_simple (RGST_CAPS (self)));
+ return CBOOL2RVAL(GST_CAPS_IS_SIMPLE(RGST_CAPS (self)));
}
/*
@@ -288,23 +288,6 @@
}
/*
- * Method: simplify
- *
- * Creates a new Gst::Caps that represents the same set of formats as
-self, but
- * simpler. Component structures that are indentical are merged.
-Component
- * structures that have ranges or lists that can be merged are also merged.
- *
- * Returns: a new Gst::Caps object.
- */
-static VALUE
-rb_gst_caps_simplify (VALUE self)
-{
- return RGST_CAPS_NEW (gst_caps_simplify (RGST_CAPS (self)));
-}
-
-/*
* Method: simplify!
*
* Modifies the current caps inplace into a representation that represents
@@ -406,7 +389,6 @@
rb_define_method (c, "intersect", rb_gst_caps_intersect, 1);
rb_define_method (c, "union", rb_gst_caps_union, 1);
rb_define_method (c, "normalize", rb_gst_caps_normalize, 0);
- rb_define_method (c, "simplify", rb_gst_caps_simplify, 0);
rb_define_method (c, "simplify!", rb_gst_caps_do_simplify, 0);
rb_define_method (c, "replace!", rb_gst_caps_replace, 1);
rb_define_method (c, "to_string", rb_gst_caps_to_string, 0);
Index: rbgstclock.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstclock.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- rbgstclock.c 28 Jul 2004 17:15:45 -0000 1.8
+++ rbgstclock.c 29 Sep 2007 14:19:16 -0000 1.9
@@ -24,31 +24,6 @@
* Abstract class for global clocks.
*/
-/* Method: speed
- * Returns: the speed of the clock.
- */
-static VALUE
-rb_gst_clock_get_speed (VALUE self)
-{
- return DBL2NUM (gst_clock_get_speed (RGST_CLOCK (self)));
-}
-
-/*
- * Method: set_speed(speed)
- * speed: the speed of the clock.
- *
- * Sets the speed of the clock.
- * 1.0 is the default speed.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_clock_set_speed (VALUE self, VALUE speed)
-{
- gst_clock_set_speed (RGST_CLOCK (self), DBL2NUM (speed));
- return self;
-}
-
/* Method: resolution
* Returns: the accuracy of the clock.
*/
@@ -82,63 +57,6 @@
return ULL2NUM (gst_clock_get_time (RGST_CLOCK (self)));
}
-/* Method: active?
- * Returns: true if the clock is active, false otherwise.
- */
-static VALUE
-rb_gst_clock_is_active (VALUE self)
-{
- return CBOOL2RVAL (gst_clock_is_active (RGST_CLOCK (self)));
-}
-
-/*
- * Method: set_active(state)
- * state: a boolean value.
- *
- * Activates or deactivates the clock based on the active parameter.
- * As soon as the clock is activated, the time will start ticking.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_clock_set_active (VALUE self, VALUE active)
-{
- gst_clock_set_active (RGST_CLOCK (self), RVAL2CBOOL (active));
- return self;
-}
-
-/*
- * Method: reset!
- *
- * Reset the clock to time 0.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_clock_reset (VALUE self)
-{
- gst_clock_reset (RGST_CLOCK (self));
- return self;
-}
-
-/*
- * Method: handle_discont(time)
- * time: time in nanoseconds.
- *
- * Notifies the clock of a discontinuity in time (nanoseconds).
- *
- * It is possible that the clock was not updated by this call because only
- * the first discontinuitity in the pipeline is honoured.
- *
- * Returns: true if the clock was updated, otherwise false.
- */
-static VALUE
-rb_gst_clock_handle_discont (VALUE self, VALUE time)
-{
- return CBOOL2RVAL (gst_clock_handle_discont (RGST_CLOCK (self),
- NUM2ULL (time)));
-}
-
/*
* Method: ==(clock)
* clock: a Gst::Clock object.
@@ -159,78 +77,14 @@
}
}
-/*
- * Method: event_time
- *
- * Gets the "event time" of a given clock. An event on the clock happens
- * whenever this method is called. This ensures that multiple events that
- * happen shortly after each other are treated as if they happened at the same
- * time. GStreamer uses to keep state changes of multiple elements in sync.
- *
- * Returns: the time of the event (in nanoseconds).
- */
-static VALUE
-rb_gst_clock_get_event_time (VALUE self)
-{
- return ULL2NUM (gst_clock_get_event_time (RGST_CLOCK (self)));
-}
-
-/*
- * Method: get_event_time_delay(delay)
- * delay: time before the event actually occurs (in nanoseconds).
- *
- * Gets the "event time" of a given clock. An event on the clock happens
- * whenever this method is called. This ensures that multiple events that
- * happen shortly after each other are treated as if they happened at the same
- * time. GStreamer uses to keep state changes of multiple elements in sync.
- *
- * When calling this method, the specified delay will be added to the current
- * time to produce the event time. This can be used for events that are
- * scheduled to happen at some point in the future.
- *
- * Returns: the time of the event (in nanoseconds).
- */
-static VALUE
-rb_gst_clock_get_event_time_delay (VALUE self, VALUE delay)
-{
- return ULL2NUM (gst_clock_get_event_time_delay (RGST_CLOCK (self),
- NUM2ULL (delay)));
-}
-
-/*
- * Method: next_id
- *
- * Gets the clock ID of the next event.
- *
- * Returns: the clock ID of the next event, or nil is no event is pending.
- */
-static VALUE
-rb_gst_clock_get_next_id (VALUE self)
-{
- GstClockID id = gst_clock_get_next_id (RGST_CLOCK (self));
-
- return id == NULL ? Qnil : RGST_CLOCK_ENTRY_NEW (id);
-}
-
void
Init_gst_clock (void)
{
VALUE c = G_DEF_CLASS (GST_TYPE_CLOCK, "Clock", mGst);
- rb_define_method (c, "speed", rb_gst_clock_get_speed, 0);
- rb_define_method (c, "set_speed", rb_gst_clock_set_speed, 1);
rb_define_method (c, "resolution", rb_gst_clock_get_resolution, 0);
rb_define_method (c, "set_resolution", rb_gst_clock_set_resolution, 1);
- rb_define_method (c, "active?", rb_gst_clock_is_active, 0);
- rb_define_method (c, "set_active", rb_gst_clock_set_active, 1);
rb_define_method (c, "time", rb_gst_clock_get_time, 0);
- rb_define_method (c, "event_time", rb_gst_clock_get_event_time, 0);
- rb_define_method (c, "get_event_time_delay",
- rb_gst_clock_get_event_time_delay, 1);
- rb_define_method (c, "next_id", rb_gst_clock_get_next_id, 0);
- rb_define_alias (c, "next_entry", "next_id");
- rb_define_method (c, "reset!", rb_gst_clock_reset, 0);
- rb_define_method (c, "handle_discont?", rb_gst_clock_handle_discont, 1);
rb_define_method (c, "==", rb_gst_clock_is_equal, 1);
G_DEF_CLASS (GST_TYPE_CLOCK_FLAGS, "Flags", c);
Index: rbgstclockentry.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstclockentry.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rbgstclockentry.c 8 Jul 2007 02:58:49 -0000 1.7
+++ rbgstclockentry.c 29 Sep 2007 14:19:16 -0000 1.8
@@ -207,20 +207,6 @@
return Qnil;
}
-/*
- * Method: unlock
- *
- * Unlocks the entry.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_clock_entry_unlock (VALUE self)
-{
- gst_clock_id_unlock (RGST_CLOCK_ENTRY (self));
- return self;
-}
-
/* Method: time
* Returns: the requested time of the entry, in nanoseconds.
*/
@@ -250,13 +236,13 @@
}
/* Method: status
- * Returns: the status of the entry (see Gst::ClockEntry::Status).
+ * Returns: the status of the entry (see Gst::ClockEntry::Return).
*/
static VALUE
rb_gst_clock_entry_get_status (VALUE self)
{
- return GENUM2RVAL (GST_CLOCK_ENTRY_STATUS (RGST_CLOCK_ENTRY (self)),
- GST_TYPE_CLOCK_ENTRY_STATUS);
+ return GENUM2RVAL(GST_CLOCK_ENTRY_STATUS(RGST_CLOCK_ENTRY (self)),
+ GST_TYPE_CLOCK_RETURN);
}
void
@@ -270,7 +256,6 @@
rb_define_method (c, "wait", rb_gst_clock_entry_wait, 0);
rb_define_method (c, "wait_async", rb_gst_clock_entry_wait_async, 0);
rb_define_method (c, "unschedule", rb_gst_clock_entry_unschedule, 0);
- rb_define_method (c, "unlock", rb_gst_clock_entry_unlock, 0);
rb_define_method (c, "clock", rb_gst_clock_entry_get_clock, 0);
rb_define_method (c, "time", rb_gst_clock_entry_get_time, 0);
rb_define_method (c, "interval", rb_gst_clock_entry_get_interval, 0);
@@ -278,6 +263,6 @@
G_DEF_CLASS (GST_TYPE_CLOCK_ENTRY_TYPE, "Type", c);
G_DEF_CONSTANTS (c, GST_TYPE_CLOCK_ENTRY_TYPE, "GST_CLOCK_ENTRY_");
- G_DEF_CLASS (GST_TYPE_CLOCK_ENTRY_STATUS, "Status", c);
- G_DEF_CONSTANTS (c, GST_TYPE_CLOCK_ENTRY_STATUS, "GST_CLOCK_ENTRY_");
+ G_DEF_CLASS (GST_TYPE_CLOCK_RETURN, "Return", c);
+ G_DEF_CONSTANTS (c, GST_TYPE_CLOCK_RETURN, "GST_CLOCK_");
}
Index: rbgstelement.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstelement.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- rbgstelement.c 6 Oct 2005 16:42:40 -0000 1.20
+++ rbgstelement.c 29 Sep 2007 14:19:17 -0000 1.21
@@ -39,10 +39,9 @@
static VALUE
rb_gst_element_set_state (VALUE self, VALUE value)
{
- const int state = RVAL2GENUM (value, GST_TYPE_ELEMENT_STATE);
-
- return GENUM2RVAL (gst_element_set_state (RGST_ELEMENT (self), state),
- GST_TYPE_ELEMENT_STATE_RETURN);
+ return GENUM2RVAL(gst_element_set_state(RGST_ELEMENT(self),
+ RVAL2GENUM(value, GST_TYPE_STATE)),
+ GST_TYPE_STATE_CHANGE_RETURN);
}
[...965 lines suppressed...]
-
G_DEF_SETTERS (c);
- G_DEF_CLASS (GST_TYPE_ELEMENT_STATE_RETURN, "StateReturn", c);
- G_DEF_CONSTANTS (c, GST_TYPE_ELEMENT_STATE_RETURN, "GST_");
- G_DEF_CLASS (GST_TYPE_ELEMENT_STATE, "State", c);
- G_DEF_CONSTANTS (c, GST_TYPE_ELEMENT_STATE, "GST_");
- G_DEF_CLASS (GST_TYPE_ELEMENT_FLAGS, "Types", c);
- G_DEF_CONSTANTS (c, GST_TYPE_ELEMENT_FLAGS, "GST_ELEMENT_");
+ G_DEF_CLASS(GST_TYPE_STATE, "State", c);
+ G_DEF_CONSTANTS(c, GST_TYPE_STATE, "GST_");
+ G_DEF_CLASS(GST_TYPE_STATE_CHANGE_RETURN, "StateChangeReturn", c);
+ G_DEF_CONSTANTS(c, GST_TYPE_STATE_CHANGE_RETURN, "GST_");
+ G_DEF_CLASS(GST_TYPE_STATE_CHANGE, "StateChange", c);
+ G_DEF_CONSTANTS(c, GST_TYPE_STATE_CHANGE, "GST_");
+ G_DEF_CLASS(GST_TYPE_ELEMENT_FLAGS, "Flags", c);
+ G_DEF_CONSTANTS(c, GST_TYPE_ELEMENT_FLAGS, "GST_ELEMENT_");
/*
* TODO:
Index: rbgstelementfactory.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstelementfactory.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rbgstelementfactory.c 4 Aug 2005 15:46:38 -0000 1.9
+++ rbgstelementfactory.c 29 Sep 2007 14:19:17 -0000 1.10
@@ -119,22 +119,28 @@
*
* Requests all pad templates of factory.
*
- * Returns: an array of Gst::PadTemplate objects.
+ * Returns: an array of Gst::PadTemplate objects.
*/
static VALUE
rb_gst_elementfactory_get_pad_templates (VALUE self)
{
- GstElementFactory *factory;
- GList *list;
- VALUE arr;
+ GstElementFactory *factory;
+ const GList *list;
+ VALUE arr;
- factory = RGST_ELEMENT_FACTORY (self);
- arr = rb_ary_new ();
- for (list = factory->padtemplates; list != NULL; list = g_list_next (list)) {
- GstPadTemplate *pad = GST_PAD_TEMPLATE (list->data);
- rb_ary_push (arr, RGST_PAD_TEMPLATE_NEW (pad));
- }
- return arr;
+ factory = RGST_ELEMENT_FACTORY(self);
+ for (list = gst_element_factory_get_static_pad_templates(factory);
+ list != NULL;
+ list = g_list_next(list)) {
+ GstStaticPadTemplate *pad = list->data;
+ rb_ary_push(arr,
+ rb_ary_new3(3,
+ CSTR2RVAL(pad->name_template),
+ GENUM2RVAL(pad->direction, GST_TYPE_PAD_DIRECTION),
+ GENUM2RVAL(pad->presence, GST_TYPE_PAD_PRESENCE)
+ /* RGST_CAPS_NEW(&(pad->static_caps.caps)) */));
+ }
+ return arr;
}
/*
Index: rbgstevent.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstevent.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- rbgstevent.c 6 Mar 2004 09:52:09 -0000 1.6
+++ rbgstevent.c 29 Sep 2007 14:19:17 -0000 1.7
@@ -23,23 +23,7 @@
/* Class: Gst::Event
* Event definitions.
*/
-
-/*
- * Class method: new(type)
- * type: an event type (see Gst::Event::Type).
- *
- * Allocates a new event of the given type.
- *
- * Returns: a newly allocated Gst::Event object.
- */
-static VALUE
-rb_gst_event_new (VALUE self, VALUE type)
-{
- GstEvent *event = gst_event_new (RVAL2GENUM (type, GST_TYPE_EVENT_TYPE));
- if (event != NULL)
- G_INITIALIZE (self, event);
- return Qnil;
-}
+VALUE rb_cGstEvent;
/* Method: src
* Returns: the source Gst::Object that generated this event.
@@ -66,13 +50,14 @@
Init_gst_event (void)
{
VALUE c = G_DEF_CLASS (GST_TYPE_EVENT, "Event", mGst);
-
- rb_define_method (c, "initialize", rb_gst_event_new, 1);
+
rb_define_method (c, "src", rb_gst_event_src, 0);
rb_define_method (c, "timestamp", rb_gst_event_timestamp, 0);
G_DEF_CLASS (GST_TYPE_EVENT_TYPE, "Type", c);
G_DEF_CONSTANTS (c, GST_TYPE_EVENT_TYPE, "GST_EVENT_");
- G_DEF_CLASS (GST_TYPE_EVENT_FLAG, "Flag", c);
- G_DEF_CONSTANTS (c, GST_TYPE_EVENT_FLAG, "GST_");
+ G_DEF_CLASS (GST_TYPE_EVENT_TYPE_FLAGS, "Flags", c);
+ G_DEF_CONSTANTS (c, GST_TYPE_EVENT_TYPE_FLAGS, "GST_EVENT_");
+
+ rb_cGstEvent = c;
}
Index: rbgsteventseek.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgsteventseek.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- rbgsteventseek.c 6 Mar 2004 09:52:09 -0000 1.6
+++ rbgsteventseek.c 29 Sep 2007 14:19:17 -0000 1.7
@@ -36,24 +36,33 @@
* Returns: a newly allocated Gst::EventSeek object.
*/
static VALUE
-rb_gst_eventseek_new (VALUE self, VALUE type, VALUE offset)
+rb_gst_event_seek_new(VALUE self, VALUE rate, VALUE format, VALUE flags,
+ VALUE start_type, VALUE start,
+ VALUE stop_type, VALUE stop)
{
- GstEvent *event = gst_event_new_seek (FIX2INT (type),
- NUM2ULL (offset));
- if (event != NULL)
- G_INITIALIZE (self, event);
- return Qnil;
+ GstEvent *event;
+
+ event = gst_event_new_seek(NUM2DBL(rate),
+ GENUM2RVAL(format, GST_TYPE_FORMAT),
+ GFLAGS2RVAL(flags, GST_TYPE_SEEK_FLAGS),
+ GENUM2RVAL(start_type, GST_TYPE_SEEK_TYPE),
+ NUM2LL(start),
+ GENUM2RVAL(stop_type, GST_TYPE_SEEK_TYPE),
+ NUM2LL(stop));
+ if (event != NULL)
+ G_INITIALIZE(self, event);
+ return Qnil;
}
void
Init_gst_eventseek (void)
{
- VALUE c = rb_define_class_under (mGst, "EventSeek", GTYPE2CLASS(GST_TYPE_EVENT));
-
- rb_define_method (c, "initialize", rb_gst_eventseek_new, 2);
+ VALUE c = rb_define_class_under(mGst, "EventSeek", rb_cGstEvent);
- G_DEF_CLASS (GST_TYPE_SEEK_TYPE, "Type", c);
- G_DEF_CONSTANTS (c, GST_TYPE_SEEK_TYPE, "GST_SEEK_");
+ rb_define_method(c, "initialize", rb_gst_event_seek_new, 7);
- cGstEventSeek = c;
+ G_DEF_CLASS(GST_TYPE_SEEK_TYPE, "Type", c);
+ G_DEF_CONSTANTS(c, GST_TYPE_SEEK_TYPE, "GST_SEEK_");
+
+ cGstEventSeek = c;
}
Index: rbgstformat.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstformat.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rbgstformat.c 6 Mar 2004 09:52:09 -0000 1.9
+++ rbgstformat.c 29 Sep 2007 14:19:17 -0000 1.10
@@ -72,15 +72,16 @@
static VALUE
rb_gst_format_each (VALUE self)
{
- const GList *list;
+ GstIterator *iter;
+ gpointer value;
- for (list = gst_format_get_definitions ();
- list != NULL;
- list = g_list_next (list)) {
- GstFormatDefinition *def = (GstFormatDefinition *) list->data;
- rb_yield (RGST_FORMAT_NEW (&(def->value)));
- }
- return Qnil;
+ iter = gst_format_iterate_definitions();
+ while (gst_iterator_next(iter, &value) == GST_ITERATOR_OK) {
+ GstFormatDefinition *def = (GstFormatDefinition *)value;
+ rb_yield(RGST_FORMAT_NEW(&(def->value)));
+ }
+ gst_iterator_free(iter);
+ return Qnil;
}
/* Method: type_id
Index: rbgstobject.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstobject.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rbgstobject.c 6 Mar 2004 09:52:09 -0000 1.5
+++ rbgstobject.c 29 Sep 2007 14:19:17 -0000 1.6
@@ -25,19 +25,6 @@
*/
/*
- * Method: destroyed?
- *
- * Checks if the Gst::Object::FLAG_DESTROYED flag is set on the object.
- *
- * Returns: true if the flag is set, false otherwise.
- */
-static VALUE
-rb_gst_object_is_destroyed (VALUE self)
-{
- return CBOOL2RVAL (GST_OBJECT_DESTROYED (RGST_OBJECT (self)));
-}
-
-/*
* Method: floating?
*
* Checks if the Gst::Object::FLAG_FLOATING flag is set on the object.
@@ -47,7 +34,7 @@
static VALUE
rb_gst_object_is_floating (VALUE self)
{
- return CBOOL2RVAL (GST_OBJECT_FLOATING (RGST_OBJECT (self)));
+ return CBOOL2RVAL(GST_OBJECT_IS_FLOATING(RGST_OBJECT(self)));
}
void
@@ -55,7 +42,6 @@
{
VALUE c = G_DEF_CLASS (GST_TYPE_OBJECT, "Object", mGst);
- rb_define_method(c, "destroyed?", rb_gst_object_is_destroyed, 0);
rb_define_method(c, "floating?", rb_gst_object_is_floating, 0);
G_DEF_CLASS (GST_TYPE_OBJECT_FLAGS, "Flags", c);
Index: rbgstpad.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstpad.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- rbgstpad.c 21 Mar 2005 23:15:51 -0000 1.17
+++ rbgstpad.c 29 Sep 2007 14:19:17 -0000 1.18
@@ -61,36 +61,6 @@
}
/*
- * Method: provides_formats?
- *
- * Checks if the pad supports formats not handled by
- * the default format dispatcher.
- *
- * Returns: true if supported, false otherwise.
- */
-static VALUE
-rb_gst_pad_provides_formats (VALUE self)
-{
- GstPad *pad = RGST_PAD (self);
- return CBOOL2RVAL (GST_RPAD_FORMATSFUNC (pad) != gst_pad_get_formats_default);
-}
-
-/*
- * Method: provides_event_masks?
- *
- * Checks if the pad supports event masks not handled by
- * the default event masks dispatcher.
- *
- * Returns: true if supported, false otherwise.
- */
-static VALUE
-rb_gst_pad_provides_event_masks (VALUE self)
-{
- GstPad *pad = RGST_PAD (self);
- return CBOOL2RVAL (GST_RPAD_EVENTMASKFUNC (pad) != gst_pad_get_event_masks_default);
-}
-
-/*
* Method: provides_query_types?
*
* Checks if the pad supports query types not handled by
@@ -102,53 +72,7 @@
rb_gst_pad_provides_query_types (VALUE self)
{
GstPad *pad = RGST_PAD (self);
- return CBOOL2RVAL (GST_RPAD_QUERYTYPEFUNC (pad) != gst_pad_get_query_types_default);
-}
-
-/*
- * Method: formats
- *
- * Gets the list of supported formats from the pad.
- *
- * Returns: an array of Gst::Format objects.
- */
-static VALUE
-rb_gst_pad_get_formats (VALUE self)
-{
- const GstFormat *formats;
- VALUE arr;
-
- arr = rb_ary_new ();
- formats = gst_pad_get_formats (RGST_PAD (self));
-
- while (formats && *formats) {
- rb_ary_push (arr, RGST_FORMAT_NEW (formats));
- formats++;
- }
- return arr;
-}
-
-/*
- * Method: event_masks
- *
- * Gets the list of event masks from the pad.
- *
- * Returns: an array of Gst::EventMask objects.
- */
-static VALUE
-rb_gst_pad_get_event_masks (VALUE self)
-{
- const GstEventMask *masks;
- VALUE arr;
-
- arr = rb_ary_new ();
- masks = gst_pad_get_event_masks (RGST_PAD (self));
-
- while (masks && masks->type) {
- rb_ary_push (arr, RGST_EVENT_MASK_NEW (masks));
- masks++;
- }
- return arr;
+ return CBOOL2RVAL (GST_PAD_QUERYTYPEFUNC (pad) != gst_pad_get_query_types_default);
}
/*
@@ -175,34 +99,6 @@
}
/*
- * Method: each_format { |format| ... }
- *
- * Calls the block for each supported format from the pad, passing
- * a reference to the Gst::Format object as parameter.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_pad_each_format (VALUE self)
-{
- return rb_ary_yield (rb_gst_pad_get_formats (self));
-}
-
-/*
- * Method: each_event_mask { |event_mask| ... }
- *
- * Calls the block for each event mask from the pad, passing
- * a reference to the Gst::EventMask object as parameter.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_pad_each_event_mask (VALUE self)
-{
- return rb_ary_yield (rb_gst_pad_get_event_masks (self));
-}
-
-/*
* Method: each_query_type { |query_type| ... }
*
* Calls the block for each supported query from the pad, passing
@@ -231,25 +127,6 @@
GstPad *sinkpad = RGST_PAD (other_pad);
return CBOOL2RVAL (gst_pad_link (srcpad, sinkpad));
}
-
-/*
- * Method: link_filtered(other_pad, caps)
- * other_pad: a Gst::Pad.
- * caps: a Gst::Caps.
- *
- * Links the current pad (source) to an other pad (sink), constrained by
- * the given filter caps.
- *
- * Returns: true if the pads have been linked, false otherwise.
- */
-static VALUE
-rb_gst_pad_link_filtered (VALUE self, VALUE other_pad, VALUE rcaps)
-{
- GstPad *srcpad = RGST_PAD (self);
- GstPad *sinkpad = RGST_PAD (other_pad);
- GstCaps *caps = RGST_CAPS (rcaps);
- return CBOOL2RVAL (gst_pad_link_filtered (srcpad, sinkpad, caps));
-}
/*
* Method: unlink(other_pad)
@@ -269,59 +146,31 @@
}
/*
- * Method: disabled?
- *
- * Checks if the Gst::Pad::FLAG_DISABLED flag is set on the object.
- *
- * Returns: true if the flag is set, false otherwise.
- */
-static VALUE
-rb_gst_pad_is_disabled (VALUE self)
-{
- return CBOOL2RVAL (GST_FLAG_IS_SET (RGST_PAD (self), GST_PAD_DISABLED));
-}
-
-/*
- * Method: negotiating?
- *
- * Checks if the Gst::Pad::FLAG_NEGOTIATING flag is set on the object.
- *
- * Returns: true if the flag is set, false otherwise.
- */
-static VALUE
-rb_gst_pad_is_negotiating (VALUE self)
-{
- return CBOOL2RVAL (GST_FLAG_IS_SET (RGST_PAD (self), GST_PAD_NEGOTIATING));
-}
-
-/*
- * Method: query(query_type, format=Gst::Format::DEFAULT)
- * query_type: a query type (see Gst::QueryType::Type).
- * format: a format (see Gst::Format::Type).
+ * Method: query(query)
+ * query: a query (see Gst::Query).
*
* Performs a query on the pad.
*
* Returns: the query result value, or nil if the query could not be performed.
*/
-static VALUE
-rb_gst_pad_query (int argc, VALUE *argv, VALUE self)
-{
- VALUE query_type, format;
- GstFormat gstformat;
- gint64 value;
+/* static VALUE */
+/* rb_gst_pad_query(VALUE self, VALUE query) */
+/* { */
+/* GstFormat gstformat; */
+/* gint64 value; */
- rb_scan_args (argc, argv, "11", &query_type, &format);
- gstformat = NIL_P (format) ? GST_FORMAT_DEFAULT : RVAL2GENUM (format, GST_TYPE_FORMAT);
+/* rb_scan_args (argc, argv, "11", &query_type, &format); */
+/* gstformat = NIL_P (format) ? GST_FORMAT_DEFAULT : RVAL2GENUM (format, GST_TYPE_FORMAT); */
- if (gst_pad_query (RGST_PAD(self),
- RVAL2GENUM (query_type, GST_TYPE_QUERY_TYPE),
- &gstformat,
- &value)) {
- format = GENUM2RVAL (gstformat, GST_TYPE_FORMAT);
- return ULL2NUM (value);
- }
- return Qnil;
-}
+/* if (gst_pad_query (RGST_PAD(self), */
+/* RVAL2GENUM (query_type, GST_TYPE_QUERY_TYPE), */
+/* &gstformat, */
+/* &value)) { */
+/* format = GENUM2RVAL (gstformat, GST_TYPE_FORMAT); */
+/* return ULL2NUM (value); */
+/* } */
+/* return Qnil; */
+/* } */
/*
* Method: send_event(event)
@@ -363,21 +212,12 @@
rb_define_method (c, "direction", rb_gst_pad_get_direction, 0);
rb_define_method (c, "name", rb_gst_pad_get_name, 0);
rb_define_method (c, "pad_template", rb_gst_pad_get_padtemplate, 0);
- rb_define_method (c, "provides_formats?", rb_gst_pad_provides_formats, 0);
- rb_define_method (c, "provides_event_masks?", rb_gst_pad_provides_event_masks, 0);
rb_define_method (c, "provides_query_types?", rb_gst_pad_provides_query_types, 0);
- rb_define_method (c, "formats", rb_gst_pad_get_formats, 0);
- rb_define_method (c, "event_masks", rb_gst_pad_get_event_masks, 0);
rb_define_method (c, "query_types", rb_gst_pad_get_query_types, 0);
- rb_define_method (c, "each_format", rb_gst_pad_each_format, 0);
- rb_define_method (c, "each_event_mask", rb_gst_pad_each_event_mask, 0);
rb_define_method (c, "each_query_type", rb_gst_pad_each_query_type, 0);
rb_define_method (c, "link", rb_gst_pad_link, 1);
- rb_define_method (c, "link_filtered", rb_gst_pad_link_filtered, 2);
rb_define_method (c, "unlink", rb_gst_pad_unlink, 1);
- rb_define_method (c, "disabled?", rb_gst_pad_is_disabled, 0);
- rb_define_method (c, "negotiating?", rb_gst_pad_is_negotiating, 0);
- rb_define_method (c, "query", rb_gst_pad_query, -1);
+ /* rb_define_method (c, "query", rb_gst_pad_query, 1); */
rb_define_method (c, "send_event", rb_gst_pad_send_event, 1);
rb_define_method (c, "caps", rb_gst_pad_get_caps, 0);
Index: rbgstplugin.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstplugin.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- rbgstplugin.c 21 Feb 2005 10:09:21 -0000 1.10
+++ rbgstplugin.c 29 Sep 2007 14:19:17 -0000 1.11
@@ -24,26 +24,6 @@
* Dynamically loadable Elements
*/
-static GstPlugin *
-plugin_copy (const GstPlugin* plugin)
-{
- GstPlugin *new_plugin;
- g_return_val_if_fail (plugin != NULL, NULL);
- new_plugin = g_new (GstPlugin, 1);
- *new_plugin = *plugin;
- return new_plugin;
-}
-
-GType
-gst_plugin_get_type (void) {
- static GType our_type = 0;
- if (our_type == 0)
- our_type = g_boxed_type_register_static ("GstPlugin",
- (GBoxedCopyFunc)plugin_copy,
- (GBoxedFreeFunc)g_free);
- return our_type;
-}
-
/* Method: loaded?
* Returns: true if the plugin is loaded into memory, false otherwise.
*/
@@ -54,46 +34,6 @@
return CBOOL2RVAL (gst_plugin_is_loaded (plugin));
}
-/*
- * Method: features
- *
- * Gets a list of all the features that this plugin provides.
- *
- * Returns: an array of Gst::PluginFeature objects.
- */
-static VALUE
-rb_gst_plugin_get_features (VALUE self)
-{
- GstPlugin *plugin;
- GList *list;
- VALUE arr;
-
- arr = rb_ary_new ();
- plugin = RGST_PLUGIN (self);
-
- for (list = gst_plugin_get_feature_list (plugin);
- list != NULL;
- list = g_list_next (list)) {
- GstPluginFeature *feature = GST_PLUGIN_FEATURE(list->data);
- rb_ary_push (arr, instanciate_pluginfeature (feature));
- }
- return arr;
-}
-
-/*
- * Method: each_feature { |plugin_feature| ... }
- *
- * Calls the block for each feature this plugin provides, passing
- * a reference to the Gst::PluginFeature object as parameter.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_plugin_each_feature (VALUE self)
-{
- return rb_ary_yield (rb_gst_plugin_get_features (self));
-}
-
/* Method: filename
* Returns: the filename where this plugin comes from.
*/
@@ -194,8 +134,6 @@
VALUE c = G_DEF_CLASS (GST_TYPE_PLUGIN, "Plugin", mGst);
rb_define_method (c, "loaded?", rb_gst_plugin_is_loaded, 0);
- rb_define_method (c, "features", rb_gst_plugin_get_features, 0);
- rb_define_method (c, "each_feature", rb_gst_plugin_each_feature, 0);
rb_define_method (c, "==", rb_gst_plugin_is_equal, 1);
rb_define_method (c, "filename", rb_gst_plugin_get_filename, 0);
Index: rbgstpluginfeature.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstpluginfeature.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rbgstpluginfeature.c 8 Feb 2005 16:52:48 -0000 1.9
+++ rbgstpluginfeature.c 29 Sep 2007 14:19:17 -0000 1.10
@@ -34,42 +34,11 @@
return CSTR2RVAL (GST_PLUGIN_FEATURE_NAME (feature));
}
-/*
- * Method: ensure_loaded
- *
- * Checks if the plugin containing the feature is loaded.
- * If not, the plugin will be loaded.
- *
- * Returns: a boolean indicating if the feature is loaded.
- */
-static VALUE
-rb_gst_pluginfeature_ensure_loaded (VALUE self)
-{
- return CBOOL2RVAL (gst_plugin_feature_ensure_loaded (
- RGST_PLUGIN_FEATURE (self)));
-}
-
-/*
- * Method: unload_thyself
- *
- * Unloads the feature. This will decrease the refcount in the
- * plugin and will eventually unload the plugin.
- *
- * Returns: self.
- */
-static VALUE
-rb_gst_pluginfeature_unload_thyself (VALUE self)
-{
- gst_plugin_feature_unload_thyself( RGST_PLUGIN_FEATURE (self));
- return self;
-}
-
gboolean
is_valid_pluginfeature_type (const GType type)
{
- return type == GST_TYPE_ELEMENT_FACTORY
- || type == GST_TYPE_INDEX_FACTORY
- || type == GST_TYPE_SCHEDULER_FACTORY;
+ return type == GST_TYPE_ELEMENT_FACTORY ||
+ type == GST_TYPE_INDEX_FACTORY;
}
VALUE
@@ -78,8 +47,6 @@
if (GST_IS_ELEMENT_FACTORY (feature))
return RGST_ELEMENT_FACTORY_NEW (feature);
- else if (GST_IS_SCHEDULER_FACTORY (feature))
- return RGST_SCHEDULER_FACTORY_NEW (feature);
else if (GST_IS_INDEX_FACTORY (feature))
return RGST_INDEX_FACTORY_NEW (feature);
else if (GST_IS_TYPE_FIND_FACTORY (feature))
@@ -96,6 +63,4 @@
{
VALUE c = G_DEF_CLASS (GST_TYPE_PLUGIN_FEATURE, "PluginFeature", mGst);
rb_define_method (c, "name", rb_gst_pluginfeature_get_name, 0);
- rb_define_method (c, "ensure_loaded", rb_gst_pluginfeature_ensure_loaded, 0);
- rb_define_method (c, "unload_thyself", rb_gst_pluginfeature_unload_thyself, 0);
}
Index: rbgstquerytype.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstquerytype.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- rbgstquerytype.c 6 Mar 2004 09:52:09 -0000 1.9
+++ rbgstquerytype.c 29 Sep 2007 14:19:17 -0000 1.10
@@ -72,16 +72,16 @@
static VALUE
rb_gst_querytype_each (VALUE self)
{
- const GList *list;
+ GstIterator *iter;
+ gpointer value;
- for (list = gst_query_type_get_definitions ();
- list != NULL;
- list = g_list_next (list))
- {
- GstQueryTypeDefinition *def = (GstQueryTypeDefinition *) list->data;
- rb_yield (RGST_QUERY_TYPE_NEW (&(def->value)));
- }
- return Qnil;
+ iter = gst_query_type_iterate_definitions();
+ while (gst_iterator_next(iter, &value) == GST_ITERATOR_OK) {
+ GstQueryTypeDefinition *definition = value;
+ rb_yield(RGST_QUERY_TYPE_NEW(&(definition->value)));
+ }
+ gst_iterator_free(iter);
+ return Qnil;
}
/* Method: type_id
Index: rbgstregistry.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstregistry.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- rbgstregistry.c 6 Mar 2004 09:52:09 -0000 1.6
+++ rbgstregistry.c 29 Sep 2007 14:19:17 -0000 1.7
@@ -24,32 +24,39 @@
* Abstract class for managing plugins.
*/
+static VALUE
+rb_gst_registry_get_default(VALUE self)
+{
+ return RGST_REGISTRY_NEW(gst_registry_get_default());
+}
+
/*
- * Class method: plugins
+ * Method: plugins
*
* Gets a list of all plugins in the pool.
*
* Returns: an array of Gst::Plugin objects.
*/
static VALUE
-rb_gst_registry_get_plugins (VALUE self)
+rb_gst_registry_get_plugins(VALUE self)
{
- GList *list;
- VALUE arr;
+ GList *list, *node;
+ VALUE arr;
- arr = rb_ary_new ();
- for (list = gst_registry_pool_plugin_list ();
- list != NULL;
- list = g_list_next (list)) {
- GstPlugin *plugin = (GstPlugin *) list->data;
- rb_ary_push (arr, RGST_PLUGIN_NEW (plugin));
- }
- g_list_free (list);
- return arr;
-}
+ arr = rb_ary_new();
+ list = gst_registry_get_plugin_list(RGST_REGISTRY(self));
+ for (node = list;
+ node != NULL;
+ node = g_list_next(node)) {
+ GstPlugin *plugin = (GstPlugin *)node->data;
+ rb_ary_push(arr, RGST_PLUGIN_NEW(plugin));
+ }
+ g_list_free(list);
+ return arr;
+}
/*
- * Class method: each_plugin { |plugin| ... }
+ * Method: each_plugin { |plugin| ... }
*
* Calls the block for each plugin in the pool, passing a reference to
* the Gst::Plugin as parameter.
@@ -63,64 +70,8 @@
}
/*
- * Class method: find_plugin(name)
- * name: a plugin name.
- *
- * Finds the plugin with the given name in the registry.
- *
- * Returns: a reference to the Gst::Plugin object if found, otherwise
- * returns nil.
- */
-static VALUE
-rb_gst_registry_find_plugin (VALUE self, VALUE name)
-{
- GstPlugin *plugin = gst_registry_pool_find_plugin (RVAL2CSTR (name));
- return plugin != NULL
- ? RGST_PLUGIN_NEW (plugin)
- : Qnil;
-}
-
-/*
- * Class method: registries
- *
- * Gets a list of all registries in the pool.
- *
- * Returns: an Array of Gst::Registry objects.
- */
-static VALUE
-rb_gst_registry_get_registries (VALUE self)
-{
- GList *list;
- VALUE arr;
-
- arr = rb_ary_new ();
- for (list = gst_registry_pool_list ();
- list != NULL;
- list = g_list_next (list)) {
- GstRegistry *reg = (GstRegistry *) list->data;
- rb_ary_push (arr, RGST_REGISTRY_NEW (reg));
- }
- g_list_free (list);
- return arr;
-}
-
-/*
- * Class method: each { |registry| ... } -> nil
- *
- * Calls the block for each registries in the pool, passing a reference to
- * the Gst::Registry as parameter.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_registry_each (VALUE self)
-{
- return rb_ary_yield (rb_gst_registry_get_registries (self));
-}
-
-/*
- * Class method: get_features(feature_type)
- * feature_type: a feature type.
+ * Method: get_features(feature_type_or_plugin_name)
+ * feature_type_or_plugin_name: a feature type or plugin name.
*
* Gets a list of all plugin features of the given type in the pool.
*
@@ -130,28 +81,34 @@
* Returns: an array of Gst::PluginFeature objects.
*/
static VALUE
-rb_gst_registry_get_features (VALUE self, VALUE type)
+rb_gst_registry_get_features(VALUE self, VALUE type_or_plugin_name)
{
- GList *list;
- GType gtype;
- VALUE arr;
+ GList *list, *node;
+ GType gtype;
+ VALUE arr;
- arr = rb_ary_new ();
- gtype = CLASS2GTYPE (type);
- if (!is_valid_pluginfeature_type (gtype))
- rb_raise (rb_eArgError, "Invalid feature type.");
- else {
- for (list = gst_registry_pool_feature_list (gtype);
- list != NULL;
- list = g_list_next (list))
- rb_ary_push (arr, instanciate_pluginfeature (GST_PLUGIN_FEATURE (list->data)));
- g_list_free (list);
- }
- return arr;
+ if (RVAL2CBOOL(rb_obj_is_kind_of(type_or_plugin_name, rb_cString))) {
+ list = gst_registry_get_feature_list_by_plugin(RGST_REGISTRY(self),
+ RVAL2CSTR(type_or_plugin_name));
+ } else {
+ gtype = CLASS2GTYPE(type_or_plugin_name);
+ if (!is_valid_pluginfeature_type(gtype))
+ rb_raise (rb_eArgError, "Invalid feature type.");
+
+ list = gst_registry_get_feature_list(RGST_REGISTRY(self), gtype);
+ }
+
+ arr = rb_ary_new();
+ for (node = list; node != NULL; node = g_list_next(node)) {
+ rb_ary_push(arr, instanciate_pluginfeature(GST_PLUGIN_FEATURE(node->data)));
+ }
+ g_list_free (list);
+
+ return arr;
}
/*
- * Class method: each_feature(feature_type) { |plugin_feature| ... }
+ * Method: each_feature(feature_type) { |plugin_feature| ... }
*
* Calls the block for each plugin features of the given type in the pool,
* passing a reference to the Gst::PluginFeature as parameter.
@@ -168,195 +125,6 @@
}
/*
- * Class method: find_feature(feature_name, feature_type)
- * feature_name: a name of a feature.
- * feature_type: a type of a feature.
- *
- * Finds the plugin feature with the given name and type from the pool of
- * registries, as a Gst::PluginFeature reference.
- *
- * Valid features types are Gst::AutoplugFactory, Gst::ElementFactory,
- * Gst::IndexFactory, Gst::SchedulerFactory and Gst::TypeFactory.
- *
- * Returns: a Gst::PluginFeature reference, or nil if the named plugin
- * feature is not found.
- */
-static VALUE
-rb_gst_registry_find_feature (VALUE self, VALUE name, VALUE type)
-{
- GstPluginFeature *feature;
- GType gtype;
-
- gtype = CLASS2GTYPE (type);
- if (!is_valid_pluginfeature_type (gtype))
- rb_raise (rb_eArgError, "Invalid feature type.");
- feature = gst_registry_pool_find_feature (RVAL2CSTR (name),
- gtype);
- return feature != NULL
- ? instanciate_pluginfeature (feature)
- : Qnil;
-}
-
-/*
- * Class method: get_prefered(flags)
- * flags: registry flags (see Gst::Registry::Flags).
- *
- * Returns: the prefered registry with the given flags.
- */
-static VALUE
-rb_gst_registry_get_prefered (VALUE self, VALUE flags)
-{
- GstRegistry *registry = gst_registry_pool_get_prefered (RVAL2GENUM (flags, GST_TYPE_REGISTRY_FLAGS));
- return registry != NULL
- ? RGST_REGISTRY_NEW (registry)
- : Qnil;
-}
-
-/*
- * Class method: add(registry, priority)
- * registry: a Gst::Registry.
- * priority: the priority (as a Fixnum).
- *
- * Adds the registry to the pool with the given priority.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_registry_add_registry (VALUE self, VALUE registry, VALUE priority)
-{
- gst_registry_pool_add (RGST_REGISTRY (registry), FIX2INT (priority));
- return Qnil;
-}
-
-/*
- * Class method: remove(registry)
- * registry: a Gst::Registry.
- *
- * Removes the registry from the pool.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_registry_remove_registry (VALUE self, VALUE registry)
-{
- gst_registry_pool_remove (RGST_REGISTRY (registry));
- return Qnil;
-}
-
-/*
- * Class method: add_plugin(plugin)
- * plugin: a Gst::Plugin.
- *
- * Adds the plugin to the global pool of plugins.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_registry_add_plugin (VALUE self, VALUE plugin)
-{
- gst_registry_pool_add_plugin (RGST_PLUGIN (plugin));
- return Qnil;
-}
-
-/*
- * Class method: load_all
- *
- * Loads all the registries in the pool.
- * Registries with the Gst::Registry::DELAYED_LOADING flag on will not be loaded.
- *
- * Returns: always nil.
- */
-static VALUE
-rb_gst_registry_load_all (VALUE self)
-{
- gst_registry_pool_load_all ();
- return Qnil;
-}
-
-/* Method: name
- * Returns: the name of the registry.
- */
-static VALUE
-rb_gst_registry_get_name (VALUE self)
-{
- GstRegistry *reg = RGST_REGISTRY (self);
- return CSTR2RVAL (reg->name);
-}
-
-/* Method: details
- * Returns: some details about the registry, or nil
- * if the registry has no details.
- */
-static VALUE
-rb_gst_registry_get_details (VALUE self)
-{
- GstRegistry *reg = RGST_REGISTRY (self);
- return CSTR2RVAL (reg->details);
-}
-
-/* Method: loaded?
- * Returns: true if the registry is currently loaded, false otherwise.
- */
-static VALUE
-rb_gst_registry_is_loaded (VALUE self)
-{
- GstRegistry *reg = RGST_REGISTRY (self);
- return CBOOL2RVAL (gst_registry_is_loaded (reg));
-}
-
-/*
- * Method: load
- *
- * Loads the registry.
- *
- * Returns: true on success, otherwise false.
- */
-static VALUE
-rb_gst_registry_load (VALUE self)
-{
- return CBOOL2RVAL (gst_registry_load (RGST_REGISTRY (self)));
-}
-
-/*
- * Method: save
- *
- * Saves the contents of the registry.
- *
- * Returns: true on success, otherwise false.
- */
-static VALUE
-rb_gst_registry_save (VALUE self)
-{
- return CBOOL2RVAL (gst_registry_save (RGST_REGISTRY (self)));
-}
-
-/*
- * Method: rebuild
- *
- * Rebuilds the registry.
- *
- * Returns: true on success, otherwise false.
- */
-static VALUE
-rb_gst_registry_rebuild (VALUE self)
-{
- return CBOOL2RVAL (gst_registry_rebuild (RGST_REGISTRY (self)));
-}
-
-/*
- * Method: unload
- *
- * Unloads the registry.
- *
- * Returns: true on success, otherwise false.
- */
-static VALUE
-rb_gst_registry_unload (VALUE self)
-{
- return CBOOL2RVAL (gst_registry_unload (RGST_REGISTRY (self)));
-}
-
-/*
* Method: paths
*
* Gets a list of paths of the registry.
@@ -400,27 +168,13 @@
* The syntax of the path is specific to the registry.
* If the path has already been added, do nothing.
*
- * Returns: self.
- */
-static VALUE
-rb_gst_registry_add_path (VALUE self, VALUE path)
-{
- gst_registry_add_path (RGST_REGISTRY (self), RVAL2CSTR (path));
- return self;
-}
-
-/*
- * Method: clear_paths
- *
- * Clears the paths of the registry.
- *
- * Returns: self.
+ * Returns: nil.
*/
static VALUE
-rb_gst_registry_clear_paths (VALUE self)
+rb_gst_registry_add_path(VALUE self, VALUE path)
{
- gst_registry_clear_paths (RGST_REGISTRY (self));
- return self;
+ gst_registry_add_path(RGST_REGISTRY(self), RVAL2CSTR(path));
+ return Qnil;
}
/*
@@ -432,10 +186,10 @@
* Returns: true on success, false otherwise.
*/
static VALUE
-rb_gst_registry_add_plugin2 (VALUE self, VALUE plugin)
+rb_gst_registry_add_plugin(VALUE self, VALUE plugin)
{
- return CBOOL2RVAL (gst_registry_add_plugin (RGST_REGISTRY (self),
- RGST_PLUGIN (plugin)));
+ return CBOOL2RVAL(gst_registry_add_plugin(RGST_REGISTRY (self),
+ RGST_PLUGIN (plugin)));
}
/*
@@ -464,7 +218,7 @@
* otherwise returns nil.
*/
static VALUE
-rb_gst_registry_find_plugin2 (VALUE self, VALUE name)
+rb_gst_registry_find_plugin (VALUE self, VALUE name)
{
GstPlugin *plugin = gst_registry_find_plugin (RGST_REGISTRY (self),
RVAL2CSTR (name));
@@ -474,54 +228,6 @@
}
/*
- * Method: load_plugin(plugin)
- * plugin: a Gst::Plugin.
- *
- * Brings the specified plugin from the registry into memory.
- *
- * Returns: a code indicating the result (see Gst::Registry::Return).
- */
-static VALUE
-rb_gst_registry_load_plugin (VALUE self, VALUE plugin)
-{
- return GENUM2RVAL (gst_registry_load_plugin (RGST_REGISTRY (self),
- RGST_PLUGIN (plugin)),
- GST_TYPE_REGISTRY_RETURN);
-}
-
-/*
- * Method: unload_plugin(plugin)
- * plugin: a Gst::Plugin.
- *
- * Unloads a plugin from the registry.
- *
- * Returns: a code indicating the result (see Gst::Registry::Return).
- */
-static VALUE
-rb_gst_registry_unload_plugin (VALUE self, VALUE plugin)
-{
- return GENUM2RVAL (gst_registry_unload_plugin (RGST_REGISTRY (self),
- RGST_PLUGIN (plugin)),
- GST_TYPE_REGISTRY_RETURN);
-}
-
-/*
- * Method: update_plugin(plugin)
- * plugin: a Gst::Plugin.
- *
- * Updates a plugin in the registry.
- *
- * Returns: a code indicating the result (see Gst::Registry::Return).
- */
-static VALUE
-rb_gst_registry_update_plugin (VALUE self, VALUE plugin)
-{
- return GENUM2RVAL (gst_registry_update_plugin (RGST_REGISTRY (self),
- RGST_PLUGIN (plugin)),
- GST_TYPE_REGISTRY_RETURN);
-}
-
-/*
* Method: find_feature(feature_name, feature_type)
* feature_name: a feature name.
* feature_type: a feature type.
@@ -535,7 +241,7 @@
* named plugin feature is not found.
*/
static VALUE
-rb_gst_registry_find_feature2 (VALUE self, VALUE name, VALUE type)
+rb_gst_registry_find_feature(VALUE self, VALUE name, VALUE type)
{
GstPluginFeature *feature;
GType gtype;
@@ -556,41 +262,17 @@
{
VALUE c = G_DEF_CLASS (GST_TYPE_REGISTRY, "Registry", mGst);
- rb_define_singleton_method (c, "plugins", rb_gst_registry_get_plugins, 0);
- rb_define_singleton_method (c, "each_plugin", rb_gst_registry_each_plugin, 0);
- rb_define_singleton_method (c, "find_plugin", rb_gst_registry_find_plugin, 1);
- rb_define_singleton_method (c, "add_plugin", rb_gst_registry_add_plugin, 1);
- rb_define_singleton_method (c, "each", rb_gst_registry_each, 0);
- rb_define_singleton_method (c, "registries", rb_gst_registry_get_registries, 0);
- rb_define_singleton_method (c, "add", rb_gst_registry_add_registry, 2);
- rb_define_singleton_method (c, "remove", rb_gst_registry_remove_registry, 1);
- rb_define_singleton_method (c, "load_all", rb_gst_registry_load_all, 0);
- rb_define_singleton_method (c, "get_features", rb_gst_registry_get_features, 1);
- rb_define_singleton_method (c, "each_feature", rb_gst_registry_each_feature, 1);
- rb_define_singleton_method (c, "find_feature", rb_gst_registry_find_feature, 2);
- rb_define_singleton_method (c, "get_prefered", rb_gst_registry_get_prefered, 1);
+ rb_define_singleton_method(c, "default", rb_gst_registry_get_default, 0);
- rb_define_method(c, "name", rb_gst_registry_get_name, 0);
- rb_define_method(c, "details", rb_gst_registry_get_details, 0);
- rb_define_method(c, "loaded?", rb_gst_registry_is_loaded, 0);
- rb_define_method(c, "load", rb_gst_registry_load, 0);
- rb_define_method(c, "save", rb_gst_registry_save, 0);
- rb_define_method(c, "rebuild", rb_gst_registry_rebuild, 0);
- rb_define_method(c, "unload", rb_gst_registry_unload, 0);
+ rb_define_method(c, "plugins", rb_gst_registry_get_plugins, 0);
+ rb_define_method(c, "each_plugin", rb_gst_registry_each_plugin, 0);
+ rb_define_method(c, "get_features", rb_gst_registry_get_features, 1);
+ rb_define_method(c, "each_feature", rb_gst_registry_each_feature, 1);
rb_define_method(c, "paths", rb_gst_registry_get_paths, 0);
rb_define_method(c, "each_path", rb_gst_registry_each_path, 0);
rb_define_method(c, "add_path", rb_gst_registry_add_path, 1);
- rb_define_method(c, "clear_paths", rb_gst_registry_clear_paths, 0);
- rb_define_method(c, "add_plugin", rb_gst_registry_add_plugin2, 1);
+ rb_define_method(c, "add_plugin", rb_gst_registry_add_plugin, 1);
rb_define_method(c, "remove_plugin", rb_gst_registry_remove_plugin, 1);
- rb_define_method(c, "find_plugin", rb_gst_registry_find_plugin2, 1);
- rb_define_method(c, "load_plugin", rb_gst_registry_load_plugin, 1);
- rb_define_method(c, "unload_plugin", rb_gst_registry_unload_plugin, 1);
- rb_define_method(c, "update_plugin", rb_gst_registry_update_plugin, 1);
- rb_define_method(c, "find_feature", rb_gst_registry_find_feature2, 2);
-
- G_DEF_CLASS (GST_TYPE_REGISTRY_FLAGS, "Flags", c);
- G_DEF_CONSTANTS (c, GST_TYPE_REGISTRY_FLAGS, "GST_REGISTRY_");
- G_DEF_CLASS (GST_TYPE_REGISTRY_RETURN, "Return", c);
- G_DEF_CONSTANTS (c, GST_TYPE_REGISTRY_RETURN, "GST_REGISTRY_");
+ rb_define_method(c, "find_plugin", rb_gst_registry_find_plugin, 1);
+ rb_define_method(c, "find_feature", rb_gst_registry_find_feature, 2);
}
Index: rbgststructure.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgststructure.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rbgststructure.c 29 Jun 2005 20:32:21 -0000 1.4
+++ rbgststructure.c 29 Sep 2007 14:19:17 -0000 1.5
@@ -26,7 +26,7 @@
*/
static gboolean
-foreach_pair (GQuark field_id, GValue *value, gpointer user_data)
+foreach_pair (GQuark field_id, const GValue *value, gpointer user_data)
{
VALUE hash;
Index: rbgsttagsetter.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgsttagsetter.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rbgsttagsetter.c 29 Jun 2005 20:32:21 -0000 1.3
+++ rbgsttagsetter.c 29 Sep 2007 14:19:17 -0000 1.4
@@ -36,10 +36,10 @@
static VALUE
rb_gst_tag_setter_merge (VALUE self, VALUE structure, VALUE merge_mode)
{
- gst_tag_setter_merge (RGST_TAG_SETTER (self),
- ruby_hash_to_gst_structure_with_name (structure, GST_TAG_LIST_STRUCTURE_NAME),
- RVAL2GENUM (merge_mode, GST_TYPE_TAG_MERGE_MODE));
- return self;
+ gst_tag_setter_merge_tags(RGST_TAG_SETTER(self),
+ ruby_hash_to_gst_structure_with_name(structure, GST_TAG_LIST_STRUCTURE_NAME),
+ RVAL2GENUM(merge_mode, GST_TYPE_TAG_MERGE_MODE));
+ return self;
}
void
Index: rbgstxoverlay.c
===================================================================
RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gstreamer/src/rbgstxoverlay.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- rbgstxoverlay.c 25 Apr 2005 21:35:57 -0000 1.1
+++ rbgstxoverlay.c 29 Sep 2007 14:19:17 -0000 1.2
@@ -21,7 +21,7 @@
#if defined(HAVE_GST_OVERLAY)
#include "rbgst.h"
-#include <gst/xoverlay/xoverlay.h>
+#include <gst/interfaces/xoverlay.h>
#define RGST_X_OVERLAY(o) (GST_X_OVERLAY(RVAL2GOBJ(o)))
@@ -33,21 +33,6 @@
}
static VALUE
-rb_gst_x_overlay_get_desired_size (VALUE self)
-{
- guint width, height;
- VALUE ary;
-
- gst_x_overlay_get_desired_size (RGST_X_OVERLAY (self), &width, &height);
-
- ary = rb_ary_new ();
- rb_ary_push (ary, INT2FIX (width));
- rb_ary_push (ary, INT2FIX (height));
-
- return ary;
-}
-
-static VALUE
rb_gst_x_overlay_expose (VALUE self)
{
gst_x_overlay_expose (RGST_X_OVERLAY (self));
@@ -61,27 +46,15 @@
return self;
}
-static VALUE
-rb_gst_x_overlay_got_desired_size (VALUE self, VALUE width, VALUE height)
-{
- gst_x_overlay_got_desired_size (RGST_X_OVERLAY (self),
- FIX2INT (width),
- FIX2INT (height));
- return self;
-}
-
void
Init_gst_x_overlay (void)
{
VALUE i = G_DEF_INTERFACE (GST_TYPE_X_OVERLAY, "XOverlay", mGst);
rb_define_method (i, "set_xwindow_id", rb_gst_x_overlay_set_xwindow_id, 1);
- rb_define_method (i, "desired_size", rb_gst_x_overlay_get_desired_size, 0);
rb_define_method (i, "expose", rb_gst_x_overlay_expose, 0);
rb_define_method (i, "got_xwindow_id", rb_gst_x_overlay_got_xwindow_id, 1);
- rb_define_method (i, "got_desired_size", rb_gst_x_overlay_got_desired_size,
- 2);
G_DEF_SETTERS (i);
}
--- rbgstcpu.c DELETED ---
--- rbgsteventmask.c DELETED ---
--- rbgsteventsegmentseek.c DELETED ---
--- rbgsteventsize.c DELETED ---
--- rbgstregistrypool.c DELETED ---
--- rbgstscheduler.c DELETED ---
--- rbgstschedulerfactory.c DELETED ---
--- rbgstthread.c DELETED ---
|