diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-06 16:31:29 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-06 18:54:57 +0100 |
commit | 2cc1a6808d8963c47ca934ccc8a584b31bd92dbd (patch) | |
tree | 151cc4a7d066df8049be64820591009fe747401b | |
parent | 4d9bd60c67608000ca53ecbef5f830874b3179ea (diff) |
rtsp: Add methods for getting the read/write fds
API:gst_rtsp_connection_get_readfd()
API:gst_rtsp_connection_get_writefd()
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspconnection.c | 41 | ||||
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspconnection.h | 3 | ||||
-rw-r--r-- | win32/common/libgstrtsp.def | 2 |
3 files changed, 46 insertions, 0 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index df4c4d3b4..0cdc6c619 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -2395,6 +2395,47 @@ gst_rtsp_connection_set_ip (GstRTSPConnection * conn, const gchar * 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 * @tunneled: the new state diff --git a/gst-libs/gst/rtsp/gstrtspconnection.h b/gst-libs/gst/rtsp/gstrtspconnection.h index cfa6c37e6..372d4af75 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.h +++ b/gst-libs/gst/rtsp/gstrtspconnection.h @@ -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); diff --git a/win32/common/libgstrtsp.def b/win32/common/libgstrtsp.def index 9f10b8670..75c5544ef 100644 --- a/win32/common/libgstrtsp.def +++ b/win32/common/libgstrtsp.def @@ -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 |