[MOVED FROM GST-P-FARSIGHT] Do wierd casting of the volume to make MSVC happy
[platform/upstream/gstreamer.git] / gst / dtmf / gstrtpdtmfsrc.h
1 /* GStreamer RTP DTMF source
2  *
3  * gstrtpdtmfsrc.h:
4  *
5  * Copyright (C) <2007> Nokia Corporation.
6  *   Contact: Zeeshan Ali <zeeshan.ali@nokia.com>
7  * Copyright (C) <2005> Wim Taymans <wim@fluendo.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #ifndef __GST_RTP_DTMF_SRC_H__
26 #define __GST_RTP_DTMF_SRC_H__
27
28 #include <gst/gst.h>
29 #include <gst/base/gstbasesrc.h>
30 #include <gst/rtp/gstrtpbuffer.h>
31
32 #include "gstrtpdtmfcommon.h"
33
34 G_BEGIN_DECLS
35
36 #define GST_TYPE_RTP_DTMF_SRC           (gst_rtp_dtmf_src_get_type())
37 #define GST_RTP_DTMF_SRC(obj)           (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_DTMF_SRC,GstRTPDTMFSrc))
38 #define GST_RTP_DTMF_SRC_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_DTMF_SRC,GstRTPDTMFSrcClass))
39 #define GST_RTP_DTMF_SRC_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_DTMF_SRC, GstRTPDTMFSrcClass))
40 #define GST_IS_RTP_DTMF_SRC(obj)                (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_DTMF_SRC))
41 #define GST_IS_RTP_DTMF_SRC_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_DTMF_SRC))
42 #define GST_RTP_DTMF_SRC_CAST(obj)              ((GstRTPDTMFSrc *)(obj))
43
44
45 typedef struct _GstRTPDTMFSrc GstRTPDTMFSrc;
46 typedef struct _GstRTPDTMFSrcClass GstRTPDTMFSrcClass;
47
48
49
50 enum _GstRTPDTMFEventType {
51   RTP_DTMF_EVENT_TYPE_START,
52   RTP_DTMF_EVENT_TYPE_STOP,
53   RTP_DTMF_EVENT_TYPE_PAUSE_TASK
54 };
55
56 typedef enum _GstRTPDTMFEventType GstRTPDTMFEventType;
57
58 struct _GstRTPDTMFSrcEvent {
59   GstRTPDTMFEventType  event_type;
60   GstRTPDTMFPayload*   payload;
61 };
62
63 typedef struct _GstRTPDTMFSrcEvent GstRTPDTMFSrcEvent;
64
65 /**
66  * GstRTPDTMFSrc:
67  * @element: the parent element.
68  *
69  * The opaque #GstRTPDTMFSrc data structure.
70  */
71 struct _GstRTPDTMFSrc {
72   GstBaseSrc           basesrc;
73
74   GAsyncQueue*         event_queue;
75   GstClockID           clockid;
76   gboolean             paused;
77   GstRTPDTMFPayload*   payload;
78
79   GstClockTime      timestamp;
80   GstClockTime      start_timestamp;
81   gboolean          first_packet;
82   gboolean          last_packet;
83   guint32           ts_base;
84   guint16           seqnum_base;
85   gint16            seqnum_offset;
86   guint16           seqnum;
87   gint32            ts_offset;
88   guint32           rtp_timestamp;
89   guint             pt;
90   guint             ssrc;
91   guint             current_ssrc;
92   guint16           interval;
93   guint16           packet_redundancy;
94   guint32           clock_rate;
95
96   gboolean          dirty;
97   guint16           redundancy_count;
98 };
99
100 struct _GstRTPDTMFSrcClass {
101   GstBaseSrcClass parent_class;
102 };
103
104 GType gst_rtp_dtmf_src_get_type (void);
105
106 gboolean gst_rtp_dtmf_src_plugin_init (GstPlugin * plugin);
107
108
109 G_END_DECLS
110
111 #endif /* __GST_RTP_DTMF_SRC_H__ */