tcp: Use the generic marshaller instead of generating custom ones

This commit is contained in:
Sebastian Dröge 2013-04-25 09:20:29 +02:00
parent e06cc5295a
commit 7f6e1bdfdb
7 changed files with 17 additions and 48 deletions

View file

@ -1,18 +1,5 @@
plugin_LTLIBRARIES = libgsttcp.la
# variables used for enum/marshal generation
glib_enum_headers = gsttcp.h
glib_enum_define = GST_TCP
glib_gen_prefix = gst_tcp
glib_gen_basename = gsttcp
include $(top_srcdir)/common/gst-glib-gen.mak
built_sources = gsttcp-enumtypes.c gsttcp-marshal.c
built_headers = gsttcp-enumtypes.h gsttcp-marshal.h
BUILT_SOURCES = $(built_sources) $(built_headers)
if HAVE_SYS_SOCKET_H
multifdsink_SOURCES = \
gstmultifdsink.c
@ -28,9 +15,6 @@ libgsttcp_la_SOURCES = \
gstmultisocketsink.c \
gsttcpserversrc.c gsttcpserversink.c
nodist_libgsttcp_la_SOURCES = \
$(built_sources)
libgsttcp_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GIO_CFLAGS)
libgsttcp_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgsttcp_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(GIO_LIBS)
@ -45,8 +29,6 @@ noinst_HEADERS = \
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = gsttcp-marshal.list
Android.mk: Makefile.am $(BUILT_SOURCES)
androgenizer \
-:PROJECT libgsttcp -:SHARED libgsttcp \

View file

@ -125,7 +125,6 @@
#endif
#include "gstmultifdsink.h"
#include "gsttcp-marshal.h"
#define NOT_IMPLEMENTED 0
@ -241,7 +240,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
g_signal_new ("add", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiFdSinkClass, add), NULL, NULL,
g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_INT);
/**
* GstMultiFdSink::add-full:
* @gstmultifdsink: the multifdsink element to emit this signal on
@ -261,7 +260,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
g_signal_new ("add-full", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiFdSinkClass, add_full), NULL, NULL,
gst_tcp_marshal_VOID__INT_ENUM_INT_UINT64_INT_UINT64, G_TYPE_NONE, 6,
g_cclosure_marshal_generic, G_TYPE_NONE, 6,
G_TYPE_INT, GST_TYPE_SYNC_METHOD, GST_TYPE_FORMAT, G_TYPE_UINT64,
GST_TYPE_FORMAT, G_TYPE_UINT64);
/**
@ -275,7 +274,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
g_signal_new ("remove", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiFdSinkClass, remove), NULL, NULL,
gst_tcp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_INT);
/**
* GstMultiFdSink::remove-flush:
* @gstmultifdsink: the multifdsink element to emit this signal on
@ -288,7 +287,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
g_signal_new ("remove-flush", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiFdSinkClass, remove_flush), NULL, NULL,
gst_tcp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_INT);
/**
* GstMultiFdSink::get-stats:
@ -310,7 +309,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
g_signal_new ("get-stats", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiFdSinkClass, get_stats), NULL, NULL,
gst_tcp_marshal_BOXED__INT, GST_TYPE_STRUCTURE, 1, G_TYPE_INT);
g_cclosure_marshal_generic, GST_TYPE_STRUCTURE, 1, G_TYPE_INT);
/**
* GstMultiFdSink::client-added:
@ -323,7 +322,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
*/
gst_multi_fd_sink_signals[SIGNAL_CLIENT_ADDED] =
g_signal_new ("client-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, gst_tcp_marshal_VOID__INT, G_TYPE_NONE,
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
1, G_TYPE_INT);
/**
* GstMultiFdSink::client-removed:
@ -341,7 +340,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
*/
gst_multi_fd_sink_signals[SIGNAL_CLIENT_REMOVED] =
g_signal_new ("client-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, gst_tcp_marshal_VOID__INT_ENUM,
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_INT, GST_TYPE_CLIENT_STATUS);
/**
* GstMultiFdSink::client-fd-removed:
@ -360,7 +359,7 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
*/
gst_multi_fd_sink_signals[SIGNAL_CLIENT_FD_REMOVED] =
g_signal_new ("client-fd-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, gst_tcp_marshal_VOID__INT,
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_INT);
gst_element_class_set_static_metadata (gstelement_class,

View file

@ -107,7 +107,6 @@
#include <gst/gst-i18n-plugin.h>
#include "gstmultihandlesink.h"
#include "gsttcp-marshal.h"
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@ -459,7 +458,7 @@ gst_multi_handle_sink_class_init (GstMultiHandleSinkClass * klass)
g_signal_new ("clear", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiHandleSinkClass, clear), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
g_cclosure_marshal_generic, G_TYPE_NONE, 0);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));

