diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2007-12-10 19:07:52 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2007-12-10 19:07:52 -0500 |
commit | a48477633420b8be985b04180ab1402a4e52b035 (patch) | |
tree | c2515276cd3a7881943fbb4e52e395ae5d702bfc | |
parent | 20223761512b5023d2cf4f4fc3f14a6a92bf6c68 (diff) | |
download | farstream-a48477633420b8be985b04180ab1402a4e52b035.tar.gz |
Make the enum types be generated by glib-mkenums
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | gst-libs/gst/farsight/Makefile.am | 34 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-codec.c | 18 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-codec.h | 4 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-session.c | 1 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-stream.c | 20 | ||||
-rw-r--r-- | gst-libs/gst/farsight/fs-stream.h | 4 |
7 files changed, 35 insertions, 50 deletions
@@ -11,8 +11,8 @@ Makefile.in .#* *.stamp -gst-libs/gst/farsight/fs-marshal.c -gst-libs/gst/farsight/fs-marshal.h +gst-libs/gst/farsight/fs-marshal.[ch] +gst-libs/gst/farsight/fs-enum-types.[ch] docs/libs/farsight-libs-decl-list.txt docs/libs/farsight-libs-decl-list.txt.bak diff --git a/gst-libs/gst/farsight/Makefile.am b/gst-libs/gst/farsight/Makefile.am index bbbed0fe..0773b907 100644 --- a/gst-libs/gst/farsight/Makefile.am +++ b/gst-libs/gst/farsight/Makefile.am @@ -11,13 +11,16 @@ libgstfarsightinclude_HEADERS = \ fs-transmitter.h \ fs-stream-transmitter.h \ fs-plugin.h \ - fs-marshal.h + fs-marshal.h \ + fs-enum-types.h lib_LTLIBRARIES = libgstfarsight-@GST_MAJORMINOR@.la BUILT_SOURCES = \ fs-marshal.c \ - fs-marshal.h + fs-marshal.h \ + fs-enum-types.c \ + fs-enum-types.h libgstfarsight_@GST_MAJORMINOR@_la_SOURCES = \ fs-base-conference.c \ @@ -30,7 +33,8 @@ libgstfarsight_@GST_MAJORMINOR@_la_SOURCES = \ fs-transmitter.c \ fs-stream-transmitter.c \ fs-plugin.c \ - fs-marshal.c + fs-marshal.c \ + fs-enum-types.c EXTRA_libgstfarsight_@GST_MAJORMINOR@_la_SOURCES = fs-marshal.list @@ -49,3 +53,27 @@ libgstfarsight_@GST_MAJORMINOR@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) libgstfarsight_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) noinst_HEADERS = fs-marshal.h + +public_headers = fs-candidate.h \ + fs-codec.h \ + fs-participant.h \ + fs-session.h \ + fs-stream.h \ + fs-conference-iface.h + +fs-enum-types-h: $(fs_headers) Makefile + ( cd $(srcdir) && glib-mkenums \ + --fhead "#ifndef __FS_ENUM_TYPES_H__\n#define __FS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define FS_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __FS_ENUM_TYPES_H__ */" \ + $(public_headers) ) > fs-enum-types.h + +fs-enum-types-c: $(fs_headers) Makefile + ( cd $(srcdir) && glib-mkenums \ + --fhead "#include <fs-conference-iface.h>" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $(public_headers) ) > fs-enum-types.c diff --git a/gst-libs/gst/farsight/fs-codec.c b/gst-libs/gst/farsight/fs-codec.c index 5d78be65..356b7be2 100644 --- a/gst-libs/gst/farsight/fs-codec.c +++ b/gst-libs/gst/farsight/fs-codec.c @@ -71,24 +71,6 @@ fs_codec_list_get_type (void) return codec_list_type; } -GType -fs_media_type_get_type (void) -{ - static GType gtype = 0; - - if (gtype == 0) { - static const GEnumValue values[] = { - { FS_MEDIA_TYPE_AUDIO, "Audio (default)", "audio"}, - { FS_MEDIA_TYPE_VIDEO, "Video", "video"}, - { FS_MEDIA_TYPE_APPLICATION, "Applicaton", "application" }, - {0, NULL, NULL} - }; - - gtype = g_enum_register_static ("FsMediaType", values); - } - return gtype; -} - /** * fs_codec_new: * @id: codec identifier, if RTP this should be based on IETF RTP payload types diff --git a/gst-libs/gst/farsight/fs-codec.h b/gst-libs/gst/farsight/fs-codec.h index ba0e5b15..d115fd43 100644 --- a/gst-libs/gst/farsight/fs-codec.h +++ b/gst-libs/gst/farsight/fs-codec.h @@ -42,9 +42,6 @@ typedef struct _FsCodecPreference FsCodecPreference; #define FS_TYPE_CODEC_LIST \ (fs_codec_list_get_type()) -#define FS_TYPE_MEDIA_TYPE \ - (fs_media_type_get_type()) - /** * FsMediaType: * @FS_MEDIA_TYPE_AUDIO: A media type that encodes audio. @@ -130,7 +127,6 @@ struct _FsCodecPreference { GType fs_codec_get_type (void); GType fs_codec_list_get_type (void); -GType fs_media_type_get_type (void); FsCodec *fs_codec_new (int id, const char *encoding_name, diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c index 14e5ac6e..d656a2f9 100644 --- a/gst-libs/gst/farsight/fs-session.c +++ b/gst-libs/gst/farsight/fs-session.c @@ -46,6 +46,7 @@ #include "fs-session.h" #include "fs-codec.h" #include "fs-marshal.h" +#include "fs-enum-types.h" #include <gst/gst.h> /* Signals */ diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c index 6be4d161..07e89f2f 100644 --- a/gst-libs/gst/farsight/fs-stream.c +++ b/gst-libs/gst/farsight/fs-stream.c @@ -46,6 +46,7 @@ #include "fs-candidate.h" #include "fs-stream-transmitter.h" #include "fs-conference-iface.h" +#include "fs-enum-types.h" #include <gst/gst.h> @@ -102,25 +103,6 @@ static void fs_stream_set_property (GObject *object, static GObjectClass *parent_class = NULL; static guint signals[LAST_SIGNAL] = { 0 }; -GType -fs_stream_direction_get_type (void) -{ - static GType gtype = 0; - - if (gtype == 0) { - static const GEnumValue values[] = { - { FS_DIRECTION_NONE, "No data transfer (default)", "none"}, - { FS_DIRECTION_BOTH, "Both (send and receive)", "both"}, - { FS_DIRECTION_SEND, "Send only", "send" }, - { FS_DIRECTION_RECV, "Receive only", "recv" }, - {0, NULL, NULL} - }; - - gtype = g_enum_register_static ("FsStreamDirection", values); - } - return gtype; -} - static void fs_stream_class_init (FsStreamClass *klass) { diff --git a/gst-libs/gst/farsight/fs-stream.h b/gst-libs/gst/farsight/fs-stream.h index b7c0f4cd..439fcb10 100644 --- a/gst-libs/gst/farsight/fs-stream.h +++ b/gst-libs/gst/farsight/fs-stream.h @@ -33,8 +33,6 @@ G_BEGIN_DECLS -#define FS_TYPE_STREAM_DIRECTION (fs_stream_direction_get_type ()) - /** * FsStreamDirection: * @FS_DIRECTION_NONE: No direction specified @@ -53,8 +51,6 @@ typedef enum FS_DIRECTION_BOTH = FS_DIRECTION_SEND | FS_DIRECTION_RECV } FsStreamDirection; -GType fs_stream_direction_get_type (void); - /* TYPE MACROS */ #define FS_TYPE_STREAM \ (fs_stream_get_type()) |