Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 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 gstdtlsdec_h |
| 27 | #define gstdtlsdec_h |
| 28 | |
| 29 | #include "gstdtlsagent.h" |
| 30 | #include "gstdtlsconnection.h" |
| 31 | |
| 32 | #include <gst/gst.h> |
| 33 | |
| 34 | G_BEGIN_DECLS |
| 35 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 36 | #define GST_TYPE_DTLS_DEC \ |
| 37 | (gst_dtls_dec_get_type()) |
| 38 | #define GST_DTLS_DEC(obj) \ |
| 39 | (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_DTLS_DEC, GstDtlsDec)) |
| 40 | #define GST_DTLS_DEC_CLASS(klass) \ |
| 41 | (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_DTLS_DEC, GstDtlsDecClass)) |
| 42 | #define GST_IS_DTLS_DEC(obj) \ |
| 43 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_DTLS_DEC)) |
| 44 | #define GST_IS_DTLS_DEC_CLASS(klass) \ |
| 45 | (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DTLS_DEC)) |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 46 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 47 | typedef struct _GstDtlsDec GstDtlsDec; |
| 48 | typedef struct _GstDtlsDecClass GstDtlsDecClass; |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 49 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 50 | struct _GstDtlsDec { |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 51 | GstElement element; |
| 52 | |
| 53 | GstPad *src; |
Santiago Carot-Nemesio | f530aac | 2015-06-03 16:59:44 +0200 | [diff] [blame] | 54 | GstPad *sink; |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 55 | GMutex src_mutex; |
| 56 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 57 | GstDtlsAgent *agent; |
| 58 | GstDtlsConnection *connection; |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 59 | GMutex connection_mutex; |
| 60 | gchar *connection_id; |
Sebastian Dröge | 2082476 | 2015-03-18 09:46:40 +0100 | [diff] [blame] | 61 | gchar *peer_pem; |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 62 | |
Sebastian Dröge | 2082476 | 2015-03-18 09:46:40 +0100 | [diff] [blame] | 63 | GstBuffer *decoder_key; |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 64 | guint srtp_cipher; |
| 65 | guint srtp_auth; |
| 66 | }; |
| 67 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 68 | struct _GstDtlsDecClass { |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 69 | GstElementClass parent_class; |
| 70 | }; |
| 71 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 72 | GType gst_dtls_dec_get_type(void); |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 73 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 74 | gboolean gst_dtls_dec_plugin_init(GstPlugin *); |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 75 | |
Sebastian Dröge | 936fa2f | 2015-03-16 17:48:43 +0100 | [diff] [blame] | 76 | GstDtlsConnection *gst_dtls_dec_fetch_connection(gchar *id); |
Sebastian Dröge | 1e0ed9a | 2015-03-16 17:33:03 +0100 | [diff] [blame] | 77 | |
| 78 | G_END_DECLS |
| 79 | |
| 80 | #endif /* gstdtlsdec_h */ |