mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 15:18:21 +00:00
rtsp: Port to GIO
This commit is contained in:
parent
cfa7083e94
commit
aed2666b53
6 changed files with 343 additions and 529 deletions
|
@ -32,8 +32,8 @@ noinst_HEADERS = gstrtsp.h
|
|||
#gstrtspextwms.c
|
||||
#rtspextreal.c
|
||||
|
||||
libgstrtsp_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
libgstrtsp_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) $(WIN32_LIBS) $(HSTRERROR_LIBS)
|
||||
libgstrtsp_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GIO_CFLAGS)
|
||||
libgstrtsp_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) $(GIO_LIBS)
|
||||
libgstrtsp_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
|
||||
|
||||
BUILT_SOURCES = $(built_headers) $(built_sources)
|
||||
|
@ -76,6 +76,7 @@ GstRtsp-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_MAJORMINO
|
|||
--libtool="$(top_builddir)/libtool" \
|
||||
--pkg gstreamer-@GST_MAJORMINOR@ \
|
||||
--pkg gstreamer-sdp-@GST_MAJORMINOR@ \
|
||||
--pkg gio-2.0 \
|
||||
--pkg-export gstreamer-rtsp-@GST_MAJORMINOR@ \
|
||||
--add-init-section="gst_init(NULL,NULL);" \
|
||||
--output $@ \
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -49,6 +49,7 @@
|
|||
#include <gst/rtsp/gstrtspdefs.h>
|
||||
#include <gst/rtsp/gstrtspurl.h>
|
||||
#include <gst/rtsp/gstrtspmessage.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -61,12 +62,12 @@ typedef struct _GstRTSPConnection GstRTSPConnection;
|
|||
|
||||
/* opening/closing a connection */
|
||||
GstRTSPResult gst_rtsp_connection_create (const GstRTSPUrl *url, GstRTSPConnection **conn);
|
||||
GstRTSPResult gst_rtsp_connection_create_from_fd (gint fd,
|
||||
GstRTSPResult gst_rtsp_connection_create_from_socket (GSocket * socket,
|
||||
const gchar * ip,
|
||||
guint16 port,
|
||||
const gchar * initial_buffer,
|
||||
GstRTSPConnection ** conn);
|
||||
GstRTSPResult gst_rtsp_connection_accept (gint sock, GstRTSPConnection **conn);
|
||||
GstRTSPResult gst_rtsp_connection_accept (GSocket *socket, GstRTSPConnection **conn, GCancellable *cancellable);
|
||||
GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout);
|
||||
GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn);
|
||||
GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn);
|
||||
|
@ -117,8 +118,8 @@ GstRTSPUrl * gst_rtsp_connection_get_url (const GstRTSPConnection *
|
|||
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);
|
||||
GSocket * gst_rtsp_connection_get_read_socket (const GstRTSPConnection *conn);
|
||||
GSocket * gst_rtsp_connection_get_write_socket (const GstRTSPConnection *conn);
|
||||
|
||||
void gst_rtsp_connection_set_http_mode (GstRTSPConnection *conn,
|
||||
gboolean enable);
|
||||
|
|
|
@ -54,12 +54,6 @@
|
|||
|
||||
#include "gstrtspdefs.h"
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
struct rtsp_header
|
||||
{
|
||||
const gchar *name;
|
||||
|
@ -261,25 +255,10 @@ gst_rtsp_strresult (GstRTSPResult result)
|
|||
switch (result) {
|
||||
case GST_RTSP_OK:
|
||||
return g_strdup ("OK");
|
||||
#ifdef G_OS_WIN32
|
||||
case GST_RTSP_ESYS:
|
||||
return g_strdup ("System error");
|
||||
case GST_RTSP_ENET:
|
||||
{
|
||||
gchar *res, *msg;
|
||||
msg = g_win32_error_message (WSAGetLastError ());
|
||||
if (result == GST_RTSP_ESYS)
|
||||
res = g_strdup_printf ("System error: %s", msg);
|
||||
else
|
||||
res = g_strdup_printf ("Network error: %s", msg);
|
||||
g_free (msg);
|
||||
return res;
|
||||
}
|
||||
#else
|
||||
case GST_RTSP_ESYS:
|
||||
return g_strdup_printf ("System error: %s", g_strerror (errno));
|
||||
case GST_RTSP_ENET:
|
||||
return g_strdup_printf ("Network error: %s", hstrerror (h_errno));
|
||||
#endif
|
||||
return g_strdup ("Network error");
|
||||
case GST_RTSP_ERROR:
|
||||
return g_strdup ("Generic error");
|
||||
case GST_RTSP_EINVAL:
|
||||
|
|
|
@ -10,7 +10,7 @@ typelibdir=@abs_top_builddir@/gst-libs/gst/rtsp
|
|||
Name: GStreamer RTSP Library, Uninstalled
|
||||
Description: RTSP base classes and helper functions, uninstalled
|
||||
Version: @VERSION@
|
||||
Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-sdp-@GST_MAJORMINOR@
|
||||
Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-sdp-@GST_MAJORMINOR@ gio-2.0
|
||||
Libs: @abs_top_builddir@/gst-libs/gst/rtsp/libgstrtsp-@GST_MAJORMINOR@.la
|
||||
Cflags: -I@abs_top_srcdir@/gst-libs -I@abs_top_builddir@/gst-libs
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ typelibdir=${libdir}/girepository-1.0
|
|||
|
||||
Name: GStreamer RTSP Library
|
||||
Description: RTSP base classes and helper functions
|
||||
Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-sdp-@GST_MAJORMINOR@
|
||||
Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-sdp-@GST_MAJORMINOR@ gio-2.0
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgstrtsp-@GST_MAJORMINOR@
|
||||
Cflags: -I${includedir}
|
||||
|
|
Loading…
Reference in a new issue