summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-06-28 20:32:36 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-06-28 20:35:15 -0400
commit47a6118fbcb8019fa6b0b828fc64e2c7fdf613f3 (patch)
tree11bbfb6cd0e485d5d76428bc382e9bb85d2c24a1
parent4d7a186513a7ceb597e718ca876dee53874d8480 (diff)
downloadgstreamer-plugins-bad-47a6118fbcb8019fa6b0b828fc64e2c7fdf613f3.tar.gz
srtp: Move the enums to the common header
The types are used in both the encoder and decoder
-rw-r--r--ext/srtp/Makefile.am6
-rw-r--r--ext/srtp/gstsrtp.c4
-rw-r--r--ext/srtp/gstsrtp.h17
-rw-r--r--ext/srtp/gstsrtpdec.c8
-rw-r--r--ext/srtp/gstsrtpenc.h13
5 files changed, 22 insertions, 26 deletions
diff --git a/ext/srtp/Makefile.am b/ext/srtp/Makefile.am
index 778db02ee..5475d1d8b 100644
--- a/ext/srtp/Makefile.am
+++ b/ext/srtp/Makefile.am
@@ -16,11 +16,7 @@ libgstsrtp_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
libgstsrtp_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstsrtp_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
-srtp_headers = \
- gstsrtpdec.h \
- gstsrtpenc.h
-
-glib_enum_headers=$(srtp_headers)
+glib_enum_headers=gstsrtp.h
glib_enum_define=GST_SRTP
glib_gen_prefix=gst_srtp
glib_gen_basename=gstsrtp
diff --git a/ext/srtp/gstsrtp.c b/ext/srtp/gstsrtp.c
index c108de2cc..427db7cf5 100644
--- a/ext/srtp/gstsrtp.c
+++ b/ext/srtp/gstsrtp.c
@@ -172,8 +172,8 @@ rtcp_buffer_get_ssrc (GstBuffer * buf, guint32 * ssrc)
}
void
-set_crypto_policy_cipher_auth (guint cipher, guint auth,
- crypto_policy_t * policy)
+set_crypto_policy_cipher_auth (GstSrtpCipherType cipher,
+ GstSrtpAuthType auth, crypto_policy_t * policy)
{
switch (cipher) {
case GST_SRTP_CIPHER_AES_128_ICM:
diff --git a/ext/srtp/gstsrtp.h b/ext/srtp/gstsrtp.h
index e3f609a59..edf646749 100644
--- a/ext/srtp/gstsrtp.h
+++ b/ext/srtp/gstsrtp.h
@@ -49,6 +49,19 @@
#include <srtp/srtp.h>
+typedef enum
+{
+ GST_SRTP_CIPHER_NULL,
+ GST_SRTP_CIPHER_AES_128_ICM
+} GstSrtpCipherType;
+
+typedef enum
+{
+ GST_SRTP_AUTH_NULL,
+ GST_SRTP_AUTH_HMAC_SHA1_32,
+ GST_SRTP_AUTH_HMAC_SHA1_80
+} GstSrtpAuthType;
+
void gst_srtp_init_event_reporter (void);
gboolean gst_srtp_get_soft_limit_reached (void);
@@ -57,8 +70,8 @@ gboolean rtcp_buffer_get_ssrc (GstBuffer * buf, guint32 * ssrc);
const gchar *enum_nick_from_value (GType enum_gtype, gint value);
gint enum_value_from_nick (GType enum_gtype, const gchar *nick);
-void set_crypto_policy_cipher_auth (guint cipher, guint auth,
- crypto_policy_t * policy);
+void set_crypto_policy_cipher_auth (GstSrtpCipherType cipher,
+ GstSrtpAuthType auth, crypto_policy_t * policy);
#endif /* __GST_SRTP_H__ */
diff --git a/ext/srtp/gstsrtpdec.c b/ext/srtp/gstsrtpdec.c
index a60369ee4..2e4fbf25d 100644
--- a/ext/srtp/gstsrtpdec.c
+++ b/ext/srtp/gstsrtpdec.c
@@ -203,10 +203,10 @@ struct _GstSrtpDecSsrcStream
GstCaps *caps;
GstBuffer *key;
- guint rtp_cipher;
- guint rtp_auth;
- guint rtcp_cipher;
- guint rtcp_auth;
+ GstSrtpCipherType rtp_cipher;
+ GstSrtpAuthType rtp_auth;
+ GstSrtpCipherType rtcp_cipher;
+ GstSrtpAuthType rtcp_auth;
};
/* initialize the srtpdec's class */
diff --git a/ext/srtp/gstsrtpenc.h b/ext/srtp/gstsrtpenc.h
index 20653cadc..1482d5fea 100644
--- a/ext/srtp/gstsrtpenc.h
+++ b/ext/srtp/gstsrtpenc.h
@@ -66,19 +66,6 @@ G_BEGIN_DECLS
typedef struct _GstSrtpEnc GstSrtpEnc;
typedef struct _GstSrtpEncClass GstSrtpEncClass;
-typedef enum
-{
- GST_SRTP_CIPHER_NULL,
- GST_SRTP_CIPHER_AES_128_ICM
-} GstSrtpCipherType;
-
-typedef enum
-{
- GST_SRTP_AUTH_NULL,
- GST_SRTP_AUTH_HMAC_SHA1_32,
- GST_SRTP_AUTH_HMAC_SHA1_80
-} GstSrtpAuthType;
-
struct _GstSrtpEnc
{
GstElement element;