2003-11-10 18:22:20 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2003> Julien Moutte <julien@moutte.net>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Our interfaces */
|
2003-11-22 04:06:50 +00:00
|
|
|
#include <gst/navigation/navigation.h>
|
|
|
|
#include <gst/xoverlay/xoverlay.h>
|
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
|
|
|
#include <gst/colorbalance/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)
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void gst_xvimagesink_buffer_free (GstBuffer * buffer);
|
2004-07-27 10:27:53 +00:00
|
|
|
static void gst_xvimagesink_xvimage_destroy (GstXvImageSink * xvimagesink,
|
|
|
|
GstXvImage * xvimage);
|
|
|
|
|
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, "
|
2004-07-16 10:33:27 +00:00
|
|
|
"framerate = (double) [ 0.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, "
|
2004-07-16 10:33:27 +00:00
|
|
|
"framerate = (double) [ 0.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,
|
|
|
|
ARG_PIXEL_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;
|
2004-04-30 10:58:08 +00:00
|
|
|
static gboolean error_caught = FALSE;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Private Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
/* X11 stuff */
|
|
|
|
|
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
|
|
|
{
|
2004-07-15 21:18:11 +00:00
|
|
|
#ifndef HAVE_XSHM
|
|
|
|
return FALSE;
|
|
|
|
#else
|
2004-01-28 00:29:42 +00:00
|
|
|
GstXvImage *xvimage = NULL;
|
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
|
|
|
xvimage = g_new0 (GstXvImage, 1);
|
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
|
|
|
g_return_val_if_fail (xvimage != 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");
|
2004-01-28 00:29:42 +00:00
|
|
|
xvimage->xvimage = XvShmCreateImage (xcontext->disp, xcontext->xv_port_id,
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->im_format, NULL, 1, 1, &xvimage->SHMInfo);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!xvimage->xvimage) {
|
|
|
|
GST_WARNING ("could not XvShmCreateImage a 1x1 image");
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
xvimage->size = xvimage->xvimage->data_size;
|
2004-01-28 00:29:42 +00:00
|
|
|
|
|
|
|
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
|
2004-03-14 22:34:34 +00:00
|
|
|
IPC_CREAT | 0777);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (xvimage->SHMInfo.shmid == -1) {
|
|
|
|
GST_WARNING ("could not get shared memory of %d bytes", xvimage->size);
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
xvimage->SHMInfo.shmaddr = shmat (xvimage->SHMInfo.shmid, 0, 0);
|
2004-07-27 10:27:53 +00:00
|
|
|
if ((int) xvimage->SHMInfo.shmaddr == -1) {
|
|
|
|
GST_WARNING ("Failed to shmat: %s", g_strerror (errno));
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
xvimage->xvimage->data = xvimage->SHMInfo.shmaddr;
|
|
|
|
xvimage->SHMInfo.readOnly = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
if (XShmAttach (xcontext->disp, &xvimage->SHMInfo) == 0) {
|
|
|
|
GST_WARNING ("Failed to XShmAttach");
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-01-28 00:29:42 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
XSync (xcontext->disp, 0);
|
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
XShmDetach (xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
shmdt (xvimage->SHMInfo.shmaddr);
|
|
|
|
shmctl (xvimage->SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
if (xvimage->xvimage)
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
g_free (xvimage);
|
|
|
|
XSync (xcontext->disp, FALSE);
|
|
|
|
return result;
|
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +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 */
|
|
|
|
static GstXvImage *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink,
|
|
|
|
gint width, gint height)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImage *xvimage = 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);
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "creating %dx%d", width, height);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimage = g_new0 (GstXvImage, 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimage->width = width;
|
|
|
|
xvimage->height = 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;
|
2004-01-11 22:52:29 +00:00
|
|
|
xvimage->xvimagesink = 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;
|
|
|
|
GST_DEBUG_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);
|
2004-07-27 10:27:53 +00:00
|
|
|
if ((int) xvimage->SHMInfo.shmaddr == -1) {
|
|
|
|
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;
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
beach:
|
|
|
|
if (!succeeded) {
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, 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;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
/* This function destroys a GstXvImage handling XShm availability */
|
2003-11-10 18:22:20 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xvimage_destroy (GstXvImageSink * xvimagesink,
|
|
|
|
GstXvImage * xvimage)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xvimage != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
/* If the destroyed image is the current one we destroy our reference too */
|
|
|
|
if (xvimagesink->cur_image == xvimage)
|
|
|
|
xvimagesink->cur_image = NULL;
|
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
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xcontext->use_xshm) {
|
2004-07-27 10:27:53 +00:00
|
|
|
if ((int) xvimage->SHMInfo.shmaddr != -1) {
|
2004-03-14 22:34:34 +00:00
|
|
|
XShmDetach (xvimagesink->xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
shmdt (xvimage->SHMInfo.shmaddr);
|
2004-07-27 10:27:53 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimage->SHMInfo.shmid > 0)
|
|
|
|
shmctl (xvimage->SHMInfo.shmid, IPC_RMID, 0);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (xvimage->xvimage)
|
|
|
|
XFree (xvimage->xvimage);
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
{
|
2004-07-15 21:18:11 +00:00
|
|
|
if (xvimage->xvimage) {
|
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->xvimage->data) {
|
|
|
|
g_free (xvimage->xvimage->data);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
XFree (xvimage->xvimage);
|
2004-07-15 21:18:11 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2003-11-26 10:12:05 +00:00
|
|
|
|
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
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
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_free (xvimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function puts a GstXvImage on a GstXvImageSink's window */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstXvImage * xvimage)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xvimage != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
/* Store a reference to the last image we put */
|
|
|
|
if (xvimagesink->cur_image != xvimage)
|
|
|
|
xvimagesink->cur_image = xvimage;
|
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-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,
|
|
|
|
0, 0, xvimagesink->xwindow->width, xvimagesink->xwindow->height, 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,
|
|
|
|
0, 0, xvimagesink->xwindow->width, xvimagesink->xwindow->height);
|
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-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);
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* This function resizes a GstXWindow.
|
|
|
|
* The width and height are the actual pixel size on the display. */
|
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
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xwindow_resize (GstXvImageSink * xvimagesink,
|
|
|
|
GstXWindow * xwindow, guint width, guint 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_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
2004-03-14 22:34:34 +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
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +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
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
2004-03-14 22:34:34 +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
|
|
|
XResizeWindow (xvimagesink->xcontext->disp, xwindow->win,
|
2004-03-14 22:34:34 +00:00
|
|
|
xwindow->width, xwindow->height);
|
|
|
|
|
|
|
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
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
|
|
|
|
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
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink, GstPad * pad)
|
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),
|
2004-03-15 19:32:28 +00:00
|
|
|
"mouse-move", 0, pointer_x, pointer_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,
|
|
|
|
StructureNotifyMask | 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 ConfigureNotify:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Window got resized or moved. We update our data. */
|
|
|
|
GST_DEBUG ("xvimagesink window is at %d, %d with geometry : %d,%d",
|
|
|
|
e.xconfigure.x, e.xconfigure.y,
|
|
|
|
e.xconfigure.width, e.xconfigure.height);
|
|
|
|
xvimagesink->xwindow->width = e.xconfigure.width;
|
|
|
|
xvimagesink->xwindow->height = e.xconfigure.height;
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
|
|
|
gint i, nb_adaptors;
|
|
|
|
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-04-17 02:30:28 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (NULL),
|
|
|
|
("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-04-17 02:30:28 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (NULL),
|
|
|
|
("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
|
|
|
|
2003-11-28 21:47:51 +00:00
|
|
|
GST_DEBUG ("Found %d 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) {
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (NULL),
|
|
|
|
("No port available"));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-05-21 13:28:24 +00:00
|
|
|
/* Set XV_AUTOPAINT_COLORKEY */
|
|
|
|
{
|
|
|
|
int count;
|
|
|
|
const XvAttribute *const attr = XvQueryPortAttributes (xcontext->disp,
|
|
|
|
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-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,
|
2004-07-16 10:33:27 +00:00
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL);
|
2004-04-17 02:30:28 +00:00
|
|
|
|
2004-07-19 11:21:10 +00:00
|
|
|
/* For RGB caps we store them and the image
|
2004-04-17 02:30:28 +00:00
|
|
|
format so that we can get back the format
|
|
|
|
when sinkconnect will give us a caps without
|
|
|
|
format property */
|
|
|
|
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-03-15 19:32:28 +00:00
|
|
|
}
|
|
|
|
}
|
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,
|
2004-07-16 10:33:27 +00:00
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, 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
|
|
|
|
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)) {
|
|
|
|
gst_caps_free (caps);
|
|
|
|
XvUngrabPort (xcontext->disp, xcontext->xv_port_id, 0);
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (NULL),
|
|
|
|
("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
|
|
|
}
|
|
|
|
|
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 */
|
|
|
|
ratio = xcontext->widthmm * xcontext->height
|
|
|
|
/ (xcontext->heightmm * xcontext->width);
|
|
|
|
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]);
|
|
|
|
|
|
|
|
g_value_init (&xcontext->par, GST_TYPE_FRACTION);
|
|
|
|
gst_value_set_fraction (&xcontext->par, par[index][0], par[index][1]);
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (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);
|
|
|
|
|
|
|
|
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-04-17 02:30:28 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (NULL),
|
|
|
|
("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
|
|
|
|
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-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
|
|
|
formats_list = xvimagesink->xcontext->formats_list;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (formats_list) {
|
|
|
|
GstXvImageFormat *format = formats_list->data;
|
|
|
|
|
|
|
|
gst_caps_free (format->caps);
|
|
|
|
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
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_caps_free (xvimagesink->xcontext->caps);
|
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
|
|
|
|
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) {
|
|
|
|
GstXvImage *xvimage = xvimagesink->image_pool->data;
|
|
|
|
|
|
|
|
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
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
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 */
|
|
|
|
|
2004-01-02 10:04:34 +00:00
|
|
|
static GstCaps *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_fixate (GstPad * pad, const GstCaps * caps)
|
2004-01-02 10:04:34 +00:00
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GstCaps *newcaps;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (gst_caps_get_size (caps) > 1)
|
|
|
|
return NULL;
|
2004-01-02 10:04:34 +00:00
|
|
|
|
|
|
|
newcaps = gst_caps_copy (caps);
|
|
|
|
structure = gst_caps_get_structure (newcaps, 0);
|
|
|
|
|
|
|
|
if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) {
|
|
|
|
return newcaps;
|
|
|
|
}
|
|
|
|
if (gst_caps_structure_fixate_field_nearest_int (structure, "height", 240)) {
|
|
|
|
return newcaps;
|
|
|
|
}
|
|
|
|
if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
|
2004-03-15 19:32:28 +00:00
|
|
|
30.0)) {
|
2004-01-02 10:04:34 +00:00
|
|
|
return newcaps;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_caps_free (newcaps);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
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
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_get_fourcc_from_caps (GstXvImageSink * xvimagesink,
|
|
|
|
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);
|
|
|
|
if (!gst_caps_is_empty (icaps))
|
2004-03-15 19:32:28 +00:00
|
|
|
return format->format;
|
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 *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_getcaps (GstPad * pad)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink = GST_XVIMAGESINK (gst_pad_get_parent (pad));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
if (xvimagesink->xcontext)
|
|
|
|
return gst_caps_copy (xvimagesink->xcontext->caps);
|
|
|
|
|
2004-06-29 11:20:25 +00:00
|
|
|
return gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstPadLinkReturn
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_sink_link (GstPad * pad, const GstCaps * caps)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
2004-05-04 14:17:25 +00:00
|
|
|
gint 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;
|
|
|
|
gint num, den;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (gst_pad_get_parent (pad));
|
|
|
|
|
2004-05-04 14:17:25 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink,
|
|
|
|
"sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %"
|
|
|
|
GST_PTR_FORMAT, xvimagesink->xcontext->caps, caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-07-27 16:43:24 +00:00
|
|
|
ret = gst_structure_get_int (structure, "width", &video_width);
|
|
|
|
ret &= gst_structure_get_int (structure, "height", &video_height);
|
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
|
|
|
ret &= gst_structure_get_double (structure, "framerate",
|
2004-03-14 22:34:34 +00:00
|
|
|
&xvimagesink->framerate);
|
|
|
|
if (!ret)
|
|
|
|
return GST_PAD_LINK_REFUSED;
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
xvimagesink->video_width = video_width;
|
|
|
|
xvimagesink->video_height = video_height;
|
2004-05-04 14:17:25 +00:00
|
|
|
if (!gst_structure_get_fourcc (structure, "format", &im_format)) {
|
|
|
|
im_format =
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_get_fourcc_from_caps (xvimagesink,
|
|
|
|
gst_caps_copy (caps));
|
2003-12-22 01:47:09 +00:00
|
|
|
}
|
2004-05-04 14:17:25 +00:00
|
|
|
if (im_format == 0) {
|
2004-01-02 10:04:34 +00:00
|
|
|
return GST_PAD_LINK_REFUSED;
|
|
|
|
}
|
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 */
|
|
|
|
display_par_n = gst_value_get_fraction_numerator (&xvimagesink->par);
|
|
|
|
display_par_d = gst_value_get_fraction_denominator (&xvimagesink->par);
|
|
|
|
|
|
|
|
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");
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink) = video_height * num / den;
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink) = video_height;
|
|
|
|
} else if (video_width % num == 0) {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "keeping video width");
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink) = video_width;
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink) = video_width * den / num;
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "approximating while keeping video height");
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink) = video_height * num / den;
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink) = video_height;
|
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "scaling to %dx%d",
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* Creating our window and our image with the display size in pixels */
|
2004-05-05 11:29:49 +00:00
|
|
|
g_assert (GST_VIDEOSINK_WIDTH (xvimagesink) > 0);
|
|
|
|
g_assert (GST_VIDEOSINK_HEIGHT (xvimagesink) > 0);
|
2003-11-10 18:22:20 +00:00
|
|
|
if (!xvimagesink->xwindow)
|
|
|
|
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
else {
|
|
|
|
if (xvimagesink->xwindow->internal)
|
|
|
|
gst_xvimagesink_xwindow_resize (xvimagesink, xvimagesink->xwindow,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_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,
|
|
|
|
"old format " GST_FOURCC_FORMAT ", new format " GST_FOURCC_FORMAT,
|
|
|
|
GST_FOURCC_ARGS (xvimagesink->xcontext->im_format),
|
|
|
|
GST_FOURCC_ARGS (im_format));
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "renewing xvimage");
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, 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;
|
|
|
|
|
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
|
|
|
gst_x_overlay_got_desired_size (GST_X_OVERLAY (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink));
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return GST_PAD_LINK_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstElementStateReturn
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_change_state (GstElement * element)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (element);
|
|
|
|
|
|
|
|
switch (GST_STATE_TRANSITION (element)) {
|
|
|
|
case GST_STATE_NULL_TO_READY:
|
|
|
|
/* Initializing the XContext */
|
2004-04-17 02:30:28 +00:00
|
|
|
if (!xvimagesink->xcontext &&
|
|
|
|
!(xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink)))
|
2004-03-15 19:32:28 +00:00
|
|
|
return GST_STATE_FAILURE;
|
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;
|
|
|
|
case GST_STATE_READY_TO_PAUSED:
|
2004-03-05 14:50:23 +00:00
|
|
|
if (xvimagesink->xwindow)
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_xwindow_clear (xvimagesink, xvimagesink->xwindow);
|
2003-12-14 05:10:28 +00:00
|
|
|
xvimagesink->time = 0;
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_PAUSED_TO_PLAYING:
|
|
|
|
break;
|
|
|
|
case GST_STATE_PLAYING_TO_PAUSED:
|
|
|
|
break;
|
|
|
|
case GST_STATE_PAUSED_TO_READY:
|
2003-12-14 05:10:28 +00:00
|
|
|
xvimagesink->framerate = 0;
|
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
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink) = 0;
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink) = 0;
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_READY_TO_NULL:
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xvimagesink->xvimage) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimagesink->xvimage);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
2003-12-14 11:42:16 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return GST_STATE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_chain (GstPad * pad, GstData * data)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
2003-12-14 11:42:16 +00:00
|
|
|
GstBuffer *buf = NULL;
|
2003-11-10 18:22:20 +00:00
|
|
|
GstXvImageSink *xvimagesink;
|
2003-12-14 11:42:16 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (GST_IS_PAD (pad));
|
2003-12-14 11:42:16 +00:00
|
|
|
g_return_if_fail (data != NULL);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (gst_pad_get_parent (pad));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (GST_IS_EVENT (data)) {
|
|
|
|
gst_pad_event_default (pad, GST_EVENT (data));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-12-14 05:10:28 +00:00
|
|
|
buf = GST_BUFFER (data);
|
|
|
|
/* update time */
|
|
|
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
|
|
|
xvimagesink->time = GST_BUFFER_TIMESTAMP (buf);
|
|
|
|
}
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_LOG_OBJECT (xvimagesink, "clock wait: %" GST_TIME_FORMAT,
|
2004-04-21 12:44:39 +00:00
|
|
|
GST_TIME_ARGS (xvimagesink->time));
|
2004-02-01 22:33:07 +00:00
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
if (GST_VIDEOSINK_CLOCK (xvimagesink)) {
|
2004-01-14 00:53:52 +00:00
|
|
|
gst_element_wait (GST_ELEMENT (xvimagesink), xvimagesink->time);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If this buffer has been allocated using our buffer management we simply
|
|
|
|
put the ximage which is in the PRIVATE pointer */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (GST_BUFFER_FREE_DATA_FUNC (buf) == gst_xvimagesink_buffer_free) {
|
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, GST_BUFFER_PRIVATE (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 {
|
|
|
|
/* 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");
|
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,
|
2004-07-27 16:43:24 +00:00
|
|
|
xvimagesink->video_width, 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
|
|
|
if (!xvimagesink->xvimage) {
|
|
|
|
/* No image available. That's very bad ! */
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL),
|
|
|
|
("Failed creating an XvImage in xvimagesink chain function."));
|
|
|
|
return;
|
|
|
|
}
|
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));
|
|
|
|
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
|
|
|
|
2003-12-14 05:10:28 +00:00
|
|
|
/* set correct time for next buffer */
|
|
|
|
if (!GST_BUFFER_TIMESTAMP_IS_VALID (buf) && xvimagesink->framerate > 0) {
|
|
|
|
xvimagesink->time += GST_SECOND / xvimagesink->framerate;
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
gst_buffer_unref (buf);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
gst_xvimagesink_handle_xevents (xvimagesink, pad);
|
|
|
|
}
|
|
|
|
|
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 */
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_buffer_free (GstBuffer * buffer)
|
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
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
GstXvImage *xvimage;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-12 02:01:52 +00:00
|
|
|
xvimage = GST_BUFFER_PRIVATE (buffer);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-11 22:52:29 +00:00
|
|
|
g_assert (GST_IS_XVIMAGESINK (xvimage->xvimagesink));
|
|
|
|
xvimagesink = xvimage->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 our geometry changed we can't reuse that image. */
|
2004-03-14 22:34:34 +00:00
|
|
|
if ((xvimage->width != GST_VIDEOSINK_WIDTH (xvimagesink)) ||
|
|
|
|
(xvimage->height != GST_VIDEOSINK_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
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
|
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 {
|
|
|
|
/* In that case we can reuse the image and add it to our image pool. */
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (xvimagesink->pool_lock);
|
|
|
|
xvimagesink->image_pool = g_slist_prepend (xvimagesink->image_pool,
|
2004-03-15 19:32:28 +00:00
|
|
|
xvimage);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (xvimagesink->pool_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
|
|
|
}
|
|
|
|
|
|
|
|
static GstBuffer *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_buffer_alloc (GstPad * pad, guint64 offset, guint size)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstXvImage *xvimage = NULL;
|
|
|
|
gboolean not_found = TRUE;
|
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
|
|
|
xvimagesink = GST_XVIMAGESINK (gst_pad_get_parent (pad));
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->pool_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Walking through the pool cleaning unsuable images and searching for a
|
|
|
|
suitable one */
|
2004-03-14 22:34:34 +00:00
|
|
|
while (not_found && xvimagesink->image_pool) {
|
|
|
|
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 */
|
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->width != GST_VIDEOSINK_WIDTH (xvimagesink)) ||
|
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->height != GST_VIDEOSINK_HEIGHT (xvimagesink)) ||
|
|
|
|
(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... */
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
|
|
|
|
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 */
|
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... */
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "no usable image in pool, creating xvimage");
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimage = gst_xvimagesink_xvimage_new (xvimagesink,
|
2004-07-27 16:43:24 +00:00
|
|
|
xvimagesink->video_width, xvimagesink->video_height);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimage) {
|
|
|
|
buffer = gst_buffer_new ();
|
|
|
|
|
|
|
|
/* Storing some pointers in the buffer */
|
|
|
|
GST_BUFFER_PRIVATE (buffer) = xvimage;
|
|
|
|
|
|
|
|
GST_BUFFER_DATA (buffer) = xvimage->xvimage->data;
|
|
|
|
GST_BUFFER_FREE_DATA_FUNC (buffer) = gst_xvimagesink_buffer_free;
|
|
|
|
GST_BUFFER_SIZE (buffer) = xvimage->size;
|
|
|
|
return buffer;
|
|
|
|
} else
|
2003-11-10 18:22:20 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
GstEvent *event;
|
2004-03-14 22:34:34 +00:00
|
|
|
double x, y;
|
2003-11-17 16:32:29 +00:00
|
|
|
|
|
|
|
event = gst_event_new (GST_EVENT_NAVIGATION);
|
|
|
|
event->event_data.structure.structure = structure;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* Converting pointer coordinates to the non scaled geometry */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (gst_structure_get_double (structure, "pointer_x", &x)) {
|
|
|
|
x *= GST_VIDEOSINK_WIDTH (xvimagesink);
|
|
|
|
x /= xvimagesink->xwindow->width;
|
|
|
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, x, NULL);
|
|
|
|
}
|
|
|
|
if (gst_structure_get_double (structure, "pointer_y", &y)) {
|
|
|
|
y *= GST_VIDEOSINK_HEIGHT (xvimagesink);
|
|
|
|
y /= xvimagesink->xwindow->height;
|
|
|
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
|
|
|
|
}
|
2003-11-17 16:32:29 +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
|
|
|
gst_pad_send_event (gst_pad_get_peer (GST_VIDEOSINK_PAD (xvimagesink)),
|
2004-03-14 22:34:34 +00:00
|
|
|
event);
|
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
|
|
|
|
|
|
|
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) {
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimagesink->xvimage);
|
|
|
|
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 */
|
|
|
|
if (GST_VIDEOSINK_WIDTH (xvimagesink) && GST_VIDEOSINK_HEIGHT (xvimagesink)) {
|
|
|
|
xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_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;
|
2003-11-17 16:32:29 +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
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_get_desired_size (GstXOverlay * overlay,
|
|
|
|
guint * width, guint * 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
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
|
|
|
|
*width = GST_VIDEOSINK_WIDTH (xvimagesink);
|
|
|
|
*height = GST_VIDEOSINK_HEIGHT (xvimagesink);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2004-02-16 23:45:55 +00:00
|
|
|
XWindowAttributes attr;
|
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
|
|
|
|
2004-02-16 23:45:55 +00:00
|
|
|
/* Update the window geometry */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
XGetWindowAttributes (xvimagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
xvimagesink->xwindow->win, &attr);
|
2004-02-16 23:45:55 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-16 23:45:55 +00:00
|
|
|
xvimagesink->xwindow->width = attr.width;
|
|
|
|
xvimagesink->xwindow->height = attr.height;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
if (xvimagesink->cur_image) {
|
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, xvimagesink->cur_image);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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;
|
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
|
|
|
iface->get_desired_size = gst_xvimagesink_get_desired_size;
|
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:
|
|
|
|
if (!g_value_transform (value, &xvimagesink->par))
|
|
|
|
g_warning ("Could not transform string to aspect ratio");
|
|
|
|
GST_DEBUG_OBJECT (xvimagesink, "set PAR to %d/%d",
|
|
|
|
gst_value_get_fraction_numerator (&xvimagesink->par),
|
|
|
|
gst_value_get_fraction_denominator (&xvimagesink->par));
|
|
|
|
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:
|
|
|
|
g_value_transform (&xvimagesink->par, 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
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_free (xvimagesink->x_lock);
|
|
|
|
g_mutex_free (xvimagesink->pool_lock);
|
|
|
|
|
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
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_PAD (xvimagesink) =
|
|
|
|
gst_pad_new_from_template (gst_static_pad_template_get
|
|
|
|
(&gst_xvimagesink_sink_template_factory), "sink");
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_PAD (xvimagesink));
|
2003-11-19 20:43:49 +00:00
|
|
|
|
|
|
|
gst_pad_set_chain_function (GST_VIDEOSINK_PAD (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_chain);
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_pad_set_link_function (GST_VIDEOSINK_PAD (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_sink_link);
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_pad_set_getcaps_function (GST_VIDEOSINK_PAD (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_getcaps);
|
2004-01-02 10:04:34 +00:00
|
|
|
gst_pad_set_fixate_function (GST_VIDEOSINK_PAD (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_fixate);
|
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
|
|
|
gst_pad_set_bufferalloc_function (GST_VIDEOSINK_PAD (xvimagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_xvimagesink_buffer_alloc);
|
|
|
|
|
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
|
|
|
|
2003-11-12 11:02:31 +00:00
|
|
|
xvimagesink->framerate = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->x_lock = g_mutex_new ();
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
g_value_init (&xvimagesink->par, GST_TYPE_FRACTION);
|
|
|
|
gst_value_set_fraction (&xvimagesink->par, 1, 1);
|
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;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_FLAG_SET (xvimagesink, GST_ELEMENT_THREAD_SUGGESTED);
|
|
|
|
GST_FLAG_SET (xvimagesink, GST_ELEMENT_EVENT_AWARE);
|
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;
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
parent_class = g_type_class_ref (GST_TYPE_VIDEOSINK);
|
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
|
|
|
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));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
gobject_class->finalize = gst_xvimagesink_finalize;
|
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
|
|
|
gobject_class->set_property = gst_xvimagesink_set_property;
|
|
|
|
gobject_class->get_property = gst_xvimagesink_get_property;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
gstelement_class->change_state = gst_xvimagesink_change_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* 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,
|
|
|
|
};
|
|
|
|
|
|
|
|
xvimagesink_type = g_type_register_static (GST_TYPE_VIDEOSINK,
|
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
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
/* Loading the library containing GstVideoSink, our parent object */
|
|
|
|
if (!gst_library_load ("gstvideo"))
|
|
|
|
return FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
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",
|
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
|