Imported Upstream version 0.10.23
[profile/ivi/gst-plugins-bad.git] / ext / directfb / dfbvideosink.h
1 /* GStreamer DirectFB plugin
2  * Copyright (C) 2005 Julien MOUTTE <julien@moutte.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19  
20 #ifndef __GST_DFBVIDEOSINK_H__
21 #define __GST_DFBVIDEOSINK_H__
22
23 #include <gst/video/gstvideosink.h>
24
25 #include <directfb.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_TYPE_DFBVIDEOSINK              (gst_dfbvideosink_get_type())
30 #define GST_DFBVIDEOSINK(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DFBVIDEOSINK, GstDfbVideoSink))
31 #define GST_DFBVIDEOSINK_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DFBVIDEOSINK, GstDfbVideoSinkClass))
32 #define GST_IS_DFBVIDEOSINK(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DFBVIDEOSINK))
33 #define GST_IS_DFBVIDEOSINK_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DFBVIDEOSINK))
34
35 typedef struct _GstDfbVideoSink GstDfbVideoSink;
36 typedef struct _GstDfbVideoSinkClass GstDfbVideoSinkClass;
37
38 #define GST_TYPE_DFBSURFACE (gst_dfbsurface_get_type())
39
40 #define GST_IS_DFBSURFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DFBSURFACE))
41 #define GST_DFBSURFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DFBSURFACE, GstDfbSurface))
42
43 typedef struct _GstDfbSurface GstDfbSurface;
44   
45 struct _GstDfbSurface {
46   GstBuffer buffer; /* We extend GstBuffer */
47   
48   IDirectFBSurface *surface;
49   
50   gint width;
51   gint height;
52   
53   gboolean locked;
54   
55   DFBSurfacePixelFormat pixel_format;
56   
57   GstDfbVideoSink *dfbvideosink;
58 };
59
60 typedef struct _GstDfbVMode GstDfbVMode;
61
62 struct _GstDfbVMode {
63   gint width;
64   gint height;
65   gint bpp;
66 };
67
68 /**
69  * GstDfbVideoSink:
70  *
71  * The opaque #GstDfbVideoSink structure.
72  */
73 struct _GstDfbVideoSink {
74   GstVideoSink videosink;
75   
76   /* < private > */
77   GMutex *pool_lock;
78   GSList *buffer_pool;
79   
80   /* Framerate numerator and denominator */
81   gint fps_n;
82   gint fps_d;
83   
84   gint video_width, video_height; /* size of incoming video */
85   gint out_width, out_height;
86   
87   /* Standalone */
88   IDirectFB *dfb;
89   
90   GSList *vmodes; /* Video modes */
91   
92   gint layer_id;
93   IDirectFBDisplayLayer *layer;
94   IDirectFBSurface *primary;
95   IDirectFBEventBuffer *event_buffer;
96   GThread *event_thread;
97   
98   /* Embedded */
99   IDirectFBSurface *ext_surface;
100   
101   DFBSurfacePixelFormat pixel_format;
102   
103   gboolean hw_scaling;
104   gboolean backbuffer;
105   gboolean vsync;
106   gboolean setup;
107   gboolean running;
108   
109   /* Color balance */
110   GList *cb_channels;
111   gint brightness;
112   gint contrast;
113   gint hue;
114   gint saturation;
115   gboolean cb_changed;
116   
117   /* object-set pixel aspect ratio */
118   GValue *par;
119 };
120
121 struct _GstDfbVideoSinkClass {
122   GstVideoSinkClass parent_class;
123 };
124
125 GType gst_dfbvideosink_get_type (void);
126 GType gst_dfbsurface_get_type (void);
127
128 G_END_DECLS
129
130 #endif /* __GST_DFBVIDEOSINK_H__ */