[gst-devel] <no subject>

arturo castro arturo at openframeworks.cc
Mon Jan 19 16:16:14 CET 2009


El lun, 19-01-2009 a las 14:47 +0000, Darren Staples escribió:
> If I were to use a GMainLoop/GMainContext approach instead, is there a
> Gstreamer event which would tell me every time a frame was ready to be
> processed ?

Hi Darren

in my code with no GMainLoop i use something like:

g_object_set (G_OBJECT (sink), "emit-signals", TRUE, "sync", TRUE, NULL);
g_signal_connect (sink, "new-buffer", G_CALLBACK (on_new_buffer_from_source), &gstData);

where on_new_buffer_from_source is a callback of the format:

static void
on_new_buffer_from_source (GstElement * elt, void * data){
  guint size;
  GstBuffer *buffer;

  //get the buffer from appsink
  buffer = gst_app_sink_pull_buffer (GST_APP_SINK (elt));
...

that is being notified everytime there's a new buffer to process, and
gstData a container to pass the raw pixels to the main app from the
callback (in my case needed as the data is inside an object)

also if you change "sync", TRUE by "sync", FALSE you'll get the frames
at the fastest speed the system can. in your case being raw video i
suppose it won' matter anyway

ciao

//------------------------------------------
arturo castro

oF core developer
barcelona





More information about the gstreamer-devel mailing list