Tizen 2.0 Release
[framework/multimedia/gst-plugins-good0.10.git] / sys / v4l2 / gstv4l2sink.h
1 /* GStreamer
2  *
3  * Copyright (C) 2009 Texas Instruments, Inc - http://www.ti.com/
4  *
5  * Description: V4L2 sink element
6  *  Created on: Jul 2, 2009
7  *      Author: Rob Clark <rob@ti.com>
8  *
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.
13  *
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.
18  *
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.
23  */
24
25 #ifndef __GSTV4L2SINK_H__
26 #define __GSTV4L2SINK_H__
27
28 #include <gst/video/gstvideosink.h>
29 #include <gstv4l2object.h>
30 #include <gstv4l2bufferpool.h>
31
32 GST_DEBUG_CATEGORY_EXTERN (v4l2sink_debug);
33
34
35 G_BEGIN_DECLS
36
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))
47
48 typedef struct _GstV4l2Sink GstV4l2Sink;
49 typedef struct _GstV4l2SinkClass GstV4l2SinkClass;
50
51
52 struct _GstV4l2Sink {
53   GstVideoSink videosink;
54
55   /*< private >*/
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;
60   guint32 num_buffers;
61   guint32 min_queued_bufs;
62
63   gint video_width, video_height;      /* original (unscaled) video w/h */
64
65   /*
66    * field to store requested overlay and crop top/left/width/height props:
67    * note, could maybe be combined with 'vwin' field in GstV4l2Object?
68    */
69   struct v4l2_rect overlay, crop;
70
71   /*
72    * bitmask to track which overlay and crop fields user has requested by
73    * setting properties:
74    */
75   guint8 overlay_fields_set, crop_fields_set;
76
77   guint8 state;
78 };
79
80 struct _GstV4l2SinkClass {
81   GstVideoSinkClass parent_class;
82
83   GList *v4l2_class_devices;
84 };
85
86 GType gst_v4l2sink_get_type(void);
87
88 G_END_DECLS
89
90
91 #endif /* __GSTV4L2SINK_H__ */