2003-11-10 18:22:20 +00:00
|
|
|
/* GStreamer
|
2005-11-27 18:12:23 +00:00
|
|
|
* Copyright (C) <2005> Julien Moutte <julien@moutte.net>
|
2003-11-10 18:22:20 +00:00
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2003-11-10 18:22:20 +00:00
|
|
|
*/
|
2004-07-19 11:21:10 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
#ifndef __GST_XV_IMAGE_SINK_H__
|
|
|
|
#define __GST_XV_IMAGE_SINK_H__
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-11-28 17:32:55 +00:00
|
|
|
#include <gst/video/gstvideosink.h>
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2011-06-22 13:38:24 +00:00
|
|
|
/* Helper functions */
|
|
|
|
#include <gst/video/video.h>
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
G_BEGIN_DECLS
|
2015-07-03 19:48:52 +00:00
|
|
|
#define GST_TYPE_XV_IMAGE_SINK \
|
|
|
|
(gst_xv_image_sink_get_type())
|
|
|
|
#define GST_XV_IMAGE_SINK(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_XV_IMAGE_SINK, GstXvImageSink))
|
|
|
|
#define GST_XV_IMAGE_SINK_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_XV_IMAGE_SINK, GstXvImageSinkClass))
|
|
|
|
#define GST_IS_XV_IMAGE_SINK(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_XV_IMAGE_SINK))
|
|
|
|
#define GST_IS_XV_IMAGE_SINK_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_XV_IMAGE_SINK))
|
2004-07-19 11:21:10 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
typedef struct _GstXvImageSink GstXvImageSink;
|
|
|
|
typedef struct _GstXvImageSinkClass GstXvImageSinkClass;
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
#include "xvimageallocator.h"
|
2011-04-06 10:26:47 +00:00
|
|
|
#include "xvimagepool.h"
|
2013-03-13 10:13:58 +00:00
|
|
|
#include "xvcontext.h"
|
2011-02-25 14:49:33 +00:00
|
|
|
|
2005-11-27 11:41:55 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:
|
|
|
|
* @display_name: the name of the Display we want to render to
|
2013-03-13 10:13:58 +00:00
|
|
|
* @xvcontext: our instance's #GstXvContext
|
2005-11-27 11:41:55 +00:00
|
|
|
* @xwindow: the #GstXWindow we are rendering to
|
|
|
|
* @cur_image: a reference to the last #GstXvImage that was put to @xwindow. It
|
|
|
|
* is used when Expose events are received to redraw the latest video frame
|
|
|
|
* @event_thread: a thread listening for events on @xwindow and handling them
|
|
|
|
* @running: used to inform @event_thread if it should run/shutdown
|
|
|
|
* @fps_n: the framerate fraction numerator
|
|
|
|
* @fps_d: the framerate fraction denominator
|
|
|
|
* @x_lock: used to protect X calls as we are not using the XLib in threaded
|
|
|
|
* mode
|
|
|
|
* @flow_lock: used to protect data flow routines from external calls such as
|
2012-12-10 13:35:37 +00:00
|
|
|
* events from @event_thread or methods from the #GstVideoOverlay interface
|
2013-03-13 10:13:58 +00:00
|
|
|
* @par: used to override calculated pixel aspect ratio from @xvcontext
|
2005-11-27 11:41:55 +00:00
|
|
|
* @pool_lock: used to protect the buffer pool
|
|
|
|
* @image_pool: a list of #GstXvImageBuffer that could be reused at next buffer
|
|
|
|
* allocation call
|
2007-04-20 10:42:24 +00:00
|
|
|
* @synchronous: used to store if XSynchronous should be used or not (for
|
2005-11-27 11:41:55 +00:00
|
|
|
* debugging purpose only)
|
|
|
|
* @keep_aspect: used to remember if reverse negotiation scaling should respect
|
|
|
|
* aspect ratio
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
* @handle_events: used to know if we should handle select XEvents or not
|
2005-11-27 11:41:55 +00:00
|
|
|
* @brightness: used to store the user settings for color balance brightness
|
|
|
|
* @contrast: used to store the user settings for color balance contrast
|
|
|
|
* @hue: used to store the user settings for color balance hue
|
|
|
|
* @saturation: used to store the user settings for color balance saturation
|
|
|
|
* @cb_changed: used to store if the color balance settings where changed
|
|
|
|
* @video_width: the width of incoming video frames in pixels
|
|
|
|
* @video_height: the height of incoming video frames in pixels
|
|
|
|
*
|
|
|
|
* The #GstXvImageSink data structure.
|
|
|
|
*/
|
2011-04-06 10:26:47 +00:00
|
|
|
struct _GstXvImageSink
|
|
|
|
{
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Our element stuff */
|
2003-11-19 20:43:49 +00:00
|
|
|
GstVideoSink videosink;
|
2004-07-19 11:21:10 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
GstXvContextConfig config;
|
|
|
|
GstXvContext *context;
|
|
|
|
GstXvImageAllocator *allocator;
|
2003-11-10 18:22:20 +00:00
|
|
|
GstXWindow *xwindow;
|
2011-02-24 10:57:53 +00:00
|
|
|
GstBuffer *cur_image;
|
2007-04-20 10:42:24 +00:00
|
|
|
|
2005-11-27 11:41:55 +00:00
|
|
|
GThread *event_thread;
|
|
|
|
gboolean running;
|
2004-07-19 11:21:10 +00:00
|
|
|
|
2011-06-22 13:38:24 +00:00
|
|
|
GstVideoInfo info;
|
|
|
|
|
2011-02-24 10:57:53 +00:00
|
|
|
/* Framerate numerator and denominator */
|
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
|
|
|
gint fps_n;
|
|
|
|
gint fps_d;
|
2007-04-20 10:42:24 +00:00
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
GMutex flow_lock;
|
2004-07-19 11:21:10 +00:00
|
|
|
|
2005-11-27 11:41:55 +00:00
|
|
|
/* object-set pixel aspect ratio */
|
|
|
|
GValue *par;
|
2007-04-20 10:42:24 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
/* the buffer pool */
|
|
|
|
GstBufferPool *pool;
|
2007-04-20 10:42:24 +00:00
|
|
|
|
2005-11-27 11:41:55 +00:00
|
|
|
gboolean synchronous;
|
2007-07-14 18:33:15 +00:00
|
|
|
gboolean double_buffer;
|
2005-11-27 11:41:55 +00:00
|
|
|
gboolean keep_aspect;
|
2008-09-04 13:46:52 +00:00
|
|
|
gboolean redraw_border;
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
gboolean handle_events;
|
2007-07-14 18:20:41 +00:00
|
|
|
gboolean handle_expose;
|
2007-04-20 10:42:24 +00:00
|
|
|
|
2008-07-29 08:59:32 +00:00
|
|
|
/* size of incoming video, used as the size for XvImage */
|
|
|
|
guint video_width, video_height;
|
|
|
|
|
2008-09-04 13:46:52 +00:00
|
|
|
gboolean draw_borders;
|
2011-04-06 10:26:47 +00:00
|
|
|
|
2009-06-22 08:40:33 +00:00
|
|
|
/* stream metadata */
|
|
|
|
gchar *media_title;
|
2003-11-10 18:22:20 +00:00
|
|
|
};
|
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
struct _GstXvImageSinkClass
|
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
GstVideoSinkClass parent_class;
|
2003-11-10 18:22:20 +00:00
|
|
|
};
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
GType gst_xv_image_sink_get_type (void);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
2015-07-03 19:48:52 +00:00
|
|
|
#endif /* __GST_XV_IMAGE_SINK_H__ */
|