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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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-01-15 21:05:17 +00:00
|
|
|
static void gst_xvimagesink_buffer_free (GstBuffer *buffer);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* ElementFactory information */
|
|
|
|
static GstElementDetails gst_xvimagesink_details = GST_ELEMENT_DETAILS (
|
|
|
|
"Video sink",
|
|
|
|
"Sink/Video",
|
|
|
|
"A Xv based videosink",
|
|
|
|
"Julien Moutte <julien@moutte.net>"
|
|
|
|
);
|
|
|
|
|
|
|
|
/* 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 =
|
|
|
|
GST_STATIC_PAD_TEMPLATE (
|
2003-11-10 18:22:20 +00:00
|
|
|
"sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2003-12-22 01:47:09 +00:00
|
|
|
GST_STATIC_CAPS (
|
|
|
|
"video/x-raw-rgb, "
|
2004-01-15 21:05:17 +00:00
|
|
|
"framerate = (double) [ 1.0, 100.0 ], "
|
2003-12-22 01:47:09 +00:00
|
|
|
"width = (int) [ 0, MAX ], "
|
|
|
|
"height = (int) [ 0, MAX ]; "
|
|
|
|
"video/x-raw-yuv, "
|
2004-01-15 21:05:17 +00:00
|
|
|
"framerate = (double) [ 1.0, 100.0 ], "
|
2003-12-22 01:47:09 +00:00
|
|
|
"width = (int) [ 0, MAX ], "
|
|
|
|
"height = (int) [ 0, MAX ]"
|
|
|
|
)
|
|
|
|
);
|
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
|
|
|
enum {
|
|
|
|
ARG_0,
|
|
|
|
ARG_CONTRAST,
|
|
|
|
ARG_BRIGHTNESS,
|
|
|
|
ARG_HUE,
|
|
|
|
ARG_SATURATION,
|
2004-01-16 23:52:53 +00:00
|
|
|
ARG_DISPLAY,
|
|
|
|
ARG_SYNCHRONOUS
|
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
|
|
|
/* FILL ME */
|
|
|
|
};
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
static GstVideoSinkClass *parent_class = NULL;
|
2004-01-28 00:29:42 +00:00
|
|
|
static gboolean error_catched = FALSE;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Private Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
/* X11 stuff */
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
static int
|
|
|
|
gst_xvimagesink_handle_xerror (Display *display, XErrorEvent *xevent)
|
|
|
|
{
|
|
|
|
char error_msg [1024];
|
|
|
|
XGetErrorText (display, xevent->error_code, error_msg, 1024);
|
|
|
|
GST_DEBUG ("xvimagesink failed to use XShm calls. error: %s",
|
|
|
|
error_msg);
|
|
|
|
error_catched = TRUE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function checks that it is actually really possible to create an image
|
|
|
|
using XShm */
|
|
|
|
static gboolean
|
|
|
|
gst_xvimagesink_check_xshm_calls (GstXContext *xcontext)
|
|
|
|
{
|
|
|
|
GstXvImage *xvimage = NULL;
|
|
|
|
int (*handler)(Display *, XErrorEvent *);
|
|
|
|
|
|
|
|
g_return_val_if_fail (xcontext != NULL, FALSE);
|
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
xvimage = g_new0 (GstXvImage, 1);
|
|
|
|
|
|
|
|
/* Setting an error handler to catch failure */
|
|
|
|
handler = XSetErrorHandler (gst_xvimagesink_handle_xerror);
|
|
|
|
|
|
|
|
xvimage->size = (xcontext->bpp / 8);
|
|
|
|
|
|
|
|
/* Trying to create a 1x1 picture */
|
|
|
|
xvimage->xvimage = XvShmCreateImage (xcontext->disp, xcontext->xv_port_id,
|
|
|
|
xcontext->im_format, NULL, 1, 1,
|
|
|
|
&xvimage->SHMInfo);
|
|
|
|
|
|
|
|
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
|
|
|
|
IPC_CREAT | 0777);
|
|
|
|
xvimage->SHMInfo.shmaddr = shmat (xvimage->SHMInfo.shmid, 0, 0);
|
|
|
|
xvimage->xvimage->data = xvimage->SHMInfo.shmaddr;
|
|
|
|
xvimage->SHMInfo.readOnly = FALSE;
|
|
|
|
|
|
|
|
XShmAttach (xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
|
|
|
|
error_catched = FALSE;
|
|
|
|
|
|
|
|
XSync(xcontext->disp, 0);
|
|
|
|
|
|
|
|
XSetErrorHandler (handler);
|
|
|
|
|
|
|
|
if (error_catched)
|
|
|
|
{ /* Failed, detaching shared memory, destroying image and telling we can't
|
|
|
|
use XShm */
|
|
|
|
error_catched = FALSE;
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
shmdt (xvimage->SHMInfo.shmaddr);
|
|
|
|
shmctl (xvimage->SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
g_free (xvimage);
|
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 (xcontext->disp, FALSE);
|
2004-01-28 00:29:42 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
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
|
|
|
XShmDetach (xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
shmdt (xvimage->SHMInfo.shmaddr);
|
|
|
|
shmctl (xvimage->SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
g_free (xvimage);
|
|
|
|
XSync (xcontext->disp, FALSE);
|
2004-01-28 00:29:42 +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
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
|
|
|
|
return TRUE;
|
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 *
|
|
|
|
gst_xvimagesink_xvimage_new (GstXvImageSink *xvimagesink,
|
|
|
|
gint width, gint height)
|
|
|
|
{
|
|
|
|
GstXvImage *xvimage = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (xvimagesink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
|
|
|
|
|
|
|
xvimage = g_new0 (GstXvImage, 1);
|
|
|
|
|
|
|
|
xvimage->width = width;
|
|
|
|
xvimage->height = height;
|
|
|
|
xvimage->data = NULL;
|
2004-01-11 22:52:29 +00:00
|
|
|
xvimage->xvimagesink = xvimagesink;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
xvimage->size = (xvimagesink->xcontext->bpp / 8) * xvimage->width * xvimage->height;
|
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
if (xvimagesink->xcontext->use_xshm)
|
2003-11-12 11:02:31 +00:00
|
|
|
{
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xcontext->im_format,
|
|
|
|
NULL, xvimage->width,
|
|
|
|
xvimage->height, &xvimage->SHMInfo);
|
|
|
|
|
|
|
|
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
|
|
|
|
IPC_CREAT | 0777);
|
|
|
|
|
|
|
|
xvimage->SHMInfo.shmaddr = shmat (xvimage->SHMInfo.shmid, 0, 0);
|
|
|
|
xvimage->xvimage->data = xvimage->SHMInfo.shmaddr;
|
|
|
|
|
|
|
|
xvimage->SHMInfo.readOnly = FALSE;
|
|
|
|
|
|
|
|
XShmAttach (xvimagesink->xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
}
|
|
|
|
else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2003-11-12 11:02:31 +00:00
|
|
|
{
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimage->xvimage = XvCreateImage (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xcontext->im_format,
|
|
|
|
xvimage->data,
|
|
|
|
xvimage->width, xvimage->height);
|
|
|
|
|
|
|
|
xvimage->data = g_malloc (xvimage->xvimage->data_size);
|
|
|
|
}
|
2003-11-26 10:12:05 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
if (xvimage->xvimage)
|
|
|
|
{
|
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);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (xvimage->data)
|
|
|
|
g_free (xvimage->data);
|
|
|
|
|
|
|
|
g_free (xvimage);
|
|
|
|
|
|
|
|
xvimage = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
return xvimage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function destroys a GstXvImage handling XShm availability */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_xvimage_destroy (GstXvImageSink *xvimagesink,
|
|
|
|
GstXvImage *xvimage)
|
|
|
|
{
|
|
|
|
g_return_if_fail (xvimage != NULL);
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
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;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
if (xvimagesink->xcontext->use_xshm)
|
|
|
|
{
|
|
|
|
if (xvimage->SHMInfo.shmaddr)
|
|
|
|
XShmDetach (xvimagesink->xcontext->disp, &xvimage->SHMInfo);
|
|
|
|
|
|
|
|
if (xvimage->xvimage)
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
|
|
|
|
if (xvimage->SHMInfo.shmaddr)
|
|
|
|
shmdt (xvimage->SHMInfo.shmaddr);
|
|
|
|
|
|
|
|
if (xvimage->SHMInfo.shmid > 0)
|
|
|
|
shmctl (xvimage->SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
}
|
|
|
|
else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
if (xvimage->xvimage)
|
|
|
|
XFree (xvimage->xvimage);
|
|
|
|
}
|
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-01-28 00:29:42 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
g_free (xvimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function puts a GstXvImage on a GstXvImageSink's window */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_xvimage_put (GstXvImageSink *xvimagesink, GstXvImage *xvimage)
|
|
|
|
{
|
|
|
|
g_return_if_fail (xvimage != NULL);
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
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;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
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
|
|
|
|
if (xvimagesink->xcontext->use_xshm)
|
|
|
|
{
|
|
|
|
XvShmPutImage (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xwindow->win,
|
|
|
|
xvimagesink->xwindow->gc, xvimage->xvimage,
|
|
|
|
0, 0, xvimage->width, xvimage->height,
|
2003-11-13 10:44:12 +00:00
|
|
|
0, 0, xvimagesink->xwindow->width,
|
|
|
|
xvimagesink->xwindow->height, FALSE);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
XvPutImage (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
xvimagesink->xwindow->win,
|
|
|
|
xvimagesink->xwindow->gc, xvimage->xvimage,
|
|
|
|
0, 0, xvimage->width, xvimage->height,
|
2003-11-13 10:44:12 +00:00
|
|
|
0, 0, xvimagesink->xwindow->width,
|
|
|
|
xvimagesink->xwindow->height);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XSync(xvimagesink->xcontext->disp, FALSE);
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function handles a GstXWindow creation */
|
|
|
|
static GstXWindow *
|
|
|
|
gst_xvimagesink_xwindow_new (GstXvImageSink *xvimagesink,
|
|
|
|
gint width, gint height)
|
|
|
|
{
|
|
|
|
GstXWindow *xwindow = NULL;
|
|
|
|
XGCValues values;
|
|
|
|
|
|
|
|
g_return_val_if_fail (xvimagesink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
|
|
|
|
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
|
|
|
|
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
2003-11-17 16:32:29 +00:00
|
|
|
xwindow->internal = TRUE;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
xwindow->win = XCreateSimpleWindow (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->root,
|
|
|
|
0, 0, xwindow->width, xwindow->height,
|
|
|
|
0, 0, xvimagesink->xcontext->black);
|
|
|
|
|
2003-11-13 10:44:12 +00:00
|
|
|
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
|
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
|
|
|
|
xwindow->win, 0, &values);
|
|
|
|
|
|
|
|
XMapRaised (xvimagesink->xcontext->disp, xwindow->win);
|
|
|
|
|
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);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
2004-01-29 10:02:48 +00:00
|
|
|
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (xvimagesink), xwindow->win);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return xwindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function destroys a GstXWindow */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_xwindow_destroy (GstXvImageSink *xvimagesink, GstXWindow *xwindow)
|
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
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);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
XFreeGC (xvimagesink->xcontext->disp, xwindow->gc);
|
|
|
|
|
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);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
g_free (xwindow);
|
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* This function resizes a GstXWindow */
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_xwindow_resize (GstXvImageSink *xvimagesink,
|
|
|
|
GstXWindow *xwindow, guint width, guint height)
|
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
|
|
|
|
|
|
|
XResizeWindow (xvimagesink->xcontext->disp, xwindow->win,
|
|
|
|
xwindow->width, xwindow->height);
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
gst_xvimagesink_update_colorbalance (GstXvImageSink *xvimagesink)
|
|
|
|
{
|
|
|
|
GList *channels = NULL;
|
|
|
|
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
|
|
|
/* If we haven't initialized the X context we can't update anything */
|
|
|
|
if (xvimagesink->xcontext == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
|
|
|
|
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 */
|
2004-01-16 23:52:53 +00:00
|
|
|
convert_coef = (channel->max_value - channel->min_value) / 2000.0;
|
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 (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0)
|
|
|
|
{
|
|
|
|
value = (xvimagesink->hue + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
|
|
|
}
|
|
|
|
else if (g_ascii_strcasecmp (channel->label, "XV_SATURATION") == 0)
|
|
|
|
{
|
|
|
|
value = (xvimagesink->saturation + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
|
|
|
}
|
|
|
|
else if (g_ascii_strcasecmp (channel->label, "XV_CONTRAST") == 0)
|
|
|
|
{
|
|
|
|
value = (xvimagesink->contrast + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
|
|
|
}
|
|
|
|
else if (g_ascii_strcasecmp (channel->label, "XV_BRIGHTNESS") == 0)
|
|
|
|
{
|
|
|
|
value = (xvimagesink->brightness + 1000) * convert_coef +
|
|
|
|
channel->min_value;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("got an unknown channel %s", channel->label);
|
|
|
|
g_object_unref (channel);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Committing to Xv port */
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
XvSetPortAttribute (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->xv_port_id,
|
|
|
|
XInternAtom (xvimagesink->xcontext->disp,
|
|
|
|
channel->label, 1), value);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
g_object_unref (channel);
|
|
|
|
}
|
|
|
|
channels = g_list_next (channels);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
gst_xvimagesink_handle_xevents (GstXvImageSink *xvimagesink, GstPad *pad)
|
|
|
|
{
|
|
|
|
XEvent e;
|
2004-02-02 21:59:35 +00:00
|
|
|
guint pointer_x = 0, pointer_y = 0;
|
|
|
|
gboolean pointer_moved = FALSE;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
|
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,
|
|
|
|
xvimagesink->xwindow->win,
|
|
|
|
PointerMotionMask, &e))
|
|
|
|
{
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
switch (e.type)
|
|
|
|
{
|
|
|
|
case MotionNotify:
|
|
|
|
pointer_x = e.xmotion.x;
|
|
|
|
pointer_y = e.xmotion.y;
|
|
|
|
pointer_moved = TRUE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
if (pointer_moved)
|
|
|
|
{
|
|
|
|
GST_DEBUG ("xvimagesink pointer moved over window at %d,%d",
|
|
|
|
pointer_x, pointer_y);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
|
|
|
"mouse-move", 0, pointer_x, pointer_y);
|
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
xvimagesink->xwindow->win,
|
2004-02-02 21:59:35 +00:00
|
|
|
StructureNotifyMask | KeyPressMask |
|
2003-11-10 18:22:20 +00:00
|
|
|
KeyReleaseMask | ButtonPressMask |
|
|
|
|
ButtonReleaseMask, &e))
|
|
|
|
{
|
2003-11-11 00:43:29 +00:00
|
|
|
KeySym keysym;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* We lock only for the X function call */
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
switch (e.type)
|
|
|
|
{
|
2003-11-13 10:44:12 +00:00
|
|
|
case ConfigureNotify:
|
|
|
|
/* Window got resized or moved. We update our data. */
|
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_DEBUG ("xvimagesink window is at %d, %d with geometry : %d,%d",
|
2003-11-13 10:44:12 +00:00
|
|
|
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;
|
2003-11-10 18:22:20 +00:00
|
|
|
case ButtonPress:
|
2004-01-06 16:42:10 +00:00
|
|
|
/* Mouse button pressed over our window. We send upstream
|
2003-11-10 18:22:20 +00:00
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink button %d pressed over window at %d,%d",
|
2003-11-11 00:43:29 +00:00
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (xvimagesink),
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
"mouse-button-press",
|
|
|
|
e.xbutton.button,
|
2004-01-06 16:42:10 +00:00
|
|
|
e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
|
|
|
case ButtonRelease:
|
|
|
|
/* 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),
|
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
|
|
|
"mouse-button-release",
|
|
|
|
e.xbutton.button,
|
2003-11-12 11:02:31 +00:00
|
|
|
e.xbutton.x, e.xbutton.y);
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
|
|
|
case KeyPress:
|
|
|
|
case KeyRelease:
|
|
|
|
/* Key pressed/released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("xvimagesink key %d pressed over window at %d,%d",
|
2003-11-11 00:43:29 +00:00
|
|
|
e.xkey.keycode, e.xkey.x, e.xkey.y);
|
2003-11-12 11:02:31 +00:00
|
|
|
keysym = XKeycodeToKeysym (xvimagesink->xcontext->disp,
|
|
|
|
e.xkey.keycode, 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
|
|
|
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");
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GST_DEBUG ("xvimagesink unhandled X event (%d)", e.type);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
}
|
|
|
|
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
|
|
|
|
format list and append the format to a newly created caps that we return */
|
2003-11-10 18:22:20 +00:00
|
|
|
static GstCaps *
|
|
|
|
gst_xvimagesink_get_xv_support (GstXContext *xcontext)
|
|
|
|
{
|
|
|
|
gint i, nb_adaptors;
|
|
|
|
XvAdaptorInfo *adaptors;
|
|
|
|
|
|
|
|
g_return_val_if_fail (xcontext != NULL, NULL);
|
|
|
|
|
|
|
|
/* First let's check that XVideo extension is available */
|
|
|
|
if (!XQueryExtension (xcontext->disp, "XVideo", &i, &i, &i))
|
2003-11-28 21:47:51 +00:00
|
|
|
{
|
|
|
|
GST_DEBUG ("XVideo extension is not available");
|
|
|
|
return NULL;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* Then we get adaptors list */
|
|
|
|
if (Success != XvQueryAdaptors (xcontext->disp, xcontext->root,
|
|
|
|
&nb_adaptors, &adaptors))
|
2003-11-28 21:47:51 +00:00
|
|
|
{
|
|
|
|
GST_DEBUG ("Failed getting XV adaptors list");
|
|
|
|
return NULL;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xcontext->xv_port_id = 0;
|
|
|
|
|
2003-11-28 21:47:51 +00:00
|
|
|
GST_DEBUG ("Found %d XV adaptor(s)", nb_adaptors);
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Now search for an adaptor that supports XvImageMask */
|
|
|
|
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++)
|
|
|
|
{
|
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG ("XV Adaptor %s with %ld ports", adaptors[i].name,
|
|
|
|
adaptors[i].num_ports);
|
|
|
|
|
|
|
|
}
|
2003-12-27 15:37:43 +00:00
|
|
|
XvFreeAdaptorInfo (adaptors);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
if (xcontext->xv_port_id)
|
|
|
|
{
|
|
|
|
gint nb_formats;
|
|
|
|
XvImageFormatValues *formats = NULL;
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
|
|
|
|
/* We get all image formats supported by our port */
|
|
|
|
formats = XvListImageFormats (xcontext->disp,
|
|
|
|
xcontext->xv_port_id, &nb_formats);
|
2003-12-22 01:47:09 +00:00
|
|
|
caps = gst_caps_new_empty ();
|
2003-11-10 18:22:20 +00:00
|
|
|
for (i = 0; i < nb_formats; i++)
|
|
|
|
{
|
|
|
|
GstCaps *format_caps = NULL;
|
|
|
|
|
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
|
|
|
/* 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;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
switch (formats[i].type)
|
|
|
|
{
|
|
|
|
case XvRGB:
|
2003-11-28 21:47:51 +00:00
|
|
|
{
|
2003-12-22 01:47:09 +00:00
|
|
|
format_caps = gst_caps_new_simple ("video/x-raw-rgb",
|
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
|
|
|
"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,
|
|
|
|
"width", GST_TYPE_INT_RANGE, 0, G_MAXINT,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 0, G_MAXINT,
|
sys/ximage/ximagesink.c: Change to using a framerate of [1,100] instead of [0,MAX], since 0 isn't handled correctly, ...
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_getcaps),
(gst_ximagesink_set_xwindow_id): Change to using a framerate
of [1,100] instead of [0,MAX], since 0 isn't handled correctly,
and neither is 100+, most likely.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_getcaps): same
2004-01-20 09:25:51 +00:00
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.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
|
|
|
NULL);
|
2003-11-28 21:47:51 +00:00
|
|
|
|
|
|
|
/* For RGB caps we store them and the image
|
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
|
|
|
format so that we can get back the format
|
|
|
|
when sinkconnect will give us a caps without
|
|
|
|
format property */
|
2003-11-28 21:47:51 +00:00
|
|
|
if (format_caps)
|
|
|
|
{
|
|
|
|
GstXvImageFormat *format = NULL;
|
|
|
|
format = g_new0 (GstXvImageFormat, 1);
|
|
|
|
if (format)
|
|
|
|
{
|
|
|
|
format->format = formats[i].id;
|
|
|
|
format->caps = gst_caps_copy (format_caps);
|
|
|
|
xcontext->formats_list = g_list_append (
|
|
|
|
xcontext->formats_list, format);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
case XvYUV:
|
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
|
|
|
format_caps = gst_caps_new_simple ("video/x-raw-yuv",
|
|
|
|
"format", GST_TYPE_FOURCC,formats[i].id,
|
|
|
|
"width", GST_TYPE_INT_RANGE, 0, G_MAXINT,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 0, G_MAXINT,
|
sys/ximage/ximagesink.c: Change to using a framerate of [1,100] instead of [0,MAX], since 0 isn't handled correctly, ...
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_getcaps),
(gst_ximagesink_set_xwindow_id): Change to using a framerate
of [1,100] instead of [0,MAX], since 0 isn't handled correctly,
and neither is 100+, most likely.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_getcaps): same
2004-01-20 09:25:51 +00:00
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.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
|
|
|
NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_caps_append (caps, format_caps);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (formats)
|
|
|
|
XFree (formats);
|
|
|
|
|
2004-02-04 19:45:32 +00:00
|
|
|
GST_DEBUG ("Generated the following caps: " GST_PTR_FORMAT, caps);
|
2003-12-22 01:47:09 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function get the X Display and global infos about it. Everything is
|
|
|
|
stored in our object and will be cleaned when the object is disposed. Note
|
|
|
|
here that caps for supported format are generated without any window or
|
|
|
|
image creation */
|
|
|
|
static GstXContext *
|
|
|
|
gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink)
|
|
|
|
{
|
|
|
|
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",
|
|
|
|
"XV_BRIGHTNESS", "XV_CONTRAST" };
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (xvimagesink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
|
|
|
|
|
|
|
xcontext = g_new0 (GstXContext, 1);
|
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
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);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
if (!xcontext->disp)
|
|
|
|
{
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
2004-02-02 17:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, TOO_LAZY, (NULL),
|
2004-01-18 21:46:58 +00:00
|
|
|
("Could not open display"));
|
2003-11-10 18:22:20 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
xcontext->screen = DefaultScreenOfDisplay (xcontext->disp);
|
|
|
|
xcontext->screen_num = DefaultScreen (xcontext->disp);
|
|
|
|
xcontext->visual = DefaultVisual(xcontext->disp, xcontext->screen_num);
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* We get supported pixmap formats at supported depth */
|
|
|
|
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
|
|
|
|
|
|
|
|
if (!px_formats)
|
|
|
|
{
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We get bpp value corresponding to our running depth */
|
|
|
|
for (i=0; i<nb_formats; i++)
|
|
|
|
{
|
|
|
|
if (px_formats[i].depth == xcontext->depth)
|
|
|
|
xcontext->bpp = px_formats[i].bits_per_pixel;
|
|
|
|
}
|
|
|
|
|
|
|
|
XFree (px_formats);
|
|
|
|
|
|
|
|
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
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xcontext->caps = gst_xvimagesink_get_xv_support (xcontext);
|
|
|
|
|
|
|
|
if (!xcontext->caps)
|
|
|
|
{
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
|
|
|
return NULL;
|
|
|
|
}
|
2004-01-13 17:57:25 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
#ifdef HAVE_XSHM
|
|
|
|
/* Search for XShm extension support */
|
|
|
|
if (XShmQueryExtension (xcontext->disp) &&
|
|
|
|
gst_xvimagesink_check_xshm_calls (xcontext))
|
|
|
|
{
|
|
|
|
xcontext->use_xshm = TRUE;
|
|
|
|
GST_DEBUG ("xvimagesink is using XShm extension");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xcontext->use_xshm = FALSE;
|
|
|
|
GST_DEBUG ("xvimagesink is not using XShm extension");
|
|
|
|
}
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
|
2004-01-13 17:57:25 +00:00
|
|
|
xv_attr = XvQueryPortAttributes (xcontext->disp,
|
|
|
|
xcontext->xv_port_id,
|
|
|
|
&N_attr);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2004-01-13 17:57:25 +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
|
|
|
/* Generate the channels list */
|
|
|
|
for (i = 0; i < (sizeof (channels) / sizeof (char *)); i++)
|
|
|
|
{
|
2004-01-13 17:57:25 +00:00
|
|
|
XvAttribute *matching_attr = NULL;
|
|
|
|
|
|
|
|
if (xv_attr != NULL)
|
|
|
|
{
|
|
|
|
for (j = 0; j < N_attr && matching_attr == NULL; ++j)
|
|
|
|
if (! g_ascii_strcasecmp (channels[i], xv_attr[j].name))
|
|
|
|
matching_attr = xv_attr + j;
|
|
|
|
}
|
|
|
|
|
2004-01-16 23:52:53 +00:00
|
|
|
if (matching_attr) {
|
2004-01-18 12:32:19 +00:00
|
|
|
GstColorBalanceChannel *channel;
|
2004-01-16 23:52:53 +00:00
|
|
|
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,
|
|
|
|
channel);
|
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 the colorbalance settings have not been touched we get Xv values
|
|
|
|
as defaults and update our internal variables */
|
|
|
|
if (!xvimagesink->cb_changed) {
|
|
|
|
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-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
|
|
|
|
gst_xvimagesink_xcontext_clear (GstXvImageSink *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
|
|
|
GList *formats_list, *channels_list;
|
2003-11-28 21:47:51 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (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
|
|
|
formats_list = xvimagesink->xcontext->formats_list;
|
2003-11-28 21:47:51 +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
|
|
|
while (formats_list)
|
2003-11-28 21:47:51 +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
|
|
|
GstXvImageFormat *format = formats_list->data;
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_caps_free (format->caps);
|
2003-11-28 21:47:51 +00:00
|
|
|
g_free (format);
|
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 = 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);
|
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;
|
|
|
|
|
|
|
|
while (channels_list)
|
|
|
|
{
|
|
|
|
GstColorBalanceChannel *channel = channels_list->data;
|
|
|
|
g_object_unref (channel);
|
|
|
|
channels_list = g_list_next (channels_list);
|
|
|
|
}
|
2003-11-28 21:47:51 +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->channels_list)
|
|
|
|
g_list_free (xvimagesink->xcontext->channels_list);
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_caps_free (xvimagesink->xcontext->caps);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
g_mutex_lock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
XvUngrabPort (xvimagesink->xcontext->disp,
|
|
|
|
xvimagesink->xcontext->xv_port_id, 0);
|
|
|
|
|
|
|
|
XCloseDisplay (xvimagesink->xcontext->disp);
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
|
|
|
|
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
|
|
|
|
gst_xvimagesink_imagepool_clear (GstXvImageSink *xvimagesink)
|
|
|
|
{
|
|
|
|
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,
|
|
|
|
xvimagesink->image_pool);
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock(xvimagesink->pool_lock);
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
/* Element stuff */
|
|
|
|
|
2004-01-02 10:04:34 +00:00
|
|
|
static GstCaps *
|
2004-01-04 23:46:39 +00:00
|
|
|
gst_xvimagesink_fixate (GstPad *pad, const GstCaps *caps)
|
2004-01-02 10:04:34 +00:00
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GstCaps *newcaps;
|
|
|
|
|
|
|
|
if (gst_caps_get_size (caps) > 1) return NULL;
|
|
|
|
|
|
|
|
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",
|
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
|
|
|
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
|
|
|
|
gst_xvimagesink_get_fourcc_from_caps (GstXvImageSink *xvimagesink,
|
|
|
|
GstCaps *caps)
|
|
|
|
{
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (xvimagesink != NULL, 0);
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), 0);
|
|
|
|
|
|
|
|
list = xvimagesink->xcontext->formats_list;
|
|
|
|
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
GstXvImageFormat *format = list->data;
|
|
|
|
|
|
|
|
if (format)
|
|
|
|
{
|
|
|
|
GstCaps *icaps = NULL;
|
|
|
|
icaps = gst_caps_intersect (caps, format->caps);
|
2003-12-22 01:47:09 +00:00
|
|
|
if (!gst_caps_is_empty(icaps))
|
|
|
|
return format->format;
|
2003-11-28 21:47:51 +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 *
|
2003-12-22 01:47:09 +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));
|
|
|
|
|
|
|
|
if (xvimagesink->xcontext)
|
|
|
|
return gst_caps_copy (xvimagesink->xcontext->caps);
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
return gst_caps_from_string(
|
|
|
|
"video/x-raw-rgb, "
|
sys/ximage/ximagesink.c: Change to using a framerate of [1,100] instead of [0,MAX], since 0 isn't handled correctly, ...
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_getcaps),
(gst_ximagesink_set_xwindow_id): Change to using a framerate
of [1,100] instead of [0,MAX], since 0 isn't handled correctly,
and neither is 100+, most likely.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_getcaps): same
2004-01-20 09:25:51 +00:00
|
|
|
"framerate = (double) [ 1.0, 100.0 ], "
|
2003-12-22 01:47:09 +00:00
|
|
|
"width = (int) [ 0, MAX ], "
|
|
|
|
"height = (int) [ 0, MAX ]; "
|
|
|
|
"video/x-raw-yuv, "
|
|
|
|
"framerate = (double) [ 0, MAX ], "
|
|
|
|
"width = (int) [ 0, MAX ], "
|
|
|
|
"height = (int) [ 0, MAX ]");
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstPadLinkReturn
|
2004-02-01 22:33:07 +00:00
|
|
|
gst_xvimagesink_sink_link (GstPad *pad, const GstCaps *caps)
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
2003-11-26 10:12:05 +00:00
|
|
|
char *caps_str1, *caps_str2;
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
|
|
|
gboolean ret;
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (gst_pad_get_parent (pad));
|
|
|
|
|
2003-11-26 10:12:05 +00:00
|
|
|
caps_str1 = gst_caps_to_string (xvimagesink->xcontext->caps);
|
|
|
|
caps_str2 = gst_caps_to_string (caps);
|
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
|
|
|
|
2003-11-26 10:12:05 +00:00
|
|
|
GST_DEBUG ("sinkconnect %s with %s", caps_str1, caps_str2);
|
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
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
g_free (caps_str1);
|
|
|
|
g_free (caps_str2);
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 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
|
|
|
ret = gst_structure_get_int (structure, "width",
|
|
|
|
&(GST_VIDEOSINK_WIDTH (xvimagesink)));
|
|
|
|
ret &= gst_structure_get_int (structure, "height",
|
|
|
|
&(GST_VIDEOSINK_HEIGHT (xvimagesink)));
|
|
|
|
ret &= gst_structure_get_double (structure, "framerate",
|
|
|
|
&xvimagesink->framerate);
|
2003-12-22 01:47:09 +00:00
|
|
|
if (!ret) return GST_PAD_LINK_REFUSED;
|
|
|
|
|
2004-01-02 10:04:34 +00:00
|
|
|
xvimagesink->xcontext->im_format = 0;
|
2003-12-22 01:47:09 +00:00
|
|
|
if (!gst_structure_get_fourcc (structure, "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
|
|
|
&xvimagesink->xcontext->im_format)) {
|
2003-11-28 21:47:51 +00:00
|
|
|
xvimagesink->xcontext->im_format = gst_xvimagesink_get_fourcc_from_caps (
|
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
|
|
|
xvimagesink, gst_caps_copy(caps));
|
2003-12-22 01:47:09 +00:00
|
|
|
}
|
2004-01-02 10:04:34 +00:00
|
|
|
if (xvimagesink->xcontext->im_format == 0) {
|
|
|
|
return GST_PAD_LINK_REFUSED;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
xvimagesink->pixel_width = 1;
|
|
|
|
gst_structure_get_int (structure, "pixel_width", &xvimagesink->pixel_width);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
xvimagesink->pixel_height = 1;
|
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_structure_get_int (structure, "pixel_height",
|
|
|
|
&xvimagesink->pixel_height);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
/* Creating our window and our image */
|
|
|
|
if (!xvimagesink->xwindow)
|
|
|
|
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
|
2003-11-19 20:43:49 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (xvimagesink->xwindow->internal)
|
|
|
|
gst_xvimagesink_xwindow_resize (xvimagesink, xvimagesink->xwindow,
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
if ( (xvimagesink->xvimage) &&
|
2003-11-19 20:43:49 +00:00
|
|
|
( (GST_VIDEOSINK_WIDTH (xvimagesink) != xvimagesink->xvimage->width) ||
|
|
|
|
(GST_VIDEOSINK_HEIGHT (xvimagesink) != xvimagesink->xvimage->height) ) )
|
2003-11-10 18:22:20 +00:00
|
|
|
{ /* We renew our xvimage only if size changed */
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimagesink->xvimage);
|
|
|
|
|
|
|
|
xvimagesink->xvimage = gst_xvimagesink_xvimage_new (xvimagesink,
|
2003-11-19 20:43:49 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
else if (!xvimagesink->xvimage) /* If no xvimage, creating one */
|
|
|
|
xvimagesink->xvimage = gst_xvimagesink_xvimage_new (xvimagesink,
|
2003-11-19 20:43:49 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
2003-11-10 18:22:20 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
gst_x_overlay_got_desired_size (GST_X_OVERLAY (xvimagesink),
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
2003-11-17 16:32:29 +00:00
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
return GST_PAD_LINK_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstElementStateReturn
|
|
|
|
gst_xvimagesink_change_state (GstElement *element)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (element);
|
|
|
|
|
|
|
|
switch (GST_STATE_TRANSITION (element)) {
|
|
|
|
case GST_STATE_NULL_TO_READY:
|
|
|
|
/* Initializing the XContext */
|
2003-11-17 16:32:29 +00:00
|
|
|
if (!xvimagesink->xcontext)
|
|
|
|
xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink);
|
2003-11-10 18:22:20 +00:00
|
|
|
if (!xvimagesink->xcontext)
|
|
|
|
return GST_STATE_FAILURE;
|
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
|
|
|
else /* If context initialized correctly let's commit our colorbalance */
|
|
|
|
gst_xvimagesink_update_colorbalance (xvimagesink);
|
2003-11-10 18:22:20 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_READY_TO_PAUSED:
|
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:
|
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->xvimage)
|
|
|
|
{
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimagesink->xvimage);
|
|
|
|
xvimagesink->xvimage = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimagesink->image_pool)
|
|
|
|
gst_xvimagesink_imagepool_clear (xvimagesink);
|
|
|
|
|
|
|
|
if (xvimagesink->xwindow)
|
|
|
|
{
|
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
|
|
|
xvimagesink->xwindow = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (xvimagesink->xcontext)
|
|
|
|
{
|
|
|
|
gst_xvimagesink_xcontext_clear (xvimagesink);
|
|
|
|
xvimagesink->xcontext = NULL;
|
|
|
|
}
|
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
|
2003-12-14 05:10:28 +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 (pad != NULL);
|
|
|
|
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));
|
|
|
|
|
2003-12-14 05:10:28 +00:00
|
|
|
if (GST_IS_EVENT (data))
|
2003-11-10 18:22:20 +00:00
|
|
|
{
|
ext/alsa/gstalsamixer.c: Setting mixer interface type to HARDWARE.
Original commit message from CVS:
2004-01-15 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_interface_init): Setting
mixer interface type to HARDWARE.
* gst-libs/gst/mixer/mixer.c: (gst_mixer_class_init): Adding a default
type to SOFTWARE.
* gst-libs/gst/mixer/mixer.h: Adding mixer interface type and macro.
* gst-libs/gst/mixer/mixertrack.h: Adding mixertrack flag SOFTWARE.
* gst/volume/gstvolume.c: (gst_volume_interface_supported),
(gst_volume_interface_init), (gst_volume_list_tracks),
(gst_volume_set_volume), (gst_volume_get_volume),
(gst_volume_set_mute), (gst_volume_mixer_init),
(gst_volume_dispose), (gst_volume_get_type), (volume_class_init),
(volume_init): Implementing mixer interface.
* gst/volume/gstvolume.h: Adding tracklist for mixer interface.
* sys/oss/gstosselement.c: (gst_osselement_get_type),
(gst_osselement_change_state): Removing some trailing commas in
structures.
* sys/oss/gstossmixer.c: (gst_ossmixer_interface_init): Setting mixer
interface type to HARDWARE.
* sys/v4l/gstv4lcolorbalance.c:
(gst_v4l_color_balance_interface_init): Setting colorbalance interface
type to HARDWARE.
* sys/v4l2/gstv4l2colorbalance.c:
(gst_v4l2_color_balance_interface_init): Setting colorbalance
interface type to HARDWARE.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain): use exactly the
same code than ximagesink for event handling.
2004-01-15 15:50:10 +00:00
|
|
|
gst_pad_event_default (pad, GST_EVENT (data));
|
2003-11-10 18:22:20 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
GST_DEBUG ("videosink: clock wait: %" G_GUINT64_FORMAT, 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
|
|
|
}
|
|
|
|
|
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-01-15 21:05:17 +00:00
|
|
|
if (GST_BUFFER_FREE_DATA_FUNC (buf) == gst_xvimagesink_buffer_free)
|
2004-01-11 22:52:29 +00:00
|
|
|
{
|
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, GST_BUFFER_PRIVATE (buf));
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
else /* Else we have to copy the data into our private image, */
|
|
|
|
{ /* if we have one... */
|
|
|
|
if (xvimagesink->xvimage)
|
|
|
|
{
|
|
|
|
memcpy (xvimagesink->xvimage->xvimage->data,
|
|
|
|
GST_BUFFER_DATA (buf),
|
|
|
|
MIN (GST_BUFFER_SIZE (buf), xvimagesink->xvimage->size));
|
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, xvimagesink->xvimage);
|
|
|
|
}
|
|
|
|
else /* No image available. Something went wrong during capsnego ! */
|
|
|
|
{
|
|
|
|
gst_buffer_unref (buf);
|
2004-02-02 17:23:33 +00:00
|
|
|
GST_ELEMENT_ERROR (xvimagesink, CORE, NEGOTIATION, (NULL), ("no format defined before chain function"));
|
2003-11-10 18:22:20 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
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);
|
|
|
|
|
|
|
|
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-01-12 02:01:52 +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-01-12 02:01:52 +00:00
|
|
|
xvimage = GST_BUFFER_PRIVATE (buffer);
|
2004-01-11 22:52:29 +00:00
|
|
|
|
|
|
|
g_assert (GST_IS_XVIMAGESINK (xvimage->xvimagesink));
|
|
|
|
xvimagesink = xvimage->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
|
|
|
/* If our geometry changed we can't reuse that image. */
|
|
|
|
if ( (xvimage->width != GST_VIDEOSINK_WIDTH (xvimagesink)) ||
|
|
|
|
(xvimage->height != GST_VIDEOSINK_HEIGHT (xvimagesink)) )
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
|
|
|
|
else /* In that case we can reuse the image and add it to our image pool. */
|
|
|
|
{
|
|
|
|
g_mutex_lock (xvimagesink->pool_lock);
|
|
|
|
xvimagesink->image_pool = g_slist_prepend (xvimagesink->image_pool,
|
|
|
|
xvimage);
|
|
|
|
g_mutex_unlock (xvimagesink->pool_lock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstBuffer *
|
|
|
|
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;
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* Walking through the pool cleaning unsuable images and searching for a
|
|
|
|
suitable one */
|
|
|
|
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,
|
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->image_pool);
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
if ( (xvimage->width != GST_VIDEOSINK_WIDTH (xvimagesink)) ||
|
|
|
|
(xvimage->height != GST_VIDEOSINK_HEIGHT (xvimagesink)) )
|
2003-11-10 18:22:20 +00:00
|
|
|
{ /* This image is unusable. Destroying... */
|
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
|
|
|
|
xvimage = NULL;
|
|
|
|
}
|
|
|
|
else /* We found a suitable image */
|
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
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock (xvimagesink->pool_lock);
|
|
|
|
|
|
|
|
if (!xvimage) /* We found no suitable image in the pool. Creating... */
|
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
|
|
|
{
|
|
|
|
xvimage = gst_xvimagesink_xvimage_new (xvimagesink,
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
|
|
|
}
|
2003-11-10 18:22:20 +00:00
|
|
|
|
|
|
|
if (xvimage)
|
|
|
|
{
|
|
|
|
buffer = gst_buffer_new ();
|
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-01-11 22:52:29 +00:00
|
|
|
/* Storing some pointers in the buffer */
|
|
|
|
GST_BUFFER_PRIVATE (buffer) = xvimage;
|
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-11-10 18:22:20 +00:00
|
|
|
GST_BUFFER_DATA (buffer) = xvimage->xvimage->data;
|
2004-01-12 02:01:52 +00:00
|
|
|
GST_BUFFER_FREE_DATA_FUNC (buffer) = gst_xvimagesink_buffer_free;
|
2003-11-10 18:22:20 +00:00
|
|
|
GST_BUFFER_SIZE (buffer) = xvimage->size;
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* Interfaces stuff */
|
|
|
|
|
|
|
|
static gboolean
|
2003-12-07 12:11:30 +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 ||
|
|
|
|
type == GST_TYPE_X_OVERLAY ||
|
|
|
|
type == GST_TYPE_COLOR_BALANCE);
|
2003-11-17 16:32:29 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-12-07 12:11:30 +00:00
|
|
|
gst_xvimagesink_interface_init (GstImplementsInterfaceClass *klass)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
klass->supported = gst_xvimagesink_interface_supported;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-11-19 20:43:49 +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;
|
|
|
|
double x,y;
|
|
|
|
|
|
|
|
event = gst_event_new (GST_EVENT_NAVIGATION);
|
|
|
|
event->event_data.structure.structure = structure;
|
|
|
|
|
|
|
|
/* Converting pointer coordinates to the non scaled geometry */
|
|
|
|
if (gst_structure_get_double (structure, "pointer_x", &x))
|
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
x *= GST_VIDEOSINK_WIDTH (xvimagesink);
|
2003-11-17 16:32:29 +00:00
|
|
|
x /= xvimagesink->xwindow->width;
|
|
|
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, x, NULL);
|
|
|
|
}
|
|
|
|
if (gst_structure_get_double (structure, "pointer_y", &y))
|
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
y *= GST_VIDEOSINK_HEIGHT (xvimagesink);
|
2003-11-17 16:32:29 +00:00
|
|
|
y /= xvimagesink->xwindow->height;
|
|
|
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, 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
|
|
|
gst_pad_send_event (gst_pad_get_peer (GST_VIDEOSINK_PAD (xvimagesink)),
|
|
|
|
event);
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_navigation_init (GstNavigationInterface *iface)
|
|
|
|
{
|
|
|
|
iface->send_event = gst_xvimagesink_navigation_send_event;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_set_xwindow_id (GstXOverlay *overlay, XID xwindow_id)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
GstXWindow *xwindow = NULL;
|
|
|
|
XWindowAttributes attr;
|
|
|
|
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (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
|
|
|
/* If we already use that window return */
|
|
|
|
if (xvimagesink->xwindow && (xwindow_id == xvimagesink->xwindow->win))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* If the element has not initialized the X11 context try to do so */
|
2003-11-17 16:32:29 +00:00
|
|
|
if (!xvimagesink->xcontext)
|
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
|
|
|
xvimagesink->xcontext = gst_xvimagesink_xcontext_get (xvimagesink);
|
2003-11-17 16:32:29 +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 (!xvimagesink->xcontext)
|
|
|
|
{
|
|
|
|
g_warning ("xvimagesink was unable to obtain the X11 context.");
|
|
|
|
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
|
|
|
else /* If context initialized correctly let's commit our colorbalance */
|
|
|
|
gst_xvimagesink_update_colorbalance (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
|
|
|
|
|
|
|
/* Clear image pool as the images are unusable anyway */
|
|
|
|
gst_xvimagesink_imagepool_clear (xvimagesink);
|
|
|
|
|
|
|
|
/* Clear the xvimage */
|
|
|
|
if (xvimagesink->xvimage)
|
|
|
|
{
|
2003-11-17 16:32:29 +00:00
|
|
|
gst_xvimagesink_xvimage_destroy (xvimagesink, xvimagesink->xvimage);
|
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->xvimage = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If a window is there already we destroy it */
|
|
|
|
if (xvimagesink->xwindow)
|
|
|
|
{
|
2003-11-17 16:32:29 +00:00
|
|
|
gst_xvimagesink_xwindow_destroy (xvimagesink, xvimagesink->xwindow);
|
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->xwindow = NULL;
|
2003-11-17 16:32:29 +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 xid is 0 we go back to an internal window */
|
|
|
|
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,
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
|
|
|
|
|
|
|
xwindow->win = xwindow_id;
|
2003-11-17 16:32:29 +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
|
|
|
/* 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 |
|
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask);
|
|
|
|
|
|
|
|
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
|
|
|
|
xwindow->win, 0, NULL);
|
|
|
|
g_mutex_unlock (xvimagesink->x_lock);
|
|
|
|
}
|
2003-11-17 16:32:29 +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
|
|
|
/* Recreating our xvimage */
|
|
|
|
if (!xvimagesink->xvimage &&
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink) &&
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink))
|
|
|
|
{
|
|
|
|
xvimagesink->xvimage = gst_xvimagesink_xvimage_new (
|
|
|
|
xvimagesink,
|
|
|
|
GST_VIDEOSINK_WIDTH (xvimagesink),
|
|
|
|
GST_VIDEOSINK_HEIGHT (xvimagesink));
|
|
|
|
}
|
2003-11-17 16:32:29 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
if (xwindow)
|
|
|
|
xvimagesink->xwindow = xwindow;
|
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
|
|
|
|
gst_xvimagesink_get_desired_size (GstXOverlay *overlay,
|
|
|
|
guint *width, guint *height)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
gst_xvimagesink_expose (GstXOverlay *overlay)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (overlay);
|
|
|
|
|
|
|
|
if (xvimagesink->cur_image) {
|
|
|
|
gst_xvimagesink_xvimage_put (xvimagesink, xvimagesink->cur_image);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
static void
|
|
|
|
gst_xvimagesink_xoverlay_init (GstXOverlayClass *iface)
|
|
|
|
{
|
|
|
|
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 *
|
|
|
|
gst_xvimagesink_colorbalance_list_channels (GstColorBalance *balance)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
|
|
|
|
|
|
|
g_return_val_if_fail (xvimagesink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
|
|
|
|
|
|
|
|
if (xvimagesink->xcontext)
|
|
|
|
return xvimagesink->xcontext->channels_list;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_colorbalance_set_value (GstColorBalance *balance,
|
|
|
|
GstColorBalanceChannel *channel,
|
|
|
|
gint value)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (balance);
|
|
|
|
|
|
|
|
g_return_if_fail (xvimagesink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
|
|
|
g_return_if_fail (channel->label != 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
|
|
|
xvimagesink->cb_changed = TRUE;
|
|
|
|
|
|
|
|
/* Normalize val to [-1000, 1000] */
|
|
|
|
value = -1000 + 2000 * (value - channel->min_value) /
|
|
|
|
(channel->max_value - channel->min_value);
|
|
|
|
|
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 (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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
gst_xvimagesink_colorbalance_get_value (GstColorBalance *balance,
|
|
|
|
GstColorBalanceChannel *channel)
|
|
|
|
{
|
|
|
|
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;
|
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 (xvimagesink != NULL, 0);
|
|
|
|
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), 0);
|
|
|
|
g_return_val_if_fail (channel->label != NULL, 0);
|
|
|
|
|
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 (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/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
|
|
|
|
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) *
|
|
|
|
(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
|
|
|
|
gst_xvimagesink_colorbalance_init (GstColorBalanceClass *iface)
|
|
|
|
{
|
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
|
|
|
|
gst_xvimagesink_set_property (GObject *object, guint prop_id,
|
|
|
|
const GValue *value, GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case ARG_HUE:
|
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 = g_value_get_int (value);
|
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;
|
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/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
|
|
|
break;
|
|
|
|
case ARG_CONTRAST:
|
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->contrast = g_value_get_int (value);
|
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;
|
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/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
|
|
|
break;
|
|
|
|
case ARG_BRIGHTNESS:
|
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->brightness = g_value_get_int (value);
|
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;
|
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/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
|
|
|
break;
|
|
|
|
case ARG_SATURATION:
|
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->saturation = g_value_get_int (value);
|
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;
|
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/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
|
|
|
break;
|
|
|
|
case ARG_DISPLAY:
|
|
|
|
xvimagesink->display_name = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
2004-01-16 23:52:53 +00:00
|
|
|
case ARG_SYNCHRONOUS:
|
|
|
|
xvimagesink->synchronous = g_value_get_boolean (value);
|
|
|
|
if (xvimagesink->xcontext) {
|
|
|
|
XSynchronize (xvimagesink->xcontext->disp,
|
2004-01-18 12:32:19 +00:00
|
|
|
xvimagesink->synchronous);
|
2004-01-16 23:52:53 +00:00
|
|
|
}
|
|
|
|
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
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_get_property (GObject *object, guint prop_id,
|
|
|
|
GValue *value, GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_XVIMAGESINK (object));
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case ARG_HUE:
|
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_value_set_int (value, xvimagesink->hue);
|
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
|
|
|
break;
|
|
|
|
case ARG_CONTRAST:
|
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_value_set_int (value, xvimagesink->contrast);
|
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
|
|
|
break;
|
|
|
|
case ARG_BRIGHTNESS:
|
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_value_set_int (value, xvimagesink->brightness);
|
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
|
|
|
break;
|
|
|
|
case ARG_SATURATION:
|
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_value_set_int (value, xvimagesink->saturation);
|
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
|
|
|
break;
|
|
|
|
case ARG_DISPLAY:
|
|
|
|
g_value_set_string (value, g_strdup (xvimagesink->display_name));
|
|
|
|
break;
|
2004-01-16 23:52:53 +00:00
|
|
|
case ARG_SYNCHRONOUS:
|
|
|
|
g_value_set_boolean (value, xvimagesink->synchronous);
|
|
|
|
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
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
static void
|
|
|
|
gst_xvimagesink_dispose (GObject *object)
|
|
|
|
{
|
|
|
|
GstXvImageSink *xvimagesink;
|
|
|
|
|
|
|
|
xvimagesink = GST_XVIMAGESINK (object);
|
|
|
|
|
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
|
|
|
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);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_init (GstXvImageSink *xvimagesink)
|
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
GST_VIDEOSINK_PAD (xvimagesink) = gst_pad_new_from_template (
|
2003-12-22 01:47:09 +00:00
|
|
|
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),
|
|
|
|
GST_VIDEOSINK_PAD (xvimagesink));
|
|
|
|
|
|
|
|
gst_pad_set_chain_function (GST_VIDEOSINK_PAD (xvimagesink),
|
|
|
|
gst_xvimagesink_chain);
|
|
|
|
gst_pad_set_link_function (GST_VIDEOSINK_PAD (xvimagesink),
|
2004-02-01 22:33:07 +00:00
|
|
|
gst_xvimagesink_sink_link);
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_pad_set_getcaps_function (GST_VIDEOSINK_PAD (xvimagesink),
|
|
|
|
gst_xvimagesink_getcaps);
|
2004-01-02 10:04:34 +00:00
|
|
|
gst_pad_set_fixate_function (GST_VIDEOSINK_PAD (xvimagesink),
|
|
|
|
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),
|
|
|
|
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;
|
2003-11-10 18:22:20 +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;
|
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-12 11:02:31 +00:00
|
|
|
xvimagesink->framerate = 0;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
xvimagesink->x_lock = g_mutex_new ();
|
|
|
|
|
|
|
|
xvimagesink->pixel_width = xvimagesink->pixel_height = 1;
|
|
|
|
|
|
|
|
xvimagesink->image_pool = NULL;
|
|
|
|
xvimagesink->pool_lock = g_mutex_new ();
|
|
|
|
|
|
|
|
GST_FLAG_SET(xvimagesink, GST_ELEMENT_THREAD_SUGGESTED);
|
|
|
|
GST_FLAG_SET(xvimagesink, GST_ELEMENT_EVENT_AWARE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &gst_xvimagesink_details);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_static_pad_template_get (&gst_xvimagesink_sink_template_factory));
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_xvimagesink_class_init (GstXvImageSinkClass *klass)
|
|
|
|
{
|
|
|
|
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,
|
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_param_spec_int ("contrast", "Contrast", "The contrast 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_BRIGHTNESS,
|
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_param_spec_int ("brightness", "Brightness", "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,
|
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_param_spec_int ("hue", "Hue", "The hue 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_SATURATION,
|
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_param_spec_int ("saturation", "Saturation", "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,
|
|
|
|
g_param_spec_string ("display", "Display", "X Display name",
|
|
|
|
NULL, G_PARAM_READWRITE));
|
2004-01-16 23:52:53 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_SYNCHRONOUS,
|
|
|
|
g_param_spec_boolean ("synchronous", "Synchronous", "When enabled, runs "
|
|
|
|
"the X display in synchronous mode. (used only for debugging)", FALSE,
|
|
|
|
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
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
gobject_class->dispose = gst_xvimagesink_dispose;
|
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;
|
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;
|
|
|
|
|
|
|
|
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,
|
|
|
|
};
|
2003-11-17 16:32:29 +00:00
|
|
|
static const GInterfaceInfo overlay_info = {
|
2003-11-10 18:22:20 +00:00
|
|
|
(GInterfaceInitFunc) gst_xvimagesink_xoverlay_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
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 GInterfaceInfo colorbalance_info = {
|
|
|
|
(GInterfaceInitFunc) gst_xvimagesink_colorbalance_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
2003-11-10 18:22:20 +00:00
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
xvimagesink_type = g_type_register_static (GST_TYPE_VIDEOSINK,
|
2003-11-10 18:22:20 +00:00
|
|
|
"GstXvImageSink",
|
|
|
|
&xvimagesink_info, 0);
|
|
|
|
|
2003-12-07 12:11:30 +00:00
|
|
|
g_type_add_interface_static (xvimagesink_type, GST_TYPE_IMPLEMENTS_INTERFACE,
|
2003-11-17 16:32:29 +00:00
|
|
|
&iface_info);
|
2003-11-10 18:22:20 +00:00
|
|
|
g_type_add_interface_static (xvimagesink_type, GST_TYPE_NAVIGATION,
|
2003-11-17 16:32:29 +00:00
|
|
|
&navigation_info);
|
|
|
|
g_type_add_interface_static (xvimagesink_type, GST_TYPE_X_OVERLAY,
|
|
|
|
&overlay_info);
|
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_type_add_interface_static (xvimagesink_type, GST_TYPE_COLOR_BALANCE,
|
|
|
|
&colorbalance_info);
|
2003-11-10 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return xvimagesink_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin *plugin)
|
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
/* Loading the library containing GstVideoSink, our parent object */
|
|
|
|
if (!gst_library_load ("gstvideo"))
|
|
|
|
return FALSE;
|
|
|
|
|
2003-11-10 18:22:20 +00:00
|
|
|
if (!gst_element_register (plugin, "xvimagesink",
|
|
|
|
GST_RANK_PRIMARY, GST_TYPE_XVIMAGESINK))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|