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
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2003-11-10 18:22:20 +00:00
|
|
|
*/
|
2004-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
|
2011-09-13 19:10:43 +00:00
|
|
|
* using the XVideo extension. Rendering to a remote display is theoretically
|
2007-04-20 10:42:24 +00:00
|
|
|
* 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
|
2012-12-10 13:35:37 +00:00
|
|
|
* application through the #GstVideoOverlay interface and will then render
|
|
|
|
* video frames in this drawable. If no Window ID was provided by the
|
|
|
|
* application, the 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
|
|
|
* |[
|
2015-05-09 21:33:26 +00:00
|
|
|
* gst-launch-1.0 -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
|
2015-05-09 21:33:26 +00:00
|
|
|
* video frames are scaled through hardware (no extra CPU cost). By default
|
|
|
|
* the image will never be distorted when scaled, instead black borders will
|
|
|
|
* be added if needed.
|
2008-07-11 06:10:24 +00:00
|
|
|
* |[
|
2015-05-09 21:33:26 +00:00
|
|
|
* gst-launch-1.0 -v videotestsrc ! xvimagesink force-aspect-ratio=false
|
|
|
|
* ]| Same pipeline with #GstXvImageSink:force-aspect-ratio property set to
|
|
|
|
* false. You can observe that no borders are drawn around the scaled image
|
|
|
|
* now and it will be distorted to fill the entire frame instead of respecting
|
|
|
|
* the aspect ratio.
|
2008-07-11 06:10:24 +00:00
|
|
|
* |[
|
2015-05-09 21:33:26 +00:00
|
|
|
* gst-launch-1.0 -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
|
|
|
* |[
|
2015-05-09 21:33:26 +00:00
|
|
|
* gst-launch-1.0 -v videotestsrc ! video/x-raw, pixel-aspect-ratio=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
|
2015-05-09 21:33:26 +00:00
|
|
|
* (from 320x240 to 320x180 in this case).
|
2008-07-11 06:10:24 +00:00
|
|
|
* |[
|
2015-05-09 21:33:26 +00:00
|
|
|
* gst-launch-1.0 -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 */
|
2012-04-13 09:01:03 +00:00
|
|
|
#include <gst/video/navigation.h>
|
2011-11-29 18:10:01 +00:00
|
|
|
#include <gst/video/videooverlay.h>
|
|
|
|
#include <gst/video/colorbalance.h>
|
2006-05-12 21:30:00 +00:00
|
|
|
/* Helper functions */
|
2011-10-31 01:23:21 +00:00
|
|
|
#include <gst/video/gstvideometa.h>
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* Object header */
|
|
|
|
#include "xvimagesink.h"
|
2013-03-13 10:13:58 +00:00
|
|
|
#include "xvimageallocator.h"
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2004-04-20 15:45:07 +00:00
|
|
|
/* Debugging category */
|
|
|
|
#include <gst/gstinfo.h>
|
2011-04-06 10:26:47 +00:00
|
|
|
|
2012-03-05 10:09:12 +00:00
|
|
|
/* for XkbKeycodeToKeysym */
|
|
|
|
#include <X11/XKBlib.h>
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xv_image_sink);
|
2011-04-06 10:26:47 +00:00
|
|
|
GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
2015-07-03 19:48:52 +00:00
|
|
|
#define GST_CAT_DEFAULT gst_debug_xv_image_sink
|
2004-04-20 15:45:07 +00:00
|
|
|
|
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)
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
static gboolean gst_xv_image_sink_open (GstXvImageSink * xvimagesink);
|
|
|
|
static void gst_xv_image_sink_close (GstXvImageSink * xvimagesink);
|
|
|
|
static void gst_xv_image_sink_xwindow_update_geometry (GstXvImageSink *
|
2010-02-19 12:46:43 +00:00
|
|
|
xvimagesink);
|
2015-07-03 19:48:52 +00:00
|
|
|
static void gst_xv_image_sink_expose (GstVideoOverlay * overlay);
|
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
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Default template - initiated with class struct to allow gst-register to work
|
|
|
|
without X running */
|
2015-07-03 19:48:52 +00:00
|
|
|
static GstStaticPadTemplate gst_xv_image_sink_sink_template_factory =
|
2011-06-16 10:48:33 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2011-06-16 10:48:33 +00:00
|
|
|
GST_STATIC_CAPS ("video/x-raw, "
|
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 */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
2015-07-03 19:48:52 +00:00
|
|
|
static void gst_xv_image_sink_navigation_init (GstNavigationInterface * iface);
|
|
|
|
static void gst_xv_image_sink_video_overlay_init (GstVideoOverlayInterface *
|
2011-10-21 12:37:31 +00:00
|
|
|
iface);
|
2015-07-03 19:48:52 +00:00
|
|
|
static void gst_xv_image_sink_colorbalance_init (GstColorBalanceInterface *
|
2011-10-21 12:37:31 +00:00
|
|
|
iface);
|
2015-07-03 19:48:52 +00:00
|
|
|
#define gst_xv_image_sink_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstXvImageSink, gst_xv_image_sink, GST_TYPE_VIDEO_SINK,
|
2011-04-19 09:44:14 +00:00
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION,
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_navigation_init);
|
2011-08-08 09:44:17 +00:00
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_video_overlay_init);
|
2011-04-19 09:44:14 +00:00
|
|
|
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_colorbalance_init));
|
2011-04-19 09:44:14 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Private Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xvimage_put (GstXvImageSink * xvimagesink,
|
|
|
|
GstBuffer * xvimage)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2013-02-23 08:52:57 +00:00
|
|
|
GstXvImageMemory *mem;
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoCropMeta *crop;
|
2010-02-19 12:46:43 +00:00
|
|
|
GstVideoRectangle result;
|
2006-10-20 13:56:55 +00:00
|
|
|
gboolean draw_border = FALSE;
|
2014-12-16 11:57:55 +00:00
|
|
|
GstVideoRectangle src = { 0, };
|
|
|
|
GstVideoRectangle dst = { 0, };
|
2013-03-13 10:13:58 +00:00
|
|
|
GstVideoRectangle mem_crop;
|
|
|
|
GstXWindow *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
|
|
|
|
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 */
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&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
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (G_UNLIKELY ((xwindow = xvimagesink->xwindow) == NULL)) {
|
2012-09-10 00:26:20 +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 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) {
|
2013-03-13 10:13:58 +00:00
|
|
|
draw_border = xvimagesink->draw_borders;
|
|
|
|
xvimagesink->redraw_border = FALSE;
|
2006-10-20 13:56:55 +00:00
|
|
|
}
|
|
|
|
|
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 {
|
2012-09-10 00:26:20 +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;
|
2005-11-27 18:12:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-23 08:52:57 +00:00
|
|
|
mem = (GstXvImageMemory *) gst_buffer_peek_memory (xvimage, 0);
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xvimage_memory_get_crop (mem, &mem_crop);
|
2011-04-06 10:26:47 +00:00
|
|
|
|
2011-10-31 01:23:21 +00:00
|
|
|
crop = gst_buffer_get_video_crop_meta (xvimage);
|
2010-02-19 12:46:43 +00:00
|
|
|
|
2011-06-23 10:55:13 +00:00
|
|
|
if (crop) {
|
2013-03-13 10:13:58 +00:00
|
|
|
src.x = crop->x + mem_crop.x;
|
|
|
|
src.y = crop->y + mem_crop.y;
|
2011-06-23 10:55:13 +00:00
|
|
|
src.w = crop->width;
|
|
|
|
src.h = crop->height;
|
2012-02-28 15:49:10 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink,
|
|
|
|
"crop %dx%d-%dx%d", crop->x, crop->y, crop->width, crop->height);
|
2011-06-23 10:55:13 +00:00
|
|
|
} else {
|
2013-03-13 10:13:58 +00:00
|
|
|
src = mem_crop;
|
2011-06-23 10:55:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimagesink->keep_aspect) {
|
2012-07-24 10:02:34 +00:00
|
|
|
GstVideoRectangle s;
|
|
|
|
|
|
|
|
/* We take the size of the source material as it was negotiated and
|
|
|
|
* corrected for DAR. This size can be different from the cropped size in
|
|
|
|
* which case the image will be scaled to fit the negotiated size. */
|
|
|
|
s.w = GST_VIDEO_SINK_WIDTH (xvimagesink);
|
|
|
|
s.h = GST_VIDEO_SINK_HEIGHT (xvimagesink);
|
2013-03-13 10:13:58 +00:00
|
|
|
dst.w = xwindow->render_rect.w;
|
|
|
|
dst.h = xwindow->render_rect.h;
|
2010-02-19 12:46:43 +00:00
|
|
|
|
2012-07-24 10:02:34 +00:00
|
|
|
gst_video_sink_center_rect (s, dst, &result, TRUE);
|
2013-03-13 10:13:58 +00:00
|
|
|
result.x += xwindow->render_rect.x;
|
|
|
|
result.y += xwindow->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 {
|
2013-03-13 10:13:58 +00:00
|
|
|
memcpy (&result, &xwindow->render_rect, sizeof (GstVideoRectangle));
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xvimage_memory_render (mem, &src, xwindow, &result, draw_border);
|
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
|
|
|
|
2012-09-10 00:26:20 +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
|
|
|
}
|
|
|
|
|
2009-06-22 08:40:33 +00:00
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
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;
|
2009-06-22 08:40:33 +00:00
|
|
|
}
|
2013-03-13 10:13:58 +00:00
|
|
|
|
|
|
|
gst_xwindow_set_title (xwindow, title);
|
|
|
|
g_free (title_mem);
|
2009-06-22 08:40:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 *
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xwindow_new (GstXvImageSink * xvimagesink,
|
2004-03-14 22:34:34 +00:00
|
|
|
gint width, gint height)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXWindow *xwindow = NULL;
|
2013-03-13 10:13:58 +00:00
|
|
|
GstXvContext *context;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
context = xvimagesink->context;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
xwindow = gst_xvcontext_create_xwindow (context, width, height);
|
2005-11-14 22:01:22 +00:00
|
|
|
|
2009-06-18 14:58:06 +00:00
|
|
|
/* set application name as a title */
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xwindow_set_title (xvimagesink, xwindow, NULL);
|
2009-06-18 14:58:06 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xwindow_set_event_handling (xwindow, xvimagesink->handle_events);
|
2004-06-27 19:02:29 +00:00
|
|
|
|
2011-08-08 09:44:17 +00:00
|
|
|
gst_video_overlay_got_window_handle (GST_VIDEO_OVERLAY (xvimagesink),
|
|
|
|
xwindow->win);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return 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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
|
|
|
if (G_LIKELY (xvimagesink->xwindow))
|
|
|
|
gst_xwindow_update_geometry (xvimagesink->xwindow);
|
|
|
|
g_mutex_unlock (&xvimagesink->flow_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
|
|
|
}
|
|
|
|
|
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
|
2013-03-13 10:13:58 +00:00
|
|
|
port. If the context is not initialized yet it simply returns */
|
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
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
|
|
{
|
2013-03-13 10:13:58 +00:00
|
|
|
GstXvContext *context;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
if ((context = xvimagesink->context) == NULL)
|
2008-06-20 17:02:48 +00:00
|
|
|
return;
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xvcontext_update_colorbalance (context, &xvimagesink->config);
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (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. */
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->lock);
|
|
|
|
while (XCheckWindowEvent (xvimagesink->context->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xwindow->win, PointerMotionMask, &e)) {
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
2012-09-10 00:26:20 +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
|
|
|
}
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2011-04-06 10:26:47 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (pointer_moved) {
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
2012-09-10 00:26:20 +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
|
|
|
|
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
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
while (XCheckWindowEvent (xvimagesink->context->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;
|
2012-03-05 10:09:12 +00:00
|
|
|
const char *key_str = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
/* We lock only for the X function call */
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
2012-09-10 00:26:20 +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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->lock);
|
|
|
|
keysym = XkbKeycodeToKeysym (xvimagesink->context->disp,
|
2012-03-05 10:09:12 +00:00
|
|
|
e.xkey.keycode, 0, 0);
|
2004-03-15 19:32:28 +00:00
|
|
|
if (keysym != NoSymbol) {
|
2007-01-23 13:19:19 +00:00
|
|
|
key_str = XKeysymToString (keysym);
|
2004-03-15 19:32:28 +00:00
|
|
|
} else {
|
2012-03-05 10:09:12 +00:00
|
|
|
key_str = "unknown";
|
2004-03-15 19:32:28 +00:00
|
|
|
}
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
2012-03-05 10:09:12 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"key %d pressed over window at %d,%d (%s)",
|
|
|
|
e.xkey.keycode, e.xkey.x, e.xkey.y, key_str);
|
|
|
|
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
|
|
|
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
|
|
|
}
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->lock);
|
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
|
|
|
|
|
|
|
/* Handle Expose */
|
2013-03-13 10:13:58 +00:00
|
|
|
while (XCheckWindowEvent (xvimagesink->context->disp,
|
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
|
|
|
xvimagesink->xwindow->win, ExposureMask | StructureNotifyMask, &e)) {
|
|
|
|
switch (e.type) {
|
|
|
|
case Expose:
|
|
|
|
exposed = TRUE;
|
|
|
|
break;
|
|
|
|
case ConfigureNotify:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xwindow_update_geometry (xvimagesink);
|
2013-03-13 10:13:58 +00:00
|
|
|
|
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
|
|
|
g_mutex_lock (&xvimagesink->context->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)) {
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
2012-09-10 00:26:20 +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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_expose (GST_VIDEO_OVERLAY (xvimagesink));
|
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
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
while (XPending (xvimagesink->context->disp)) {
|
|
|
|
XNextEvent (xvimagesink->context->disp, &e);
|
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
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case ClientMessage:{
|
|
|
|
Atom wm_delete;
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
wm_delete = XInternAtom (xvimagesink->context->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));
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
|
|
|
gst_xwindow_destroy (xvimagesink->xwindow);
|
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
|
|
|
xvimagesink->xwindow = NULL;
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->context->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
|
|
|
}
|
|
|
|
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
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->context->lock);
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_event_thread (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
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), 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
|
|
|
|
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) {
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_handle_xevents (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
|
|
|
}
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_manage_event_thread (GstXvImageSink * xvimagesink)
|
2009-09-15 12:26:06 +00:00
|
|
|
{
|
|
|
|
GThread *thread = NULL;
|
|
|
|
|
|
|
|
/* don't start the thread too early */
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->context == NULL) {
|
2009-09-15 12:26:06 +00:00
|
|
|
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;
|
2011-12-04 16:43:38 +00:00
|
|
|
xvimagesink->event_thread = g_thread_try_new ("xvimagesink-events",
|
2015-07-03 19:48:52 +00:00
|
|
|
(GThreadFunc) gst_xv_image_sink_event_thread, xvimagesink, NULL);
|
2009-09-15 12:26:06 +00:00
|
|
|
}
|
|
|
|
} 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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Element stuff */
|
|
|
|
|
|
|
|
static GstCaps *
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->context) {
|
2011-05-16 10:04:39 +00:00
|
|
|
if (filter)
|
2013-03-13 10:13:58 +00:00
|
|
|
return gst_caps_intersect_full (filter, xvimagesink->context->caps,
|
2011-05-16 10:04:39 +00:00
|
|
|
GST_CAPS_INTERSECT_FIRST);
|
|
|
|
else
|
2013-03-13 10:13:58 +00:00
|
|
|
return gst_caps_ref (xvimagesink->context->caps);
|
2011-05-16 10:04:39 +00:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2015-06-05 18:30:12 +00:00
|
|
|
static GstBufferPool *
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_create_pool (GstXvImageSink * xvimagesink, GstCaps * caps,
|
2015-06-05 18:30:12 +00:00
|
|
|
gsize size, gint min)
|
|
|
|
{
|
|
|
|
GstBufferPool *pool;
|
|
|
|
GstStructure *config;
|
|
|
|
|
|
|
|
pool = gst_xvimage_buffer_pool_new (xvimagesink->allocator);
|
|
|
|
|
|
|
|
config = gst_buffer_pool_get_config (pool);
|
|
|
|
gst_buffer_pool_config_set_params (config, caps, size, min, 0);
|
|
|
|
|
|
|
|
if (!gst_buffer_pool_set_config (pool, config))
|
|
|
|
goto config_failed;
|
|
|
|
|
|
|
|
return pool;
|
|
|
|
|
|
|
|
config_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (xvimagesink, "failed to set config.");
|
|
|
|
gst_object_unref (pool);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2013-03-13 10:13:58 +00:00
|
|
|
GstXvContext *context;
|
2011-04-06 10:26:47 +00:00
|
|
|
GstBufferPool *newpool, *oldpool;
|
2011-06-17 13:31:59 +00:00
|
|
|
GstVideoInfo info;
|
2011-04-06 10:26:47 +00:00
|
|
|
guint32 im_format = 0;
|
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 */
|
2006-05-12 22:22:37 +00:00
|
|
|
guint num, den;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
2013-03-13 10:13:58 +00:00
|
|
|
context = xvimagesink->context;
|
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 %"
|
2013-03-13 10:13:58 +00:00
|
|
|
GST_PTR_FORMAT, context->caps, caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (!gst_caps_can_intersect (context->caps, caps))
|
2008-11-13 18:18:32 +00:00
|
|
|
goto incompatible_caps;
|
2005-10-24 17:04:01 +00:00
|
|
|
|
2011-06-17 13:31:59 +00:00
|
|
|
if (!gst_video_info_from_caps (&info, caps))
|
|
|
|
goto invalid_format;
|
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
|
|
|
|
2011-06-17 13:31:59 +00:00
|
|
|
xvimagesink->fps_n = info.fps_n;
|
|
|
|
xvimagesink->fps_d = info.fps_d;
|
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
|
|
|
|
2011-06-17 13:31:59 +00:00
|
|
|
xvimagesink->video_width = info.width;
|
|
|
|
xvimagesink->video_height = info.height;
|
2008-11-13 18:18:32 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
im_format = gst_xvcontext_get_format_from_info (context, &info);
|
2008-11-13 18:18:32 +00:00
|
|
|
if (im_format == -1)
|
|
|
|
goto invalid_format;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-14 14:46:59 +00:00
|
|
|
gst_xvcontext_set_colorimetry (context, &info.colorimetry);
|
|
|
|
|
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 */
|
2011-06-17 13:31:59 +00:00
|
|
|
video_par_n = info.par_n;
|
|
|
|
video_par_d = info.par_d;
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* 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
|
|
|
|
2011-06-17 13:31:59 +00:00
|
|
|
if (!gst_video_calculate_display_ratio (&num, &den, info.width,
|
|
|
|
info.height, video_par_n, video_par_d, display_par_n, display_par_d))
|
2008-11-13 18:18:32 +00:00
|
|
|
goto no_disp_ratio;
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"video width/height: %dx%d, calculated display ratio: %d/%d",
|
2011-06-17 13:31:59 +00:00
|
|
|
info.width, info.height, num, den);
|
2004-07-27 16:43:24 +00:00
|
|
|
|
|
|
|
/* 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 */
|
2011-06-17 13:31:59 +00:00
|
|
|
if (info.height % den == 0) {
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video height");
|
2006-05-19 13:02:46 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = (guint)
|
2011-06-17 13:31:59 +00:00
|
|
|
gst_util_uint64_scale_int (info.height, num, den);
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = info.height;
|
|
|
|
} else if (info.width % num == 0) {
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video width");
|
2011-06-17 13:31:59 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = info.width;
|
2006-05-19 13:02:46 +00:00
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = (guint)
|
2011-06-17 13:31:59 +00:00
|
|
|
gst_util_uint64_scale_int (info.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)
|
2011-06-17 13:31:59 +00:00
|
|
|
gst_util_uint64_scale_int (info.height, num, den);
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = info.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 */
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2005-11-22 11:13:49 +00:00
|
|
|
if (!xvimagesink->xwindow) {
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
2011-08-08 09:44:17 +00:00
|
|
|
gst_video_overlay_prepare_window_handle (GST_VIDEO_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 {
|
2012-09-10 00:26:20 +00:00
|
|
|
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
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
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 (!xvimagesink->xwindow) {
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink->xwindow = gst_xv_image_sink_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-06-22 13:38:24 +00:00
|
|
|
xvimagesink->info = info;
|
|
|
|
|
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 */
|
2015-07-03 19:48:52 +00:00
|
|
|
newpool = gst_xv_image_sink_create_pool (xvimagesink, caps, info.size, 2);
|
2011-04-06 10:26:47 +00:00
|
|
|
|
2015-06-05 18:30:12 +00:00
|
|
|
/* we don't activate the internal pool yet as it may not be needed */
|
2011-04-06 10:26:47 +00:00
|
|
|
oldpool = xvimagesink->pool;
|
|
|
|
xvimagesink->pool = newpool;
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-06-05 18:30:12 +00:00
|
|
|
/* deactivate and unref the old internal pool */
|
2011-04-06 10:26:47 +00:00
|
|
|
if (oldpool) {
|
2015-06-05 18:30:12 +00:00
|
|
|
gst_buffer_pool_set_active (oldpool, FALSE);
|
2011-04-06 10:26:47 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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;
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (element);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2015-07-03 19:48:52 +00:00
|
|
|
if (!gst_xv_image_sink_open (xvimagesink))
|
2013-03-13 10:13:58 +00:00
|
|
|
goto error;
|
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;
|
2012-09-10 00:26:20 +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);
|
2012-09-10 00:26:20 +00:00
|
|
|
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:
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_close (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
|
|
|
}
|
2005-11-15 19:01:43 +00:00
|
|
|
return ret;
|
2013-03-13 10:13:58 +00:00
|
|
|
|
|
|
|
error:
|
|
|
|
{
|
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
2005-03-31 09:43:49 +00:00
|
|
|
GstClockTime * start, GstClockTime * end)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-14 11:42:16 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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;
|
2013-12-16 05:01:42 +00:00
|
|
|
GstBuffer *to_put = NULL;
|
2013-03-13 10:13:58 +00:00
|
|
|
GstMemory *mem;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (vsink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (gst_buffer_n_memory (buf) == 1 && (mem = gst_buffer_peek_memory (buf, 0))
|
|
|
|
&& gst_xvimage_memory_is_from_context (mem, xvimagesink->context)) {
|
2011-02-25 15:01:47 +00:00
|
|
|
/* 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);
|
|
|
|
to_put = buf;
|
2011-06-20 15:36:24 +00:00
|
|
|
res = GST_FLOW_OK;
|
2011-02-25 15:01:47 +00:00
|
|
|
} else {
|
2011-06-22 13:38:24 +00:00
|
|
|
GstVideoFrame src, dest;
|
2012-08-10 09:45:38 +00:00
|
|
|
GstBufferPoolAcquireParams params = { 0, };
|
2011-03-27 15:16:10 +00:00
|
|
|
|
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-06-20 15:36:24 +00:00
|
|
|
if (!gst_buffer_pool_set_active (xvimagesink->pool, TRUE))
|
|
|
|
goto activate_failed;
|
|
|
|
|
2012-08-10 09:45:38 +00:00
|
|
|
/* take a buffer from our pool, if there is no buffer in the pool something
|
|
|
|
* is seriously wrong, waiting for the pool here might deadlock when we try
|
|
|
|
* to go to PAUSED because we never flush the pool then. */
|
|
|
|
params.flags = GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
|
|
|
|
res = gst_buffer_pool_acquire_buffer (xvimagesink->pool, &to_put, ¶ms);
|
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
|
|
|
GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, xvimagesink,
|
2013-03-05 15:34:35 +00:00
|
|
|
"slow copy buffer %p into bufferpool buffer %p", buf, 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-06-22 13:38:24 +00:00
|
|
|
if (!gst_video_frame_map (&src, &xvimagesink->info, buf, GST_MAP_READ))
|
|
|
|
goto invalid_buffer;
|
|
|
|
|
|
|
|
if (!gst_video_frame_map (&dest, &xvimagesink->info, to_put, GST_MAP_WRITE)) {
|
|
|
|
gst_video_frame_unmap (&src);
|
|
|
|
goto invalid_buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_video_frame_copy (&dest, &src);
|
|
|
|
|
|
|
|
gst_video_frame_unmap (&dest);
|
|
|
|
gst_video_frame_unmap (&src);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2006-09-20 10:59:06 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
if (!gst_xv_image_sink_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");
|
2012-08-10 09:45:38 +00:00
|
|
|
return GST_FLOW_OK;
|
2011-04-06 10:26:47 +00:00
|
|
|
}
|
2011-06-22 13:38:24 +00:00
|
|
|
invalid_buffer:
|
|
|
|
{
|
|
|
|
/* No Window available to put our image into */
|
2012-08-10 09:45:38 +00:00
|
|
|
GST_WARNING_OBJECT (xvimagesink, "could not map image");
|
2011-06-22 13:38:24 +00:00
|
|
|
res = GST_FLOW_OK;
|
|
|
|
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
|
|
|
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
|
|
|
}
|
2011-06-20 15:36:24 +00:00
|
|
|
activate_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (xvimagesink, "failed to activate bufferpool.");
|
|
|
|
res = GST_FLOW_ERROR;
|
|
|
|
goto done;
|
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
|
|
|
|
2009-06-22 08:40:33 +00:00
|
|
|
static gboolean
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_event (GstBaseSink * sink, GstEvent * event)
|
2009-06-22 08:40:33 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (sink);
|
2009-06-22 08:40:33 +00:00
|
|
|
|
|
|
|
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);
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xwindow_set_title (xvimagesink, xvimagesink->xwindow,
|
2009-06-22 13:17:10 +00:00
|
|
|
title);
|
2009-06-22 08:40:33 +00:00
|
|
|
|
|
|
|
g_free (title);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2011-12-02 21:24:43 +00:00
|
|
|
return GST_BASE_SINK_CLASS (parent_class)->event (sink, event);
|
2009-06-22 08:40:33 +00:00
|
|
|
}
|
|
|
|
|
2011-04-29 10:09:38 +00:00
|
|
|
static gboolean
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
2011-04-29 10:09:38 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (bsink);
|
2015-06-05 18:30:12 +00:00
|
|
|
GstBufferPool *pool = NULL;
|
2011-07-26 11:17:20 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
guint size;
|
|
|
|
gboolean need_pool;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-07-26 11:17:20 +00:00
|
|
|
gst_query_parse_allocation (query, &caps, &need_pool);
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-07-26 11:17:20 +00:00
|
|
|
if (caps == NULL)
|
|
|
|
goto no_caps;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2015-06-05 18:30:12 +00:00
|
|
|
if (need_pool) {
|
2011-07-26 11:17:20 +00:00
|
|
|
GstVideoInfo info;
|
2011-05-19 13:55:53 +00:00
|
|
|
|
2011-07-26 11:17:20 +00:00
|
|
|
if (!gst_video_info_from_caps (&info, caps))
|
|
|
|
goto invalid_caps;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2012-06-18 10:17:12 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "create new pool");
|
2015-07-03 19:48:52 +00:00
|
|
|
pool = gst_xv_image_sink_create_pool (xvimagesink, caps, info.size, 0);
|
2012-06-18 10:17:12 +00:00
|
|
|
|
2011-07-26 11:17:20 +00:00
|
|
|
/* the normal size of a frame */
|
|
|
|
size = info.size;
|
2011-05-19 13:55:53 +00:00
|
|
|
|
2015-06-05 18:30:12 +00:00
|
|
|
if (pool == NULL)
|
|
|
|
goto no_pool;
|
2011-07-26 11:17:20 +00:00
|
|
|
}
|
2015-06-05 18:30:12 +00:00
|
|
|
|
2012-06-15 14:43:47 +00:00
|
|
|
if (pool) {
|
|
|
|
/* we need at least 2 buffer because we hold on to the last one */
|
|
|
|
gst_query_add_allocation_pool (query, pool, size, 2, 0);
|
|
|
|
gst_object_unref (pool);
|
|
|
|
}
|
2011-05-19 13:55:53 +00:00
|
|
|
|
2011-07-26 11:17:20 +00:00
|
|
|
/* we also support various metadata */
|
2012-07-06 09:50:44 +00:00
|
|
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
|
|
|
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL);
|
2011-04-29 10:09:38 +00:00
|
|
|
|
2011-07-26 11:17:20 +00:00
|
|
|
return TRUE;
|
2011-04-29 10:09:38 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_caps:
|
|
|
|
{
|
2011-07-26 11:17:20 +00:00
|
|
|
GST_DEBUG_OBJECT (bsink, "no caps specified");
|
2011-04-29 10:09:38 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
invalid_caps:
|
|
|
|
{
|
2011-07-26 11:17:20 +00:00
|
|
|
GST_DEBUG_OBJECT (bsink, "invalid caps specified");
|
2011-04-29 10:09:38 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2015-06-05 18:30:12 +00:00
|
|
|
no_pool:
|
2011-04-29 10:09:38 +00:00
|
|
|
{
|
2015-06-05 18:30:12 +00:00
|
|
|
/* Already warned in create_pool */
|
2011-04-29 10:09:38 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* Interfaces stuff */
|
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_navigation_send_event (GstNavigation * navigation,
|
2004-03-14 22:34:34 +00:00
|
|
|
GstStructure * structure)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (navigation);
|
2015-04-02 14:10:32 +00:00
|
|
|
gboolean handled = FALSE;
|
|
|
|
GstEvent *event = NULL;
|
2005-01-09 00:07:30 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
GstVideoRectangle src = { 0, };
|
|
|
|
GstVideoRectangle dst = { 0, };
|
|
|
|
GstVideoRectangle result;
|
|
|
|
gdouble x, y, xscale = 1.0, yscale = 1.0;
|
|
|
|
GstXWindow *xwindow;
|
2005-11-22 10:09:54 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
/* We take the flow_lock while we look at the window */
|
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
if (!(xwindow = xvimagesink->xwindow)) {
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
2015-07-07 10:55:44 +00:00
|
|
|
return;
|
|
|
|
}
|
2010-02-19 12:46:43 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
if (xvimagesink->keep_aspect) {
|
|
|
|
/* 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 = xwindow->render_rect.w;
|
|
|
|
dst.h = xwindow->render_rect.h;
|
2005-11-11 17:41:04 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
|
|
|
result.x += xwindow->render_rect.x;
|
|
|
|
result.y += xwindow->render_rect.y;
|
|
|
|
} else {
|
|
|
|
memcpy (&result, &xwindow->render_rect, sizeof (GstVideoRectangle));
|
2005-11-11 17:41:04 +00:00
|
|
|
}
|
2015-04-02 14:10:32 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
|
|
|
/* Converting pointer coordinates to the non scaled geometry */
|
|
|
|
if (gst_structure_get_double (structure, "pointer_x", &x)) {
|
|
|
|
x = MIN (x, result.x + result.w);
|
|
|
|
x = MAX (x - result.x, 0);
|
|
|
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
|
|
|
|
(gdouble) x * xscale, NULL);
|
|
|
|
}
|
|
|
|
if (gst_structure_get_double (structure, "pointer_y", &y)) {
|
|
|
|
y = MIN (y, result.y + result.h);
|
|
|
|
y = MAX (y - result.y, 0);
|
|
|
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
|
|
|
|
(gdouble) y * yscale, NULL);
|
2015-04-02 14:10:32 +00:00
|
|
|
}
|
2015-05-04 16:00:18 +00:00
|
|
|
|
2015-07-07 10:55:44 +00:00
|
|
|
event = gst_event_new_navigation (structure);
|
|
|
|
if (event) {
|
|
|
|
gst_event_ref (event);
|
|
|
|
handled = gst_pad_push_event (GST_VIDEO_SINK_PAD (xvimagesink), event);
|
|
|
|
|
|
|
|
if (!handled)
|
|
|
|
gst_element_post_message ((GstElement *) xvimagesink,
|
|
|
|
gst_navigation_message_new_event ((GstObject *) xvimagesink, event));
|
|
|
|
|
2015-05-04 16:00:18 +00:00
|
|
|
gst_event_unref (event);
|
2015-07-07 10:55:44 +00:00
|
|
|
}
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_navigation_init (GstNavigationInterface * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
iface->send_event = gst_xv_image_sink_navigation_send_event;
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_set_window_handle (GstVideoOverlay * overlay, guintptr id)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2010-09-05 22:17:47 +00:00
|
|
|
XID xwindow_id = id;
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
2003-11-17 16:32:29 +00:00
|
|
|
GstXWindow *xwindow = NULL;
|
2013-03-13 10:13:58 +00:00
|
|
|
GstXvContext *context;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
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
|
|
|
|
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)) {
|
2012-09-10 00:26:20 +00:00
|
|
|
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 */
|
2013-03-13 10:13:58 +00:00
|
|
|
if (!xvimagesink->context &&
|
|
|
|
!(xvimagesink->context =
|
|
|
|
gst_xvcontext_new (&xvimagesink->config, NULL))) {
|
2012-09-10 00:26:20 +00:00
|
|
|
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
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
context = xvimagesink->context;
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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) {
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xwindow_destroy (xvimagesink->xwindow);
|
2004-03-14 22:34:34 +00:00
|
|
|
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 =
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xwindow_new (xvimagesink,
|
2005-07-10 12:03:58 +00:00
|
|
|
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 {
|
2013-03-13 10:13:58 +00:00
|
|
|
xwindow = gst_xvcontext_create_xwindow_from_xid (context, xwindow_id);
|
|
|
|
gst_xwindow_set_event_handling (xwindow, xvimagesink->handle_events);
|
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 (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
|
|
|
|
2012-09-10 00:26:20 +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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_expose (GstVideoOverlay * overlay)
|
2004-02-03 23:05:46 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
2004-02-16 23:45:55 +00:00
|
|
|
|
2011-04-06 15:54:28 +00:00
|
|
|
GST_DEBUG ("doing expose");
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_xwindow_update_geometry (xvimagesink);
|
|
|
|
gst_xv_image_sink_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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_set_event_handling (GstVideoOverlay * overlay,
|
Add a method to the XOverlay interface to allow disabling of event handling in x[v]imagesink elements. This will let ...
Original commit message from CVS:
2007-01-04 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/interfaces/xoverlay.c:
(gst_x_overlay_handle_events):
* gst-libs/gst/interfaces/xoverlay.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_set_xwindow_id),
(gst_ximagesink_set_event_handling),
(gst_ximagesink_xoverlay_init), (gst_ximagesink_set_property),
(gst_ximagesink_get_property), (gst_ximagesink_init),
(gst_ximagesink_class_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_new),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_set_event_handling),
(gst_xvimagesink_xoverlay_init), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_init),
(gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h:
* tests/icles/stress-xoverlay.c: (toggle_events),
(create_window):
Add a method to the XOverlay interface to allow disabling of
event handling in x[v]imagesink elements. This will let X events
propagate to parent windows which can be usefull in some cases.
Be carefull that the application is then responsible of pushing
navigation events and expose events to the video sink.
Fixes: #387138.
2007-01-04 11:30:53 +00:00
|
|
|
gboolean handle_events)
|
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
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
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->handle_events = handle_events;
|
|
|
|
if (G_LIKELY (xvimagesink->xwindow))
|
|
|
|
gst_xwindow_set_event_handling (xvimagesink->xwindow, handle_events);
|
2012-09-10 00:26:20 +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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_set_render_rectangle (GstVideoOverlay * overlay, gint x,
|
|
|
|
gint y, gint width, gint height)
|
2010-02-19 12:46:43 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (overlay);
|
2010-02-19 12:46:43 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
|
|
|
if (G_LIKELY (xvimagesink->xwindow))
|
|
|
|
gst_xwindow_set_render_rectangle (xvimagesink->xwindow, x, y, width,
|
|
|
|
height);
|
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
2010-02-19 12:46:43 +00:00
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_video_overlay_init (GstVideoOverlayInterface * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
iface->set_window_handle = gst_xv_image_sink_set_window_handle;
|
|
|
|
iface->expose = gst_xv_image_sink_expose;
|
|
|
|
iface->handle_events = gst_xv_image_sink_set_event_handling;
|
|
|
|
iface->set_render_rectangle = gst_xv_image_sink_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 *
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (balance);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->context)
|
|
|
|
return xvimagesink->context->channels_list;
|
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
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_colorbalance_set_value (GstColorBalance * balance,
|
2004-03-14 22:34:34 +00:00
|
|
|
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
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (balance);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (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
|
|
|
g_return_if_fail (channel->label != NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.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) {
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.hue = value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.saturation = value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.contrast = value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.brightness = value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else {
|
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_colorbalance_get_value (GstColorBalance * balance,
|
2004-03-14 22:34:34 +00:00
|
|
|
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
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XV_IMAGE_SINK (xvimagesink), 0);
|
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 (channel->label != NULL, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
value = xvimagesink->config.hue;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
value = xvimagesink->config.saturation;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
value = xvimagesink->config.contrast;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
2013-03-13 10:13:58 +00:00
|
|
|
value = xvimagesink->config.brightness;
|
2004-03-14 22:34:34 +00:00
|
|
|
} 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;
|
|
|
|
}
|
|
|
|
|
2012-03-02 09:00:59 +00:00
|
|
|
static GstColorBalanceType
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_colorbalance_get_balance_type (GstColorBalance * balance)
|
2012-03-02 09:00:59 +00:00
|
|
|
{
|
|
|
|
return 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
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_colorbalance_init (GstColorBalanceInterface * 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
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
iface->list_channels = gst_xv_image_sink_colorbalance_list_channels;
|
|
|
|
iface->set_value = gst_xv_image_sink_colorbalance_set_value;
|
|
|
|
iface->get_value = gst_xv_image_sink_colorbalance_get_value;
|
|
|
|
iface->get_balance_type = gst_xv_image_sink_colorbalance_get_balance_type;
|
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
|
|
|
}
|
|
|
|
|
2011-12-21 10:58:53 +00:00
|
|
|
#if 0
|
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 *
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_probe_get_properties (GstPropertyProbe * probe)
|
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
|
|
|
{
|
|
|
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_probe_probe_property (GstPropertyProbe * probe,
|
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 prop_id, const GParamSpec * pspec)
|
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
|
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
|
|
|
|
|
|
|
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");
|
2013-03-13 10:13:58 +00:00
|
|
|
if (!xvimagesink->context) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "generating context");
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink->context = gst_xv_image_sink_context_get (xvimagesink);
|
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
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_probe_needs_probe (GstPropertyProbe * probe,
|
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 prop_id, const GParamSpec * pspec)
|
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
|
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
|
|
|
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:
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->context != 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
|
|
|
ret = FALSE;
|
|
|
|
} else {
|
|
|
|
ret = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GValueArray *
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_probe_get_values (GstPropertyProbe * probe,
|
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 prop_id, const GParamSpec * pspec)
|
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
GstXvImageSink *xvimagesink = GST_XV_IMAGE_SINK (probe);
|
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
|
|
|
GValueArray *array = NULL;
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (G_UNLIKELY (!xvimagesink->context)) {
|
|
|
|
GST_WARNING_OBJECT (xvimagesink, "we don't have any context, can't "
|
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
|
|
|
"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 };
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
array = g_value_array_new (xvimagesink->context->nb_adaptors);
|
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_value_init (&value, G_TYPE_STRING);
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
for (i = 0; i < xvimagesink->context->nb_adaptors; i++) {
|
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
|
|
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_property_probe_interface_init (GstPropertyProbeInterface *
|
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
|
|
|
iface)
|
|
|
|
{
|
2015-07-03 19:48:52 +00:00
|
|
|
iface->get_properties = gst_xv_image_sink_probe_get_properties;
|
|
|
|
iface->probe_property = gst_xv_image_sink_probe_probe_property;
|
|
|
|
iface->needs_probe = gst_xv_image_sink_probe_needs_probe;
|
|
|
|
iface->get_values = gst_xv_image_sink_probe_get_values;
|
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
|
|
|
}
|
2011-12-21 10:58:53 +00:00
|
|
|
#endif
|
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
|
|
|
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:34 +00:00
|
|
|
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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HUE:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.hue = g_value_get_int (value);
|
|
|
|
xvimagesink->config.cb_changed = TRUE;
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_CONTRAST:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.contrast = g_value_get_int (value);
|
|
|
|
xvimagesink->config.cb_changed = TRUE;
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_BRIGHTNESS:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.brightness = g_value_get_int (value);
|
|
|
|
xvimagesink->config.cb_changed = TRUE;
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_SATURATION:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.saturation = g_value_get_int (value);
|
|
|
|
xvimagesink->config.cb_changed = TRUE;
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DISPLAY:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_free (xvimagesink->config.display_name);
|
|
|
|
xvimagesink->config.display_name = g_strdup (g_value_get_string (value));
|
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
|
|
|
xvimagesink->synchronous = g_value_get_boolean (value);
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->context) {
|
|
|
|
gst_xvcontext_set_synchronous (xvimagesink->context,
|
|
|
|
xvimagesink->synchronous);
|
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:
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_set_event_handling (GST_VIDEO_OVERLAY (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
|
|
|
g_value_get_boolean (value));
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.adaptor_nr = 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);
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.autopaint_colorkey = g_value_get_boolean (value);
|
2008-07-29 08:59:32 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_COLORKEY:
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.colorkey = g_value_get_int (value);
|
2008-10-22 12:25:02 +00:00
|
|
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_get_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:34 +00:00
|
|
|
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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
g_return_if_fail (GST_IS_XV_IMAGE_SINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_HUE:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_int (value, xvimagesink->config.hue);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_CONTRAST:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_int (value, xvimagesink->config.contrast);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_BRIGHTNESS:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_int (value, xvimagesink->config.brightness);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_SATURATION:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_int (value, xvimagesink->config.saturation);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DISPLAY:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_string (value, xvimagesink->config.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
|
|
|
{
|
2013-03-13 10:13:58 +00:00
|
|
|
char *adaptor_nr_s =
|
|
|
|
g_strdup_printf ("%u", xvimagesink->config.adaptor_nr);
|
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
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_string (value, adaptor_nr_s);
|
|
|
|
g_free (adaptor_nr_s);
|
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
|
|
|
break;
|
|
|
|
}
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_DEVICE_NAME:
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->context && xvimagesink->context->adaptors) {
|
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_value_set_string (value,
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->context->adaptors[xvimagesink->config.adaptor_nr]);
|
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
|
|
|
} 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:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_boolean (value, xvimagesink->config.autopaint_colorkey);
|
2008-07-29 08:59:32 +00:00
|
|
|
break;
|
2010-10-25 13:09:39 +00:00
|
|
|
case PROP_COLORKEY:
|
2013-03-13 10:13:58 +00:00
|
|
|
g_value_set_int (value, xvimagesink->config.colorkey);
|
2008-07-29 08:59:32 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
static gboolean
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_open (GstXvImageSink * xvimagesink)
|
2013-03-13 10:13:58 +00:00
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
|
2014-01-14 22:07:34 +00:00
|
|
|
/* Initializing the XvContext unless already done through GstVideoOverlay */
|
|
|
|
if (!xvimagesink->context) {
|
|
|
|
GstXvContext *context;
|
|
|
|
if (!(context = gst_xvcontext_new (&xvimagesink->config, &error)))
|
|
|
|
goto no_context;
|
2013-03-13 10:13:58 +00:00
|
|
|
|
2014-01-14 22:07:34 +00:00
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
|
|
|
xvimagesink->context = context;
|
|
|
|
} else
|
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
2013-03-13 10:13:58 +00:00
|
|
|
/* make an allocator for this context */
|
2014-01-14 22:07:34 +00:00
|
|
|
xvimagesink->allocator = gst_xvimage_allocator_new (xvimagesink->context);
|
2013-03-13 10:13:58 +00:00
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
|
|
|
|
|
|
|
/* 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->context->par);
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "set calculated PAR on object's PAR");
|
|
|
|
}
|
|
|
|
/* call XSynchronize with the current value of synchronous */
|
|
|
|
gst_xvcontext_set_synchronous (xvimagesink->context,
|
|
|
|
xvimagesink->synchronous);
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_update_colorbalance (xvimagesink);
|
|
|
|
gst_xv_image_sink_manage_event_thread (xvimagesink);
|
2013-03-13 10:13:58 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
no_context:
|
|
|
|
{
|
|
|
|
gst_element_message_full (GST_ELEMENT (xvimagesink), GST_MESSAGE_ERROR,
|
|
|
|
error->domain, error->code, g_strdup ("Could not initialise Xv output"),
|
|
|
|
error->message, __FILE__, GST_FUNCTION, __LINE__);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-08 15:22:53 +00:00
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_close (GstXvImageSink * xvimagesink)
|
2007-03-08 15:22:53 +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
|
|
|
GThread *thread;
|
2013-03-13 10:13:58 +00:00
|
|
|
GstXvContext *context;
|
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
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_lock (&xvimagesink->flow_lock);
|
2011-04-06 10:26:47 +00:00
|
|
|
|
|
|
|
if (xvimagesink->pool) {
|
|
|
|
gst_object_unref (xvimagesink->pool);
|
|
|
|
xvimagesink->pool = NULL;
|
|
|
|
}
|
2007-03-08 15:22:53 +00:00
|
|
|
|
|
|
|
if (xvimagesink->xwindow) {
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xwindow_clear (xvimagesink->xwindow);
|
|
|
|
gst_xwindow_destroy (xvimagesink->xwindow);
|
2007-03-08 15:22:53 +00:00
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
}
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_unlock (&xvimagesink->flow_lock);
|
2007-03-08 15:22:53 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
if (xvimagesink->allocator) {
|
|
|
|
gst_object_unref (xvimagesink->allocator);
|
|
|
|
xvimagesink->allocator = NULL;
|
|
|
|
}
|
2010-02-19 12:46:43 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
GST_OBJECT_LOCK (xvimagesink);
|
|
|
|
/* grab context and mark it as NULL */
|
|
|
|
context = xvimagesink->context;
|
|
|
|
xvimagesink->context = NULL;
|
|
|
|
GST_OBJECT_UNLOCK (xvimagesink);
|
|
|
|
|
|
|
|
if (context)
|
|
|
|
gst_xvcontext_unref (context);
|
2007-03-08 15:22:53 +00:00
|
|
|
}
|
|
|
|
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_finalize (GObject * object)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
xvimagesink = GST_XV_IMAGE_SINK (object);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_close (xvimagesink);
|
2007-03-08 15:22:53 +00:00
|
|
|
|
2013-03-13 10:13:58 +00:00
|
|
|
gst_xvcontext_config_clear (&xvimagesink->config);
|
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;
|
|
|
|
}
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_clear (&xvimagesink->flow_lock);
|
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
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_init (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2013-03-13 10:13:58 +00:00
|
|
|
xvimagesink->config.display_name = NULL;
|
|
|
|
xvimagesink->config.adaptor_nr = 0;
|
|
|
|
xvimagesink->config.autopaint_colorkey = TRUE;
|
|
|
|
xvimagesink->config.double_buffer = TRUE;
|
|
|
|
/* 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->config.colorkey = (8 << 16) | (8 << 8) | 16;
|
|
|
|
xvimagesink->config.hue = xvimagesink->config.saturation = 0;
|
|
|
|
xvimagesink->config.contrast = xvimagesink->config.brightness = 0;
|
|
|
|
xvimagesink->config.cb_changed = FALSE;
|
|
|
|
|
|
|
|
xvimagesink->context = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->xwindow = NULL;
|
2004-02-03 23:05:46 +00:00
|
|
|
xvimagesink->cur_image = NULL;
|
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
|
|
|
|
2012-09-10 00:26:20 +00:00
|
|
|
g_mutex_init (&xvimagesink->flow_lock);
|
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;
|
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;
|
2012-07-24 09:23:30 +00:00
|
|
|
xvimagesink->keep_aspect = TRUE;
|
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
|
|
|
|
2008-09-04 13:46:52 +00:00
|
|
|
xvimagesink->draw_borders = TRUE;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_xv_image_sink_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
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gobject_class->set_property = gst_xv_image_sink_set_property;
|
|
|
|
gobject_class->get_property = gst_xv_image_sink_get_property;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
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",
|
2011-10-19 08:41:31 +00:00
|
|
|
"When enabled, runs the X display in synchronous mode. "
|
|
|
|
"(unrelated to A/V sync, 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",
|
2012-06-29 10:43:46 +00:00
|
|
|
"When enabled, scaling will respect original aspect ratio", 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_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.
|
|
|
|
*/
|
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.
|
|
|
|
*/
|
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
|
|
|
|
*/
|
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.
|
|
|
|
*/
|
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.
|
|
|
|
*/
|
2010-10-25 13:09:39 +00:00
|
|
|
g_object_class_install_property (gobject_class, PROP_DRAW_BORDERS,
|
2014-07-17 13:36:16 +00:00
|
|
|
g_param_spec_boolean ("draw-borders", "Draw Borders",
|
2008-09-04 13:46:52 +00:00
|
|
|
"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.
|
|
|
|
*/
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
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));
|
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gobject_class->finalize = gst_xv_image_sink_finalize;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2012-04-09 23:45:16 +00:00
|
|
|
gst_element_class_set_static_metadata (gstelement_class,
|
2011-04-19 09:44:14 +00:00
|
|
|
"Video sink", "Sink/Video",
|
|
|
|
"A Xv based videosink", "Julien Moutte <julien@moutte.net>");
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
2015-07-03 19:48:52 +00:00
|
|
|
gst_static_pad_template_get (&gst_xv_image_sink_sink_template_factory));
|
2011-04-19 09:44:14 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gstelement_class->change_state =
|
2015-07-03 19:48:52 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_change_state);
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_xv_image_sink_getcaps);
|
|
|
|
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xv_image_sink_setcaps);
|
|
|
|
gstbasesink_class->get_times =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_get_times);
|
2011-08-26 12:20:30 +00:00
|
|
|
gstbasesink_class->propose_allocation =
|
2015-07-03 19:48:52 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_propose_allocation);
|
|
|
|
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xv_image_sink_event);
|
2009-09-08 16:43:26 +00:00
|
|
|
|
2015-07-03 19:48:52 +00:00
|
|
|
videosink_class->show_frame =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_xv_image_sink_show_frame);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|