2006-05-11 17:59:59 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2017-02-26 00:47:03 +00:00
|
|
|
* 2006 Edgard Lima <edgard.lima@gmail.com>
|
2006-09-02 14:28:55 +00:00
|
|
|
*
|
|
|
|
* 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
|
2012-11-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2006-05-11 17:59:59 +00:00
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
2017-07-24 18:19:02 +00:00
|
|
|
#include "ext/videodev2.h"
|
2017-07-13 00:49:47 +00:00
|
|
|
#ifdef HAVE_LIBV4L2
|
|
|
|
# include <libv4l2.h>
|
|
|
|
#endif
|
|
|
|
|
2016-06-07 20:04:52 +00:00
|
|
|
#include "v4l2-utils.h"
|
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
|
|
|
|
2011-07-13 14:33:58 +00:00
|
|
|
typedef struct _GstV4l2Object GstV4l2Object;
|
|
|
|
typedef struct _GstV4l2ObjectClassHelper GstV4l2ObjectClassHelper;
|
|
|
|
|
|
|
|
#include <gstv4l2bufferpool.h>
|
2009-08-04 07:14:20 +00:00
|
|
|
|
|
|
|
/* size of v4l2 buffer pool in streaming case */
|
2014-04-05 02:38:05 +00:00
|
|
|
#define GST_V4L2_MIN_BUFFERS 2
|
2009-08-04 07:14:20 +00:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
2013-11-28 21:59:59 +00:00
|
|
|
#define GST_TYPE_V4L2_IO_MODE (gst_v4l2_io_mode_get_type ())
|
|
|
|
GType gst_v4l2_io_mode_get_type (void);
|
|
|
|
|
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 {
|
2014-04-14 16:19:39 +00:00
|
|
|
GST_V4L2_IO_AUTO = 0,
|
|
|
|
GST_V4L2_IO_RW = 1,
|
|
|
|
GST_V4L2_IO_MMAP = 2,
|
|
|
|
GST_V4L2_IO_USERPTR = 3,
|
|
|
|
GST_V4L2_IO_DMABUF = 4,
|
|
|
|
GST_V4L2_IO_DMABUF_IMPORT = 5
|
2011-07-18 08:52:23 +00:00
|
|
|
} 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)
|
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
/* checks whether the current v4lv4l2object has already been open()'ed or not */
|
|
|
|
#define GST_V4L2_CHECK_OPEN(v4l2object) \
|
|
|
|
if (!GST_V4L2_IS_OPEN(v4l2object)) \
|
|
|
|
{ \
|
|
|
|
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, \
|
|
|
|
(_("Device is not open.")), (NULL)); \
|
|
|
|
return FALSE; \
|
|
|
|
}
|
|
|
|
|
|
|
|
/* checks whether the current v4lv4l2object is close()'ed or whether it is still open */
|
|
|
|
#define GST_V4L2_CHECK_NOT_OPEN(v4l2object) \
|
|
|
|
if (GST_V4L2_IS_OPEN(v4l2object)) \
|
|
|
|
{ \
|
|
|
|
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, \
|
|
|
|
(_("Device is open.")), (NULL)); \
|
|
|
|
return FALSE; \
|
|
|
|
}
|
|
|
|
|
|
|
|
/* checks whether we're out of capture mode or not */
|
|
|
|
#define GST_V4L2_CHECK_NOT_ACTIVE(v4l2object) \
|
|
|
|
if (GST_V4L2_IS_ACTIVE(v4l2object)) \
|
|
|
|
{ \
|
|
|
|
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, \
|
|
|
|
(NULL), ("Device is in streaming mode")); \
|
|
|
|
return FALSE; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
struct _GstV4l2Object {
|
|
|
|
GstElement * element;
|
2017-12-13 19:39:47 +00:00
|
|
|
GstObject * dbg_obj;
|
2006-05-11 17:59:59 +00:00
|
|
|
|
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;
|
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;
|
2014-03-27 22:41:07 +00:00
|
|
|
struct v4l2_format format;
|
2011-07-13 11:00:42 +00:00
|
|
|
GstVideoInfo info;
|
2014-04-15 19:07:23 +00:00
|
|
|
GstVideoAlignment align;
|
|
|
|
|
2014-03-19 21:00:56 +00:00
|
|
|
/* Features */
|
2014-04-15 19:07:23 +00:00
|
|
|
gboolean need_video_meta;
|
2014-03-19 21:00:56 +00:00
|
|
|
gboolean has_alpha_component;
|
2011-07-13 11:00:42 +00:00
|
|
|
|
2013-11-13 12:05:40 +00:00
|
|
|
/* only used if the device supports MPLANE
|
|
|
|
* nb planes is meaning of v4l2 planes
|
|
|
|
* the gstreamer equivalent is gst_buffer_n_memory
|
|
|
|
*/
|
|
|
|
gint n_v4l2_planes;
|
|
|
|
|
2014-05-06 16:58:59 +00:00
|
|
|
/* We cache the frame duration if known */
|
2011-07-13 09:19:28 +00:00
|
|
|
GstClockTime duration;
|
2011-07-12 16:13:42 +00:00
|
|
|
|
2014-05-06 16:55:30 +00:00
|
|
|
/* if the MPLANE device support both contiguous and non contiguous
|
2013-11-13 12:05:40 +00:00
|
|
|
* it allows to select which one we want. But we prefered_non_contiguous
|
|
|
|
* non contiguous mode.
|
|
|
|
*/
|
|
|
|
gboolean prefered_non_contiguous;
|
|
|
|
|
2013-12-19 20:26:52 +00:00
|
|
|
/* This will be set if supported in decide_allocation. It can be used to
|
2014-09-04 19:11:40 +00:00
|
|
|
* calculate the minimum latency. */
|
|
|
|
guint32 min_buffers;
|
2013-12-19 20:26:52 +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-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;
|
2016-07-02 08:56:07 +00:00
|
|
|
/* opened device specific capabilities */
|
|
|
|
guint32 device_caps;
|
2006-05-11 17:59:59 +00:00
|
|
|
|
|
|
|
/* lists... */
|
2009-08-04 07:14:20 +00:00
|
|
|
GSList *formats; /* list of available capture formats */
|
2012-10-22 21:58:07 +00:00
|
|
|
GstCaps *probed_caps;
|
2009-08-04 07:14:20 +00:00
|
|
|
|
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;
|
2013-05-20 14:45:37 +00:00
|
|
|
GData *controls;
|
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;
|
2013-05-20 14:45:37 +00:00
|
|
|
GstStructure *extra_controls;
|
2013-06-04 06:26:33 +00:00
|
|
|
gboolean keep_aspect;
|
|
|
|
GValue *par;
|
2006-05-11 17:59:59 +00:00
|
|
|
|
|
|
|
/* 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;
|
2013-06-05 03:42:24 +00:00
|
|
|
|
2017-07-24 18:19:02 +00:00
|
|
|
/* syscalls */
|
2017-07-24 20:45:40 +00:00
|
|
|
gint (*fd_open) (gint fd, gint v4l2_flags);
|
|
|
|
gint (*close) (gint fd);
|
|
|
|
gint (*dup) (gint fd);
|
|
|
|
gint (*ioctl) (gint fd, gulong request, ...);
|
|
|
|
gssize (*read) (gint fd, gpointer buffer, gsize n);
|
|
|
|
gpointer (*mmap) (gpointer start, gsize length, gint prot, gint flags,
|
|
|
|
gint fd, gint64 offset);
|
|
|
|
gint (*munmap) (gpointer _start, gsize length);
|
2017-07-24 18:19:02 +00:00
|
|
|
|
2013-06-05 03:42:24 +00:00
|
|
|
/* Quirks */
|
|
|
|
/* Skips interlacing probes */
|
|
|
|
gboolean never_interlaced;
|
2013-11-28 22:10:29 +00:00
|
|
|
/* Allow to skip reading initial format through G_FMT. Some devices
|
|
|
|
* just fails if you don't call S_FMT first. (ex: M2M decoders) */
|
|
|
|
gboolean no_initial_format;
|
2017-07-20 02:09:38 +00:00
|
|
|
/* Avoid any try_fmt probe. This is used by v4l2src to speedup start up time
|
|
|
|
* on slow USB firmwares. When this is set, gst_v4l2_set_format() will modify
|
|
|
|
* the caps to reflect what was negotiated during fixation */
|
|
|
|
gboolean skip_try_fmt_probes;
|
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
|
|
|
|
2013-05-29 19:44:31 +00:00
|
|
|
#define V4L2_STD_OBJECT_PROPS \
|
|
|
|
PROP_DEVICE, \
|
|
|
|
PROP_DEVICE_NAME, \
|
|
|
|
PROP_DEVICE_FD, \
|
|
|
|
PROP_FLAGS, \
|
|
|
|
PROP_BRIGHTNESS, \
|
|
|
|
PROP_CONTRAST, \
|
|
|
|
PROP_SATURATION, \
|
|
|
|
PROP_HUE, \
|
|
|
|
PROP_TV_NORM, \
|
|
|
|
PROP_IO_MODE, \
|
2014-05-15 22:08:53 +00:00
|
|
|
PROP_OUTPUT_IO_MODE, \
|
|
|
|
PROP_CAPTURE_IO_MODE, \
|
2013-05-29 19:44:31 +00:00
|
|
|
PROP_EXTRA_CONTROLS, \
|
|
|
|
PROP_PIXEL_ASPECT_RATIO, \
|
2013-06-04 06:26:33 +00:00
|
|
|
PROP_FORCE_ASPECT_RATIO
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2006-09-26 13:18:06 +00:00
|
|
|
/* create/destroy */
|
2013-05-29 19:44:31 +00:00
|
|
|
GstV4l2Object* gst_v4l2_object_new (GstElement * element,
|
2017-12-13 19:39:47 +00:00
|
|
|
GstObject * dbg_obj,
|
2013-05-29 19:44:31 +00:00
|
|
|
enum v4l2_buf_type type,
|
|
|
|
const char * default_device,
|
|
|
|
GstV4l2GetInOutFunction get_in_out_func,
|
|
|
|
GstV4l2SetInOutFunction set_in_out_func,
|
|
|
|
GstV4l2UpdateFpsFunction update_fps_func);
|
|
|
|
|
2017-07-13 00:49:47 +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
|
|
|
|
2013-05-29 19:44:31 +00:00
|
|
|
void gst_v4l2_object_install_properties_helper (GObjectClass * gobject_class,
|
|
|
|
const char * default_device);
|
2006-09-26 13:18:06 +00:00
|
|
|
|
2014-05-15 22:08:53 +00:00
|
|
|
void gst_v4l2_object_install_m2m_properties_helper (GObjectClass * gobject_class);
|
|
|
|
|
2013-05-29 19:44:31 +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 */
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_open (GstV4l2Object * v4l2object);
|
|
|
|
gboolean gst_v4l2_object_open_shared (GstV4l2Object * v4l2object, GstV4l2Object * other);
|
|
|
|
gboolean gst_v4l2_object_close (GstV4l2Object * v4l2object);
|
2006-09-26 13:18:06 +00:00
|
|
|
|
|
|
|
/* probing */
|
2006-05-11 17:59:59 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
GstCaps* gst_v4l2_object_get_all_caps (void);
|
2009-08-04 07:14:20 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
GstCaps* gst_v4l2_object_get_raw_caps (void);
|
2013-12-06 19:44:51 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
GstCaps* gst_v4l2_object_get_codec_caps (void);
|
2013-12-06 19:44:51 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gint gst_v4l2_object_extrapolate_stride (const GstVideoFormatInfo * finfo,
|
2014-10-06 15:30:06 +00:00
|
|
|
gint plane, gint stride);
|
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps, GstV4l2Error * error);
|
|
|
|
gboolean gst_v4l2_object_try_format (GstV4l2Object * v4l2object, GstCaps * caps, GstV4l2Error * error);
|
2009-08-04 07:14:20 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_caps_equal (GstV4l2Object * v4l2object, GstCaps * caps);
|
2013-05-17 08:16:48 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_unlock (GstV4l2Object * v4l2object);
|
|
|
|
gboolean gst_v4l2_object_unlock_stop (GstV4l2Object * v4l2object);
|
2011-07-18 16:54:49 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_stop (GstV4l2Object * v4l2object);
|
2011-07-13 16:32:00 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
GstCaps * gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter);
|
|
|
|
GstCaps * gst_v4l2_object_get_caps (GstV4l2Object * v4l2object, GstCaps * filter);
|
2012-10-22 21:58:07 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_acquire_format (GstV4l2Object * v4l2object, GstVideoInfo * info);
|
2014-03-20 19:31:22 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_set_crop (GstV4l2Object * obj);
|
2014-05-06 16:55:30 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_decide_allocation (GstV4l2Object * v4l2object, GstQuery * query);
|
2009-08-04 07:14:20 +00:00
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
gboolean gst_v4l2_object_propose_allocation (GstV4l2Object * obj, GstQuery * query);
|
2014-03-27 17:20:53 +00:00
|
|
|
|
2013-12-18 08:56:35 +00:00
|
|
|
GstStructure * gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc);
|
|
|
|
|
2017-07-13 00:49:47 +00:00
|
|
|
/* TODO Move to proper namespace */
|
|
|
|
/* open/close the device */
|
|
|
|
gboolean gst_v4l2_open (GstV4l2Object * v4l2object);
|
|
|
|
gboolean gst_v4l2_dup (GstV4l2Object * v4l2object, GstV4l2Object * other);
|
|
|
|
gboolean gst_v4l2_close (GstV4l2Object * v4l2object);
|
|
|
|
|
|
|
|
/* norm/input/output */
|
|
|
|
gboolean gst_v4l2_get_norm (GstV4l2Object * v4l2object, v4l2_std_id * norm);
|
|
|
|
gboolean gst_v4l2_set_norm (GstV4l2Object * v4l2object, v4l2_std_id norm);
|
|
|
|
gboolean gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input);
|
|
|
|
gboolean gst_v4l2_set_input (GstV4l2Object * v4l2object, gint input);
|
|
|
|
gboolean gst_v4l2_get_output (GstV4l2Object * v4l2object, gint * output);
|
|
|
|
gboolean gst_v4l2_set_output (GstV4l2Object * v4l2object, gint output);
|
|
|
|
|
|
|
|
/* frequency control */
|
|
|
|
gboolean gst_v4l2_get_frequency (GstV4l2Object * v4l2object, gint tunernum, gulong * frequency);
|
|
|
|
gboolean gst_v4l2_set_frequency (GstV4l2Object * v4l2object, gint tunernum, gulong frequency);
|
|
|
|
gboolean gst_v4l2_signal_strength (GstV4l2Object * v4l2object, gint tunernum, gulong * signal);
|
|
|
|
|
|
|
|
/* attribute control */
|
|
|
|
gboolean gst_v4l2_get_attribute (GstV4l2Object * v4l2object, int attribute, int * value);
|
|
|
|
gboolean gst_v4l2_set_attribute (GstV4l2Object * v4l2object, int attribute, const int value);
|
|
|
|
gboolean gst_v4l2_set_controls (GstV4l2Object * v4l2object, GstStructure * controls);
|
|
|
|
|
2006-05-11 17:59:59 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2006-05-19 18:31:25 +00:00
|
|
|
#endif /* __GST_V4L2_OBJECT_H__ */
|