summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--farstream/fs-candidate.h6
-rw-r--r--farstream/fs-codec.h3
-rw-r--r--farstream/fs-conference.h2
-rw-r--r--farstream/fs-stream.h4
-rw-r--r--python/pyfarstream-filter.defs6
-rw-r--r--python/pyfarstream.defs104
-rw-r--r--python/pyfarstream.override8
-rw-r--r--python/pyfarstreammodule.c2
8 files changed, 112 insertions, 23 deletions
diff --git a/farstream/fs-candidate.h b/farstream/fs-candidate.h
index e5fa45f7..20866a85 100644
--- a/farstream/fs-candidate.h
+++ b/farstream/fs-candidate.h
@@ -47,7 +47,7 @@ G_BEGIN_DECLS
*
* An enum for the type of candidate used/reported
*/
-typedef enum _FsCandidateType
+typedef enum
{
FS_CANDIDATE_TYPE_HOST,
FS_CANDIDATE_TYPE_SRFLX,
@@ -63,7 +63,7 @@ typedef enum _FsCandidateType
*
* An enum for the base IP protocol
*/
-typedef enum _FsNetworkProtocol
+typedef enum
{
FS_NETWORK_PROTOCOL_UDP,
FS_NETWORK_PROTOCOL_TCP
@@ -78,7 +78,7 @@ typedef enum _FsNetworkProtocol
* This enum contains the component IDs defined in ICE-19
*/
-typedef enum _FsComponentType
+typedef enum
{
FS_COMPONENT_NONE = 0,
FS_COMPONENT_RTP = 1,
diff --git a/farstream/fs-codec.h b/farstream/fs-codec.h
index 9d8e716e..0cf448e6 100644
--- a/farstream/fs-codec.h
+++ b/farstream/fs-codec.h
@@ -50,8 +50,7 @@ typedef struct _FsFeedbackParameter FsFeedbackParameter;
*
* Enum used to signify the media type of a codec or stream.
*/
-typedef enum _FsMediaType
-{
+typedef enum {
FS_MEDIA_TYPE_AUDIO,
FS_MEDIA_TYPE_VIDEO,
FS_MEDIA_TYPE_LAST = FS_MEDIA_TYPE_VIDEO
diff --git a/farstream/fs-conference.h b/farstream/fs-conference.h
index e13c46e6..35d8f367 100644
--- a/farstream/fs-conference.h
+++ b/farstream/fs-conference.h
@@ -130,7 +130,7 @@ GType fs_conference_get_type (void);
* signal, from the Gst Bus or for error in the FS_ERROR domain in GErrors
*/
-typedef enum _FsError
+typedef enum
{
FS_ERROR_CONSTRUCTION = 1,
FS_ERROR_INTERNAL,
diff --git a/farstream/fs-stream.h b/farstream/fs-stream.h
index 9637a66a..226107a9 100644
--- a/farstream/fs-stream.h
+++ b/farstream/fs-stream.h
@@ -43,7 +43,7 @@ G_BEGIN_DECLS
* An enum for specifying the direction of a stream
*
*/
-typedef enum _FsStreamDirection
+typedef enum
{
FS_DIRECTION_NONE = 0,
FS_DIRECTION_SEND = 1<<0,
@@ -66,7 +66,7 @@ typedef enum _FsStreamDirection
* An stream using an ICE transmitter would use all of these.
*/
-typedef enum _FsStreamState
+typedef enum
{
FS_STREAM_STATE_FAILED,
FS_STREAM_STATE_DISCONNECTED,
diff --git a/python/pyfarstream-filter.defs b/python/pyfarstream-filter.defs
index a4697697..b606d872 100644
--- a/python/pyfarstream-filter.defs
+++ b/python/pyfarstream-filter.defs
@@ -1,9 +1,3 @@
-(define-interface Conference
- (in-module "Fs")
- (c-name "FsConference")
- (gtype-id "FS_TYPE_CONFERENCE")
-)
-
(define-boxed Codec
(in-module "Fs")
(c-name "FsCodec")
diff --git a/python/pyfarstream.defs b/python/pyfarstream.defs
index 61457b30..49380774 100644
--- a/python/pyfarstream.defs
+++ b/python/pyfarstream.defs
@@ -1,9 +1,3 @@
-(define-interface Conference
- (in-module "Fs")
- (c-name "FsConference")
- (gtype-id "FS_TYPE_CONFERENCE")
-)
-
(define-boxed Codec
(in-module "Fs")
(c-name "FsCodec")
@@ -23,6 +17,17 @@
; object definitions ...
;; Enumerations and flags ...
+(define-enum MediaType
+ (in-module "Fs")
+ (c-name "FsMediaType")
+ (gtype-id "FS_TYPE_MEDIA_TYPE")
+ (values
+ '("audio" "FS_MEDIA_TYPE_AUDIO")
+ '("video" "FS_MEDIA_TYPE_VIDEO")
+ '("last" "FS_MEDIA_TYPE_LAST")
+ )
+)
+
;; From fs-codec.h
@@ -214,6 +219,40 @@
; object definitions ...
;; Enumerations and flags ...
+(define-enum CandidateType
+ (in-module "Fs")
+ (c-name "FsCandidateType")
+ (gtype-id "FS_TYPE_CANDIDATE_TYPE")
+ (values
+ '("host" "FS_CANDIDATE_TYPE_HOST")
+ '("srflx" "FS_CANDIDATE_TYPE_SRFLX")
+ '("prflx" "FS_CANDIDATE_TYPE_PRFLX")
+ '("relay" "FS_CANDIDATE_TYPE_RELAY")
+ '("multicast" "FS_CANDIDATE_TYPE_MULTICAST")
+ )
+)
+
+(define-enum NetworkProtocol
+ (in-module "Fs")
+ (c-name "FsNetworkProtocol")
+ (gtype-id "FS_TYPE_NETWORK_PROTOCOL")
+ (values
+ '("udp" "FS_NETWORK_PROTOCOL_UDP")
+ '("tcp" "FS_NETWORK_PROTOCOL_TCP")
+ )
+)
+
+(define-enum ComponentType
+ (in-module "Fs")
+ (c-name "FsComponentType")
+ (gtype-id "FS_TYPE_COMPONENT_TYPE")
+ (values
+ '("none" "FS_COMPONENT_NONE")
+ '("rtp" "FS_COMPONENT_RTP")
+ '("rtcp" "FS_COMPONENT_RTCP")
+ )
+)
+
;; From fs-candidate.h
@@ -272,8 +311,35 @@
;; -*- scheme -*-
; object definitions ...
+(define-object Conference
+ (in-module "Fs")
+ (parent "GstBin")
+ (c-name "FsConference")
+ (gtype-id "FS_TYPE_CONFERENCE")
+)
+
;; Enumerations and flags ...
+(define-enum Error
+ (in-module "Fs")
+ (c-name "FsError")
+ (gtype-id "FS_TYPE_ERROR")
+ (values
+ '("construction" "FS_ERROR_CONSTRUCTION")
+ '("internal" "FS_ERROR_INTERNAL")
+ '("invalid-arguments" "FS_ERROR_INVALID_ARGUMENTS")
+ '("network" "FS_ERROR_NETWORK")
+ '("not-implemented" "FS_ERROR_NOT_IMPLEMENTED")
+ '("negotiation-failed" "FS_ERROR_NEGOTIATION_FAILED")
+ '("unknown-codec" "FS_ERROR_UNKNOWN_CODEC")
+ '("no-codecs" "FS_ERROR_NO_CODECS")
+ '("no-codecs-left" "FS_ERROR_NO_CODECS_LEFT")
+ '("connection-failed" "FS_ERROR_CONNECTION_FAILED")
+ '("disposed" "FS_ERROR_DISPOSED")
+ '("already-exists" "FS_ERROR_ALREADY_EXISTS")
+ )
+)
+
;; From fs-conference.h
@@ -518,6 +584,32 @@
;; Enumerations and flags ...
+(define-flags StreamDirection
+ (in-module "Fs")
+ (c-name "FsStreamDirection")
+ (gtype-id "FS_TYPE_STREAM_DIRECTION")
+ (values
+ '("none" "FS_DIRECTION_NONE")
+ '("send" "FS_DIRECTION_SEND")
+ '("recv" "FS_DIRECTION_RECV")
+ '("both" "FS_DIRECTION_BOTH")
+ )
+)
+
+(define-enum StreamState
+ (in-module "Fs")
+ (c-name "FsStreamState")
+ (gtype-id "FS_TYPE_STREAM_STATE")
+ (values
+ '("failed" "FS_STREAM_STATE_FAILED")
+ '("disconnected" "FS_STREAM_STATE_DISCONNECTED")
+ '("gathering" "FS_STREAM_STATE_GATHERING")
+ '("connecting" "FS_STREAM_STATE_CONNECTING")
+ '("connected" "FS_STREAM_STATE_CONNECTED")
+ '("ready" "FS_STREAM_STATE_READY")
+ )
+)
+
;; From fs-stream.h
diff --git a/python/pyfarstream.override b/python/pyfarstream.override
index e3bd2919..e60911d1 100644
--- a/python/pyfarstream.override
+++ b/python/pyfarstream.override
@@ -159,8 +159,8 @@ ignore
fs_codec_list_are_equal
%%
import gobject.GObject as PyGObject_Type
-import gst.GstObject as PyGstObject_Type
-import gst.GstElement as PyGstElement_Type
+import gst.Object as PyGstObject_Type
+import gst.Element as PyGstElement_Type
import gst.Pad as PyGstPad_Type
import gst.Bin as PyGstBin_Type
import gst.Iterator as PyGstIterator_Type
@@ -173,6 +173,8 @@ pyg_register_gtype_custom (FS_TYPE_CANDIDATE_LIST,
_fs_candidate_list_from_value,
_fs_candidate_list_to_value);
%%
+dynamicnamespace
+%%
override-slot FsCodec.tp_setattr
static int
_wrap_fs_codec_tp_setattr(PyObject *self, char *attr, PyObject *value)
@@ -896,7 +898,7 @@ _wrap_fs_stream_set_transmitter(PyGObject *self, PyObject *args,
Py_BEGIN_ALLOW_THREADS
g_object_get (pygobject_get (self), "session", &session, NULL);
st_type = fs_session_get_stream_transmitter_type (
- FS_SESSION (pygobject_get (self)), transmitter_name);
+ FS_SESSION (session), transmitter_name);
g_object_unref (session);
Py_END_ALLOW_THREADS
diff --git a/python/pyfarstreammodule.c b/python/pyfarstreammodule.c
index 07e3ac44..8286f61e 100644
--- a/python/pyfarstreammodule.c
+++ b/python/pyfarstreammodule.c
@@ -2,6 +2,7 @@
#include <farstream/fs-codec.h>
void fs_register_classes (PyObject *d);
+void fs_add_constants(PyObject *module, const gchar *strip_prefix);
DL_EXPORT(void) initfarstream(void);
extern PyMethodDef fs_functions[];
@@ -20,6 +21,7 @@ initfarstream(void)
PyModule_AddIntConstant (m, "CODEC_ID_DISABLE", FS_CODEC_ID_DISABLE);
fs_register_classes (d);
+ fs_add_constants (m, "FS_");
if (PyErr_Occurred ()) {
PyErr_Print();