Re: GStreamer access to raw audio data

Hi, Torsten.

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.

$appsink->pull_buffer() seems to work though; It's what I'm mainly
interested in.

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.

My GStreamer::App repo is at

Zach Morgan

On 1/17/12, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
On 16.01.2012 17:06, Zach Morgan wrote:
First of all, Gtk2, Glib, Gstreamer are all phenomenal bindings. They
have truly turned a spaghetti nightmare into a gizmo paradise. Thank

Thanks for the feedback!

It doesn't look like it will be that easy for audio. 'convert-frame'
doesn't handle audio caps, and #gstreamer on freenode insists that an
appsink is the way to capture audio. I have a significant problem with
appsink, which is that it appsink methods don't appear to work. My
appsink object is instantiated by the GStreamer::ElementFactory, but
calling, for example, $appsink->pull_preroll() produces this error:

Can't locate object method "gst_app_sink_pull_preroll" via package
"Glib::Object::_Unregistered::GstAppSink" at lib/PDL/ line

I cannot comment on whether GstAppSink is the best way to achieve this.
  But assuming it is, the problem at hand is that we have no bindings
for it.  GstAppSink seems to be part of the libgstapp library, which in
turn is part of gst-plugins-base, i.e. not of gstreamer itself.  So I
think the best way to wrap GstAppSink would be to create a separate Perl
module GStreamer::App along the lines of the existing module
GStreamer::Interfaces.  I cannot promise to tackle this soon myself, but
I would definitely try to provide all the necessary help if someone else
wanted to give it a shot.

The code in your github repository looks fine to me.  Looking at
capture_image, though, I'm reminded of how awkward the
GStreamer::Structure stuff is.  The current bindings are basically a
one-to-one mapping of the C API.  But in this case I think a more
natural Perl wrapper would be handy.
gtk-perl-list mailing list
gtk-perl-list gnome org

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