sys/xvimage/xvimagesink.c: Some fixes to image size calculation.

Original commit message from CVS:
2004-07-27  Julien MOUTTE  <julien@moutte.net>

* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new): Some fixes to image size calculation.
This commit is contained in:
Julien Moutte 2004-07-27 10:10:02 +00:00
parent 7861c8410f
commit 23f23004c5
2 changed files with 8 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2004-07-27 Julien MOUTTE <julien@moutte.net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new): Some fixes to image size calculation.
2004-07-27 Wim Taymans <wim@fluendo.com>
* ext/libpng/gstpngdec.c: (gst_pngdec_src_getcaps):

View file

@ -125,14 +125,13 @@ gst_xvimagesink_check_xshm_calls (GstXContext * xcontext)
error_caught = FALSE;
handler = XSetErrorHandler (gst_xvimagesink_handle_xerror);
xvimage->size = (xcontext->bpp / 8);
/* Trying to create a 1x1 picture */
xvimage->xvimage = XvShmCreateImage (xcontext->disp, xcontext->xv_port_id,
xcontext->im_format, NULL, 1, 1, &xvimage->SHMInfo);
if (!xvimage->xvimage)
goto out;
xvimage->size = xvimage->xvimage->bytes_per_line;
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
IPC_CREAT | 0777);
xvimage->SHMInfo.shmaddr = shmat (xvimage->SHMInfo.shmid, 0, 0);
@ -184,11 +183,6 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink,
g_mutex_lock (xvimagesink->x_lock);
xvimage->size =
(xvimagesink->xcontext->bpp / 8) * xvimage->width * xvimage->height;
GST_DEBUG_OBJECT (xvimagesink, "GStreamer's image size is %d, stride %d",
xvimage->size, xvimage->size / xvimage->height);
#ifdef HAVE_XSHM
if (xvimagesink->xcontext->use_xshm) {
xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp,
@ -222,7 +216,8 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink,
xvimage->im_format, NULL, xvimage->width, xvimage->height);
/* Allocating memory for image's data */
xvimage->xvimage->data = g_malloc (xvimage->xvimage->data_size);
xvimage->size = xvimage->xvimage->data_size;
xvimage->xvimage->data = g_malloc (xvimage->size);
XSync (xvimagesink->xcontext->disp, FALSE);
}