gstreamer/sys/xvimage/xvimagesink.h
Jan Schmidt 0e82871285 Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00

174 lines
3.8 KiB
C

/* GStreamer
* Copyright (C) <2003> Julien Moutte <julien@moutte.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_XVIMAGESINK_H__
#define __GST_XVIMAGESINK_H__
#include <gst/video/videosink.h>
#ifdef HAVE_XSHM
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#endif /* HAVE_XSHM */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef HAVE_XSHM
#include <X11/extensions/XShm.h>
#endif /* HAVE_XSHM */
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <string.h>
#include <math.h>
G_BEGIN_DECLS
#define GST_TYPE_XVIMAGESINK \
(gst_xvimagesink_get_type())
#define GST_XVIMAGESINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XVIMAGESINK, GstXvImageSink))
#define GST_XVIMAGESINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XVIMAGESINK, GstXvImageSink))
#define GST_IS_XVIMAGESINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XVIMAGESINK))
#define GST_IS_XVIMAGESINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XVIMAGESINK))
typedef struct _GstXContext GstXContext;
typedef struct _GstXWindow GstXWindow;
typedef struct _GstXvImageFormat GstXvImageFormat;
typedef struct _GstXvImageBuffer GstXvImageBuffer;
typedef struct _GstXvImageBufferClass GstXvImageBufferClass;
typedef struct _GstXvImageSink GstXvImageSink;
typedef struct _GstXvImageSinkClass GstXvImageSinkClass;
/* Global X Context stuff */
struct _GstXContext {
Display *disp;
Screen *screen;
gint screen_num;
Visual *visual;
Window root;
gulong white, black;
gint depth;
gint bpp;
gint endianness;
gint width, height;
gint widthmm, heightmm;
GValue *par; /* calculated pixel aspect ratio */
gboolean use_xshm;
XvPortID xv_port_id;
gint im_format;
GList *formats_list;
GList *channels_list;
GstCaps *caps;
};
/* XWindow stuff */
struct _GstXWindow {
Window win;
gint width, height;
gboolean internal;
GC gc;
};
/* XvImage format stuff */
struct _GstXvImageFormat {
gint format;
GstCaps *caps;
};
/* XvImage stuff */
struct _GstXvImageBuffer {
GstBuffer buffer;
/* Reference to the xvimagesink we belong to */
GstXvImageSink *xvimagesink;
XvImage *xvimage;
#ifdef HAVE_XSHM
XShmSegmentInfo SHMInfo;
#endif /* HAVE_XSHM */
gint width, height, size, im_format;
};
struct _GstXvImageSink {
/* Our element stuff */
GstVideoSink videosink;
char *display_name;
GstXContext *xcontext;
GstXWindow *xwindow;
GstXvImageBuffer *xvimage;
GstXvImageBuffer *cur_image;
gint fps_n;
gint fps_d;
gint brightness;
gint contrast;
gint hue;
gint saturation;
gboolean cb_changed;
GMutex *x_lock;
GMutex *flow_lock;
GThread *event_thread;
guint video_width, video_height; /* size of incoming video;
* used as the size for XvImage */
GValue *par; /* object-set pixel aspect ratio */
GMutex *pool_lock;
GSList *image_pool;
gboolean synchronous;
gboolean running;
gboolean keep_aspect;
};
struct _GstXvImageSinkClass {
GstVideoSinkClass parent_class;
};
GType gst_xvimagesink_get_type(void);
G_END_DECLS
#endif /* __GST_XVIMAGESINK_H__ */