1 /* GStreamer
2  * Copyright (C) <2009> Edward Hervey <bilboed@bilboed.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __GST_RTP_QDM2_DEPAY_H__
21 #define __GST_RTP_QDM2_DEPAY_H__
22 
23 #include <gst/gst.h>
24 #include <gst/base/gstadapter.h>
25 #include <gst/rtp/gstrtpbasedepayload.h>
26 
27 G_BEGIN_DECLS
28 
29 #define GST_TYPE_RTP_QDM2_DEPAY \
30   (gst_rtp_qdm2_depay_get_type())
31 #define GST_RTP_QDM2_DEPAY(obj) \
32   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_QDM2_DEPAY,GstRtpQDM2Depay))
33 #define GST_RTP_QDM2_DEPAY_CLASS(klass) \
34   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_QDM2_DEPAY,GstRtpQDM2DepayClass))
35 #define GST_IS_RTP_QDM2_DEPAY(obj) \
36   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_QDM2_DEPAY))
37 #define GST_IS_RTP_QDM2_DEPAY_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_QDM2_DEPAY))
39 
40 typedef struct _GstRtpQDM2Depay GstRtpQDM2Depay;
41 typedef struct _GstRtpQDM2DepayClass GstRtpQDM2DepayClass;
42 
43 typedef struct _QDM2Packet {
44   guint8* data;
45   guint offs;		/* Starts at 4 to give room for the prefix */
46 } QDM2Packet;
47 
48 #define MAX_SCRAMBLED_PACKETS 64
49 
50 struct _GstRtpQDM2Depay
51 {
52   GstRTPBaseDepayload depayload;
53 
54   GstAdapter *adapter;
55 
56   guint16 nextseq;
57   gboolean configured;
58 
59   GstClockTime timestamp; /* Timestamp of current incoming data */
60   GstClockTime ptimestamp; /* Timestamp of data stored in the adapter */
61 
62   guint32 channs;
63   guint32 samplerate;
64   guint32 bitrate;
65   guint32 blocksize;
66   guint32 framesize;
67   guint32 packetsize;
68 
69   guint nbpackets;	/* Number of packets to unscramble */
70 
71   QDM2Packet *packets[MAX_SCRAMBLED_PACKETS];
72 };
73 
74 struct _GstRtpQDM2DepayClass
75 {
76   GstRTPBaseDepayloadClass parent_class;
77 };
78 
79 GType gst_rtp_qdm2_depay_get_type (void);
80 
81 gboolean gst_rtp_qdm2_depay_plugin_init (GstPlugin * plugin);
82 
83 G_END_DECLS
84 
85 #endif /* __GST_RTP_QDM2_DEPAY_H__ */
86