Application Development Manual 1.8.3 example code does not compile

Tim Müller tim at centricular.com
Sun Sep 4 19:10:15 UTC 2016


On Fri, 2016-09-02 at 11:23 -0700, Andres Gonzalez wrote:

Hi Andres,

> I am referencing the GStreamer Application Development Manual 1.8.3,
> 2nd page of chapter 17. Example code of how to implement a custom
> GstTaskPool for use in the Stream Status message callbacks does not
> compile. There are some obvious typos that I corrected ( e.g.
> TEST_TYPE_RT_POOL is not defined, and I believe convention is to only
> capitalize the 1st letter of each of the name parts) but I still
> cannot get this code to compile. I get the following error:
> 
> cRTPStream.cpp:1387:16: error: variable or field ‘test_rt_pool_init’
> declared void
>  G_DEFINE_TYPE (TestRtPool, test_rt_pool, GST_TYPE_TASK_POOL);
> 
> The test_rt_pool_init() is indeed defined to return void. I am
> admittedly weak in the finer points of the GObject class system, but
> my references show that all of the GObject instance and class init
> functions should be defined to return void. So I am at a loss as to
> what is going on here.

It's hard to help here without knowing what changes you made exactly,
ie. seeing your code. You get a random error after making random
changes to the code :)

The code should compile just fine as-is if you add the following at the
beginning:

#include <gst/gst.h>

#define TEST_TYPE_RT_POOL test_rt_pool_get_type()

typedef struct {
  GstTaskPool parent;
} TestRTPool;

typedef struct {
  GstTaskPoolClass parent;
} TestRTPoolClass;

(It says it's only the implementation part after all :))

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference: 10-11 October 2016 in Berlin,
Germany


More information about the gstreamer-devel mailing list