gstv4l2src.h 2.5 KB
Newer Older
Edgard Lima's avatar
Edgard Lima committed
1
2
3
/* GStreamer
 *
 * Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
4
5
6
 *               2006 Edgard Lima <edgard.lima@indt.org.br>
 *
 * gstv4l2src.h: BT8x8/V4L2 source element
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * 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
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __GST_V4L2SRC_H__
#define __GST_V4L2SRC_H__

27
#include <gstv4l2object.h>
Rob Clark's avatar
Rob Clark committed
28
#include <gstv4l2bufferpool.h>
29

30
31
GST_DEBUG_CATEGORY_EXTERN (v4l2src_debug);

Edgard Lima's avatar
Edgard Lima committed
32
G_BEGIN_DECLS
Stefan Kost's avatar
Stefan Kost committed
33

34
#define GST_TYPE_V4L2SRC \
Edgard Lima's avatar
Edgard Lima committed
35
  (gst_v4l2src_get_type())
36
#define GST_V4L2SRC(obj) \
Edgard Lima's avatar
Edgard Lima committed
37
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_V4L2SRC,GstV4l2Src))
38
#define GST_V4L2SRC_CLASS(klass) \
Edgard Lima's avatar
Edgard Lima committed
39
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4L2SRC,GstV4l2SrcClass))
40
#define GST_IS_V4L2SRC(obj) \
Edgard Lima's avatar
Edgard Lima committed
41
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4L2SRC))
42
#define GST_IS_V4L2SRC_CLASS(klass) \
Edgard Lima's avatar
Edgard Lima committed
43
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4L2SRC))
Stefan Kost's avatar
Stefan Kost committed
44

Edgard Lima's avatar
Edgard Lima committed
45
46
47
typedef struct _GstV4l2Src GstV4l2Src;
typedef struct _GstV4l2SrcClass GstV4l2SrcClass;

48
typedef GstFlowReturn (*GstV4l2SrcGetFunc)(GstV4l2Src * v4l2src, GstBuffer ** buf);
49

50
51
52
53
54
55
/**
 * GstV4l2Src:
 * @pushsrc: parent #GstPushSrc.
 *
 * Opaque object.
 */
Edgard Lima's avatar
Edgard Lima committed
56
57
struct _GstV4l2Src
{
58
59
  GstPushSrc pushsrc;

60
  /*< private >*/
61
  GstV4l2Object * v4l2object;
62

Edgard Lima's avatar
Edgard Lima committed
63
  /* pads */
64
65
  GstCaps *probed_caps;

Stefan Kost's avatar
Stefan Kost committed
66
  /* buffer handling */
Edgard Lima's avatar
Edgard Lima committed
67
  GstV4l2BufferPool *pool;
68

69
70
71
  guint32 num_buffers;
  gboolean use_mmap;
  guint32 frame_byte_size;
72

73
74
75
  /* if the buffer will be or not used from directly mmap */
  gboolean always_copy;

Edgard Lima's avatar
Edgard Lima committed
76
  /* True if we want to stop */
77
78
  gboolean quit;
  gboolean is_capturing;
79

80
  guint64 offset;
81
82

  gint     fps_d, fps_n;       /* framerate if device is open */
Stefan Kost's avatar
Stefan Kost committed
83
  GstClockTime duration;       /* duration of one frame */
84
85
  
  GstV4l2SrcGetFunc get_frame;
Edgard Lima's avatar
Edgard Lima committed
86
};
87

Edgard Lima's avatar
Edgard Lima committed
88
89
struct _GstV4l2SrcClass
{
90
91
92
  GstPushSrcClass parent_class;
  
  GList *v4l2_class_devices;
93
94
};

Edgard Lima's avatar
Edgard Lima committed
95
96
97
GType gst_v4l2src_get_type (void);

G_END_DECLS
98

99
#endif /* __GST_V4L2SRC_H__ */