2003-11-06 21:51:14 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
#ifndef __GST_XIMAGESINK_H__
|
|
|
|
#define __GST_XIMAGESINK_H__
|
|
|
|
|
2004-03-02 02:10:28 +00:00
|
|
|
#include <gst/video/videosink.h>
|
2003-11-06 21:51:14 +00:00
|
|
|
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-04-16 23:42:12 +00:00
|
|
|
#include <sys/types.h>
|
2003-11-06 21:51:14 +00:00
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/shm.h>
|
2003-11-12 03:06:07 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2003-11-06 21:51:14 +00:00
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2003-11-06 21:51:14 +00:00
|
|
|
#include <X11/extensions/XShm.h>
|
2003-11-12 03:06:07 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2003-11-06 21:51:14 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
#define GST_TYPE_XIMAGESINK \
|
|
|
|
(gst_ximagesink_get_type())
|
|
|
|
#define GST_XIMAGESINK(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XIMAGESINK, GstXImageSink))
|
|
|
|
#define GST_XIMAGESINK_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XIMAGESINK, GstXImageSink))
|
|
|
|
#define GST_IS_XIMAGESINK(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XIMAGESINK))
|
|
|
|
#define GST_IS_XIMAGESINK_CLASS(obj) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XIMAGESINK))
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
typedef struct _GstXContext GstXContext;
|
|
|
|
typedef struct _GstXWindow GstXWindow;
|
|
|
|
typedef struct _GstXImage GstXImage;
|
|
|
|
|
|
|
|
typedef struct _GstXImageSink GstXImageSink;
|
|
|
|
typedef struct _GstXImageSinkClass GstXImageSinkClass;
|
|
|
|
|
|
|
|
/* Global X Context stuff */
|
2004-03-15 16:32:55 +00:00
|
|
|
struct _GstXContext {
|
2003-11-06 21:51:14 +00:00
|
|
|
Display *disp;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
Screen *screen;
|
|
|
|
gint screen_num;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
Visual *visual;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
Window root;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
gulong white, black;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
gint depth;
|
|
|
|
gint bpp;
|
|
|
|
gint endianness;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
gboolean use_xshm;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* XWindow stuff */
|
2004-03-15 16:32:55 +00:00
|
|
|
struct _GstXWindow {
|
2003-11-06 21:51:14 +00:00
|
|
|
Window win;
|
|
|
|
gint width, height;
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
gboolean internal;
|
2003-11-06 21:51:14 +00:00
|
|
|
GC gc;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* XImage stuff */
|
2004-03-15 16:32:55 +00:00
|
|
|
struct _GstXImage {
|
2004-01-11 22:52:29 +00:00
|
|
|
/* Reference to the ximagesink we belong to */
|
|
|
|
GstXImageSink *ximagesink;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
XImage *ximage;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2003-11-06 21:51:14 +00:00
|
|
|
XShmSegmentInfo SHMInfo;
|
2004-03-15 16:32:55 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
char *data;
|
|
|
|
gint width, height, size;
|
|
|
|
};
|
|
|
|
|
2004-03-15 16:32:55 +00:00
|
|
|
struct _GstXImageSink {
|
2003-11-06 21:51:14 +00:00
|
|
|
/* Our element stuff */
|
2003-11-19 20:43:49 +00:00
|
|
|
GstVideoSink videosink;
|
2004-01-04 18:53:53 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
char *display_name;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
GstXContext *xcontext;
|
|
|
|
GstXWindow *xwindow;
|
|
|
|
GstXImage *ximage;
|
2004-02-03 23:05:46 +00:00
|
|
|
GstXImage *cur_image;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
gdouble framerate;
|
2003-11-06 21:51:14 +00:00
|
|
|
GMutex *x_lock;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
/* Unused */
|
|
|
|
gint pixel_width, pixel_height;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
GstClockTime time;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
GMutex *pool_lock;
|
|
|
|
GSList *image_pool;
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2004-01-18 12:32:19 +00:00
|
|
|
gboolean synchronous;
|
2004-02-18 21:16:50 +00:00
|
|
|
gboolean sw_scaling_failed;
|
2003-11-06 21:51:14 +00:00
|
|
|
};
|
|
|
|
|
2004-03-15 16:32:55 +00:00
|
|
|
struct _GstXImageSinkClass {
|
2003-11-19 20:43:49 +00:00
|
|
|
GstVideoSinkClass parent_class;
|
2003-11-06 21:51:14 +00:00
|
|
|
};
|
|
|
|
|
2004-03-15 16:32:55 +00:00
|
|
|
GType gst_ximagesink_get_type(void);
|
2003-11-06 21:51:14 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
#endif /* __GST_XIMAGESINK_H__ */
|