Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
/* GStreamer
|
2006-04-28 16:15:20 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Zaheer Merali <zaheerabbas at merali dot org>
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +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-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
*/
|
|
|
|
|
2006-03-31 16:32:47 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-ximagesrc
|
|
|
|
*
|
|
|
|
* This element captures your X Display and creates raw RGB video. It uses
|
|
|
|
* the XDamage extension if available to only capture areas of the screen that
|
|
|
|
* have changed since the last frame. It uses the XFixes extension if
|
2006-04-28 16:15:20 +00:00
|
|
|
* available to also capture your mouse pointer. By default it will fixate to
|
|
|
|
* 25 frames per second.
|
2009-01-29 08:10:08 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
2006-03-31 16:32:47 +00:00
|
|
|
* <title>Example pipelines</title>
|
2009-01-29 08:10:08 +00:00
|
|
|
* |[
|
2012-08-26 21:39:55 +00:00
|
|
|
* gst-launch-1.0 ximagesrc ! video/x-raw,framerate=5/1 ! videoconvert ! theoraenc ! oggmux ! filesink location=desktop.ogg
|
2009-01-29 08:10:08 +00:00
|
|
|
* ]| Encodes your X display to an Ogg theora video at 5 frames per second.
|
2006-03-31 16:32:47 +00:00
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2006-04-28 18:57:09 +00:00
|
|
|
#include "gstximagesrc.h"
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2006-04-07 15:27:40 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/gst-i18n-plugin.h>
|
2012-03-05 11:03:01 +00:00
|
|
|
#include <gst/video/video.h>
|
2006-04-07 15:27:40 +00:00
|
|
|
|
2011-12-12 02:30:45 +00:00
|
|
|
#include "gst/glib-compat-private.h"
|
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_debug_ximage_src);
|
|
|
|
#define GST_CAT_DEFAULT gst_debug_ximage_src
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
static GstStaticPadTemplate t =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
2012-03-05 11:03:01 +00:00
|
|
|
GST_STATIC_CAPS ("video/x-raw, "
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
"framerate = (fraction) [ 0, MAX ], "
|
2006-03-31 17:52:36 +00:00
|
|
|
"width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ], "
|
|
|
|
"pixel-aspect-ratio = (fraction) [ 0, MAX ]"));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_DISPLAY_NAME,
|
2006-03-17 16:34:36 +00:00
|
|
|
PROP_SCREEN_NUM,
|
2006-07-08 19:03:54 +00:00
|
|
|
PROP_SHOW_POINTER,
|
2006-07-08 22:41:25 +00:00
|
|
|
PROP_USE_DAMAGE,
|
|
|
|
PROP_STARTX,
|
|
|
|
PROP_STARTY,
|
|
|
|
PROP_ENDX,
|
2010-11-29 12:36:06 +00:00
|
|
|
PROP_ENDY,
|
|
|
|
PROP_REMOTE,
|
2011-09-20 11:11:47 +00:00
|
|
|
PROP_XID,
|
|
|
|
PROP_XNAME,
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
};
|
|
|
|
|
2011-07-10 12:56:00 +00:00
|
|
|
#define gst_ximage_src_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE (GstXImageSrc, gst_ximage_src, GST_TYPE_PUSH_SRC);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2012-03-11 18:06:37 +00:00
|
|
|
static GstCaps *gst_ximage_src_fixate (GstBaseSrc * bsrc, GstCaps * caps);
|
2006-04-28 16:51:33 +00:00
|
|
|
static void gst_ximage_src_clear_bufpool (GstXImageSrc * ximagesrc);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
/* Called when a buffer is returned from the pipeline */
|
|
|
|
static void
|
2011-02-24 12:51:32 +00:00
|
|
|
gst_ximage_src_return_buf (GstXImageSrc * ximagesrc, GstBuffer * ximage)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2011-02-27 18:43:13 +00:00
|
|
|
GstMetaXImage *meta = GST_META_XIMAGE_GET (ximage);
|
2011-02-24 12:51:32 +00:00
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
/* If our geometry changed we can't reuse that image. */
|
2011-02-25 15:29:38 +00:00
|
|
|
if ((meta->width != ximagesrc->width) || (meta->height != ximagesrc->height)) {
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesrc,
|
|
|
|
"destroy image %p as its size changed %dx%d vs current %dx%d",
|
2011-02-25 15:29:38 +00:00
|
|
|
ximage, meta->width, meta->height, ximagesrc->width, ximagesrc->height);
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&ximagesrc->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
gst_ximageutil_ximage_destroy (ximagesrc->xcontext, ximage);
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&ximagesrc->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
} else {
|
|
|
|
/* In that case we can reuse the image and add it to our image pool. */
|
|
|
|
GST_LOG_OBJECT (ximagesrc, "recycling image %p in pool", ximage);
|
|
|
|
/* need to increment the refcount again to recycle */
|
2011-02-24 12:51:32 +00:00
|
|
|
gst_buffer_ref (ximage);
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&ximagesrc->pool_lock);
|
2011-08-09 08:05:31 +00:00
|
|
|
GST_BUFFER_FLAGS (GST_BUFFER (ximage)) = 0; /* clear out any flags from the previous use */
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
ximagesrc->buffer_pool = g_slist_prepend (ximagesrc->buffer_pool, ximage);
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&ximagesrc->pool_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-20 11:11:47 +00:00
|
|
|
static Window
|
|
|
|
gst_ximage_src_find_window (GstXImageSrc * src, Window root, const char *name)
|
|
|
|
{
|
|
|
|
Window *children;
|
|
|
|
Window window = 0, root_return, parent_return;
|
|
|
|
unsigned int nchildren;
|
|
|
|
char *tmpname;
|
|
|
|
int n, status;
|
|
|
|
|
|
|
|
status = XFetchName (src->xcontext->disp, root, &tmpname);
|
|
|
|
if (status && !strcmp (name, tmpname))
|
|
|
|
return root;
|
|
|
|
|
|
|
|
status =
|
|
|
|
XQueryTree (src->xcontext->disp, root, &root_return, &parent_return,
|
|
|
|
&children, &nchildren);
|
|
|
|
if (!status || !children)
|
|
|
|
return (Window) 0;
|
|
|
|
|
|
|
|
for (n = 0; n < nchildren; ++n) {
|
|
|
|
window = gst_ximage_src_find_window (src, children[n], name);
|
|
|
|
if (window != 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
XFree (children);
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
static gboolean
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_open_display (GstXImageSrc * s, const gchar * name)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XIMAGE_SRC (s), FALSE);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
if (s->xcontext != NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&s->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
s->xcontext = ximageutil_xcontext_get (GST_ELEMENT (s), name);
|
2007-03-01 10:44:36 +00:00
|
|
|
if (s->xcontext == NULL) {
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&s->x_lock);
|
2007-03-01 10:44:36 +00:00
|
|
|
GST_ELEMENT_ERROR (s, RESOURCE, OPEN_READ,
|
|
|
|
("Could not open X display for reading"),
|
|
|
|
("NULL returned from getting xcontext"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
s->width = s->xcontext->width;
|
|
|
|
s->height = s->xcontext->height;
|
|
|
|
|
|
|
|
s->xwindow = s->xcontext->root;
|
2011-09-20 11:11:47 +00:00
|
|
|
if (s->xid != 0 || s->xname) {
|
|
|
|
int status;
|
|
|
|
XWindowAttributes attrs;
|
|
|
|
Window window;
|
|
|
|
|
|
|
|
if (s->xid != 0) {
|
|
|
|
status = XGetWindowAttributes (s->xcontext->disp, s->xid, &attrs);
|
|
|
|
if (status) {
|
2011-09-29 14:41:53 +00:00
|
|
|
GST_DEBUG_OBJECT (s, "Found window XID %" G_GUINT64_FORMAT, s->xid);
|
2011-09-20 11:11:47 +00:00
|
|
|
s->xwindow = s->xid;
|
|
|
|
goto window_found;
|
|
|
|
} else {
|
2011-09-29 14:41:53 +00:00
|
|
|
GST_WARNING_OBJECT (s, "Failed to get window %" G_GUINT64_FORMAT
|
|
|
|
" attributes", s->xid);
|
2011-09-20 11:11:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (s->xname) {
|
|
|
|
GST_DEBUG_OBJECT (s, "Looking for window %s", s->xname);
|
|
|
|
window = gst_ximage_src_find_window (s, s->xcontext->root, s->xname);
|
|
|
|
if (window != 0) {
|
2011-09-29 14:41:53 +00:00
|
|
|
GST_DEBUG_OBJECT (s, "Found window named %s, ", s->xname);
|
2011-09-20 11:11:47 +00:00
|
|
|
status = XGetWindowAttributes (s->xcontext->disp, window, &attrs);
|
|
|
|
if (status) {
|
|
|
|
s->xwindow = window;
|
|
|
|
goto window_found;
|
|
|
|
} else {
|
2011-09-29 14:41:53 +00:00
|
|
|
GST_WARNING_OBJECT (s, "Failed to get window attributes for "
|
|
|
|
"window named %s", s->xname);
|
2011-09-20 11:11:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_INFO_OBJECT (s, "Using root window");
|
|
|
|
goto use_root_window;
|
|
|
|
|
|
|
|
window_found:
|
|
|
|
g_assert (s->xwindow != 0);
|
|
|
|
s->width = attrs.width;
|
|
|
|
s->height = attrs.height;
|
2011-09-29 14:41:53 +00:00
|
|
|
GST_INFO_OBJECT (s, "Using default window size of %dx%d",
|
2011-09-20 11:11:47 +00:00
|
|
|
s->width, s->height);
|
|
|
|
}
|
|
|
|
use_root_window:
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
/* check if xfixes supported */
|
|
|
|
{
|
|
|
|
int error_base;
|
|
|
|
|
|
|
|
if (XFixesQueryExtension (s->xcontext->disp, &s->fixes_event_base,
|
|
|
|
&error_base)) {
|
|
|
|
s->have_xfixes = TRUE;
|
|
|
|
GST_DEBUG_OBJECT (s, "X Server supports XFixes");
|
|
|
|
} else {
|
2006-03-17 16:34:36 +00:00
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GST_DEBUG_OBJECT (s, "X Server does not support XFixes");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_XDAMAGE
|
|
|
|
/* check if xdamage is supported */
|
|
|
|
{
|
|
|
|
int error_base;
|
|
|
|
long evmask = NoEventMask;
|
|
|
|
|
2008-02-12 13:34:52 +00:00
|
|
|
s->have_xdamage = FALSE;
|
|
|
|
s->damage = None;
|
|
|
|
s->damage_copy_gc = None;
|
|
|
|
s->damage_region = None;
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
if (XDamageQueryExtension (s->xcontext->disp, &s->damage_event_base,
|
|
|
|
&error_base)) {
|
|
|
|
s->damage =
|
2007-05-11 16:11:04 +00:00
|
|
|
XDamageCreate (s->xcontext->disp, s->xwindow, XDamageReportNonEmpty);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
if (s->damage != None) {
|
|
|
|
s->damage_region = XFixesCreateRegion (s->xcontext->disp, NULL, 0);
|
|
|
|
if (s->damage_region != None) {
|
|
|
|
XGCValues values;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (s, "Using XDamage extension");
|
|
|
|
values.subwindow_mode = IncludeInferiors;
|
|
|
|
s->damage_copy_gc = XCreateGC (s->xcontext->disp,
|
|
|
|
s->xwindow, GCSubwindowMode, &values);
|
|
|
|
XSelectInput (s->xcontext->disp, s->xwindow, evmask);
|
|
|
|
|
|
|
|
s->have_xdamage = TRUE;
|
|
|
|
} else {
|
|
|
|
XDamageDestroy (s->xcontext->disp, s->damage);
|
|
|
|
s->damage = None;
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
GST_DEBUG_OBJECT (s, "Could not attach to XDamage");
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (s, "X Server does not have XDamage extension");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&s->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
if (s->xcontext == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_start (GstBaseSrc * basesrc)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *s = GST_XIMAGE_SRC (basesrc);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
s->last_frame_no = -1;
|
2007-05-11 10:31:27 +00:00
|
|
|
#ifdef HAVE_XDAMAGE
|
2008-10-03 15:54:07 +00:00
|
|
|
if (s->last_ximage)
|
|
|
|
gst_buffer_unref (GST_BUFFER_CAST (s->last_ximage));
|
2007-05-11 10:31:27 +00:00
|
|
|
s->last_ximage = NULL;
|
|
|
|
#endif
|
2007-06-11 11:41:56 +00:00
|
|
|
return gst_ximage_src_open_display (s, s->display_name);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_stop (GstBaseSrc * basesrc)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *src = GST_XIMAGE_SRC (basesrc);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2008-10-08 09:29:00 +00:00
|
|
|
#ifdef HAVE_XDAMAGE
|
2008-10-03 15:54:07 +00:00
|
|
|
if (src->last_ximage)
|
|
|
|
gst_buffer_unref (GST_BUFFER_CAST (src->last_ximage));
|
|
|
|
src->last_ximage = NULL;
|
2008-10-08 09:29:00 +00:00
|
|
|
#endif
|
2008-10-03 15:54:07 +00:00
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_clear_bufpool (src);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2008-10-08 09:29:00 +00:00
|
|
|
#ifdef HAVE_XFIXES
|
2008-10-03 15:54:07 +00:00
|
|
|
if (src->cursor_image)
|
|
|
|
XFree (src->cursor_image);
|
|
|
|
src->cursor_image = NULL;
|
2008-10-08 09:29:00 +00:00
|
|
|
#endif
|
2008-10-03 15:54:07 +00:00
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
if (src->xcontext) {
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&src->x_lock);
|
2008-02-12 11:09:08 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XDAMAGE
|
|
|
|
if (src->damage_copy_gc != None) {
|
|
|
|
XFreeGC (src->xcontext->disp, src->damage_copy_gc);
|
|
|
|
src->damage_copy_gc = None;
|
|
|
|
}
|
|
|
|
if (src->damage_region != None) {
|
|
|
|
XFixesDestroyRegion (src->xcontext->disp, src->damage_region);
|
|
|
|
src->damage_region = None;
|
|
|
|
}
|
|
|
|
if (src->damage != None) {
|
|
|
|
XDamageDestroy (src->xcontext->disp, src->damage);
|
|
|
|
src->damage = None;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
ximageutil_xcontext_clear (src->xcontext);
|
|
|
|
src->xcontext = NULL;
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&src->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_unlock (GstBaseSrc * basesrc)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *src = GST_XIMAGE_SRC (basesrc);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
/* Awaken the create() func if it's waiting on the clock */
|
|
|
|
GST_OBJECT_LOCK (src);
|
|
|
|
if (src->clock_id) {
|
|
|
|
GST_DEBUG_OBJECT (src, "Waking up waiting clock");
|
|
|
|
gst_clock_id_unschedule (src->clock_id);
|
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (src);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_recalc (GstXImageSrc * src)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
|
|
|
if (!src->xcontext)
|
|
|
|
return FALSE;
|
|
|
|
|
2006-04-07 15:53:43 +00:00
|
|
|
/* Maybe later we can check the display hasn't changed size */
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
/* We could use XQueryPointer to get only the current window. */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
static void
|
|
|
|
composite_pixel (GstXContext * xcontext, guchar * dest, guchar * src)
|
|
|
|
{
|
|
|
|
guint8 r = src[2];
|
|
|
|
guint8 g = src[1];
|
|
|
|
guint8 b = src[0];
|
|
|
|
guint8 a = src[3];
|
2006-03-31 15:21:35 +00:00
|
|
|
guint8 dr, dg, db;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
guint32 color;
|
2006-03-31 15:21:35 +00:00
|
|
|
gint r_shift, r_max, r_shift_out;
|
|
|
|
gint g_shift, g_max, g_shift_out;
|
|
|
|
gint b_shift, b_max, b_shift_out;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
switch (xcontext->bpp) {
|
|
|
|
case 8:
|
|
|
|
color = *dest;
|
|
|
|
break;
|
|
|
|
case 16:
|
2006-12-24 11:36:31 +00:00
|
|
|
color = GUINT16_FROM_LE (*(guint16 *) (dest));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
|
|
|
color = GUINT32_FROM_LE (*(guint32 *) (dest));
|
|
|
|
break;
|
|
|
|
default:
|
2006-04-07 15:27:40 +00:00
|
|
|
/* Should not reach here */
|
2007-12-26 16:03:57 +00:00
|
|
|
g_return_if_reached ();
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
2006-04-07 15:27:40 +00:00
|
|
|
/* possible optimisation:
|
|
|
|
* move the code that finds shift and max in the _link function */
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
for (r_shift = 0; !(xcontext->visual->red_mask & (1 << r_shift)); r_shift++);
|
|
|
|
for (g_shift = 0; !(xcontext->visual->green_mask & (1 << g_shift));
|
|
|
|
g_shift++);
|
|
|
|
for (b_shift = 0; !(xcontext->visual->blue_mask & (1 << b_shift)); b_shift++);
|
|
|
|
|
2006-03-31 15:21:35 +00:00
|
|
|
for (r_shift_out = 0; !(xcontext->visual->red_mask & (1 << r_shift_out));
|
|
|
|
r_shift_out++);
|
|
|
|
for (g_shift_out = 0; !(xcontext->visual->green_mask & (1 << g_shift_out));
|
|
|
|
g_shift_out++);
|
|
|
|
for (b_shift_out = 0; !(xcontext->visual->blue_mask & (1 << b_shift_out));
|
|
|
|
b_shift_out++);
|
|
|
|
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
r_max = (xcontext->visual->red_mask >> r_shift);
|
|
|
|
b_max = (xcontext->visual->blue_mask >> b_shift);
|
|
|
|
g_max = (xcontext->visual->green_mask >> g_shift);
|
|
|
|
|
|
|
|
#define RGBXXX_R(x) (((x)>>r_shift) & (r_max))
|
|
|
|
#define RGBXXX_G(x) (((x)>>g_shift) & (g_max))
|
|
|
|
#define RGBXXX_B(x) (((x)>>b_shift) & (b_max))
|
|
|
|
|
|
|
|
dr = (RGBXXX_R (color) * 255) / r_max;
|
|
|
|
dg = (RGBXXX_G (color) * 255) / g_max;
|
|
|
|
db = (RGBXXX_B (color) * 255) / b_max;
|
|
|
|
|
|
|
|
dr = (r * a + (0xff - a) * dr) / 0xff;
|
|
|
|
dg = (g * a + (0xff - a) * dg) / 0xff;
|
|
|
|
db = (b * a + (0xff - a) * db) / 0xff;
|
|
|
|
|
2006-03-31 15:21:35 +00:00
|
|
|
color = (((dr * r_max) / 255) << r_shift_out) +
|
|
|
|
(((dg * g_max) / 255) << g_shift_out) +
|
|
|
|
(((db * b_max) / 255) << b_shift_out);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
switch (xcontext->bpp) {
|
|
|
|
case 8:
|
|
|
|
*dest = color;
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
*(guint16 *) (dest) = color;
|
|
|
|
break;
|
|
|
|
case 32:
|
|
|
|
*(guint32 *) (dest) = color;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_warning ("bpp %d not supported\n", xcontext->bpp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-11-21 19:31:31 +00:00
|
|
|
#ifdef HAVE_XDAMAGE
|
2011-07-10 12:56:00 +00:00
|
|
|
static void
|
|
|
|
copy_buffer (GstBuffer * dest, GstBuffer * src)
|
|
|
|
{
|
2012-01-24 13:38:58 +00:00
|
|
|
GstMapInfo map;
|
2011-07-10 12:56:00 +00:00
|
|
|
|
2012-01-24 13:38:58 +00:00
|
|
|
gst_buffer_map (src, &map, GST_MAP_READ);
|
|
|
|
gst_buffer_fill (dest, 0, map.data, map.size);
|
|
|
|
gst_buffer_unmap (src, &map);
|
2011-07-10 12:56:00 +00:00
|
|
|
}
|
2011-11-21 19:31:31 +00:00
|
|
|
#endif
|
2011-07-10 12:56:00 +00:00
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
/* Retrieve an XImageSrcBuffer, preferably from our
|
|
|
|
* pool of existing images and populate it from the window */
|
2011-02-24 12:51:32 +00:00
|
|
|
static GstBuffer *
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2011-02-24 12:51:32 +00:00
|
|
|
GstBuffer *ximage = NULL;
|
2011-02-25 15:29:38 +00:00
|
|
|
GstMetaXImage *meta;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&ximagesrc->pool_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
while (ximagesrc->buffer_pool != NULL) {
|
|
|
|
ximage = ximagesrc->buffer_pool->data;
|
|
|
|
|
2011-02-27 18:43:13 +00:00
|
|
|
meta = GST_META_XIMAGE_GET (ximage);
|
2011-02-24 12:51:32 +00:00
|
|
|
|
2011-02-25 15:29:38 +00:00
|
|
|
if ((meta->width != ximagesrc->width) ||
|
|
|
|
(meta->height != ximagesrc->height)) {
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
gst_ximage_buffer_free (ximage);
|
|
|
|
}
|
|
|
|
|
|
|
|
ximagesrc->buffer_pool = g_slist_delete_link (ximagesrc->buffer_pool,
|
|
|
|
ximagesrc->buffer_pool);
|
|
|
|
}
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&ximagesrc->pool_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
if (ximage == NULL) {
|
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "creating image (%dx%d)",
|
|
|
|
ximagesrc->width, ximagesrc->height);
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&ximagesrc->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
ximage = gst_ximageutil_ximage_new (ximagesrc->xcontext,
|
|
|
|
GST_ELEMENT (ximagesrc), ximagesrc->width, ximagesrc->height,
|
2006-04-28 16:51:33 +00:00
|
|
|
(BufferReturnFunc) (gst_ximage_src_return_buf));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
if (ximage == NULL) {
|
|
|
|
GST_ELEMENT_ERROR (ximagesrc, RESOURCE, WRITE, (NULL),
|
2010-06-16 17:30:25 +00:00
|
|
|
("could not create a %dx%d ximage", ximagesrc->width,
|
|
|
|
ximagesrc->height));
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&ximagesrc->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&ximagesrc->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XIMAGE_SRC (ximagesrc), NULL);
|
2011-02-24 12:51:32 +00:00
|
|
|
|
2011-02-27 18:43:13 +00:00
|
|
|
meta = GST_META_XIMAGE_GET (ximage);
|
2011-02-24 12:51:32 +00:00
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
#ifdef HAVE_XDAMAGE
|
2007-05-11 16:11:04 +00:00
|
|
|
if (ximagesrc->have_xdamage && ximagesrc->use_damage &&
|
|
|
|
ximagesrc->last_ximage != NULL) {
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
XEvent ev;
|
|
|
|
|
2007-05-11 10:31:27 +00:00
|
|
|
/* have_frame is TRUE when either the entire screen has been
|
|
|
|
* grabbed or when the last image has been copied */
|
|
|
|
gboolean have_frame = FALSE;
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Retrieving screen using XDamage");
|
|
|
|
|
|
|
|
do {
|
|
|
|
XNextEvent (ximagesrc->xcontext->disp, &ev);
|
|
|
|
|
2007-05-11 16:11:04 +00:00
|
|
|
if (ev.type == ximagesrc->damage_event_base + XDamageNotify) {
|
|
|
|
XserverRegion parts;
|
|
|
|
XRectangle *rects;
|
|
|
|
int nrects;
|
|
|
|
|
|
|
|
parts = XFixesCreateRegion (ximagesrc->xcontext->disp, 0, 0);
|
|
|
|
XDamageSubtract (ximagesrc->xcontext->disp, ximagesrc->damage, None,
|
|
|
|
parts);
|
|
|
|
/* Now copy out all of the damaged rectangles. */
|
|
|
|
rects = XFixesFetchRegion (ximagesrc->xcontext->disp, parts, &nrects);
|
|
|
|
if (rects != NULL) {
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!have_frame) {
|
|
|
|
GST_LOG_OBJECT (ximagesrc,
|
2011-11-22 01:40:39 +00:00
|
|
|
"Copying from last frame ximage->size: %" G_GSIZE_FORMAT,
|
2011-07-10 12:56:00 +00:00
|
|
|
gst_buffer_get_size (ximage));
|
|
|
|
copy_buffer (ximage, ximagesrc->last_ximage);
|
2007-05-11 16:11:04 +00:00
|
|
|
have_frame = TRUE;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
2007-05-11 16:11:04 +00:00
|
|
|
for (i = 0; i < nrects; i++) {
|
|
|
|
GST_LOG_OBJECT (ximagesrc,
|
|
|
|
"Damaged sub-region @ %d,%d size %dx%d reported",
|
|
|
|
rects[i].x, rects[i].y, rects[i].width, rects[i].height);
|
|
|
|
|
|
|
|
/* if we only want a small area, clip this damage region to
|
|
|
|
* area we want */
|
|
|
|
if (ximagesrc->endx > ximagesrc->startx &&
|
|
|
|
ximagesrc->endy > ximagesrc->starty) {
|
|
|
|
/* see if damage area intersects */
|
2010-11-27 17:15:32 +00:00
|
|
|
if (rects[i].x + rects[i].width - 1 < ximagesrc->startx ||
|
2007-05-11 16:11:04 +00:00
|
|
|
rects[i].x > ximagesrc->endx) {
|
|
|
|
/* trivial reject */
|
2010-11-27 17:15:32 +00:00
|
|
|
} else if (rects[i].y + rects[i].height - 1 < ximagesrc->starty ||
|
2007-05-11 16:11:04 +00:00
|
|
|
rects[i].y > ximagesrc->endy) {
|
|
|
|
/* trivial reject */
|
|
|
|
} else {
|
|
|
|
/* find intersect region */
|
|
|
|
int startx, starty, width, height;
|
|
|
|
|
|
|
|
startx = (rects[i].x < ximagesrc->startx) ? ximagesrc->startx :
|
|
|
|
rects[i].x;
|
|
|
|
starty = (rects[i].y < ximagesrc->starty) ? ximagesrc->starty :
|
|
|
|
rects[i].y;
|
2010-11-27 17:15:32 +00:00
|
|
|
width = (rects[i].x + rects[i].width - 1 < ximagesrc->endx) ?
|
2007-05-11 16:11:04 +00:00
|
|
|
rects[i].x + rects[i].width - startx :
|
2010-11-27 17:15:32 +00:00
|
|
|
ximagesrc->endx - startx + 1;
|
|
|
|
height = (rects[i].y + rects[i].height - 1 < ximagesrc->endy) ?
|
2007-05-11 16:11:04 +00:00
|
|
|
rects[i].y + rects[i].height - starty : ximagesrc->endy -
|
2010-11-27 17:15:32 +00:00
|
|
|
starty + 1;
|
2007-05-11 16:11:04 +00:00
|
|
|
|
2007-05-11 10:31:27 +00:00
|
|
|
GST_LOG_OBJECT (ximagesrc,
|
2007-05-11 16:11:04 +00:00
|
|
|
"Retrieving damaged sub-region @ %d,%d size %dx%d as intersect region",
|
|
|
|
startx, starty, width, height);
|
|
|
|
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
|
|
|
startx, starty, width, height, AllPlanes, ZPixmap,
|
2011-02-25 15:29:38 +00:00
|
|
|
meta->ximage, startx - ximagesrc->startx,
|
2007-05-11 16:11:04 +00:00
|
|
|
starty - ximagesrc->starty);
|
2007-05-11 10:31:27 +00:00
|
|
|
}
|
2007-05-11 16:11:04 +00:00
|
|
|
} else {
|
2007-05-11 10:31:27 +00:00
|
|
|
|
2006-07-08 22:41:25 +00:00
|
|
|
GST_LOG_OBJECT (ximagesrc,
|
2007-05-11 16:11:04 +00:00
|
|
|
"Retrieving damaged sub-region @ %d,%d size %dx%d",
|
|
|
|
rects[i].x, rects[i].y, rects[i].width, rects[i].height);
|
|
|
|
|
2006-07-08 22:41:25 +00:00
|
|
|
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
2007-05-11 16:11:04 +00:00
|
|
|
rects[i].x, rects[i].y,
|
|
|
|
rects[i].width, rects[i].height,
|
2011-02-25 15:29:38 +00:00
|
|
|
AllPlanes, ZPixmap, meta->ximage, rects[i].x, rects[i].y);
|
2007-05-11 10:31:27 +00:00
|
|
|
}
|
2006-07-08 22:41:25 +00:00
|
|
|
}
|
2007-05-11 16:11:04 +00:00
|
|
|
free (rects);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (XPending (ximagesrc->xcontext->disp));
|
2007-05-11 10:31:27 +00:00
|
|
|
if (!have_frame) {
|
|
|
|
GST_LOG_OBJECT (ximagesrc,
|
2011-11-22 01:40:39 +00:00
|
|
|
"Copying from last frame ximage->size: %" G_GSIZE_FORMAT,
|
2011-07-10 12:56:00 +00:00
|
|
|
gst_buffer_get_size (ximage));
|
|
|
|
copy_buffer (ximage, ximagesrc->last_ximage);
|
2007-05-11 10:31:27 +00:00
|
|
|
}
|
2006-03-31 15:21:35 +00:00
|
|
|
#ifdef HAVE_XFIXES
|
2006-07-08 22:41:25 +00:00
|
|
|
/* re-get area where last mouse pointer was but only if in our clipping
|
|
|
|
* bounds */
|
2006-03-31 15:21:35 +00:00
|
|
|
if (ximagesrc->cursor_image) {
|
|
|
|
gint x, y, width, height;
|
|
|
|
|
|
|
|
x = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot;
|
|
|
|
y = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot;
|
|
|
|
width = ximagesrc->cursor_image->width;
|
|
|
|
height = ximagesrc->cursor_image->height;
|
|
|
|
|
|
|
|
/* bounds checking */
|
|
|
|
if (x < 0)
|
|
|
|
x = 0;
|
|
|
|
if (y < 0)
|
|
|
|
y = 0;
|
2006-07-08 22:41:25 +00:00
|
|
|
if (x + width > ximagesrc->xcontext->width)
|
|
|
|
width = ximagesrc->xcontext->width - x;
|
|
|
|
if (y + height > ximagesrc->xcontext->height)
|
|
|
|
height = ximagesrc->xcontext->height - y;
|
2006-03-31 15:21:35 +00:00
|
|
|
g_assert (x >= 0);
|
|
|
|
g_assert (y >= 0);
|
2006-07-08 22:41:25 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesrc,
|
|
|
|
"Cursor was at (%d,%d) width: %d, height: %d and our range is: (%d,%d) - (%d,%d)",
|
|
|
|
x, y, width, height, ximagesrc->startx, ximagesrc->starty,
|
|
|
|
ximagesrc->endx, ximagesrc->endy);
|
|
|
|
/* only get where cursor last was, if it is in our range */
|
|
|
|
if (ximagesrc->endx > ximagesrc->startx &&
|
|
|
|
ximagesrc->endy > ximagesrc->starty) {
|
|
|
|
/* check bounds */
|
|
|
|
if (x + width < ximagesrc->startx || x > ximagesrc->endx) {
|
|
|
|
/* trivial reject */
|
|
|
|
} else if (y + height < ximagesrc->starty || y > ximagesrc->endy) {
|
|
|
|
/* trivial reject */
|
|
|
|
} else {
|
|
|
|
/* find intersect region */
|
|
|
|
int startx, starty, iwidth, iheight;
|
|
|
|
|
|
|
|
startx = (x < ximagesrc->startx) ? ximagesrc->startx : x;
|
|
|
|
starty = (y < ximagesrc->starty) ? ximagesrc->starty : y;
|
|
|
|
iwidth = (x + width < ximagesrc->endx) ?
|
|
|
|
x + width - startx : ximagesrc->endx - startx;
|
|
|
|
iheight = (y + height < ximagesrc->endy) ?
|
|
|
|
y + height - starty : ximagesrc->endy - starty;
|
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Removing cursor from %d,%d", x, y);
|
|
|
|
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
|
|
|
startx, starty, iwidth, iheight, AllPlanes, ZPixmap,
|
2011-02-25 15:29:38 +00:00
|
|
|
meta->ximage, startx - ximagesrc->startx,
|
2006-07-08 22:41:25 +00:00
|
|
|
starty - ximagesrc->starty);
|
|
|
|
}
|
|
|
|
} else {
|
2006-03-31 15:21:35 +00:00
|
|
|
|
2006-07-08 22:41:25 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Removing cursor from %d,%d", x, y);
|
|
|
|
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
2011-02-25 15:29:38 +00:00
|
|
|
x, y, width, height, AllPlanes, ZPixmap, meta->ximage, x, y);
|
2006-07-08 22:41:25 +00:00
|
|
|
}
|
2006-03-31 15:21:35 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
} else {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
if (ximagesrc->xcontext->use_xshm) {
|
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Retrieving screen using XShm");
|
|
|
|
XShmGetImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
2011-02-25 15:29:38 +00:00
|
|
|
meta->ximage, ximagesrc->startx, ximagesrc->starty, AllPlanes);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
} else
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
{
|
2011-09-29 14:41:53 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Retrieving screen using XGetImage");
|
2010-11-29 12:36:06 +00:00
|
|
|
if (ximagesrc->remote) {
|
|
|
|
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
|
|
|
ximagesrc->startx, ximagesrc->starty, ximagesrc->width,
|
2011-02-25 15:29:38 +00:00
|
|
|
ximagesrc->height, AllPlanes, ZPixmap, meta->ximage, 0, 0);
|
2010-11-29 12:36:06 +00:00
|
|
|
} else {
|
2011-02-25 15:29:38 +00:00
|
|
|
meta->ximage =
|
2010-11-29 12:36:06 +00:00
|
|
|
XGetImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
|
|
|
|
ximagesrc->startx, ximagesrc->starty, ximagesrc->width,
|
|
|
|
ximagesrc->height, AllPlanes, ZPixmap);
|
|
|
|
}
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
#ifdef HAVE_XDAMAGE
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
if (ximagesrc->show_pointer && ximagesrc->have_xfixes) {
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Using XFixes to draw cursor");
|
|
|
|
/* get cursor */
|
2008-10-03 15:54:07 +00:00
|
|
|
if (ximagesrc->cursor_image)
|
|
|
|
XFree (ximagesrc->cursor_image);
|
2006-03-31 15:21:35 +00:00
|
|
|
ximagesrc->cursor_image = XFixesGetCursorImage (ximagesrc->xcontext->disp);
|
|
|
|
if (ximagesrc->cursor_image != NULL) {
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
int cx, cy, i, j, count;
|
2006-07-08 22:41:25 +00:00
|
|
|
int startx, starty, iwidth, iheight;
|
|
|
|
gboolean cursor_in_image = TRUE;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2006-03-31 15:21:35 +00:00
|
|
|
cx = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot;
|
2006-06-29 11:05:14 +00:00
|
|
|
if (cx < 0)
|
|
|
|
cx = 0;
|
2006-03-31 15:21:35 +00:00
|
|
|
cy = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot;
|
2006-06-29 11:05:14 +00:00
|
|
|
if (cy < 0)
|
|
|
|
cy = 0;
|
2006-03-31 15:21:35 +00:00
|
|
|
count = ximagesrc->cursor_image->width * ximagesrc->cursor_image->height;
|
2006-07-08 22:41:25 +00:00
|
|
|
|
|
|
|
/* only get where cursor last was, if it is in our range */
|
|
|
|
if (ximagesrc->endx > ximagesrc->startx &&
|
|
|
|
ximagesrc->endy > ximagesrc->starty) {
|
|
|
|
/* check bounds */
|
|
|
|
if (cx + ximagesrc->cursor_image->width < ximagesrc->startx ||
|
|
|
|
cx > ximagesrc->endx) {
|
|
|
|
/* trivial reject */
|
|
|
|
cursor_in_image = FALSE;
|
|
|
|
} else if (cy + ximagesrc->cursor_image->height < ximagesrc->starty ||
|
|
|
|
cy > ximagesrc->endy) {
|
|
|
|
/* trivial reject */
|
|
|
|
cursor_in_image = FALSE;
|
|
|
|
} else {
|
|
|
|
/* find intersect region */
|
|
|
|
|
|
|
|
startx = (cx < ximagesrc->startx) ? ximagesrc->startx : cx;
|
|
|
|
starty = (cy < ximagesrc->starty) ? ximagesrc->starty : cy;
|
|
|
|
iwidth = (cx + ximagesrc->cursor_image->width < ximagesrc->endx) ?
|
|
|
|
cx + ximagesrc->cursor_image->width - startx :
|
|
|
|
ximagesrc->endx - startx;
|
|
|
|
iheight = (cy + ximagesrc->cursor_image->height < ximagesrc->endy) ?
|
|
|
|
cy + ximagesrc->cursor_image->height - starty :
|
|
|
|
ximagesrc->endy - starty;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
startx = cx;
|
|
|
|
starty = cy;
|
|
|
|
iwidth = ximagesrc->cursor_image->width;
|
|
|
|
iheight = ximagesrc->cursor_image->height;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cursor_in_image) {
|
|
|
|
GST_DEBUG_OBJECT (ximagesrc, "Cursor is in image so trying to draw it");
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
ximagesrc->cursor_image->pixels[i] =
|
|
|
|
GUINT_TO_LE (ximagesrc->cursor_image->pixels[i]);
|
|
|
|
/* copy those pixels across */
|
2007-05-11 16:11:04 +00:00
|
|
|
for (j = starty;
|
|
|
|
j < starty + iheight && j < ximagesrc->starty + ximagesrc->height;
|
2007-05-11 10:31:27 +00:00
|
|
|
j++) {
|
2007-05-11 16:11:04 +00:00
|
|
|
for (i = startx;
|
|
|
|
i < startx + iwidth && i < ximagesrc->startx + ximagesrc->width;
|
2007-05-11 10:31:27 +00:00
|
|
|
i++) {
|
2006-07-08 22:41:25 +00:00
|
|
|
guint8 *src, *dest;
|
|
|
|
|
|
|
|
src =
|
|
|
|
(guint8 *) & (ximagesrc->cursor_image->pixels[((j -
|
|
|
|
cy) * ximagesrc->cursor_image->width + (i - cx))]);
|
|
|
|
dest =
|
2011-02-25 15:29:38 +00:00
|
|
|
(guint8 *) & (meta->ximage->data[((j -
|
2006-07-08 22:41:25 +00:00
|
|
|
ximagesrc->starty) * ximagesrc->width + (i -
|
|
|
|
ximagesrc->startx)) * (ximagesrc->xcontext->bpp /
|
|
|
|
8)]);
|
|
|
|
|
|
|
|
composite_pixel (ximagesrc->xcontext, (guint8 *) dest,
|
|
|
|
(guint8 *) src);
|
|
|
|
}
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2007-05-11 10:31:27 +00:00
|
|
|
#ifdef HAVE_XDAMAGE
|
|
|
|
if (ximagesrc->have_xdamage && ximagesrc->use_damage) {
|
|
|
|
/* need to ref ximage to put in last_ximage */
|
2011-07-10 12:56:00 +00:00
|
|
|
gst_buffer_ref (ximage);
|
2007-05-11 10:31:27 +00:00
|
|
|
if (ximagesrc->last_ximage) {
|
2011-07-10 12:56:00 +00:00
|
|
|
gst_buffer_unref (ximagesrc->last_ximage);
|
2007-05-11 10:31:27 +00:00
|
|
|
}
|
|
|
|
ximagesrc->last_ximage = ximage;
|
|
|
|
GST_LOG_OBJECT (ximagesrc, "reffing current buffer for last_ximage");
|
|
|
|
}
|
|
|
|
#endif
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
return ximage;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *s = GST_XIMAGE_SRC (bs);
|
2011-02-24 12:51:32 +00:00
|
|
|
GstBuffer *image;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GstClockTime base_time;
|
|
|
|
GstClockTime next_capture_ts;
|
|
|
|
GstClockTime dur;
|
|
|
|
gint64 next_frame_no;
|
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
if (!gst_ximage_src_recalc (s)) {
|
2006-04-07 15:27:40 +00:00
|
|
|
GST_ELEMENT_ERROR (s, RESOURCE, FAILED,
|
2006-04-28 16:15:20 +00:00
|
|
|
(_("Changing resolution at runtime is not yet supported.")), (NULL));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (s->fps_n <= 0 || s->fps_d <= 0)
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED; /* FPS must be > 0 */
|
|
|
|
|
2006-04-28 16:15:20 +00:00
|
|
|
/* Now, we might need to wait for the next multiple of the fps
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
* before capturing */
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (s);
|
2007-03-04 14:56:53 +00:00
|
|
|
if (GST_ELEMENT_CLOCK (s) == NULL) {
|
|
|
|
GST_OBJECT_UNLOCK (s);
|
|
|
|
GST_ELEMENT_ERROR (s, RESOURCE, FAILED,
|
|
|
|
(_("Cannot operate without a clock")), (NULL));
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
base_time = GST_ELEMENT_CAST (s)->base_time;
|
|
|
|
next_capture_ts = gst_clock_get_time (GST_ELEMENT_CLOCK (s));
|
|
|
|
next_capture_ts -= base_time;
|
|
|
|
|
|
|
|
/* Figure out which 'frame number' position we're at, based on the cur time
|
|
|
|
* and frame rate */
|
|
|
|
next_frame_no = gst_util_uint64_scale (next_capture_ts,
|
|
|
|
s->fps_n, GST_SECOND * s->fps_d);
|
|
|
|
if (next_frame_no == s->last_frame_no) {
|
|
|
|
GstClockID id;
|
|
|
|
GstClockReturn ret;
|
|
|
|
|
|
|
|
/* Need to wait for the next frame */
|
|
|
|
next_frame_no += 1;
|
|
|
|
|
|
|
|
/* Figure out what the next frame time is */
|
|
|
|
next_capture_ts = gst_util_uint64_scale (next_frame_no,
|
|
|
|
s->fps_d * GST_SECOND, s->fps_n);
|
|
|
|
|
|
|
|
id = gst_clock_new_single_shot_id (GST_ELEMENT_CLOCK (s),
|
|
|
|
next_capture_ts + base_time);
|
|
|
|
s->clock_id = id;
|
|
|
|
|
|
|
|
/* release the object lock while waiting */
|
|
|
|
GST_OBJECT_UNLOCK (s);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (s, "Waiting for next frame time %" G_GUINT64_FORMAT,
|
|
|
|
next_capture_ts);
|
|
|
|
ret = gst_clock_id_wait (id, NULL);
|
|
|
|
GST_OBJECT_LOCK (s);
|
|
|
|
|
|
|
|
gst_clock_id_unref (id);
|
|
|
|
s->clock_id = NULL;
|
|
|
|
if (ret == GST_CLOCK_UNSCHEDULED) {
|
|
|
|
/* Got woken up by the unlock function */
|
|
|
|
GST_OBJECT_UNLOCK (s);
|
2012-02-08 15:34:00 +00:00
|
|
|
return GST_FLOW_FLUSHING;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
/* Duration is a complete 1/fps frame duration */
|
|
|
|
dur = gst_util_uint64_scale_int (GST_SECOND, s->fps_d, s->fps_n);
|
|
|
|
} else {
|
|
|
|
GstClockTime next_frame_ts;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (s, "No need to wait for next frame time %"
|
|
|
|
G_GUINT64_FORMAT " next frame = %" G_GINT64_FORMAT " prev = %"
|
|
|
|
G_GINT64_FORMAT, next_capture_ts, next_frame_no, s->last_frame_no);
|
|
|
|
next_frame_ts = gst_util_uint64_scale (next_frame_no + 1,
|
|
|
|
s->fps_d * GST_SECOND, s->fps_n);
|
|
|
|
/* Frame duration is from now until the next expected capture time */
|
|
|
|
dur = next_frame_ts - next_capture_ts;
|
|
|
|
}
|
|
|
|
s->last_frame_no = next_frame_no;
|
|
|
|
GST_OBJECT_UNLOCK (s);
|
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
image = gst_ximage_src_ximage_get (s);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
if (!image)
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
|
2011-07-10 12:56:00 +00:00
|
|
|
*buf = image;
|
2013-06-20 23:42:02 +00:00
|
|
|
GST_BUFFER_DTS (*buf) = GST_CLOCK_TIME_NONE;
|
|
|
|
GST_BUFFER_PTS (*buf) = next_capture_ts;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GST_BUFFER_DURATION (*buf) = dur;
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_set_property (GObject * object, guint prop_id,
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *src = GST_XIMAGE_SRC (object);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_DISPLAY_NAME:
|
|
|
|
|
|
|
|
g_free (src->display_name);
|
|
|
|
src->display_name = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
|
|
|
case PROP_SCREEN_NUM:
|
|
|
|
src->screen_num = g_value_get_uint (value);
|
|
|
|
break;
|
2006-03-17 16:34:36 +00:00
|
|
|
case PROP_SHOW_POINTER:
|
|
|
|
src->show_pointer = g_value_get_boolean (value);
|
|
|
|
break;
|
2006-07-08 19:03:54 +00:00
|
|
|
case PROP_USE_DAMAGE:
|
|
|
|
src->use_damage = g_value_get_boolean (value);
|
|
|
|
break;
|
2006-07-08 22:41:25 +00:00
|
|
|
case PROP_STARTX:
|
|
|
|
src->startx = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case PROP_STARTY:
|
|
|
|
src->starty = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case PROP_ENDX:
|
|
|
|
src->endx = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case PROP_ENDY:
|
|
|
|
src->endy = g_value_get_uint (value);
|
|
|
|
break;
|
2010-11-29 12:36:06 +00:00
|
|
|
case PROP_REMOTE:
|
|
|
|
src->remote = g_value_get_boolean (value);
|
|
|
|
break;
|
2011-09-20 11:11:47 +00:00
|
|
|
case PROP_XID:
|
|
|
|
if (src->xcontext != NULL) {
|
|
|
|
g_warning ("ximagesrc window ID must be set before opening display");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
src->xid = g_value_get_uint64 (value);
|
|
|
|
break;
|
|
|
|
case PROP_XNAME:
|
|
|
|
if (src->xcontext != NULL) {
|
|
|
|
g_warning ("ximagesrc window name must be set before opening display");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
g_free (src->xname);
|
|
|
|
src->xname = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_get_property (GObject * object, guint prop_id, GValue * value,
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *src = GST_XIMAGE_SRC (object);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_DISPLAY_NAME:
|
|
|
|
if (src->xcontext)
|
|
|
|
g_value_set_string (value, DisplayString (src->xcontext->disp));
|
|
|
|
else
|
|
|
|
g_value_set_string (value, src->display_name);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case PROP_SCREEN_NUM:
|
|
|
|
g_value_set_uint (value, src->screen_num);
|
|
|
|
break;
|
2006-03-17 16:34:36 +00:00
|
|
|
case PROP_SHOW_POINTER:
|
|
|
|
g_value_set_boolean (value, src->show_pointer);
|
|
|
|
break;
|
2006-07-08 19:03:54 +00:00
|
|
|
case PROP_USE_DAMAGE:
|
|
|
|
g_value_set_boolean (value, src->use_damage);
|
2006-07-08 22:41:25 +00:00
|
|
|
break;
|
|
|
|
case PROP_STARTX:
|
|
|
|
g_value_set_uint (value, src->startx);
|
|
|
|
break;
|
|
|
|
case PROP_STARTY:
|
|
|
|
g_value_set_uint (value, src->starty);
|
|
|
|
break;
|
|
|
|
case PROP_ENDX:
|
|
|
|
g_value_set_uint (value, src->endx);
|
|
|
|
break;
|
|
|
|
case PROP_ENDY:
|
|
|
|
g_value_set_uint (value, src->endy);
|
|
|
|
break;
|
2010-11-29 12:36:06 +00:00
|
|
|
case PROP_REMOTE:
|
2010-12-22 20:27:11 +00:00
|
|
|
g_value_set_boolean (value, src->remote);
|
2010-11-29 12:36:06 +00:00
|
|
|
break;
|
2011-09-20 11:11:47 +00:00
|
|
|
case PROP_XID:
|
|
|
|
g_value_set_uint64 (value, src->xid);
|
|
|
|
break;
|
|
|
|
case PROP_XNAME:
|
|
|
|
g_value_set_string (value, src->xname);
|
|
|
|
break;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_clear_bufpool (GstXImageSrc * ximagesrc)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_lock (&ximagesrc->pool_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
while (ximagesrc->buffer_pool != NULL) {
|
2011-02-24 12:51:32 +00:00
|
|
|
GstBuffer *ximage = ximagesrc->buffer_pool->data;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
gst_ximage_buffer_free (ximage);
|
|
|
|
|
|
|
|
ximagesrc->buffer_pool = g_slist_delete_link (ximagesrc->buffer_pool,
|
|
|
|
ximagesrc->buffer_pool);
|
|
|
|
}
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_unlock (&ximagesrc->pool_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_dispose (GObject * object)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
|
|
|
/* Drop references in the buffer_pool */
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_clear_bufpool (GST_XIMAGE_SRC (object));
|
2007-03-04 15:28:30 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_finalize (GObject * object)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *src = GST_XIMAGE_SRC (object);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
if (src->xcontext)
|
|
|
|
ximageutil_xcontext_clear (src->xcontext);
|
|
|
|
|
2011-09-20 11:11:47 +00:00
|
|
|
g_free (src->xname);
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_clear (&src->pool_lock);
|
|
|
|
g_mutex_clear (&src->x_lock);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps *
|
2011-07-10 12:56:00 +00:00
|
|
|
gst_ximage_src_get_caps (GstBaseSrc * bs, GstCaps * filter)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *s = GST_XIMAGE_SRC (bs);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GstXContext *xcontext;
|
2009-04-18 16:11:00 +00:00
|
|
|
gint width, height;
|
2012-03-05 11:03:01 +00:00
|
|
|
GstVideoFormat format;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2007-06-11 11:41:56 +00:00
|
|
|
if ((!s->xcontext) && (!gst_ximage_src_open_display (s, s->display_name)))
|
2012-03-27 14:41:06 +00:00
|
|
|
return gst_pad_get_pad_template_caps (GST_BASE_SRC (s)->srcpad);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
if (!gst_ximage_src_recalc (s))
|
2012-03-27 14:41:06 +00:00
|
|
|
return gst_pad_get_pad_template_caps (GST_BASE_SRC (s)->srcpad);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
xcontext = s->xcontext;
|
2011-09-20 11:11:47 +00:00
|
|
|
width = s->xcontext->width;
|
|
|
|
height = s->xcontext->height;
|
|
|
|
if (s->xwindow != 0) {
|
|
|
|
XWindowAttributes attrs;
|
|
|
|
int status = XGetWindowAttributes (s->xcontext->disp, s->xwindow, &attrs);
|
|
|
|
if (status) {
|
|
|
|
width = attrs.width;
|
|
|
|
height = attrs.height;
|
|
|
|
}
|
|
|
|
}
|
2010-11-27 17:15:32 +00:00
|
|
|
|
|
|
|
/* property comments say 0 means right/bottom, means we can't capture
|
|
|
|
the top left pixel alone */
|
|
|
|
if (s->endx == 0)
|
|
|
|
s->endx = width - 1;
|
|
|
|
if (s->endy == 0)
|
|
|
|
s->endy = height - 1;
|
|
|
|
|
|
|
|
if (s->endx >= s->startx && s->endy >= s->starty) {
|
2006-07-08 22:41:25 +00:00
|
|
|
/* this means user has put in values */
|
|
|
|
if (s->startx < xcontext->width && s->endx < xcontext->width &&
|
2012-03-06 13:22:43 +00:00
|
|
|
s->starty < xcontext->height && s->endy < xcontext->height) {
|
2006-07-08 22:41:25 +00:00
|
|
|
/* values are fine */
|
2010-11-27 17:15:32 +00:00
|
|
|
s->width = width = s->endx - s->startx + 1;
|
|
|
|
s->height = height = s->endy - s->starty + 1;
|
2006-07-08 22:41:25 +00:00
|
|
|
} else {
|
|
|
|
GST_WARNING
|
|
|
|
("User put in co-ordinates overshooting the X resolution, setting to full screen");
|
|
|
|
s->startx = 0;
|
|
|
|
s->starty = 0;
|
2010-11-27 17:15:32 +00:00
|
|
|
s->endx = width - 1;
|
|
|
|
s->endy = height - 1;
|
2006-07-08 22:41:25 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
GST_WARNING ("User put in bogus co-ordinates, setting to full screen");
|
|
|
|
s->startx = 0;
|
|
|
|
s->starty = 0;
|
2010-11-27 17:15:32 +00:00
|
|
|
s->endx = width - 1;
|
|
|
|
s->endy = height - 1;
|
2006-07-08 22:41:25 +00:00
|
|
|
}
|
|
|
|
GST_DEBUG ("width = %d, height=%d", width, height);
|
2012-03-05 11:03:01 +00:00
|
|
|
|
|
|
|
format =
|
|
|
|
gst_video_format_from_masks (xcontext->depth, xcontext->bpp,
|
|
|
|
xcontext->endianness, xcontext->r_mask_output, xcontext->g_mask_output,
|
|
|
|
xcontext->b_mask_output, 0);
|
|
|
|
|
|
|
|
return gst_caps_new_simple ("video/x-raw",
|
|
|
|
"format", G_TYPE_STRING, gst_video_format_to_string (format),
|
2006-07-08 22:41:25 +00:00
|
|
|
"width", G_TYPE_INT, width,
|
|
|
|
"height", G_TYPE_INT, height,
|
2006-03-31 17:52:36 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 1, G_MAXINT, G_MAXINT, 1,
|
2013-01-24 02:35:25 +00:00
|
|
|
"pixel-aspect-ratio", GST_TYPE_FRACTION, xcontext->par_n, xcontext->par_d,
|
2006-03-31 17:52:36 +00:00
|
|
|
NULL);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_set_caps (GstBaseSrc * bs, GstCaps * caps)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2006-04-28 16:51:33 +00:00
|
|
|
GstXImageSrc *s = GST_XIMAGE_SRC (bs);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GstStructure *structure;
|
|
|
|
const GValue *new_fps;
|
|
|
|
|
|
|
|
/* If not yet opened, disallow setcaps until later */
|
|
|
|
if (!s->xcontext)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* The only thing that can change is the framerate downstream wants */
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
new_fps = gst_structure_get_value (structure, "framerate");
|
|
|
|
if (!new_fps)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Store this FPS for use when generating buffers */
|
|
|
|
s->fps_n = gst_value_get_fraction_numerator (new_fps);
|
|
|
|
s->fps_d = gst_value_get_fraction_denominator (new_fps);
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (s, "peer wants %d/%d fps", s->fps_n, s->fps_d);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-03-11 18:06:37 +00:00
|
|
|
static GstCaps *
|
2011-11-10 10:03:18 +00:00
|
|
|
gst_ximage_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GstStructure *structure;
|
|
|
|
|
2012-03-11 18:06:37 +00:00
|
|
|
caps = gst_caps_make_writable (caps);
|
|
|
|
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
for (i = 0; i < gst_caps_get_size (caps); ++i) {
|
|
|
|
structure = gst_caps_get_structure (caps, i);
|
|
|
|
|
|
|
|
gst_structure_fixate_field_nearest_fraction (structure, "framerate", 25, 1);
|
|
|
|
}
|
2012-03-11 18:06:37 +00:00
|
|
|
caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps);
|
|
|
|
|
|
|
|
return caps;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 16:51:33 +00:00
|
|
|
gst_ximage_src_class_init (GstXImageSrcClass * klass)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gc = G_OBJECT_CLASS (klass);
|
2011-07-10 12:56:00 +00:00
|
|
|
GstElementClass *ec = GST_ELEMENT_CLASS (klass);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
GstBaseSrcClass *bc = GST_BASE_SRC_CLASS (klass);
|
|
|
|
GstPushSrcClass *push_class = GST_PUSH_SRC_CLASS (klass);
|
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
gc->set_property = gst_ximage_src_set_property;
|
|
|
|
gc->get_property = gst_ximage_src_get_property;
|
|
|
|
gc->dispose = gst_ximage_src_dispose;
|
|
|
|
gc->finalize = gst_ximage_src_finalize;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gc, PROP_DISPLAY_NAME,
|
2006-07-25 17:54:25 +00:00
|
|
|
g_param_spec_string ("display-name", "Display", "X Display Name", NULL,
|
2010-10-13 14:13:04 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
g_object_class_install_property (gc, PROP_SCREEN_NUM,
|
2006-07-25 17:54:25 +00:00
|
|
|
g_param_spec_uint ("screen-num", "Screen number", "X Screen Number",
|
2010-10-13 14:13:04 +00:00
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2006-03-17 16:34:36 +00:00
|
|
|
g_object_class_install_property (gc, PROP_SHOW_POINTER,
|
2006-07-25 17:54:25 +00:00
|
|
|
g_param_spec_boolean ("show-pointer", "Show Mouse Pointer",
|
2006-04-28 16:15:20 +00:00
|
|
|
"Show mouse pointer (if XFixes extension enabled)", TRUE,
|
2010-10-13 14:13:04 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2006-07-25 17:54:25 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:use-damage:
|
2006-07-25 17:54:25 +00:00
|
|
|
*
|
|
|
|
* Use XDamage (if the XDamage extension is enabled)
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2006-07-08 22:41:25 +00:00
|
|
|
g_object_class_install_property (gc, PROP_USE_DAMAGE,
|
2006-07-25 17:54:25 +00:00
|
|
|
g_param_spec_boolean ("use-damage", "Use XDamage",
|
2006-07-08 19:03:54 +00:00
|
|
|
"Use XDamage (if XDamage extension enabled)", TRUE,
|
2010-10-13 14:13:04 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2006-07-25 17:54:25 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:startx:
|
2006-07-25 17:54:25 +00:00
|
|
|
*
|
|
|
|
* X coordinate of top left corner of area to be recorded
|
|
|
|
* (0 for top left of screen)
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2006-07-08 22:41:25 +00:00
|
|
|
g_object_class_install_property (gc, PROP_STARTX,
|
|
|
|
g_param_spec_uint ("startx", "Start X co-ordinate",
|
|
|
|
"X coordinate of top left corner of area to be recorded (0 for top left of screen)",
|
2010-10-13 14:13:04 +00:00
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2006-07-25 17:54:25 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:starty:
|
2006-07-25 17:54:25 +00:00
|
|
|
*
|
|
|
|
* Y coordinate of top left corner of area to be recorded
|
|
|
|
* (0 for top left of screen)
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2006-07-08 22:41:25 +00:00
|
|
|
g_object_class_install_property (gc, PROP_STARTY,
|
|
|
|
g_param_spec_uint ("starty", "Start Y co-ordinate",
|
|
|
|
"Y coordinate of top left corner of area to be recorded (0 for top left of screen)",
|
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE));
|
2006-07-25 17:54:25 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:endx:
|
2006-07-25 17:54:25 +00:00
|
|
|
*
|
|
|
|
* X coordinate of bottom right corner of area to be recorded
|
|
|
|
* (0 for bottom right of screen)
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2006-07-08 22:41:25 +00:00
|
|
|
g_object_class_install_property (gc, PROP_ENDX,
|
|
|
|
g_param_spec_uint ("endx", "End X",
|
|
|
|
"X coordinate of bottom right corner of area to be recorded (0 for bottom right of screen)",
|
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE));
|
2006-07-25 17:54:25 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:endy:
|
2006-07-25 17:54:25 +00:00
|
|
|
*
|
|
|
|
* Y coordinate of bottom right corner of area to be recorded
|
|
|
|
* (0 for bottom right of screen)
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2006-07-08 22:41:25 +00:00
|
|
|
g_object_class_install_property (gc, PROP_ENDY,
|
|
|
|
g_param_spec_uint ("endy", "End Y",
|
|
|
|
"Y coordinate of bottom right corner of area to be recorded (0 for bottom right of screen)",
|
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2010-11-29 12:36:06 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:remote:
|
2010-11-29 12:36:06 +00:00
|
|
|
*
|
|
|
|
* Whether the X display is remote. The element will try to use alternate calls
|
|
|
|
* known to work better with remote displays.
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2010-11-29 12:36:06 +00:00
|
|
|
g_object_class_install_property (gc, PROP_REMOTE,
|
|
|
|
g_param_spec_boolean ("remote", "Remote dispay",
|
|
|
|
"Whether the display is remote", FALSE,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-09-20 11:11:47 +00:00
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:xid:
|
2011-09-20 11:11:47 +00:00
|
|
|
*
|
|
|
|
* The XID of the window to capture. 0 for the root window (default).
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2011-09-20 11:11:47 +00:00
|
|
|
g_object_class_install_property (gc, PROP_XID,
|
|
|
|
g_param_spec_uint64 ("xid", "Window XID",
|
|
|
|
"Window XID to capture from", 0, G_MAXUINT64, 0,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
/**
|
2013-11-18 14:44:36 +00:00
|
|
|
* GstXImageSrc:xname:
|
2011-09-20 11:11:47 +00:00
|
|
|
*
|
|
|
|
* The name of the window to capture, if any.
|
2013-11-18 14:44:36 +00:00
|
|
|
*/
|
2011-09-20 11:11:47 +00:00
|
|
|
g_object_class_install_property (gc, PROP_XNAME,
|
|
|
|
g_param_spec_string ("xname", "Window name",
|
|
|
|
"Window name to capture from", NULL,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-11-29 12:36:06 +00:00
|
|
|
|
2012-04-09 23:51:41 +00:00
|
|
|
gst_element_class_set_static_metadata (ec, "Ximage video source",
|
2011-07-10 12:56:00 +00:00
|
|
|
"Source/Video",
|
|
|
|
"Creates a screenshot video stream",
|
|
|
|
"Lutz Mueller <lutz@users.sourceforge.net>, "
|
|
|
|
"Jan Schmidt <thaytan@mad.scientist.com>, "
|
|
|
|
"Zaheer Merali <zaheerabbas at merali dot org>");
|
|
|
|
gst_element_class_add_pad_template (ec, gst_static_pad_template_get (&t));
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
2011-11-10 10:03:18 +00:00
|
|
|
bc->fixate = gst_ximage_src_fixate;
|
2006-04-28 16:51:33 +00:00
|
|
|
bc->get_caps = gst_ximage_src_get_caps;
|
|
|
|
bc->set_caps = gst_ximage_src_set_caps;
|
|
|
|
bc->start = gst_ximage_src_start;
|
|
|
|
bc->stop = gst_ximage_src_stop;
|
|
|
|
bc->unlock = gst_ximage_src_unlock;
|
2011-11-10 10:03:18 +00:00
|
|
|
push_class->create = gst_ximage_src_create;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-07-10 12:56:00 +00:00
|
|
|
gst_ximage_src_init (GstXImageSrc * ximagesrc)
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
{
|
2010-02-24 00:06:55 +00:00
|
|
|
gst_base_src_set_format (GST_BASE_SRC (ximagesrc), GST_FORMAT_TIME);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
gst_base_src_set_live (GST_BASE_SRC (ximagesrc), TRUE);
|
|
|
|
|
2012-01-19 10:33:53 +00:00
|
|
|
g_mutex_init (&ximagesrc->pool_lock);
|
|
|
|
g_mutex_init (&ximagesrc->x_lock);
|
2006-03-17 16:34:36 +00:00
|
|
|
ximagesrc->show_pointer = TRUE;
|
2006-07-08 19:03:54 +00:00
|
|
|
ximagesrc->use_damage = TRUE;
|
2006-07-08 22:41:25 +00:00
|
|
|
ximagesrc->startx = 0;
|
|
|
|
ximagesrc->starty = 0;
|
|
|
|
ximagesrc->endx = 0;
|
|
|
|
ximagesrc->endy = 0;
|
2010-11-29 12:36:06 +00:00
|
|
|
ximagesrc->remote = FALSE;
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
gboolean ret;
|
|
|
|
|
2006-04-28 16:51:33 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_debug_ximage_src, "ximagesrc", 0,
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
"ximagesrc element debug");
|
|
|
|
|
|
|
|
ret = gst_element_register (plugin, "ximagesrc", GST_RANK_NONE,
|
2006-04-28 16:51:33 +00:00
|
|
|
GST_TYPE_XIMAGE_SRC);
|
Port ximagesrc to 0.10 (Closes #304795)
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/ximagesrc/Makefile.am:
* sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_return_buf),
(gst_ximagesrc_open_display), (gst_ximagesrc_start),
(gst_ximagesrc_stop), (gst_ximagesrc_unlock),
(gst_ximagesrc_recalc), (composite_pixel),
(gst_ximagesrc_ximage_get), (gst_ximagesrc_create),
(gst_ximagesrc_set_property), (gst_ximagesrc_get_property),
(gst_ximagesrc_clear_bufpool), (gst_ximagesrc_base_init),
(gst_ximagesrc_dispose), (gst_ximagesrc_finalize),
(gst_ximagesrc_get_caps), (gst_ximagesrc_set_caps),
(gst_ximagesrc_fixate), (gst_ximagesrc_class_init),
(gst_ximagesrc_init), (plugin_init):
* sys/ximagesrc/ximagesrc.h:
* sys/ximagesrc/ximageutil.c: (ximageutil_handle_xerror),
(ximageutil_check_xshm_calls), (ximageutil_xcontext_get),
(ximageutil_xcontext_clear),
(ximageutil_calculate_pixel_aspect_ratio),
(gst_ximagesrc_buffer_finalize), (gst_ximage_buffer_free),
(gst_ximagesrc_buffer_init), (gst_ximagesrc_buffer_class_init),
(gst_ximagesrc_buffer_get_type), (gst_ximageutil_ximage_new),
(gst_ximageutil_ximage_destroy):
* sys/ximagesrc/ximageutil.h:
Port ximagesrc to 0.10 (Closes #304795)
2006-02-20 21:19:59 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
2012-04-05 15:36:38 +00:00
|
|
|
ximagesrc,
|
2006-04-28 16:15:20 +00:00
|
|
|
"X11 video input plugin using standard Xlib calls",
|
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|