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:
parent
7861c8410f
commit
23f23004c5
@ -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>
|
2004-07-27 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* ext/libpng/gstpngdec.c: (gst_pngdec_src_getcaps):
|
* ext/libpng/gstpngdec.c: (gst_pngdec_src_getcaps):
|
||||||
|
@ -125,14 +125,13 @@ gst_xvimagesink_check_xshm_calls (GstXContext * xcontext)
|
|||||||
error_caught = FALSE;
|
error_caught = FALSE;
|
||||||
handler = XSetErrorHandler (gst_xvimagesink_handle_xerror);
|
handler = XSetErrorHandler (gst_xvimagesink_handle_xerror);
|
||||||
|
|
||||||
xvimage->size = (xcontext->bpp / 8);
|
|
||||||
|
|
||||||
/* Trying to create a 1x1 picture */
|
/* Trying to create a 1x1 picture */
|
||||||
xvimage->xvimage = XvShmCreateImage (xcontext->disp, xcontext->xv_port_id,
|
xvimage->xvimage = XvShmCreateImage (xcontext->disp, xcontext->xv_port_id,
|
||||||
xcontext->im_format, NULL, 1, 1, &xvimage->SHMInfo);
|
xcontext->im_format, NULL, 1, 1, &xvimage->SHMInfo);
|
||||||
if (!xvimage->xvimage)
|
if (!xvimage->xvimage)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
xvimage->size = xvimage->xvimage->bytes_per_line;
|
||||||
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
|
xvimage->SHMInfo.shmid = shmget (IPC_PRIVATE, xvimage->size,
|
||||||
IPC_CREAT | 0777);
|
IPC_CREAT | 0777);
|
||||||
xvimage->SHMInfo.shmaddr = shmat (xvimage->SHMInfo.shmid, 0, 0);
|
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);
|
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
|
#ifdef HAVE_XSHM
|
||||||
if (xvimagesink->xcontext->use_xshm) {
|
if (xvimagesink->xcontext->use_xshm) {
|
||||||
xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp,
|
xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp,
|
||||||
@ -222,7 +216,8 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink,
|
|||||||
xvimage->im_format, NULL, xvimage->width, xvimage->height);
|
xvimage->im_format, NULL, xvimage->width, xvimage->height);
|
||||||
|
|
||||||
/* Allocating memory for image's data */
|
/* 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);
|
XSync (xvimagesink->xcontext->disp, FALSE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user