2011-10-17 15:25:11 +00:00
|
|
|
/* Gstreamer video blending utility functions
|
|
|
|
*
|
|
|
|
* Copied/pasted from gst/videoconvert/videoconvert.c
|
|
|
|
* Copyright (C) 2010 David Schleef <ds@schleef.org>
|
|
|
|
* Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
|
|
|
*
|
|
|
|
* Copyright (C) <2011> Intel Corporation
|
|
|
|
* Copyright (C) <2011> Collabora Ltd.
|
|
|
|
* Copyright (C) <2011> Thibault Saunier <thibault.saunier@collabora.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "video-blend.h"
|
|
|
|
#include "videoblendorc.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
|
|
|
|
#define GST_CAT_DEFAULT ensure_debug_category()
|
|
|
|
|
|
|
|
static GstDebugCategory *
|
|
|
|
ensure_debug_category (void)
|
|
|
|
{
|
|
|
|
static gsize cat_gonce = 0;
|
|
|
|
|
|
|
|
if (g_once_init_enter (&cat_gonce)) {
|
|
|
|
gsize cat_done;
|
|
|
|
|
|
|
|
cat_done = (gsize) _gst_debug_category_new ("video-blending", 0,
|
|
|
|
"video blending");
|
|
|
|
|
|
|
|
g_once_init_leave (&cat_gonce, cat_done);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (GstDebugCategory *) cat_gonce;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define ensure_debug_category() /* NOOP */
|
|
|
|
|
|
|
|
#endif /* GST_DISABLE_GST_DEBUG */
|
|
|
|
|
|
|
|
static void
|
|
|
|
matrix_identity (guint8 * tmpline, guint width)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-12-14 14:14:47 +00:00
|
|
|
static void
|
|
|
|
matrix_prea_rgb_to_yuv (guint8 * tmpline, guint width)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int a, r, g, b;
|
|
|
|
int y, u, v;
|
|
|
|
|
|
|
|
for (i = 0; i < width; i++) {
|
|
|
|
a = tmpline[i * 4 + 0];
|
|
|
|
r = tmpline[i * 4 + 1];
|
|
|
|
g = tmpline[i * 4 + 2];
|
|
|
|
b = tmpline[i * 4 + 3];
|
|
|
|
if (a) {
|
|
|
|
r = (r * 255 + a / 2) / a;
|
|
|
|
g = (g * 255 + a / 2) / a;
|
|
|
|
b = (b * 255 + a / 2) / a;
|
|
|
|
}
|
|
|
|
|
|
|
|
y = (47 * r + 157 * g + 16 * b + 4096) >> 8;
|
|
|
|
u = (-26 * r - 87 * g + 112 * b + 32768) >> 8;
|
|
|
|
v = (112 * r - 102 * g - 10 * b + 32768) >> 8;
|
|
|
|
|
|
|
|
tmpline[i * 4 + 1] = CLAMP (y, 0, 255);
|
|
|
|
tmpline[i * 4 + 2] = CLAMP (u, 0, 255);
|
|
|
|
tmpline[i * 4 + 3] = CLAMP (v, 0, 255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-17 15:25:11 +00:00
|
|
|
static void
|
|
|
|
matrix_rgb_to_yuv (guint8 * tmpline, guint width)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int r, g, b;
|
|
|
|
int y, u, v;
|
|
|
|
|
|
|
|
for (i = 0; i < width; i++) {
|
|
|
|
r = tmpline[i * 4 + 1];
|
|
|
|
g = tmpline[i * 4 + 2];
|
|
|
|
b = tmpline[i * 4 + 3];
|
|
|
|
|
|
|
|
y = (47 * r + 157 * g + 16 * b + 4096) >> 8;
|
|
|
|
u = (-26 * r - 87 * g + 112 * b + 32768) >> 8;
|
|
|
|
v = (112 * r - 102 * g - 10 * b + 32768) >> 8;
|
|
|
|
|
|
|
|
tmpline[i * 4 + 1] = CLAMP (y, 0, 255);
|
|
|
|
tmpline[i * 4 + 2] = CLAMP (u, 0, 255);
|
|
|
|
tmpline[i * 4 + 3] = CLAMP (v, 0, 255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
matrix_yuv_to_rgb (guint8 * tmpline, guint width)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int r, g, b;
|
|
|
|
int y, u, v;
|
|
|
|
|
|
|
|
for (i = 0; i < width; i++) {
|
|
|
|
y = tmpline[i * 4 + 1];
|
|
|
|
u = tmpline[i * 4 + 2];
|
|
|
|
v = tmpline[i * 4 + 3];
|
|
|
|
|
|
|
|
r = (298 * y + 459 * v - 63514) >> 8;
|
|
|
|
g = (298 * y - 55 * u - 136 * v + 19681) >> 8;
|
|
|
|
b = (298 * y + 541 * u - 73988) >> 8;
|
|
|
|
|
2011-12-14 16:34:39 +00:00
|
|
|
tmpline[i * 4 + 1] = CLAMP (r, 0, 255);
|
|
|
|
tmpline[i * 4 + 2] = CLAMP (g, 0, 255);
|
|
|
|
tmpline[i * 4 + 3] = CLAMP (b, 0, 255);
|
2011-10-17 15:25:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-14 14:14:47 +00:00
|
|
|
#define BLEND00(ret, alpha, v0, v1) \
|
|
|
|
G_STMT_START { \
|
2011-10-17 15:25:11 +00:00
|
|
|
ret = (v0 * alpha + v1 * (255 - alpha)) / 255; \
|
2011-12-14 14:14:47 +00:00
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
#define BLEND10(ret, alpha, v0, v1) \
|
|
|
|
G_STMT_START { \
|
|
|
|
ret = v0 + (v1 * (255 - alpha)) / 255; \
|
|
|
|
} G_STMT_END
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
/* returns newly-allocated buffer, which caller must unref */
|
2011-10-17 15:25:11 +00:00
|
|
|
void
|
2012-06-28 16:16:20 +00:00
|
|
|
gst_video_blend_scale_linear_RGBA (GstVideoInfo * src, GstBuffer * src_buffer,
|
|
|
|
gint dest_height, gint dest_width, GstVideoInfo * dest,
|
|
|
|
GstBuffer ** dest_buffer)
|
2011-10-17 15:25:11 +00:00
|
|
|
{
|
2012-03-25 00:31:41 +00:00
|
|
|
const guint8 *src_pixels;
|
2011-10-17 15:25:11 +00:00
|
|
|
int acc;
|
|
|
|
int y_increment;
|
|
|
|
int x_increment;
|
|
|
|
int y1;
|
|
|
|
int i;
|
|
|
|
int j;
|
|
|
|
int x;
|
|
|
|
int dest_size;
|
2012-07-16 14:25:42 +00:00
|
|
|
guint dest_stride;
|
|
|
|
guint src_stride;
|
2012-06-28 16:16:20 +00:00
|
|
|
guint8 *dest_pixels;
|
2011-10-17 15:25:11 +00:00
|
|
|
guint8 *tmpbuf = g_malloc (dest_width * 8 * 4);
|
2012-06-28 16:16:20 +00:00
|
|
|
GstVideoFrame src_frame, dest_frame;
|
|
|
|
|
|
|
|
g_return_if_fail (dest_buffer != NULL);
|
|
|
|
|
|
|
|
gst_video_info_init (dest);
|
|
|
|
gst_video_info_set_format (dest, GST_VIDEO_INFO_FORMAT (src),
|
|
|
|
dest_width, dest_height);
|
|
|
|
|
|
|
|
*dest_buffer = gst_buffer_new_and_alloc (GST_VIDEO_INFO_SIZE (dest));
|
|
|
|
|
|
|
|
gst_video_frame_map (&src_frame, src, src_buffer, GST_MAP_READ);
|
|
|
|
gst_video_frame_map (&dest_frame, dest, *dest_buffer, GST_MAP_WRITE);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
|
|
|
if (dest_height == 1)
|
|
|
|
y_increment = 0;
|
|
|
|
else
|
|
|
|
y_increment = ((src->height - 1) << 16) / (dest_height - 1) - 1;
|
|
|
|
|
|
|
|
if (dest_width == 1)
|
|
|
|
x_increment = 0;
|
|
|
|
else
|
|
|
|
x_increment = ((src->width - 1) << 16) / (dest_width - 1) - 1;
|
|
|
|
|
2012-07-16 14:25:42 +00:00
|
|
|
dest_size = dest_stride = dest_width * 4;
|
|
|
|
src_stride = GST_VIDEO_FRAME_PLANE_STRIDE (&src_frame, 0);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
|
|
|
#define LINE(x) ((tmpbuf) + (dest_size)*((x)&1))
|
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
dest_pixels = GST_VIDEO_FRAME_PLANE_DATA (&dest_frame, 0);
|
|
|
|
src_pixels = GST_VIDEO_FRAME_PLANE_DATA (&src_frame, 0);
|
2012-03-25 00:31:41 +00:00
|
|
|
|
2011-10-17 15:25:11 +00:00
|
|
|
acc = 0;
|
2012-03-25 00:31:41 +00:00
|
|
|
orc_resample_bilinear_u32 (LINE (0), src_pixels, 0, x_increment, dest_width);
|
2011-10-17 15:25:11 +00:00
|
|
|
y1 = 0;
|
|
|
|
for (i = 0; i < dest_height; i++) {
|
|
|
|
j = acc >> 16;
|
|
|
|
x = acc & 0xffff;
|
|
|
|
|
|
|
|
if (x == 0) {
|
|
|
|
memcpy (dest_pixels + i * dest_stride, LINE (j), dest_size);
|
|
|
|
} else {
|
|
|
|
if (j > y1) {
|
|
|
|
orc_resample_bilinear_u32 (LINE (j),
|
2012-03-25 00:31:41 +00:00
|
|
|
src_pixels + j * src_stride, 0, x_increment, dest_width);
|
2011-10-17 15:25:11 +00:00
|
|
|
y1++;
|
|
|
|
}
|
|
|
|
if (j >= y1) {
|
|
|
|
orc_resample_bilinear_u32 (LINE (j + 1),
|
2012-03-25 00:31:41 +00:00
|
|
|
src_pixels + (j + 1) * src_stride, 0, x_increment, dest_width);
|
2011-10-17 15:25:11 +00:00
|
|
|
y1++;
|
|
|
|
}
|
|
|
|
orc_merge_linear_u8 (dest_pixels + i * dest_stride,
|
|
|
|
LINE (j), LINE (j + 1), (x >> 8), dest_width * 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
acc += y_increment;
|
|
|
|
}
|
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
gst_video_frame_unmap (&src_frame);
|
|
|
|
gst_video_frame_unmap (&dest_frame);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
|
|
|
g_free (tmpbuf);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* video_blend:
|
|
|
|
* @dest: The #GstBlendVideoFormatInfo where to blend @src in
|
|
|
|
* @src: the #GstBlendVideoFormatInfo that we want to blend into
|
|
|
|
* @dest
|
|
|
|
* @x: The x offset in pixel where the @src image should be blended
|
|
|
|
* @y: the y offset in pixel where the @src image should be blended
|
2012-03-24 19:31:29 +00:00
|
|
|
* @global_alpha: the global_alpha each per-pixel alpha value is multiplied
|
|
|
|
* with
|
2011-10-17 15:25:11 +00:00
|
|
|
*
|
|
|
|
* Lets you blend the @src image into the @dest image
|
|
|
|
*/
|
|
|
|
gboolean
|
2012-05-30 07:25:12 +00:00
|
|
|
gst_video_blend (GstVideoFrame * dest,
|
2012-06-20 08:35:04 +00:00
|
|
|
GstVideoFrame * src, gint x, gint y, gfloat global_alpha)
|
2011-10-17 15:25:11 +00:00
|
|
|
{
|
2012-06-28 16:16:20 +00:00
|
|
|
guint i, j, global_alpha_val, src_width, src_height, dest_width, dest_height;
|
|
|
|
gint xoff;
|
2011-12-14 14:14:47 +00:00
|
|
|
guint8 *tmpdestline = NULL, *tmpsrcline = NULL;
|
2012-06-28 16:16:20 +00:00
|
|
|
gboolean src_premultiplied_alpha, dest_premultiplied_alpha;
|
|
|
|
void (*matrix) (guint8 * tmpline, guint width);
|
|
|
|
const GstVideoFormatInfo *sinfo, *dinfo;
|
2011-12-14 14:14:47 +00:00
|
|
|
|
2012-03-25 00:22:29 +00:00
|
|
|
g_assert (dest != NULL);
|
|
|
|
g_assert (src != NULL);
|
|
|
|
|
|
|
|
global_alpha_val = 256.0 * global_alpha;
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
dest_premultiplied_alpha =
|
|
|
|
GST_VIDEO_INFO_FLAGS (&dest->info) & GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA;
|
|
|
|
src_premultiplied_alpha =
|
|
|
|
GST_VIDEO_INFO_FLAGS (&src->info) & GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA;
|
|
|
|
|
2011-12-14 14:14:47 +00:00
|
|
|
/* we do no support writing to premultiplied alpha, though that should
|
|
|
|
just be a matter of adding blenders below (BLEND01 and BLEND11) */
|
2012-06-28 16:16:20 +00:00
|
|
|
g_return_val_if_fail (!dest_premultiplied_alpha, FALSE);
|
2011-12-14 14:14:47 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
src_width = GST_VIDEO_FRAME_WIDTH (src);
|
|
|
|
src_height = GST_VIDEO_FRAME_HEIGHT (src);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
dest_width = GST_VIDEO_FRAME_WIDTH (dest);
|
|
|
|
dest_height = GST_VIDEO_FRAME_HEIGHT (dest);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
tmpdestline = g_malloc (sizeof (guint8) * (dest_width + 8) * 4);
|
|
|
|
tmpsrcline = g_malloc (sizeof (guint8) * (dest_width + 8) * 4);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
ensure_debug_category ();
|
|
|
|
|
|
|
|
dinfo = gst_video_format_get_info (GST_VIDEO_FRAME_FORMAT (dest));
|
|
|
|
sinfo = gst_video_format_get_info (GST_VIDEO_FRAME_FORMAT (src));
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
if (!sinfo || !dinfo)
|
2011-10-17 15:25:11 +00:00
|
|
|
goto failed;
|
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
matrix = matrix_identity;
|
|
|
|
if (GST_VIDEO_INFO_IS_RGB (&src->info) != GST_VIDEO_INFO_IS_RGB (&dest->info)) {
|
|
|
|
if (GST_VIDEO_INFO_IS_RGB (&src->info)) {
|
2011-12-14 14:14:47 +00:00
|
|
|
if (src_premultiplied_alpha) {
|
2012-06-28 16:16:20 +00:00
|
|
|
matrix = matrix_prea_rgb_to_yuv;
|
2011-12-14 14:14:47 +00:00
|
|
|
src_premultiplied_alpha = FALSE;
|
|
|
|
} else {
|
2012-06-28 16:16:20 +00:00
|
|
|
matrix = matrix_rgb_to_yuv;
|
2011-12-14 14:14:47 +00:00
|
|
|
}
|
|
|
|
} else {
|
2012-06-28 16:16:20 +00:00
|
|
|
matrix = matrix_yuv_to_rgb;
|
2011-12-14 14:14:47 +00:00
|
|
|
}
|
|
|
|
}
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
xoff = 0;
|
|
|
|
|
2011-10-17 15:25:11 +00:00
|
|
|
/* adjust src pointers for negative sizes */
|
|
|
|
if (x < 0) {
|
2012-06-28 16:16:20 +00:00
|
|
|
src_width -= -x;
|
2011-10-17 15:25:11 +00:00
|
|
|
x = 0;
|
2012-06-28 16:16:20 +00:00
|
|
|
xoff = -x;
|
2011-10-17 15:25:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (y < 0) {
|
2012-06-28 16:16:20 +00:00
|
|
|
src_height -= -y;
|
2011-10-17 15:25:11 +00:00
|
|
|
y = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* adjust width/height if the src is bigger than dest */
|
2012-06-28 16:16:20 +00:00
|
|
|
if (x + src_width > dest_width)
|
|
|
|
src_width = dest_width - x;
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
if (y + src_height > dest_height)
|
|
|
|
src_height = dest_height - y;
|
2012-03-25 00:31:41 +00:00
|
|
|
|
2011-10-17 15:25:11 +00:00
|
|
|
/* Mainloop doing the needed conversions, and blending */
|
2012-03-25 00:31:41 +00:00
|
|
|
for (i = y; i < y + src_height; i++) {
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
dinfo->unpack_func (dinfo, 0, tmpdestline, dest->data, dest->info.stride,
|
|
|
|
0, i, dest_width);
|
|
|
|
sinfo->unpack_func (sinfo, 0, tmpsrcline, src->data, src->info.stride,
|
|
|
|
xoff, i - y, src_width - xoff);
|
2011-10-17 15:25:11 +00:00
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
matrix (tmpsrcline, src_width);
|
|
|
|
|
|
|
|
tmpdestline += 4 * x;
|
2011-10-17 15:25:11 +00:00
|
|
|
|
|
|
|
/* Here dest and src are both either in AYUV or ARGB
|
|
|
|
* TODO: Make the orc version working properly*/
|
2012-03-25 00:22:29 +00:00
|
|
|
#define BLENDLOOP(blender,alpha_val,alpha_scale) \
|
2011-12-14 14:14:47 +00:00
|
|
|
do { \
|
2012-03-25 00:31:41 +00:00
|
|
|
for (j = 0; j < src_width * 4; j += 4) { \
|
2012-03-25 00:22:29 +00:00
|
|
|
guint8 alpha; \
|
|
|
|
\
|
|
|
|
alpha = (tmpsrcline[j] * alpha_val) / alpha_scale; \
|
2011-12-14 14:14:47 +00:00
|
|
|
\
|
|
|
|
blender (tmpdestline[j + 1], alpha, tmpsrcline[j + 1], tmpdestline[j + 1]); \
|
|
|
|
blender (tmpdestline[j + 2], alpha, tmpsrcline[j + 2], tmpdestline[j + 2]); \
|
|
|
|
blender (tmpdestline[j + 3], alpha, tmpsrcline[j + 3], tmpdestline[j + 3]); \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
2012-03-25 00:22:29 +00:00
|
|
|
if (G_LIKELY (global_alpha == 1.0)) {
|
2012-06-28 16:16:20 +00:00
|
|
|
if (src_premultiplied_alpha && dest_premultiplied_alpha) {
|
2012-03-25 00:22:29 +00:00
|
|
|
/* BLENDLOOP (BLEND11, 1, 1); */
|
2012-06-28 16:16:20 +00:00
|
|
|
} else if (!src_premultiplied_alpha && dest_premultiplied_alpha) {
|
2012-03-25 00:22:29 +00:00
|
|
|
/* BLENDLOOP (BLEND01, 1, 1); */
|
2012-06-28 16:16:20 +00:00
|
|
|
} else if (src_premultiplied_alpha && !dest_premultiplied_alpha) {
|
2012-03-25 00:22:29 +00:00
|
|
|
BLENDLOOP (BLEND10, 1, 1);
|
|
|
|
} else {
|
|
|
|
BLENDLOOP (BLEND00, 1, 1);
|
|
|
|
}
|
2011-12-14 14:14:47 +00:00
|
|
|
} else {
|
2012-06-28 16:16:20 +00:00
|
|
|
if (src_premultiplied_alpha && dest_premultiplied_alpha) {
|
2012-03-25 00:22:29 +00:00
|
|
|
/* BLENDLOOP (BLEND11, global_alpha_val, 256); */
|
2012-06-28 16:16:20 +00:00
|
|
|
} else if (!src_premultiplied_alpha && dest_premultiplied_alpha) {
|
2012-03-25 00:22:29 +00:00
|
|
|
/* BLENDLOOP (BLEND01, global_alpha_val, 256); */
|
2012-06-28 16:16:20 +00:00
|
|
|
} else if (src_premultiplied_alpha && !dest_premultiplied_alpha) {
|
2012-03-25 00:22:29 +00:00
|
|
|
BLENDLOOP (BLEND10, global_alpha_val, 256);
|
|
|
|
} else {
|
|
|
|
BLENDLOOP (BLEND00, global_alpha_val, 256);
|
|
|
|
}
|
2011-10-17 15:25:11 +00:00
|
|
|
}
|
|
|
|
|
2011-12-14 14:14:47 +00:00
|
|
|
#undef BLENDLOOP
|
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
tmpdestline -= 4 * x;
|
|
|
|
|
2011-10-17 15:25:11 +00:00
|
|
|
/* FIXME
|
|
|
|
* #if G_BYTE_ORDER == LITTLE_ENDIAN
|
|
|
|
* orc_blend_little (tmpdestline, tmpsrcline, dest->width);
|
|
|
|
* #else
|
|
|
|
* orc_blend_big (tmpdestline, tmpsrcline, src->width);
|
|
|
|
* #endif
|
|
|
|
*/
|
|
|
|
|
2012-06-28 16:16:20 +00:00
|
|
|
dinfo->pack_func (dinfo, 0, tmpdestline, dest_width,
|
|
|
|
dest->data, dest->info.stride, dest->info.chroma_site, i, dest_width);
|
2011-10-17 15:25:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (tmpdestline);
|
|
|
|
g_free (tmpsrcline);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
failed:
|
|
|
|
GST_WARNING ("Could not do the blending");
|
|
|
|
g_free (tmpdestline);
|
|
|
|
g_free (tmpsrcline);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|