2006-09-02 14:28:55 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
2003-10-10 12:47:42 +00:00
|
|
|
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2006-09-02 14:28:55 +00:00
|
|
|
* 2006 Edgard Lima <edgard.lima@indt.org.br>
|
2003-10-10 12:47:42 +00:00
|
|
|
*
|
|
|
|
* gstv4l2tuner.h: tuner interface implementation for V4L2
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_V4L2_TUNER_H__
|
|
|
|
#define __GST_V4L2_TUNER_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2006-03-11 22:50:03 +00:00
|
|
|
#include <gst/interfaces/tuner.h>
|
2003-10-10 12:47:42 +00:00
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
#include "gstv4l2object.h"
|
2003-10-10 12:47:42 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
2004-03-15 16:32:54 +00:00
|
|
|
|
2003-10-10 12:47:42 +00:00
|
|
|
#define GST_TYPE_V4L2_TUNER_CHANNEL \
|
|
|
|
(gst_v4l2_tuner_channel_get_type ())
|
|
|
|
#define GST_V4L2_TUNER_CHANNEL(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_V4L2_TUNER_CHANNEL, \
|
2006-05-11 17:59:59 +00:00
|
|
|
GstV4l2TunerChannel))
|
2003-10-10 12:47:42 +00:00
|
|
|
#define GST_V4L2_TUNER_CHANNEL_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_V4L2_TUNER_CHANNEL, \
|
2006-05-11 17:59:59 +00:00
|
|
|
GstV4l2TunerChannelClass))
|
2003-10-10 12:47:42 +00:00
|
|
|
#define GST_IS_V4L2_TUNER_CHANNEL(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_TUNER_CHANNEL))
|
|
|
|
#define GST_IS_V4L2_TUNER_CHANNEL_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_TUNER_CHANNEL))
|
2004-03-15 16:32:54 +00:00
|
|
|
|
|
|
|
typedef struct _GstV4l2TunerChannel {
|
2003-10-10 12:47:42 +00:00
|
|
|
GstTunerChannel parent;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
guint32 index;
|
|
|
|
guint32 tuner;
|
|
|
|
guint32 audio;
|
2003-10-10 12:47:42 +00:00
|
|
|
} GstV4l2TunerChannel;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstV4l2TunerChannelClass {
|
2003-10-10 12:47:42 +00:00
|
|
|
GstTunerChannelClass parent;
|
|
|
|
} GstV4l2TunerChannelClass;
|
|
|
|
|
|
|
|
#define GST_TYPE_V4L2_TUNER_NORM \
|
|
|
|
(gst_v4l2_tuner_norm_get_type ())
|
|
|
|
#define GST_V4L2_TUNER_NORM(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_V4L2_TUNER_NORM, \
|
2006-05-11 17:59:59 +00:00
|
|
|
GstV4l2TunerNorm))
|
2003-10-10 12:47:42 +00:00
|
|
|
#define GST_V4L2_TUNER_NORM_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_V4L2_TUNER_NORM, \
|
2006-05-11 17:59:59 +00:00
|
|
|
GstV4l2TunerNormClass))
|
2003-10-10 12:47:42 +00:00
|
|
|
#define GST_IS_V4L2_TUNER_NORM(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_TUNER_NORM))
|
|
|
|
#define GST_IS_V4L2_TUNER_NORM_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_TUNER_NORM))
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstV4l2TunerNorm {
|
2003-10-10 12:47:42 +00:00
|
|
|
GstTunerNorm parent;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
v4l2_std_id index;
|
2003-10-10 12:47:42 +00:00
|
|
|
} GstV4l2TunerNorm;
|
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstV4l2TunerNormClass {
|
2003-10-10 12:47:42 +00:00
|
|
|
GstTunerNormClass parent;
|
|
|
|
} GstV4l2TunerNormClass;
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
GType gst_v4l2_tuner_channel_get_type (void);
|
|
|
|
GType gst_v4l2_tuner_norm_get_type (void);
|
|
|
|
|
2006-09-26 13:18:06 +00:00
|
|
|
/* channels */
|
|
|
|
const GList* gst_v4l2_tuner_list_channels (GstV4l2Object * v4l2object);
|
|
|
|
GstTunerChannel* gst_v4l2_tuner_get_channel (GstV4l2Object * v4l2object);
|
|
|
|
gboolean gst_v4l2_tuner_set_channel (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerChannel * channel);
|
|
|
|
/* norms */
|
|
|
|
const GList* gst_v4l2_tuner_list_norms (GstV4l2Object * v4l2object);
|
|
|
|
void gst_v4l2_tuner_set_norm_and_notify (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerNorm * norm);
|
|
|
|
GstTunerNorm* gst_v4l2_tuner_get_norm (GstV4l2Object * v4l2object);
|
|
|
|
gboolean gst_v4l2_tuner_set_norm (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerNorm * norm);
|
2010-04-04 11:43:41 +00:00
|
|
|
GstTunerNorm* gst_v4l2_tuner_get_norm_by_std_id (GstV4l2Object * v4l2object,
|
|
|
|
v4l2_std_id norm);
|
|
|
|
v4l2_std_id gst_v4l2_tuner_get_std_id_by_norm (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerNorm * norm);
|
|
|
|
|
2006-09-26 13:18:06 +00:00
|
|
|
/* frequency */
|
|
|
|
void gst_v4l2_tuner_set_frequency_and_notify (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerChannel * channel,
|
|
|
|
gulong frequency);
|
|
|
|
gint gst_v4l2_tuner_signal_strength (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerChannel * channel);
|
|
|
|
gulong gst_v4l2_tuner_get_frequency (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerChannel * channel);
|
|
|
|
gboolean gst_v4l2_tuner_set_frequency (GstV4l2Object * v4l2object,
|
|
|
|
GstTunerChannel * channel,
|
|
|
|
gulong frequency);
|
2006-05-11 17:59:59 +00:00
|
|
|
|
|
|
|
#define GST_IMPLEMENT_V4L2_TUNER_METHODS(Type, interface_as_function) \
|
|
|
|
\
|
|
|
|
static const GList * \
|
|
|
|
interface_as_function ## _tuner_list_channels (GstTuner * mixer) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
return gst_v4l2_tuner_list_channels (this->v4l2object); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static void \
|
2006-10-18 11:04:09 +00:00
|
|
|
interface_as_function ## _tuner_set_channel (GstTuner * mixer, \
|
|
|
|
GstTunerChannel * channel) \
|
2006-05-11 17:59:59 +00:00
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
2006-10-18 11:04:09 +00:00
|
|
|
gst_v4l2_tuner_set_channel (this->v4l2object, channel); \
|
2006-05-11 17:59:59 +00:00
|
|
|
} \
|
|
|
|
static GstTunerChannel * \
|
|
|
|
interface_as_function ## _tuner_get_channel (GstTuner * mixer) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
return gst_v4l2_tuner_get_channel (this->v4l2object); \
|
|
|
|
} \
|
|
|
|
static const GList * \
|
|
|
|
interface_as_function ## _tuner_list_norms (GstTuner * mixer) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
return gst_v4l2_tuner_list_norms (this->v4l2object); \
|
|
|
|
} \
|
|
|
|
static void \
|
|
|
|
interface_as_function ## _tuner_set_norm_and_notify (GstTuner * mixer, \
|
|
|
|
GstTunerNorm * norm) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
gst_v4l2_tuner_set_norm_and_notify (this->v4l2object, norm); \
|
|
|
|
} \
|
|
|
|
static GstTunerNorm * \
|
|
|
|
interface_as_function ## _tuner_get_norm (GstTuner * mixer) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
return gst_v4l2_tuner_get_norm (this->v4l2object); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static void \
|
|
|
|
interface_as_function ## _tuner_set_frequency_and_notify (GstTuner * mixer, \
|
|
|
|
GstTunerChannel * channel, \
|
|
|
|
gulong frequency) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
gst_v4l2_tuner_set_frequency_and_notify (this->v4l2object, channel, frequency); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gulong \
|
|
|
|
interface_as_function ## _tuner_get_frequency (GstTuner * mixer, \
|
|
|
|
GstTunerChannel * channel) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
return gst_v4l2_tuner_get_frequency (this->v4l2object, channel); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gint \
|
|
|
|
interface_as_function ## _tuner_signal_strength (GstTuner * mixer, \
|
|
|
|
GstTunerChannel * channel) \
|
|
|
|
{ \
|
|
|
|
Type *this = (Type*) mixer; \
|
|
|
|
return gst_v4l2_tuner_signal_strength (this->v4l2object, channel); \
|
|
|
|
} \
|
|
|
|
\
|
2010-03-17 17:23:00 +00:00
|
|
|
static void \
|
2006-05-11 17:59:59 +00:00
|
|
|
interface_as_function ## _tuner_interface_init (GstTunerClass * klass) \
|
|
|
|
{ \
|
|
|
|
/* default virtual functions */ \
|
|
|
|
klass->list_channels = interface_as_function ## _tuner_list_channels; \
|
2006-10-18 11:04:09 +00:00
|
|
|
klass->set_channel = interface_as_function ## _tuner_set_channel; \
|
2006-05-11 17:59:59 +00:00
|
|
|
klass->get_channel = interface_as_function ## _tuner_get_channel; \
|
|
|
|
\
|
|
|
|
klass->list_norms = interface_as_function ## _tuner_list_norms; \
|
|
|
|
klass->set_norm = interface_as_function ## _tuner_set_norm_and_notify; \
|
|
|
|
klass->get_norm = interface_as_function ## _tuner_get_norm; \
|
|
|
|
\
|
|
|
|
klass->set_frequency = interface_as_function ## _tuner_set_frequency_and_notify; \
|
|
|
|
klass->get_frequency = interface_as_function ## _tuner_get_frequency; \
|
|
|
|
klass->signal_strength = interface_as_function ## _tuner_signal_strength; \
|
|
|
|
} \
|
2006-05-05 20:12:59 +00:00
|
|
|
|
2003-10-10 12:47:42 +00:00
|
|
|
#endif /* __GST_V4L2_TUNER_H__ */
|