4 * Header file for Video Display Driver Sink Module for Gstreamer
5 * implementation on DM644x device
7 * Copyright (C) 2007 Texas Instruments, Inc.
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation version 2.1 of the License.
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
19 #ifndef __FBVIDEOSINK_DEMUX_H__
20 #define __FBVIDEOSINK_DEMUX_H__
25 #include <sys/ioctl.h>
26 #include <sys/types.h>
35 #include <ti/sdo/ce/video/viddec.h>
36 #include <ti/sdo/ce/CERuntime.h>
37 #include <ti/sdo/ce/Engine.h>
38 #include <ti/sdo/ce/trace/gt.h>
39 #include <ti/sdo/ce/osal/Memory.h>
42 #define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
43 #define FBIO_SETPOSX _IOW('F', 0x22, u_int32_t)
44 #define FBIO_SETPOSY _IOW('F', 0x23, u_int32_t)
47 #define MAX_NO_OF_CMEM_OUTPUT_BUFFERS 15
52 #include <gst/video/gstvideosink.h>
56 #define GST_TYPE_FBVIDEOSINK (gst_fbvideosink_get_type())
57 #define GST_FBVIDEOSINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_FBVIDEOSINK, GstFbVideoSink))
58 #define GST_FBVIDEOSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) , GST_TYPE_FBVIDEOSINK, GstFbVideoSink))
59 #define GST_FBVIDEOSINK_GET_CLASS(klass) (G_TYPE_INSTANCE_GET_CLASS((klass),GST_TYPE_FBVIDEOSINK,GstFbVideoSinkClass))
60 #define GST_IS_FBVIDEOSINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_FBVIDEOSINK))
61 #define GST_IS_FBVIDEOSINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass) , GST_TYPE_FBVIDEOSINK))
62 typedef struct _GstFbVideoSink GstFbVideoSink;
63 typedef struct _GstFbVideoSinkClass GstFbVideoSinkClass;
64 typedef struct _GstFbContext GstFbContext;
65 typedef struct _GstFbImageFormat GstFbImageFormat;
66 typedef struct _GstFbImageBuffer GstFbImageBuffer;
67 typedef struct _GstFbImageBufferClass GstFbImageBufferClass;
70 The Context of the Frame Buffer Device
73 #define DEFAULT_DEVICE "/dev/fb/3"
75 //#define SLOW_MEMCOPY
83 #define D1_MAX_HEIGHT 576
86 struct _GstFbContext {
88 struct fb_var_screeninfo vScreenInfo;
89 struct fb_fix_screeninfo fScreenInfo;
90 guint8 *data; //pointer to the mapped memory
92 gint noofbuffers; //no of buffers that will be used 1 - single, 2- double....
93 // gint bufferIndex; //index to the cur buffer
94 gint bpp; //bits per pixel
95 gint depth; //color depth
96 gint endianness; //endianess
97 gint width; //width in px
98 gint height; //height in px
99 gint widthmm; //width in mm
100 gint heightmm; //height in mm
101 GValue *par; //calculated pixel aspect ratio
102 GList *formats_list; //list of formats supported by the frame buffer device
104 GstCaps *caps; //capabilities to latch on to the fbdev
106 //allocation of hardware buffers
112 struct _GstFbImageFormat {
117 struct _GstFbImageBuffer {
119 GstFbVideoSink *fbvideosink;
126 struct _GstFbVideoSink {
128 GstVideoSink videosink;
130 GstFbContext *fbcontext;
131 GstFbImageBuffer *fbimage;
132 GstFbImageBuffer *cur_image;
137 /* object-set pixel aspect ratio */
141 GSList *cmem_buffers_list;
143 /* width and height of the incoming vid frames */
148 guint framesDisplayed;
149 guint8 buffers_allocated;
154 struct _GstFbVideoSinkClass {
155 GstVideoSinkClass parent_class;
158 struct cmem_buffers_node
166 GType gst_fbvideosink_get_type(void);