v4l2: guard use of ENODATA with #ifdef
[platform/upstream/gst-plugins-good.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., 51 Franklin St, Fifth Floor,
22  * Boston, MA 02110-1301, 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
58   gint video_width, video_height;      /* original (unscaled) video w/h */
59
60   /*
61    * field to store requested overlay and crop top/left/width/height props:
62    * note, could maybe be combined with 'vwin' field in GstV4l2Object?
63    */
64   struct v4l2_rect overlay, crop;
65
66   /*
67    * bitmask to track which overlay and crop fields user has requested by
68    * setting properties:
69    */
70   guint8 overlay_fields_set, crop_fields_set;
71 };
72
73 struct _GstV4l2SinkClass {
74   GstVideoSinkClass parent_class;
75
76   GList *v4l2_class_devices;
77 };
78
79 GType gst_v4l2sink_get_type(void);
80
81 G_END_DECLS
82
83
84 #endif /* __GSTV4L2SINK_H__ */