View file

@ -109,7 +109,6 @@
#include <string.h>
#include "gstmultisocketsink.h"
#include "gsttcp-marshal.h"
#ifndef G_OS_WIN32
#include <netinet/in.h>
@ -229,7 +228,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
g_signal_new ("add", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiSocketSinkClass, add), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_SOCKET);
g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_SOCKET);
/**
* GstMultiSocketSink::add-full:
* @gstmultisocketsink: the multisocketsink element to emit this signal on
@ -249,7 +248,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
g_signal_new ("add-full", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiSocketSinkClass, add_full), NULL, NULL,
gst_tcp_marshal_VOID__OBJECT_ENUM_ENUM_UINT64_ENUM_UINT64, G_TYPE_NONE, 6,
g_cclosure_marshal_generic, G_TYPE_NONE, 6,
G_TYPE_SOCKET, GST_TYPE_SYNC_METHOD, GST_TYPE_FORMAT, G_TYPE_UINT64,
GST_TYPE_FORMAT, G_TYPE_UINT64);
/**
@ -263,7 +262,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
g_signal_new ("remove", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiSocketSinkClass, remove), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_SOCKET);
g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_SOCKET);
/**
* GstMultiSocketSink::remove-flush:
* @gstmultisocketsink: the multisocketsink element to emit this signal on
@ -276,7 +275,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
g_signal_new ("remove-flush", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiSocketSinkClass, remove_flush), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_SOCKET);
g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_SOCKET);
/**
* GstMultiSocketSink::get-stats:
@ -296,7 +295,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
g_signal_new ("get-stats", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstMultiSocketSinkClass, get_stats), NULL, NULL,
gst_tcp_marshal_BOXED__OBJECT, GST_TYPE_STRUCTURE, 1, G_TYPE_SOCKET);
g_cclosure_marshal_generic, GST_TYPE_STRUCTURE, 1, G_TYPE_SOCKET);
/**
* GstMultiSocketSink::client-added:
@ -309,7 +308,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
*/
gst_multi_socket_sink_signals[SIGNAL_CLIENT_ADDED] =
g_signal_new ("client-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_OBJECT);
/**
* GstMultiSocketSink::client-removed:
@ -327,7 +326,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
*/
gst_multi_socket_sink_signals[SIGNAL_CLIENT_REMOVED] =
g_signal_new ("client-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, gst_tcp_marshal_VOID__OBJECT_ENUM,
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 2, G_TYPE_INT, GST_TYPE_CLIENT_STATUS);
/**
* GstMultiSocketSink::client-socket-removed:
@ -346,7 +345,7 @@ gst_multi_socket_sink_class_init (GstMultiSocketSinkClass * klass)
*/
gst_multi_socket_sink_signals[SIGNAL_CLIENT_SOCKET_REMOVED] =
g_signal_new ("client-socket-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 1, G_TYPE_SOCKET);
gst_element_class_set_static_metadata (gstelement_class,

View file

@ -1,8 +0,0 @@
VOID:STRING,UINT
VOID:OBJECT,ENUM
VOID:OBJECT,ENUM,ENUM,UINT64,ENUM,UINT64
BOXED:OBJECT
VOID:INT,ENUM,INT,UINT64,INT,UINT64
VOID:INT
VOID:INT,ENUM
BOXED:INT

View file

@ -23,7 +23,6 @@
#ifndef __GST_TCP_HELP_H__
#define __GST_TCP_HELP_H__
#include "gsttcp-enumtypes.h"
#include <gst/gst.h>
#define TCP_HIGHEST_PORT 65535

View file

@ -41,7 +41,6 @@
#include "gsttcp.h"
#include "gsttcpserversink.h"
#include "gsttcp-marshal.h"
#define TCP_BACKLOG 5