v4l2bufferpool: Copy flags and timestamp when importing
[platform/upstream/gst-plugins-good.git] / sys / v4l2 / gstv4l2src.h
1 /* GStreamer
2  *
3  * Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
4  *               2006 Edgard Lima <edgard.lima@gmail.com>
5  *
6  * gstv4l2src.h: BT8x8/V4L2 source element
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23
24 #ifndef __GST_V4L2SRC_H__
25 #define __GST_V4L2SRC_H__
26
27 #include <gstv4l2object.h>
28 #include <gstv4l2bufferpool.h>
29
30 GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);
31
32 G_BEGIN_DECLS
33
34 #define GST_TYPE_V4L2SRC \
35   (gst_v4l2src_get_type())
36 #define GST_V4L2SRC(obj) \
37   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_V4L2SRC,GstV4l2Src))
38 #define GST_V4L2SRC_CLASS(klass) \
39   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4L2SRC,GstV4l2SrcClass))
40 #define GST_IS_V4L2SRC(obj) \
41   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4L2SRC))
42 #define GST_IS_V4L2SRC_CLASS(klass) \
43   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4L2SRC))
44
45 typedef struct _GstV4l2Src GstV4l2Src;
46 typedef struct _GstV4l2SrcClass GstV4l2SrcClass;
47
48 /**
49  * GstV4l2Src:
50  *
51  * Opaque object.
52  */
53 struct _GstV4l2Src
54 {
55   GstPushSrc pushsrc;
56
57   /*< private >*/
58   GstV4l2Object * v4l2object;
59
60   guint64 offset;
61
62   /* offset adjust after renegotiation */
63   guint64 renegotiation_adjust;
64
65   GstClockTime ctrl_time;
66
67   gboolean pending_set_fmt;
68
69   /* Timestamp sanity check */
70   GstClockTime last_timestamp;
71   gboolean has_bad_timestamp;
72 };
73
74 struct _GstV4l2SrcClass
75 {
76   GstPushSrcClass parent_class;
77
78   GList *v4l2_class_devices;
79 };
80
81 GType gst_v4l2src_get_type (void);
82
83 G_END_DECLS
84
85 #endif /* __GST_V4L2SRC_H__ */