00001
00021 #ifndef GSTSHVIDEOBUFFER_H
00022 #define GSTSHVIDEOBUFFER_H
00023
00024 #include <linux/videodev2.h>
00025 #include <uiomux/uiomux.h>
00026 #include <gst/gst.h>
00027 #include <gst/video/video.h>
00028
00029
00030 #include <shveu/shveu.h>
00031
00032 #define GST_TYPE_SH_VIDEO_BUFFER (gst_sh_video_buffer_get_type())
00033 #define GST_IS_SH_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SH_VIDEO_BUFFER))
00034 #define GST_SH_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SH_VIDEO_BUFFER, GstSHVideoBuffer))
00035 #define GST_SH_VIDEO_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_SH_VIDEO_BUFFER, GstSHVideoBufferclass))
00036 #define GST_SH_VIDEO_BUFFER_CAST(obj) ((GstSHVideoBuffer *)(obj))
00037
00038 typedef struct _GstSHVideoBuffer GstSHVideoBuffer;
00039 typedef struct _GstSHVideoBufferclass GstSHVideoBufferclass;
00040
00046 struct _GstSHVideoBuffer
00047 {
00048 GstBuffer buffer;
00049
00050 UIOMux *uiomux;
00051 int format;
00052 int allocated;
00053 gint allocated_size;
00054 };
00055
00060 struct _GstSHVideoBufferclass
00061 {
00062 GstBufferClass parent;
00063 };
00064
00069 GType gst_sh_video_buffer_get_type (void);
00070
00074 GstBuffer *gst_sh_video_buffer_new(UIOMux *uiomux, gint width, gint height, int fmt);
00075
00076
00077
00078
00079
00080 #ifndef GST_VIDEO_FORMAT_NV12
00081 #define GST_VIDEO_FORMAT_NV12 (1000)
00082 #endif
00083 #ifndef GST_VIDEO_FORMAT_NV16
00084 #define GST_VIDEO_FORMAT_NV16 (1001)
00085 #endif
00086 #ifndef GST_VIDEO_FORMAT_RGB16
00087 #define GST_VIDEO_FORMAT_RGB16 (1002)
00088 #endif
00089
00090
00091
00092 int gst_sh_video_format_get_size(GstVideoFormat format, int width, int height);
00093
00094
00095 gboolean gst_sh_video_format_parse_caps (
00096 GstCaps *caps,
00097 GstVideoFormat *format,
00098 int *width,
00099 int *height);
00100
00101 gboolean gst_caps_to_renesas_format (GstCaps *caps, ren_vid_format_t *ren_format);
00102
00103 int get_renesas_format (GstVideoFormat format);
00104
00105 void *get_c_addr (void *y, ren_vid_format_t ren_format, int width, int height);
00106
00107 #endif //GSTSHVIDEOBUFFER_H