mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
server: simpify channel function
This commit is contained in:
parent
ba4d65a673
commit
3315031bf6
1 changed files with 13 additions and 30 deletions
|
@ -498,9 +498,17 @@ gst_rtsp_server_set_property (GObject * object, guint propid,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare a server socket for @server and make it listen on the configured port */
|
/**
|
||||||
static GIOChannel *
|
* gst_rtsp_server_get_io_channel:
|
||||||
gst_rtsp_server_sink_init_send (GstRTSPServer * server)
|
* @server: a #GstRTSPServer
|
||||||
|
*
|
||||||
|
* Create a #GIOChannel for @server. The io channel will listen on the
|
||||||
|
* configured service.
|
||||||
|
*
|
||||||
|
* Returns: the GIOChannel for @server or NULL when an error occured.
|
||||||
|
*/
|
||||||
|
GIOChannel *
|
||||||
|
gst_rtsp_server_get_io_channel (GstRTSPServer * server)
|
||||||
{
|
{
|
||||||
GIOChannel *channel;
|
GIOChannel *channel;
|
||||||
int ret, sockfd;
|
int ret, sockfd;
|
||||||
|
@ -510,6 +518,8 @@ gst_rtsp_server_sink_init_send (GstRTSPServer * server)
|
||||||
struct linger linger;
|
struct linger linger;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL);
|
||||||
|
|
||||||
memset (&hints, 0, sizeof (struct addrinfo));
|
memset (&hints, 0, sizeof (struct addrinfo));
|
||||||
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
|
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
|
||||||
hints.ai_socktype = SOCK_STREAM; /* stream socket */
|
hints.ai_socktype = SOCK_STREAM; /* stream socket */
|
||||||
|
@ -761,33 +771,6 @@ accept_failed:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gst_rtsp_server_get_io_channel:
|
|
||||||
* @server: a #GstRTSPServer
|
|
||||||
*
|
|
||||||
* Create a #GIOChannel for @server.
|
|
||||||
*
|
|
||||||
* Returns: the GIOChannel for @server or NULL when an error occured.
|
|
||||||
*/
|
|
||||||
GIOChannel *
|
|
||||||
gst_rtsp_server_get_io_channel (GstRTSPServer * server)
|
|
||||||
{
|
|
||||||
GIOChannel *channel;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL);
|
|
||||||
|
|
||||||
if (!(channel = gst_rtsp_server_sink_init_send (server)))
|
|
||||||
goto init_failed;
|
|
||||||
|
|
||||||
return channel;
|
|
||||||
|
|
||||||
init_failed:
|
|
||||||
{
|
|
||||||
GST_ERROR_OBJECT (server, "failed to initialize server");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
watch_destroyed (GstRTSPServer * server)
|
watch_destroyed (GstRTSPServer * server)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue