media: add _get_element() method
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 24 Jun 2013 21:56:57 +0000 (23:56 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 24 Jun 2013 21:56:57 +0000 (23:56 +0200)
Add method to get the element used when creating the media.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703008

gst/rtsp-server/rtsp-media.c
gst/rtsp-server/rtsp-media.h

index 1cd14d5..e2c62ca 100644 (file)
@@ -439,6 +439,22 @@ gst_rtsp_media_new (GstElement * element)
 }
 
 /**
+ * gst_rtsp_media_get_element:
+ * @media: a #GstRTSPMedia
+ *
+ * Get the element that was used when constructing @media.
+ *
+ * Returns: a #GstElement. Unref after usage.
+ */
+GstElement *
+gst_rtsp_media_get_element (GstRTSPMedia * media)
+{
+  g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), NULL);
+
+  return gst_object_ref (media->priv->element);
+}
+
+/**
  * gst_rtsp_media_take_pipeline:
  * @media: a #GstRTSPMedia
  * @pipeline: (transfer full): a #GstPipeline
index 4dbe063..727cac3 100644 (file)
@@ -117,6 +117,7 @@ GType                 gst_rtsp_media_get_type         (void);
 
 /* creating the media */
 GstRTSPMedia *        gst_rtsp_media_new              (GstElement *element);
+GstElement *          gst_rtsp_media_get_element      (GstRTSPMedia *media);
 
 void                  gst_rtsp_media_take_pipeline    (GstRTSPMedia *media, GstPipeline *pipeline);