2003-11-10 18:22:20 +00:00
|
|
|
/* GStreamer
|
2005-11-27 18:12:23 +00:00
|
|
|
* Copyright (C) <2005> Julien Moutte <julien@moutte.net>
|
2003-11-10 18:22:20 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-26 15:26:36 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-xvimagesink
|
|
|
|
*
|
|
|
|
* <refsect2>
|
|
|
|
* <para>
|
|
|
|
* XvImageSink renders video frames to a drawable (XWindow) on a local display
|
|
|
|
* using the XVideo extension. Rendering to a remote display is theorically
|
|
|
|
* possible but i doubt that the XVideo extension is actually available when
|
|
|
|
* connecting to a remote display. This element can receive a Window ID from the
|
|
|
|
* application through the XOverlay interface and will then render video frames
|
|
|
|
* in this drawable. If no Window ID was provided by the application, the
|
|
|
|
* element will create its own internal window and render into it.
|
|
|
|
* </para>
|
|
|
|
* <title>Scaling</title>
|
|
|
|
* <para>
|
|
|
|
* The XVideo extension, when it's available, handles hardware accelerated
|
|
|
|
* 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
|
|
|
|
* drawable scaling them on the fly. Using the
|
|
|
|
* <link linkend="GstXvImageSink--force-aspect-ratio">force-aspect-ratio</link>
|
|
|
|
* property it is possible to enforce scaling with a constant aspect ratio,
|
|
|
|
* which means drawing black borders around the video frame.
|
|
|
|
* </para>
|
|
|
|
* <title>Events</title>
|
|
|
|
* <para>
|
|
|
|
* XvImageSink creates a thread to handle events coming from the drawable. There
|
|
|
|
* are several kind of events that can be grouped in 2 big categories: input
|
|
|
|
* 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>
|
|
|
|
* <title>Pixel aspect ratio</title>
|
|
|
|
* <para>
|
|
|
|
* When changing state to GST_STATE_READY, XvImageSink will open a connection to
|
|
|
|
* the display specified in the
|
|
|
|
* <link linkend="GstXvImageSink--display">display</link> property or the
|
|
|
|
* default display if nothing specified. Once this connection is open it will
|
|
|
|
* inspect the display configuration including the physical display geometry and
|
|
|
|
* then calculate the pixel aspect ratio. When receiving video frames with a
|
|
|
|
* 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
|
|
|
|
* <link linkend="GstXvImageSink--pixel-aspect-ratio">pixel-aspect-ratio</link>
|
|
|
|
* property.
|
|
|
|
* </para>
|
|
|
|
* <title>Examples</title>
|
|
|
|
* <para>
|
|
|
|
* Here is a simple pipeline to test hardware scaling :
|
|
|
|
* <programlisting>
|
|
|
|
* gst-launch -v videotestsrc ! xvimagesink
|
|
|
|
* </programlisting>
|
|
|
|
* When the test video signal appears you can resize the window and see that
|
|
|
|
* video frames are scaled through hardware (no extra CPU cost). You can try
|
|
|
|
* again setting the force-aspect-ratio property to true and observe the borders
|
|
|
|
* drawn around the scaled image respecting aspect ratio.
|
|
|
|
* <programlisting>
|
|
|
|
* gst-launch -v videotestsrc ! xvimagesink force-aspect-ratio=true
|
|
|
|
* </programlisting>
|
|
|
|
* </para>
|
|
|
|
* <para>
|
|
|
|
* Here is a simple pipeline to test navigation events :
|
|
|
|
* <programlisting>
|
|
|
|
* gst-launch -v videotestsrc ! navigationtest ! xvimagesink
|
|
|
|
* </programlisting>
|
|
|
|
* While moving the mouse pointer over the test signal you will see a black box
|
|
|
|
* following the mouse pointer. If you press the mouse button somewhere on the
|
|
|
|
* 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
|
|
|
|
* original video frame geometry so that the box can be drawn to the correct
|
|
|
|
* position. This also handles borders correctly, limiting coordinates to the
|
|
|
|
* image area
|
|
|
|
* </para>
|
|
|
|
* <para>
|
|
|
|
* Here is a simple pipeline to test pixel aspect ratio :
|
|
|
|
* <programlisting>
|
|
|
|
* gst-launch -v videotestsrc ! video/x-raw-yuv, pixel-aspect-ratio=(fraction)4/3 ! xvimagesink
|
|
|
|
* </programlisting>
|
|
|
|
* This is faking a 4/3 pixel aspect ratio caps on video frames produced by
|
|
|
|
* videotestsrc, in most cases the pixel aspect ratio of the display will be
|
|
|
|
* 1/1. This means that XvImageSink will have to do the scaling to convert
|
|
|
|
* incoming frames to a size that will match the display pixel aspect ratio
|
|
|
|
* (from 320x240 to 320x180 in this case). Note that you might have to escape
|
|
|
|
* some characters for your shell like '\(fraction\)'.
|
|
|
|
* </para>
|
|
|
|
* <para>
|
|
|
|
* Here is a test pipeline to test the colorbalance interface :
|
|
|
|
* <programlisting>
|
|
|
|
* gst-launch -v videotestsrc ! xvimagesink hue=100 saturation=-100 brightness=100
|
|
|
|
* </programlisting>
|
|
|
|
* </para>
|
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Our interfaces */
|
2005-06-30 11:58:40 +00:00
|
|
|
#include <gst/interfaces/navigation.h>
|
|
|
|
#include <gst/interfaces/xoverlay.h>
|
|
|
|
#include <gst/interfaces/colorbalance.h>
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* Object header */
|
|
|
|
#include "xvimagesink.h"
|
|
|
|
|
2004-04-20 15:45:07 +00:00
|
|
|
/* Debugging category */
|
|
|
|
#include <gst/gstinfo.h>
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_debug_xvimagesink);
|
|
|
|
#define GST_CAT_DEFAULT gst_debug_xvimagesink
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long functions;
|
|
|
|
unsigned long decorations;
|
|
|
|
long input_mode;
|
|
|
|
unsigned long status;
|
|
|
|
}
|
|
|
|
MotifWmHints, MwmHints;
|
|
|
|
|
|
|
|
#define MWM_HINTS_DECORATIONS (1L << 1)
|
|
|
|
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
static void gst_xvimage_buffer_finalize (GstXvImageBuffer * 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
|
|
|
static void gst_xvimagesink_xwindow_update_geometry (GstXvImageSink *
|
|
|
|
xvimagesink, GstXWindow * xwindow);
|
|
|
|
static gint gst_xvimagesink_get_format_from_caps (GstXvImageSink * xvimagesink,
|
|
|
|
GstCaps * caps);
|
|
|
|
static void gst_xvimagesink_expose (GstXOverlay * overlay);
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
//static void gst_xvimagesink_send_pending_navigation (GstXvImageSink * xvimagesink);
|
2004-01-15 21:05:17 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* ElementFactory information */
|
2004-03-14 22:34:34 +00:00
|
|
|
static GstElementDetails gst_xvimagesink_details =
|
|
|
|
GST_ELEMENT_DETAILS ("Video sink",
|
|
|
|
"Sink/Video",
|
|
|
|
"A Xv based videosink",
|
|
|
|
"Julien Moutte <julien@moutte.net>");
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* Default template - initiated with class struct to allow gst-register to work
|
|
|
|
without X running */
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_xvimagesink_sink_template_factory =
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-raw-rgb, "
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate = (fraction) [ 0, MAX ], "
|
2004-05-05 11:29:49 +00:00
|
|
|
"width = (int) [ 1, MAX ], "
|
|
|
|
"height = (int) [ 1, MAX ]; "
|
2004-03-15 19:32:28 +00:00
|
|
|
"video/x-raw-yuv, "
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate = (fraction) [ 0, MAX ], "
|
2004-05-05 11:29:49 +00:00
|
|
|
"width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]")
|
2004-03-14 22:34:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
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
|
|
|
ARG_0,
|
|
|
|
ARG_CONTRAST,
|
|
|
|
ARG_BRIGHTNESS,
|
|
|
|
ARG_HUE,
|
|
|
|
ARG_SATURATION,
|
2004-01-16 23:52:53 +00:00
|
|
|
ARG_DISPLAY,
|
2004-07-27 16:43:24 +00:00
|
|
|
ARG_SYNCHRONOUS,
|
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
|
|
|
ARG_PIXEL_ASPECT_RATIO,
|
|
|
|
ARG_FORCE_ASPECT_RATIO
|
2004-03-14 22:34:34 +00:00
|
|
|
/* FILL ME */
|
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
|
|
|
};
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
static GstVideoSinkClass *parent_class = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Private Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
/* xvimage buffers */
|
|
|
|
|
|
|
|
#define GST_TYPE_XVIMAGE_BUFFER (gst_xvimage_buffer_get_type())
|
|
|
|
|
|
|
|
#define GST_IS_XVIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XVIMAGE_BUFFER))
|
|
|
|
#define GST_XVIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XVIMAGE_BUFFER, GstXvImageBuffer))
|
|
|
|
|
|
|
|
/* This function destroys a GstXvImage handling XShm availability */
|
|
|
|
static void
|
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
|
|
|
gst_xvimage_buffer_destroy (GstXvImageBuffer * xvimage)
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = xvimage->xvimagesink;
|
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
|
|
|
if (xvimagesink == NULL)
|
|
|
|
goto no_sink;
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
|
|
|
/* If the destroyed image is the current one we destroy our reference too */
|
|
|
|
if (xvimagesink->cur_image == xvimage)
|
|
|
|
xvimagesink->cur_image = NULL;
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
if (xvimagesink->xcontext->use_xshm) {
|
|
|
|
if (xvimage->SHMInfo.shmaddr != ((void *) -1)) {
|
|
|
|
XShmDetach (xvimagesink->xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
shmdt (xvimage->SHMInfo.shmaddr);
|
|
|
|
}
|
|
|
|
if (xvimage->SHMInfo.shmid > 0)
|
|
|
|
shmctl (xvimage->SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
if (xvimage->xvimage)
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
} else
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
{
|
|
|
|
if (xvimage->xvimage) {
|
|
|
|
if (xvimage->xvimage->data) {
|
|
|
|
g_free (xvimage->xvimage->data);
|
|
|
|
}
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
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
|
|
|
|
2005-07-13 13:54:11 +00:00
|
|
|
xvimage->xvimagesink = NULL;
|
|
|
|
gst_object_unref (xvimagesink);
|
|
|
|
|
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
|
|
|
return;
|
|
|
|
|
|
|
|
no_sink:
|
|
|
|
{
|
|
|
|
GST_WARNING ("no sink found");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimage_buffer_finalize (GstXvImageBuffer * xvimage)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = xvimage->xvimagesink;
|
|
|
|
if (xvimagesink == NULL)
|
|
|
|
goto no_sink;
|
|
|
|
|
|
|
|
/* If our geometry changed we can't reuse that image. */
|
|
|
|
if ((xvimage->width != xvimagesink->video_width) ||
|
|
|
|
(xvimage->height != xvimagesink->video_height)) {
|
|
|
|
GST_DEBUG ("destroy image as its size changed %dx%d vs current %dx%d",
|
|
|
|
xvimage->width, xvimage->height,
|
|
|
|
xvimagesink->video_width, xvimagesink->video_height);
|
|
|
|
gst_xvimage_buffer_destroy (xvimage);
|
|
|
|
} else {
|
|
|
|
/* In that case we can reuse the image and add it to our image pool. */
|
|
|
|
GST_DEBUG ("recycling image in pool");
|
|
|
|
/* need to increment the refcount again to recycle */
|
|
|
|
gst_buffer_ref (GST_BUFFER (xvimage));
|
|
|
|
g_mutex_lock (xvimagesink->pool_lock);
|
|
|
|
xvimagesink->image_pool = g_slist_prepend (xvimagesink->image_pool,
|
|
|
|
xvimage);
|
|
|
|
g_mutex_unlock (xvimagesink->pool_lock);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
|
|
|
|
no_sink:
|
|
|
|
{
|
|
|
|
GST_WARNING ("no sink found");
|
|
|
|
return;
|
|
|
|
}
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void
|
|
|
|
gst_xvimage_buffer_free (GstXvImageBuffer * xvimage)
|
|
|
|
{
|
|
|
|
/* make sure it is not recycled */
|
|
|
|
xvimage->width = -1;
|
|
|
|
xvimage->height = -1;
|
|
|
|
gst_buffer_unref (GST_BUFFER (xvimage));
|
|
|
|
}
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
|
|
|
|
static void
|
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
|
|
|
gst_xvimage_buffer_init (GstXvImageBuffer * xvimage, gpointer g_class)
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
{
|
2005-09-08 16:38:30 +00:00
|
|
|
#ifdef HAVE_XSHM
|
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
|
|
|
xvimage->SHMInfo.shmaddr = ((void *) -1);
|
|
|
|
xvimage->SHMInfo.shmid = -1;
|
2005-09-08 16:38:30 +00:00
|
|
|
#endif
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimage_buffer_class_init (gpointer g_class, gpointer class_data)
|
|
|
|
{
|
|
|
|
GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
|
|
|
|
|
|
|
|
mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
|
|
|
|
gst_xvimage_buffer_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
GType
|
|
|
|
gst_xvimage_buffer_get_type (void)
|
|
|
|
{
|
|
|
|
static GType _gst_xvimage_buffer_type;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (_gst_xvimage_buffer_type == 0)) {
|
|
|
|
static const GTypeInfo xvimage_buffer_info = {
|
|
|
|
sizeof (GstBufferClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
gst_xvimage_buffer_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstXvImageBuffer),
|
|
|
|
0,
|
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
|
|
|
(GInstanceInitFunc) gst_xvimage_buffer_init,
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
_gst_xvimage_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
|
|
|
|
"GstXvImageBuffer", &xvimage_buffer_info, 0);
|
|
|
|
}
|
|
|
|
return _gst_xvimage_buffer_type;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* X11 stuff */
|
|
|
|
|
2005-09-08 16:38:30 +00:00
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
static gboolean error_caught = FALSE;
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
static int
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_handle_xerror (Display * display, XErrorEvent * xevent)
|
2004-01-28 00:29:42 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
char error_msg[1024];
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
XGetErrorText (display, xevent->error_code, error_msg, 1024);
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_DEBUG ("xvimagesink failed to use XShm calls. error: %s", error_msg);
|
2004-04-30 10:58:08 +00:00
|
|
|
error_caught = TRUE;
|
2004-01-28 00:29:42 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function checks that it is actually really possible to create an image
|
|
|
|
using XShm */
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_check_xshm_calls (GstXContext * xcontext)
|
2004-01-28 00:29:42 +00:00
|
|
|
{
|
2005-07-13 13:54:11 +00:00
|
|
|
XvImage *xvimage;
|
|
|
|
XShmSegmentInfo SHMInfo;
|
|
|
|
gint size;
|
2004-03-14 22:34:34 +00:00
|
|
|
int (*handler) (Display *, XErrorEvent *);
|
2004-07-15 21:18:11 +00:00
|
|
|
gboolean result = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
g_return_val_if_fail (xcontext != NULL, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
/* Setting an error handler to catch failure */
|
2004-07-15 21:18:11 +00:00
|
|
|
error_caught = FALSE;
|
2004-01-28 00:29:42 +00:00
|
|
|
handler = XSetErrorHandler (gst_xvimagesink_handle_xerror);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
/* Trying to create a 1x1 picture */
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_DEBUG ("XvShmCreateImage of 1x1");
|
2005-07-13 13:54:11 +00:00
|
|
|
xvimage = XvShmCreateImage (xcontext->disp, xcontext->xv_port_id,
|
|
|
|
xcontext->im_format, NULL, 1, 1, &SHMInfo);
|
|
|
|
if (!xvimage) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_WARNING ("could not XvShmCreateImage a 1x1 image");
|
|
|
|
goto beach;
|
|
|
|
}
|
2005-07-13 13:54:11 +00:00
|
|
|
size = xvimage->data_size;
|
2004-01-28 00:29:42 +00:00
|
|
|
|
2005-07-13 13:54:11 +00:00
|
|
|
SHMInfo.shmid = shmget (IPC_PRIVATE, size, IPC_CREAT | 0777);
|
|
|
|
if (SHMInfo.shmid == -1) {
|
|
|
|
GST_WARNING ("could not get shared memory of %d bytes", size);
|
2004-07-27 10:27:53 +00:00
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
2005-07-13 13:54:11 +00:00
|
|
|
SHMInfo.shmaddr = shmat (SHMInfo.shmid, 0, 0);
|
|
|
|
if (SHMInfo.shmaddr == ((void *) -1)) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_WARNING ("Failed to shmat: %s", g_strerror (errno));
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
2005-07-13 13:54:11 +00:00
|
|
|
xvimage->data = SHMInfo.shmaddr;
|
|
|
|
SHMInfo.readOnly = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-07-13 13:54:11 +00:00
|
|
|
if (XShmAttach (xcontext->disp, &SHMInfo) == 0) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_WARNING ("Failed to XShmAttach");
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-01-28 00:29:42 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
/* store whether we succeeded in result and reset error_caught */
|
|
|
|
result = !error_caught;
|
|
|
|
error_caught = FALSE;
|
|
|
|
|
|
|
|
beach:
|
2004-07-15 21:18:11 +00:00
|
|
|
XSetErrorHandler (handler);
|
2005-07-13 13:54:11 +00:00
|
|
|
|
2004-07-15 21:18:11 +00:00
|
|
|
XSync (xcontext->disp, FALSE);
|
2005-07-13 13:54:11 +00:00
|
|
|
if (SHMInfo.shmaddr != ((void *) -1)) {
|
|
|
|
XShmDetach (xcontext->disp, &SHMInfo);
|
|
|
|
XSync (xcontext->disp, FALSE);
|
|
|
|
shmdt (SHMInfo.shmaddr);
|
|
|
|
}
|
|
|
|
if (SHMInfo.shmid > 0)
|
|
|
|
shmctl (SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
if (xvimage)
|
|
|
|
XFree (xvimage);
|
2004-07-15 21:18:11 +00:00
|
|
|
return result;
|
2004-01-28 00:29:42 +00:00
|
|
|
}
|
2005-09-08 16:38:30 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-01-28 00:29:42 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* This function handles GstXvImage creation depending on XShm availability */
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
static GstXvImageBuffer *
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
GstXvImageBuffer *xvimage = 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
|
|
|
GstStructure *structure = NULL;
|
2004-07-27 10:27:53 +00:00
|
|
|
gboolean succeeded = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
xvimage = (GstXvImageBuffer *) gst_mini_object_new (GST_TYPE_XVIMAGE_BUFFER);
|
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
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
|
|
|
if (!gst_structure_get_int (structure, "width", &xvimage->width) ||
|
|
|
|
!gst_structure_get_int (structure, "height", &xvimage->height)) {
|
|
|
|
GST_WARNING ("failed getting geometry from caps %" GST_PTR_FORMAT, caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (xvimagesink, "creating %dx%d", xvimage->width,
|
|
|
|
xvimage->height);
|
|
|
|
|
|
|
|
xvimage->im_format = gst_xvimagesink_get_format_from_caps (xvimagesink, caps);
|
|
|
|
if (!xvimage->im_format) {
|
|
|
|
GST_WARNING_OBJECT (xvimagesink, "failed to get format from caps %"
|
|
|
|
GST_PTR_FORMAT, caps);
|
2005-11-28 10:43:26 +00:00
|
|
|
goto beach_unlocked;
|
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-07-13 13:54:11 +00:00
|
|
|
xvimage->xvimagesink = gst_object_ref (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xcontext->use_xshm) {
|
|
|
|
xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
xvimage->im_format, NULL,
|
|
|
|
xvimage->width, xvimage->height, &xvimage->SHMInfo);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!xvimage->xvimage) {
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("could not XvShmCreateImage a %dx%d image"));
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we have to use the returned data_size for our shm size */
|
2004-07-26 13:00:27 +00:00
|
|
|
xvimage->size = xvimage->xvimage->data_size;
|
2005-01-06 16:08:11 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink, "XShm image size is %d", xvimage->size);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
|
2004-03-15 19:32:28 +00:00
|
|
|
IPC_CREAT | 0777);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (xvimage->SHMInfo.shmid == -1) {
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("could not get shared memory of %d bytes", xvimage->size));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xvimage->SHMInfo.shmaddr = shmat (xvimage->SHMInfo.shmid, 0, 0);
|
Fixes: #151879, #151881, #151882, #151883, #151884, #151886, #151887, #152102, #152247.
Original commit message from CVS:
Fixes: #151879, #151881, #151882, #151883, #151884, #151886,
#151887, #152102, #152247.
* examples/indexing/indexmpeg.c: 64-bit warning fixes.
* examples/seeking/cdparanoia.c: same
* examples/seeking/cdplayer.c: same
* examples/seeking/seek.c: same
* examples/seeking/spider_seek.c: same
* examples/seeking/vorbisfile.c: same
* examples/stats/mp2ogg.c: same
* ext/esd/esdsink.c: (gst_esdsink_class_init),
(gst_esdsink_dispose): Dispose of element properly.
* ext/ivorbis/vorbisfile.c: (gst_ivorbisfile_seek): 64-bit warning
fixes.
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_dispose): Dispose of element correctly.
* gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Fix leak.
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy):
Fix 64-bit warning.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy):
Fix 64-bit warning.
2004-09-12 22:57:27 +00:00
|
|
|
if (xvimage->SHMInfo.shmaddr == ((void *) -1)) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("Failed to shmat: %s", g_strerror (errno)));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
xvimage->xvimage->data = xvimage->SHMInfo.shmaddr;
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimage->SHMInfo.readOnly = FALSE;
|
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
if (XShmAttach (xvimagesink->xcontext->disp, &xvimage->SHMInfo) == 0) {
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("Failed to XShmAttach"));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
} else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
|
|
|
xvimage->xvimage = XvCreateImage (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
xvimage->im_format, NULL, xvimage->width, xvimage->height);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!xvimage->xvimage) {
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("could not XvCreateImage a %dx%d image"));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
/* we have to use the returned data_size for our image size */
|
2004-07-27 10:10:02 +00:00
|
|
|
xvimage->size = xvimage->xvimage->data_size;
|
|
|
|
xvimage->xvimage->data = g_malloc (xvimage->size);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
}
|
2004-07-27 10:27:53 +00:00
|
|
|
succeeded = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
GST_BUFFER_DATA (xvimage) = (guchar *) xvimage->xvimage->data;
|
|
|
|
GST_BUFFER_SIZE (xvimage) = xvimage->size;
|
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
beach:
|
2005-07-06 15:14:38 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
2005-11-28 10:43:26 +00:00
|
|
|
beach_unlocked:
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!succeeded) {
|
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
|
|
|
gst_xvimage_buffer_free (xvimage);
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimage = NULL;
|
|
|
|
}
|
2004-02-17 11:06:52 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return 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
|
|
|
/* We are called with the x_lock taken */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_xwindow_draw_borders (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow, GstVideoRectangle rect)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
|
|
|
|
XSetForeground (xvimagesink->xcontext->disp, xwindow->gc,
|
|
|
|
xvimagesink->xcontext->black);
|
|
|
|
|
|
|
|
/* Left border */
|
|
|
|
if (rect.x > 0) {
|
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
|
|
|
0, 0, rect.x, xwindow->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Right border */
|
|
|
|
if ((rect.x + rect.w) < xwindow->width) {
|
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
|
|
|
rect.x + rect.w, 0, xwindow->width, xwindow->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Top border */
|
|
|
|
if (rect.y > 0) {
|
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
|
|
|
0, 0, xwindow->width, rect.y);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Bottom border */
|
|
|
|
if ((rect.y + rect.h) < xwindow->height) {
|
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
|
|
|
0, rect.y + rect.h, xwindow->width, xwindow->height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* This function puts a GstXvImage on a GstXvImageSink's window */
|
|
|
|
static void
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
|
|
|
|
GstXvImageBuffer * xvimage)
|
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
|
|
|
GstVideoRectangle src, dst, result;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
sys/xvimage/xvimagesink.c: Protect interface methods from chain and negotiation and vice versa (Fixes #166142).
Original commit message from CVS:
2005-02-11 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_sink_link), (gst_xvimagesink_change_state),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_finalize), (gst_xvimagesink_init): Protect interface
methods from chain and negotiation and vice versa (Fixes #166142).
Fix a possible bug of images in the buffer pool being discarded because
we are looking at the wrong geometry.
* sys/xvimage/xvimagesink.h: Add stream_lock.
2005-02-11 22:49:23 +00:00
|
|
|
g_return_if_fail (xvimagesink->xwindow != NULL);
|
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
|
|
|
/* We take the flow_lock. If expose is in there we don't want to run
|
|
|
|
concurrently from the data flow thread */
|
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
/* Store a reference to the last image we put, loose 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) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "unreffing %p", xvimagesink->cur_image);
|
|
|
|
gst_buffer_unref (xvimagesink->cur_image);
|
|
|
|
}
|
2005-11-28 22:13:33 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "reffing %p as our current 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
|
|
|
xvimagesink->cur_image = GST_XVIMAGE_BUFFER (gst_buffer_ref (xvimage));
|
|
|
|
}
|
|
|
|
|
2005-11-27 18:12:23 +00:00
|
|
|
/* Expose sends a NULL image, we take the latest frame */
|
|
|
|
if (!xvimage) {
|
|
|
|
if (xvimagesink->cur_image) {
|
|
|
|
xvimage = xvimagesink->cur_image;
|
|
|
|
} else {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_xwindow_update_geometry (xvimagesink, xvimagesink->xwindow);
|
|
|
|
|
2005-11-28 14:15:54 +00:00
|
|
|
/* We use the calculated geometry from _setcaps as a source to respect
|
|
|
|
source and screen pixel aspect ratios. */
|
|
|
|
src.w = GST_VIDEO_SINK_WIDTH (xvimagesink);
|
|
|
|
src.h = GST_VIDEO_SINK_HEIGHT (xvimagesink);
|
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
|
|
|
dst.w = xvimagesink->xwindow->width;
|
|
|
|
dst.h = xvimagesink->xwindow->height;
|
|
|
|
|
|
|
|
if (xvimagesink->keep_aspect) {
|
|
|
|
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
|
|
|
} else {
|
|
|
|
result.x = result.y = 0;
|
|
|
|
result.w = dst.w;
|
|
|
|
result.h = dst.h;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_xwindow_draw_borders (xvimagesink, xvimagesink->xwindow,
|
|
|
|
result);
|
|
|
|
|
2003-11-12 11:02:31 +00:00
|
|
|
/* We scale to the window's geometry */
|
2003-11-10 18:22:20 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xcontext->use_xshm) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink,
|
|
|
|
"XvShmPutImage with image %dx%d and window %dx%d",
|
|
|
|
xvimage->width, xvimage->height,
|
|
|
|
xvimagesink->xwindow->width, xvimagesink->xwindow->height);
|
2004-03-14 22:34:34 +00:00
|
|
|
XvShmPutImage (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xwindow->win,
|
|
|
|
xvimagesink->xwindow->gc, xvimage->xvimage,
|
|
|
|
0, 0, xvimage->width, xvimage->height,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
result.x, result.y, result.w, result.h, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
|
|
|
XvPutImage (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xwindow->win,
|
|
|
|
xvimagesink->xwindow->gc, xvimage->xvimage,
|
|
|
|
0, 0, xvimage->width, xvimage->height,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
result.x, result.y, result.w, result.h);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_xwindow_decorate (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * window)
|
|
|
|
{
|
|
|
|
Atom hints_atom = None;
|
|
|
|
MotifWmHints *hints;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), FALSE);
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
hints_atom = XInternAtom (xvimagesink->xcontext->disp, "_MOTIF_WM_HINTS", 1);
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
if (hints_atom == None) {
|
2004-07-27 09:35:52 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-06-27 18:53:04 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
hints = g_malloc0 (sizeof (MotifWmHints));
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
hints->flags |= MWM_HINTS_DECORATIONS;
|
|
|
|
hints->decorations = 1 << 0;
|
|
|
|
|
|
|
|
XChangeProperty (xvimagesink->xcontext->disp, window->win,
|
|
|
|
hints_atom, hints_atom, 32, PropModeReplace,
|
|
|
|
(guchar *) hints, sizeof (MotifWmHints) / sizeof (long));
|
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
g_free (hints);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* This function handles a GstXWindow creation
|
|
|
|
* The width and height are the actual pixel size on the display */
|
2003-11-10 18:22:20 +00:00
|
|
|
static GstXWindow *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
|
|
|
|
gint width, gint height)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXWindow *xwindow = NULL;
|
|
|
|
XGCValues values;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
2003-11-17 16:32:29 +00:00
|
|
|
xwindow->internal = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow->win = XCreateSimpleWindow (xvimagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->xcontext->root,
|
|
|
|
0, 0, xwindow->width, xwindow->height,
|
|
|
|
0, 0, xvimagesink->xcontext->black);
|
|
|
|
|
2005-11-14 22:01:22 +00:00
|
|
|
/* We have to do that to prevent X from redrawing the background on
|
|
|
|
* ConfigureNotify. This takes away flickering of video when resizing. */
|
|
|
|
XSetWindowBackgroundPixmap (xvimagesink->xcontext->disp, xwindow->win, None);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
|
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xwindow->win, 0, &values);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XMapRaised (xvimagesink->xcontext->disp, xwindow->win);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
gst_xvimagesink_xwindow_decorate (xvimagesink, xwindow);
|
|
|
|
|
2004-01-29 10:02:48 +00:00
|
|
|
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (xvimagesink), xwindow->win);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return xwindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function destroys a GstXWindow */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_destroy (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* If we did not create that window we just free the GC and let it live */
|
|
|
|
if (xwindow->internal)
|
|
|
|
XDestroyWindow (xvimagesink->xcontext->disp, xwindow->win);
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
else
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XFreeGC (xvimagesink->xcontext->disp, xwindow->gc);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_free (xwindow);
|
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
static void
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * 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
|
|
|
{
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XWindowAttributes attr;
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
/* Update the window geometry */
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
XGetWindowAttributes (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xwindow->win, &attr);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
xvimagesink->xwindow->width = attr.width;
|
|
|
|
xvimagesink->xwindow->height = attr.height;
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_clear (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow)
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-02-05 23:01:59 +00:00
|
|
|
XvStopVideo (xvimagesink->xcontext->disp, xvimagesink->xcontext->xv_port_id,
|
|
|
|
xwindow->win);
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XSetForeground (xvimagesink->xcontext->disp, xwindow->gc,
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->xcontext->black);
|
|
|
|
|
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
|
|
|
XFillRectangle (xvimagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
2004-03-14 22:34:34 +00:00
|
|
|
0, 0, xwindow->width, xwindow->height);
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
/* This function commits our internal colorbalance settings to our grabbed Xv
|
|
|
|
port. If the xcontext is not initialized yet it simply returns */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (GstXvImageSink * xvimagesink)
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
{
|
|
|
|
GList *channels = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
/* If we haven't initialized the X context we can't update anything */
|
|
|
|
if (xvimagesink->xcontext == NULL)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
/* For each channel of the colorbalance we calculate the correct value
|
|
|
|
doing range conversion and then set the Xv port attribute to match our
|
|
|
|
values. */
|
|
|
|
channels = xvimagesink->xcontext->channels_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (channels) {
|
|
|
|
if (channels->data && GST_IS_COLOR_BALANCE_CHANNEL (channels->data)) {
|
|
|
|
GstColorBalanceChannel *channel = NULL;
|
|
|
|
gint value = 0;
|
|
|
|
gdouble convert_coef;
|
|
|
|
|
|
|
|
channel = GST_COLOR_BALANCE_CHANNEL (channels->data);
|
|
|
|
g_object_ref (channel);
|
|
|
|
|
|
|
|
/* Our range conversion coef */
|
|
|
|
convert_coef = (channel->max_value - channel->min_value) / 2000.0;
|
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
2004-03-15 19:32:28 +00:00
|
|
|
value = (xvimagesink->hue + 1000) * convert_coef + channel->min_value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
2004-03-15 19:32:28 +00:00
|
|
|
value = (xvimagesink->saturation + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
2004-03-15 19:32:28 +00:00
|
|
|
value = (xvimagesink->contrast + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
2004-03-15 19:32:28 +00:00
|
|
|
value = (xvimagesink->brightness + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
2004-03-14 22:34:34 +00:00
|
|
|
} else {
|
2004-03-15 19:32:28 +00:00
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
g_object_unref (channel);
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Committing to Xv port */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
XvSetPortAttribute (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
XInternAtom (xvimagesink->xcontext->disp, channel->label, 1), value);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
g_object_unref (channel);
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
channels = g_list_next (channels);
|
|
|
|
}
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* This function handles XEvents that might be in the queue. It generates
|
|
|
|
GstEvent that will be sent upstream in the pipeline to handle interactivity
|
|
|
|
and navigation. It will also listen for configure events on the window to
|
|
|
|
trigger caps renegotiation so on the fly software scaling can work. */
|
|
|
|
static void
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
XEvent e;
|
2004-02-02 21:59:35 +00:00
|
|
|
guint pointer_x = 0, pointer_y = 0;
|
|
|
|
gboolean pointer_moved = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-02 21:59:35 +00:00
|
|
|
/* We get all pointer motion events, only the last position is
|
|
|
|
interesting. */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xwindow->win, PointerMotionMask, &e)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
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
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
2004-02-02 21:59:35 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (pointer_moved) {
|
|
|
|
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);
|
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 */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xwindow->win,
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask,
|
|
|
|
&e)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
KeySym keysym;
|
|
|
|
|
|
|
|
/* We lock only for the X function call */
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case ButtonPress:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Mouse button pressed over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink button %d pressed over window at %d,%d",
|
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
"mouse-button-press", e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
case ButtonRelease:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Mouse button released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink button %d released over window at %d,%d",
|
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
"mouse-button-release", e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
case KeyPress:
|
|
|
|
case KeyRelease:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Key pressed/released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink key %d pressed over window at %d,%d",
|
|
|
|
e.xkey.keycode, e.xkey.x, e.xkey.y);
|
|
|
|
keysym = XKeycodeToKeysym (xvimagesink->xcontext->disp,
|
|
|
|
e.xkey.keycode, 0);
|
|
|
|
if (keysym != NoSymbol) {
|
|
|
|
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
e.type == KeyPress ?
|
|
|
|
"key-press" : "key-release", XKeysymToString (keysym));
|
|
|
|
} else {
|
|
|
|
gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
e.type == KeyPress ? "key-press" : "key-release", "unknown");
|
|
|
|
}
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_DEBUG ("xvimagesink unhandled X event (%d)", e.type);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
/* Handle Expose */
|
|
|
|
{
|
|
|
|
gboolean exposed = FALSE, configured = FALSE;
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xwindow->win, ExposureMask | StructureNotifyMask,
|
|
|
|
&e)) {
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case Expose:
|
|
|
|
exposed = TRUE;
|
|
|
|
break;
|
|
|
|
case ConfigureNotify:
|
|
|
|
configured = TRUE;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
if (exposed || configured) {
|
|
|
|
gst_xvimagesink_expose (GST_X_OVERLAY (xvimagesink));
|
|
|
|
}
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* This function generates a caps with all supported format by the first
|
|
|
|
Xv grabable port we find. We store each one of the supported formats in a
|
2004-07-19 11:21:10 +00:00
|
|
|
format list and append the format to a newly created caps that we return
|
2004-04-17 02:30:28 +00:00
|
|
|
If this function does not return NULL because of an error, it also grabs
|
|
|
|
the port via XvGrabPort */
|
2003-11-10 18:22:20 +00:00
|
|
|
static GstCaps *
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink,
|
|
|
|
GstXContext * xcontext)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
ext/: ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek) (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain) ext...
Original commit message from CVS:
2005-05-09 Andy Wingo <wingo@pobox.com>
* ext/alsa/gstalsasink.h:
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_get_icy_metadata):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
(gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
* ext/theora/theoradec.c (theora_dec_src_query)
(theora_dec_src_event, theora_dec_sink_event)
(theora_handle_comment_packet, theora_handle_data_packet):
* ext/theora/theoraenc.c (theora_enc_chain):
* ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
(vorbis_dec_sink_event, vorbis_handle_comment_packet):
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
* gst/typefind/gsttypefindfunctions.c (mp3_type_find)
(qt_type_find):
* gst/videotestsrc/videotestsrc.c (paint_setup_I420)
(paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
(paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
(paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
(paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
(paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
(paint_setup_xBGR8888, paint_setup_RGBx8888)
(paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
(paint_setup_RGB565, paint_setup_xRGB1555):
* gst/videotestsrc/videotestsrc.h:
* sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
(gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
GCC4 fixes.
* ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
gst_pad_query_position. Fixes oggdemux.
2005-05-09 07:03:13 +00:00
|
|
|
gint i;
|
|
|
|
guint nb_adaptors;
|
2003-11-10 18:22:20 +00:00
|
|
|
XvAdaptorInfo *adaptors;
|
2004-04-17 02:30:28 +00:00
|
|
|
gint nb_formats;
|
|
|
|
XvImageFormatValues *formats = NULL;
|
|
|
|
GstCaps *caps = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (xcontext != NULL, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* First let's check that XVideo extension is available */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!XQueryExtension (xcontext->disp, "XVideo", &i, &i, &i)) {
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS, (NULL),
|
2004-04-17 02:30:28 +00:00
|
|
|
("XVideo extension is not available"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Then we get adaptors list */
|
|
|
|
if (Success != XvQueryAdaptors (xcontext->disp, xcontext->root,
|
2004-03-15 19:32:28 +00:00
|
|
|
&nb_adaptors, &adaptors)) {
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS, (NULL),
|
2004-04-17 02:30:28 +00:00
|
|
|
("Failed getting XV adaptors list"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext->xv_port_id = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/: ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek) (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain) ext...
Original commit message from CVS:
2005-05-09 Andy Wingo <wingo@pobox.com>
* ext/alsa/gstalsasink.h:
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_get_icy_metadata):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
(gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
* ext/theora/theoradec.c (theora_dec_src_query)
(theora_dec_src_event, theora_dec_sink_event)
(theora_handle_comment_packet, theora_handle_data_packet):
* ext/theora/theoraenc.c (theora_enc_chain):
* ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
(vorbis_dec_sink_event, vorbis_handle_comment_packet):
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
* gst/typefind/gsttypefindfunctions.c (mp3_type_find)
(qt_type_find):
* gst/videotestsrc/videotestsrc.c (paint_setup_I420)
(paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
(paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
(paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
(paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
(paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
(paint_setup_xBGR8888, paint_setup_RGBx8888)
(paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
(paint_setup_RGB565, paint_setup_xRGB1555):
* gst/videotestsrc/videotestsrc.h:
* sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
(gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
GCC4 fixes.
* ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
gst_pad_query_position. Fixes oggdemux.
2005-05-09 07:03:13 +00:00
|
|
|
GST_DEBUG ("Found %u XV adaptor(s)", nb_adaptors);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Now search for an adaptor that supports XvImageMask */
|
2004-03-14 22:34:34 +00:00
|
|
|
for (i = 0; i < nb_adaptors && !xcontext->xv_port_id; i++) {
|
|
|
|
if (adaptors[i].type & XvImageMask) {
|
|
|
|
gint j;
|
|
|
|
|
|
|
|
/* We found such an adaptor, looking for an available port */
|
|
|
|
for (j = 0; j < adaptors[i].num_ports && !xcontext->xv_port_id; j++) {
|
2004-03-15 19:32:28 +00:00
|
|
|
/* We try to grab the port */
|
|
|
|
if (Success == XvGrabPort (xcontext->disp, adaptors[i].base_id + j, 0)) {
|
|
|
|
xcontext->xv_port_id = adaptors[i].base_id + j;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
GST_DEBUG ("XV Adaptor %s with %ld ports", adaptors[i].name,
|
2004-03-15 19:32:28 +00:00
|
|
|
adaptors[i].num_ports);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
}
|
2003-12-27 15:37:43 +00:00
|
|
|
XvFreeAdaptorInfo (adaptors);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
if (!xcontext->xv_port_id) {
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, BUSY, (NULL),
|
2004-04-17 02:30:28 +00:00
|
|
|
("No port available"));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-05-21 13:28:24 +00:00
|
|
|
/* Set XV_AUTOPAINT_COLORKEY */
|
|
|
|
{
|
|
|
|
int count;
|
2004-10-26 11:36:53 +00:00
|
|
|
XvAttribute *const attr = XvQueryPortAttributes (xcontext->disp,
|
2004-05-21 13:28:24 +00:00
|
|
|
xcontext->xv_port_id, &count);
|
|
|
|
static const char autopaint[] = "XV_AUTOPAINT_COLORKEY";
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
if (!strcmp (attr[i].name, autopaint)) {
|
|
|
|
const Atom atom = XInternAtom (xcontext->disp, autopaint, False);
|
|
|
|
|
|
|
|
XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom, 1);
|
|
|
|
break;
|
|
|
|
}
|
2004-10-26 11:36:53 +00:00
|
|
|
|
|
|
|
XFree (attr);
|
2004-05-21 13:28:24 +00:00
|
|
|
}
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
/* We get all image formats supported by our port */
|
|
|
|
formats = XvListImageFormats (xcontext->disp,
|
|
|
|
xcontext->xv_port_id, &nb_formats);
|
|
|
|
caps = gst_caps_new_empty ();
|
|
|
|
for (i = 0; i < nb_formats; i++) {
|
|
|
|
GstCaps *format_caps = NULL;
|
|
|
|
|
|
|
|
/* We set the image format of the xcontext to an existing one. Sink
|
|
|
|
connect method will override that but we need to have at least a
|
|
|
|
valid image format so that we can make our xshm calls check before
|
|
|
|
caps negotiation really happens. */
|
|
|
|
xcontext->im_format = formats[i].id;
|
|
|
|
|
|
|
|
switch (formats[i].type) {
|
|
|
|
case XvRGB:
|
|
|
|
{
|
|
|
|
format_caps = gst_caps_new_simple ("video/x-raw-rgb",
|
|
|
|
"endianness", G_TYPE_INT, xcontext->endianness,
|
|
|
|
"depth", G_TYPE_INT, xcontext->depth,
|
|
|
|
"bpp", G_TYPE_INT, xcontext->bpp,
|
|
|
|
"blue_mask", G_TYPE_INT, formats[i].red_mask,
|
|
|
|
"green_mask", G_TYPE_INT, formats[i].green_mask,
|
|
|
|
"red_mask", G_TYPE_INT, formats[i].blue_mask,
|
2004-05-05 11:29:49 +00:00
|
|
|
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
2004-04-17 02:30:28 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2004-04-17 02:30:28 +00:00
|
|
|
case XvYUV:
|
|
|
|
format_caps = gst_caps_new_simple ("video/x-raw-yuv",
|
|
|
|
"format", GST_TYPE_FOURCC, formats[i].id,
|
2004-05-05 11:29:49 +00:00
|
|
|
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
|
2004-04-17 02:30:28 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (format_caps) {
|
|
|
|
GstXvImageFormat *format = NULL;
|
|
|
|
|
|
|
|
format = g_new0 (GstXvImageFormat, 1);
|
|
|
|
if (format) {
|
|
|
|
format->format = formats[i].id;
|
|
|
|
format->caps = gst_caps_copy (format_caps);
|
|
|
|
xcontext->formats_list = g_list_append (xcontext->formats_list, format);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_caps_append (caps, format_caps);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
if (formats)
|
|
|
|
XFree (formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
GST_DEBUG ("Generated the following caps: %" GST_PTR_FORMAT, caps);
|
|
|
|
|
|
|
|
if (gst_caps_is_empty (caps)) {
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_caps_unref (caps);
|
2004-04-17 02:30:28 +00:00
|
|
|
XvUngrabPort (xcontext->disp, xcontext->xv_port_id, 0);
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, STREAM, WRONG_TYPE, (NULL),
|
2004-04-17 02:30:28 +00:00
|
|
|
("No supported format found"));
|
|
|
|
return NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
return caps;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
static gpointer
|
|
|
|
gst_xvimagesink_event_thread (GstXvImageSink * xvimagesink)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
|
|
|
|
|
|
|
while (xvimagesink->running) {
|
|
|
|
if (xvimagesink->xwindow) {
|
|
|
|
gst_xvimagesink_handle_xevents (xvimagesink);
|
|
|
|
}
|
|
|
|
g_usleep (50000);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* This function calculates the pixel aspect ratio based on the properties
|
|
|
|
* in the xcontext structure and stores it there. */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_calculate_pixel_aspect_ratio (GstXContext * xcontext)
|
|
|
|
{
|
|
|
|
gint par[][2] = {
|
|
|
|
{1, 1}, /* regular screen */
|
|
|
|
{16, 15}, /* PAL TV */
|
|
|
|
{11, 10}, /* 525 line Rec.601 video */
|
|
|
|
{54, 59} /* 625 line Rec.601 video */
|
|
|
|
};
|
|
|
|
gint i;
|
|
|
|
gint index;
|
|
|
|
gdouble ratio;
|
|
|
|
gdouble delta;
|
|
|
|
|
|
|
|
#define DELTA(idx) (ABS (ratio - ((gdouble) par[idx][0] / par[idx][1])))
|
|
|
|
|
|
|
|
/* first calculate the "real" ratio based on the X values;
|
|
|
|
* which is the "physical" w/h divided by the w/h in pixels of the display */
|
2004-08-03 14:09:26 +00:00
|
|
|
ratio = (gdouble) (xcontext->widthmm * xcontext->height)
|
2004-07-27 16:43:24 +00:00
|
|
|
/ (xcontext->heightmm * xcontext->width);
|
2004-08-03 14:09:26 +00:00
|
|
|
|
2004-08-02 10:04:08 +00:00
|
|
|
/* DirectFB's X in 720x576 reports the physical dimensions wrong, so
|
|
|
|
* override here */
|
|
|
|
if (xcontext->width == 720 && xcontext->height == 576) {
|
|
|
|
ratio = 4.0 * 576 / (3.0 * 720);
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG ("calculated pixel aspect ratio: %f", ratio);
|
|
|
|
/* now find the one from par[][2] with the lowest delta to the real one */
|
|
|
|
delta = DELTA (0);
|
|
|
|
index = 0;
|
|
|
|
|
|
|
|
for (i = 1; i < sizeof (par) / (sizeof (gint) * 2); ++i) {
|
|
|
|
gdouble this_delta = DELTA (i);
|
|
|
|
|
|
|
|
if (this_delta < delta) {
|
|
|
|
index = i;
|
|
|
|
delta = this_delta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG ("Decided on index %d (%d/%d)", index,
|
|
|
|
par[index][0], par[index][1]);
|
|
|
|
|
2004-08-02 10:04:08 +00:00
|
|
|
g_free (xcontext->par);
|
|
|
|
xcontext->par = g_new0 (GValue, 1);
|
|
|
|
g_value_init (xcontext->par, GST_TYPE_FRACTION);
|
|
|
|
gst_value_set_fraction (xcontext->par, par[index][0], par[index][1]);
|
|
|
|
GST_DEBUG ("set xcontext PAR to %d/%d",
|
|
|
|
gst_value_get_fraction_numerator (xcontext->par),
|
|
|
|
gst_value_get_fraction_denominator (xcontext->par));
|
2004-07-27 16:43:24 +00:00
|
|
|
}
|
|
|
|
|
2004-07-19 11:21:10 +00:00
|
|
|
/* This function gets the X Display and global info about it. Everything is
|
2003-11-10 18:22:20 +00:00
|
|
|
stored in our object and will be cleaned when the object is disposed. Note
|
2004-07-19 11:21:10 +00:00
|
|
|
here that caps for supported format are generated without any window or
|
2003-11-10 18:22:20 +00:00
|
|
|
image creation */
|
|
|
|
static GstXContext *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXContext *xcontext = NULL;
|
|
|
|
XPixmapFormatValues *px_formats = NULL;
|
2004-01-13 17:57:25 +00:00
|
|
|
gint nb_formats = 0, i, j, N_attr;
|
|
|
|
XvAttribute *xv_attr;
|
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
|
|
|
char *channels[4] = { "XV_HUE", "XV_SATURATION",
|
2004-03-14 22:34:34 +00:00
|
|
|
"XV_BRIGHTNESS", "XV_CONTRAST"
|
|
|
|
};
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext = g_new0 (GstXContext, 1);
|
2004-05-04 14:17:25 +00:00
|
|
|
xcontext->im_format = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xcontext->disp = XOpenDisplay (xvimagesink->display_name);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!xcontext->disp) {
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, (NULL),
|
2004-03-15 19:32:28 +00:00
|
|
|
("Could not open display"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext->screen = DefaultScreenOfDisplay (xcontext->disp);
|
|
|
|
xcontext->screen_num = DefaultScreen (xcontext->disp);
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->visual = DefaultVisual (xcontext->disp, xcontext->screen_num);
|
2003-11-10 18:22:20 +00:00
|
|
|
xcontext->root = DefaultRootWindow (xcontext->disp);
|
|
|
|
xcontext->white = XWhitePixel (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->black = XBlackPixel (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->depth = DefaultDepthOfScreen (xcontext->screen);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
xcontext->width = DisplayWidth (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->height = DisplayHeight (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->widthmm = DisplayWidthMM (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->heightmm = DisplayHeightMM (xcontext->disp, xcontext->screen_num);
|
|
|
|
|
2004-08-03 08:48:29 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "X reports %dx%d pixels and %d mm x %d mm",
|
|
|
|
xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
|
|
|
|
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
gst_xvimagesink_calculate_pixel_aspect_ratio (xcontext);
|
2003-11-10 18:22:20 +00:00
|
|
|
/* We get supported pixmap formats at supported depth */
|
|
|
|
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!px_formats) {
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS, (NULL),
|
2004-04-17 02:30:28 +00:00
|
|
|
("Could not get pixel formats"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* We get bpp value corresponding to our running depth */
|
2004-03-14 22:34:34 +00:00
|
|
|
for (i = 0; i < nb_formats; i++) {
|
|
|
|
if (px_formats[i].depth == xcontext->depth)
|
|
|
|
xcontext->bpp = px_formats[i].bits_per_pixel;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XFree (px_formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xcontext->endianness =
|
|
|
|
(ImageByteOrder (xcontext->disp) ==
|
|
|
|
LSBFirst) ? G_LITTLE_ENDIAN : G_BIG_ENDIAN;
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* our caps system handles 24/32bpp RGB as big-endian. */
|
|
|
|
if ((xcontext->bpp == 24 || xcontext->bpp == 32) &&
|
|
|
|
xcontext->endianness == G_LITTLE_ENDIAN) {
|
|
|
|
xcontext->endianness = G_BIG_ENDIAN;
|
|
|
|
xcontext->visual->red_mask = GUINT32_TO_BE (xcontext->visual->red_mask);
|
|
|
|
xcontext->visual->green_mask = GUINT32_TO_BE (xcontext->visual->green_mask);
|
|
|
|
xcontext->visual->blue_mask = GUINT32_TO_BE (xcontext->visual->blue_mask);
|
|
|
|
if (xcontext->bpp == 24) {
|
|
|
|
xcontext->visual->red_mask >>= 8;
|
|
|
|
xcontext->visual->green_mask >>= 8;
|
|
|
|
xcontext->visual->blue_mask >>= 8;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
xcontext->caps = gst_xvimagesink_get_xv_support (xvimagesink, xcontext);
|
2004-01-13 17:57:25 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!xcontext->caps) {
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
2004-04-17 02:30:28 +00:00
|
|
|
/* GST_ELEMENT_ERROR is thrown by gst_xvimagesink_get_xv_support */
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2004-01-28 00:29:42 +00:00
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
/* Search for XShm extension support */
|
|
|
|
if (XShmQueryExtension (xcontext->disp) &&
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_check_xshm_calls (xcontext)) {
|
|
|
|
xcontext->use_xshm = TRUE;
|
|
|
|
GST_DEBUG ("xvimagesink is using XShm extension");
|
2004-04-17 02:30:28 +00:00
|
|
|
} else
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->use_xshm = FALSE;
|
|
|
|
GST_DEBUG ("xvimagesink is not using XShm extension");
|
|
|
|
}
|
|
|
|
|
2004-01-13 17:57:25 +00:00
|
|
|
xv_attr = XvQueryPortAttributes (xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->xv_port_id, &N_attr);
|
|
|
|
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
/* Generate the channels list */
|
2004-03-14 22:34:34 +00:00
|
|
|
for (i = 0; i < (sizeof (channels) / sizeof (char *)); i++) {
|
|
|
|
XvAttribute *matching_attr = NULL;
|
|
|
|
|
|
|
|
if (xv_attr != NULL) {
|
|
|
|
for (j = 0; j < N_attr && matching_attr == NULL; ++j)
|
2004-03-15 19:32:28 +00:00
|
|
|
if (!g_ascii_strcasecmp (channels[i], xv_attr[j].name))
|
|
|
|
matching_attr = xv_attr + j;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (matching_attr) {
|
|
|
|
GstColorBalanceChannel *channel;
|
|
|
|
|
|
|
|
channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL);
|
|
|
|
channel->label = g_strdup (channels[i]);
|
|
|
|
channel->min_value = matching_attr ? matching_attr->min_value : -1000;
|
|
|
|
channel->max_value = matching_attr ? matching_attr->max_value : 1000;
|
|
|
|
|
|
|
|
xcontext->channels_list = g_list_append (xcontext->channels_list,
|
2004-03-15 19:32:28 +00:00
|
|
|
channel);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
/* If the colorbalance settings have not been touched we get Xv values
|
|
|
|
as defaults and update our internal variables */
|
|
|
|
if (!xvimagesink->cb_changed) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gint val;
|
|
|
|
|
|
|
|
XvGetPortAttribute (xcontext->disp, xcontext->xv_port_id,
|
|
|
|
XInternAtom (xcontext->disp, channel->label, 1), &val);
|
|
|
|
/* Normalize val to [-1000, 1000] */
|
|
|
|
val = -1000 + 2000 * (val - channel->min_value) /
|
|
|
|
(channel->max_value - channel->min_value);
|
|
|
|
|
|
|
|
if (!g_ascii_strcasecmp (channels[i], "XV_HUE"))
|
|
|
|
xvimagesink->hue = val;
|
|
|
|
else if (!g_ascii_strcasecmp (channels[i], "XV_SATURATION"))
|
|
|
|
xvimagesink->saturation = val;
|
|
|
|
else if (!g_ascii_strcasecmp (channels[i], "XV_BRIGHTNESS"))
|
|
|
|
xvimagesink->brightness = val;
|
|
|
|
else if (!g_ascii_strcasecmp (channels[i], "XV_CONTRAST"))
|
|
|
|
xvimagesink->contrast = val;
|
2004-01-16 23:52:53 +00:00
|
|
|
}
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2004-01-13 17:57:25 +00:00
|
|
|
|
|
|
|
if (xv_attr)
|
|
|
|
XFree (xv_attr);
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
|
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
|
|
|
/* Setup our event listening thread */
|
|
|
|
xvimagesink->event_thread = g_thread_create (
|
|
|
|
(GThreadFunc) gst_xvimagesink_event_thread, xvimagesink, TRUE, NULL);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return xcontext;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function cleans the X context. Closing the Display, releasing the XV
|
|
|
|
port and unrefing the caps for supported formats. */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xcontext_clear (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
GList *formats_list, *channels_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-11-08 14:31:55 +00:00
|
|
|
g_return_if_fail (xvimagesink->xcontext != NULL);
|
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
|
|
|
/* Wait for our event thread */
|
|
|
|
if (xvimagesink->event_thread) {
|
|
|
|
g_thread_join (xvimagesink->event_thread);
|
|
|
|
xvimagesink->event_thread = NULL;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
formats_list = xvimagesink->xcontext->formats_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (formats_list) {
|
|
|
|
GstXvImageFormat *format = formats_list->data;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_caps_unref (format->caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_free (format);
|
|
|
|
formats_list = g_list_next (formats_list);
|
|
|
|
}
|
|
|
|
|
2003-11-28 21:47:51 +00:00
|
|
|
if (xvimagesink->xcontext->formats_list)
|
|
|
|
g_list_free (xvimagesink->xcontext->formats_list);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
channels_list = xvimagesink->xcontext->channels_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (channels_list) {
|
|
|
|
GstColorBalanceChannel *channel = channels_list->data;
|
|
|
|
|
|
|
|
g_object_unref (channel);
|
|
|
|
channels_list = g_list_next (channels_list);
|
|
|
|
}
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
if (xvimagesink->xcontext->channels_list)
|
|
|
|
g_list_free (xvimagesink->xcontext->channels_list);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_caps_unref (xvimagesink->xcontext->caps);
|
2004-08-02 10:04:08 +00:00
|
|
|
g_free (xvimagesink->xcontext->par);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XvUngrabPort (xvimagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->xcontext->xv_port_id, 0);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
XCloseDisplay (xvimagesink->xcontext->disp);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-10-26 11:36:53 +00:00
|
|
|
g_free (xvimagesink->xcontext);
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->xcontext = NULL;
|
|
|
|
}
|
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_imagepool_clear (GstXvImageSink * xvimagesink)
|
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-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (xvimagesink->pool_lock);
|
|
|
|
|
|
|
|
while (xvimagesink->image_pool) {
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
GstXvImageBuffer *xvimage = xvimagesink->image_pool->data;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xvimagesink->image_pool = g_slist_delete_link (xvimagesink->image_pool,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->image_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
|
|
|
gst_xvimage_buffer_free (xvimage);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->pool_lock);
|
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
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Element stuff */
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* This function tries to get a format matching with a given caps in the
|
|
|
|
supported list of formats we generated in gst_xvimagesink_get_xv_support */
|
2003-11-28 21:47:51 +00:00
|
|
|
static gint
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
gst_xvimagesink_get_format_from_caps (GstXvImageSink * xvimagesink,
|
2004-03-14 22:34:34 +00:00
|
|
|
GstCaps * caps)
|
2003-11-28 21:47:51 +00:00
|
|
|
{
|
|
|
|
GList *list = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-28 21:47:51 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-28 21:47:51 +00:00
|
|
|
list = xvimagesink->xcontext->formats_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (list) {
|
|
|
|
GstXvImageFormat *format = list->data;
|
|
|
|
|
|
|
|
if (format) {
|
|
|
|
GstCaps *icaps = NULL;
|
|
|
|
|
|
|
|
icaps = gst_caps_intersect (caps, format->caps);
|
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 (!gst_caps_is_empty (icaps)) {
|
|
|
|
gst_caps_unref (icaps);
|
2004-03-15 19:32:28 +00:00
|
|
|
return format->format;
|
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-28 21:47:51 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
list = g_list_next (list);
|
|
|
|
}
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
return 0;
|
2003-11-28 21:47:51 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
static GstCaps *
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_xvimagesink_getcaps (GstBaseSink * bsink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
if (xvimagesink->xcontext)
|
2005-03-31 09:43:49 +00:00
|
|
|
return gst_caps_ref (xvimagesink->xcontext->caps);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return
|
2005-07-10 12:03:58 +00:00
|
|
|
gst_caps_copy (gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD
|
2005-03-31 09:43:49 +00:00
|
|
|
(xvimagesink)));
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
2005-10-24 17:04:01 +00:00
|
|
|
GstCaps *intersection;
|
ext/: ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek) (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain) ext...
Original commit message from CVS:
2005-05-09 Andy Wingo <wingo@pobox.com>
* ext/alsa/gstalsasink.h:
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_get_icy_metadata):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
(gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
* ext/theora/theoradec.c (theora_dec_src_query)
(theora_dec_src_event, theora_dec_sink_event)
(theora_handle_comment_packet, theora_handle_data_packet):
* ext/theora/theoraenc.c (theora_enc_chain):
* ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
(vorbis_dec_sink_event, vorbis_handle_comment_packet):
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
* gst/typefind/gsttypefindfunctions.c (mp3_type_find)
(qt_type_find):
* gst/videotestsrc/videotestsrc.c (paint_setup_I420)
(paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
(paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
(paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
(paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
(paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
(paint_setup_xBGR8888, paint_setup_RGBx8888)
(paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
(paint_setup_RGB565, paint_setup_xRGB1555):
* gst/videotestsrc/videotestsrc.h:
* sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
(gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
GCC4 fixes.
* ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
gst_pad_query_position. Fixes oggdemux.
2005-05-09 07:03:13 +00:00
|
|
|
guint32 im_format = 0;
|
2003-12-22 01:47:09 +00:00
|
|
|
gboolean ret;
|
2004-07-27 16:43:24 +00:00
|
|
|
gint video_width, video_height;
|
|
|
|
gint video_par_n, video_par_d; /* video's PAR */
|
|
|
|
gint display_par_n, display_par_d; /* display's PAR */
|
|
|
|
GValue display_ratio = { 0, }; /* display w/h ratio */
|
|
|
|
const GValue *caps_par;
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
const GValue *fps;
|
2004-07-27 16:43:24 +00:00
|
|
|
gint num, den;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
sys/ximage/ximagesink.c: Protect interface methods from chain and negotiation and vice versa (Fixes #166142).
Original commit message from CVS:
2005-02-12 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_sink_link), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id),
(gst_ximagesink_expose), (gst_ximagesink_set_property),
(gst_ximagesink_finalize), (gst_ximagesink_init): Protect interface
methods from chain and negotiation and vice versa (Fixes #166142).
* sys/ximage/ximagesink.h: Add stream_lock.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose): Check for xcontext before trying to link.
2005-02-12 18:41:49 +00:00
|
|
|
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
configure.ac: In the output at the end, don't show the first plugin on the same line as "Core plug-ins, always built:".
Original commit message from CVS:
* configure.ac:
In the output at the end, don't show the first plugin on the same
line as "Core plug-ins, always built:".
Indent the output as for other plugin categories
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create):
#define that can be used to not use peer buffer_alloc functions for
test purposes.
* sys/ximage/ximagesink.c: (gst_ximage_buffer_init),
(gst_ximage_buffer_get_type), (gst_ximagesink_ximage_new),
(gst_ximagesink_show_frame):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_init),
(gst_xvimage_buffer_get_type), (gst_xvimagesink_setcaps),
(gst_xvimagesink_show_frame):
Error case handling fixes. gst-launch fakesrc ! x[v]imagesink now
fails gracefully instead of XError aborting or deadlocking.
2005-09-06 23:26:49 +00:00
|
|
|
"In setcaps. Possible caps %" GST_PTR_FORMAT ", setting caps %"
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_PTR_FORMAT, xvimagesink->xcontext->caps, caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-10-24 17:04:01 +00:00
|
|
|
intersection = gst_caps_intersect (xvimagesink->xcontext->caps, caps);
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "intersection returned %" GST_PTR_FORMAT,
|
|
|
|
intersection);
|
|
|
|
if (gst_caps_is_empty (intersection)) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_caps_unref (intersection);
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-07-27 16:43:24 +00:00
|
|
|
ret = gst_structure_get_int (structure, "width", &video_width);
|
|
|
|
ret &= gst_structure_get_int (structure, "height", &video_height);
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
fps = gst_structure_get_value (structure, "framerate");
|
|
|
|
ret &= (fps != NULL);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!ret)
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
sys/xvimage/xvimagesink.c: Protect interface methods from chain and negotiation and vice versa (Fixes #166142).
Original commit message from CVS:
2005-02-11 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_sink_link), (gst_xvimagesink_change_state),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_finalize), (gst_xvimagesink_init): Protect interface
methods from chain and negotiation and vice versa (Fixes #166142).
Fix a possible bug of images in the buffer pool being discarded because
we are looking at the wrong geometry.
* sys/xvimage/xvimagesink.h: Add stream_lock.
2005-02-11 22:49:23 +00:00
|
|
|
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
xvimagesink->fps_n = gst_value_get_fraction_numerator (fps);
|
|
|
|
xvimagesink->fps_d = gst_value_get_fraction_denominator (fps);
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
xvimagesink->video_width = video_width;
|
|
|
|
xvimagesink->video_height = video_height;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
im_format = gst_xvimagesink_get_format_from_caps (xvimagesink, caps);
|
2004-05-04 14:17:25 +00:00
|
|
|
if (im_format == 0) {
|
2005-03-31 09:43:49 +00:00
|
|
|
return FALSE;
|
2004-01-02 10:04:34 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
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
|
|
|
|
* using wd / hd = wv / hv * PARv / PARd
|
|
|
|
* the ratio wd / hd will be stored in display_ratio */
|
|
|
|
g_value_init (&display_ratio, GST_TYPE_FRACTION);
|
|
|
|
|
|
|
|
/* get video's PAR */
|
|
|
|
caps_par = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
|
|
|
if (caps_par) {
|
|
|
|
video_par_n = gst_value_get_fraction_numerator (caps_par);
|
|
|
|
video_par_d = gst_value_get_fraction_denominator (caps_par);
|
|
|
|
} else {
|
|
|
|
video_par_n = 1;
|
|
|
|
video_par_d = 1;
|
|
|
|
}
|
|
|
|
/* get display's PAR */
|
2004-08-02 10:04:08 +00:00
|
|
|
if (xvimagesink->par) {
|
|
|
|
display_par_n = gst_value_get_fraction_numerator (xvimagesink->par);
|
|
|
|
display_par_d = gst_value_get_fraction_denominator (xvimagesink->par);
|
|
|
|
} else {
|
|
|
|
display_par_n = 1;
|
|
|
|
display_par_d = 1;
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
|
|
|
|
gst_value_set_fraction (&display_ratio,
|
|
|
|
video_width * video_par_n * display_par_d,
|
|
|
|
video_height * video_par_d * display_par_n);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
num = gst_value_get_fraction_numerator (&display_ratio);
|
|
|
|
den = gst_value_get_fraction_denominator (&display_ratio);
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"video width/height: %dx%d, calculated display ratio: %d/%d",
|
|
|
|
video_width, video_height, num, den);
|
|
|
|
|
|
|
|
/* now find a width x height that respects this display ratio.
|
|
|
|
* prefer those that have one of w/h the same as the incoming video
|
|
|
|
* using wd / hd = num / den */
|
|
|
|
|
|
|
|
/* start with same height, because of interlaced video */
|
|
|
|
/* check hd / den is an integer scale factor, and scale wd with the PAR */
|
|
|
|
if (video_height % den == 0) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video height");
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = video_height * num / den;
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height;
|
2004-07-27 16:43:24 +00:00
|
|
|
} else if (video_width % num == 0) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video width");
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = video_width;
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_width * den / num;
|
2004-07-27 16:43:24 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "approximating while keeping video height");
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink) = video_height * num / den;
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height;
|
2004-07-27 16:43:24 +00:00
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "scaling to %dx%d",
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink), GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-22 11:13:49 +00:00
|
|
|
/* Notify application to set xwindow id now */
|
|
|
|
if (!xvimagesink->xwindow) {
|
|
|
|
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (xvimagesink));
|
|
|
|
}
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* Creating our window and our image with the display size in pixels */
|
2005-07-10 12:03:58 +00:00
|
|
|
g_assert (GST_VIDEO_SINK_WIDTH (xvimagesink) > 0);
|
|
|
|
g_assert (GST_VIDEO_SINK_HEIGHT (xvimagesink) > 0);
|
2003-11-10 18:22:20 +00:00
|
|
|
if (!xvimagesink->xwindow)
|
2004-10-08 11:26:49 +00:00
|
|
|
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
|
2005-07-10 12:03:58 +00:00
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* We renew our xvimage only if size or format changed;
|
|
|
|
* the xvimage is the same size as the video pixel size */
|
2004-05-04 14:17:25 +00:00
|
|
|
if ((xvimagesink->xvimage) &&
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
((im_format != xvimagesink->xvimage->im_format) ||
|
2004-07-27 16:43:24 +00:00
|
|
|
(video_width != xvimagesink->xvimage->width) ||
|
|
|
|
(video_height != xvimagesink->xvimage->height))) {
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
2005-11-21 13:32:36 +00:00
|
|
|
"old format %" GST_FOURCC_FORMAT ", new format %" GST_FOURCC_FORMAT,
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_FOURCC_ARGS (xvimagesink->xcontext->im_format),
|
|
|
|
GST_FOURCC_ARGS (im_format));
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "renewing xvimage");
|
2005-11-28 22:13:33 +00:00
|
|
|
gst_buffer_unref (GST_BUFFER (xvimagesink->xvimage));
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
xvimagesink->xvimage = NULL;
|
2004-05-04 14:17:25 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
xvimagesink->xcontext->im_format = im_format;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return TRUE;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2005-11-15 19:01:43 +00:00
|
|
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
2003-11-10 18:22:20 +00:00
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (element);
|
|
|
|
|
2005-09-02 15:43:18 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
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 = TRUE;
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Initializing the XContext */
|
2004-04-17 02:30:28 +00:00
|
|
|
if (!xvimagesink->xcontext &&
|
|
|
|
!(xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink)))
|
2005-09-02 15:43:18 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-08-02 10:04:08 +00:00
|
|
|
/* update object's par with calculated one if not set yet */
|
|
|
|
if (!xvimagesink->par) {
|
|
|
|
xvimagesink->par = g_new0 (GValue, 1);
|
|
|
|
gst_value_init_and_copy (xvimagesink->par, xvimagesink->xcontext->par);
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "set calculated PAR on object's PAR");
|
|
|
|
}
|
2004-07-19 11:33:32 +00:00
|
|
|
/* call XSynchronize with the current value of synchronous */
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "XSynchronize called with %s",
|
|
|
|
xvimagesink->synchronous ? "TRUE" : "FALSE");
|
|
|
|
XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous);
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2005-03-31 09:43:49 +00:00
|
|
|
if (xvimagesink->xwindow)
|
|
|
|
gst_xvimagesink_xwindow_clear (xvimagesink, xvimagesink->xwindow);
|
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;
|
2005-11-15 19:01:43 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
if (ret == GST_STATE_CHANGE_FAILURE)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
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;
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
2005-09-02 15:43:18 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_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
|
|
|
xvimagesink->running = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xvimage) {
|
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
|
|
|
gst_xvimage_buffer_free (xvimagesink->xvimage);
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->xvimage = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
if (xvimagesink->image_pool)
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_imagepool_clear (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (xvimagesink->xwindow) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
|
|
|
xvimagesink->xwindow = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimagesink->xcontext) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_xcontext_clear (xvimagesink);
|
|
|
|
xvimagesink->xcontext = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
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;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
|
|
|
|
GstClockTime * start, GstClockTime * end)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-14 11:42:16 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2003-12-14 05:10:28 +00:00
|
|
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
2005-03-31 09:43:49 +00:00
|
|
|
*start = GST_BUFFER_TIMESTAMP (buf);
|
|
|
|
if (GST_BUFFER_DURATION_IS_VALID (buf)) {
|
|
|
|
*end = *start + GST_BUFFER_DURATION (buf);
|
|
|
|
} else {
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
if (xvimagesink->fps_n > 0) {
|
|
|
|
*end = *start + (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
|
|
|
|
gst_xvimagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
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 this buffer has been allocated using our buffer management we simply
|
|
|
|
put the ximage which is in the PRIVATE pointer */
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
if (GST_IS_XVIMAGE_BUFFER (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
|
|
|
GST_DEBUG ("fast put of bufferpool buffer");
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, GST_XVIMAGE_BUFFER (buf));
|
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 {
|
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
|
|
|
GST_DEBUG ("slow copy into bufferpool buffer");
|
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... */
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
if (!xvimagesink->xvimage) {
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "creating our xvimage");
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
xvimagesink->xvimage = gst_xvimagesink_xvimage_new (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
|
|
|
GST_BUFFER_CAPS (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
|
|
|
|
|
|
|
if (!xvimagesink->xvimage)
|
|
|
|
goto no_image;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
|
|
|
|
memcpy (xvimagesink->xvimage->xvimage->data,
|
|
|
|
GST_BUFFER_DATA (buf),
|
|
|
|
MIN (GST_BUFFER_SIZE (buf), xvimagesink->xvimage->size));
|
Leak fixes in oggdemux.
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain),
(gst_ogg_demux_submit_buffer), (gst_ogg_demux_get_data),
(gst_ogg_demux_chain_unlocked):
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
(gst_audio_convert_caps_remove_format_info),
(gst_audio_convert_getcaps), (gst_audio_convert_setcaps),
(gst_audio_convert_fixate), (gst_audio_convert_change_state):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_init),
(gst_ffmpegcsp_bufferalloc), (gst_ffmpegcsp_chain),
(gst_ffmpegcsp_change_state), (gst_ffmpegcsp_set_property),
(gst_ffmpegcsp_get_property):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
(gst_xvimage_buffer_finalize), (gst_xvimage_buffer_free),
(gst_xvimage_buffer_class_init), (gst_xvimage_buffer_get_type),
(gst_xvimagesink_check_xshm_calls), (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_put), (gst_xvimagesink_imagepool_clear),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc), (gst_xvimagesink_set_xwindow_id):
Leak fixes in oggdemux.
Some cleanups in audioconvert.
Make passthrough work along with buffer_alloc etc.
Make buffer_alloc and buffer recycling actually work in
xvimagesink.
2005-05-17 17:41:32 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, xvimagesink->xvimage);
|
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
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
return GST_FLOW_OK;
|
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 */
|
|
|
|
no_image:
|
|
|
|
{
|
|
|
|
/* No image available. That's very bad ! */
|
2005-07-06 15:14:38 +00:00
|
|
|
GST_DEBUG ("could not create image");
|
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
|
|
|
GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL),
|
|
|
|
("Failed creating an XvImage in xvimagesink chain function."));
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
2005-03-31 09:43:49 +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
|
|
|
/* Buffer management */
|
|
|
|
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* 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_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
static GstFlowReturn
|
2005-03-31 09:43:49 +00:00
|
|
|
gst_xvimagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* 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_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
GstCaps * caps, GstBuffer ** buf)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
GstXvImageBuffer *xvimage = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (bsink);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->pool_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-08-02 10:04:08 +00:00
|
|
|
/* Walking through the pool cleaning unusable images and searching for a
|
2003-11-10 18:22:20 +00:00
|
|
|
suitable one */
|
2005-03-31 09:43:49 +00:00
|
|
|
while (xvimagesink->image_pool) {
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimage = xvimagesink->image_pool->data;
|
|
|
|
|
|
|
|
if (xvimage) {
|
|
|
|
/* Removing from the pool */
|
|
|
|
xvimagesink->image_pool = g_slist_delete_link (xvimagesink->image_pool,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimagesink->image_pool);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
/* We check for geometry or image format changes */
|
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
|
|
|
if ((xvimage->width != xvimagesink->video_width) ||
|
|
|
|
(xvimage->height != xvimagesink->video_height) ||
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
(xvimage->im_format != xvimagesink->xcontext->im_format)) {
|
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
|
|
|
/* This image is unusable. Destroying... */
|
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
|
|
|
gst_xvimage_buffer_free (xvimage);
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimage = NULL;
|
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 found a suitable image */
|
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
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "found usable image in pool");
|
2004-03-15 19:32:28 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->pool_lock);
|
2004-03-14 22:34:34 +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
|
|
|
if (!xvimage) {
|
|
|
|
/* We found no suitable image in the pool. Creating... */
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "no usable image in pool, creating 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
|
|
|
xvimage = gst_xvimagesink_xvimage_new (xvimagesink, caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
if (xvimage) {
|
sys/: Port xvimagesink to new MiniObject.
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_finalize),
(gst_xvimage_buffer_init), (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):
* sys/xvimage/xvimagesink.h:
Port xvimagesink to new MiniObject.
2005-05-17 12:00:42 +00:00
|
|
|
gst_buffer_set_caps (GST_BUFFER (xvimage), caps);
|
|
|
|
}
|
Cleanups and buffer alloc.
Original commit message from CVS:
* ext/ogg/README:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_clear_chains):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page):
* ext/theora/theoradec.c: (theora_dec_src_query),
(theora_handle_data_packet):
* ext/theora/theoraenc.c: (theora_buffer_from_packet),
(theora_enc_chain):
* ext/vorbis/vorbisdec.c: (vorbis_dec_sink_event),
(vorbis_handle_data_packet):
* gst/audioconvert/bufferframesconvert.c:
(buffer_frames_convert_chain):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_getcaps), (gst_ffmpegcsp_configure_context),
(gst_ffmpegcsp_setcaps), (gst_ffmpegcsp_bufferalloc),
(gst_ffmpegcsp_chain):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_getcaps), (gst_videorate_setcaps),
(gst_videorate_event), (gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_activate),
(gst_videotestsrc_src_query), (gst_videotestsrc_loop):
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps), (gst_ximagesink_buffer_alloc):
* 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_xvimage_new), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
Cleanups and buffer alloc.
2005-06-02 09:46:40 +00:00
|
|
|
*buf = GST_BUFFER (xvimage);
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* Interfaces stuff */
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_interface_supported (GstImplementsInterface * iface, GType type)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
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_assert (type == GST_TYPE_NAVIGATION ||
|
2004-03-14 22:34:34 +00:00
|
|
|
type == GST_TYPE_X_OVERLAY || type == GST_TYPE_COLOR_BALANCE);
|
2003-11-17 16:32:29 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_interface_init (GstImplementsInterfaceClass * klass)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
klass->supported = gst_xvimagesink_interface_supported;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
|
|
|
|
GstStructure * structure)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (navigation);
|
2005-11-11 17:41:04 +00:00
|
|
|
GstPad *peer;
|
2005-01-09 00:07:30 +00:00
|
|
|
|
2005-11-11 17:41:04 +00:00
|
|
|
if ((peer = gst_pad_get_peer (GST_VIDEO_SINK_PAD (xvimagesink)))) {
|
|
|
|
GstEvent *event;
|
2005-11-22 10:09:54 +00:00
|
|
|
GstVideoRectangle src, dst, result;
|
2005-11-11 17:41:04 +00:00
|
|
|
gdouble x, y, xscale = 1.0, yscale = 1.0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-22 10:09:54 +00:00
|
|
|
event = gst_event_new_navigation (structure);
|
2005-11-11 17:41:04 +00:00
|
|
|
|
2005-11-22 10:09:54 +00:00
|
|
|
/* We take the flow_lock while we look at the window */
|
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
if (!xvimagesink->xwindow) {
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-11-28 14:32:48 +00:00
|
|
|
/* We get the frame position using the calculated geometry from _setcaps
|
|
|
|
that respect pixel aspect ratios */
|
2005-11-22 10:09:54 +00:00
|
|
|
src.w = GST_VIDEO_SINK_WIDTH (xvimagesink);
|
|
|
|
src.h = GST_VIDEO_SINK_HEIGHT (xvimagesink);
|
|
|
|
dst.w = xvimagesink->xwindow->width;
|
|
|
|
dst.h = xvimagesink->xwindow->height;
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
|
|
|
|
|
|
|
if (xvimagesink->keep_aspect) {
|
|
|
|
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
|
|
|
} else {
|
|
|
|
result.x = result.y = 0;
|
|
|
|
result.w = dst.w;
|
|
|
|
result.h = dst.h;
|
2005-11-11 17:41:04 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
|
2005-11-28 14:32:48 +00:00
|
|
|
/* We calculate scaling using the original video frames geometry to include
|
|
|
|
pixel aspect ratio scaling. */
|
|
|
|
xscale = (gdouble) xvimagesink->video_width / result.w;
|
|
|
|
yscale = (gdouble) xvimagesink->video_height / result.h;
|
2005-11-22 10:09:54 +00:00
|
|
|
|
2005-11-11 17:41:04 +00:00
|
|
|
/* Converting pointer coordinates to the non scaled geometry */
|
|
|
|
if (gst_structure_get_double (structure, "pointer_x", &x)) {
|
2005-11-22 10:09:54 +00:00
|
|
|
x = MIN (x, result.x + result.w);
|
|
|
|
x = MAX (x - result.x, 0);
|
2005-11-11 17:41:04 +00:00
|
|
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
|
|
|
|
(gdouble) x * xscale, NULL);
|
|
|
|
}
|
|
|
|
if (gst_structure_get_double (structure, "pointer_y", &y)) {
|
2005-11-22 10:09:54 +00:00
|
|
|
y = MIN (y, result.y + result.h);
|
|
|
|
y = MAX (y - result.y, 0);
|
2005-11-11 17:41:04 +00:00
|
|
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
|
|
|
|
(gdouble) y * yscale, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_pad_send_event (peer, event);
|
|
|
|
gst_object_unref (peer);
|
|
|
|
}
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_navigation_init (GstNavigationInterface * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
iface->send_event = gst_xvimagesink_navigation_send_event;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
GstXWindow *xwindow = NULL;
|
|
|
|
XWindowAttributes attr;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
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 */
|
|
|
|
if (xvimagesink->xwindow && (xwindow_id == xvimagesink->xwindow->win))
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If the element has not initialized the X11 context try to do so */
|
2004-04-17 02:30:28 +00:00
|
|
|
if (!xvimagesink->xcontext &&
|
|
|
|
!(xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink)))
|
|
|
|
/* we have thrown a GST_ELEMENT_ERROR now */
|
2004-03-14 22:34:34 +00:00
|
|
|
return;
|
2004-04-17 02:30:28 +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
|
|
|
g_mutex_lock (xvimagesink->flow_lock);
|
|
|
|
|
2004-04-17 02:30:28 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* Clear image pool as the images are unusable anyway */
|
|
|
|
gst_xvimagesink_imagepool_clear (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
|
|
|
/* Clear the xvimage */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xvimage) {
|
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
|
|
|
gst_xvimage_buffer_free (xvimagesink->xvimage);
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->xvimage = 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 a window is there already we destroy it */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xwindow) {
|
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If the xid is 0 we go back to an internal window */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xwindow_id == 0) {
|
|
|
|
/* If no width/height caps nego did not happen window will be created
|
|
|
|
during caps nego then */
|
2005-07-10 12:03:58 +00:00
|
|
|
if (GST_VIDEO_SINK_WIDTH (xvimagesink)
|
|
|
|
&& GST_VIDEO_SINK_HEIGHT (xvimagesink)) {
|
|
|
|
xwindow =
|
|
|
|
gst_xvimagesink_xwindow_new (xvimagesink,
|
|
|
|
GST_VIDEO_SINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEO_SINK_HEIGHT (xvimagesink));
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
} else {
|
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
|
|
|
|
|
|
|
xwindow->win = xwindow_id;
|
|
|
|
|
|
|
|
/* We get window geometry, set the event we want to receive,
|
|
|
|
and create a GC */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
XGetWindowAttributes (xvimagesink->xcontext->disp, xwindow->win, &attr);
|
|
|
|
xwindow->width = attr.width;
|
|
|
|
xwindow->height = attr.height;
|
|
|
|
xwindow->internal = FALSE;
|
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
|
2004-03-15 19:32:28 +00:00
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
xwindow->win, 0, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
|
|
|
|
if (xwindow)
|
|
|
|
xvimagesink->xwindow = xwindow;
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->flow_lock);
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_expose (GstXOverlay * overlay)
|
2004-02-03 23:05:46 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
2004-02-16 23:45:55 +00:00
|
|
|
|
|
|
|
if (!xvimagesink->xwindow)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-11-27 18:12:23 +00:00
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, NULL);
|
2004-02-03 23:05:46 +00:00
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xoverlay_init (GstXOverlayClass * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
iface->set_xwindow_id = gst_xvimagesink_set_xwindow_id;
|
2004-02-03 23:05:46 +00:00
|
|
|
iface->expose = gst_xvimagesink_expose;
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
static const GList *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_list_channels (GstColorBalance * balance)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
if (xvimagesink->xcontext)
|
|
|
|
return xvimagesink->xcontext->channels_list;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_set_value (GstColorBalance * balance,
|
|
|
|
GstColorBalanceChannel * channel, gint value)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
g_return_if_fail (channel->label != NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
xvimagesink->cb_changed = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
/* Normalize val to [-1000, 1000] */
|
|
|
|
value = -1000 + 2000 * (value - channel->min_value) /
|
2004-03-14 22:34:34 +00:00
|
|
|
(channel->max_value - channel->min_value);
|
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
|
|
|
xvimagesink->hue = value;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
|
|
|
xvimagesink->saturation = value;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
|
|
|
xvimagesink->contrast = value;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
|
|
|
xvimagesink->brightness = value;
|
|
|
|
} else {
|
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_get_value (GstColorBalance * balance,
|
|
|
|
GstColorBalanceChannel * channel)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
gint value = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), 0);
|
|
|
|
g_return_val_if_fail (channel->label != NULL, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) {
|
|
|
|
value = xvimagesink->hue;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0) {
|
|
|
|
value = xvimagesink->saturation;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0) {
|
|
|
|
value = xvimagesink->contrast;
|
|
|
|
} else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0) {
|
|
|
|
value = xvimagesink->brightness;
|
|
|
|
} else {
|
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
}
|
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
/* Normalize val to [channel->min_value, channel->max_value] */
|
|
|
|
value = channel->min_value + (channel->max_value - channel->min_value) *
|
2004-03-14 22:34:34 +00:00
|
|
|
(value + 1000) / 2000;
|
|
|
|
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_colorbalance_init (GstColorBalanceClass * iface)
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
{
|
2004-01-14 17:15:34 +00:00
|
|
|
GST_COLOR_BALANCE_TYPE (iface) = GST_COLOR_BALANCE_HARDWARE;
|
gst-libs/gst/colorbalance/colorbalancechannel.c: Adding safety check in dispose method.
Original commit message from CVS:
2004-01-12 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/colorbalance/colorbalancechannel.c:
(gst_color_balance_channel_dispose): Adding safety check in dispose
method.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_interface_supported),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_colorbalance_init), (gst_xvimagesink_get_type):
Adding colorbalance interface support to set XV parameters such as
HUE, BRIGHTNESS, CONTRAST, SATURATION.
* sys/xvimage/xvimagesink.h: Adding the channels list for colorbalance
interface.
2004-01-12 19:50:29 +00:00
|
|
|
iface->list_channels = gst_xvimagesink_colorbalance_list_channels;
|
|
|
|
iface->set_value = gst_xvimagesink_colorbalance_set_value;
|
|
|
|
iface->get_value = gst_xvimagesink_colorbalance_get_value;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* =========================================== */
|
|
|
|
/* */
|
|
|
|
/* Init & Class init */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_HUE:
|
|
|
|
xvimagesink->hue = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
|
|
|
case ARG_CONTRAST:
|
|
|
|
xvimagesink->contrast = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
|
|
|
case ARG_BRIGHTNESS:
|
|
|
|
xvimagesink->brightness = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
|
|
|
case ARG_SATURATION:
|
|
|
|
xvimagesink->saturation = g_value_get_int (value);
|
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
|
|
|
break;
|
|
|
|
case ARG_DISPLAY:
|
|
|
|
xvimagesink->display_name = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
|
|
|
case ARG_SYNCHRONOUS:
|
|
|
|
xvimagesink->synchronous = g_value_get_boolean (value);
|
|
|
|
if (xvimagesink->xcontext) {
|
2004-03-15 19:32:28 +00:00
|
|
|
XSynchronize (xvimagesink->xcontext->disp, xvimagesink->synchronous);
|
2004-07-19 11:33:32 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "XSynchronize called with %s",
|
|
|
|
xvimagesink->synchronous ? "TRUE" : "FALSE");
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-07-27 16:43:24 +00:00
|
|
|
case ARG_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;
|
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
|
|
|
case ARG_FORCE_ASPECT_RATIO:
|
|
|
|
xvimagesink->keep_aspect = g_value_get_boolean (value);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_HUE:
|
|
|
|
g_value_set_int (value, xvimagesink->hue);
|
|
|
|
break;
|
|
|
|
case ARG_CONTRAST:
|
|
|
|
g_value_set_int (value, xvimagesink->contrast);
|
|
|
|
break;
|
|
|
|
case ARG_BRIGHTNESS:
|
|
|
|
g_value_set_int (value, xvimagesink->brightness);
|
|
|
|
break;
|
|
|
|
case ARG_SATURATION:
|
|
|
|
g_value_set_int (value, xvimagesink->saturation);
|
|
|
|
break;
|
|
|
|
case ARG_DISPLAY:
|
|
|
|
g_value_set_string (value, g_strdup (xvimagesink->display_name));
|
|
|
|
break;
|
|
|
|
case ARG_SYNCHRONOUS:
|
|
|
|
g_value_set_boolean (value, xvimagesink->synchronous);
|
|
|
|
break;
|
2004-07-27 16:43:24 +00:00
|
|
|
case ARG_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;
|
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
|
|
|
case ARG_FORCE_ASPECT_RATIO:
|
|
|
|
g_value_set_boolean (value, xvimagesink->keep_aspect);
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
/* Finalize is called only once, dispose can be called multiple times.
|
|
|
|
* We use mutexes and don't reset stuff to NULL here so let's register
|
|
|
|
* as a finalize. */
|
2003-11-10 18:22:20 +00:00
|
|
|
static void
|
2004-06-17 14:15:23 +00:00
|
|
|
gst_xvimagesink_finalize (GObject * object)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->display_name) {
|
|
|
|
g_free (xvimagesink->display_name);
|
|
|
|
xvimagesink->display_name = NULL;
|
|
|
|
}
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
|
2004-11-08 14:31:55 +00:00
|
|
|
if (xvimagesink->par) {
|
|
|
|
g_free (xvimagesink->par);
|
|
|
|
xvimagesink->par = NULL;
|
|
|
|
}
|
|
|
|
if (xvimagesink->x_lock) {
|
|
|
|
g_mutex_free (xvimagesink->x_lock);
|
|
|
|
xvimagesink->x_lock = NULL;
|
|
|
|
}
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
if (xvimagesink->flow_lock) {
|
|
|
|
g_mutex_free (xvimagesink->flow_lock);
|
|
|
|
xvimagesink->flow_lock = NULL;
|
|
|
|
}
|
2004-11-08 14:31:55 +00:00
|
|
|
if (xvimagesink->pool_lock) {
|
|
|
|
g_mutex_free (xvimagesink->pool_lock);
|
|
|
|
xvimagesink->pool_lock = NULL;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_init (GstXvImageSink * xvimagesink)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xvimagesink->display_name = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->xcontext = NULL;
|
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
xvimagesink->xvimage = NULL;
|
2004-02-03 23:05:46 +00:00
|
|
|
xvimagesink->cur_image = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/xvimage/xvimagesink.c: Implementing correct colorbalance properties. They can now be set when the element is stil...
Original commit message from CVS:
2004-01-16 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_xcontext_get), (gst_xvimagesink_change_state),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_init), (gst_xvimagesink_class_init): Implementing
correct colorbalance properties. They can now be set when the element
is still in NULL state. The values will be committed to the Xv Port
when xcontext is initialized.
* sys/xvimage/xvimagesink.h: Added hue, saturation, contrast,
brightness int values in the GstXvImagesink structure.
2004-01-16 15:43:35 +00:00
|
|
|
xvimagesink->hue = xvimagesink->saturation = 0;
|
|
|
|
xvimagesink->contrast = xvimagesink->brightness = 0;
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
xvimagesink->cb_changed = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
Convert elements to use fractions for their framerate.
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
(gst_visual_chain):
* ext/ogg/gstogmparse.c: (gst_ogm_parse_chain):
* ext/theora/theoradec.c: (theora_handle_type_packet):
* ext/theora/theoraenc.c: (theora_enc_sink_setcaps),
(theora_enc_chain):
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
* gst-libs/gst/video/video.c: (gst_video_frame_rate):
* gst-libs/gst/video/video.h:
* gst/ffmpegcolorspace/avcodec.h:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_caps_to_pixfmt):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_set_caps):
* gst/videorate/gstvideorate.c: (gst_videorate_transformcaps),
(gst_videorate_setcaps), (gst_videorate_blank_data),
(gst_videorate_chain):
* gst/videotestsrc/gstvideotestsrc.c:
(gst_videotestsrc_src_fixate), (gst_videotestsrc_getcaps),
(gst_videotestsrc_parse_caps), (gst_videotestsrc_setcaps),
(gst_videotestsrc_event), (gst_videotestsrc_create):
* gst/videotestsrc/gstvideotestsrc.h:
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_setcaps), (gst_ximagesink_change_state),
(gst_ximagesink_get_times), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_setcaps), (gst_xvimagesink_change_state),
(gst_xvimagesink_get_times), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Convert elements to use fractions for their framerate.
V4L elements to come later tonight.
2005-11-22 16:08:37 +00:00
|
|
|
xvimagesink->fps_n = 0;
|
|
|
|
xvimagesink->fps_d = 0;
|
Adding a first version of directfbvideosink.
Original commit message from CVS:
2004-11-28 Julien MOUTTE <julien@moutte.net>
* configure.ac:
* ext/Makefile.am:
* ext/directfb/Makefile.am:
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_create),
(gst_directfbvideosink_get_pixel_format),
(gst_directfbvideosink_get_format_from_fourcc),
(gst_directfbvideosink_fixate), (gst_directfbvideosink_getcaps),
(gst_directfbvideosink_sink_link),
(gst_directfbvideosink_change_state),
(gst_directfbvideosink_chain), (gst_directfbvideosink_buffer_free),
(gst_directfbvideosink_buffer_alloc),
(gst_directfbvideosink_interface_supported),
(gst_directfbvideosink_interface_init),
(gst_directfbvideosink_navigation_send_event),
(gst_directfbvideosink_navigation_init),
(gst_directfbvideosink_set_property),
(gst_directfbvideosink_get_property),
(gst_directfbvideosink_finalize), (gst_directfbvideosink_init),
(gst_directfbvideosink_base_init),
(gst_directfbvideosink_class_init),
(gst_directfbvideosink_get_type), (plugin_init):
* ext/directfb/directfbvideosink.h: Adding a first version of
directfbvideosink.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_init): Initializing some
more.
2004-11-28 19:08:45 +00:00
|
|
|
xvimagesink->video_width = 0;
|
|
|
|
xvimagesink->video_height = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->x_lock = g_mutex_new ();
|
sys/ximage/ximagesink.c: Add debug macros on functions.
Original commit message from CVS:
2005-11-22 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_event_thread),
(gst_ximagesink_class_init): Add debug macros on functions.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_draw_borders),
(gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_update_geometry),
(gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support),
(gst_xvimagesink_event_thread), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_format_from_caps),
(gst_xvimagesink_setcaps),
(gst_xvimagesink_change_state), (gst_xvimagesink_show_frame),
(gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_expose), (gst_xvimagesink_set_property),
(gst_xvimagesink_get_property), (gst_xvimagesink_finalize),
(gst_xvimagesink_init), (gst_xvimagesink_class_init):
* sys/xvimage/xvimagesink.h: Refactoring to handle aspect ratio,
expose while being PAUSED, out of data flow navigation events,
etc..
2005-11-22 09:18:56 +00:00
|
|
|
xvimagesink->flow_lock = g_mutex_new ();
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->image_pool = NULL;
|
|
|
|
xvimagesink->pool_lock = g_mutex_new ();
|
|
|
|
|
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;
|
|
|
|
xvimagesink->keep_aspect = FALSE;
|
2004-08-02 10:04:08 +00:00
|
|
|
xvimagesink->par = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
gst_element_class_set_details (element_class, &gst_xvimagesink_details);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_xvimagesink_sink_template_factory));
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
2005-03-31 09:43:49 +00:00
|
|
|
GstBaseSinkClass *gstbasesink_class;
|
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;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-07-10 12:03:58 +00:00
|
|
|
parent_class = g_type_class_ref (GST_TYPE_VIDEO_SINK);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gobject_class->set_property = gst_xvimagesink_set_property;
|
|
|
|
gobject_class->get_property = gst_xvimagesink_get_property;
|
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_CONTRAST,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("contrast", "Contrast", "The contrast of the video",
|
2004-03-15 19:32:28 +00:00
|
|
|
-1000, 1000, 0, G_PARAM_READWRITE));
|
2004-03-14 22:34:34 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_BRIGHTNESS,
|
|
|
|
g_param_spec_int ("brightness", "Brightness",
|
2004-03-15 19:32:28 +00:00
|
|
|
"The brightness of the video", -1000, 1000, 0, G_PARAM_READWRITE));
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_HUE,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("hue", "Hue", "The hue of the video", -1000, 1000, 0,
|
2004-03-15 19:32:28 +00:00
|
|
|
G_PARAM_READWRITE));
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_SATURATION,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_int ("saturation", "Saturation",
|
2004-03-15 19:32:28 +00:00
|
|
|
"The saturation of the video", -1000, 1000, 0, G_PARAM_READWRITE));
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_DISPLAY,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_string ("display", "Display", "X Display name", NULL,
|
2004-03-15 19:32:28 +00:00
|
|
|
G_PARAM_READWRITE));
|
2004-01-16 23:52:53 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_SYNCHRONOUS,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_boolean ("synchronous", "Synchronous",
|
2004-03-15 19:32:28 +00:00
|
|
|
"When enabled, runs "
|
|
|
|
"the X display in synchronous mode. (used only for debugging)", FALSE,
|
|
|
|
G_PARAM_READWRITE));
|
2004-07-27 16:43:24 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_PIXEL_ASPECT_RATIO,
|
|
|
|
g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio",
|
|
|
|
"The pixel aspect ratio of the device", "1/1", G_PARAM_READWRITE));
|
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_object_class_install_property (gobject_class, ARG_FORCE_ASPECT_RATIO,
|
|
|
|
g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio",
|
|
|
|
"When enabled, scaling will respect original aspect ratio", FALSE,
|
|
|
|
G_PARAM_READWRITE));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
gobject_class->finalize = gst_xvimagesink_finalize;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gstelement_class->change_state =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_xvimagesink_change_state);
|
|
|
|
|
|
|
|
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_getcaps);
|
|
|
|
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_xvimagesink_setcaps);
|
|
|
|
gstbasesink_class->buffer_alloc =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_xvimagesink_buffer_alloc);
|
|
|
|
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_xvimagesink_get_times);
|
|
|
|
gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame);
|
|
|
|
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Public Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
/* =========================================== */
|
|
|
|
/* */
|
|
|
|
/* Object typing & Creation */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
|
|
|
|
|
|
|
GType
|
|
|
|
gst_xvimagesink_get_type (void)
|
|
|
|
{
|
|
|
|
static GType xvimagesink_type = 0;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!xvimagesink_type) {
|
|
|
|
static const GTypeInfo xvimagesink_info = {
|
|
|
|
sizeof (GstXvImageSinkClass),
|
|
|
|
gst_xvimagesink_base_init,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_xvimagesink_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstXvImageSink),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_xvimagesink_init,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo iface_info = {
|
|
|
|
(GInterfaceInitFunc) gst_xvimagesink_interface_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo navigation_info = {
|
|
|
|
(GInterfaceInitFunc) gst_xvimagesink_navigation_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo overlay_info = {
|
|
|
|
(GInterfaceInitFunc) gst_xvimagesink_xoverlay_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo colorbalance_info = {
|
|
|
|
(GInterfaceInitFunc) gst_xvimagesink_colorbalance_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
2005-07-10 12:03:58 +00:00
|
|
|
xvimagesink_type = g_type_register_static (GST_TYPE_VIDEO_SINK,
|
2004-03-15 19:32:28 +00:00
|
|
|
"GstXvImageSink", &xvimagesink_info, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
g_type_add_interface_static (xvimagesink_type,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_TYPE_IMPLEMENTS_INTERFACE, &iface_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_type_add_interface_static (xvimagesink_type, GST_TYPE_NAVIGATION,
|
2004-03-15 19:32:28 +00:00
|
|
|
&navigation_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_type_add_interface_static (xvimagesink_type, GST_TYPE_X_OVERLAY,
|
2004-03-15 19:32:28 +00:00
|
|
|
&overlay_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_type_add_interface_static (xvimagesink_type, GST_TYPE_COLOR_BALANCE,
|
2004-03-15 19:32:28 +00:00
|
|
|
&colorbalance_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return xvimagesink_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
if (!gst_element_register (plugin, "xvimagesink",
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_RANK_PRIMARY, GST_TYPE_XVIMAGESINK))
|
2003-11-10 18:22:20 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2004-04-20 15:45:07 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_debug_xvimagesink, "xvimagesink", 0,
|
|
|
|
"xvimagesink element");
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"xvimagesink",
|
|
|
|
"XFree86 video output plugin using Xv extension",
|
2005-10-16 13:54:44 +00:00
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|