srtp: Move the enums to the common header

The types are used in both the encoder and decoder
This commit is contained in:
Olivier Crête 2013-06-28 20:32:36 -04:00
parent 4d7a186513
commit 47a6118fbc
5 changed files with 22 additions and 26 deletions

View file

@ -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

View file

@ -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:

View file

@ -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__ */

View file

@ -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 */

View file

@ -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;