3 * gstv4lmjpegsrc.h: hardware MJPEG video source element
5 * Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_V4LMJPEGSRC_H__
24 #define __GST_V4LMJPEGSRC_H__
26 #include <gstv4lelement.h>
28 #include <videodev_mjpeg.h>
32 #define GST_TYPE_V4LMJPEGSRC \
33 (gst_v4lmjpegsrc_get_type())
34 #define GST_V4LMJPEGSRC(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_V4LMJPEGSRC,GstV4lMjpegSrc))
36 #define GST_V4LMJPEGSRC_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4LMJPEGSRC,GstV4lMjpegSrcClass))
38 #define GST_IS_V4LMJPEGSRC(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4LMJPEGSRC))
40 #define GST_IS_V4LMJPEGSRC_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4LMJPEGSRC))
43 typedef struct _GstV4lMjpegSrc GstV4lMjpegSrc;
44 typedef struct _GstV4lMjpegSrcClass GstV4lMjpegSrcClass;
46 struct _GstV4lMjpegSrc {
47 GstV4lElement v4lelement;
52 /* buffer/capture info */
53 struct mjpeg_sync bsync;
54 struct mjpeg_requestbuffers breq;
56 /* num of queued frames and some GThread stuff
57 * to wait if there's not enough */
58 gint8 *frame_queue_state;
59 GMutex *mutex_queue_state;
60 GCond *cond_queue_state;
64 /* True if we want to stop */
65 gboolean quit, is_capturing;
67 /* A/V sync... frame counter and internal cache */
77 /* time to substract from clock time to get back to timestamp */
78 GstClockTime substract_time;
80 /* how often are we going to use each frame? */
83 /* how are we going to push buffers? */
84 gboolean use_fixed_fps;
87 gint end_width, end_height;
101 struct _GstV4lMjpegSrcClass {
102 GstV4lElementClass parent_class;
104 void (*frame_capture) (GObject *object);
105 void (*frame_drop) (GObject *object);
106 void (*frame_insert) (GObject *object);
107 void (*frame_lost) (GObject *object,
111 GType gst_v4lmjpegsrc_get_type(void);
116 #endif /* __GST_V4LMJPEGSRC_H__ */