GNOME Bugzilla – Bug 673327
ximagesink/xvimagesink don't compile on Mac; here is a fix.
Last modified: 2012-04-02 09:39:37 UTC
Ximagesink and xvimagesink don't compile on the Mac unless I apply my following two patches: patch #1(xvimagesink): --- sys/xvimage/xvimagepool.c.orig 2012-02-16 08:15:28.000000000 -0500 +++ sys/xvimage/xvimagepool.c 2012-02-19 22:16:25.000000000 -0500 @@ -227,6 +227,7 @@ /* Delete the shared memory segment as soon as we everyone is attached. * This way, it will be deleted as soon as we detach later, and not * leaked if we crash. */ + shmctl (meta->SHMInfo.shmid, IPC_RMID, NULL); GST_DEBUG_OBJECT (xvimagesink, "XServer ShmAttached to 0x%x, id 0x%lx", @@ -296,13 +297,17 @@ ("Failed to create output image buffer of %dx%d pixels", width, height), ("Failed to shmat: %s", g_strerror (errno))); /* Clean up the shared memory segment */ +#ifdef HAVE_XSHM shmctl (meta->SHMInfo.shmid, IPC_RMID, NULL); +#endif goto beach; } xattach_failed: { /* Clean up the shared memory segment */ +#ifdef HAVE_XSHM shmctl (meta->SHMInfo.shmid, IPC_RMID, NULL); +#endif g_mutex_unlock (xvimagesink->x_lock); GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE, patch #2(ximagesink): --- sys/ximage/ximagepool.c.orig 2012-02-16 08:15:28.000000000 -0500 +++ sys/ximage/ximagepool.c 2012-02-19 22:17:11.000000000 -0500 @@ -172,8 +172,10 @@ /* Now that everyone has attached, we can delete the shared memory segment. * This way, it will be deleted as soon as we detach later, and not * leaked if we crash. */ + shmctl (meta->SHMInfo.shmid, IPC_RMID, NULL); + GST_DEBUG_OBJECT (ximagesink, "XServer ShmAttached to 0x%x, id 0x%lx", meta->SHMInfo.shmid, meta->SHMInfo.shmseg); } else @@ -262,13 +264,17 @@ ("Failed to create output image buffer of %dx%d pixels", width, height), ("Failed to shmat: %s", g_strerror (errno))); /* Clean up the shared memory segment */ +#ifdef HAVE_XSHM shmctl (meta->SHMInfo.shmid, IPC_RMID, NULL); +#endif goto beach; } xattach_failed: { /* Clean up the shared memory segment */ +#ifdef HAVE_XSHM shmctl (meta->SHMInfo.shmid, IPC_RMID, NULL); +#endif g_mutex_unlock (ximagesink->x_lock); GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE,
Can you try if this also works, it comments out the complete error handling block. commit 798ce6c0e1cc28eba8c444809e7e8de01bfccec7 Author: Jonathan Lyons <jclyons at wesleyan.edu> Date: Mon Apr 2 11:37:43 2012 +0200 x11: fix build without XSHM Fixes https://bugzilla.gnome.org/show_bug.cgi?id=673327