# Gstreamer install plugins

**URL:** <https://www.ruby-forum.com/t/gstreamer-install-plugins/203374>\
**Category:** Ruby-Gnome 2\
**Created:** [February 18, 2011, 5:20pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374 "2011-02-18T17:20:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 18, 2011, 5:20pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/1 "2011-02-18T17:20:29Z")

</div>

Hi.

I am trying to implement gstreamer install plugins.  
Can someone take a look at the attached patch ?

Documentation can be seen at  
[http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstpbutilsinstallplugins.html](http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstpbutilsinstallplugins.html)

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [February 20, 2011, 9:52pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/2 "2011-02-20T21:52:33Z")

</div>

Hello,

Perhaps it could just be added to Ruby-gnome? If problems result from  
this users could email you? Gstreamer is nice but I remember it was not  
easy to keep maintaining it. (Documentation about Gstreamer is also not  
perfect yet in my opinion.)

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [February 21, 2011, 3:19pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/3 "2011-02-21T15:19:01Z")

</div>

2011/2/20 Marc H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Perhaps it could just be added to Ruby-gnome? If problems result from  
> this users could email you? Gstreamer is nice but I remember it was not  
> easy to keep maintaining it. (Documentation about Gstreamer is also not  
> perfect yet in my opinion.)

I hope these functions will be added to Ruby-gnome.  
If bugs are found in code I have written you can write me an email.

–  
Vincent C.

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [February 26, 2011, 11:09am UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/4 "2011-02-26T11:09:11Z")

</div>

Hi,

In [AANLkTi=removed\_email\_address@domain.invalid](mailto:AANLkTi=removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] gstreamer install plugins” on Fri, 18 Feb 2011  
17:19:53 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am trying to implement gstreamer install plugins.  
> Can someone take a look at the attached patch ?
> 
> Documentation can be seen at

> **[API reference](https://gstreamer.freedesktop.org/documentation/libs.html)**

1. It seems that RG\_DEF\_CONVERSION isn’t needed. Do you  
have a sample script that needes RG\_DEF\_CONVERSION?

2. GstInstallPluginsReturn in  
gst\_install\_plugins\_result\_func(), async() and sync()  
should convert by GENUM2RVAL(result,  
GST\_TYPE\_INSTALL\_PLUGINS\_RETURN) not INT2FIX().

3. block in async() shuold be guarded from GC by keeping a  
reference to block. You can use G\_RELATIVE(self, block).  
(You need to unreference the block after the block  
isn’t needed. But I don’t have English skil to explain  
how to do it. So it’s enough that just using  
G\_RELATIVE() for now. Hint: G\_CHILD\_ADD() and  
G\_CHILD\_REMOVE().)

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [February 27, 2011, 11:48pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/5 "2011-02-27T23:48:17Z")

</div>

2011/2/27 Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > > Documentation can be seen at  
> > > GST\_TYPE\_INSTALL\_PLUGINS\_RETURN) not INT2FIX().
> 
> I have used G\_RELATIVE. I guess best solution should :  
> use G\_CHILD\_ADD in place of current G\_RELATIVE,  
> unreference the block inside gst\_install\_plugins\_result\_func function  
> with G\_CHILD\_REMOVE macro.
> 
> It requires to pass both the block and mGstInstallPlugins to the  
> gst\_install\_plugins\_result\_func function. I guess it is possible by  
> using the last argument of the function.

mGstInstallPlugins does not need to be pass as an argument as it is  
also defined within gst\_install\_plugins\_result\_func function.  
What do you think of gst-install-plugins6.diff ?

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [February 27, 2011, 9:03pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/6 "2011-02-27T21:03:58Z")

</div>

2011/2/26 Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> >

> **[API reference](https://gstreamer.freedesktop.org/documentation/libs.html)**

> 1. It seems that RG\_DEF\_CONVERSION isn’t needed. Do you  
> have a sample script that needes RG\_DEF\_CONVERSION?

I think that you are right.

> 1. GstInstallPluginsReturn in  
> gst\_install\_plugins\_result\_func(), async() and sync()  
> should convert by GENUM2RVAL(result,  
> GST\_TYPE\_INSTALL\_PLUGINS\_RETURN) not INT2FIX().

Done.

> 1. block in async() shuold be guarded from GC by keeping a  
> reference to block. You can use G\_RELATIVE(self, block).  
> (You need to unreference the block after the block  
> isn’t needed. But I don’t have English skil to explain  
> how to do it. So it’s enough that just using  
> G\_RELATIVE() for now. Hint: G\_CHILD\_ADD() and  
> G\_CHILD\_REMOVE().)

I have used G\_RELATIVE. I guess best solution should :  
use G\_CHILD\_ADD in place of current G\_RELATIVE,  
unreference the block inside gst\_install\_plugins\_result\_func function  
with G\_CHILD\_REMOVE macro.

It requires to pass both the block and mGstInstallPlugins to the  
gst\_install\_plugins\_result\_func function. I guess it is possible by  
using the last argument of the function.

In gst-install-plugins5.diff I have try another solution. I store the  
block in an Array object which is an (hidden) instance variable of  
Gst::InstallPlugins. I delete the block from the array after use.

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 3, 2011, 1:29pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/7 "2011-03-03T13:29:14Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] gstreamer install plugins” on Sun, 27 Feb  
2011 23:47:53 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> mGstInstallPlugins does not need to be pass as an argument as it is  
> also defined within gst\_install\_plugins\_result\_func function.  
> What do you think of gst-install-plugins6.diff ?

Ah, you’re right.  
Could you commit gst-install-plugins6.diff instead of  
4.diff?

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 3, 2011, 1:27pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/8 "2011-03-03T13:27:21Z")

</div>

Hi,

In [AANLkTi=removed\_email\_address@domain.invalid](mailto:AANLkTi=removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] gstreamer install plugins” on Sun, 27 Feb  
2011 21:03:27 +0100,  
Vincent C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 1. GstInstallPluginsReturn in  
> > gst\_install\_plugins\_result\_func(), async() and sync()  
> > should convert by GENUM2RVAL(result,  
> > GST\_TYPE\_INSTALL\_PLUGINS\_RETURN) not INT2FIX().
> 
> Done.

Thanks!

> unreference the block inside gst\_install\_plugins\_result\_func function  
> with G\_CHILD\_REMOVE macro.

Yes!

> It requires to pass both the block and mGstInstallPlugins to the  
> gst\_install\_plugins\_result\_func function. I guess it is possible by  
> using the last argument of the function.

I think so too.

> In gst-install-plugins5.diff I have try another solution. I store the  
> block in an Array object which is an (hidden) instance variable of  
> Gst::InstallPlugins. I delete the block from the array after use.

It will work but we want to use common way to do the same  
thing. (keeping block’s reference)

I think that gst-install-plugins4.diff with comment about  
G\_CHILD\_ADD() and G\_CHILD\_REMOVE() is better patch in your 3  
patches. Please commit it!

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [March 3, 2011, 6:29pm UTC](https://www.ruby-forum.com/t/gstreamer-install-plugins/203374/9 "2011-03-03T18:29:09Z")

</div>

2011/3/3 Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Ah, you’re right.  
> Could you commit gst-install-plugins6.diff instead of  
> 4.diff?

Done.

> ## Thanks,
> 
> kou

–  
Vincent C.
