2006-05-11 17:59:59 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2006-09-02 14:28:55 +00:00
|
|
|
* 2006 Edgard Lima <edgard.lima@indt.org.br>
|
|
|
|
*
|
|
|
|
* gstv4l2object.h: base class for V4L2 elements
|
2006-05-11 17:59:59 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2006-05-19 18:31:25 +00:00
|
|
|
#ifndef __GST_V4L2_OBJECT_H__
|
|
|
|
#define __GST_V4L2_OBJECT_H__
|
2006-05-11 17:59:59 +00:00
|
|
|
|
|
|
|
/* Because of some really cool feature in video4linux1, also known as
|
|
|
|
* 'not including sys/types.h and sys/time.h', we had to include it
|
|
|
|
* ourselves. In all their intelligence, these people decided to fix
|
|
|
|
* this in the next version (video4linux2) in such a cool way that it
|
|
|
|
* breaks all compilations of old stuff...
|
|
|
|
* The real problem is actually that linux/time.h doesn't use proper
|
|
|
|
* macro checks before defining types like struct timeval. The proper
|
|
|
|
* fix here is to either fuck the kernel header (which is what we do
|
|
|
|
* by defining _LINUX_TIME_H, an innocent little hack) or by fixing it
|
|
|
|
* upstream, which I'll consider doing later on. If you get compiler
|
|
|
|
* errors here, check your linux/time.h && sys/time.h header setup.
|
|
|
|
*/
|
2009-10-09 09:34:16 +00:00
|
|
|
#include <sys/ioctl.h>
|
2006-05-11 17:59:59 +00:00
|
|
|
#include <sys/types.h>
|
2008-01-21 19:35:58 +00:00
|
|
|
#ifndef __sun
|
2006-05-11 17:59:59 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
#define _LINUX_TIME_H
|
|
|
|
#define __user
|
|
|
|
#include <linux/videodev2.h>
|
2008-01-21 19:35:58 +00:00
|
|
|
#else
|
|
|
|
#include <sys/videodev2.h>
|
|
|
|
#endif
|
2006-05-11 17:59:59 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/base/gstpushsrc.h>
|
|
|
|
|
2011-07-13 11:00:42 +00:00
|
|
|
#include <gst/video/video.h>
|
2006-05-11 17:59:59 +00:00
|
|
|
#include <gst/interfaces/propertyprobe.h>
|
|
|
|
|
2011-07-13 14:33:58 +00:00
|
|
|
typedef struct _GstV4l2Object GstV4l2Object;
|
|
|
|
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
|
|
|
|
typedef struct _GstV4l2Xv GstV4l2Xv;
|
|
|
|
|
|
|
|
#include <gstv4l2bufferpool.h>
|
2009-08-04 07:14:20 +00:00
|
|
|
|
|
|
|
/* size of v4l2 buffer pool in streaming case */
|
|
|
|
#define GST_V4L2_MAX_BUFFERS 16
|
|
|
|
#define GST_V4L2_MIN_BUFFERS 1
|
|
|
|
|
|
|
|
/* max frame width/height */
|
|
|
|
#define GST_V4L2_MAX_SIZE (1<<15) /* 2^15 == 32768 */
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2006-05-19 18:31:25 +00:00
|
|
|
#define GST_V4L2_OBJECT(obj) (GstV4l2Object *)(obj)
|
2006-05-18 19:34:47 +00:00
|
|
|
|
2011-07-18 08:52:23 +00:00
|
|
|
typedef enum {
|
2011-07-18 16:54:49 +00:00
|
|
|
GST_V4L2_IO_AUTO = 0,
|
2011-07-18 08:52:23 +00:00
|
|
|
GST_V4L2_IO_RW = 1,
|
|
|
|
GST_V4L2_IO_MMAP = 2,
|
|
|
|
GST_V4L2_IO_USERPTR = 3
|
|
|
|
} GstV4l2IOMode;
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2006-09-26 13:18:06 +00:00
|
|
|
typedef gboolean (*GstV4l2GetInOutFunction) (GstV4l2Object * v4l2object, gint * input);
|
|
|
|
typedef gboolean (*GstV4l2SetInOutFunction) (GstV4l2Object * v4l2object, gint input);
|
2007-05-30 14:57:44 +00:00
|
|
|
typedef gboolean (*GstV4l2UpdateFpsFunction) (GstV4l2Object * v4l2object);
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2011-07-13 11:00:42 +00:00
|
|
|
#define GST_V4L2_WIDTH(o) (GST_VIDEO_INFO_WIDTH (&(o)->info))
|
|
|
|
#define GST_V4L2_HEIGHT(o) (GST_VIDEO_INFO_HEIGHT (&(o)->info))
|
|
|
|
#define GST_V4L2_PIXELFORMAT(o) ((o)->fmtdesc->pixelformat)
|
|
|
|
#define GST_V4L2_FPS_N(o) (GST_VIDEO_INFO_FPS_N (&(o)->info))
|
|
|
|
#define GST_V4L2_FPS_D(o) (GST_VIDEO_INFO_FPS_D (&(o)->info))
|
2011-07-13 09:19:28 +00:00
|
|
|
|
|
|
|
/* simple check whether the device is open */
|
|
|
|
#define GST_V4L2_IS_OPEN(o) ((o)->video_fd > 0)
|
|
|
|
|
|
|
|
/* check whether the device is 'active' */
|
|
|
|
#define GST_V4L2_IS_ACTIVE(o) ((o)->active)
|
|
|
|
#define GST_V4L2_SET_ACTIVE(o) ((o)->active = TRUE)
|
|
|
|
#define GST_V4L2_SET_INACTIVE(o) ((o)->active = FALSE)
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
struct _GstV4l2Object {
|
|
|
|
GstElement * element;
|
|
|
|
|
2011-07-13 09:19:28 +00:00
|
|
|
enum v4l2_buf_type type; /* V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_BUF_TYPE_VIDEO_OUTPUT */
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
/* the video device */
|
|
|
|
char *videodev;
|
|
|
|
|
|
|
|
/* the video-device's file descriptor */
|
|
|
|
gint video_fd;
|
2011-07-18 08:52:23 +00:00
|
|
|
GstV4l2IOMode mode;
|
2009-03-01 18:55:26 +00:00
|
|
|
GstPoll * poll;
|
2009-07-17 12:22:57 +00:00
|
|
|
gboolean can_poll_device;
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2011-07-13 09:19:28 +00:00
|
|
|
gboolean active;
|
2011-07-13 14:33:58 +00:00
|
|
|
gboolean streaming;
|
2009-08-04 07:14:20 +00:00
|
|
|
|
2011-07-12 16:13:42 +00:00
|
|
|
/* the current format */
|
2011-07-13 11:00:42 +00:00
|
|
|
struct v4l2_fmtdesc *fmtdesc;
|
|
|
|
GstVideoInfo info;
|
|
|
|
|
2011-07-13 14:33:58 +00:00
|
|
|
guint32 bytesperline;
|
2011-07-26 14:15:05 +00:00
|
|
|
guint32 sizeimage;
|
2011-07-13 09:19:28 +00:00
|
|
|
GstClockTime duration;
|
2011-07-12 16:13:42 +00:00
|
|
|
|
2011-07-18 16:54:49 +00:00
|
|
|
/* wanted mode */
|
|
|
|
GstV4l2IOMode req_mode;
|
|
|
|
|
2011-07-13 14:33:58 +00:00
|
|
|
/* optional pool */
|
2011-07-13 16:32:00 +00:00
|
|
|
gboolean always_copy;
|
2011-08-04 11:50:01 +00:00
|
|
|
GstBufferPool *pool;
|
2011-07-13 14:33:58 +00:00
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
/* the video device's capabilities */
|
|
|
|
struct v4l2_capability vcap;
|
|
|
|
|
|
|
|
/* the video device's window properties */
|
|
|
|
struct v4l2_window vwin;
|
|
|
|
|
|
|
|
/* some more info about the current input's capabilities */
|
|
|
|
struct v4l2_input vinput;
|
|
|
|
|
|
|
|
/* lists... */
|
2009-08-04 07:14:20 +00:00
|
|
|
GSList *formats; /* list of available capture formats */
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
GList *colors;
|
sys/v4l2/: Renamed some properties to match the tuner interface naming.
Original commit message from CVS:
* sys/v4l2/gstv4l2object.c:
(gst_v4l2_object_install_properties_helper), (gst_v4l2_object_new),
(gst_v4l2_object_set_property_helper),
(gst_v4l2_object_get_property_helper), (gst_v4l2_set_defaults):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_create):
* sys/v4l2/gstv4l2tuner.c: (gst_v4l2_tuner_contains_channel),
(gst_v4l2_tuner_list_channels),
(gst_v4l2_tuner_set_channel_and_notify),
(gst_v4l2_tuner_get_channel), (gst_v4l2_tuner_contains_norm),
(gst_v4l2_tuner_list_norms), (gst_v4l2_tuner_set_norm_and_notify),
(gst_v4l2_tuner_get_norm):
* sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities),
(gst_v4l2_fill_lists), (gst_v4l2_empty_lists):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_get_fps):
Renamed some properties to match the tuner interface naming.
2006-09-27 17:04:22 +00:00
|
|
|
GList *norms;
|
|
|
|
GList *channels;
|
2006-05-11 17:59:59 +00:00
|
|
|
|
|
|
|
/* properties */
|
2010-04-04 11:43:41 +00:00
|
|
|
v4l2_std_id tv_norm;
|
sys/v4l2/: Renamed some properties to match the tuner interface naming.
Original commit message from CVS:
* sys/v4l2/gstv4l2object.c:
(gst_v4l2_object_install_properties_helper), (gst_v4l2_object_new),
(gst_v4l2_object_set_property_helper),
(gst_v4l2_object_get_property_helper), (gst_v4l2_set_defaults):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_create):
* sys/v4l2/gstv4l2tuner.c: (gst_v4l2_tuner_contains_channel),
(gst_v4l2_tuner_list_channels),
(gst_v4l2_tuner_set_channel_and_notify),
(gst_v4l2_tuner_get_channel), (gst_v4l2_tuner_contains_norm),
(gst_v4l2_tuner_list_norms), (gst_v4l2_tuner_set_norm_and_notify),
(gst_v4l2_tuner_get_norm):
* sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities),
(gst_v4l2_fill_lists), (gst_v4l2_empty_lists):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_get_fps):
Renamed some properties to match the tuner interface naming.
2006-09-27 17:04:22 +00:00
|
|
|
gchar *channel;
|
2006-05-11 17:59:59 +00:00
|
|
|
gulong frequency;
|
|
|
|
|
|
|
|
/* X-overlay */
|
|
|
|
GstV4l2Xv *xv;
|
|
|
|
gulong xwindow_id;
|
|
|
|
|
|
|
|
/* funcs */
|
2006-09-26 13:18:06 +00:00
|
|
|
GstV4l2GetInOutFunction get_in_out_func;
|
|
|
|
GstV4l2SetInOutFunction set_in_out_func;
|
2007-05-30 14:57:44 +00:00
|
|
|
GstV4l2UpdateFpsFunction update_fps_func;
|
2006-05-11 17:59:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstV4l2ObjectClassHelper {
|
|
|
|
/* probed devices */
|
|
|
|
GList *devices;
|
|
|
|
};
|
|
|
|
|
sys/v4l2/: Fix EIO handing when capturing. Add new property to specify the number of buffers to enque (and remove the...
Original commit message from CVS:
* sys/v4l2/gstv4l2object.c:
(gst_v4l2_object_install_properties_helper),
(gst_v4l2_object_set_property_helper),
(gst_v4l2_object_get_property_helper), (gst_v4l2_set_defaults):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_init), (gst_v4l2src_set_property),
(gst_v4l2src_get_property), (gst_v4l2src_set_caps):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_fill_format_list),
(gst_v4l2src_grab_frame), (gst_v4l2src_set_capture),
(gst_v4l2src_capture_init), (gst_v4l2src_capture_start),
(gst_v4l2src_capture_deinit):
Fix EIO handing when capturing. Add new property to specify the number of
buffers to enque (and remove the borked num-buffers usage).
2007-01-17 14:30:50 +00:00
|
|
|
GType gst_v4l2_object_get_type (void);
|
2006-05-11 17:59:59 +00:00
|
|
|
|
sys/v4l2/: Fix EIO handing when capturing. Add new property to specify the number of buffers to enque (and remove the...
Original commit message from CVS:
* sys/v4l2/gstv4l2object.c:
(gst_v4l2_object_install_properties_helper),
(gst_v4l2_object_set_property_helper),
(gst_v4l2_object_get_property_helper), (gst_v4l2_set_defaults):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_init), (gst_v4l2src_set_property),
(gst_v4l2src_get_property), (gst_v4l2src_set_caps):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_fill_format_list),
(gst_v4l2src_grab_frame), (gst_v4l2src_set_capture),
(gst_v4l2src_capture_init), (gst_v4l2src_capture_start),
(gst_v4l2src_capture_deinit):
Fix EIO handing when capturing. Add new property to specify the number of
buffers to enque (and remove the borked num-buffers usage).
2007-01-17 14:30:50 +00:00
|
|
|
#define V4L2_STD_OBJECT_PROPS \
|
|
|
|
PROP_DEVICE, \
|
|
|
|
PROP_DEVICE_NAME, \
|
2008-03-26 15:10:08 +00:00
|
|
|
PROP_DEVICE_FD, \
|
2010-04-04 11:43:41 +00:00
|
|
|
PROP_FLAGS, \
|
2010-06-22 12:48:04 +00:00
|
|
|
PROP_BRIGHTNESS, \
|
|
|
|
PROP_CONTRAST, \
|
|
|
|
PROP_SATURATION, \
|
2010-04-04 11:43:41 +00:00
|
|
|
PROP_HUE, \
|
2011-07-18 16:54:49 +00:00
|
|
|
PROP_TV_NORM, \
|
|
|
|
PROP_IO_MODE
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2006-09-26 13:18:06 +00:00
|
|
|
/* create/destroy */
|
|
|
|
GstV4l2Object * gst_v4l2_object_new (GstElement * element,
|
2010-03-19 23:54:14 +00:00
|
|
|
enum v4l2_buf_type type,
|
|
|
|
const char *default_device,
|
2006-09-26 13:18:06 +00:00
|
|
|
GstV4l2GetInOutFunction get_in_out_func,
|
2007-05-30 14:57:44 +00:00
|
|
|
GstV4l2SetInOutFunction set_in_out_func,
|
|
|
|
GstV4l2UpdateFpsFunction update_fps_func);
|
Fix a bunch of leaks shown by the newly-added states test.
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flac_enc_finalize):
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_class_init),
(gst_gconf_audio_sink_dispose), (gst_gconf_audio_sink_finalize):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init),
(gst_gconf_audio_src_class_init), (gst_gconf_audio_src_dispose),
(gst_gconf_audio_src_finalize), (do_toggle_element):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init),
(gst_gconf_video_sink_class_init), (gst_gconf_video_sink_finalize),
(do_toggle_element):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init),
(gst_gconf_video_src_class_init), (gst_gconf_video_src_dispose),
(gst_gconf_video_src_finalize), (do_toggle_element):
* ext/gconf/gstswitchsink.c: (gst_switch_sink_class_init),
(gst_switch_sink_reset), (gst_switch_sink_set_child):
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/shout2/gstshout2.c: (gst_shout2send_class_init),
(gst_shout2send_init), (gst_shout2send_finalize):
* gst/debug/testplugin.c: (gst_test_class_init),
(gst_test_finalize):
* gst/flx/gstflxdec.c: (gst_flxdec_class_init),
(gst_flxdec_dispose):
* gst/multipart/multipartmux.c: (gst_multipart_mux_finalize):
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize):
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init),
(gst_rtspsrc_finalize):
* gst/rtsp/rtspextwms.c: (rtsp_ext_wms_free_context):
* gst/rtsp/rtspextwms.h:
* gst/smpte/gstsmpte.c: (gst_smpte_class_init),
(gst_smpte_finalize):
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_finalize):
* gst/udp/gstudpsink.c: (gst_udpsink_class_init),
(gst_udpsink_finalize):
* gst/wavparse/gstwavparse.c: (gst_wavparse_dispose),
(gst_wavparse_sink_activate):
* sys/oss/gstosssink.c: (gst_oss_sink_finalise):
* sys/oss/gstosssrc.c: (gst_oss_src_class_init),
(gst_oss_src_finalize):
* sys/v4l2/gstv4l2object.c: (gst_v4l2_object_destroy):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_finalize):
* sys/ximage/gstximagesrc.c: (gst_ximage_src_ximage_get):
Fix a bunch of leaks shown by the newly-added states test.
2007-03-04 13:52:03 +00:00
|
|
|
void gst_v4l2_object_destroy (GstV4l2Object * v4l2object);
|
2006-09-26 13:18:06 +00:00
|
|
|
|
|
|
|
/* properties */
|
2009-08-04 07:14:20 +00:00
|
|
|
|
|
|
|
void gst_v4l2_object_install_properties_helper (GObjectClass *gobject_class, const char *default_device);
|
2006-09-26 13:18:06 +00:00
|
|
|
|
|
|
|
gboolean gst_v4l2_object_set_property_helper (GstV4l2Object *v4l2object,
|
|
|
|
guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec);
|
|
|
|
gboolean gst_v4l2_object_get_property_helper (GstV4l2Object *v4l2object,
|
|
|
|
guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec);
|
2011-07-13 14:33:58 +00:00
|
|
|
/* open/close */
|
|
|
|
gboolean gst_v4l2_object_open (GstV4l2Object *v4l2object);
|
|
|
|
gboolean gst_v4l2_object_close (GstV4l2Object *v4l2object);
|
2006-09-26 13:18:06 +00:00
|
|
|
|
|
|
|
/* probing */
|
|
|
|
const GList* gst_v4l2_probe_get_properties (GstPropertyProbe * probe);
|
|
|
|
|
|
|
|
void gst_v4l2_probe_probe_property (GstPropertyProbe * probe, guint prop_id,
|
|
|
|
const GParamSpec * pspec,
|
|
|
|
GList ** klass_devices);
|
|
|
|
gboolean gst_v4l2_probe_needs_probe (GstPropertyProbe * probe, guint prop_id,
|
|
|
|
const GParamSpec * pspec,
|
|
|
|
GList ** klass_devices);
|
|
|
|
GValueArray* gst_v4l2_probe_get_values (GstPropertyProbe * probe, guint prop_id,
|
|
|
|
const GParamSpec * pspec,
|
|
|
|
GList ** klass_devices);
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2009-08-04 07:14:20 +00:00
|
|
|
GstCaps* gst_v4l2_object_probe_caps_for_format (GstV4l2Object *v4l2object, guint32 pixelformat,
|
|
|
|
const GstStructure * template);
|
|
|
|
|
|
|
|
GSList* gst_v4l2_object_get_format_list (GstV4l2Object *v4l2object);
|
|
|
|
|
|
|
|
GstCaps* gst_v4l2_object_get_all_caps (void);
|
|
|
|
|
|
|
|
GstStructure* gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc);
|
|
|
|
|
2011-07-12 18:03:32 +00:00
|
|
|
gboolean gst_v4l2_object_set_format (GstV4l2Object *v4l2object, GstCaps * caps);
|
2009-08-04 07:14:20 +00:00
|
|
|
|
2011-07-18 16:54:49 +00:00
|
|
|
gboolean gst_v4l2_object_unlock (GstV4l2Object *v4l2object);
|
|
|
|
gboolean gst_v4l2_object_unlock_stop (GstV4l2Object *v4l2object);
|
|
|
|
|
2011-07-13 16:32:00 +00:00
|
|
|
gboolean gst_v4l2_object_stop (GstV4l2Object *v4l2object);
|
|
|
|
|
|
|
|
|
2011-07-18 16:54:49 +00:00
|
|
|
gboolean gst_v4l2_object_copy (GstV4l2Object * v4l2object,
|
|
|
|
GstBuffer * dest, GstBuffer *src);
|
|
|
|
|
2009-08-04 07:14:20 +00:00
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
#define GST_IMPLEMENT_V4L2_PROBE_METHODS(Type_Class, interface_as_function) \
|
|
|
|
\
|
|
|
|
static void \
|
|
|
|
interface_as_function ## _probe_probe_property (GstPropertyProbe * probe, \
|
|
|
|
guint prop_id, \
|
|
|
|
const GParamSpec * pspec) \
|
|
|
|
{ \
|
2008-10-03 11:32:47 +00:00
|
|
|
Type_Class *this_class = (Type_Class*) G_OBJECT_GET_CLASS (probe); \
|
2006-05-11 17:59:59 +00:00
|
|
|
gst_v4l2_probe_probe_property (probe, prop_id, pspec, \
|
|
|
|
&this_class->v4l2_class_devices); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
interface_as_function ## _probe_needs_probe (GstPropertyProbe * probe, \
|
|
|
|
guint prop_id, \
|
|
|
|
const GParamSpec * pspec) \
|
|
|
|
{ \
|
2008-10-03 11:32:47 +00:00
|
|
|
Type_Class *this_class = (Type_Class*) G_OBJECT_GET_CLASS (probe); \
|
2006-05-11 17:59:59 +00:00
|
|
|
return gst_v4l2_probe_needs_probe (probe, prop_id, pspec, \
|
|
|
|
&this_class->v4l2_class_devices); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static GValueArray * \
|
|
|
|
interface_as_function ## _probe_get_values (GstPropertyProbe * probe, \
|
|
|
|
guint prop_id, \
|
|
|
|
const GParamSpec * pspec) \
|
|
|
|
{ \
|
2008-10-03 11:32:47 +00:00
|
|
|
Type_Class *this_class = (Type_Class*) G_OBJECT_GET_CLASS (probe); \
|
2006-05-11 17:59:59 +00:00
|
|
|
return gst_v4l2_probe_get_values (probe, prop_id, pspec, \
|
|
|
|
&this_class->v4l2_class_devices); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static void \
|
|
|
|
interface_as_function ## _property_probe_interface_init (GstPropertyProbeInterface * iface) \
|
|
|
|
{ \
|
|
|
|
iface->get_properties = gst_v4l2_probe_get_properties; \
|
|
|
|
iface->probe_property = interface_as_function ## _probe_probe_property; \
|
|
|
|
iface->needs_probe = interface_as_function ## _probe_needs_probe; \
|
|
|
|
iface->get_values = interface_as_function ## _probe_get_values; \
|
|
|
|
}
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2006-05-19 18:31:25 +00:00
|
|
|
#endif /* __GST_V4L2_OBJECT_H__ */
|