Skip to content

Commit

Permalink
Merge pull request #30 from artofey/master
Browse files Browse the repository at this point in the history
New value type for Element.SetObject
  • Loading branch information
notedit authored Feb 15, 2022
2 parents 0a896ea + 5bd1510 commit 5bcccf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions element.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ func (e *Element) SetObject(name string, value interface{}) {
case *Structure:
structure := value.(*Structure)
C.X_gst_g_object_set_structure(e.GstElement, cname, structure.C)
case *Element:
element := value.(*Element)
C.X_gst_g_object_set_element(e.GstElement, cname, element.GstElement)

default:
panic(fmt.Errorf("SetObject: don't know how to set value for type %T", value))
}
Expand Down
4 changes: 4 additions & 0 deletions gst.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ void X_gst_g_object_set_structure(GstElement *e, const gchar* p_name, const GstS
g_object_set(G_OBJECT(e), p_name, p_value, NULL);
}

void X_gst_g_object_set_element(GstElement *e, const gchar* p_name, const GstElement *p_value) {
g_object_set(G_OBJECT(e), p_name, p_value, NULL);
}

void X_gst_g_object_setv(GObject *object, guint n_properties, const gchar *names[], const GValue value[]) {
//g_object_setv(object, n_properties, names, value);
}
Expand Down
1 change: 1 addition & 0 deletions gst.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern void X_gst_g_object_set_gdouble(GstElement *e, const gchar* p_name, gdoub
extern void X_gst_g_object_set_caps(GstElement *e, const gchar* p_name, const GstCaps *p_value);
extern void X_gst_g_object_set(GstElement* e, const gchar* p_name, const GValue* p_value);
extern void X_gst_g_object_set_structure(GstElement *e, const gchar* p_name, const GstStructure *p_value);
extern void X_gst_g_object_set_element(GstElement *e, const gchar* p_name, const GstElement *p_value);
extern void X_gst_g_object_setv(GObject* object, guint n_properties, const gchar* names[], const GValue value[]);
extern void X_gst_g_pad_set_string(GstPad *e, const gchar* p_name, gchar* p_value);
extern void X_gst_g_pad_set_int(GstPad *e, const gchar* p_name, gint p_value);
Expand Down

0 comments on commit 5bcccf3

Please sign in to comment.