1 /* 2 * Copyright (c) 2014, Ericsson AB. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without modification, 5 * are permitted provided that the following conditions are met: 6 * 7 * 1. Redistributions of source code must retain the above copyright notice, this 8 * list of conditions and the following disclaimer. 9 * 10 * 2. Redistributions in binary form must reproduce the above copyright notice, this 11 * list of conditions and the following disclaimer in the documentation and/or other 12 * materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 18 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 23 * OF SUCH DAMAGE. 24 */ 25 26 #ifndef gstdtlsenc_h 27 #define gstdtlsenc_h 28 29 #include "gstdtlsagent.h" 30 #include "gstdtlsconnection.h" 31 32 #include <gst/gst.h> 33 34 G_BEGIN_DECLS 35 36 #define GST_TYPE_DTLS_ENC (gst_dtls_enc_get_type()) 37 #define GST_DTLS_ENC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_DTLS_ENC, GstDtlsEnc)) 38 #define GST_DTLS_ENC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_DTLS_ENC, GstDtlsEncClass)) 39 #define GST_IS_DTLS_ENC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_DTLS_ENC)) 40 #define GST_IS_DTLS_ENC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DTLS_ENC)) 41 42 typedef struct _GstDtlsEnc GstDtlsEnc; 43 typedef struct _GstDtlsEncClass GstDtlsEncClass; 44 45 struct _GstDtlsEnc { 46 GstElement element; 47 48 GstPad *src; 49 GstFlowReturn src_ret; 50 51 GQueue queue; 52 GMutex queue_lock; 53 GCond queue_cond_add; 54 gboolean flushing; 55 56 GstDtlsConnection *connection; 57 gchar *connection_id; 58 59 gboolean is_client; 60 61 GstBuffer *encoder_key; 62 guint srtp_cipher; 63 guint srtp_auth; 64 65 gboolean send_initial_events; 66 }; 67 68 struct _GstDtlsEncClass { 69 GstElementClass parent_class; 70 }; 71 72 GType gst_dtls_enc_get_type(void); 73 74 gboolean gst_dtls_enc_plugin_init(GstPlugin *); 75 76 G_END_DECLS 77 78 #endif /* gstdtlsenc_h */ 79