Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / ext / srtp / gstsrtpdec.h
1 /*
2  * GStreamer - GStreamer SRTP decoder
3  *
4  * Copyright 2009 Collabora Ltd.
5  *  @author: Gabriel Millaire <gabriel.millaire@collabora.co.uk>
6  *  @author: Olivier Crete <olivier.crete@collabora.com>
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a
9  * copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation
11  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12  * and/or sell copies of the Software, and to permit persons to whom the
13  * Software is furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in
16  * all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24  * DEALINGS IN THE SOFTWARE.
25  *
26  * Alternatively, the contents of this file may be used under the
27  * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
28  * which case the following provisions apply instead of the ones
29  * mentioned above:
30  *
31  * This library is free software; you can redistribute it and/or
32  * modify it under the terms of the GNU Library General Public
33  * License as published by the Free Software Foundation; either
34  * version 2 of the License, or (at your option) any later version.
35  *
36  * This library is distributed in the hope that it will be useful,
37  * but WITHOUT ANY WARRANTY; without even the implied warranty of
38  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
39  * Library General Public License for more details.
40  *
41  * You should have received a copy of the GNU Library General Public
42  * License along with this library; if not, write to the
43  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
44  * Boston, MA 02111-1307, USA.
45  */
46
47 #ifndef __GST_SRTPDEC_H__
48 #define __GST_SRTPDEC_H__
49
50 #include "gstsrtp.h"
51
52 G_BEGIN_DECLS
53
54 #define GST_TYPE_SRTP_DEC \
55   (gst_srtp_dec_get_type())
56 #define GST_SRTP_DEC(obj) \
57   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SRTP_DEC,GstSrtpDec))
58 #define GST_SRTP_DEC_CLASS(klass) \
59   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SRTP_DEC,GstSrtpDecClass))
60 #define GST_IS_SRTP_DEC(obj) \
61   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SRTP_DEC))
62 #define GST_IS_SRTP_DEC_CLASS(klass) \
63   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SRTP_DEC))
64
65 typedef struct _GstSrtpDec      GstSrtpDec;
66 typedef struct _GstSrtpDecClass GstSrtpDecClass;
67 typedef struct _GstSrtpDecSsrcStream GstSrtpDecSsrcStream;
68
69 struct _GstSrtpDec
70 {
71   GstElement element;
72
73   guint replay_window_size;
74
75   GstPad *rtp_sinkpad, *rtp_srcpad;
76   GstPad *rtcp_sinkpad, *rtcp_srcpad;
77
78   gboolean ask_update;
79   srtp_t session;
80   gboolean first_session;
81   GHashTable *streams;
82
83   gboolean rtp_has_segment;
84   gboolean rtcp_has_segment;
85
86 #ifndef HAVE_SRTP2
87   GHashTable *streams_roc_changed;
88 #endif
89 };
90
91 struct _GstSrtpDecClass
92 {
93   GstElementClass parent_class;
94
95   void (*clear_streams) (GstSrtpDec * filter);
96   void (*remove_stream) (GstSrtpDec * filter, guint ssrc);
97 };
98
99 GType gst_srtp_dec_get_type (void);
100
101
102 G_END_DECLS
103
104 #endif /* __GST_SRTPDEC_H__ */