<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hey Tom<div class=""><br class=""></div><div class="">GStreamer elements are GObjects under the hood. Here’s a summary of the GObject lifycicle:</div><div class=""><br class=""></div><div class=""><a href="https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gobject/howto-gobject.html" class="">https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gobject/howto-gobject.html</a></div><div class=""><br class=""></div><div class="">The constructor you’re looking for is gst_my_filter_init(). You want to initialize your struct there (or call your constructor).</div><div class=""><br class=""></div><div class="">Michael<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 1 Mar 2022, at 04:32, tom via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">In <a href="https://gstreamer.freedesktop.org/documentation/plugin-development/basics/boiler.html?gi-language=c" class="">https://gstreamer.freedesktop.org/documentation/plugin-development/basics/boiler.html?gi-language=c</a><div class=""><br class=""></div><div class="">there is a structure that contains information of a particular instance of an element:<br class="">(<span style="font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: inherit; word-spacing: normal;" class="">GstMyFilter)<br class=""><br class="">which later on in the tutorial gets used in for example:<br class=""><br class=""></span><pre class="gmail-language-c" style="box-sizing: border-box; overflow: auto; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; padding: 1em; margin-top: 0.5em; margin-bottom: 0.5em; line-height: 1.5; word-break: normal; background-color: rgb(245, 242, 240); border: 1px solid rgb(204, 204, 204); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;"><code class="gmail-language-c" style="box-sizing:border-box;font-family:Consolas,Monaco,"Andale Mono","Ubuntu Mono",monospace;font-size:inherit;padding:0px;background:none;border-radius:0px;word-spacing:normal;word-break:normal;line-height:1.5"><span class="gmail-token gmail-keyword" style="box-sizing:border-box;color:rgb(0,119,170)">static</span> gboolean
gst_my_filter_sink_event <span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">(</span>GstPad <span class="gmail-token gmail-operator" style="box-sizing:border-box;color:rgb(166,127,89);background:rgba(255,255,255,0.5)">*</span>pad<span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">,</span>
GstObject <span class="gmail-token gmail-operator" style="box-sizing:border-box;color:rgb(166,127,89);background:rgba(255,255,255,0.5)">*</span>parent<span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">,</span>
GstEvent <span class="gmail-token gmail-operator" style="box-sizing:border-box;color:rgb(166,127,89);background:rgba(255,255,255,0.5)">*</span>event<span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">)</span>
<span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">{</span>
GstMyFilter <span class="gmail-token gmail-operator" style="box-sizing:border-box;color:rgb(166,127,89);background:rgba(255,255,255,0.5)">*</span>filter <span class="gmail-token gmail-operator" style="box-sizing:border-box;color:rgb(166,127,89);background:rgba(255,255,255,0.5)">=</span> GST_MY_FILTER <span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">(</span>parent<span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">)</span><span class="gmail-token gmail-punctuation" style="box-sizing:border-box;color:rgb(153,153,153)">;</span>
</code></pre><br class="gmail-Apple-interchange-newline"><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div class="">but where does the structure 'GstMyFilter' get initialised ?<br class=""><br class="">I'm asking because i've added a default constructor in my structure, but it never gets called, but somehow the structure is initialised with 0's <br class=""><br class="">how can I ensure that the data structure's constructor is used ?<br class=""><br class="">kind regards,</div><div class="">tom</div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>