1 /* Gstreamer video blending utility functions
3 * Copyright (C) <2011> Intel Corporation
4 * Copyright (C) <2011> Collabora Ltd.
5 * Copyright (C) <2011> Thibault Saunier <thibault.saunier@collabora.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #ifndef __GST_VIDEO_BLEND__
25 #define __GST_VIDEO_BLEND__
28 #include <gst/video/video.h>
30 #define MAX_VIDEO_PLANES 4
32 typedef struct _GstBlendVideoFormatInfo GstBlendVideoFormatInfo;
34 /* GstBlendVideoFormatInfo:
35 * @fmt: The #GstVideoFormat describing the video format
36 * @width: The width of the video
37 * @height: The height of the video
38 * @pixels: The buffer containing the pixels of the video
39 * @size: The size in byte of @pixels
40 * @offset: The offsets of the different component of the video
41 * @stride: The stride of the different component of the video
43 * Information describing image properties containing necessary
44 * fields to do video blending.
46 struct _GstBlendVideoFormatInfo
56 /* YUV components: Y=0, U=1, V=2, A=3
57 * RGB components: R=0, G=1, B=2, A=3 */
58 gint offset[MAX_VIDEO_PLANES];
59 gint stride[MAX_VIDEO_PLANES];
62 void video_blend_format_info_init (GstBlendVideoFormatInfo * info,
63 guint8 *pixels, guint height,
64 guint width, GstVideoFormat fmt);
66 void video_blend_scale_linear_RGBA (GstBlendVideoFormatInfo * src,
67 gint dest_height, gint dest_width);
69 gboolean video_blend (GstBlendVideoFormatInfo * dest,
70 GstBlendVideoFormatInfo * src,