2003-11-10 18:22:20 +00:00
|
|
|
/* GStreamer
|
2005-11-27 18:12:23 +00:00
|
|
|
* Copyright (C) <2005> Julien Moutte <julien@moutte.net>
|
2011-04-05 08:32:52 +00:00
|
|
|
* <2009>,<2010> Stefan Kost <stefan.kost@nokia.com>
|
2003-11-10 18:22:20 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-26 15:26:36 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-xvimagesink
|
|
|
|
*
|
|
|
|
* XvImageSink renders video frames to a drawable (XWindow) on a local display
|
2007-04-20 10:42:24 +00:00
|
|
|
* using the XVideo extension. Rendering to a remote display is theorically
|
|
|
|
* possible but i doubt that the XVideo extension is actually available when
|
2005-11-26 15:26:36 +00:00
|
|
|
* connecting to a remote display. This element can receive a Window ID from the
|
|
|
|
* application through the XOverlay interface and will then render video frames
|
2007-04-20 10:42:24 +00:00
|
|
|
* in this drawable. If no Window ID was provided by the application, the
|
2005-11-26 15:26:36 +00:00
|
|
|
* element will create its own internal window and render into it.
|
2008-07-11 06:10:24 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
2005-11-26 15:26:36 +00:00
|
|
|
* <title>Scaling</title>
|
|
|
|
* <para>
|
2007-04-20 10:42:24 +00:00
|
|
|
* The XVideo extension, when it's available, handles hardware accelerated
|
2005-11-26 15:26:36 +00:00
|
|
|
* scaling of video frames. This means that the element will just accept
|
|
|
|
* incoming video frames no matter their geometry and will then put them to the
|
2008-07-11 06:10:24 +00:00
|
|
|
* drawable scaling them on the fly. Using the #GstXvImageSink:force-aspect-ratio
|
2005-11-26 15:26:36 +00:00
|
|
|
* property it is possible to enforce scaling with a constant aspect ratio,
|
|
|
|
* which means drawing black borders around the video frame.
|
|
|
|
* </para>
|
2008-07-11 06:10:24 +00:00
|
|
|
* </refsect2>
|
|
|
|
* <refsect2>
|
2005-11-26 15:26:36 +00:00
|
|
|
* <title>Events</title>
|
|
|
|
* <para>
|
|
|
|
* XvImageSink creates a thread to handle events coming from the drawable. There
|
2007-04-20 10:42:24 +00:00
|
|
|
* are several kind of events that can be grouped in 2 big categories: input
|
2005-11-26 15:26:36 +00:00
|
|
|
* events and window state related events. Input events will be translated to
|
|
|
|
* navigation events and pushed upstream for other elements to react on them.
|
|
|
|
* This includes events such as pointer moves, key press/release, clicks etc...
|
|
|
|
* Other events are used to handle the drawable appearance even when the data
|
|
|
|
* is not flowing (GST_STATE_PAUSED). That means that even when the element is
|
|
|
|
* paused, it will receive expose events from the drawable and draw the latest
|
|
|
|
* frame with correct borders/aspect-ratio.
|
|
|
|
* </para>
|
2008-07-11 06:10:24 +00:00
|
|
|
* </refsect2>
|
|
|
|
* <refsect2>
|
2005-11-26 15:26:36 +00:00
|
|
|
* <title>Pixel aspect ratio</title>
|
|
|
|
* <para>
|
|
|
|
* When changing state to GST_STATE_READY, XvImageSink will open a connection to
|
2008-07-11 06:10:24 +00:00
|
|
|
* the display specified in the #GstXvImageSink:display property or the
|
2005-11-26 15:26:36 +00:00
|
|
|
* default display if nothing specified. Once this connection is open it will
|
|
|
|
* inspect the display configuration including the physical display geometry and
|
2007-04-20 10:42:24 +00:00
|
|
|
* then calculate the pixel aspect ratio. When receiving video frames with a
|
2005-11-26 15:26:36 +00:00
|
|
|
* different pixel aspect ratio, XvImageSink will use hardware scaling to
|
|
|
|
* display the video frames correctly on display's pixel aspect ratio.
|
|
|
|
* Sometimes the calculated pixel aspect ratio can be wrong, it is
|
|
|
|
* then possible to enforce a specific pixel aspect ratio using the
|
2008-07-11 06:10:24 +00:00
|
|
|
* #GstXvImageSink:pixel-aspect-ratio property.
|
2005-11-26 15:26:36 +00:00
|
|
|
* </para>
|
2008-07-11 06:10:24 +00:00
|
|
|
* </refsect2>
|
|
|
|
* <refsect2>
|
2005-11-26 15:26:36 +00:00
|
|
|
* <title>Examples</title>
|
2008-07-11 06:10:24 +00:00
|
|
|
* |[
|
2005-11-26 15:26:36 +00:00
|
|
|
* gst-launch -v videotestsrc ! xvimagesink
|
2008-07-11 06:10:24 +00:00
|
|
|
* ]| A pipeline to test hardware scaling.
|
2005-11-26 15:26:36 +00:00
|
|
|
* When the test video signal appears you can resize the window and see that
|
2008-07-11 06:10:24 +00:00
|
|
|
* video frames are scaled through hardware (no extra CPU cost).
|
|
|
|
* |[
|
2005-11-26 15:26:36 +00:00
|
|
|
* gst-launch -v videotestsrc ! xvimagesink force-aspect-ratio=true
|
2008-07-11 06:10:24 +00:00
|
|
|
* ]| Same pipeline with #GstXvImageSink:force-aspect-ratio property set to true
|
|
|
|
* You can observe the borders drawn around the scaled image respecting aspect
|
|
|
|
* ratio.
|
|
|
|
* |[
|
2005-11-26 15:26:36 +00:00
|
|
|
* gst-launch -v videotestsrc ! navigationtest ! xvimagesink
|
2008-07-11 06:10:24 +00:00
|
|
|
* ]| A pipeline to test navigation events.
|
2005-11-26 15:26:36 +00:00
|
|
|
* While moving the mouse pointer over the test signal you will see a black box
|
2007-04-20 10:42:24 +00:00
|
|
|
* following the mouse pointer. If you press the mouse button somewhere on the
|
2005-11-26 15:26:36 +00:00
|
|
|
* video and release it somewhere else a green box will appear where you pressed
|
|
|
|
* the button and a red one where you released it. (The navigationtest element
|
|
|
|
* is part of gst-plugins-good.) You can observe here that even if the images
|
|
|
|
* are scaled through hardware the pointer coordinates are converted back to the
|
2007-04-20 10:42:24 +00:00
|
|
|
* original video frame geometry so that the box can be drawn to the correct
|
|
|
|
* position. This also handles borders correctly, limiting coordinates to the
|
2005-11-26 15:26:36 +00:00
|
|
|
* image area
|
2008-07-11 06:10:24 +00:00
|
|
|
* |[
|
2005-11-26 15:26:36 +00:00
|
|
|
* gst-launch -v videotestsrc ! video/x-raw-yuv, pixel-aspect-ratio=(fraction)4/3 ! xvimagesink
|
2008-07-11 06:10:24 +00:00
|
|
|
* ]| This is faking a 4/3 pixel aspect ratio caps on video frames produced by
|
2005-11-26 15:26:36 +00:00
|
|
|
* videotestsrc, in most cases the pixel aspect ratio of the display will be
|
2007-04-20 10:42:24 +00:00
|
|
|
* 1/1. This means that XvImageSink will have to do the scaling to convert
|
2005-11-26 15:26:36 +00:00
|
|
|
* incoming frames to a size that will match the display pixel aspect ratio
|
2007-04-20 10:42:24 +00:00
|
|
|
* (from 320x240 to 320x180 in this case). Note that you might have to escape
|
2005-11-26 15:26:36 +00:00
|
|
|
* some characters for your shell like '\(fraction\)'.
|
2008-07-11 06:10:24 +00:00
|
|
|
* |[
|
2005-11-26 15:26:36 +00:00
|
|
|
* gst-launch -v videotestsrc ! xvimagesink hue=100 saturation=-100 brightness=100
|
2008-07-11 06:10:24 +00:00
|
|
|
* ]| Demonstrates how to use the colorbalance interface.
|
2005-11-26 15:26:36 +00:00
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
2008-05-14 09:12:10 +00:00
|
|
|
/* for developers: there are two useful tools : xvinfo and xvattr */
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Our interfaces */
|
2005-06-30 11:58:40 +00:00
|
|
|
#include <gst/interfaces/navigation.h>
|
|
|
|
#include <gst/interfaces/xoverlay.h>
|
|
|
|
#include <gst/interfaces/colorbalance.h>
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
#include <gst/interfaces/propertyprobe.h>
|
2006-05-12 21:30:00 +00:00
|
|
|
/* Helper functions */
|
|
|
|
#include <gst/video/video.h>
|
2011-04-29 10:09:38 +00:00
|
|
|
#include <gst/video/gstmetavideo.h>
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* Object header */
|
|
|
|
#include "xvimagesink.h"
|
|
|
|
|
2004-04-20 15:45:07 +00:00
|
|
|
/* Debugging category */
|
|
|
|
#include <gst/gstinfo.h>
|
2011-04-06 10:26:47 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagesink);
|
|
|
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
2004-04-20 15:45:07 +00:00
|
|
|
#define GST_CAT_DEFAULT gst_debug_xvimagesink
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long functions;
|
|
|
|
unsigned long decorations;
|
|
|
|
long input_mode;
|
|
|
|
unsigned long status;
|
|
|
|
}
|
|
|
|
MotifWmHints, MwmHints;
|
|
|
|
|
|
|
|
#define MWM_HINTS_DECORATIONS (1L << 1)
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
static void gst_xvimagesink_reset (GstXvImageSink * xvimagesink);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
static void gst_xvimagesink_xwindow_update_geometry (GstXvImageSink *
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
static void gst_xvimagesink_expose (GstXOverlay * overlay);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Default template - initiated with class struct to allow gst-register to work
|
|
|
|
without X running */
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_xvimagesink_sink_template_factory =
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-raw-rgb, "
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate = (fraction) [ 0, MAX ], "
|
2004-05-05 11:29:49 +00:00
|
|
|
"width = (int) [ 1, MAX ], "
|
|
|
|
"height = (int) [ 1, MAX ]; "
|
2004-03-15 19:32:28 +00:00
|
|
|
"video/x-raw-yuv, "
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate = (fraction) [ 0, MAX ], "
|
2004-05-05 11:29:49 +00:00
|
|
|
"width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]")
|
2004-03-14 22:34:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2010-10-25 13:09:39 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_CONTRAST,
|
|
|
|
PROP_BRIGHTNESS,
|
|
|
|
PROP_HUE,
|
|
|
|
PROP_SATURATION,
|
|
|
|
PROP_DISPLAY,
|
|
|
|
PROP_SYNCHRONOUS,
|
|
|
|
PROP_PIXEL_ASPECT_RATIO,
|
|
|
|
PROP_FORCE_ASPECT_RATIO,
|
|
|
|
PROP_HANDLE_EVENTS,
|
|
|
|
PROP_DEVICE,
|
|
|
|
PROP_DEVICE_NAME,
|
|
|
|
PROP_HANDLE_EXPOSE,
|
|
|
|
PROP_DOUBLE_BUFFER,
|
|
|
|
PROP_AUTOPAINT_COLORKEY,
|
|
|
|
PROP_COLORKEY,
|
|
|
|
PROP_DRAW_BORDERS,
|
|
|
|
PROP_WINDOW_WIDTH,
|
|
|
|
PROP_WINDOW_HEIGHT
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
};
|
|
|
|
|
2011-04-19 09:44:14 +00:00
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Public Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
/* =========================================== */
|
|
|
|
/* */
|
|
|
|
/* Object typing & Creation */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
|
|
|
static void gst_xvimagesink_interface_init (GstImplementsInterfaceClass *
|
|
|
|
klass);
|
|
|
|
static void gst_xvimagesink_navigation_init (GstNavigationInterface * iface);
|
|
|
|
static void gst_xvimagesink_xoverlay_init (GstXOverlayClass * iface);
|
|
|
|
static void gst_xvimagesink_colorbalance_init (GstColorBalanceClass * iface);
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_property_probe_interface_init (GstPropertyProbeInterface *
|
|
|
|
iface);
|
|
|
|
#define gst_xvimagesink_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xvimagesink, GST_TYPE_VIDEO_SINK,
|
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_IMPLEMENTS_INTERFACE,
|
|
|
|
gst_xvimagesink_interface_init);
|
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
|
|
|
|
gst_xvimagesink_navigation_init);
|
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_X_OVERLAY, gst_xvimagesink_xoverlay_init);
|
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
|
|
|
|
gst_xvimagesink_colorbalance_init);
|
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_PROPERTY_PROBE,
|
|
|
|
gst_xvimagesink_property_probe_interface_init));
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Private Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
/* We are called with the x_lock taken */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_xwindow_draw_borders (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow, GstVideoRectangle rect)
|
|
|
|
{
|
2010-02-19 12:46:43 +00:00
|
|
|
gint t1, t2;
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
|
|
|
|
XSetForeground (xvimagesink->xcontext->disp, xwindow->gc,
|
|
|
|
xvimagesink->xcontext->black);
|
|
|
|
|
|
|
|
/* Left border */
|
2010-02-19 12:46:43 +00:00
|
|
|
if (rect.x > xvimagesink->render_rect.x) {
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.x, xvimagesink->render_rect.y,
|
|
|
|
rect.x - xvimagesink->render_rect.x, xvimagesink->render_rect.h);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Right border */
|
2010-02-19 12:46:43 +00:00
|
|
|
t1 = rect.x + rect.w;
|
|
|
|
t2 = xvimagesink->render_rect.x + xvimagesink->render_rect.w;
|
|
|
|
if (t1 < t2) {
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
2010-02-19 12:46:43 +00:00
|
|
|
t1, xvimagesink->render_rect.y, t2 - t1, xvimagesink->render_rect.h);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Top border */
|
2010-02-19 12:46:43 +00:00
|
|
|
if (rect.y > xvimagesink->render_rect.y) {
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.x, xvimagesink->render_rect.y,
|
|
|
|
xvimagesink->render_rect.w, rect.y - xvimagesink->render_rect.y);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Bottom border */
|
2010-02-19 12:46:43 +00:00
|
|
|
t1 = rect.y + rect.h;
|
|
|
|
t2 = xvimagesink->render_rect.y + xvimagesink->render_rect.h;
|
|
|
|
if (t1 < t2) {
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.x, t1, xvimagesink->render_rect.w, t2 - t1);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
/* This function puts a GstXvImage on a GstXvImageSink's window. Returns FALSE
|
|
|
|
* if no window was available */
|
|
|
|
static gboolean
|
2011-02-24 10:57:53 +00:00
|
|
|
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2011-04-06 10:26:47 +00:00
|
|
|
GstMetaXvImage *meta;
|
2010-02-19 12:46:43 +00:00
|
|
|
GstVideoRectangle result;
|
2006-10-20 13:56:55 +00:00
|
|
|
gboolean draw_border = FALSE;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
2006-01-15 10:06:40 +00:00
|
|
|
/* We take the flow_lock. If expose is in there we don't want to run
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
concurrently from the data flow thread */
|
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
if (G_UNLIKELY (xvimagesink->xwindow == NULL)) {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
return FALSE;
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
}
|
|
|
|
|
2006-10-20 13:56:55 +00:00
|
|
|
/* Draw borders when displaying the first frame. After this
|
2007-07-13 16:05:17 +00:00
|
|
|
draw borders only on expose event or after a size change. */
|
2008-09-04 13:46:52 +00:00
|
|
|
if (!xvimagesink->cur_image || xvimagesink->redraw_border) {
|
2006-10-20 13:56:55 +00:00
|
|
|
draw_border = TRUE;
|
|
|
|
}
|
|
|
|
|
2006-01-15 10:06:40 +00:00
|
|
|
/* Store a reference to the last image we put, lose the previous one */
|
2005-11-27 18:12:23 +00:00
|
|
|
if (xvimage && xvimagesink->cur_image != xvimage) {
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (xvimagesink->cur_image) {
|
2006-01-15 10:06:40 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink, "unreffing %p", xvimagesink->cur_image);
|
2011-02-24 10:57:53 +00:00
|
|
|
gst_buffer_unref (xvimagesink->cur_image);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
2006-01-15 10:06:40 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink, "reffing %p as our current image", xvimage);
|
2011-02-24 10:57:53 +00:00
|
|
|
xvimagesink->cur_image = gst_buffer_ref (xvimage);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
|
|
|
|
2005-11-27 18:12:23 +00:00
|
|
|
/* Expose sends a NULL image, we take the latest frame */
|
|
|
|
if (!xvimage) {
|
|
|
|
if (xvimagesink->cur_image) {
|
2008-09-04 13:46:52 +00:00
|
|
|
draw_border = TRUE;
|
2005-11-27 18:12:23 +00:00
|
|
|
xvimage = xvimagesink->cur_image;
|
|
|
|
} else {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
return TRUE;
|
2005-11-27 18:12:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
meta = gst_buffer_get_meta_xvimage (xvimage);
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (xvimagesink->keep_aspect) {
|
2010-02-19 12:46:43 +00:00
|
|
|
GstVideoRectangle src, dst;
|
|
|
|
|
|
|
|
/* We use the calculated geometry from _setcaps as a source to respect
|
|
|
|
source and screen pixel aspect ratios. */
|
|
|
|
src.w = GST_VIDEO_SINK_WIDTH (xvimagesink);
|
|
|
|
src.h = GST_VIDEO_SINK_HEIGHT (xvimagesink);
|
|
|
|
dst.w = xvimagesink->render_rect.w;
|
|
|
|
dst.h = xvimagesink->render_rect.h;
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
2010-02-19 12:46:43 +00:00
|
|
|
result.x += xvimagesink->render_rect.x;
|
|
|
|
result.y += xvimagesink->render_rect.y;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
} else {
|
2010-02-19 12:46:43 +00:00
|
|
|
memcpy (&result, &xvimagesink->render_rect, sizeof (GstVideoRectangle));
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2008-09-04 13:46:52 +00:00
|
|
|
if (draw_border && xvimagesink->draw_borders) {
|
2006-10-20 13:56:55 +00:00
|
|
|
gst_xvimagesink_xwindow_draw_borders (xvimagesink, xvimagesink->xwindow,
|
|
|
|
result);
|
2008-09-04 13:46:52 +00:00
|
|
|
xvimagesink->redraw_border = FALSE;
|
2006-10-20 13:56:55 +00:00
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xcontext->use_xshm) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink,
|
2006-07-13 14:38:15 +00:00
|
|
|
"XvShmPutImage with image %dx%d and window %dx%d, from xvimage %"
|
2011-04-06 15:54:28 +00:00
|
|
|
GST_PTR_FORMAT, meta->width, meta->height,
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.w, xvimagesink->render_rect.h, xvimage);
|
2006-07-13 14:38:15 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
XvShmPutImage (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xwindow->win,
|
2011-04-06 10:26:47 +00:00
|
|
|
xvimagesink->xwindow->gc, meta->xvimage,
|
2008-11-13 18:18:32 +00:00
|
|
|
xvimagesink->disp_x, xvimagesink->disp_y,
|
|
|
|
xvimagesink->disp_width, xvimagesink->disp_height,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
result.x, result.y, result.w, result.h, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
|
|
|
XvPutImage (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xwindow->win,
|
2011-04-06 10:26:47 +00:00
|
|
|
xvimagesink->xwindow->gc, meta->xvimage,
|
2008-11-13 18:18:32 +00:00
|
|
|
xvimagesink->disp_x, xvimagesink->disp_y,
|
|
|
|
xvimagesink->disp_width, xvimagesink->disp_height,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
result.x, result.y, result.w, result.h);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_xwindow_decorate (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * window)
|
|
|
|
{
|
|
|
|
Atom hints_atom = None;
|
|
|
|
MotifWmHints *hints;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), FALSE);
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
2007-10-12 10:52:18 +00:00
|
|
|
hints_atom = XInternAtom (xvimagesink->xcontext->disp, "_MOTIF_WM_HINTS",
|
|
|
|
True);
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
if (hints_atom == None) {
|
2004-07-27 09:35:52 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-06-27 18:53:04 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
hints = g_malloc0 (sizeof (MotifWmHints));
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
hints->flags |= MWM_HINTS_DECORATIONS;
|
|
|
|
hints->decorations = 1 << 0;
|
|
|
|
|
|
|
|
XChangeProperty (xvimagesink->xcontext->disp, window->win,
|
|
|
|
hints_atom, hints_atom, 32, PropModeReplace,
|
|
|
|
(guchar *) hints, sizeof (MotifWmHints) / sizeof (long));
|
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
g_free (hints);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-22 08:40:33 +00:00
|
|
|
static void
|
|
|
|
gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
2009-06-22 13:17:10 +00:00
|
|
|
GstXWindow * xwindow, const gchar * media_title)
|
2009-06-22 08:40:33 +00:00
|
|
|
{
|
|
|
|
if (media_title) {
|
|
|
|
g_free (xvimagesink->media_title);
|
|
|
|
xvimagesink->media_title = g_strdup (media_title);
|
|
|
|
}
|
2009-06-22 13:17:10 +00:00
|
|
|
if (xwindow) {
|
2009-06-22 08:40:33 +00:00
|
|
|
/* we have a window */
|
2009-06-22 13:17:10 +00:00
|
|
|
if (xwindow->internal) {
|
2009-06-22 08:40:33 +00:00
|
|
|
XTextProperty xproperty;
|
|
|
|
const gchar *app_name;
|
|
|
|
const gchar *title = NULL;
|
|
|
|
gchar *title_mem = NULL;
|
|
|
|
|
|
|
|
/* set application name as a title */
|
|
|
|
app_name = g_get_application_name ();
|
|
|
|
|
|
|
|
if (app_name && xvimagesink->media_title) {
|
|
|
|
title = title_mem = g_strconcat (xvimagesink->media_title, " : ",
|
|
|
|
app_name, NULL);
|
|
|
|
} else if (app_name) {
|
|
|
|
title = app_name;
|
|
|
|
} else if (xvimagesink->media_title) {
|
|
|
|
title = xvimagesink->media_title;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (title) {
|
|
|
|
if ((XStringListToTextProperty (((char **) &title), 1,
|
2009-09-05 22:42:42 +00:00
|
|
|
&xproperty)) != 0) {
|
2009-06-22 13:17:10 +00:00
|
|
|
XSetWMName (xvimagesink->xcontext->disp, xwindow->win, &xproperty);
|
2009-09-05 22:42:42 +00:00
|
|
|
XFree (xproperty.value);
|
|
|
|
}
|
2009-06-22 08:40:33 +00:00
|
|
|
|
|
|
|
g_free (title_mem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* This function handles a GstXWindow creation
|
|
|
|
* The width and height are the actual pixel size on the display */
|
2003-11-10 18:22:20 +00:00
|
|
|
static GstXWindow *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
|
|
|
|
gint width, gint height)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXWindow *xwindow = NULL;
|
|
|
|
XGCValues values;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.x = xvimagesink->render_rect.y = 0;
|
|
|
|
xvimagesink->render_rect.w = width;
|
|
|
|
xvimagesink->render_rect.h = height;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
2003-11-17 16:32:29 +00:00
|
|
|
xwindow->internal = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow->win = XCreateSimpleWindow (xvimagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->xcontext->root,
|
2010-02-19 12:46:43 +00:00
|
|
|
0, 0, width, height, 0, 0, xvimagesink->xcontext->black);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2007-04-20 10:42:24 +00:00
|
|
|
/* We have to do that to prevent X from redrawing the background on
|
2005-11-14 22:01:22 +00:00
|
|
|
* ConfigureNotify. This takes away flickering of video when resizing. */
|
|
|
|
XSetWindowBackgroundPixmap (xvimagesink->xcontext->disp, xwindow->win, None);
|
|
|
|
|
2009-06-18 14:58:06 +00:00
|
|
|
/* set application name as a title */
|
2009-06-22 13:17:10 +00:00
|
|
|
gst_xvimagesink_xwindow_set_title (xvimagesink, xwindow, NULL);
|
2009-06-18 14:58:06 +00:00
|
|
|
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
if (xvimagesink->handle_events) {
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
Atom wm_delete;
|
|
|
|
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
|
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
|
|
|
|
/* Tell the window manager we'd like delete client messages instead of
|
|
|
|
* being killed */
|
|
|
|
wm_delete = XInternAtom (xvimagesink->xcontext->disp,
|
2007-10-12 10:52:18 +00:00
|
|
|
"WM_DELETE_WINDOW", True);
|
|
|
|
if (wm_delete != None) {
|
|
|
|
(void) XSetWMProtocols (xvimagesink->xcontext->disp, xwindow->win,
|
|
|
|
&wm_delete, 1);
|
|
|
|
}
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xwindow->win, 0, &values);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XMapRaised (xvimagesink->xcontext->disp, xwindow->win);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
gst_xvimagesink_xwindow_decorate (xvimagesink, xwindow);
|
|
|
|
|
2010-09-05 22:17:47 +00:00
|
|
|
gst_x_overlay_got_window_handle (GST_X_OVERLAY (xvimagesink), xwindow->win);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return xwindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function destroys a GstXWindow */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_destroy (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* If we did not create that window we just free the GC and let it live */
|
|
|
|
if (xwindow->internal)
|
|
|
|
XDestroyWindow (xvimagesink->xcontext->disp, xwindow->win);
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
else
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XFreeGC (xvimagesink->xcontext->disp, xwindow->gc);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_free (xwindow);
|
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
static void
|
2010-02-19 12:46:43 +00:00
|
|
|
gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink)
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
{
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XWindowAttributes attr;
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
/* Update the window geometry */
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2010-04-15 09:59:53 +00:00
|
|
|
if (G_UNLIKELY (xvimagesink->xwindow == NULL)) {
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
return;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XGetWindowAttributes (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xwindow->win, &attr);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
xvimagesink->xwindow->width = attr.width;
|
|
|
|
xvimagesink->xwindow->height = attr.height;
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
|
2010-02-19 12:46:43 +00:00
|
|
|
if (!xvimagesink->have_render_rect) {
|
|
|
|
xvimagesink->render_rect.x = xvimagesink->render_rect.y = 0;
|
|
|
|
xvimagesink->render_rect.w = attr.width;
|
|
|
|
xvimagesink->render_rect.h = attr.height;
|
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_clear (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow)
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-02-05 23:01:59 +00:00
|
|
|
XvStopVideo (xvimagesink->xcontext->disp, xvimagesink->xcontext->xv_port_id,
|
|
|
|
xwindow->win);
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
/* This function commits our internal colorbalance settings to our grabbed Xv
|
|
|
|
port. If the xcontext is not initialized yet it simply returns */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (GstXvImageSink * xvimagesink)
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
{
|
|
|
|
GList *channels = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
/* If we haven't initialized the X context we can't update anything */
|
|
|
|
if (xvimagesink->xcontext == NULL)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2008-06-20 17:02:48 +00:00
|
|
|
/* Don't set the attributes if they haven't been changed, to avoid
|
|
|
|
* rounding errors changing the values */
|
|
|
|
if (!xvimagesink->cb_changed)
|
|
|
|
return;
|
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
/* For each channel of the colorbalance we calculate the correct value
|
|
|
|
doing range conversion and then set the Xv port attribute to match our
|
|
|
|
values. */
|
|
|
|
channels = xvimagesink->xcontext->channels_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (channels) {
|
|
|
|
if (channels->data && GST_IS_COLOR_BALANCE_CHANNEL (channels->data)) {
|
|
|
|
GstColorBalanceChannel *channel = NULL;
|
2007-10-12 10:52:18 +00:00
|
|
|
Atom prop_atom;
|
2004-03-14 22:34:34 +00:00
|
|
|
gint value = 0;
|
|
|
|
gdouble convert_coef;
|
|
|
|
|
|
|
|
channel = GST_COLOR_BALANCE_CHANNEL (channels->data);
|
|
|
|
g_object_ref (channel);
|
|
|
|
|
|
|
|
/* Our range conversion coef */
|
|
|
|
convert_coef = (channel->max_value - channel->min_value) / 2000.0;
|
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
2008-07-29 01:58:05 +00:00
|
|
|
value = xvimagesink->hue;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
2008-07-29 01:58:05 +00:00
|
|
|
value = xvimagesink->saturation;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
2008-07-29 01:58:05 +00:00
|
|
|
value = xvimagesink->contrast;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
2008-07-29 01:58:05 +00:00
|
|
|
value = xvimagesink->brightness;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else {
|
2004-03-15 19:32:28 +00:00
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
g_object_unref (channel);
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Committing to Xv port */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2007-10-12 10:52:18 +00:00
|
|
|
prop_atom =
|
|
|
|
XInternAtom (xvimagesink->xcontext->disp, channel->label, True);
|
|
|
|
if (prop_atom != None) {
|
2008-07-29 01:58:05 +00:00
|
|
|
int xv_value;
|
|
|
|
xv_value =
|
|
|
|
floor (0.5 + (value + 1000) * convert_coef + channel->min_value);
|
2007-10-12 10:52:18 +00:00
|
|
|
XvSetPortAttribute (xvimagesink->xcontext->disp,
|
2008-07-29 01:58:05 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id, prop_atom, xv_value);
|
2007-10-12 10:52:18 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
g_object_unref (channel);
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
channels = g_list_next (channels);
|
|
|
|
}
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* This function handles XEvents that might be in the queue. It generates
|
|
|
|
GstEvent that will be sent upstream in the pipeline to handle interactivity
|
|
|
|
and navigation. It will also listen for configure events on the window to
|
|
|
|
trigger caps renegotiation so on the fly software scaling can work. */
|
|
|
|
static void
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
XEvent e;
|
2004-02-02 21:59:35 +00:00
|
|
|
guint pointer_x = 0, pointer_y = 0;
|
|
|
|
gboolean pointer_moved = FALSE;
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
gboolean exposed = FALSE, configured = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2009-09-15 12:26:06 +00:00
|
|
|
/* Handle Interaction, produces navigation events */
|
|
|
|
|
2004-02-02 21:59:35 +00:00
|
|
|
/* We get all pointer motion events, only the last position is
|
|
|
|
interesting. */
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
2004-02-02 21:59:35 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xwindow->win, PointerMotionMask, &e)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case MotionNotify:
|
2004-03-15 19:32:28 +00:00
|
|
|
pointer_x = e.xmotion.x;
|
|
|
|
pointer_y = e.xmotion.y;
|
|
|
|
pointer_moved = TRUE;
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
2004-03-15 19:32:28 +00:00
|
|
|
break;
|
2004-02-02 21:59:35 +00:00
|
|
|
}
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
2011-04-06 10:26:47 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (pointer_moved) {
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_DEBUG ("xvimagesink pointer moved over window at %d,%d",
|
2004-03-15 19:32:28 +00:00
|
|
|
pointer_x, pointer_y);
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
2005-01-06 16:08:11 +00:00
|
|
|
"mouse-move", 0, e.xbutton.x, e.xbutton.y);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* We get all events on our window to throw them upstream */
|
|
|
|
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xwindow->win,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask,
|
|
|
|
&e)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
KeySym keysym;
|
|
|
|
|
|
|
|
/* We lock only for the X function call */
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case ButtonPress:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Mouse button pressed over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink button %d pressed over window at %d,%d",
|
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
"mouse-button-press", e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
case ButtonRelease:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Mouse button released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink button %d released over window at %d,%d",
|
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
"mouse-button-release", e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
case KeyPress:
|
|
|
|
case KeyRelease:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Key pressed/released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink key %d pressed over window at %d,%d",
|
|
|
|
e.xkey.keycode, e.xkey.x, e.xkey.y);
|
2007-01-22 13:10:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-15 19:32:28 +00:00
|
|
|
keysym = XKeycodeToKeysym (xvimagesink->xcontext->disp,
|
|
|
|
e.xkey.keycode, 0);
|
2007-01-22 13:10:13 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-15 19:32:28 +00:00
|
|
|
if (keysym != NoSymbol) {
|
2007-01-23 13:19:19 +00:00
|
|
|
char *key_str = NULL;
|
|
|
|
|
2007-01-22 13:16:42 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2007-01-23 13:19:19 +00:00
|
|
|
key_str = XKeysymToString (keysym);
|
2007-01-22 13:16:42 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2007-01-23 13:19:19 +00:00
|
|
|
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
e.type == KeyPress ? "key-press" : "key-release", key_str);
|
2004-03-15 19:32:28 +00:00
|
|
|
} else {
|
|
|
|
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
e.type == KeyPress ? "key-press" : "key-release", "unknown");
|
|
|
|
}
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
2011-04-06 10:26:47 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "xvimagesink unhandled X event (%d)",
|
|
|
|
e.type);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
/* Handle Expose */
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xwindow->win, ExposureMask | StructureNotifyMask, &e)) {
|
|
|
|
switch (e.type) {
|
|
|
|
case Expose:
|
|
|
|
exposed = TRUE;
|
|
|
|
break;
|
|
|
|
case ConfigureNotify:
|
2010-02-16 10:06:08 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2010-02-19 12:46:43 +00:00
|
|
|
gst_xvimagesink_xwindow_update_geometry (xvimagesink);
|
2010-02-16 10:06:08 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
configured = TRUE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
}
|
|
|
|
|
2007-07-14 18:20:41 +00:00
|
|
|
if (xvimagesink->handle_expose && (exposed || configured)) {
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
gst_xvimagesink_expose (GST_X_OVERLAY (xvimagesink));
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
2007-05-21 15:32:42 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle Display events */
|
|
|
|
while (XPending (xvimagesink->xcontext->disp)) {
|
|
|
|
XNextEvent (xvimagesink->xcontext->disp, &e);
|
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case ClientMessage:{
|
|
|
|
Atom wm_delete;
|
|
|
|
|
|
|
|
wm_delete = XInternAtom (xvimagesink->xcontext->disp,
|
2007-10-12 10:52:18 +00:00
|
|
|
"WM_DELETE_WINDOW", True);
|
|
|
|
if (wm_delete != None && wm_delete == (Atom) e.xclient.data.l[0]) {
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
/* Handle window deletion by posting an error on the bus */
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, NOT_FOUND,
|
|
|
|
("Output window was closed"), (NULL));
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
|
|
|
}
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
static void
|
|
|
|
gst_lookup_xv_port_from_adaptor (GstXContext * xcontext,
|
|
|
|
XvAdaptorInfo * adaptors, int adaptor_no)
|
|
|
|
{
|
|
|
|
gint j;
|
2008-04-23 08:58:42 +00:00
|
|
|
gint res;
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
|
|
|
|
/* Do we support XvImageMask ? */
|
2008-04-23 08:58:42 +00:00
|
|
|
if (!(adaptors[adaptor_no].type & XvImageMask)) {
|
|
|
|
GST_DEBUG ("XV Adaptor %s has no support for XvImageMask",
|
|
|
|
adaptors[adaptor_no].name);
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
return;
|
2008-04-23 08:58:42 +00:00
|
|
|
}
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
|
|
|
|
/* We found such an adaptor, looking for an available port */
|
|
|
|
for (j = 0; j < adaptors[adaptor_no].num_ports && !xcontext->xv_port_id; j++) {
|
|
|
|
/* We try to grab the port */
|
2008-04-23 08:58:42 +00:00
|
|
|
res = XvGrabPort (xcontext->disp, adaptors[adaptor_no].base_id + j, 0);
|
|
|
|
if (Success == res) {
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
xcontext->xv_port_id = adaptors[adaptor_no].base_id + j;
|
|
|
|
GST_DEBUG ("XV Adaptor %s with %ld ports", adaptors[adaptor_no].name,
|
|
|
|
adaptors[adaptor_no].num_ports);
|
2008-04-23 08:58:42 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG ("GrabPort %d for XV Adaptor %s failed: %d", j,
|
|
|
|
adaptors[adaptor_no].name, res);
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* This function generates a caps with all supported format by the first
|
|
|
|
Xv grabable port we find. We store each one of the supported formats in a
|
2004-07-19 11:21:10 +00:00
|
|
|
format list and append the format to a newly created caps that we return
|
2004-04-17 02:30:28 +00:00
|
|
|
If this function does not return NULL because of an error, it also grabs
|
|
|
|
the port via XvGrabPort */
|
2003-11-10 18:22:20 +00:00
|
|
|
static GstCaps *
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink,
|
|
|
|
GstXContext * xcontext)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
ext/: ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek) (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain) ext...
Original commit message from CVS:
2005-05-09 Andy Wingo <wingo@pobox.com>
* ext/alsa/gstalsasink.h:
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_get_icy_metadata):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
(gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
* ext/theora/theoradec.c (theora_dec_src_query)
(theora_dec_src_event, theora_dec_sink_event)
(theora_handle_comment_packet, theora_handle_data_packet):
* ext/theora/theoraenc.c (theora_enc_chain):
* ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
(vorbis_dec_sink_event, vorbis_handle_comment_packet):
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
* gst/typefind/gsttypefindfunctions.c (mp3_type_find)
(qt_type_find):
* gst/videotestsrc/videotestsrc.c (paint_setup_I420)
(paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
(paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
(paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
(paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
(paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
(paint_setup_xBGR8888, paint_setup_RGBx8888)
(paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
(paint_setup_RGB565, paint_setup_xRGB1555):
* gst/videotestsrc/videotestsrc.h:
* sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
(gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
GCC4 fixes.
* ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
gst_pad_query_position. Fixes oggdemux.
2005-05-09 07:03:13 +00:00
|
|
|
gint i;
|
2003-11-10 18:22:20 +00:00
|
|
|
XvAdaptorInfo *adaptors;
|
2004-04-17 02:30:28 +00:00
|
|
|
gint nb_formats;
|
|
|
|
XvImageFormatValues *formats = NULL;
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
guint nb_encodings;
|
|
|
|
XvEncodingInfo *encodings = NULL;
|
|
|
|
gulong max_w = G_MAXINT, max_h = G_MAXINT;
|
2004-04-17 02:30:28 +00:00
|
|
|
GstCaps *caps = NULL;
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
GstCaps *rgb_caps = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (xcontext != NULL, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* First let's check that XVideo extension is available */
|
2006-09-20 10:59:06 +00:00
|
|
|
if (!XQueryExtension (xcontext->disp, "XVideo", &i, &i, &i)) {
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS,
|
|
|
|
("Could not initialise Xv output"),
|
|
|
|
("XVideo extension is not available"));
|
|
|
|
return NULL;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Then we get adaptors list */
|
|
|
|
if (Success != XvQueryAdaptors (xcontext->disp, xcontext->root,
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
&xcontext->nb_adaptors, &adaptors)) {
|
2006-09-20 10:59:06 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS,
|
|
|
|
("Could not initialise Xv output"),
|
|
|
|
("Failed getting XV adaptors list"));
|
|
|
|
return NULL;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext->xv_port_id = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
GST_DEBUG ("Found %u XV adaptor(s)", xcontext->nb_adaptors);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
xcontext->adaptors =
|
|
|
|
(gchar **) g_malloc0 (xcontext->nb_adaptors * sizeof (gchar *));
|
|
|
|
|
|
|
|
/* Now fill up our adaptor name array */
|
|
|
|
for (i = 0; i < xcontext->nb_adaptors; i++) {
|
|
|
|
xcontext->adaptors[i] = g_strdup (adaptors[i].name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimagesink->adaptor_no >= 0 &&
|
|
|
|
xvimagesink->adaptor_no < xcontext->nb_adaptors) {
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
/* Find xv port from user defined adaptor */
|
|
|
|
gst_lookup_xv_port_from_adaptor (xcontext, adaptors,
|
|
|
|
xvimagesink->adaptor_no);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
if (!xcontext->xv_port_id) {
|
|
|
|
/* Now search for an adaptor that supports XvImageMask */
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
for (i = 0; i < xcontext->nb_adaptors && !xcontext->xv_port_id; i++) {
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
gst_lookup_xv_port_from_adaptor (xcontext, adaptors, i);
|
|
|
|
xvimagesink->adaptor_no = i;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
|
2003-12-27 15:37:43 +00:00
|
|
|
XvFreeAdaptorInfo (adaptors);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-09-20 10:59:06 +00:00
|
|
|
if (!xcontext->xv_port_id) {
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
xvimagesink->adaptor_no = -1;
|
2006-09-20 10:59:06 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, BUSY,
|
|
|
|
("Could not initialise Xv output"), ("No port available"));
|
|
|
|
return NULL;
|
|
|
|
}
|
2004-04-17 02:30:28 +00:00
|
|
|
|
2006-01-27 01:36:01 +00:00
|
|
|
/* Set XV_AUTOPAINT_COLORKEY and XV_DOUBLE_BUFFER and XV_COLORKEY */
|
2004-05-21 13:28:24 +00:00
|
|
|
{
|
2008-05-14 09:12:10 +00:00
|
|
|
int count, todo = 3;
|
2004-10-26 11:36:53 +00:00
|
|
|
XvAttribute *const attr = XvQueryPortAttributes (xcontext->disp,
|
2004-05-21 13:28:24 +00:00
|
|
|
xcontext->xv_port_id, &count);
|
|
|
|
static const char autopaint[] = "XV_AUTOPAINT_COLORKEY";
|
2006-01-27 01:36:01 +00:00
|
|
|
static const char dbl_buffer[] = "XV_DOUBLE_BUFFER";
|
|
|
|
static const char colorkey[] = "XV_COLORKEY";
|
2004-05-21 13:28:24 +00:00
|
|
|
|
2008-05-14 09:12:10 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "Checking %d Xv port attributes", count);
|
|
|
|
|
2008-10-22 12:25:02 +00:00
|
|
|
xvimagesink->have_autopaint_colorkey = FALSE;
|
|
|
|
xvimagesink->have_double_buffer = FALSE;
|
|
|
|
xvimagesink->have_colorkey = FALSE;
|
|
|
|
|
2008-05-14 09:12:10 +00:00
|
|
|
for (i = 0; ((i < count) && todo); i++)
|
2004-05-21 13:28:24 +00:00
|
|
|
if (!strcmp (attr[i].name, autopaint)) {
|
|
|
|
const Atom atom = XInternAtom (xcontext->disp, autopaint, False);
|
|
|
|
|
2008-07-29 08:59:32 +00:00
|
|
|
/* turn on autopaint colorkey */
|
|
|
|
XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom,
|
|
|
|
(xvimagesink->autopaint_colorkey ? 1 : 0));
|
2008-05-14 09:12:10 +00:00
|
|
|
todo--;
|
2008-10-22 12:25:02 +00:00
|
|
|
xvimagesink->have_autopaint_colorkey = TRUE;
|
2008-05-14 09:12:10 +00:00
|
|
|
} else if (!strcmp (attr[i].name, dbl_buffer)) {
|
2006-01-27 01:36:01 +00:00
|
|
|
const Atom atom = XInternAtom (xcontext->disp, dbl_buffer, False);
|
|
|
|
|
2007-07-14 18:33:15 +00:00
|
|
|
XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom,
|
|
|
|
(xvimagesink->double_buffer ? 1 : 0));
|
2008-05-14 09:12:10 +00:00
|
|
|
todo--;
|
2008-10-22 12:25:02 +00:00
|
|
|
xvimagesink->have_double_buffer = TRUE;
|
2008-05-14 09:12:10 +00:00
|
|
|
} else if (!strcmp (attr[i].name, colorkey)) {
|
2008-10-22 12:25:02 +00:00
|
|
|
/* Set the colorkey, default is something that is dark but hopefully
|
|
|
|
* won't randomly appear on the screen elsewhere (ie not black or greys)
|
|
|
|
* can be overridden by setting "colorkey" property
|
|
|
|
*/
|
2006-01-27 01:36:01 +00:00
|
|
|
const Atom atom = XInternAtom (xcontext->disp, colorkey, False);
|
2008-07-30 15:29:44 +00:00
|
|
|
guint32 ckey = 0;
|
2006-09-30 15:30:07 +00:00
|
|
|
gboolean set_attr = TRUE;
|
2008-10-22 12:25:02 +00:00
|
|
|
guint cr, cg, cb;
|
2006-09-30 15:30:07 +00:00
|
|
|
|
2006-09-20 10:59:06 +00:00
|
|
|
/* set a colorkey in the right format RGB565/RGB888
|
2009-03-26 16:54:56 +00:00
|
|
|
* We only handle these 2 cases, because they're the only types of
|
|
|
|
* devices we've encountered. If we don't recognise it, leave it alone
|
|
|
|
*/
|
2008-10-22 12:25:02 +00:00
|
|
|
cr = (xvimagesink->colorkey >> 16);
|
|
|
|
cg = (xvimagesink->colorkey >> 8) & 0xFF;
|
|
|
|
cb = (xvimagesink->colorkey) & 0xFF;
|
2009-03-26 16:54:56 +00:00
|
|
|
switch (xcontext->depth) {
|
|
|
|
case 16: /* RGB 565 */
|
|
|
|
cr >>= 3;
|
|
|
|
cg >>= 2;
|
|
|
|
cb >>= 3;
|
|
|
|
ckey = (cr << 11) | (cg << 5) | cb;
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
case 32: /* RGB 888 / ARGB 8888 */
|
|
|
|
ckey = (cr << 16) | (cg << 8) | cb;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"Unknown bit depth %d for Xv Colorkey - not adjusting",
|
|
|
|
xcontext->depth);
|
|
|
|
set_attr = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2006-09-30 15:30:07 +00:00
|
|
|
|
|
|
|
if (set_attr) {
|
|
|
|
ckey = CLAMP (ckey, (guint32) attr[i].min_value,
|
|
|
|
(guint32) attr[i].max_value);
|
|
|
|
GST_LOG_OBJECT (xvimagesink,
|
|
|
|
"Setting color key for display depth %d to 0x%x",
|
|
|
|
xcontext->depth, ckey);
|
|
|
|
|
|
|
|
XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom,
|
|
|
|
(gint) ckey);
|
|
|
|
}
|
2008-05-14 09:12:10 +00:00
|
|
|
todo--;
|
2008-10-22 12:25:02 +00:00
|
|
|
xvimagesink->have_colorkey = TRUE;
|
2006-01-27 01:36:01 +00:00
|
|
|
}
|
|
|
|
|
2004-10-26 11:36:53 +00:00
|
|
|
XFree (attr);
|
2004-05-21 13:28:24 +00:00
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
/* Get the list of encodings supported by the adapter and look for the
|
|
|
|
* XV_IMAGE encoding so we can determine the maximum width and height
|
|
|
|
* supported */
|
|
|
|
XvQueryEncodings (xcontext->disp, xcontext->xv_port_id, &nb_encodings,
|
|
|
|
&encodings);
|
|
|
|
|
|
|
|
for (i = 0; i < nb_encodings; i++) {
|
|
|
|
GST_LOG_OBJECT (xvimagesink,
|
|
|
|
"Encoding %d, name %s, max wxh %lux%lu rate %d/%d",
|
|
|
|
i, encodings[i].name, encodings[i].width, encodings[i].height,
|
|
|
|
encodings[i].rate.numerator, encodings[i].rate.denominator);
|
|
|
|
if (strcmp (encodings[i].name, "XV_IMAGE") == 0) {
|
|
|
|
max_w = encodings[i].width;
|
|
|
|
max_h = encodings[i].height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
XvFreeEncodingInfo (encodings);
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
/* We get all image formats supported by our port */
|
|
|
|
formats = XvListImageFormats (xcontext->disp,
|
|
|
|
xcontext->xv_port_id, &nb_formats);
|
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; i < nb_formats; i++) {
|
|
|
|
GstCaps *format_caps = NULL;
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
gboolean is_rgb_format = FALSE;
|
2004-04-17 02:30:28 +00:00
|
|
|
|
2007-07-20 16:09:03 +00:00
|
|
|
/* We set the image format of the xcontext to an existing one. This
|
|
|
|
is just some valid image format for making our xshm calls check before
|
2004-04-17 02:30:28 +00:00
|
|
|
caps negotiation really happens. */
|
|
|
|
xcontext->im_format = formats[i].id;
|
|
|
|
|
|
|
|
switch (formats[i].type) {
|
|
|
|
case XvRGB:
|
|
|
|
{
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
XvImageFormatValues *fmt = &(formats[i]);
|
|
|
|
gint endianness = G_BIG_ENDIAN;
|
|
|
|
|
|
|
|
if (fmt->byte_order == LSBFirst) {
|
|
|
|
/* our caps system handles 24/32bpp RGB as big-endian. */
|
|
|
|
if (fmt->bits_per_pixel == 24 || fmt->bits_per_pixel == 32) {
|
|
|
|
fmt->red_mask = GUINT32_TO_BE (fmt->red_mask);
|
|
|
|
fmt->green_mask = GUINT32_TO_BE (fmt->green_mask);
|
|
|
|
fmt->blue_mask = GUINT32_TO_BE (fmt->blue_mask);
|
|
|
|
|
|
|
|
if (fmt->bits_per_pixel == 24) {
|
|
|
|
fmt->red_mask >>= 8;
|
|
|
|
fmt->green_mask >>= 8;
|
|
|
|
fmt->blue_mask >>= 8;
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
endianness = G_LITTLE_ENDIAN;
|
|
|
|
}
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
format_caps = gst_caps_new_simple ("video/x-raw-rgb",
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
"endianness", G_TYPE_INT, endianness,
|
|
|
|
"depth", G_TYPE_INT, fmt->depth,
|
|
|
|
"bpp", G_TYPE_INT, fmt->bits_per_pixel,
|
2007-01-16 11:41:58 +00:00
|
|
|
"red_mask", G_TYPE_INT, fmt->red_mask,
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
"green_mask", G_TYPE_INT, fmt->green_mask,
|
2007-01-16 11:41:58 +00:00
|
|
|
"blue_mask", G_TYPE_INT, fmt->blue_mask,
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
"width", GST_TYPE_INT_RANGE, 1, max_w,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 1, max_h,
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
|
|
|
|
is_rgb_format = TRUE;
|
2004-04-17 02:30:28 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2004-04-17 02:30:28 +00:00
|
|
|
case XvYUV:
|
|
|
|
format_caps = gst_caps_new_simple ("video/x-raw-yuv",
|
|
|
|
"format", GST_TYPE_FOURCC, formats[i].id,
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
"width", GST_TYPE_INT_RANGE, 1, max_w,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 1, max_h,
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
2004-04-17 02:30:28 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (format_caps) {
|
|
|
|
GstXvImageFormat *format = NULL;
|
|
|
|
|
|
|
|
format = g_new0 (GstXvImageFormat, 1);
|
|
|
|
if (format) {
|
|
|
|
format->format = formats[i].id;
|
|
|
|
format->caps = gst_caps_copy (format_caps);
|
|
|
|
xcontext->formats_list = g_list_append (xcontext->formats_list, format);
|
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
if (is_rgb_format) {
|
|
|
|
if (rgb_caps == NULL)
|
|
|
|
rgb_caps = format_caps;
|
|
|
|
else
|
|
|
|
gst_caps_append (rgb_caps, format_caps);
|
|
|
|
} else
|
|
|
|
gst_caps_append (caps, format_caps);
|
|
|
|
}
|
2004-04-17 02:30:28 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
/* Collected all caps into either the caps or rgb_caps structures.
|
|
|
|
* Append rgb_caps on the end of YUV, so that YUV is always preferred */
|
|
|
|
if (rgb_caps)
|
|
|
|
gst_caps_append (caps, rgb_caps);
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
if (formats)
|
|
|
|
XFree (formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
GST_DEBUG ("Generated the following caps: %" GST_PTR_FORMAT, caps);
|
|
|
|
|
2006-09-20 10:59:06 +00:00
|
|
|
if (gst_caps_is_empty (caps)) {
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_caps_unref (caps);
|
2004-04-17 02:30:28 +00:00
|
|
|
XvUngrabPort (xcontext->disp, xcontext->xv_port_id, 0);
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, STREAM, WRONG_TYPE, (NULL),
|
2004-04-17 02:30:28 +00:00
|
|
|
("No supported format found"));
|
|
|
|
return NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2006-09-20 10:59:06 +00:00
|
|
|
|
|
|
|
return caps;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
static gpointer
|
|
|
|
gst_xvimagesink_event_thread (GstXvImageSink * xvimagesink)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
|
|
|
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
while (xvimagesink->running) {
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (xvimagesink->xwindow) {
|
|
|
|
gst_xvimagesink_handle_xevents (xvimagesink);
|
|
|
|
}
|
2009-09-15 12:26:06 +00:00
|
|
|
/* FIXME: do we want to align this with the framerate or anything else? */
|
|
|
|
g_usleep (G_USEC_PER_SEC / 20);
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
|
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
}
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-09-15 12:26:06 +00:00
|
|
|
static void
|
|
|
|
gst_xvimagesink_manage_event_thread (GstXvImageSink * xvimagesink)
|
|
|
|
{
|
|
|
|
GThread *thread = NULL;
|
|
|
|
|
|
|
|
/* don't start the thread too early */
|
|
|
|
if (xvimagesink->xcontext == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
|
|
|
if (xvimagesink->handle_expose || xvimagesink->handle_events) {
|
|
|
|
if (!xvimagesink->event_thread) {
|
|
|
|
/* Setup our event listening thread */
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "run xevent thread, expose %d, events %d",
|
|
|
|
xvimagesink->handle_expose, xvimagesink->handle_events);
|
|
|
|
xvimagesink->running = TRUE;
|
|
|
|
xvimagesink->event_thread = g_thread_create (
|
|
|
|
(GThreadFunc) gst_xvimagesink_event_thread, xvimagesink, TRUE, NULL);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (xvimagesink->event_thread) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "stop xevent thread, expose %d, events %d",
|
|
|
|
xvimagesink->handle_expose, xvimagesink->handle_events);
|
|
|
|
xvimagesink->running = FALSE;
|
|
|
|
/* grab thread and mark it as NULL */
|
|
|
|
thread = xvimagesink->event_thread;
|
|
|
|
xvimagesink->event_thread = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
|
|
|
|
|
|
|
/* Wait for our event thread to finish */
|
|
|
|
if (thread)
|
|
|
|
g_thread_join (thread);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* This function calculates the pixel aspect ratio based on the properties
|
|
|
|
* in the xcontext structure and stores it there. */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_calculate_pixel_aspect_ratio (GstXContext * xcontext)
|
|
|
|
{
|
2007-02-15 12:07:57 +00:00
|
|
|
static const gint par[][2] = {
|
2004-07-27 16:43:24 +00:00
|
|
|
{1, 1}, /* regular screen */
|
|
|
|
{16, 15}, /* PAL TV */
|
|
|
|
{11, 10}, /* 525 line Rec.601 video */
|
2006-01-26 19:17:38 +00:00
|
|
|
{54, 59}, /* 625 line Rec.601 video */
|
|
|
|
{64, 45}, /* 1280x1024 on 16:9 display */
|
|
|
|
{5, 3}, /* 1280x1024 on 4:3 display */
|
|
|
|
{4, 3} /* 800x600 on 16:9 display */
|
2004-07-27 16:43:24 +00:00
|
|
|
};
|
|
|
|
gint i;
|
|
|
|
gint index;
|
|
|
|
gdouble ratio;
|
|
|
|
gdouble delta;
|
|
|
|
|
|
|
|
#define DELTA(idx) (ABS (ratio - ((gdouble) par[idx][0] / par[idx][1])))
|
|
|
|
|
|
|
|
/* first calculate the "real" ratio based on the X values;
|
|
|
|
* which is the "physical" w/h divided by the w/h in pixels of the display */
|
2004-08-03 14:09:26 +00:00
|
|
|
ratio = (gdouble) (xcontext->widthmm * xcontext->height)
|
2004-07-27 16:43:24 +00:00
|
|
|
/ (xcontext->heightmm * xcontext->width);
|
2004-08-03 14:09:26 +00:00
|
|
|
|
2004-08-02 10:04:08 +00:00
|
|
|
/* DirectFB's X in 720x576 reports the physical dimensions wrong, so
|
|
|
|
* override here */
|
|
|
|
if (xcontext->width == 720 && xcontext->height == 576) {
|
|
|
|
ratio = 4.0 * 576 / (3.0 * 720);
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG ("calculated pixel aspect ratio: %f", ratio);
|
2011-02-24 10:57:53 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* now find the one from par[][2] with the lowest delta to the real one */
|
|
|
|
delta = DELTA (0);
|
|
|
|
index = 0;
|
|
|
|
|
|
|
|
for (i = 1; i < sizeof (par) / (sizeof (gint) * 2); ++i) {
|
|
|
|
gdouble this_delta = DELTA (i);
|
|
|
|
|
|
|
|
if (this_delta < delta) {
|
|
|
|
index = i;
|
|
|
|
delta = this_delta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG ("Decided on index %d (%d/%d)", index,
|
|
|
|
par[index][0], par[index][1]);
|
|
|
|
|
2004-08-02 10:04:08 +00:00
|
|
|
g_free (xcontext->par);
|
|
|
|
xcontext->par = g_new0 (GValue, 1);
|
|
|
|
g_value_init (xcontext->par, GST_TYPE_FRACTION);
|
|
|
|
gst_value_set_fraction (xcontext->par, par[index][0], par[index][1]);
|
|
|
|
GST_DEBUG ("set xcontext PAR to %d/%d",
|
|
|
|
gst_value_get_fraction_numerator (xcontext->par),
|
|
|
|
gst_value_get_fraction_denominator (xcontext->par));
|
2004-07-27 16:43:24 +00:00
|
|
|
}
|
|
|
|
|
2004-07-19 11:21:10 +00:00
|
|
|
/* This function gets the X Display and global info about it. Everything is
|
2003-11-10 18:22:20 +00:00
|
|
|
stored in our object and will be cleaned when the object is disposed. Note
|
2004-07-19 11:21:10 +00:00
|
|
|
here that caps for supported format are generated without any window or
|
2003-11-10 18:22:20 +00:00
|
|
|
image creation */
|
|
|
|
static GstXContext *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXContext *xcontext = NULL;
|
|
|
|
XPixmapFormatValues *px_formats = NULL;
|
2004-01-13 17:57:25 +00:00
|
|
|
gint nb_formats = 0, i, j, N_attr;
|
|
|
|
XvAttribute *xv_attr;
|
2007-10-12 10:52:18 +00:00
|
|
|
Atom prop_atom;
|
2010-03-15 21:49:53 +00:00
|
|
|
const char *channels[4] = { "XV_HUE", "XV_SATURATION",
|
2004-03-14 22:34:34 +00:00
|
|
|
"XV_BRIGHTNESS", "XV_CONTRAST"
|
|
|
|
};
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext = g_new0 (GstXContext, 1);
|
2004-05-04 14:17:25 +00:00
|
|
|
xcontext->im_format = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xcontext->disp = XOpenDisplay (xvimagesink->display_name);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!xcontext->disp) {
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE,
|
|
|
|
("Could not initialise Xv output"), ("Could not open display"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext->screen = DefaultScreenOfDisplay (xcontext->disp);
|
|
|
|
xcontext->screen_num = DefaultScreen (xcontext->disp);
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->visual = DefaultVisual (xcontext->disp, xcontext->screen_num);
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext->root = DefaultRootWindow (xcontext->disp);
|
|
|
|
xcontext->white = XWhitePixel (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->black = XBlackPixel (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->depth = DefaultDepthOfScreen (xcontext->screen);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
xcontext->width = DisplayWidth (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->height = DisplayHeight (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->widthmm = DisplayWidthMM (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->heightmm = DisplayHeightMM (xcontext->disp, xcontext->screen_num);
|
|
|
|
|
2004-08-03 08:48:29 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "X reports %dx%d pixels and %d mm x %d mm",
|
|
|
|
xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
gst_xvimagesink_calculate_pixel_aspect_ratio (xcontext);
|
2003-11-10 18:22:20 +00:00
|
|
|
/* We get supported pixmap formats at supported depth */
|
|
|
|
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!px_formats) {
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2007-11-16 11:16:58 +00:00
|
|
|
g_free (xcontext->par);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_free (xcontext);
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS,
|
|
|
|
("Could not initialise Xv output"), ("Could not get pixel formats"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* We get bpp value corresponding to our running depth */
|
2004-03-14 22:34:34 +00:00
|
|
|
for (i = 0; i < nb_formats; i++) {
|
|
|
|
if (px_formats[i].depth == xcontext->depth)
|
|
|
|
xcontext->bpp = px_formats[i].bits_per_pixel;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XFree (px_formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xcontext->endianness =
|
|
|
|
(ImageByteOrder (xcontext->disp) ==
|
|
|
|
LSBFirst) ? G_LITTLE_ENDIAN : G_BIG_ENDIAN;
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* our caps system handles 24/32bpp RGB as big-endian. */
|
|
|
|
if ((xcontext->bpp == 24 || xcontext->bpp == 32) &&
|
|
|
|
xcontext->endianness == G_LITTLE_ENDIAN) {
|
|
|
|
xcontext->endianness = G_BIG_ENDIAN;
|
|
|
|
xcontext->visual->red_mask = GUINT32_TO_BE (xcontext->visual->red_mask);
|
|
|
|
xcontext->visual->green_mask = GUINT32_TO_BE (xcontext->visual->green_mask);
|
|
|
|
xcontext->visual->blue_mask = GUINT32_TO_BE (xcontext->visual->blue_mask);
|
|
|
|
if (xcontext->bpp == 24) {
|
|
|
|
xcontext->visual->red_mask >>= 8;
|
|
|
|
xcontext->visual->green_mask >>= 8;
|
|
|
|
xcontext->visual->blue_mask >>= 8;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
xcontext->caps = gst_xvimagesink_get_xv_support (xvimagesink, xcontext);
|
2004-01-13 17:57:25 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
/* Search for XShm extension support */
|
2011-04-06 10:26:47 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-01-28 00:29:42 +00:00
|
|
|
if (XShmQueryExtension (xcontext->disp) &&
|
2011-04-06 10:26:47 +00:00
|
|
|
gst_xvimagesink_check_xshm_calls (xvimagesink, xcontext)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->use_xshm = TRUE;
|
|
|
|
GST_DEBUG ("xvimagesink is using XShm extension");
|
2004-04-17 02:30:28 +00:00
|
|
|
} else
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->use_xshm = FALSE;
|
|
|
|
GST_DEBUG ("xvimagesink is not using XShm extension");
|
|
|
|
}
|
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
if (!xcontext->caps) {
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext->par);
|
|
|
|
g_free (xcontext);
|
|
|
|
/* GST_ELEMENT_ERROR is thrown by gst_xvimagesink_get_xv_support */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-01-13 17:57:25 +00:00
|
|
|
xv_attr = XvQueryPortAttributes (xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->xv_port_id, &N_attr);
|
|
|
|
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
/* Generate the channels list */
|
2004-03-14 22:34:34 +00:00
|
|
|
for (i = 0; i < (sizeof (channels) / sizeof (char *)); i++) {
|
|
|
|
XvAttribute *matching_attr = NULL;
|
|
|
|
|
2011-04-05 08:32:52 +00:00
|
|
|
/* Retrieve the property atom if it exists. If it doesn't exist,
|
2007-10-12 10:52:18 +00:00
|
|
|
* the attribute itself must not either, so we can skip */
|
|
|
|
prop_atom = XInternAtom (xcontext->disp, channels[i], True);
|
|
|
|
if (prop_atom == None)
|
|
|
|
continue;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xv_attr != NULL) {
|
|
|
|
for (j = 0; j < N_attr && matching_attr == NULL; ++j)
|
2004-03-15 19:32:28 +00:00
|
|
|
if (!g_ascii_strcasecmp (channels[i], xv_attr[j].name))
|
|
|
|
matching_attr = xv_attr + j;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (matching_attr) {
|
|
|
|
GstColorBalanceChannel *channel;
|
|
|
|
|
|
|
|
channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL);
|
|
|
|
channel->label = g_strdup (channels[i]);
|
|
|
|
channel->min_value = matching_attr ? matching_attr->min_value : -1000;
|
|
|
|
channel->max_value = matching_attr ? matching_attr->max_value : 1000;
|
|
|
|
|
|
|
|
xcontext->channels_list = g_list_append (xcontext->channels_list,
|
2004-03-15 19:32:28 +00:00
|
|
|
channel);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
/* If the colorbalance settings have not been touched we get Xv values
|
|
|
|
as defaults and update our internal variables */
|
|
|
|
if (!xvimagesink->cb_changed) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gint val;
|
|
|
|
|
|
|
|
XvGetPortAttribute (xcontext->disp, xcontext->xv_port_id,
|
2007-10-12 10:52:18 +00:00
|
|
|
prop_atom, &val);
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Normalize val to [-1000, 1000] */
|
2008-07-29 01:58:05 +00:00
|
|
|
val = floor (0.5 + -1000 + 2000 * (val - channel->min_value) /
|
|
|
|
(double) (channel->max_value - channel->min_value));
|
2004-03-15 19:32:28 +00:00
|
|
|
|
|
|
|
if (!g_ascii_strcasecmp (channels[i], "XV_HUE"))
|
|
|
|
xvimagesink->hue = val;
|
|
|
|
else if (!g_ascii_strcasecmp (channels[i], "XV_SATURATION"))
|
|
|
|
xvimagesink->saturation = val;
|
|
|
|
else if (!g_ascii_strcasecmp (channels[i], "XV_BRIGHTNESS"))
|
|
|
|
xvimagesink->brightness = val;
|
|
|
|
else if (!g_ascii_strcasecmp (channels[i], "XV_CONTRAST"))
|
|
|
|
xvimagesink->contrast = val;
|
2004-01-16 23:52:53 +00:00
|
|
|
}
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2004-01-13 17:57:25 +00:00
|
|
|
|
|
|
|
if (xv_attr)
|
|
|
|
XFree (xv_attr);
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return xcontext;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function cleans the X context. Closing the Display, releasing the XV
|
|
|
|
port and unrefing the caps for supported formats. */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xcontext_clear (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
GList *formats_list, *channels_list;
|
2006-07-13 14:38:15 +00:00
|
|
|
GstXContext *xcontext;
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
gint i = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2006-07-13 14:38:15 +00:00
|
|
|
|
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
|
|
|
if (xvimagesink->xcontext == NULL) {
|
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Take the XContext from the sink and clean it up */
|
|
|
|
xcontext = xvimagesink->xcontext;
|
|
|
|
xvimagesink->xcontext = NULL;
|
|
|
|
|
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
formats_list = xcontext->formats_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (formats_list) {
|
|
|
|
GstXvImageFormat *format = formats_list->data;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_caps_unref (format->caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_free (format);
|
|
|
|
formats_list = g_list_next (formats_list);
|
|
|
|
}
|
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
if (xcontext->formats_list)
|
|
|
|
g_list_free (xcontext->formats_list);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
channels_list = xcontext->channels_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (channels_list) {
|
|
|
|
GstColorBalanceChannel *channel = channels_list->data;
|
|
|
|
|
|
|
|
g_object_unref (channel);
|
|
|
|
channels_list = g_list_next (channels_list);
|
|
|
|
}
|
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
if (xcontext->channels_list)
|
|
|
|
g_list_free (xcontext->channels_list);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
gst_caps_unref (xcontext->caps);
|
|
|
|
if (xcontext->last_caps)
|
|
|
|
gst_caps_replace (&xcontext->last_caps, NULL);
|
2006-05-19 11:50:17 +00:00
|
|
|
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
for (i = 0; i < xcontext->nb_adaptors; i++) {
|
|
|
|
g_free (xcontext->adaptors[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (xcontext->adaptors);
|
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
g_free (xcontext->par);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "Closing display and freeing X Context");
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
XvUngrabPort (xcontext->disp, xcontext->xv_port_id, 0);
|
|
|
|
|
|
|
|
XCloseDisplay (xcontext->disp);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2006-07-13 14:38:15 +00:00
|
|
|
g_free (xcontext);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Element stuff */
|
|
|
|
|
|
|
|
static GstCaps *
|
2011-05-16 10:04:39 +00:00
|
|
|
gst_xvimagesink_getcaps (GstBaseSink * bsink, GstCaps * filter)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2011-05-17 10:54:41 +00:00
|
|
|
GstCaps *caps;
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
|
|
|
|
2011-05-16 10:04:39 +00:00
|
|
|
if (xvimagesink->xcontext) {
|
|
|
|
if (filter)
|
|
|
|
return gst_caps_intersect_full (filter, xvimagesink->xcontext->caps,
|
|
|
|
GST_CAPS_INTERSECT_FIRST);
|
|
|
|
else
|
|
|
|
return gst_caps_ref (xvimagesink->xcontext->caps);
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2011-05-17 10:54:41 +00:00
|
|
|
caps = gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD (xvimagesink));
|
2011-05-16 10:04:39 +00:00
|
|
|
if (filter) {
|
2011-05-17 10:54:41 +00:00
|
|
|
GstCaps *intersection;
|
|
|
|
|
|
|
|
intersection =
|
|
|
|
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
caps = intersection;
|
2011-05-16 10:04:39 +00:00
|
|
|
}
|
2011-05-17 10:54:41 +00:00
|
|
|
return caps;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
2011-04-06 10:26:47 +00:00
|
|
|
GstBufferPool *newpool, *oldpool;
|
2003-12-22 01:47:09 +00:00
|
|
|
gboolean ret;
|
2011-04-06 10:26:47 +00:00
|
|
|
guint32 im_format = 0;
|
2004-07-27 16:43:24 +00:00
|
|
|
gint video_width, video_height;
|
2008-11-13 18:18:32 +00:00
|
|
|
gint disp_x, disp_y;
|
|
|
|
gint disp_width, disp_height;
|
2004-07-27 16:43:24 +00:00
|
|
|
gint video_par_n, video_par_d; /* video's PAR */
|
|
|
|
gint display_par_n, display_par_d; /* display's PAR */
|
|
|
|
const GValue *caps_par;
|
2008-11-13 18:18:32 +00:00
|
|
|
const GValue *caps_disp_reg;
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
const GValue *fps;
|
2006-05-12 22:22:37 +00:00
|
|
|
guint num, den;
|
2011-06-11 18:47:01 +00:00
|
|
|
gint size;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
sys/ximage/ximagesink.c: Protect interface methods from chain and negotiation and vice versa (Fixes #166142).
Original commit message from CVS:
2005-02-12 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_sink_link), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_property),
(gst_ximagesink_finalize), (gst_ximagesink_init): Protect interface
methods from chain and negotiation and vice versa (Fixes #166142).
* sys/ximage/ximagesink.h: Add stream_lock.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose): Check for xcontext before trying to link.
2005-02-12 18:41:49 +00:00
|
|
|
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
configure.ac: In the output at the end, don't show the first plugin on the same line as "Core plug-ins, always built:".
Original commit message from CVS:
* configure.ac:
In the output at the end, don't show the first plugin on the same
line as "Core plug-ins, always built:".
Indent the output as for other plugin categories
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create):
#define that can be used to not use peer buffer_alloc functions for
test purposes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximage_buffer_get_type), (gst_ximagesink_ximage_new),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_init),
(gst_xvimage_buffer_get_type), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame):
Error case handling fixes. gst-launch fakesrc ! x[v]imagesink now
fails gracefully instead of XError aborting or deadlocking.
2005-09-06 23:26:49 +00:00
|
|
|
"In setcaps. Possible caps %" GST_PTR_FORMAT ", setting caps %"
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_PTR_FORMAT, xvimagesink->xcontext->caps, caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2010-12-09 07:40:25 +00:00
|
|
|
if (!gst_caps_can_intersect (xvimagesink->xcontext->caps, caps))
|
2008-11-13 18:18:32 +00:00
|
|
|
goto incompatible_caps;
|
2005-10-24 17:04:01 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-07-27 16:43:24 +00:00
|
|
|
ret = gst_structure_get_int (structure, "width", &video_width);
|
|
|
|
ret &= gst_structure_get_int (structure, "height", &video_height);
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
fps = gst_structure_get_value (structure, "framerate");
|
|
|
|
ret &= (fps != NULL);
|
|
|
|
|
2008-11-13 18:18:32 +00:00
|
|
|
if (!ret)
|
|
|
|
goto incomplete_caps;
|
sys/xvimage/xvimagesink.c: Protect interface methods from chain and negotiation and vice versa (Fixes #166142).
Original commit message from CVS:
2005-02-11 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_sink_link), (gst_xvimagesink_change_state),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_finalize), (gst_xvimagesink_init): Protect interface
methods from chain and negotiation and vice versa (Fixes #166142).
Fix a possible bug of images in the buffer pool being discarded because
we are looking at the wrong geometry.
* sys/xvimage/xvimagesink.h: Add stream_lock.
2005-02-11 22:49:23 +00:00
|
|
|
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
xvimagesink->fps_n = gst_value_get_fraction_numerator (fps);
|
|
|
|
xvimagesink->fps_d = gst_value_get_fraction_denominator (fps);
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
xvimagesink->video_width = video_width;
|
|
|
|
xvimagesink->video_height = video_height;
|
2008-11-13 18:18:32 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
im_format = gst_xvimagesink_get_format_from_caps (xvimagesink, caps);
|
2008-11-13 18:18:32 +00:00
|
|
|
if (im_format == -1)
|
|
|
|
goto invalid_format;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-06-11 18:47:01 +00:00
|
|
|
if (!gst_video_get_size_from_caps (caps, &size))
|
|
|
|
goto invalid_format;
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* get aspect ratio from caps if it's present, and
|
|
|
|
* convert video width and height to a display width and height
|
2006-05-12 21:30:00 +00:00
|
|
|
* using wd / hd = wv / hv * PARv / PARd */
|
2004-07-27 16:43:24 +00:00
|
|
|
|
|
|
|
/* get video's PAR */
|
|
|
|
caps_par = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
|
|
|
if (caps_par) {
|
|
|
|
video_par_n = gst_value_get_fraction_numerator (caps_par);
|
|
|
|
video_par_d = gst_value_get_fraction_denominator (caps_par);
|
|
|
|
} else {
|
|
|
|
video_par_n = 1;
|
|
|
|
video_par_d = 1;
|
|
|
|
}
|
|
|
|
/* get display's PAR */
|
2004-08-02 10:04:08 +00:00
|
|
|
if (xvimagesink->par) {
|
|
|
|
display_par_n = gst_value_get_fraction_numerator (xvimagesink->par);
|
|
|
|
display_par_d = gst_value_get_fraction_denominator (xvimagesink->par);
|
|
|
|
} else {
|
|
|
|
display_par_n = 1;
|
|
|
|
display_par_d = 1;
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
|
2008-11-13 18:18:32 +00:00
|
|
|
/* get the display region */
|
|
|
|
caps_disp_reg = gst_structure_get_value (structure, "display-region");
|
|
|
|
if (caps_disp_reg) {
|
|
|
|
disp_x = g_value_get_int (gst_value_array_get_value (caps_disp_reg, 0));
|
|
|
|
disp_y = g_value_get_int (gst_value_array_get_value (caps_disp_reg, 1));
|
|
|
|
disp_width = g_value_get_int (gst_value_array_get_value (caps_disp_reg, 2));
|
|
|
|
disp_height =
|
|
|
|
g_value_get_int (gst_value_array_get_value (caps_disp_reg, 3));
|
|
|
|
} else {
|
|
|
|
disp_x = disp_y = 0;
|
|
|
|
disp_width = video_width;
|
|
|
|
disp_height = video_height;
|
2006-05-12 21:30:00 +00:00
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2008-11-13 18:18:32 +00:00
|
|
|
if (!gst_video_calculate_display_ratio (&num, &den, video_width,
|
|
|
|
video_height, video_par_n, video_par_d, display_par_n, display_par_d))
|
|
|
|
goto no_disp_ratio;
|
|
|
|
|
|
|
|
xvimagesink->disp_x = disp_x;
|
|
|
|
xvimagesink->disp_y = disp_y;
|
|
|
|
xvimagesink->disp_width = disp_width;
|
|
|
|
xvimagesink->disp_height = disp_height;
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"video width/height: %dx%d, calculated display ratio: %d/%d",
|
|
|
|
video_width, video_height, num, den);
|
|
|
|
|
|
|
|
/* now find a width x height that respects this display ratio.
|
|
|
|
* prefer those that have one of w/h the same as the incoming video
|
|
|
|
* using wd / hd = num / den */
|
|
|
|
|
|
|
|
/* start with same height, because of interlaced video */
|
|
|
|
/* check hd / den is an integer scale factor, and scale wd with the PAR */
|
|
|
|
if (video_height % den == 0) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video height");
|
2006-05-19 13:02:46 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = (guint)
|
|
|
|
gst_util_uint64_scale_int (video_height, num, den);
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height;
|
2004-07-27 16:43:24 +00:00
|
|
|
} else if (video_width % num == 0) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video width");
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = video_width;
|
2006-05-19 13:02:46 +00:00
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = (guint)
|
|
|
|
gst_util_uint64_scale_int (video_width, den, num);
|
2004-07-27 16:43:24 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "approximating while keeping video height");
|
2006-05-19 13:02:46 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = (guint)
|
|
|
|
gst_util_uint64_scale_int (video_height, num, den);
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height;
|
2004-07-27 16:43:24 +00:00
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "scaling to %dx%d",
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink), GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-22 11:13:49 +00:00
|
|
|
/* Notify application to set xwindow id now */
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
2005-11-22 11:13:49 +00:00
|
|
|
if (!xvimagesink->xwindow) {
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2005-11-22 11:13:49 +00:00
|
|
|
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (xvimagesink));
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
} else {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2005-11-22 11:13:49 +00:00
|
|
|
}
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* Creating our window and our image with the display size in pixels */
|
2006-05-12 21:30:00 +00:00
|
|
|
if (GST_VIDEO_SINK_WIDTH (xvimagesink) <= 0 ||
|
2008-11-13 18:18:32 +00:00
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) <= 0)
|
|
|
|
goto no_display_size;
|
2006-05-12 21:30:00 +00:00
|
|
|
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
if (!xvimagesink->xwindow) {
|
2004-10-08 11:26:49 +00:00
|
|
|
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
}
|
2007-07-13 16:05:17 +00:00
|
|
|
|
2011-04-05 08:32:52 +00:00
|
|
|
/* After a resize, we want to redraw the borders in case the new frame size
|
2007-07-13 16:05:17 +00:00
|
|
|
* doesn't cover the same area */
|
2008-09-04 13:46:52 +00:00
|
|
|
xvimagesink->redraw_border = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
/* create a new pool for the new configuration */
|
|
|
|
newpool = gst_xvimage_buffer_pool_new (xvimagesink);
|
2011-02-24 10:57:53 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
structure = gst_buffer_pool_get_config (newpool);
|
2011-06-11 18:47:01 +00:00
|
|
|
gst_buffer_pool_config_set (structure, caps, size, 0, 0, 0, 15);
|
2011-04-06 10:26:47 +00:00
|
|
|
if (!gst_buffer_pool_set_config (newpool, structure))
|
|
|
|
goto config_failed;
|
|
|
|
|
|
|
|
if (!gst_buffer_pool_set_active (newpool, TRUE))
|
|
|
|
goto activate_failed;
|
|
|
|
|
|
|
|
oldpool = xvimagesink->pool;
|
|
|
|
xvimagesink->pool = newpool;
|
2011-05-19 13:55:53 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
/* unref the old sink */
|
|
|
|
if (oldpool) {
|
|
|
|
/* deactivate */
|
|
|
|
gst_buffer_pool_set_active (oldpool, FALSE);
|
|
|
|
gst_object_unref (oldpool);
|
|
|
|
}
|
2007-07-13 16:05:17 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return TRUE;
|
2008-11-13 18:18:32 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
incompatible_caps:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (xvimagesink, "caps incompatible");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
incomplete_caps:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "Failed to retrieve either width, "
|
|
|
|
"height or framerate from intersected caps");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_format:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"Could not locate image format from caps %" GST_PTR_FORMAT, caps);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_disp_ratio:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL),
|
|
|
|
("Error calculating the output display ratio of the video."));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
no_display_size:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL),
|
|
|
|
("Error calculating the output display ratio of the video."));
|
|
|
|
return FALSE;
|
|
|
|
}
|
2011-04-06 10:26:47 +00:00
|
|
|
config_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (xvimagesink, "failed to set config.");
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
activate_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (xvimagesink, "failed to activate bufferpool.");
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2011-05-24 07:45:18 +00:00
|
|
|
gst_object_unref (newpool);
|
2011-04-06 10:26:47 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2005-11-15 19:01:43 +00:00
|
|
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
2003-11-10 18:22:20 +00:00
|
|
|
GstXvImageSink *xvimagesink;
|
2006-07-13 16:34:04 +00:00
|
|
|
GstXContext *xcontext = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (element);
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Initializing the XContext */
|
2006-07-13 16:34:04 +00:00
|
|
|
if (xvimagesink->xcontext == NULL) {
|
|
|
|
xcontext = gst_xvimagesink_xcontext_get (xvimagesink);
|
2011-04-06 14:26:12 +00:00
|
|
|
if (xcontext == NULL) {
|
|
|
|
ret = GST_STATE_CHANGE_FAILURE;
|
|
|
|
goto beach;
|
|
|
|
}
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
|
|
|
if (xcontext)
|
|
|
|
xvimagesink->xcontext = xcontext;
|
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
2006-07-13 14:38:15 +00:00
|
|
|
}
|
2006-07-13 16:34:04 +00:00
|
|
|
|
2004-08-02 10:04:08 +00:00
|
|
|
/* update object's par with calculated one if not set yet */
|
|
|
|
if (!xvimagesink->par) {
|
|
|
|
xvimagesink->par = g_new0 (GValue, 1);
|
|
|
|
gst_value_init_and_copy (xvimagesink->par, xvimagesink->xcontext->par);
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "set calculated PAR on object's PAR");
|
|
|
|
}
|
2004-07-19 11:33:32 +00:00
|
|
|
/* call XSynchronize with the current value of synchronous */
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "XSynchronize called with %s",
|
|
|
|
xvimagesink->synchronous ? "TRUE" : "FALSE");
|
|
|
|
XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous);
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
2009-09-15 12:26:06 +00:00
|
|
|
gst_xvimagesink_manage_event_thread (xvimagesink);
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2009-02-25 12:16:32 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
|
|
|
break;
|
2005-11-15 19:01:43 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
xvimagesink->fps_n = 0;
|
|
|
|
xvimagesink->fps_d = 1;
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = 0;
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = 0;
|
2011-04-06 10:26:47 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
2011-04-06 14:26:12 +00:00
|
|
|
if (xvimagesink->pool)
|
|
|
|
gst_buffer_pool_set_active (xvimagesink->pool, FALSE);
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2007-03-08 15:22:53 +00:00
|
|
|
gst_xvimagesink_reset (xvimagesink);
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-11-15 19:01:43 +00:00
|
|
|
default:
|
|
|
|
break;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2011-04-06 14:26:12 +00:00
|
|
|
beach:
|
2005-11-15 19:01:43 +00:00
|
|
|
return ret;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
|
|
|
GstClockTime * start, GstClockTime * end)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-14 11:42:16 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2003-12-14 05:10:28 +00:00
|
|
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
2005-03-31 09:43:49 +00:00
|
|
|
*start = GST_BUFFER_TIMESTAMP (buf);
|
|
|
|
if (GST_BUFFER_DURATION_IS_VALID (buf)) {
|
|
|
|
*end = *start + GST_BUFFER_DURATION (buf);
|
|
|
|
} else {
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
if (xvimagesink->fps_n > 0) {
|
2006-09-18 14:42:03 +00:00
|
|
|
*end = *start +
|
|
|
|
gst_util_uint64_scale_int (GST_SECOND, xvimagesink->fps_d,
|
|
|
|
xvimagesink->fps_n);
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
}
|
2003-12-14 05:10:28 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2004-02-01 22:33:07 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstFlowReturn
|
2009-09-08 16:43:26 +00:00
|
|
|
gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
2005-03-31 09:43:49 +00:00
|
|
|
{
|
2011-04-06 10:26:47 +00:00
|
|
|
GstFlowReturn res;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstXvImageSink *xvimagesink;
|
2011-02-25 15:01:47 +00:00
|
|
|
GstMetaXvImage *meta;
|
2011-04-06 17:21:02 +00:00
|
|
|
GstBuffer *to_put;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2009-09-08 16:43:26 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (vsink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
meta = gst_buffer_get_meta_xvimage (buf);
|
2011-02-25 15:01:47 +00:00
|
|
|
|
|
|
|
if (meta) {
|
|
|
|
/* If this buffer has been allocated using our buffer management we simply
|
|
|
|
put the ximage which is in the PRIVATE pointer */
|
2011-04-06 17:21:02 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink, "buffer %p from our pool, writing directly",
|
|
|
|
buf);
|
2011-04-06 10:26:47 +00:00
|
|
|
res = GST_FLOW_OK;
|
2011-04-06 17:21:02 +00:00
|
|
|
to_put = buf;
|
2011-02-25 15:01:47 +00:00
|
|
|
} else {
|
2011-03-27 15:16:10 +00:00
|
|
|
guint8 *data;
|
|
|
|
gsize size;
|
|
|
|
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
/* Else we have to copy the data into our private image, */
|
2004-03-14 22:34:34 +00:00
|
|
|
/* if we have one... */
|
2011-04-06 17:21:02 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink, "buffer %p not from our pool, copying", buf);
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
/* we should have a pool, configured in setcaps */
|
|
|
|
if (xvimagesink->pool == NULL)
|
|
|
|
goto no_pool;
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
/* take a buffer form our pool */
|
2011-04-06 17:21:02 +00:00
|
|
|
res = gst_buffer_pool_acquire_buffer (xvimagesink->pool, &to_put, NULL);
|
2011-04-06 10:26:47 +00:00
|
|
|
if (res != GST_FLOW_OK)
|
|
|
|
goto no_buffer;
|
sys/xvimage/xvimagesink.c: Improve the errors produced on bad output, including some human readable description strings.
Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_get_format_from_caps), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Improve the errors produced on bad output, including some human
readable description strings.
Handle RGB Xv formats properly by transforming them into our
big-endian caps description.
Use gst_caps_truncate to ensure that we never try and choose a
non-fixed caps in buffer_alloc.
Handle the case where the XServer has a different idea about the size
required for a particular frame and gives us too small a memory
allocation.
Use -1 to indicate 'no image format', because 0 is a valid XServer
image format number.
Put RGB Xv formats at the end of the caps, so that we always prefer
YUV format frames.
Iterate the available Xv Encodings to determine the maximum width and
height, and then return that in our caps.
2006-05-26 09:40:35 +00:00
|
|
|
|
2011-04-06 17:21:02 +00:00
|
|
|
if (gst_buffer_get_size (to_put) < gst_buffer_get_size (buf))
|
2011-04-06 10:26:47 +00:00
|
|
|
goto wrong_size;
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
|
2011-04-06 17:21:02 +00:00
|
|
|
GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, xvimagesink,
|
|
|
|
"slow copy into bufferpool buffer %p", to_put);
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
|
2011-04-06 17:21:02 +00:00
|
|
|
data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ);
|
|
|
|
gst_buffer_fill (to_put, 0, data, size);
|
|
|
|
gst_buffer_unmap (buf, data, size);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2006-09-20 10:59:06 +00:00
|
|
|
|
2011-04-06 17:21:02 +00:00
|
|
|
if (!gst_xvimagesink_xvimage_put (xvimagesink, to_put))
|
2011-04-06 10:26:47 +00:00
|
|
|
goto no_window;
|
|
|
|
|
2011-04-06 14:26:12 +00:00
|
|
|
done:
|
2011-04-06 17:21:02 +00:00
|
|
|
if (to_put != buf)
|
|
|
|
gst_buffer_unref (to_put);
|
2011-04-06 14:26:12 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
return res;
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
2011-04-06 10:26:47 +00:00
|
|
|
no_pool:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE,
|
|
|
|
("Internal error: can't allocate images"),
|
|
|
|
("We don't have a bufferpool negotiated"));
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
no_buffer:
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
{
|
|
|
|
/* No image available. That's very bad ! */
|
2006-01-15 10:06:40 +00:00
|
|
|
GST_WARNING_OBJECT (xvimagesink, "could not create image");
|
2011-04-06 10:26:47 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
wrong_size:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE,
|
|
|
|
("Failed to create output image buffer"),
|
2011-04-06 14:26:12 +00:00
|
|
|
("XServer allocated buffer size did not match input buffer %"
|
2011-04-06 17:21:02 +00:00
|
|
|
G_GSIZE_FORMAT " - %" G_GSIZE_FORMAT, gst_buffer_get_size (to_put),
|
2011-04-06 14:26:12 +00:00
|
|
|
gst_buffer_get_size (buf)));
|
|
|
|
res = GST_FLOW_ERROR;
|
|
|
|
goto done;
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
}
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
no_window:
|
|
|
|
{
|
|
|
|
/* No Window available to put our image into */
|
|
|
|
GST_WARNING_OBJECT (xvimagesink, "could not output image - no window");
|
2011-04-06 14:26:12 +00:00
|
|
|
res = GST_FLOW_ERROR;
|
|
|
|
goto done;
|
sys/: When we create our own window, indicate that we handle the
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_handle_xevents),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_show_frame):
When we create our own window, indicate that we handle the
WM_DELETE client message from the window manager, so that it won't
kill our window (and our app) along with it. Handle ClientMessage,
post an error on the bus, and close the window. Further buffers
arriving will result in a FlowError because the window has been
destroyed.
Fixes: #393975
Clean up the X event handling loop and make them the same for
both xvimagesink and ximagesink while I'm at it.
2007-05-17 17:35:46 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
2009-06-22 08:40:33 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (sink);
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_TAG:{
|
|
|
|
GstTagList *l;
|
|
|
|
gchar *title = NULL;
|
|
|
|
|
|
|
|
gst_event_parse_tag (event, &l);
|
|
|
|
gst_tag_list_get_string (l, GST_TAG_TITLE, &title);
|
|
|
|
|
|
|
|
if (title) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "got tags, title='%s'", title);
|
2009-06-22 13:17:10 +00:00
|
|
|
gst_xvimagesink_xwindow_set_title (xvimagesink, xvimagesink->xwindow,
|
|
|
|
title);
|
2009-06-22 08:40:33 +00:00
|
|
|
|
|
|
|
g_free (title);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (GST_BASE_SINK_CLASS (parent_class)->event)
|
|
|
|
return GST_BASE_SINK_CLASS (parent_class)->event (sink, event);
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-04-29 10:09:38 +00:00
|
|
|
static gboolean
|
2011-05-17 09:25:31 +00:00
|
|
|
gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery * query)
|
2011-04-29 10:09:38 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (GST_PAD_PARENT (sinkpad));
|
|
|
|
gboolean res = TRUE;
|
|
|
|
|
2011-05-17 09:25:31 +00:00
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
2011-04-29 10:09:38 +00:00
|
|
|
case GST_QUERY_ALLOCATION:
|
|
|
|
{
|
2011-05-19 13:55:53 +00:00
|
|
|
GstBufferPool *pool;
|
|
|
|
GstStructure *config;
|
2011-04-29 10:09:38 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
guint size;
|
2011-05-19 13:55:53 +00:00
|
|
|
gboolean need_pool;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-05-17 09:25:31 +00:00
|
|
|
gst_query_parse_allocation (query, &caps, &need_pool);
|
2011-04-29 10:09:38 +00:00
|
|
|
|
|
|
|
if (caps == NULL)
|
|
|
|
goto no_caps;
|
|
|
|
|
2011-05-19 13:55:53 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
if ((pool = xvimagesink->pool))
|
|
|
|
gst_object_ref (pool);
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-05-19 13:55:53 +00:00
|
|
|
if (pool != NULL) {
|
|
|
|
const GstCaps *pcaps;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-05-19 13:55:53 +00:00
|
|
|
/* we had a pool, check caps */
|
2011-06-11 18:47:01 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "check existing pool caps");
|
2011-05-19 13:55:53 +00:00
|
|
|
config = gst_buffer_pool_get_config (pool);
|
|
|
|
gst_buffer_pool_config_get (config, &pcaps, &size, NULL, NULL, NULL,
|
2011-06-11 16:54:44 +00:00
|
|
|
NULL);
|
2011-05-19 13:55:53 +00:00
|
|
|
|
|
|
|
if (!gst_caps_is_equal (caps, pcaps)) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "pool has different caps");
|
|
|
|
/* different caps, we can't use this pool */
|
|
|
|
gst_object_unref (pool);
|
|
|
|
pool = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pool == NULL && need_pool) {
|
|
|
|
GstVideoFormat format;
|
|
|
|
gint width, height;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-05-19 13:55:53 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "create new pool");
|
2011-04-29 10:09:38 +00:00
|
|
|
pool = gst_xvimage_buffer_pool_new (xvimagesink);
|
|
|
|
|
2011-05-19 13:55:53 +00:00
|
|
|
if (!gst_video_format_parse_caps (caps, &format, &width, &height))
|
|
|
|
goto invalid_caps;
|
|
|
|
|
|
|
|
/* the normal size of a frame */
|
|
|
|
size = gst_video_format_get_size (format, width, height);
|
|
|
|
|
2011-04-29 10:09:38 +00:00
|
|
|
config = gst_buffer_pool_get_config (pool);
|
2011-06-11 18:47:01 +00:00
|
|
|
gst_buffer_pool_config_set (config, caps, size, 0, 0, 0, 15);
|
2011-04-29 10:09:38 +00:00
|
|
|
if (!gst_buffer_pool_set_config (pool, config))
|
|
|
|
goto config_failed;
|
|
|
|
}
|
2011-06-11 18:47:01 +00:00
|
|
|
gst_query_set_allocation_params (query, size, 0, 0, 0, 15, pool);
|
2011-04-29 10:09:38 +00:00
|
|
|
|
|
|
|
/* we also support various metadata */
|
2011-05-17 09:25:31 +00:00
|
|
|
gst_query_add_allocation_meta (query, GST_META_API_VIDEO);
|
2011-05-19 13:55:53 +00:00
|
|
|
|
|
|
|
gst_object_unref (pool);
|
2011-04-29 10:09:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
res = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_caps:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (sinkpad, "no caps specified");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_caps:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (sinkpad, "invalid caps specified");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
config_failed:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (sinkpad, "failed setting config");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* Interfaces stuff */
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_interface_supported (GstImplementsInterface * iface, GType type)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2011-05-25 11:08:43 +00:00
|
|
|
if (type == GST_TYPE_NAVIGATION || type == GST_TYPE_X_OVERLAY ||
|
|
|
|
type == GST_TYPE_COLOR_BALANCE || type == GST_TYPE_PROPERTY_PROBE)
|
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_interface_init (GstImplementsInterfaceClass * klass)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
klass->supported = gst_xvimagesink_interface_supported;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
|
|
|
|
GstStructure * structure)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (navigation);
|
2005-11-11 17:41:04 +00:00
|
|
|
GstPad *peer;
|
2005-01-09 00:07:30 +00:00
|
|
|
|
2005-11-11 17:41:04 +00:00
|
|
|
if ((peer = gst_pad_get_peer (GST_VIDEO_SINK_PAD (xvimagesink)))) {
|
|
|
|
GstEvent *event;
|
2005-11-22 10:09:54 +00:00
|
|
|
GstVideoRectangle src, dst, result;
|
2005-11-11 17:41:04 +00:00
|
|
|
gdouble x, y, xscale = 1.0, yscale = 1.0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-22 10:09:54 +00:00
|
|
|
event = gst_event_new_navigation (structure);
|
2005-11-11 17:41:04 +00:00
|
|
|
|
2005-11-22 10:09:54 +00:00
|
|
|
/* We take the flow_lock while we look at the window */
|
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
if (!xvimagesink->xwindow) {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimagesink->keep_aspect) {
|
2010-02-19 12:46:43 +00:00
|
|
|
/* We get the frame position using the calculated geometry from _setcaps
|
|
|
|
that respect pixel aspect ratios */
|
|
|
|
src.w = GST_VIDEO_SINK_WIDTH (xvimagesink);
|
|
|
|
src.h = GST_VIDEO_SINK_HEIGHT (xvimagesink);
|
|
|
|
dst.w = xvimagesink->render_rect.w;
|
|
|
|
dst.h = xvimagesink->render_rect.h;
|
|
|
|
|
2005-11-22 10:09:54 +00:00
|
|
|
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
2010-02-19 12:46:43 +00:00
|
|
|
result.x += xvimagesink->render_rect.x;
|
|
|
|
result.y += xvimagesink->render_rect.y;
|
2005-11-22 10:09:54 +00:00
|
|
|
} else {
|
2010-02-19 12:46:43 +00:00
|
|
|
memcpy (&result, &xvimagesink->render_rect, sizeof (GstVideoRectangle));
|
2005-11-11 17:41:04 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2010-02-19 12:46:43 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
|
2005-11-28 14:32:48 +00:00
|
|
|
/* We calculate scaling using the original video frames geometry to include
|
|
|
|
pixel aspect ratio scaling. */
|
|
|
|
xscale = (gdouble) xvimagesink->video_width / result.w;
|
|
|
|
yscale = (gdouble) xvimagesink->video_height / result.h;
|
2005-11-22 10:09:54 +00:00
|
|
|
|
2005-11-11 17:41:04 +00:00
|
|
|
/* Converting pointer coordinates to the non scaled geometry */
|
|
|
|
if (gst_structure_get_double (structure, "pointer_x", &x)) {
|
2005-11-22 10:09:54 +00:00
|
|
|
x = MIN (x, result.x + result.w);
|
|
|
|
x = MAX (x - result.x, 0);
|
2005-11-11 17:41:04 +00:00
|
|
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
|
|
|
|
(gdouble) x * xscale, NULL);
|
|
|
|
}
|
|
|
|
if (gst_structure_get_double (structure, "pointer_y", &y)) {
|
2005-11-22 10:09:54 +00:00
|
|
|
y = MIN (y, result.y + result.h);
|
|
|
|
y = MAX (y - result.y, 0);
|
2005-11-11 17:41:04 +00:00
|
|
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
|
|
|
|
(gdouble) y * yscale, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_pad_send_event (peer, event);
|
|
|
|
gst_object_unref (peer);
|
|
|
|
}
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_navigation_init (GstNavigationInterface * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
iface->send_event = gst_xvimagesink_navigation_send_event;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-09-05 22:17:47 +00:00
|
|
|
gst_xvimagesink_set_window_handle (GstXOverlay * overlay, guintptr id)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2010-09-05 22:17:47 +00:00
|
|
|
XID xwindow_id = id;
|
2003-11-17 16:32:29 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
GstXWindow *xwindow = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If we already use that window return */
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
if (xvimagesink->xwindow && (xwindow_id == xvimagesink->xwindow->win)) {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
return;
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If the element has not initialized the X11 context try to do so */
|
2004-04-17 02:30:28 +00:00
|
|
|
if (!xvimagesink->xcontext &&
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
!(xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink))) {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2004-04-17 02:30:28 +00:00
|
|
|
/* we have thrown a GST_ELEMENT_ERROR now */
|
2004-03-14 22:34:34 +00:00
|
|
|
return;
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
}
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If a window is there already we destroy it */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xwindow) {
|
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If the xid is 0 we go back to an internal window */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xwindow_id == 0) {
|
|
|
|
/* If no width/height caps nego did not happen window will be created
|
|
|
|
during caps nego then */
|
2005-07-10 12:03:58 +00:00
|
|
|
if (GST_VIDEO_SINK_WIDTH (xvimagesink)
|
|
|
|
&& GST_VIDEO_SINK_HEIGHT (xvimagesink)) {
|
|
|
|
xwindow =
|
|
|
|
gst_xvimagesink_xwindow_new (xvimagesink,
|
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
} else {
|
2010-04-13 13:20:10 +00:00
|
|
|
XWindowAttributes attr;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
|
|
|
xwindow->win = xwindow_id;
|
|
|
|
|
2010-02-19 12:46:43 +00:00
|
|
|
/* Set the event we want to receive and create a GC */
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2010-04-13 13:20:10 +00:00
|
|
|
|
|
|
|
XGetWindowAttributes (xvimagesink->xcontext->disp, xwindow->win, &attr);
|
|
|
|
|
|
|
|
xwindow->width = attr.width;
|
|
|
|
xwindow->height = attr.height;
|
2004-03-14 22:34:34 +00:00
|
|
|
xwindow->internal = FALSE;
|
2010-04-13 13:20:10 +00:00
|
|
|
if (!xvimagesink->have_render_rect) {
|
|
|
|
xvimagesink->render_rect.x = xvimagesink->render_rect.y = 0;
|
|
|
|
xvimagesink->render_rect.w = attr.width;
|
|
|
|
xvimagesink->render_rect.h = attr.height;
|
|
|
|
}
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
if (xvimagesink->handle_events) {
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
|
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xwindow->win, 0, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
|
|
|
|
if (xwindow)
|
|
|
|
xvimagesink->xwindow = xwindow;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_expose (GstXOverlay * overlay)
|
2004-02-03 23:05:46 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
2004-02-16 23:45:55 +00:00
|
|
|
|
2011-04-06 15:54:28 +00:00
|
|
|
GST_DEBUG ("doing expose");
|
2010-02-19 12:46:43 +00:00
|
|
|
gst_xvimagesink_xwindow_update_geometry (xvimagesink);
|
2005-11-27 18:12:23 +00:00
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, NULL);
|
2004-02-03 23:05:46 +00:00
|
|
|
}
|
|
|
|
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
static void
|
|
|
|
gst_xvimagesink_set_event_handling (GstXOverlay * overlay,
|
|
|
|
gboolean handle_events)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
|
|
|
|
xvimagesink->handle_events = handle_events;
|
|
|
|
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!xvimagesink->xwindow)) {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
return;
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
}
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
if (handle_events) {
|
|
|
|
if (xvimagesink->xwindow->internal) {
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win,
|
|
|
|
ExposureMask | StructureNotifyMask | PointerMotionMask |
|
|
|
|
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
|
|
|
|
} else {
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win,
|
|
|
|
ExposureMask | StructureNotifyMask | PointerMotionMask |
|
|
|
|
KeyPressMask | KeyReleaseMask);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xvimagesink->xwindow->win, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/: Use flow_lock much more to protect every access to xwindow.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
(gst_ximagesink_handle_xerror), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_handle_xevents), (gst_ximagesink_setcaps),
(gst_ximagesink_change_state), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_event_handling):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_handle_xerror),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_event_handling):
Use flow_lock much more to protect every access to xwindow.
Try to catch erros while creating images in case some drivers
are
just generating an XError when the requested image is too big.
Should fix : #354698, #384008, #384060.
* tests/icles/stress-xoverlay.c: (cycle_window),
(create_window):
Implement some stress testing of setting window xid.
2007-01-07 18:50:13 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
}
|
|
|
|
|
2010-02-19 12:46:43 +00:00
|
|
|
static void
|
2010-03-24 09:59:42 +00:00
|
|
|
gst_xvimagesink_set_render_rectangle (GstXOverlay * overlay, gint x, gint y,
|
|
|
|
gint width, gint height)
|
2010-02-19 12:46:43 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
|
2010-03-24 09:59:42 +00:00
|
|
|
/* FIXME: how about some locking? */
|
2010-06-17 11:32:22 +00:00
|
|
|
if (width >= 0 && height >= 0) {
|
2010-03-24 09:59:42 +00:00
|
|
|
xvimagesink->render_rect.x = x;
|
|
|
|
xvimagesink->render_rect.y = y;
|
|
|
|
xvimagesink->render_rect.w = width;
|
|
|
|
xvimagesink->render_rect.h = height;
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->have_render_rect = TRUE;
|
|
|
|
} else {
|
2010-03-24 09:59:42 +00:00
|
|
|
xvimagesink->render_rect.x = 0;
|
|
|
|
xvimagesink->render_rect.y = 0;
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.w = xvimagesink->xwindow->width;
|
|
|
|
xvimagesink->render_rect.h = xvimagesink->xwindow->height;
|
|
|
|
xvimagesink->have_render_rect = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xoverlay_init (GstXOverlayClass * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2010-09-05 22:17:47 +00:00
|
|
|
iface->set_window_handle = gst_xvimagesink_set_window_handle;
|
2004-02-03 23:05:46 +00:00
|
|
|
iface->expose = gst_xvimagesink_expose;
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
iface->handle_events = gst_xvimagesink_set_event_handling;
|
2010-02-19 12:46:43 +00:00
|
|
|
iface->set_render_rectangle = gst_xvimagesink_set_render_rectangle;
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
static const GList *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_list_channels (GstColorBalance * balance)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
if (xvimagesink->xcontext)
|
|
|
|
return xvimagesink->xcontext->channels_list;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_set_value (GstColorBalance * balance,
|
|
|
|
GstColorBalanceChannel * channel, gint value)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
g_return_if_fail (channel->label != NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
xvimagesink->cb_changed = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
/* Normalize val to [-1000, 1000] */
|
2008-07-29 01:58:05 +00:00
|
|
|
value = floor (0.5 + -1000 + 2000 * (value - channel->min_value) /
|
|
|
|
(double) (channel->max_value - channel->min_value));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
|
|
|
xvimagesink->hue = value;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
|
|
|
xvimagesink->saturation = value;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
|
|
|
xvimagesink->contrast = value;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
|
|
|
xvimagesink->brightness = value;
|
|
|
|
} else {
|
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_get_value (GstColorBalance * balance,
|
|
|
|
GstColorBalanceChannel * channel)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
gint value = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), 0);
|
|
|
|
g_return_val_if_fail (channel->label != NULL, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
|
|
|
value = xvimagesink->hue;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
|
|
|
value = xvimagesink->saturation;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
|
|
|
value = xvimagesink->contrast;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
|
|
|
value = xvimagesink->brightness;
|
|
|
|
} else {
|
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
}
|
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
/* Normalize val to [channel->min_value, channel->max_value] */
|
|
|
|
value = channel->min_value + (channel->max_value - channel->min_value) *
|
2004-03-14 22:34:34 +00:00
|
|
|
(value + 1000) / 2000;
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_init (GstColorBalanceClass * iface)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
2004-01-14 17:15:34 +00:00
|
|
|
GST_COLOR_BALANCE_TYPE (iface) = GST_COLOR_BALANCE_HARDWARE;
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
iface->list_channels = gst_xvimagesink_colorbalance_list_channels;
|
|
|
|
iface->set_value = gst_xvimagesink_colorbalance_set_value;
|
|
|
|
iface->get_value = gst_xvimagesink_colorbalance_get_value;
|
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
static const GList *
|
|
|
|
gst_xvimagesink_probe_get_properties (GstPropertyProbe * probe)
|
|
|
|
{
|
|
|
|
GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
|
|
|
|
static GList *list = NULL;
|
|
|
|
|
|
|
|
if (!list) {
|
|
|
|
list = g_list_append (NULL, g_object_class_find_property (klass, "device"));
|
2008-10-22 12:25:02 +00:00
|
|
|
list =
|
|
|
|
g_list_append (list, g_object_class_find_property (klass,
|
|
|
|
"autopaint-colorkey"));
|
|
|
|
list =
|
|
|
|
g_list_append (list, g_object_class_find_property (klass,
|
|
|
|
"double-buffer"));
|
|
|
|
list =
|
|
|
|
g_list_append (list, g_object_class_find_property (klass, "colorkey"));
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_probe_probe_property (GstPropertyProbe * probe,
|
|
|
|
guint prop_id, const GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE:
|
|
|
|
case PROP_AUTOPAINT_COLORKEY:
|
|
|
|
case PROP_DOUBLE_BUFFER:
|
|
|
|
case PROP_COLORKEY:
|
2008-10-22 12:25:02 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"probing device list and get capabilities");
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
if (!xvimagesink->xcontext) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "generating xcontext");
|
|
|
|
xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_probe_needs_probe (GstPropertyProbe * probe,
|
|
|
|
guint prop_id, const GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
|
|
|
|
gboolean ret = FALSE;
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE:
|
|
|
|
case PROP_AUTOPAINT_COLORKEY:
|
|
|
|
case PROP_DOUBLE_BUFFER:
|
|
|
|
case PROP_COLORKEY:
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
if (xvimagesink->xcontext != NULL) {
|
|
|
|
ret = FALSE;
|
|
|
|
} else {
|
|
|
|
ret = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GValueArray *
|
|
|
|
gst_xvimagesink_probe_get_values (GstPropertyProbe * probe,
|
|
|
|
guint prop_id, const GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (probe);
|
|
|
|
GValueArray *array = NULL;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!xvimagesink->xcontext)) {
|
|
|
|
GST_WARNING_OBJECT (xvimagesink, "we don't have any xcontext, can't "
|
|
|
|
"get values");
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE:
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
GValue value = { 0 };
|
|
|
|
|
|
|
|
array = g_value_array_new (xvimagesink->xcontext->nb_adaptors);
|
|
|
|
g_value_init (&value, G_TYPE_STRING);
|
|
|
|
|
|
|
|
for (i = 0; i < xvimagesink->xcontext->nb_adaptors; i++) {
|
|
|
|
gchar *adaptor_id_s = g_strdup_printf ("%u", i);
|
|
|
|
|
|
|
|
g_value_set_string (&value, adaptor_id_s);
|
|
|
|
g_value_array_append (array, &value);
|
|
|
|
g_free (adaptor_id_s);
|
|
|
|
}
|
|
|
|
g_value_unset (&value);
|
|
|
|
break;
|
|
|
|
}
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_AUTOPAINT_COLORKEY:
|
2008-10-22 12:25:02 +00:00
|
|
|
if (xvimagesink->have_autopaint_colorkey) {
|
|
|
|
GValue value = { 0 };
|
|
|
|
|
|
|
|
array = g_value_array_new (2);
|
|
|
|
g_value_init (&value, G_TYPE_BOOLEAN);
|
|
|
|
g_value_set_boolean (&value, FALSE);
|
|
|
|
g_value_array_append (array, &value);
|
|
|
|
g_value_set_boolean (&value, TRUE);
|
|
|
|
g_value_array_append (array, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DOUBLE_BUFFER:
|
2008-10-22 12:25:02 +00:00
|
|
|
if (xvimagesink->have_double_buffer) {
|
|
|
|
GValue value = { 0 };
|
|
|
|
|
|
|
|
array = g_value_array_new (2);
|
|
|
|
g_value_init (&value, G_TYPE_BOOLEAN);
|
|
|
|
g_value_set_boolean (&value, FALSE);
|
|
|
|
g_value_array_append (array, &value);
|
|
|
|
g_value_set_boolean (&value, TRUE);
|
|
|
|
g_value_array_append (array, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_COLORKEY:
|
2008-10-22 12:25:02 +00:00
|
|
|
if (xvimagesink->have_colorkey) {
|
|
|
|
GValue value = { 0 };
|
|
|
|
|
|
|
|
array = g_value_array_new (1);
|
|
|
|
g_value_init (&value, GST_TYPE_INT_RANGE);
|
|
|
|
gst_value_set_int_range (&value, 0, 0xffffff);
|
|
|
|
g_value_array_append (array, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
break;
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
beach:
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_property_probe_interface_init (GstPropertyProbeInterface *
|
|
|
|
iface)
|
|
|
|
{
|
|
|
|
iface->get_properties = gst_xvimagesink_probe_get_properties;
|
|
|
|
iface->probe_property = gst_xvimagesink_probe_probe_property;
|
|
|
|
iface->needs_probe = gst_xvimagesink_probe_needs_probe;
|
|
|
|
iface->get_values = gst_xvimagesink_probe_get_values;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* =========================================== */
|
|
|
|
/* */
|
|
|
|
/* Init & Class init */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HUE:
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->hue = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_CONTRAST:
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->contrast = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_BRIGHTNESS:
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->brightness = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_SATURATION:
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->saturation = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DISPLAY:
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->display_name = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_SYNCHRONOUS:
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->synchronous = g_value_get_boolean (value);
|
|
|
|
if (xvimagesink->xcontext) {
|
2004-03-15 19:32:28 +00:00
|
|
|
XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous);
|
2004-07-19 11:33:32 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "XSynchronize called with %s",
|
|
|
|
xvimagesink->synchronous ? "TRUE" : "FALSE");
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_PIXEL_ASPECT_RATIO:
|
2004-08-02 10:04:08 +00:00
|
|
|
g_free (xvimagesink->par);
|
|
|
|
xvimagesink->par = g_new0 (GValue, 1);
|
|
|
|
g_value_init (xvimagesink->par, GST_TYPE_FRACTION);
|
|
|
|
if (!g_value_transform (value, xvimagesink->par)) {
|
2004-07-27 16:43:24 +00:00
|
|
|
g_warning ("Could not transform string to aspect ratio");
|
2004-08-02 10:04:08 +00:00
|
|
|
gst_value_set_fraction (xvimagesink->par, 1, 1);
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "set PAR to %d/%d",
|
2004-08-02 10:04:08 +00:00
|
|
|
gst_value_get_fraction_numerator (xvimagesink->par),
|
|
|
|
gst_value_get_fraction_denominator (xvimagesink->par));
|
2004-07-27 16:43:24 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_FORCE_ASPECT_RATIO:
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
xvimagesink->keep_aspect = g_value_get_boolean (value);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HANDLE_EVENTS:
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
gst_xvimagesink_set_event_handling (GST_X_OVERLAY (xvimagesink),
|
|
|
|
g_value_get_boolean (value));
|
2009-09-15 12:26:06 +00:00
|
|
|
gst_xvimagesink_manage_event_thread (xvimagesink);
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE:
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
xvimagesink->adaptor_no = atoi (g_value_get_string (value));
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HANDLE_EXPOSE:
|
2007-07-14 18:20:41 +00:00
|
|
|
xvimagesink->handle_expose = g_value_get_boolean (value);
|
2009-09-15 12:26:06 +00:00
|
|
|
gst_xvimagesink_manage_event_thread (xvimagesink);
|
2007-07-14 18:20:41 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DOUBLE_BUFFER:
|
2007-07-14 18:33:15 +00:00
|
|
|
xvimagesink->double_buffer = g_value_get_boolean (value);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_AUTOPAINT_COLORKEY:
|
2008-07-29 08:59:32 +00:00
|
|
|
xvimagesink->autopaint_colorkey = g_value_get_boolean (value);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_COLORKEY:
|
2008-10-22 12:25:02 +00:00
|
|
|
xvimagesink->colorkey = g_value_get_int (value);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DRAW_BORDERS:
|
2008-09-04 13:46:52 +00:00
|
|
|
xvimagesink->draw_borders = g_value_get_boolean (value);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HUE:
|
2004-03-14 22:34:34 +00:00
|
|
|
g_value_set_int (value, xvimagesink->hue);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_CONTRAST:
|
2004-03-14 22:34:34 +00:00
|
|
|
g_value_set_int (value, xvimagesink->contrast);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_BRIGHTNESS:
|
2004-03-14 22:34:34 +00:00
|
|
|
g_value_set_int (value, xvimagesink->brightness);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_SATURATION:
|
2004-03-14 22:34:34 +00:00
|
|
|
g_value_set_int (value, xvimagesink->saturation);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DISPLAY:
|
2006-08-15 19:20:16 +00:00
|
|
|
g_value_set_string (value, xvimagesink->display_name);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_SYNCHRONOUS:
|
2004-03-14 22:34:34 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->synchronous);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_PIXEL_ASPECT_RATIO:
|
2004-08-02 10:04:08 +00:00
|
|
|
if (xvimagesink->par)
|
|
|
|
g_value_transform (xvimagesink->par, value);
|
2004-07-27 16:43:24 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_FORCE_ASPECT_RATIO:
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->keep_aspect);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HANDLE_EVENTS:
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->handle_events);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE:
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
{
|
|
|
|
char *adaptor_no_s = g_strdup_printf ("%u", xvimagesink->adaptor_no);
|
|
|
|
|
|
|
|
g_value_set_string (value, adaptor_no_s);
|
|
|
|
g_free (adaptor_no_s);
|
|
|
|
break;
|
|
|
|
}
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE_NAME:
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
if (xvimagesink->xcontext && xvimagesink->xcontext->adaptors) {
|
|
|
|
g_value_set_string (value,
|
|
|
|
xvimagesink->xcontext->adaptors[xvimagesink->adaptor_no]);
|
|
|
|
} else {
|
|
|
|
g_value_set_string (value, NULL);
|
|
|
|
}
|
sys/xvimage/xvimagesink.c: Fixes : #390076.
Original commit message from CVS:
2007-01-07 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put),
(gst_lookup_xv_port_from_adaptor),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_setcaps),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
Patch by : Young-Ho Cha <ganadist at chollian dot net>
Fixes : #390076.
Add an adaptor property to select a specific XV adaptor.
* sys/xvimage/xvimagesink.h:
2007-01-07 21:53:38 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HANDLE_EXPOSE:
|
2007-07-14 18:20:41 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->handle_expose);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DOUBLE_BUFFER:
|
2007-07-14 18:33:15 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->double_buffer);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_AUTOPAINT_COLORKEY:
|
2008-07-29 08:59:32 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->autopaint_colorkey);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_COLORKEY:
|
2008-07-29 08:59:32 +00:00
|
|
|
g_value_set_int (value, xvimagesink->colorkey);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DRAW_BORDERS:
|
2008-09-04 13:46:52 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->draw_borders);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_WINDOW_WIDTH:
|
2010-10-25 13:09:20 +00:00
|
|
|
if (xvimagesink->xwindow)
|
|
|
|
g_value_set_uint64 (value, xvimagesink->xwindow->width);
|
|
|
|
else
|
|
|
|
g_value_set_uint64 (value, 0);
|
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_WINDOW_HEIGHT:
|
2010-10-25 13:09:20 +00:00
|
|
|
if (xvimagesink->xwindow)
|
|
|
|
g_value_set_uint64 (value, xvimagesink->xwindow->height);
|
|
|
|
else
|
|
|
|
g_value_set_uint64 (value, 0);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
}
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
static void
|
|
|
|
gst_xvimagesink_reset (GstXvImageSink * xvimagesink)
|
|
|
|
{
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
GThread *thread;
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
|
|
|
xvimagesink->running = FALSE;
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
/* grab thread and mark it as NULL */
|
|
|
|
thread = xvimagesink->event_thread;
|
|
|
|
xvimagesink->event_thread = NULL;
|
2007-03-08 15:22:53 +00:00
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
sys/: Make sure that before we clean up the X resources, we shutdown and join the event thread.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_reset):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_event_thread),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_change_state), (gst_xvimagesink_reset):
Make sure that before we clean up the X resources, we shutdown and join
the event thread.
Also make sure the event thread does not shut down immediatly after
startup because the running variable is not yet correctly set.
Fixes #378770.
2007-10-22 10:21:46 +00:00
|
|
|
|
|
|
|
/* Wait for our event thread to finish before we clean up our stuff. */
|
|
|
|
if (thread)
|
|
|
|
g_thread_join (thread);
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
if (xvimagesink->cur_image) {
|
2011-04-06 10:26:47 +00:00
|
|
|
gst_buffer_unref (xvimagesink->cur_image);
|
2007-03-08 15:22:53 +00:00
|
|
|
xvimagesink->cur_image = NULL;
|
|
|
|
}
|
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
if (xvimagesink->pool) {
|
|
|
|
gst_object_unref (xvimagesink->pool);
|
|
|
|
xvimagesink->pool = NULL;
|
|
|
|
}
|
2007-03-08 15:22:53 +00:00
|
|
|
|
|
|
|
if (xvimagesink->xwindow) {
|
|
|
|
gst_xvimagesink_xwindow_clear (xvimagesink, xvimagesink->xwindow);
|
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
}
|
2011-04-06 10:26:47 +00:00
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2007-03-08 15:22:53 +00:00
|
|
|
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink->render_rect.x = xvimagesink->render_rect.y =
|
|
|
|
xvimagesink->render_rect.w = xvimagesink->render_rect.h = 0;
|
|
|
|
xvimagesink->have_render_rect = FALSE;
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
gst_xvimagesink_xcontext_clear (xvimagesink);
|
|
|
|
}
|
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
/* Finalize is called only once, dispose can be called multiple times.
|
|
|
|
* We use mutexes and don't reset stuff to NULL here so let's register
|
|
|
|
* as a finalize. */
|
2003-11-10 18:22:20 +00:00
|
|
|
static void
|
2004-06-17 14:15:23 +00:00
|
|
|
gst_xvimagesink_finalize (GObject * object)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
gst_xvimagesink_reset (xvimagesink);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->display_name) {
|
|
|
|
g_free (xvimagesink->display_name);
|
|
|
|
xvimagesink->display_name = NULL;
|
|
|
|
}
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
|
2004-11-08 14:31:55 +00:00
|
|
|
if (xvimagesink->par) {
|
|
|
|
g_free (xvimagesink->par);
|
|
|
|
xvimagesink->par = NULL;
|
|
|
|
}
|
|
|
|
if (xvimagesink->x_lock) {
|
|
|
|
g_mutex_free (xvimagesink->x_lock);
|
|
|
|
xvimagesink->x_lock = NULL;
|
|
|
|
}
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (xvimagesink->flow_lock) {
|
|
|
|
g_mutex_free (xvimagesink->flow_lock);
|
|
|
|
xvimagesink->flow_lock = NULL;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2009-06-22 08:40:33 +00:00
|
|
|
g_free (xvimagesink->media_title);
|
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_init (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2011-04-29 10:09:38 +00:00
|
|
|
/* for the ALLOCATION query */
|
|
|
|
gst_pad_set_query_function (GST_BASE_SINK (xvimagesink)->sinkpad,
|
|
|
|
gst_xvimagesink_sink_query);
|
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xvimagesink->display_name = NULL;
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
xvimagesink->adaptor_no = 0;
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->xcontext = NULL;
|
|
|
|
xvimagesink->xwindow = NULL;
|
2004-02-03 23:05:46 +00:00
|
|
|
xvimagesink->cur_image = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
xvimagesink->hue = xvimagesink->saturation = 0;
|
|
|
|
xvimagesink->contrast = xvimagesink->brightness = 0;
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
xvimagesink->cb_changed = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
xvimagesink->fps_n = 0;
|
|
|
|
xvimagesink->fps_d = 0;
|
Adding a first version of directfbvideosink.
Original commit message from CVS:
2004-11-28 Julien MOUTTE <julien@moutte.net>
* configure.ac:
* ext/Makefile.am:
* ext/directfb/Makefile.am:
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_create),
(gst_directfbvideosink_get_pixel_format),
(gst_directfbvideosink_get_format_from_fourcc),
(gst_directfbvideosink_fixate), (gst_directfbvideosink_getcaps),
(gst_directfbvideosink_sink_link),
(gst_directfbvideosink_change_state),
(gst_directfbvideosink_chain), (gst_directfbvideosink_buffer_free),
(gst_directfbvideosink_buffer_alloc),
(gst_directfbvideosink_interface_supported),
(gst_directfbvideosink_interface_init),
(gst_directfbvideosink_navigation_send_event),
(gst_directfbvideosink_navigation_init),
(gst_directfbvideosink_set_property),
(gst_directfbvideosink_get_property),
(gst_directfbvideosink_finalize), (gst_directfbvideosink_init),
(gst_directfbvideosink_base_init),
(gst_directfbvideosink_class_init),
(gst_directfbvideosink_get_type), (plugin_init):
* ext/directfb/directfbvideosink.h: Adding a first version of
directfbvideosink.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_init): Initializing some
more.
2004-11-28 19:08:45 +00:00
|
|
|
xvimagesink->video_width = 0;
|
|
|
|
xvimagesink->video_height = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->x_lock = g_mutex_new ();
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
xvimagesink->flow_lock = g_mutex_new ();
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-04-06 10:26:47 +00:00
|
|
|
xvimagesink->pool = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
xvimagesink->synchronous = FALSE;
|
2007-07-14 18:33:15 +00:00
|
|
|
xvimagesink->double_buffer = TRUE;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
xvimagesink->running = FALSE;
|
|
|
|
xvimagesink->keep_aspect = FALSE;
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
xvimagesink->handle_events = TRUE;
|
2004-08-02 10:04:08 +00:00
|
|
|
xvimagesink->par = NULL;
|
2007-07-14 18:20:41 +00:00
|
|
|
xvimagesink->handle_expose = TRUE;
|
2008-07-29 08:59:32 +00:00
|
|
|
xvimagesink->autopaint_colorkey = TRUE;
|
|
|
|
|
2009-03-25 12:16:25 +00:00
|
|
|
/* on 16bit displays this becomes r,g,b = 1,2,3
|
|
|
|
* on 24bit displays this becomes r,g,b = 8,8,16
|
|
|
|
* as a port atom value
|
|
|
|
*/
|
|
|
|
xvimagesink->colorkey = (8 << 16) | (8 << 8) | 16;
|
2008-09-04 13:46:52 +00:00
|
|
|
xvimagesink->draw_borders = TRUE;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstBaseSinkClass *gstbasesink_class;
|
2009-09-08 16:43:26 +00:00
|
|
|
GstVideoSinkClass *videosink_class;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2005-03-31 09:43:49 +00:00
|
|
|
gstbasesink_class = (GstBaseSinkClass *) klass;
|
2009-09-08 16:43:26 +00:00
|
|
|
videosink_class = (GstVideoSinkClass *) klass;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2006-04-08 21:02:53 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gobject_class->set_property = gst_xvimagesink_set_property;
|
|
|
|
gobject_class->get_property = gst_xvimagesink_get_property;
|
|
|
|
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_CONTRAST,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("contrast", "Contrast", "The contrast of the video",
|
2008-03-22 15:00:53 +00:00
|
|
|
-1000, 1000, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_BRIGHTNESS,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("brightness", "Brightness",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The brightness of the video", -1000, 1000, 0,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_HUE,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("hue", "Hue", "The hue of the video", -1000, 1000, 0,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_SATURATION,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("saturation", "Saturation",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The saturation of the video", -1000, 1000, 0,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_DISPLAY,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_string ("display", "Display", "X Display name", NULL,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_SYNCHRONOUS,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_boolean ("synchronous", "Synchronous",
|
2004-03-15 19:32:28 +00:00
|
|
|
"When enabled, runs "
|
|
|
|
"the X display in synchronous mode. (used only for debugging)", FALSE,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_PIXEL_ASPECT_RATIO,
|
2004-07-27 16:43:24 +00:00
|
|
|
g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The pixel aspect ratio of the device", "1/1",
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_FORCE_ASPECT_RATIO,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio",
|
|
|
|
"When enabled, scaling will respect original aspect ratio", FALSE,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_HANDLE_EVENTS,
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
g_param_spec_boolean ("handle-events", "Handle XEvents",
|
|
|
|
"When enabled, XEvents will be selected and handled", TRUE,
|
2008-03-22 15:00:53 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_DEVICE,
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
g_param_spec_string ("device", "Adaptor number",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The number of the video adaptor", "0",
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_DEVICE_NAME,
|
sys/xvimage/xvimagesink.*: Implement PropertyProbe Interface for XVAdaptors so that one can choose the adaptor to use...
Original commit message from CVS:
2007-02-06 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_probe_get_properties),
(gst_xvimagesink_probe_probe_property),
(gst_xvimagesink_probe_needs_probe),
(gst_xvimagesink_probe_get_values),
(gst_xvimagesink_property_probe_interface_init),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init),
(gst_xvimagesink_get_type):
* sys/xvimage/xvimagesink.h: Implement PropertyProbe Interface
for XVAdaptors so that one can choose the adaptor to use with
gstreamer-properties.
2007-02-06 17:47:32 +00:00
|
|
|
g_param_spec_string ("device-name", "Adaptor name",
|
2008-03-22 15:00:53 +00:00
|
|
|
"The name of the video adaptor", NULL,
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
2008-07-29 10:26:28 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:handle-expose
|
|
|
|
*
|
|
|
|
* When enabled, the current frame will always be drawn in response to X
|
|
|
|
* Expose.
|
|
|
|
*
|
|
|
|
* Since: 0.10.14
|
|
|
|
*/
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_HANDLE_EXPOSE,
|
2008-03-22 15:00:53 +00:00
|
|
|
g_param_spec_boolean ("handle-expose", "Handle expose",
|
|
|
|
"When enabled, "
|
2007-07-14 18:20:41 +00:00
|
|
|
"the current frame will always be drawn in response to X Expose "
|
2008-03-22 15:00:53 +00:00
|
|
|
"events", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2010-10-25 13:09:20 +00:00
|
|
|
|
2008-07-29 10:26:28 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:double-buffer
|
|
|
|
*
|
|
|
|
* Whether to double-buffer the output.
|
|
|
|
*
|
|
|
|
* Since: 0.10.14
|
|
|
|
*/
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_DOUBLE_BUFFER,
|
2007-07-14 18:33:15 +00:00
|
|
|
g_param_spec_boolean ("double-buffer", "Double-buffer",
|
2008-03-22 15:00:53 +00:00
|
|
|
"Whether to double-buffer the output", TRUE,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2008-07-29 10:26:28 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:autopaint-colorkey
|
|
|
|
*
|
|
|
|
* Whether to autofill overlay with colorkey
|
|
|
|
*
|
|
|
|
* Since: 0.10.21
|
|
|
|
*/
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_AUTOPAINT_COLORKEY,
|
2008-07-29 08:59:32 +00:00
|
|
|
g_param_spec_boolean ("autopaint-colorkey", "Autofill with colorkey",
|
|
|
|
"Whether to autofill overlay with colorkey", TRUE,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2008-07-29 10:26:28 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:colorkey
|
|
|
|
*
|
|
|
|
* Color to use for the overlay mask.
|
|
|
|
*
|
|
|
|
* Since: 0.10.21
|
|
|
|
*/
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_COLORKEY,
|
2008-07-29 08:59:32 +00:00
|
|
|
g_param_spec_int ("colorkey", "Colorkey",
|
|
|
|
"Color to use for the overlay mask", G_MININT, G_MAXINT, 0,
|
2008-10-22 12:25:02 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2008-09-04 13:46:52 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:draw-borders
|
|
|
|
*
|
|
|
|
* Draw black borders when using GstXvImageSink:force-aspect-ratio to fill
|
|
|
|
* unused parts of the video area.
|
|
|
|
*
|
2008-09-05 10:24:05 +00:00
|
|
|
* Since: 0.10.21
|
2008-09-04 13:46:52 +00:00
|
|
|
*/
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_DRAW_BORDERS,
|
2008-09-04 13:46:52 +00:00
|
|
|
g_param_spec_boolean ("draw-borders", "Colorkey",
|
|
|
|
"Draw black borders to fill unused area in force-aspect-ratio mode",
|
|
|
|
TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2010-10-25 13:11:01 +00:00
|
|
|
/**
|
|
|
|
* GstXvImageSink:window-width
|
|
|
|
*
|
|
|
|
* Actual width of the video window.
|
|
|
|
*
|
|
|
|
* Since: 0.10.32
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_WINDOW_WIDTH,
|
|
|
|
g_param_spec_uint64 ("window-width", "window-width",
|
|
|
|
"Width of the window", 0, G_MAXUINT64, 0,
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstXvImageSink:window-height
|
|
|
|
*
|
|
|
|
* Actual height of the video window.
|
|
|
|
*
|
|
|
|
* Since: 0.10.32
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_WINDOW_HEIGHT,
|
|
|
|
g_param_spec_uint64 ("window-height", "window-height",
|
|
|
|
"Height of the window", 0, G_MAXUINT64, 0,
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
gobject_class->finalize = gst_xvimagesink_finalize;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2011-04-19 09:44:14 +00:00
|
|
|
gst_element_class_set_details_simple (gstelement_class,
|
|
|
|
"Video sink", "Sink/Video",
|
|
|
|
"A Xv based videosink", "Julien Moutte <julien@moutte.net>");
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
|
|
|
gst_static_pad_template_get (&gst_xvimagesink_sink_template_factory));
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gstelement_class->change_state =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_xvimagesink_change_state);
|
|
|
|
|
|
|
|
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_getcaps);
|
|
|
|
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_setcaps);
|
|
|
|
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_xvimagesink_get_times);
|
2009-06-22 08:40:33 +00:00
|
|
|
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xvimagesink_event);
|
2009-09-08 16:43:26 +00:00
|
|
|
|
|
|
|
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|