3 * gstv4lmjpegsink.h: hardware MJPEG video sink 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_V4LMJPEGSINK_H__
24 #define __GST_V4LMJPEGSINK_H__
26 #include <gstv4lelement.h>
28 #include <videodev_mjpeg.h>
34 #define GST_TYPE_V4LMJPEGSINK \
35 (gst_v4lmjpegsink_get_type())
36 #define GST_V4LMJPEGSINK(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_V4LMJPEGSINK,GstV4lMjpegSink))
38 #define GST_V4LMJPEGSINK_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_V4LMJPEGSINK,GstV4lMjpegSinkClass))
40 #define GST_IS_V4LMJPEGSINK(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_V4LMJPEGSINK))
42 #define GST_IS_V4LMJPEGSINK_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_V4LMJPEGSINK))
45 typedef struct _GstV4lMjpegSink GstV4lMjpegSink;
46 typedef struct _GstV4lMjpegSinkClass GstV4lMjpegSinkClass;
48 struct _GstV4lMjpegSink {
49 GstV4lElement v4lelement;
54 /* frame properties for common players */
55 gint frames_displayed;
58 /* system clock object */
61 /* buffer/capture info */
62 struct mjpeg_sync bsync;
63 struct mjpeg_requestbuffers breq;
65 /* thread to keep track of synced frames */
66 gint8 *isqueued_queued_frames; /* 1 = queued, 0 = unqueued, -1 = error */
67 GThread *thread_queued_frames;
68 GMutex *mutex_queued_frames;
69 GCond **cond_queued_frames;
72 /* width/height/norm of the jpeg stream */
82 gint bufsize; /* in KB */
85 struct _GstV4lMjpegSinkClass {
86 GstV4lElementClass parent_class;
89 void (*frame_displayed) (GstElement *element);
92 GType gst_v4lmjpegsink_get_type(void);
97 #endif /* __GST_SDLVIDEOSINK_H__ */