1 /* GStreamer android.hardware.Camera Source
2  *
3  * Copyright (C) 2012, Cisco Systems, Inc.
4  *   Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
5  *
6  * Copyright (C) 2015, Collabora Ltd.
7  *   Author: Justin Kim <justin.kim@collabora.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., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24 
25 #ifndef __GST_AHC_SRC_H__
26 #define __GST_AHC_SRC_H__
27 
28 #include <gst/gst.h>
29 #include <gst/base/gstpushsrc.h>
30 #include <gst/base/gstdataqueue.h>
31 
32 #include "gst-android-hardware-camera.h"
33 #include "gstamcsurfacetexture.h"
34 
35 G_BEGIN_DECLS
36 
37 #define GST_TYPE_AHC_SRC \
38   (gst_ahc_src_get_type())
39 #define GST_AHC_SRC(obj) \
40   (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AHC_SRC, GstAHCSrc))
41 #define GST_AHC_SRC_CLASS(klass) \
42   (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AHC_SRC, GstAHCSrcClass))
43 #define GST_IS_AHC_SRC(obj) \
44   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AHC_SRC))
45 #define GST_IS_AHC_SRC_CLASS(klass) \
46   (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AHC_SRC))
47 
48 
49 typedef struct _GstAHCSrc GstAHCSrc;
50 typedef struct _GstAHCSrcClass GstAHCSrcClass;
51 
52 /**
53  * GstAHCSrc:
54  *
55  * Opaque data structure.
56  */
57 struct _GstAHCSrc
58 {
59   /*< private >*/
60   GstPushSrc parent;
61 
62   GstAHCamera *camera;
63   GstAmcSurfaceTexture *texture;
64   GList *data;
65   GstDataQueue *queue;
66   gint buffer_size;
67   GstClockTime previous_ts;
68   gint format;
69   gint width;
70   gint height;
71   gint fps_min;
72   gint fps_max;
73   gboolean start;
74   gboolean smooth_zoom;
75   GMutex mutex;
76 
77   /* Properties */
78   gint device;
79 };
80 
81 struct _GstAHCSrcClass
82 {
83   GstPushSrcClass parent_class;
84 };
85 
86 GType gst_ahc_src_get_type (void);
87 
88 G_END_DECLS
89 #endif /* __GST_AHC_SRC_H__ */
90