3 * Copyright (C) 2009 Texas Instruments, Inc - http://www.ti.com/
5 * Description: V4L2 sink element
6 * Created on: Jul 2, 2009
7 * Author: Rob Clark <rob@ti.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #ifndef __GSTV4L2SINK_H__
26 #define __GSTV4L2SINK_H__
28 #include <gst/video/gstvideosink.h>
29 #include <gstv4l2object.h>
30 #include <gstv4l2bufferpool.h>
32 GST_DEBUG_CATEGORY_EXTERN (v4l2sink_debug);
37 #define GST_TYPE_V4L2SINK \
38 (gst_v4l2sink_get_type())
39 #define GST_V4L2SINK(obj) \
40 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_V4L2SINK, GstV4l2Sink))
41 #define GST_V4L2SINK_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_V4L2SINK, GstV4l2SinkClass))
43 #define GST_IS_V4L2SINK(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_V4L2SINK))
45 #define GST_IS_V4L2SINK_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_V4L2SINK))
48 typedef struct _GstV4l2Sink GstV4l2Sink;
49 typedef struct _GstV4l2SinkClass GstV4l2SinkClass;
53 GstVideoSink videosink;
56 GstV4l2Object * v4l2object;
57 GstCaps *probed_caps; /* all supported caps of underlying v4l2 device */
58 GstCaps *current_caps; /* the current negotiated caps */
59 GstV4l2BufferPool *pool;
61 guint32 min_queued_bufs;
63 gint video_width, video_height; /* original (unscaled) video w/h */
66 * field to store requested overlay and crop top/left/width/height props:
67 * note, could maybe be combined with 'vwin' field in GstV4l2Object?
69 struct v4l2_rect overlay, crop;
72 * bitmask to track which overlay and crop fields user has requested by
75 guint8 overlay_fields_set, crop_fields_set;
80 struct _GstV4l2SinkClass {
81 GstVideoSinkClass parent_class;
83 GList *v4l2_class_devices;
86 GType gst_v4l2sink_get_type(void);
91 #endif /* __GSTV4L2SINK_H__ */