Hi,
Sorry for my late response…
We need more reviewers…
In [email protected]
“Re: [ruby-gnome2-devel-en] gstpbutilsinstallplugins” on Sat, 23 Oct
2010 20:38:36 +0200,
Vincent C. [email protected] wrote:
I joined 2 pathes this time.
gst-missing-plugins is to be applyed before gst-install-plugins.
gst-missing-plugins handles missing plugin Gst::MessageElement .
gst-install-plugins implements gstpbutilsinstallplugins.
OK. Can we process gst-missing-plugins before
gst-install-plugins? I want to process gst-install-plugins
after gst-missing-plugins is done.
2010/10/17 Kouhei S. [email protected]:
- Don’t define XXX2() function XXX2() name is too bad name.
- Use G_DEF_SETTERS(); for define XXX= method for set_XXX.
- …
G_DEF_SETTERS needs a class as a argument. I do not see how it can
define set_xid and xid= for Gst::InstallPlugins::Context class!
I define context_set_xid and context_set_xid2 functions for these
setters. How should I rename it if we keep these functions?
What about this?
- static VALUE
- context_set_xid2(VALUE self, VALUE xid)
- {
-
GstInstallPluginsContext *context;
-
-
context = (GstInstallPluginsContext *)RVAL2GOBJ(self);
-
gst_install_plugins_context_set_xid(context, NUM2INT(xid));/*
segfault on ruby exit */
- G_DEF_SETTERS(rb_cGstInstallPluginsContext);
We prefer to small patches with test cases instead of a
large patch. Could you split your patch with small path and
add tests for it? test/test_*.rb will help you.
How can I run tests ? make test does not work.
Please try “ruby test/run-test.rb”.
I had a test for Gst::InstallPlugins::Context#new method and
Gst::MessageElement#missing_plugin?
There is currently no ruby ways to create a missing plugin
Gst::MessageElement so I cannot test other methods.
I do not think I should test Gst::InstallPlugins functions (). Am I wrong ?
Can we use existing Gst::MessageElement? But talking about
Gst::MessageElement is the next step.
I think that we need more tests for added
methods. e.g. Gst::InstallPlugins::return#get_name. It will
not work well.
Should I try to define RARRAY2CSTRARRAY(VALUE, ??) macro or is it a
too specific to be reused ? (cf : comment in the patch)
Please define it in the same file for now.
Other comments:
- use CSTR2RVAL() instead of rb_str_new2().
static VALUE
return_get_name(VALUE self)
{
- return rb_str_new2(gst_install_plugins_return_get_name(
- return CSTR2RVAL(gst_install_plugins_return_get_name(
(GstInstallPluginsReturn)RVAL2GOBJ(self)));
}
- use RVAL2GENUM() instead of RVAL2GOBJ() for GEnum.
static VALUE
return_get_name(VALUE self)
{
return rb_str_new2(gst_install_plugins_return_get_name(
}
- don’t add “get_” prefix for no argument getter.
See:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Naming+and+Conversion+Rules
- rb_define_method(rb_cGstInstallPluginsReturn, “get_name”,
return_get_name,
- rb_define_method(rb_cGstInstallPluginsReturn, “name”,
return_get_name,
0);
-
don’t use deep class hierarchy. (nest level shuld be less
than 3.)
See:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Naming+and+Conversion+Rules
GstInstallPluginsReturn → Gst::InstallPluginsReturn
GstInstallPluginsContext → Gst::InstallPluginsContext
-
please clean style. (please confirm again.)
We need clean style for maintaining it.
rb_cGstInstallPluginsContext)))
rb_cGstInstallPluginsContext)))
…
}
rb_cGstInstallPluginsContext)))
…
}
static VALUE
context_initialize(VALUE self)
{
Thanks,
kou