*
* 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.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
/**
static gboolean
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
{
- GstXImageMeta *meta;
+ GstXImageMemory *mem;
GstVideoCropMeta *crop;
GstVideoRectangle src, dst, result;
gboolean draw_border = FALSE;
}
}
- meta = gst_buffer_get_ximage_meta (ximage);
+ mem = (GstXImageMemory *) gst_buffer_peek_memory (ximage, 0);
crop = gst_buffer_get_video_crop_meta (ximage);
if (crop) {
- src.x = crop->x + meta->x;
- src.y = crop->y + meta->y;
+ src.x = crop->x + mem->x;
+ src.y = crop->y + mem->y;
src.w = crop->width;
src.h = crop->height;
GST_LOG_OBJECT (ximagesink,
"crop %dx%d-%dx%d", crop->x, crop->y, crop->width, crop->height);
} else {
- src.x = meta->x;
- src.y = meta->y;
- src.w = meta->width;
- src.h = meta->height;
+ src.x = mem->x;
+ src.y = mem->y;
+ src.w = mem->width;
+ src.h = mem->height;
}
dst.w = ximagesink->xwindow->width;
dst.h = ximagesink->xwindow->height;
ximage, 0, 0, result.x, result.y, result.w, result.h,
ximagesink->xwindow->width, ximagesink->xwindow->height);
XShmPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
- ximagesink->xwindow->gc, meta->ximage, src.x, src.y, result.x, result.y,
+ ximagesink->xwindow->gc, mem->ximage, src.x, src.y, result.x, result.y,
result.w, result.h, FALSE);
} else
#endif /* HAVE_XSHM */
ximage, 0, 0, result.x, result.y, result.w, result.h,
ximagesink->xwindow->width, ximagesink->xwindow->height);
XPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
- ximagesink->xwindow->gc, meta->ximage, src.x, src.y, result.x, result.y,
+ ximagesink->xwindow->gc, mem->ximage, src.x, src.y, result.x, result.y,
result.w, result.h);
}
caps = intersection;
}
+ if (gst_caps_is_empty (caps)) {
+ g_mutex_unlock (&ximagesink->x_lock);
+ return caps;
+ }
+
if (ximagesink->xwindow && ximagesink->xwindow->width) {
GstStructure *s0, *s1;
{
GstFlowReturn res;
GstXImageSink *ximagesink;
- GstXImageMeta *meta;
+ GstXImageMemory *mem;
GstBuffer *to_put = NULL;
ximagesink = GST_XIMAGESINK (vsink);
- meta = gst_buffer_get_ximage_meta (buf);
-
- if (meta && meta->sink == ximagesink) {
+ if (gst_buffer_n_memory (buf) == 1
+ && (mem = (GstXImageMemory *) gst_buffer_peek_memory (buf, 0))
+ && g_strcmp0 (mem->parent.allocator->mem_type, "ximage") == 0
+ && mem->sink == ximagesink) {
/* If this buffer has been allocated using our buffer management we simply
put the ximage which is in the PRIVATE pointer */
GST_LOG_OBJECT (ximagesink, "buffer from our pool, writing directly");