Ruby Forum Ruby-Gnome 2 > [patch] Implement each_pad using a GstIterator

Posted by Sjoerd Simons (Guest)
on 29.03.2008 19:14
Attachment: each-pad.patch (3,2 KB)
(Received via mailing list)
Hi,

  See patch for details. What might need some thought is the behaviour 
when we
  have to resync. This patch just calls gst_iterator_resync, which might 
cause
  some elements to be yielded twice. The only good option i can think of 
to
  prevent this is throw an error when a resync is needed, so the ruby 
code can
  choose how to handle it.. But for most code this is probably a bit too 
much

  Sjoerd
Posted by Kouhei Sutou (Guest)
on 30.03.2008 00:52
(Received via mailing list)
Hi,

In <20080329181349.GA19917@beast.luon.net>
  "[ruby-gnome2-devel-en] [patch] Implement each_pad using a 
GstIterator" on Sat, 29 Mar 2008 19:13:49 +0100,
  Sjoerd Simons <sjoerd@luon.net> wrote:

>   See patch for details.

It was very happy for us if you considered to follow our
coding-style.

>     * src/rbgst-element.c: Implement Gst::Element.each_pad using a GstIterator to
>       ensure thread safety. Remove the get_pads function as it can't be
>       implemented safely.

Can we use gst_iterator_fold for get_pads?

>                          What might need some thought is the behaviour when we
>   have to resync. This patch just calls gst_iterator_resync, which might cause
>   some elements to be yielded twice. The only good option i can think of to
>   prevent this is throw an error when a resync is needed, so the ruby code can
>   choose how to handle it.. But for most code this is probably a bit too much

We will export other method (#pads_iterator ???) for the
case. #each_pad should keep being convenience.


Thanks,
--
kou