diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2019-09-02 14:52:53 +0200 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-01-03 20:50:27 +0000 |
commit | d1b3b19088c3921f1f1b07e7198700864bb35b5e (patch) | |
tree | 096441db12b846d36c52e8b45e99e52dc2c6a3a7 /ext/dash/gstmpdsegmenturlnode.c | |
parent | ac74b042ec263650d14d7acce6cfdbce483c3cd2 (diff) | |
download | gstreamer-plugins-bad-d1b3b19088c3921f1f1b07e7198700864bb35b5e.tar.gz |
dash: add set/get property for nodes
Add a way to set/get properties for given nodes:
- root
- baseurl
- representation
Diffstat (limited to 'ext/dash/gstmpdsegmenturlnode.c')
-rw-r--r-- | ext/dash/gstmpdsegmenturlnode.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/dash/gstmpdsegmenturlnode.c b/ext/dash/gstmpdsegmenturlnode.c index 2a3909159..ac13ec482 100644 --- a/ext/dash/gstmpdsegmenturlnode.c +++ b/ext/dash/gstmpdsegmenturlnode.c @@ -25,9 +25,46 @@ G_DEFINE_TYPE (GstMPDSegmentURLNode, gst_mpd_segment_url_node, GST_TYPE_MPD_NODE); +enum +{ + PROP_MPD_SEGMENT_URL_0, + PROP_MPD_SEGMENT_URL_MEDIA, +}; + /* GObject VMethods */ static void +gst_mpd_segment_url_node_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstMPDSegmentURLNode *self = GST_MPD_SEGMENT_URL_NODE (object); + switch (prop_id) { + case PROP_MPD_SEGMENT_URL_MEDIA: + g_free (self->media); + self->media = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gst_mpd_segment_url_node_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstMPDSegmentURLNode *self = GST_MPD_SEGMENT_URL_NODE (object); + switch (prop_id) { + case PROP_MPD_SEGMENT_URL_MEDIA: + g_value_set_string (value, self->media); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void gst_mpd_segment_url_node_finalize (GObject * object) { GstMPDSegmentURLNode *self = GST_MPD_SEGMENT_URL_NODE (object); @@ -79,8 +116,15 @@ gst_mpd_segment_url_node_class_init (GstMPDSegmentURLNodeClass * klass) m_klass = GST_MPD_NODE_CLASS (klass); object_class->finalize = gst_mpd_segment_url_node_finalize; + object_class->set_property = gst_mpd_segment_url_node_set_property; + object_class->get_property = gst_mpd_segment_url_node_get_property; m_klass->get_xml_node = gst_mpd_segment_url_get_xml_node; + + g_object_class_install_property (object_class, + PROP_MPD_SEGMENT_URL_MEDIA, g_param_spec_string ("media", + "media", "media description", NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static void |