Merging gst-plugins-bad
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / dvb / gstdvbsrc.h
1 /* GStreamer DVB source
2  * Copyright (C) 2006 Zaheer Abbas Merali <zaheerabbas at merali
3  *                                         dot org>
4  * Copyright (C) 2014 Samsung Electronics. All rights reserved.
5  *     @Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef __GST_DVBSRC_H__
24 #define __GST_DVBSRC_H__
25
26 #include <gst/gst.h>
27 #include <gst/base/gstpushsrc.h>
28
29 G_BEGIN_DECLS
30
31  typedef enum
32 {
33   DVB_POL_H,
34   DVB_POL_V,
35   DVB_POL_ZERO
36 } GstDvbSrcPol;
37
38
39 #define IPACKS 2048
40 #define TS_SIZE 188
41 #define IN_SIZE TS_SIZE*10
42
43 #define MAX_FILTERS 32
44
45 #define GST_TYPE_DVBSRC \
46   (gst_dvbsrc_get_type())
47 #define GST_DVBSRC(obj) \
48   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVBSRC,GstDvbSrc))
49 #define GST_DVBSRC_CLASS(klass) \
50   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVBSRC,GstDvbSrcClass))
51 #define GST_IS_DVBSRC(obj) \
52   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVBSRC))
53 #define GST_IS_DVBSRC_CLASS(klass) \
54   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVBSRC))
55
56 typedef struct _GstDvbSrc GstDvbSrc;
57 typedef struct _GstDvbSrcClass GstDvbSrcClass;
58 typedef struct _GstDvbSrcParam GstDvbSrcParam;
59
60 struct _GstDvbSrc
61 {
62   GstPushSrc element;
63
64   GMutex tune_mutex;
65   gboolean need_tune;
66
67   GList * supported_delsys;
68   guchar delsys;
69
70   int adapter_number;
71   int frontend_number;
72
73   int fd_frontend;
74   int fd_dvr;
75   int fd_filters[MAX_FILTERS];
76   GstPoll *poll;
77   GstPollFD poll_fd_dvr;
78
79   guint16 pids[MAX_FILTERS];
80   unsigned int freq;
81   unsigned int sym_rate;
82   int tone;
83   int diseqc_src;
84   gboolean send_diseqc;
85
86   guint bandwidth;
87   int code_rate_hp;
88   int code_rate_lp;
89   int modulation;
90   int guard_interval;
91   int transmission_mode;
92   int hierarchy_information;
93   int inversion;
94   int pilot;
95   int rolloff;
96   int stream_id;
97   guint64 timeout;
98   guint64 tuning_timeout;
99
100   GstDvbSrcPol pol;
101   guint stats_interval;
102   guint stats_counter;
103   gboolean need_unlock;
104
105   guint dvb_buffer_size;
106
107   unsigned int isdbt_layer_enabled;
108   int isdbt_partial_reception;
109   int isdbt_sound_broadcasting;
110   int isdbt_sb_subchannel_id;
111   int isdbt_sb_segment_idx;
112   unsigned int isdbt_sb_segment_count;
113   int isdbt_layera_fec;
114   int isdbt_layera_modulation;
115   int isdbt_layera_segment_count;
116   int isdbt_layera_time_interleaving;
117   int isdbt_layerb_fec;
118   int isdbt_layerb_modulation;
119   int isdbt_layerb_segment_count;
120   int isdbt_layerb_time_interleaving;
121   int isdbt_layerc_fec;
122   int isdbt_layerc_modulation;
123   int isdbt_layerc_segment_count;
124   int isdbt_layerc_time_interleaving;
125
126   /* LNB properties */
127   unsigned int lnb_slof;
128   unsigned int lnb_lof1;
129   unsigned int lnb_lof2;
130
131   /* Only used for DTMB if available */
132   int interleaving;
133 };
134
135 struct _GstDvbSrcClass
136 {
137   GstPushSrcClass parent_class;
138
139   void (*adapter_type) (GstElement * element, gint type);
140   void (*signal_quality) (GstElement * element, gint strength, gint snr);
141
142   void (*do_tune) (GstDvbSrc * self);
143 };
144
145
146 GType gst_dvbsrc_get_type (void);
147
148 G_END_DECLS
149 #endif /* __GST_DVBSRC_H__ */