mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +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_sink_init_send (GstRTSPServer * server)
|
||||
/**
|
||||
* gst_rtsp_server_get_io_channel:
|
||||
* @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;
|
||||
int ret, sockfd;
|
||||
|
@ -510,6 +518,8 @@ gst_rtsp_server_sink_init_send (GstRTSPServer * server)
|
|||
struct linger linger;
|
||||
#endif
|
||||
|
||||
g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL);
|
||||
|
||||
memset (&hints, 0, sizeof (struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
|
||||
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
|
||||
watch_destroyed (GstRTSPServer * server)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue