rtsp: Add methods for getting the read/write fds
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 6 Mar 2009 15:31:29 +0000 (16:31 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 6 Mar 2009 17:54:57 +0000 (18:54 +0100)
API:gst_rtsp_connection_get_readfd()
API:gst_rtsp_connection_get_writefd()

gst-libs/gst/rtsp/gstrtspconnection.c
gst-libs/gst/rtsp/gstrtspconnection.h
win32/common/libgstrtsp.def

index df4c4d3b475abf24ef0641a235fc60abd712930c..0cdc6c619fb42d3197d072fb3497921801b42878 100644 (file)
@@ -2394,6 +2394,47 @@ gst_rtsp_connection_set_ip (GstRTSPConnection * conn, const gchar * ip)
   conn->ip = g_strdup (ip);
 }
 
+/**
+ * gst_rtsp_connection_get_readfd:
+ * @conn: a #GstRTSPConnection
+ *
+ * Get the file descriptor for reading.
+ *
+ * Returns: the file descriptor used for reading or -1 on error. The file
+ * descriptor remains valid until the connection is closed.
+ *
+ * Since: 0.10.23
+ */
+gint
+gst_rtsp_connection_get_readfd (const GstRTSPConnection * conn)
+{
+  g_return_val_if_fail (conn != NULL, -1);
+  g_return_val_if_fail (conn->readfd != NULL, -1);
+
+  return conn->readfd->fd;
+}
+
+/**
+ * gst_rtsp_connection_get_writefd:
+ * @conn: a #GstRTSPConnection
+ *
+ * Get the file descriptor for writing.
+ *
+ * Returns: the file descriptor used for writing or -1 on error. The file
+ * descriptor remains valid until the connection is closed.
+ *
+ * Since: 0.10.23
+ */
+gint
+gst_rtsp_connection_get_writefd (const GstRTSPConnection * conn)
+{
+  g_return_val_if_fail (conn != NULL, -1);
+  g_return_val_if_fail (conn->writefd != NULL, -1);
+
+  return conn->writefd->fd;
+}
+
+
 /**
  * gst_rtsp_connection_set_tunneled:
  * @conn: a #GstRTSPConnection
index cfa6c37e6d1cefa2c1ff7a8bf23629001e3b766c..372d4af754ed3b59368c6979305a0004cfb91c6b 100644 (file)
@@ -107,6 +107,9 @@ GstRTSPUrl *       gst_rtsp_connection_get_url       (const GstRTSPConnection *c
 const gchar *      gst_rtsp_connection_get_ip        (const GstRTSPConnection *conn);
 void               gst_rtsp_connection_set_ip        (GstRTSPConnection *conn, const gchar *ip);
 
+gint               gst_rtsp_connection_get_readfd    (const GstRTSPConnection *conn);
+gint               gst_rtsp_connection_get_writefd   (const GstRTSPConnection *conn);
+
 /* tunneling */
 void               gst_rtsp_connection_set_tunneled  (GstRTSPConnection *conn, gboolean tunneled);
 gboolean           gst_rtsp_connection_is_tunneled   (const GstRTSPConnection *conn);
index 9f10b8670097d36f72b021fb46c091d2b687baf8..75c5544ef7e987e745c63a3fb2d62113571550c4 100644 (file)
@@ -11,8 +11,10 @@ EXPORTS
        gst_rtsp_connection_flush
        gst_rtsp_connection_free
        gst_rtsp_connection_get_ip
+       gst_rtsp_connection_get_readfd
        gst_rtsp_connection_get_tunnelid
        gst_rtsp_connection_get_url
+       gst_rtsp_connection_get_writefd
        gst_rtsp_connection_is_tunneled
        gst_rtsp_connection_next_timeout
        gst_rtsp_connection_poll