Re: GStreamer access to raw audio data

On 19.01.2012 14:01, Zach Morgan wrote:
I took your advice and cannibalized GStreamer::Interfaces to create
bindings for Appsink and Appsrc. I'm not clear on how you would make
it nice and perlish, so any criticism is welcome. Also, I've never
used xs or created bindings before. I didn't touch the set_callbacks
methods, and the GstAppStreamType enum, which isn't even tested,
probably could have been handled better.

First of all: fantastic work!  That was really quick.  Comments:

• For an example of how to handle callbacks, look into GstBus.xs.

• Your gst_app_sink_pull_buffer_list wrapper lacks sv_2mortal() wrapped around newSVGstBuffer(), but otherwise it looks fine.

• For gst_app_src_get_latency, you could use xsubpp's OUTLIST, like so:

  void gst_app_src_get_latency (GstAppSrc *appsrc,
                                OUTLIST guint64 min,
                                OUTLIST guint64 max);

But note that there are some unresolved issues on win32 that seem to involve OUTLIST.¹ So if you want to be on the safe side, you have to do it manually, as is done for gst_clock_add_observation, for example.

¹ Search for "Gtk2::TreeView get_path_at_pos doesn't return array on Windows".

• Your handling of GstAppStreamType looks good. Its mention in the "maps" file will trigger all the magic.

And a question: Will GStreamer buffers leak every bit of data that
they're set with? I don't see what this comment is referring to.

Indeed, they do leak everything. I never used GStreamer::Buffer, so I never noticed. This commit should fix it: <>. Please test.

My GStreamer::App repo is at

Next stop: CPAN!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]