title: gstreamer : how do I pass structure as a argument to g_object_set()?
body: <p>Hi all I am currently able to set one property at a time to gstreamer plugin like as fallow.</p>
  
  <pre><code>GstElement *source = gst_bin_get_by_name (GST_BIN (m_pu_pipeline), "ue");
  
  g_object_set(G_OBJECT(source), "objectLeftEnabled", settings.m_b_left, NULL);           
  g_object_set(G_OBJECT(source), "objectRemovedEnabled", settings.m_b_removed, NULL);
  </code></pre>
  
  <p>But I want to set whole structure at a time like as fallow.</p>
  
  <pre><code>g_object_set (G_OBJECT (source), "lettremoved-settings", settings,  NULL); 
  </code></pre>
  
  <p>Following is What I have done so far to set structure directly to gstreamer plugin.</p>
  
  <pre><code>struct _LeftRemoved
  {
      bool left;
      bool removed;
  }; 
  
  //Declaration of copy and free function.
  static gpointer lr_copy (gpointer data);
  static void lr_free (gpointer data);
  
  G_DEFINE_BOXED_TYPE (_Leftremoved, lettremoved_settings,
                       lr_copy,
                       lr_free);  
  
  //Defination of copy and free.
  static gpointer lr_copy (gpointer data)
  {
    struct _LeftRemoved *details = (struct _LeftRemoved *)data;
    struct _LeftRemoved *copy = g_new (struct _LeftRemoved, 1);
  
    // We need to copy 
    copy-&gt;left= details-&gt;left;
    copy-&gt;removed = details-&gt;removed;
  
    g_print("Set Property From Copy left=%d\n",copy-&gt;left);
    g_print("Set Property From Copy removed=%d\n",copy-&gt;removed);
  
    return (gpointer) copy;
  }
  
  
  static void lr_free (gpointer data)
  {
          //code for free memory.
  }
  
  enum ePropertyType
  {
     PROP_OBJ_LR
  }
  
  static void gst_ivue_class_init (GstIVUEClass * klass)
  {  
    GObjectClass *gobject_class;
    GstElementClass *gstelement_class;
  
    gobject_class = (GObjectClass *) klass;
    gstelement_class = (GstElementClass *) klass;
  
    gobject_class-&gt;set_property = gst_ivue_set_property;
    gobject_class-&gt;get_property = gst_ivue_get_property;
    gobject_class-&gt;finalize = gst_ivue_finalize;
  
    GParamSpec *pspec;
    pspec = g_param_spec_boxed ("lettremoved_settings",     "lettremoved_settings", "Left Removed Settings",lettremoved_settings_get_type(), (GParamFlags)G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class, PROP_OBJ_LR, pspec);
  
  }
  
  static void gst_ivue_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)
  {
     GstIVUE *filter = GST_IVUE (object);
  
      switch (prop_id)
      {
         case PROP_OBJ_LR:
              g_boxed_copy(lettremoved_settings_get_type(),&amp;value);
              break;
         default:
              G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      }
  } 
  
  static void gst_ivue_get_property( GObject* object, guint prop_id, GValue* value, GParamSpec* pspec )
  {
       GstIVUE* filter = GST_IVUE (object);
       switch (prop_id) 
       {
           case PROP_OBJ_LR:
               // Also I don't know how to get value
       } 
  }
  </code></pre>
  
  <p>The above code run successfully but it is not setting value which is provided by me. 
  For example If I called g_object_set() function as :</p>
  
  <pre><code>   settings.left=true;
     settings.removed=true;
     g_object_set (G_OBJECT (source), "lettremoved-settings", settings,  NULL); 
  </code></pre>
  
  <p>Then in copy function, This code setting the default value as false for both left and removed.
  Please help me where I am going wrong.</p>