2003-11-06 21:51:14 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2003> Julien Moutte <julien@moutte.net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Our interfaces */
|
2003-11-22 04:06:50 +00:00
|
|
|
#include <gst/navigation/navigation.h>
|
|
|
|
#include <gst/xoverlay/xoverlay.h>
|
2003-11-06 21:51:14 +00:00
|
|
|
|
|
|
|
/* Object header */
|
|
|
|
#include "ximagesink.h"
|
|
|
|
|
2004-04-20 15:45:07 +00:00
|
|
|
/* Debugging category */
|
|
|
|
#include <gst/gstinfo.h>
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_debug_ximagesink);
|
|
|
|
#define GST_CAT_DEFAULT gst_debug_ximagesink
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long functions;
|
|
|
|
unsigned long decorations;
|
|
|
|
long input_mode;
|
|
|
|
unsigned long status;
|
|
|
|
}
|
|
|
|
MotifWmHints, MwmHints;
|
|
|
|
|
|
|
|
#define MWM_HINTS_DECORATIONS (1L << 1)
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void gst_ximagesink_buffer_free (GstBuffer * buffer);
|
2004-07-27 10:27:53 +00:00
|
|
|
static void gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
|
|
|
|
GstXImage * ximage);
|
2004-01-15 22:03:45 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
/* ElementFactory information */
|
2004-03-14 22:34:34 +00:00
|
|
|
static GstElementDetails gst_ximagesink_details =
|
|
|
|
GST_ELEMENT_DETAILS ("Video sink",
|
|
|
|
"Sink/Video",
|
|
|
|
"A standard X based videosink",
|
|
|
|
"Julien Moutte <julien@moutte.net>");
|
2003-11-06 21:51:14 +00:00
|
|
|
|
|
|
|
/* Default template - initiated with class struct to allow gst-register to work
|
|
|
|
without X running */
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_ximagesink_sink_template_factory =
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-raw-rgb, "
|
2004-08-09 20:07:10 +00:00
|
|
|
"framerate = (double) [ 1.0, 100.0 ], "
|
2004-05-05 11:29:49 +00:00
|
|
|
"width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]")
|
2004-03-14 22:34:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
ARG_0,
|
2004-01-18 12:32:19 +00:00
|
|
|
ARG_DISPLAY,
|
2004-07-27 16:43:24 +00:00
|
|
|
ARG_SYNCHRONOUS,
|
|
|
|
ARG_PIXEL_ASPECT_RATIO
|
2004-03-14 22:34:34 +00:00
|
|
|
/* FILL ME */
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
};
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
static GstVideoSinkClass *parent_class = NULL;
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
static gboolean error_caught = FALSE;
|
2003-11-06 21:51:14 +00:00
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Private Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
/* X11 stuff */
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
static int
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_handle_xerror (Display * display, XErrorEvent * xevent)
|
2004-01-28 00:29:42 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
char error_msg[1024];
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
XGetErrorText (display, xevent->error_code, error_msg, 1024);
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_DEBUG ("ximagesink failed to use XShm calls. error: %s", error_msg);
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
error_caught = TRUE;
|
2004-01-28 00:29:42 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function checks that it is actually really possible to create an image
|
|
|
|
using XShm */
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_check_xshm_calls (GstXContext * xcontext)
|
2004-01-28 00:29:42 +00:00
|
|
|
{
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
#ifndef HAVE_XSHM
|
|
|
|
return FALSE;
|
|
|
|
#else
|
2004-01-28 00:29:42 +00:00
|
|
|
GstXImage *ximage = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
int (*handler) (Display *, XErrorEvent *);
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
gboolean result = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
g_return_val_if_fail (xcontext != NULL, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
ximage = g_new0 (GstXImage, 1);
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
g_return_val_if_fail (ximage != NULL, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
/* Setting an error handler to catch failure */
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
error_caught = FALSE;
|
2004-01-28 00:29:42 +00:00
|
|
|
handler = XSetErrorHandler (gst_ximagesink_handle_xerror);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
/* Trying to create a 1x1 picture */
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_DEBUG ("XShmCreateImage of 1x1");
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
ximage->ximage = XShmCreateImage (xcontext->disp, xcontext->visual,
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->depth, ZPixmap, NULL, &ximage->SHMInfo, 1, 1);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!ximage->ximage) {
|
|
|
|
GST_WARNING ("could not XShmCreateImage a 1x1 image");
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
ximage->size = ximage->ximage->height * ximage->ximage->bytes_per_line;
|
2004-01-28 00:29:42 +00:00
|
|
|
|
|
|
|
ximage->SHMInfo.shmid = shmget (IPC_PRIVATE, ximage->size, IPC_CREAT | 0777);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (ximage->SHMInfo.shmid == -1) {
|
|
|
|
GST_WARNING ("could not get shared memory of %d bytes", ximage->size);
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
ximage->SHMInfo.shmaddr = shmat (ximage->SHMInfo.shmid, 0, 0);
|
Fixes: #151879, #151881, #151882, #151883, #151884, #151886, #151887, #152102, #152247.
Original commit message from CVS:
Fixes: #151879, #151881, #151882, #151883, #151884, #151886,
#151887, #152102, #152247.
* examples/indexing/indexmpeg.c: 64-bit warning fixes.
* examples/seeking/cdparanoia.c: same
* examples/seeking/cdplayer.c: same
* examples/seeking/seek.c: same
* examples/seeking/spider_seek.c: same
* examples/seeking/vorbisfile.c: same
* examples/stats/mp2ogg.c: same
* ext/esd/esdsink.c: (gst_esdsink_class_init),
(gst_esdsink_dispose): Dispose of element properly.
* ext/ivorbis/vorbisfile.c: (gst_ivorbisfile_seek): 64-bit warning
fixes.
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_dispose): Dispose of element correctly.
* gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Fix leak.
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy):
Fix 64-bit warning.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy):
Fix 64-bit warning.
2004-09-12 22:57:27 +00:00
|
|
|
if (ximage->SHMInfo.shmaddr == ((void *) -1)) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_WARNING ("Failed to shmat: %s", g_strerror (errno));
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
2004-01-28 00:29:42 +00:00
|
|
|
ximage->ximage->data = ximage->SHMInfo.shmaddr;
|
|
|
|
ximage->SHMInfo.readOnly = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
if (XShmAttach (xcontext->disp, &ximage->SHMInfo) == 0) {
|
|
|
|
GST_WARNING ("Failed to XShmAttach");
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-01-28 00:29:42 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
XSync (xcontext->disp, 0);
|
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
XShmDetach (xcontext->disp, &ximage->SHMInfo);
|
|
|
|
shmdt (ximage->SHMInfo.shmaddr);
|
|
|
|
shmctl (ximage->SHMInfo.shmid, IPC_RMID, 0);
|
|
|
|
|
|
|
|
/* store whether we succeeded in result and reset error_caught */
|
|
|
|
result = !error_caught;
|
|
|
|
error_caught = FALSE;
|
|
|
|
|
|
|
|
beach:
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
XSetErrorHandler (handler);
|
|
|
|
if (ximage->ximage)
|
|
|
|
XFree (ximage->ximage);
|
|
|
|
g_free (ximage);
|
|
|
|
XSync (xcontext->disp, FALSE);
|
|
|
|
return result;
|
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-01-28 00:29:42 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
/* This function handles GstXImage creation depending on XShm availability */
|
2003-11-06 21:51:14 +00:00
|
|
|
static GstXImage *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_ximage_new (GstXImageSink * ximagesink, gint width, gint height)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXImage *ximage = NULL;
|
2004-07-27 10:27:53 +00:00
|
|
|
gboolean succeeded = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "creating %dx%d", width, height);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
ximage = g_new0 (GstXImage, 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
ximage->width = width;
|
|
|
|
ximage->height = height;
|
2004-01-11 22:52:29 +00:00
|
|
|
ximage->ximagesink = ximagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->xcontext->use_xshm) {
|
|
|
|
ximage->ximage = XShmCreateImage (ximagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->xcontext->visual,
|
|
|
|
ximagesink->xcontext->depth,
|
|
|
|
ZPixmap, NULL, &ximage->SHMInfo, ximage->width, ximage->height);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!ximage->ximage) {
|
|
|
|
GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("could not XShmCreateImage a %dx%d image"));
|
|
|
|
goto beach;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we have to use the returned bytes_per_line for our shm size */
|
2004-07-26 13:00:27 +00:00
|
|
|
ximage->size = ximage->ximage->bytes_per_line * ximage->ximage->height;
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "XShm image size is %d, width %d, stride %d",
|
|
|
|
ximage->size, ximage->width, ximage->ximage->bytes_per_line);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
ximage->SHMInfo.shmid = shmget (IPC_PRIVATE, ximage->size,
|
2004-03-15 19:32:28 +00:00
|
|
|
IPC_CREAT | 0777);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (ximage->SHMInfo.shmid == -1) {
|
|
|
|
GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("could not get shared memory of %d bytes", ximage->size));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
ximage->SHMInfo.shmaddr = shmat (ximage->SHMInfo.shmid, 0, 0);
|
Fixes: #151879, #151881, #151882, #151883, #151884, #151886, #151887, #152102, #152247.
Original commit message from CVS:
Fixes: #151879, #151881, #151882, #151883, #151884, #151886,
#151887, #152102, #152247.
* examples/indexing/indexmpeg.c: 64-bit warning fixes.
* examples/seeking/cdparanoia.c: same
* examples/seeking/cdplayer.c: same
* examples/seeking/seek.c: same
* examples/seeking/spider_seek.c: same
* examples/seeking/vorbisfile.c: same
* examples/stats/mp2ogg.c: same
* ext/esd/esdsink.c: (gst_esdsink_class_init),
(gst_esdsink_dispose): Dispose of element properly.
* ext/ivorbis/vorbisfile.c: (gst_ivorbisfile_seek): 64-bit warning
fixes.
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_dispose): Dispose of element correctly.
* gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Fix leak.
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy):
Fix 64-bit warning.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy):
Fix 64-bit warning.
2004-09-12 22:57:27 +00:00
|
|
|
if (ximage->SHMInfo.shmaddr == ((void *) -1)) {
|
2004-07-27 10:27:53 +00:00
|
|
|
GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("Failed to shmat: %s", g_strerror (errno)));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
ximage->ximage->data = ximage->SHMInfo.shmaddr;
|
2004-03-14 22:34:34 +00:00
|
|
|
ximage->SHMInfo.readOnly = FALSE;
|
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
if (XShmAttach (ximagesink->xcontext->disp, &ximage->SHMInfo) == 0) {
|
|
|
|
GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("Failed to XShmAttach"));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
XSync (ximagesink->xcontext->disp, FALSE);
|
|
|
|
} else
|
2003-11-25 04:48:04 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
|
|
|
ximage->ximage = XCreateImage (ximagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->xcontext->visual,
|
|
|
|
ximagesink->xcontext->depth,
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
ZPixmap, 0, NULL,
|
2004-07-26 21:07:33 +00:00
|
|
|
ximage->width, ximage->height, ximagesink->xcontext->bpp, 0);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (!ximage->ximage) {
|
|
|
|
GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE, (NULL),
|
|
|
|
("could not XCreateImage a %dx%d image"));
|
|
|
|
goto beach;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
/* we have to use the returned bytes_per_line for our image size */
|
2004-07-26 21:07:33 +00:00
|
|
|
ximage->size = ximage->ximage->bytes_per_line * ximage->ximage->height;
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
ximage->ximage->data = g_malloc (ximage->size);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
XSync (ximagesink->xcontext->disp, FALSE);
|
|
|
|
}
|
2004-07-27 10:27:53 +00:00
|
|
|
succeeded = TRUE;
|
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 10:27:53 +00:00
|
|
|
beach:
|
|
|
|
if (!succeeded) {
|
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximage);
|
2004-03-14 22:34:34 +00:00
|
|
|
ximage = NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
return ximage;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
/* This function destroys a GstXImage handling XShm availability */
|
2003-11-06 21:51:14 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink, GstXImage * ximage)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (ximage != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
/* If the destroyed image is the current one we destroy our reference too */
|
|
|
|
if (ximagesink->cur_image == ximage)
|
|
|
|
ximagesink->cur_image = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->xcontext->use_xshm) {
|
Fixes: #151879, #151881, #151882, #151883, #151884, #151886, #151887, #152102, #152247.
Original commit message from CVS:
Fixes: #151879, #151881, #151882, #151883, #151884, #151886,
#151887, #152102, #152247.
* examples/indexing/indexmpeg.c: 64-bit warning fixes.
* examples/seeking/cdparanoia.c: same
* examples/seeking/cdplayer.c: same
* examples/seeking/seek.c: same
* examples/seeking/spider_seek.c: same
* examples/seeking/vorbisfile.c: same
* examples/stats/mp2ogg.c: same
* ext/esd/esdsink.c: (gst_esdsink_class_init),
(gst_esdsink_dispose): Dispose of element properly.
* ext/ivorbis/vorbisfile.c: (gst_ivorbisfile_seek): 64-bit warning
fixes.
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_dispose): Dispose of element correctly.
* gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Fix leak.
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy):
Fix 64-bit warning.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy):
Fix 64-bit warning.
2004-09-12 22:57:27 +00:00
|
|
|
if (ximage->SHMInfo.shmaddr != ((void *) -1)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
XShmDetach (ximagesink->xcontext->disp, &ximage->SHMInfo);
|
|
|
|
shmdt (ximage->SHMInfo.shmaddr);
|
2004-07-27 10:27:53 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximage->SHMInfo.shmid > 0)
|
|
|
|
shmctl (ximage->SHMInfo.shmid, IPC_RMID, 0);
|
2004-07-27 10:27:53 +00:00
|
|
|
if (ximage->ximage)
|
|
|
|
XDestroyImage (ximage->ximage);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
|
|
|
#endif /* HAVE_XSHM */
|
|
|
|
{
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
if (ximage->ximage) {
|
2004-07-27 10:27:53 +00:00
|
|
|
if (ximage->ximage->data) {
|
|
|
|
g_free (ximage->ximage->data);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
XDestroyImage (ximage->ximage);
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +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 (ximagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_free (ximage);
|
|
|
|
}
|
|
|
|
|
2003-11-09 19:11:26 +00:00
|
|
|
/* This function puts a GstXImage on a GstXImageSink's window */
|
2003-11-06 21:51:14 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImage * ximage)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
gint x, y;
|
2004-07-26 13:00:27 +00:00
|
|
|
gint w, h;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_return_if_fail (ximage != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
/* Store a reference to the last image we put */
|
|
|
|
if (ximagesink->cur_image != ximage)
|
|
|
|
ximagesink->cur_image = ximage;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-26 13:00:27 +00:00
|
|
|
/* We center the image in the window; so calculate top left corner location */
|
2003-11-13 10:46:12 +00:00
|
|
|
x = MAX (0, (ximagesink->xwindow->width - ximage->width) / 2);
|
2004-03-14 22:34:34 +00:00
|
|
|
y = MAX (0, (ximagesink->xwindow->height - ximage->height) / 2);
|
2003-11-06 21:51:14 +00:00
|
|
|
|
2004-07-26 13:04:32 +00:00
|
|
|
w = ximage->width;
|
|
|
|
h = ximage->height;
|
2004-07-26 13:00:27 +00:00
|
|
|
|
2003-11-15 11:48:55 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->xcontext->use_xshm) {
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_LOG_OBJECT (ximagesink,
|
|
|
|
"XShmPutImage, src: %d, %d - dest: %d, %d, dim: %dx%d",
|
|
|
|
0, 0, x, y, w, h);
|
2004-03-14 22:34:34 +00:00
|
|
|
XShmPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
2004-07-26 13:00:27 +00:00
|
|
|
ximagesink->xwindow->gc, ximage->ximage, 0, 0, x, y, w, h, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
2003-11-26 10:12:05 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
|
|
|
XPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
2004-07-26 13:00:27 +00:00
|
|
|
ximagesink->xwindow->gc, ximage->ximage, 0, 0, x, y, w, h);
|
2004-03-14 22:34:34 +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 (ximagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
static gboolean
|
|
|
|
gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
|
|
|
|
GstXWindow * window)
|
|
|
|
{
|
|
|
|
Atom hints_atom = None;
|
|
|
|
MotifWmHints *hints;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), FALSE);
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
hints_atom = XInternAtom (ximagesink->xcontext->disp, "_MOTIF_WM_HINTS", 1);
|
2004-07-20 19:15:41 +00:00
|
|
|
if (hints_atom == None) {
|
2004-07-27 09:35:52 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-06-27 18:53:04 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2004-07-20 19:15:41 +00:00
|
|
|
hints = g_malloc0 (sizeof (MotifWmHints));
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
hints->flags |= MWM_HINTS_DECORATIONS;
|
|
|
|
hints->decorations = 1 << 0;
|
|
|
|
|
|
|
|
XChangeProperty (ximagesink->xcontext->disp, window->win,
|
|
|
|
hints_atom, hints_atom, 32, PropModeReplace,
|
|
|
|
(guchar *) hints, sizeof (MotifWmHints) / sizeof (long));
|
|
|
|
|
|
|
|
XSync (ximagesink->xcontext->disp, FALSE);
|
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
|
2004-06-27 18:53:04 +00:00
|
|
|
g_free (hints);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-11-09 19:11:26 +00:00
|
|
|
/* This function handles a GstXWindow creation */
|
2003-11-06 21:51:14 +00:00
|
|
|
static GstXWindow *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXWindow *xwindow = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
xwindow->internal = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
xwindow->win = XCreateSimpleWindow (ximagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
ximagesink->xcontext->root,
|
|
|
|
0, 0, xwindow->width, xwindow->height, 0, 0, ximagesink->xcontext->black);
|
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
|
|
|
|
2003-11-07 18:00:39 +00:00
|
|
|
XSelectInput (ximagesink->xcontext->disp, xwindow->win, ExposureMask |
|
2004-03-14 22:34:34 +00:00
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask | ButtonPressMask | ButtonReleaseMask);
|
|
|
|
|
|
|
|
xwindow->gc = XCreateGC (ximagesink->xcontext->disp, xwindow->win, 0, 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
|
|
|
|
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
|
|
|
XMapRaised (ximagesink->xcontext->disp, xwindow->win);
|
2004-03-14 22:34:34 +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 (ximagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-06-27 19:02:29 +00:00
|
|
|
gst_ximagesink_xwindow_decorate (ximagesink, xwindow);
|
|
|
|
|
2004-01-29 10:02:48 +00:00
|
|
|
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (ximagesink), xwindow->win);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
return xwindow;
|
|
|
|
}
|
|
|
|
|
2003-11-09 19:11:26 +00:00
|
|
|
/* This function destroys a GstXWindow */
|
2003-11-06 21:51:14 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xwindow_destroy (GstXImageSink * ximagesink,
|
|
|
|
GstXWindow * xwindow)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* If we did not create that window we just free the GC and let it live */
|
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 (xwindow->internal)
|
2003-11-17 16:32:29 +00:00
|
|
|
XDestroyWindow (ximagesink->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
|
2004-01-04 18:53:53 +00:00
|
|
|
XSelectInput (ximagesink->xcontext->disp, xwindow->win, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
XFreeGC (ximagesink->xcontext->disp, xwindow->gc);
|
2004-03-14 22:34:34 +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 (ximagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_free (xwindow);
|
|
|
|
}
|
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
/* This function resizes a GstXWindow */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xwindow_resize (GstXImageSink * ximagesink, GstXWindow * xwindow,
|
|
|
|
guint width, guint height)
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
xwindow->width = width;
|
|
|
|
xwindow->height = height;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
XResizeWindow (ximagesink->xcontext->disp, xwindow->win,
|
2004-03-14 22:34:34 +00:00
|
|
|
xwindow->width, xwindow->height);
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XSync (ximagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
g_mutex_unlock (ximagesink->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
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xwindow_clear (GstXImageSink * ximagesink, GstXWindow * xwindow)
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XSetForeground (ximagesink->xcontext->disp, xwindow->gc,
|
2004-03-14 22:34:34 +00:00
|
|
|
ximagesink->xcontext->black);
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XFillRectangle (ximagesink->xcontext->disp, xwindow->win, xwindow->gc,
|
2004-03-14 22:34:34 +00:00
|
|
|
0, 0, xwindow->width, xwindow->height);
|
|
|
|
|
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
|
|
|
XSync (ximagesink->xcontext->disp, FALSE);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
}
|
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink,
|
|
|
|
GstXWindow * xwindow)
|
2004-02-18 21:16:50 +00:00
|
|
|
{
|
|
|
|
XWindowAttributes attr;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
g_return_if_fail (xwindow != NULL);
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
/* Update the window geometry */
|
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
XGetWindowAttributes (ximagesink->xcontext->disp,
|
2004-03-14 22:34:34 +00:00
|
|
|
ximagesink->xwindow->win, &attr);
|
2004-02-18 21:16:50 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
ximagesink->xwindow->width = attr.width;
|
|
|
|
ximagesink->xwindow->height = attr.height;
|
|
|
|
}
|
|
|
|
|
2004-02-02 21:59:35 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink)
|
2004-02-02 21:59:35 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-16 23:45:55 +00:00
|
|
|
if (!ximagesink->xwindow)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
gst_ximagesink_xwindow_update_geometry (ximagesink, ximagesink->xwindow);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
if (ximagesink->sw_scaling_failed)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 13:06:49 +00:00
|
|
|
if (ximagesink->xwindow->width <= 1 || ximagesink->xwindow->height <= 1)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 13:06:49 +00:00
|
|
|
if (GST_PAD_IS_NEGOTIATING (GST_VIDEOSINK_PAD (ximagesink)) ||
|
|
|
|
!gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)))
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-02 21:59:35 +00:00
|
|
|
/* Window got resized or moved. We do caps negotiation again to get video
|
2004-02-16 23:45:55 +00:00
|
|
|
scaler to fit that new size only if size of the window differs from our
|
|
|
|
size. */
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 13:06:49 +00:00
|
|
|
if (GST_VIDEOSINK_WIDTH (ximagesink) != ximagesink->xwindow->width ||
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_HEIGHT (ximagesink) != ximagesink->xwindow->height) {
|
|
|
|
GstPadLinkReturn r;
|
2004-07-28 21:28:34 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = gst_caps_new_simple ("video/x-raw-rgb",
|
|
|
|
"bpp", G_TYPE_INT, ximagesink->xcontext->bpp,
|
|
|
|
"depth", G_TYPE_INT, ximagesink->xcontext->depth,
|
|
|
|
"endianness", G_TYPE_INT, ximagesink->xcontext->endianness,
|
|
|
|
"red_mask", G_TYPE_INT, ximagesink->xcontext->visual->red_mask,
|
|
|
|
"green_mask", G_TYPE_INT, ximagesink->xcontext->visual->green_mask,
|
|
|
|
"blue_mask", G_TYPE_INT, ximagesink->xcontext->visual->blue_mask,
|
|
|
|
"width", G_TYPE_INT, ximagesink->xwindow->width,
|
|
|
|
"height", G_TYPE_INT, ximagesink->xwindow->height,
|
|
|
|
"framerate", G_TYPE_DOUBLE, ximagesink->framerate, NULL);
|
|
|
|
|
|
|
|
if (ximagesink->par) {
|
|
|
|
int nom, den;
|
|
|
|
|
|
|
|
nom = gst_value_get_fraction_numerator (ximagesink->par);
|
|
|
|
den = gst_value_get_fraction_denominator (ximagesink->par);
|
|
|
|
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
|
|
|
nom, den, NULL);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-28 21:28:34 +00:00
|
|
|
r = gst_pad_try_set_caps (GST_VIDEOSINK_PAD (ximagesink), caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if ((r == GST_PAD_LINK_OK) || (r == GST_PAD_LINK_DONE)) {
|
|
|
|
/* Renegotiation succeeded, we update our size and image */
|
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink) = ximagesink->xwindow->width;
|
|
|
|
GST_VIDEOSINK_HEIGHT (ximagesink) = ximagesink->xwindow->height;
|
|
|
|
|
|
|
|
if ((ximagesink->ximage) &&
|
2004-03-15 19:32:28 +00:00
|
|
|
((GST_VIDEOSINK_WIDTH (ximagesink) != ximagesink->ximage->width) ||
|
|
|
|
(GST_VIDEOSINK_HEIGHT (ximagesink) !=
|
|
|
|
ximagesink->ximage->height))) {
|
|
|
|
/* We renew our ximage only if size changed */
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "destroying and recreating our ximage");
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
ximagesink->ximage = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ximagesink->sw_scaling_failed = TRUE;
|
2004-02-02 21:59:35 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2004-02-02 21:59:35 +00:00
|
|
|
}
|
|
|
|
|
2003-11-09 19:11:26 +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. */
|
2003-11-08 14:58:35 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_handle_xevents (GstXImageSink * ximagesink, GstPad * pad)
|
2003-11-08 14:58:35 +00:00
|
|
|
{
|
|
|
|
XEvent e;
|
2004-02-18 13:06:49 +00:00
|
|
|
guint pointer_x = 0, pointer_y = 0;
|
2004-02-18 21:16:50 +00:00
|
|
|
gboolean pointer_moved = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-08 14:58:35 +00:00
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
gst_ximagesink_renegotiate_size (ximagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-02 21:59:35 +00:00
|
|
|
/* Then we get all pointer motion events, only the last position is
|
|
|
|
interesting. */
|
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
while (XCheckWindowEvent (ximagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->xwindow->win, PointerMotionMask, &e)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case MotionNotify:
|
2004-03-15 19:32:28 +00:00
|
|
|
pointer_x = e.xmotion.x;
|
|
|
|
pointer_y = e.xmotion.y;
|
|
|
|
pointer_moved = TRUE;
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
2004-03-15 19:32:28 +00:00
|
|
|
break;
|
2004-02-02 21:59:35 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
}
|
2004-02-02 21:59:35 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (pointer_moved) {
|
|
|
|
GST_DEBUG ("ximagesink pointer moved over window at %d,%d",
|
2004-03-15 19:32:28 +00:00
|
|
|
pointer_x, pointer_y);
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink),
|
2004-03-15 19:32:28 +00:00
|
|
|
"mouse-move", 0, pointer_x, pointer_y);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2004-02-02 21:59:35 +00:00
|
|
|
/* We get all remaining events on our window to throw them upstream */
|
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
while (XCheckWindowEvent (ximagesink->xcontext->disp,
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->xwindow->win,
|
|
|
|
KeyPressMask | KeyReleaseMask |
|
|
|
|
ButtonPressMask | ButtonReleaseMask, &e)) {
|
2004-03-14 22:34:34 +00:00
|
|
|
KeySym keysym;
|
|
|
|
|
|
|
|
/* We lock only for the X function call */
|
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
|
|
|
|
switch (e.type) {
|
|
|
|
case ButtonPress:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Mouse button pressed/released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("ximagesink button %d pressed over window at %d,%d",
|
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.x);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink),
|
|
|
|
"mouse-button-press", e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
case ButtonRelease:
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_DEBUG ("ximagesink button %d release over window at %d,%d",
|
|
|
|
e.xbutton.button, e.xbutton.x, e.xbutton.x);
|
|
|
|
gst_navigation_send_mouse_event (GST_NAVIGATION (ximagesink),
|
|
|
|
"mouse-button-release", e.xbutton.button, e.xbutton.x, e.xbutton.y);
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
case KeyPress:
|
|
|
|
case KeyRelease:
|
2004-03-15 19:32:28 +00:00
|
|
|
/* Key pressed/released over our window. We send upstream
|
|
|
|
events for interactivity/navigation */
|
|
|
|
GST_DEBUG ("ximagesink key %d pressed over window at %d,%d",
|
|
|
|
e.xkey.keycode, e.xkey.x, e.xkey.x);
|
|
|
|
keysym = XKeycodeToKeysym (ximagesink->xcontext->disp,
|
|
|
|
e.xkey.keycode, 0);
|
|
|
|
if (keysym != NoSymbol) {
|
|
|
|
gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
|
|
|
|
e.type == KeyPress ?
|
|
|
|
"key-press" : "key-release", XKeysymToString (keysym));
|
|
|
|
} else {
|
|
|
|
gst_navigation_send_key_event (GST_NAVIGATION (ximagesink),
|
|
|
|
e.type == KeyPress ? "key-press" : "key-release", "unknown");
|
|
|
|
}
|
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_DEBUG ("ximagesink unhandled X event (%d)", e.type);
|
2003-11-08 14:58:35 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
}
|
2003-11-09 19:11:26 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2003-11-08 14:58:35 +00:00
|
|
|
}
|
2003-11-09 19:11:26 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* This function calculates the pixel aspect ratio based on the properties
|
|
|
|
* in the xcontext structure and stores it there. */
|
|
|
|
static void
|
|
|
|
gst_ximagesink_calculate_pixel_aspect_ratio (GstXContext * xcontext)
|
|
|
|
{
|
|
|
|
gint par[][2] = {
|
|
|
|
{1, 1}, /* regular screen */
|
|
|
|
{16, 15}, /* PAL TV */
|
|
|
|
{11, 10}, /* 525 line Rec.601 video */
|
|
|
|
{54, 59} /* 625 line Rec.601 video */
|
|
|
|
};
|
|
|
|
gint i;
|
|
|
|
gint index;
|
|
|
|
gdouble ratio;
|
|
|
|
gdouble delta;
|
|
|
|
|
|
|
|
#define DELTA(idx) (ABS (ratio - ((gdouble) par[idx][0] / par[idx][1])))
|
|
|
|
|
|
|
|
/* first calculate the "real" ratio based on the X values;
|
|
|
|
* which is the "physical" w/h divided by the w/h in pixels of the display */
|
2004-08-03 14:09:26 +00:00
|
|
|
ratio = (gdouble) (xcontext->widthmm * xcontext->height)
|
2004-07-27 16:43:24 +00:00
|
|
|
/ (xcontext->heightmm * xcontext->width);
|
2004-07-28 21:28:34 +00:00
|
|
|
|
|
|
|
/* DirectFB's X in 720x576 reports the physical dimensions wrong, so
|
|
|
|
* override here */
|
|
|
|
if (xcontext->width == 720 && xcontext->height == 576) {
|
|
|
|
ratio = 4.0 * 576 / (3.0 * 720);
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG ("calculated pixel aspect ratio: %f", ratio);
|
|
|
|
|
|
|
|
/* now find the one from par[][2] with the lowest delta to the real one */
|
|
|
|
delta = DELTA (0);
|
|
|
|
index = 0;
|
|
|
|
|
|
|
|
for (i = 1; i < sizeof (par) / (sizeof (gint) * 2); ++i) {
|
|
|
|
gdouble this_delta = DELTA (i);
|
|
|
|
|
|
|
|
if (this_delta < delta) {
|
|
|
|
index = i;
|
|
|
|
delta = this_delta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG ("Decided on index %d (%d/%d)", index,
|
|
|
|
par[index][0], par[index][1]);
|
|
|
|
|
2004-07-28 21:28:34 +00:00
|
|
|
g_free (xcontext->par);
|
|
|
|
xcontext->par = g_new0 (GValue, 1);
|
|
|
|
g_value_init (xcontext->par, GST_TYPE_FRACTION);
|
|
|
|
gst_value_set_fraction (xcontext->par, par[index][0], par[index][1]);
|
|
|
|
GST_DEBUG ("set xcontext PAR to %d/%d",
|
|
|
|
gst_value_get_fraction_numerator (xcontext->par),
|
|
|
|
gst_value_get_fraction_denominator (xcontext->par));
|
2004-07-27 16:43:24 +00:00
|
|
|
}
|
|
|
|
|
2004-07-19 11:21:10 +00:00
|
|
|
/* This function gets the X Display and global info about it. Everything is
|
2003-11-06 21:51:14 +00:00
|
|
|
stored in our object and will be cleaned when the object is disposed. Note
|
2004-07-19 11:21:10 +00:00
|
|
|
here that caps for supported format are generated without any window or
|
2003-11-11 11:32:27 +00:00
|
|
|
image creation */
|
2003-11-06 21:51:14 +00:00
|
|
|
static GstXContext *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXContext *xcontext = NULL;
|
|
|
|
XPixmapFormatValues *px_formats = NULL;
|
|
|
|
gint nb_formats = 0, i;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-10 19:57:57 +00:00
|
|
|
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
xcontext = g_new0 (GstXContext, 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
xcontext->disp = XOpenDisplay (ximagesink->display_name);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!xcontext->disp) {
|
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
2004-08-09 09:00:05 +00:00
|
|
|
GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE, (NULL),
|
2004-03-15 19:32:28 +00:00
|
|
|
("Could not open display"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
xcontext->screen = DefaultScreenOfDisplay (xcontext->disp);
|
|
|
|
xcontext->screen_num = DefaultScreen (xcontext->disp);
|
2004-03-14 22:34:34 +00:00
|
|
|
xcontext->visual = DefaultVisual (xcontext->disp, xcontext->screen_num);
|
2003-11-06 21:51:14 +00:00
|
|
|
xcontext->root = DefaultRootWindow (xcontext->disp);
|
|
|
|
xcontext->white = XWhitePixel (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->black = XBlackPixel (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->depth = DefaultDepthOfScreen (xcontext->screen);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
xcontext->width = DisplayWidth (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->height = DisplayHeight (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->widthmm = DisplayWidthMM (xcontext->disp, xcontext->screen_num);
|
|
|
|
xcontext->heightmm = DisplayHeightMM (xcontext->disp, xcontext->screen_num);
|
|
|
|
|
2004-08-03 08:48:29 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "X reports %dx%d pixels and %d mm x %d mm",
|
|
|
|
xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
gst_ximagesink_calculate_pixel_aspect_ratio (xcontext);
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
/* We get supported pixmap formats at supported depth */
|
|
|
|
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!px_formats) {
|
|
|
|
XCloseDisplay (xcontext->disp);
|
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
g_free (xcontext);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
/* We get bpp value corresponding to our running depth */
|
2004-03-14 22:34:34 +00:00
|
|
|
for (i = 0; i < nb_formats; i++) {
|
|
|
|
if (px_formats[i].depth == xcontext->depth)
|
|
|
|
xcontext->bpp = px_formats[i].bits_per_pixel;
|
|
|
|
}
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
XFree (px_formats);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xcontext->endianness =
|
|
|
|
(ImageByteOrder (xcontext->disp) ==
|
|
|
|
LSBFirst) ? G_LITTLE_ENDIAN : G_BIG_ENDIAN;
|
|
|
|
|
2003-11-12 03:06:07 +00:00
|
|
|
#ifdef HAVE_XSHM
|
2003-11-06 21:51:14 +00:00
|
|
|
/* Search for XShm extension support */
|
2004-01-28 00:29:42 +00:00
|
|
|
if (XShmQueryExtension (xcontext->disp) &&
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_check_xshm_calls (xcontext)) {
|
|
|
|
xcontext->use_xshm = TRUE;
|
|
|
|
GST_DEBUG ("ximagesink is using XShm extension");
|
|
|
|
} else {
|
|
|
|
xcontext->use_xshm = FALSE;
|
|
|
|
GST_DEBUG ("ximagesink is not using XShm extension");
|
|
|
|
}
|
2003-11-12 03:06:07 +00:00
|
|
|
#endif /* HAVE_XSHM */
|
2003-12-17 22:37:26 +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;
|
2003-12-23 22:41:37 +00:00
|
|
|
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-12-17 22:37:26 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/alsa/gstalsamixer.c: Update mixer (to sync with other sessions) if we try to obtain a new value. This makes alsam...
Original commit message from CVS:
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_update),
(gst_alsa_mixer_get_volume), (gst_alsa_mixer_set_volume),
(gst_alsa_mixer_set_mute), (gst_alsa_mixer_set_record),
(gst_alsa_mixer_set_option), (gst_alsa_mixer_get_option):
Update mixer (to sync with other sessions) if we try to obtain
a new value. This makes alsamixer work accross applications.
* ext/alsa/gstalsasink.c: (gst_alsa_sink_get_time):
Only call sync functions if we're running, else alsalib asserts.
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_query):
Sometimes fails to compile. Possibly a gcc bug.
* gst/playback/gstplaybin.c: (gen_video_element),
(gen_audio_element):
Add a reference to an application-provided object, because we lose
this same reference if we add it to the bin. If we don't do this,
we can only use this object once and thus crash if we go from
ready to playing, back to ready and back to playing again.
Also add an audioscale element because several cheap soundcards -
like mine - don't support all samplerates.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_xcontext_clear), (gst_ximagesink_change_state):
Fix wrong order or PAR calls. Makes automatically obtained PAR
from the X server atually being used.
2004-09-13 09:24:00 +00:00
|
|
|
/* update object's par with calculated one if not set yet */
|
|
|
|
if (!ximagesink->par) {
|
|
|
|
ximagesink->par = g_new0 (GValue, 1);
|
|
|
|
gst_value_init_and_copy (ximagesink->par, xcontext->par);
|
|
|
|
GST_DEBUG_OBJECT (ximagesink, "set calculated PAR on object's PAR");
|
|
|
|
}
|
2003-12-22 01:47:09 +00:00
|
|
|
xcontext->caps = gst_caps_new_simple ("video/x-raw-rgb",
|
2004-03-14 22:34:34 +00:00
|
|
|
"bpp", G_TYPE_INT, xcontext->bpp,
|
|
|
|
"depth", G_TYPE_INT, xcontext->depth,
|
2003-12-22 01:47:09 +00:00
|
|
|
"endianness", G_TYPE_INT, xcontext->endianness,
|
2004-03-14 22:34:34 +00:00
|
|
|
"red_mask", G_TYPE_INT, xcontext->visual->red_mask,
|
2003-12-22 01:47:09 +00:00
|
|
|
"green_mask", G_TYPE_INT, xcontext->visual->green_mask,
|
2004-03-14 22:34:34 +00:00
|
|
|
"blue_mask", G_TYPE_INT, xcontext->visual->blue_mask,
|
2004-05-05 11:29:49 +00:00
|
|
|
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
|
|
|
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
|
2004-08-09 20:07:10 +00:00
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 1.0, 100.0, NULL);
|
2004-07-28 21:28:34 +00:00
|
|
|
if (ximagesink->par) {
|
|
|
|
int nom, den;
|
|
|
|
|
|
|
|
nom = gst_value_get_fraction_numerator (ximagesink->par);
|
|
|
|
den = gst_value_get_fraction_denominator (ximagesink->par);
|
|
|
|
gst_caps_set_simple (xcontext->caps, "pixel-aspect-ratio",
|
|
|
|
GST_TYPE_FRACTION, nom, den, NULL);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
return xcontext;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function cleans the X context. Closing the Display and unrefing the
|
|
|
|
caps for supported formats. */
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xcontext_clear (GstXImageSink * ximagesink)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_caps_free (ximagesink->xcontext->caps);
|
2004-07-28 21:28:34 +00:00
|
|
|
g_free (ximagesink->xcontext->par);
|
ext/alsa/gstalsamixer.c: Update mixer (to sync with other sessions) if we try to obtain a new value. This makes alsam...
Original commit message from CVS:
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_update),
(gst_alsa_mixer_get_volume), (gst_alsa_mixer_set_volume),
(gst_alsa_mixer_set_mute), (gst_alsa_mixer_set_record),
(gst_alsa_mixer_set_option), (gst_alsa_mixer_get_option):
Update mixer (to sync with other sessions) if we try to obtain
a new value. This makes alsamixer work accross applications.
* ext/alsa/gstalsasink.c: (gst_alsa_sink_get_time):
Only call sync functions if we're running, else alsalib asserts.
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_query):
Sometimes fails to compile. Possibly a gcc bug.
* gst/playback/gstplaybin.c: (gen_video_element),
(gen_audio_element):
Add a reference to an application-provided object, because we lose
this same reference if we add it to the bin. If we don't do this,
we can only use this object once and thus crash if we go from
ready to playing, back to ready and back to playing again.
Also add an audioscale element because several cheap soundcards -
like mine - don't support all samplerates.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_xcontext_clear), (gst_ximagesink_change_state):
Fix wrong order or PAR calls. Makes automatically obtained PAR
from the X server atually being used.
2004-09-13 09:24:00 +00:00
|
|
|
g_free (ximagesink->par);
|
|
|
|
ximagesink->par = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
XCloseDisplay (ximagesink->xcontext->disp);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink->xcontext = NULL;
|
2003-11-06 21:51:14 +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
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_imagepool_clear (GstXImageSink * ximagesink)
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (ximagesink->pool_lock);
|
|
|
|
|
|
|
|
while (ximagesink->image_pool) {
|
|
|
|
GstXImage *ximage = ximagesink->image_pool->data;
|
|
|
|
|
|
|
|
ximagesink->image_pool = g_slist_delete_link (ximagesink->image_pool,
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->image_pool);
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximage);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_mutex_unlock (ximagesink->pool_lock);
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
/* Element stuff */
|
|
|
|
|
2003-12-31 08:02:04 +00:00
|
|
|
static GstCaps *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_fixate (GstPad * pad, const GstCaps * caps)
|
2003-12-31 08:02:04 +00:00
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GstCaps *newcaps;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (gst_caps_get_size (caps) > 1)
|
|
|
|
return NULL;
|
2003-12-31 08:02:04 +00:00
|
|
|
|
|
|
|
newcaps = gst_caps_copy (caps);
|
|
|
|
structure = gst_caps_get_structure (newcaps, 0);
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* if par is set and either w or h is set, we can set the other */
|
|
|
|
|
2003-12-31 08:02:04 +00:00
|
|
|
if (gst_caps_structure_fixate_field_nearest_int (structure, "width", 320)) {
|
|
|
|
return newcaps;
|
|
|
|
}
|
|
|
|
if (gst_caps_structure_fixate_field_nearest_int (structure, "height", 240)) {
|
|
|
|
return newcaps;
|
|
|
|
}
|
|
|
|
if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
|
2004-03-15 19:32:28 +00:00
|
|
|
30.0)) {
|
2003-12-31 08:02:04 +00:00
|
|
|
return newcaps;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_caps_free (newcaps);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
static GstCaps *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_getcaps (GstPad * pad)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
2004-07-27 16:43:24 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
int i;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
if (ximagesink->xcontext)
|
|
|
|
return gst_caps_copy (ximagesink->xcontext->caps);
|
2003-11-06 22:48:03 +00:00
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* get a template copy and add the pixel aspect ratio */
|
|
|
|
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
|
|
|
for (i = 0; i < gst_caps_get_size (caps); ++i) {
|
|
|
|
GstStructure *structure = gst_caps_get_structure (caps, i);
|
|
|
|
|
2004-07-28 21:28:34 +00:00
|
|
|
if (ximagesink->par) {
|
|
|
|
int nom, den;
|
|
|
|
|
|
|
|
nom = gst_value_get_fraction_numerator (ximagesink->par);
|
|
|
|
den = gst_value_get_fraction_denominator (ximagesink->par);
|
|
|
|
gst_structure_set (structure, "pixel-aspect-ratio",
|
|
|
|
GST_TYPE_FRACTION, nom, den, NULL);
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
}
|
|
|
|
return caps;
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
static GstPadLinkReturn
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_sink_link (GstPad * pad, const GstCaps * caps)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
2003-12-22 01:47:09 +00:00
|
|
|
gboolean ret;
|
|
|
|
GstStructure *structure;
|
2004-07-27 16:43:24 +00:00
|
|
|
const GValue *par;
|
2003-11-06 21:51:14 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
2003-11-06 21:51:14 +00:00
|
|
|
|
2003-11-22 04:06:50 +00:00
|
|
|
if (!ximagesink->xcontext)
|
|
|
|
return GST_PAD_LINK_DELAYED;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-05-04 14:51:40 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink,
|
2004-05-04 14:17:25 +00:00
|
|
|
"sinkconnect possible caps %" GST_PTR_FORMAT " with given caps %"
|
2004-05-04 14:51:40 +00:00
|
|
|
GST_PTR_FORMAT, ximagesink->xcontext->caps, caps);
|
2003-11-26 10:12:05 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
ret = gst_structure_get_int (structure, "width",
|
2004-03-14 22:34:34 +00:00
|
|
|
&(GST_VIDEOSINK_WIDTH (ximagesink)));
|
2003-12-22 01:47:09 +00:00
|
|
|
ret &= gst_structure_get_int (structure, "height",
|
2004-03-14 22:34:34 +00:00
|
|
|
&(GST_VIDEOSINK_HEIGHT (ximagesink)));
|
2003-12-22 01:47:09 +00:00
|
|
|
ret &= gst_structure_get_double (structure,
|
2004-03-14 22:34:34 +00:00
|
|
|
"framerate", &ximagesink->framerate);
|
|
|
|
if (!ret)
|
|
|
|
return GST_PAD_LINK_REFUSED;
|
|
|
|
|
2004-07-27 16:43:24 +00:00
|
|
|
/* if the caps contain pixel-aspect-ratio, they have to match ours,
|
|
|
|
* otherwise linking should fail */
|
|
|
|
par = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
|
|
|
if (par) {
|
2004-07-28 21:28:34 +00:00
|
|
|
if (gst_value_compare (par, ximagesink->par) != GST_VALUE_EQUAL) {
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_INFO_OBJECT (ximagesink, "pixel aspect ratio does not match");
|
|
|
|
return GST_PAD_LINK_REFUSED;
|
|
|
|
}
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
/* Creating our window and our image */
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
g_assert (GST_VIDEOSINK_WIDTH (ximagesink) > 0);
|
|
|
|
g_assert (GST_VIDEOSINK_HEIGHT (ximagesink) > 0);
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
if (!ximagesink->xwindow) {
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink->xwindow = gst_ximagesink_xwindow_new (ximagesink,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
} else {
|
|
|
|
if (ximagesink->xwindow->internal) {
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xwindow_resize (ximagesink, ximagesink->xwindow,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
/* If our ximage has changed we destroy it, next chain iteration will create
|
|
|
|
a new one */
|
|
|
|
if ((ximagesink->ximage) &&
|
|
|
|
((GST_VIDEOSINK_WIDTH (ximagesink) != ximagesink->ximage->width) ||
|
|
|
|
(GST_VIDEOSINK_HEIGHT (ximagesink) != ximagesink->ximage->height))) {
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
ximagesink->ximage = NULL;
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-04 18:53:53 +00:00
|
|
|
gst_x_overlay_got_desired_size (GST_X_OVERLAY (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
return GST_PAD_LINK_OK;
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
static GstElementStateReturn
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_change_state (GstElement * element)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
2003-11-11 11:32:27 +00:00
|
|
|
|
|
|
|
ximagesink = GST_XIMAGESINK (element);
|
|
|
|
|
|
|
|
switch (GST_STATE_TRANSITION (element)) {
|
|
|
|
case GST_STATE_NULL_TO_READY:
|
|
|
|
/* Initializing the XContext */
|
2003-11-17 16:32:29 +00:00
|
|
|
if (!ximagesink->xcontext)
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink);
|
2003-11-11 11:32:27 +00:00
|
|
|
if (!ximagesink->xcontext)
|
2004-03-15 19:32:28 +00:00
|
|
|
return GST_STATE_FAILURE;
|
2004-07-19 11:33:32 +00:00
|
|
|
/* call XSynchronize with the current value of synchronous */
|
|
|
|
GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s",
|
|
|
|
ximagesink->synchronous ? "TRUE" : "FALSE");
|
|
|
|
XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous);
|
2003-11-11 11:32:27 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_READY_TO_PAUSED:
|
2004-03-05 14:40:41 +00:00
|
|
|
if (ximagesink->xwindow)
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_xwindow_clear (ximagesink, ximagesink->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
|
|
|
ximagesink->time = 0;
|
2003-11-11 11:32:27 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_PAUSED_TO_PLAYING:
|
|
|
|
break;
|
|
|
|
case GST_STATE_PLAYING_TO_PAUSED:
|
|
|
|
break;
|
|
|
|
case GST_STATE_PAUSED_TO_READY:
|
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
|
|
|
ximagesink->framerate = 0;
|
2004-02-18 21:16:50 +00:00
|
|
|
ximagesink->sw_scaling_failed = FALSE;
|
2004-01-04 18:53:53 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink) = 0;
|
|
|
|
GST_VIDEOSINK_HEIGHT (ximagesink) = 0;
|
2003-11-11 11:32:27 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_READY_TO_NULL:
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->ximage) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
|
|
|
|
ximagesink->ximage = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
|
|
|
if (ximagesink->image_pool)
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_imagepool_clear (ximagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (ximagesink->xwindow) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
|
|
|
ximagesink->xwindow = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ximagesink->xcontext) {
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_xcontext_clear (ximagesink);
|
|
|
|
ximagesink->xcontext = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2003-11-11 11:32:27 +00:00
|
|
|
break;
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
|
|
|
|
2003-11-19 22:31:46 +00:00
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
return GST_STATE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_chain (GstPad * pad, GstData * data)
|
2003-11-06 21:51:14 +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
|
|
|
GstBuffer *buf = GST_BUFFER (data);
|
2003-11-06 21:51:14 +00:00
|
|
|
GstXImageSink *ximagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_return_if_fail (GST_IS_PAD (pad));
|
|
|
|
g_return_if_fail (buf != NULL);
|
|
|
|
|
|
|
|
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (GST_IS_EVENT (data)) {
|
|
|
|
gst_pad_event_default (pad, GST_EVENT (data));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
buf = GST_BUFFER (data);
|
|
|
|
/* update time */
|
|
|
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
|
|
|
ximagesink->time = GST_BUFFER_TIMESTAMP (buf);
|
|
|
|
}
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_LOG_OBJECT (ximagesink, "clock wait: %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (ximagesink->time));
|
2004-02-01 22:33:07 +00:00
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
if (GST_VIDEOSINK_CLOCK (ximagesink)) {
|
2004-01-14 00:53:52 +00:00
|
|
|
gst_element_wait (GST_ELEMENT (ximagesink), ximagesink->time);
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If this buffer has been allocated using our buffer management we simply
|
|
|
|
put the ximage which is in the PRIVATE pointer */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (GST_BUFFER_FREE_DATA_FUNC (buf) == gst_ximagesink_buffer_free) {
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_LOG_OBJECT (ximagesink, "buffer from our pool, writing directly");
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_ximage_put (ximagesink, GST_BUFFER_PRIVATE (buf));
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
} else {
|
|
|
|
/* Else we have to copy the data into our private image, */
|
2004-03-14 22:34:34 +00:00
|
|
|
/* if we have one... */
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_LOG_OBJECT (ximagesink, "normal buffer, copying from it");
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
if (!ximagesink->ximage) {
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "creating our ximage");
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
ximagesink->ximage = gst_ximagesink_ximage_new (ximagesink,
|
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
|
|
|
if (!ximagesink->ximage) {
|
|
|
|
/* No image available. That's very bad ! */
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
GST_ELEMENT_ERROR (ximagesink, CORE, NEGOTIATION, (NULL),
|
|
|
|
("Failed creating an XImage in ximagesink chain function."));
|
|
|
|
return;
|
|
|
|
}
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
sys/ximage/ximagesink.c: Optimize images creation for both elements. We don't create the image on caps nego or renego...
Original commit message from CVS:
2004-07-21 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_set_xwindow_id): Optimize
images creation for both elements. We don't create the image on caps
nego or renego, we just destroy the internal one if present if it does
not match the needs. The chain function takes care of creating a new
image when needed.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xwindow_decorate), (gst_xvimagesink_sink_link),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id): Additionally xvimage now contains
the image format information. The buffer pool checks for the context
image format and discard images with different formats.
* sys/xvimage/xvimagesink.h: Adding im_format in the xvimage structure.
2004-07-21 11:02:32 +00:00
|
|
|
|
|
|
|
memcpy (ximagesink->ximage->ximage->data,
|
|
|
|
GST_BUFFER_DATA (buf),
|
|
|
|
MIN (GST_BUFFER_SIZE (buf), ximagesink->ximage->size));
|
|
|
|
gst_ximagesink_ximage_put (ximagesink, ximagesink->ximage);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
|
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
|
|
|
/* set correct time for next buffer */
|
|
|
|
if (!GST_BUFFER_TIMESTAMP_IS_VALID (buf) && ximagesink->framerate > 0) {
|
|
|
|
ximagesink->time += GST_SECOND / ximagesink->framerate;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
gst_buffer_unref (buf);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-08 14:58:35 +00:00
|
|
|
gst_ximagesink_handle_xevents (ximagesink, pad);
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* Buffer management */
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_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
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
|
|
|
GstXImage *ximage;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-12 02:01:52 +00:00
|
|
|
ximage = GST_BUFFER_PRIVATE (buffer);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-01-11 22:52:29 +00:00
|
|
|
g_assert (GST_IS_XIMAGESINK (ximage->ximagesink));
|
|
|
|
ximagesink = ximage->ximagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If our geometry changed we can't reuse that image. */
|
2004-03-14 22:34:34 +00:00
|
|
|
if ((ximage->width != GST_VIDEOSINK_WIDTH (ximagesink)) ||
|
|
|
|
(ximage->height != GST_VIDEOSINK_HEIGHT (ximagesink)))
|
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_ximagesink_ximage_destroy (ximagesink, ximage);
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
else {
|
|
|
|
/* In that case we can reuse the image and add it to our image pool. */
|
2004-03-14 22:34:34 +00:00
|
|
|
g_mutex_lock (ximagesink->pool_lock);
|
|
|
|
ximagesink->image_pool = g_slist_prepend (ximagesink->image_pool, ximage);
|
|
|
|
g_mutex_unlock (ximagesink->pool_lock);
|
|
|
|
}
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstBuffer *
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_buffer_alloc (GstPad * pad, guint64 offset, guint size)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstXImage *ximage = NULL;
|
|
|
|
gboolean not_found = TRUE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
ximagesink = GST_XIMAGESINK (gst_pad_get_parent (pad));
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
g_mutex_lock (ximagesink->pool_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
/* Walking through the pool cleaning unsuable images and searching for a
|
|
|
|
suitable one */
|
2004-03-14 22:34:34 +00:00
|
|
|
while (not_found && ximagesink->image_pool) {
|
|
|
|
ximage = ximagesink->image_pool->data;
|
|
|
|
|
|
|
|
if (ximage) {
|
|
|
|
/* Removing from the pool */
|
|
|
|
ximagesink->image_pool = g_slist_delete_link (ximagesink->image_pool,
|
2004-03-15 19:32:28 +00:00
|
|
|
ximagesink->image_pool);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
if ((ximage->width != GST_VIDEOSINK_WIDTH (ximagesink)) ||
|
|
|
|
(ximage->height != GST_VIDEOSINK_HEIGHT (ximagesink))) {
|
|
|
|
/* This image is unusable. Destroying... */
|
2004-03-15 19:32:28 +00:00
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximage);
|
|
|
|
ximage = NULL;
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
} else {
|
|
|
|
/* We found a suitable image */
|
2004-03-15 19:32:28 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
g_mutex_unlock (ximagesink->pool_lock);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
sys/: Getting the 2 video sinks synchronized again. Using internal data pointer of the x(v)image to store image's dat...
Original commit message from CVS:
2004-07-16 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xerror),
(gst_ximagesink_check_xshm_calls), (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_sink_link),
(gst_ximagesink_chain), (gst_ximagesink_buffer_free),
(gst_ximagesink_buffer_alloc):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_chain), (gst_xvimagesink_buffer_free),
(gst_xvimagesink_buffer_alloc):
* sys/xvimage/xvimagesink.h: Getting the 2 video sinks synchronized
again. Using internal data pointer of the x(v)image to store image's
data to be coherent with the buffer alloc mechanism. Investigated the
image destruction code to be sure that everything gets freed correctly.
2004-07-16 10:48:52 +00:00
|
|
|
if (!ximage) {
|
|
|
|
/* We found no suitable image in the pool. Creating... */
|
2004-07-26 13:00:27 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "no usable image in pool, creating ximage");
|
2004-03-14 22:34:34 +00:00
|
|
|
ximage = gst_ximagesink_ximage_new (ximagesink,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ximage) {
|
|
|
|
buffer = gst_buffer_new ();
|
|
|
|
|
|
|
|
/* Storing some pointers in the buffer */
|
|
|
|
GST_BUFFER_PRIVATE (buffer) = ximage;
|
|
|
|
|
|
|
|
GST_BUFFER_DATA (buffer) = ximage->ximage->data;
|
|
|
|
GST_BUFFER_FREE_DATA_FUNC (buffer) = gst_ximagesink_buffer_free;
|
|
|
|
GST_BUFFER_SIZE (buffer) = ximage->size;
|
|
|
|
return buffer;
|
|
|
|
} else
|
2003-11-11 11:32:27 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
/* Interfaces stuff */
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_interface_supported (GstImplementsInterface * iface, GType type)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
g_assert (type == GST_TYPE_NAVIGATION || type == GST_TYPE_X_OVERLAY);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_interface_init (GstImplementsInterfaceClass * klass)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
klass->supported = gst_ximagesink_interface_supported;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_navigation_send_event (GstNavigation * navigation,
|
|
|
|
GstStructure * structure)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink = GST_XIMAGESINK (navigation);
|
|
|
|
GstEvent *event;
|
|
|
|
gint x_offset, y_offset;
|
2004-03-14 22:34:34 +00:00
|
|
|
double x, y;
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
event = gst_event_new (GST_EVENT_NAVIGATION);
|
|
|
|
event->event_data.structure.structure = structure;
|
|
|
|
|
2004-07-19 11:21:10 +00:00
|
|
|
/* We are not converting the pointer coordinates as there's no hardware
|
2003-11-17 16:32:29 +00:00
|
|
|
scaling done here. The only possible scaling is done by videoscale and
|
|
|
|
videoscale will have to catch those events and tranform the coordinates
|
|
|
|
to match the applied scaling. So here we just add the offset if the image
|
|
|
|
is centered in the window. */
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
x_offset = ximagesink->xwindow->width - GST_VIDEOSINK_WIDTH (ximagesink);
|
|
|
|
y_offset = ximagesink->xwindow->height - GST_VIDEOSINK_HEIGHT (ximagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (gst_structure_get_double (structure, "pointer_x", &x)) {
|
|
|
|
x += x_offset;
|
|
|
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, x, NULL);
|
|
|
|
}
|
|
|
|
if (gst_structure_get_double (structure, "pointer_y", &y)) {
|
|
|
|
y += y_offset;
|
|
|
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
|
|
|
|
}
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_pad_send_event (gst_pad_get_peer (GST_VIDEOSINK_PAD (ximagesink)), event);
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_navigation_init (GstNavigationInterface * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
iface->send_event = gst_ximagesink_navigation_send_event;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
|
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
|
|
|
GstXWindow *xwindow = NULL;
|
|
|
|
XWindowAttributes attr;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If we already use that window return */
|
|
|
|
if (ximagesink->xwindow && (xwindow_id == ximagesink->xwindow->win))
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If the element has not initialized the X11 context try to do so */
|
2003-11-17 16:32:29 +00:00
|
|
|
if (!ximagesink->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
|
|
|
ximagesink->xcontext = gst_ximagesink_xcontext_get (ximagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!ximagesink->xcontext) {
|
|
|
|
g_warning ("ximagesink was unable to obtain the X11 context.");
|
|
|
|
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
|
|
|
/* Clear image pool as the images are unusable anyway */
|
|
|
|
gst_ximagesink_imagepool_clear (ximagesink);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* Clear the ximage */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->ximage) {
|
|
|
|
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
|
|
|
|
ximagesink->ximage = NULL;
|
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If a window is there already we destroy it */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->xwindow) {
|
|
|
|
gst_ximagesink_xwindow_destroy (ximagesink, ximagesink->xwindow);
|
|
|
|
ximagesink->xwindow = NULL;
|
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
/* If the xid is 0 we go back to an internal window */
|
2004-03-14 22:34:34 +00:00
|
|
|
if (xwindow_id == 0) {
|
|
|
|
/* If no width/height caps nego did not happen window will be created
|
|
|
|
during caps nego then */
|
|
|
|
if (GST_VIDEOSINK_WIDTH (ximagesink) && GST_VIDEOSINK_HEIGHT (ximagesink)) {
|
|
|
|
xwindow = gst_ximagesink_xwindow_new (ximagesink,
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink));
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
} else {
|
|
|
|
xwindow = g_new0 (GstXWindow, 1);
|
|
|
|
|
|
|
|
xwindow->win = xwindow_id;
|
|
|
|
|
|
|
|
/* We get window geometry, set the event we want to receive,
|
|
|
|
and create a GC */
|
|
|
|
g_mutex_lock (ximagesink->x_lock);
|
|
|
|
XGetWindowAttributes (ximagesink->xcontext->disp, xwindow->win, &attr);
|
|
|
|
xwindow->width = attr.width;
|
|
|
|
xwindow->height = attr.height;
|
|
|
|
xwindow->internal = FALSE;
|
|
|
|
XSelectInput (ximagesink->xcontext->disp, xwindow->win, ExposureMask |
|
2004-03-15 19:32:28 +00:00
|
|
|
StructureNotifyMask | PointerMotionMask | KeyPressMask |
|
|
|
|
KeyReleaseMask);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
xwindow->gc = XCreateGC (ximagesink->xcontext->disp, xwindow->win, 0, NULL);
|
|
|
|
g_mutex_unlock (ximagesink->x_lock);
|
|
|
|
|
2004-07-19 11:21:10 +00:00
|
|
|
/* If that new window geometry differs from our one we try to
|
2004-03-14 22:34:34 +00:00
|
|
|
renegotiate caps */
|
|
|
|
if (gst_pad_is_negotiated (GST_VIDEOSINK_PAD (ximagesink)) &&
|
2004-03-15 19:32:28 +00:00
|
|
|
(xwindow->width != GST_VIDEOSINK_WIDTH (ximagesink) ||
|
|
|
|
xwindow->height != GST_VIDEOSINK_HEIGHT (ximagesink))) {
|
2004-03-14 22:34:34 +00:00
|
|
|
GstPadLinkReturn r;
|
2004-07-28 21:28:34 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = gst_caps_new_simple ("video/x-raw-rgb",
|
|
|
|
"bpp", G_TYPE_INT, ximagesink->xcontext->bpp,
|
|
|
|
"depth", G_TYPE_INT, ximagesink->xcontext->depth,
|
|
|
|
"endianness", G_TYPE_INT, ximagesink->xcontext->endianness,
|
|
|
|
"red_mask", G_TYPE_INT, ximagesink->xcontext->visual->red_mask,
|
|
|
|
"green_mask", G_TYPE_INT,
|
|
|
|
ximagesink->xcontext->visual->green_mask,
|
|
|
|
"blue_mask", G_TYPE_INT,
|
|
|
|
ximagesink->xcontext->visual->blue_mask,
|
|
|
|
"width", G_TYPE_INT, xwindow->width,
|
|
|
|
"height", G_TYPE_INT, xwindow->height,
|
|
|
|
"framerate", G_TYPE_DOUBLE, ximagesink->framerate, NULL);
|
|
|
|
|
|
|
|
if (ximagesink->par) {
|
|
|
|
int nom, den;
|
|
|
|
|
|
|
|
nom = gst_value_get_fraction_numerator (ximagesink->par);
|
|
|
|
den = gst_value_get_fraction_denominator (ximagesink->par);
|
|
|
|
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
|
|
|
nom, den, NULL);
|
|
|
|
}
|
|
|
|
r = gst_pad_try_set_caps (GST_VIDEOSINK_PAD (ximagesink), caps);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
/* If caps nego succeded updating our size */
|
|
|
|
if ((r == GST_PAD_LINK_OK) || (r == GST_PAD_LINK_DONE)) {
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_VIDEOSINK_WIDTH (ximagesink) = xwindow->width;
|
|
|
|
GST_VIDEOSINK_HEIGHT (ximagesink) = xwindow->height;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
|
|
|
if (xwindow)
|
|
|
|
ximagesink->xwindow = xwindow;
|
2004-01-04 18:53:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_get_desired_size (GstXOverlay * overlay,
|
|
|
|
guint * width, guint * height)
|
2004-01-04 18:53:53 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
|
|
|
|
|
|
|
|
*width = GST_VIDEOSINK_WIDTH (ximagesink);
|
|
|
|
*height = GST_VIDEOSINK_HEIGHT (ximagesink);
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
2004-02-03 23:05:46 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_expose (GstXOverlay * overlay)
|
2004-02-03 23:05:46 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink = GST_XIMAGESINK (overlay);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-16 23:45:55 +00:00
|
|
|
if (!ximagesink->xwindow)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
gst_ximagesink_xwindow_update_geometry (ximagesink, ximagesink->xwindow);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 13:06:49 +00:00
|
|
|
/* We don't act on internal window from outside that could cause some thread
|
|
|
|
race with the video sink own thread checking for configure event */
|
|
|
|
if (ximagesink->xwindow->internal)
|
|
|
|
return;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-16 23:45:55 +00:00
|
|
|
gst_ximagesink_xwindow_clear (ximagesink, ximagesink->xwindow);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 13:06:49 +00:00
|
|
|
if (ximagesink->cur_image)
|
2004-02-03 23:05:46 +00:00
|
|
|
gst_ximagesink_ximage_put (ximagesink, ximagesink->cur_image);
|
|
|
|
}
|
|
|
|
|
2003-11-17 16:32:29 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_xoverlay_init (GstXOverlayClass * iface)
|
2003-11-17 16:32:29 +00:00
|
|
|
{
|
|
|
|
iface->set_xwindow_id = gst_ximagesink_set_xwindow_id;
|
2004-01-04 18:53:53 +00:00
|
|
|
iface->get_desired_size = gst_ximagesink_get_desired_size;
|
2004-02-03 23:05:46 +00:00
|
|
|
iface->expose = gst_ximagesink_expose;
|
2003-11-17 16:32:29 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
/* =========================================== */
|
|
|
|
/* */
|
|
|
|
/* Init & Class init */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
ximagesink = GST_XIMAGESINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DISPLAY:
|
|
|
|
ximagesink->display_name = g_strdup (g_value_get_string (value));
|
|
|
|
break;
|
|
|
|
case ARG_SYNCHRONOUS:
|
|
|
|
ximagesink->synchronous = g_value_get_boolean (value);
|
|
|
|
if (ximagesink->xcontext) {
|
2004-07-19 11:33:32 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "XSynchronize called with %s",
|
|
|
|
ximagesink->synchronous ? "TRUE" : "FALSE");
|
2004-03-15 19:32:28 +00:00
|
|
|
XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-07-27 16:43:24 +00:00
|
|
|
case ARG_PIXEL_ASPECT_RATIO:
|
2004-07-28 21:28:34 +00:00
|
|
|
g_free (ximagesink->par);
|
|
|
|
ximagesink->par = g_new0 (GValue, 1);
|
|
|
|
g_value_init (ximagesink->par, GST_TYPE_FRACTION);
|
|
|
|
if (!g_value_transform (value, ximagesink->par)) {
|
2004-07-27 16:43:24 +00:00
|
|
|
g_warning ("Could not transform string to aspect ratio");
|
2004-07-28 21:28:34 +00:00
|
|
|
gst_value_set_fraction (ximagesink->par, 1, 1);
|
|
|
|
}
|
2004-07-27 16:43:24 +00:00
|
|
|
GST_DEBUG_OBJECT (ximagesink, "set PAR to %d/%d",
|
2004-07-28 21:28:34 +00:00
|
|
|
gst_value_get_fraction_numerator (ximagesink->par),
|
|
|
|
gst_value_get_fraction_denominator (ximagesink->par));
|
2004-07-27 16:43:24 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_return_if_fail (GST_IS_XIMAGESINK (object));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
ximagesink = GST_XIMAGESINK (object);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DISPLAY:
|
|
|
|
g_value_set_string (value, g_strdup (ximagesink->display_name));
|
|
|
|
break;
|
|
|
|
case ARG_SYNCHRONOUS:
|
|
|
|
g_value_set_boolean (value, ximagesink->synchronous);
|
|
|
|
break;
|
2004-07-27 16:43:24 +00:00
|
|
|
case ARG_PIXEL_ASPECT_RATIO:
|
2004-07-28 21:28:34 +00:00
|
|
|
if (ximagesink->par)
|
|
|
|
g_value_transform (ximagesink->par, value);
|
2004-07-27 16:43:24 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
}
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
static void
|
2004-06-17 14:15:23 +00:00
|
|
|
gst_ximagesink_finalize (GObject * object)
|
2003-11-11 11:32:27 +00:00
|
|
|
{
|
|
|
|
GstXImageSink *ximagesink;
|
|
|
|
|
|
|
|
ximagesink = GST_XIMAGESINK (object);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ximagesink->display_name) {
|
|
|
|
g_free (ximagesink->display_name);
|
|
|
|
ximagesink->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-11 11:32:27 +00:00
|
|
|
g_mutex_free (ximagesink->x_lock);
|
|
|
|
g_mutex_free (ximagesink->pool_lock);
|
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2003-11-11 11:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_init (GstXImageSink * ximagesink)
|
2003-11-11 11:32:27 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_PAD (ximagesink) =
|
|
|
|
gst_pad_new_from_template (gst_static_pad_template_get
|
|
|
|
(&gst_ximagesink_sink_template_factory), "sink");
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_VIDEOSINK_PAD (ximagesink));
|
2003-11-19 20:43:49 +00:00
|
|
|
|
|
|
|
gst_pad_set_chain_function (GST_VIDEOSINK_PAD (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_chain);
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_pad_set_link_function (GST_VIDEOSINK_PAD (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_sink_link);
|
2003-11-19 20:43:49 +00:00
|
|
|
gst_pad_set_getcaps_function (GST_VIDEOSINK_PAD (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_getcaps);
|
2003-12-31 08:02:04 +00:00
|
|
|
gst_pad_set_fixate_function (GST_VIDEOSINK_PAD (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_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 (ximagesink),
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_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
|
|
|
ximagesink->display_name = NULL;
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink->xcontext = NULL;
|
|
|
|
ximagesink->xwindow = NULL;
|
|
|
|
ximagesink->ximage = NULL;
|
2004-02-03 23:05:46 +00:00
|
|
|
ximagesink->cur_image = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-12 13:06:21 +00:00
|
|
|
ximagesink->framerate = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink->x_lock = g_mutex_new ();
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
ximagesink->image_pool = NULL;
|
|
|
|
ximagesink->pool_lock = g_mutex_new ();
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-02-18 21:16:50 +00:00
|
|
|
ximagesink->sw_scaling_failed = FALSE;
|
|
|
|
ximagesink->synchronous = FALSE;
|
2003-11-11 11:32:27 +00:00
|
|
|
|
2004-07-28 21:28:34 +00:00
|
|
|
ximagesink->par = NULL;
|
2004-07-27 16:43:24 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_FLAG_SET (ximagesink, GST_ELEMENT_THREAD_SUGGESTED);
|
|
|
|
GST_FLAG_SET (ximagesink, GST_ELEMENT_EVENT_AWARE);
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_ximagesink_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
gst_element_class_set_details (element_class, &gst_ximagesink_details);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_ximagesink_sink_template_factory));
|
2003-11-06 21:51:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_ximagesink_class_init (GstXImageSinkClass * klass)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
|
2003-11-19 20:43:49 +00:00
|
|
|
parent_class = g_type_class_ref (GST_TYPE_VIDEOSINK);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_DISPLAY,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_string ("display", "Display", "X Display name",
|
2004-03-15 19:32:28 +00:00
|
|
|
NULL, G_PARAM_READWRITE));
|
2004-01-18 12:32:19 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_SYNCHRONOUS,
|
2004-03-14 22:34:34 +00:00
|
|
|
g_param_spec_boolean ("synchronous", "Synchronous", "When enabled, runs "
|
2004-03-15 19:32:28 +00:00
|
|
|
"the X display in synchronous mode. (used only for debugging)", FALSE,
|
|
|
|
G_PARAM_READWRITE));
|
2004-07-27 16:43:24 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_PIXEL_ASPECT_RATIO,
|
|
|
|
g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio",
|
|
|
|
"The pixel aspect ratio of the device", "1/1", G_PARAM_READWRITE));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2004-06-17 14:15:23 +00:00
|
|
|
gobject_class->finalize = gst_ximagesink_finalize;
|
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
|
|
|
gobject_class->set_property = gst_ximagesink_set_property;
|
|
|
|
gobject_class->get_property = gst_ximagesink_get_property;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
gstelement_class->change_state = gst_ximagesink_change_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ============================================================= */
|
|
|
|
/* */
|
|
|
|
/* Public Methods */
|
|
|
|
/* */
|
|
|
|
/* ============================================================= */
|
|
|
|
|
|
|
|
/* =========================================== */
|
|
|
|
/* */
|
|
|
|
/* Object typing & Creation */
|
|
|
|
/* */
|
|
|
|
/* =========================================== */
|
|
|
|
|
|
|
|
GType
|
|
|
|
gst_ximagesink_get_type (void)
|
|
|
|
{
|
|
|
|
static GType ximagesink_type = 0;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!ximagesink_type) {
|
|
|
|
static const GTypeInfo ximagesink_info = {
|
|
|
|
sizeof (GstXImageSinkClass),
|
|
|
|
gst_ximagesink_base_init,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_ximagesink_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstXImageSink),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_ximagesink_init,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo iface_info = {
|
|
|
|
(GInterfaceInitFunc) gst_ximagesink_interface_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo navigation_info = {
|
|
|
|
(GInterfaceInitFunc) gst_ximagesink_navigation_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
static const GInterfaceInfo overlay_info = {
|
|
|
|
(GInterfaceInitFunc) gst_ximagesink_xoverlay_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
ximagesink_type = g_type_register_static (GST_TYPE_VIDEOSINK,
|
2004-03-15 19:32:28 +00:00
|
|
|
"GstXImageSink", &ximagesink_info, 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
g_type_add_interface_static (ximagesink_type, GST_TYPE_IMPLEMENTS_INTERFACE,
|
2004-03-15 19:32:28 +00:00
|
|
|
&iface_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_type_add_interface_static (ximagesink_type, GST_TYPE_NAVIGATION,
|
2004-03-15 19:32:28 +00:00
|
|
|
&navigation_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
g_type_add_interface_static (ximagesink_type, GST_TYPE_X_OVERLAY,
|
2004-03-15 19:32:28 +00:00
|
|
|
&overlay_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
return ximagesink_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:34 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2003-11-06 21:51:14 +00:00
|
|
|
{
|
2003-11-19 20:43:49 +00:00
|
|
|
/* Loading the library containing GstVideoSink, our parent object */
|
|
|
|
if (!gst_library_load ("gstvideo"))
|
|
|
|
return FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2003-11-11 11:32:27 +00:00
|
|
|
if (!gst_element_register (plugin, "ximagesink",
|
2004-03-15 19:32:28 +00:00
|
|
|
GST_RANK_SECONDARY, GST_TYPE_XIMAGESINK))
|
2003-11-06 21:51:14 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2004-04-20 15:45:07 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_debug_ximagesink, "ximagesink", 0,
|
|
|
|
"ximagesink element");
|
|
|
|
|
2003-11-06 21:51:14 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"ximagesink",
|
|
|
|
"XFree86 video output plugin based on standard Xlib calls",
|
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
|