Remove compositor plugin which was moved to -base

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/138
This commit is contained in:
Tim-Philipp Müller 2018-12-27 13:41:05 +01:00
parent b9e15fddb1
commit e42efbccb1
29 changed files with 4 additions and 7812 deletions

1
.gitignore vendored
View file

@ -61,7 +61,6 @@ gst*orc.h
/tests/examples/ipcpipeline/ipcpipeline1
/tests/examples/codecparsers/parse-jpeg
/tests/examples/codecparsers/parse-vp8
/tests/examples/compositor/crossfade
/tests/examples/shapewipe/shapewipe-example
/tests/examples/jack/jack_client
/tests/examples/opencv/gstmotioncells_dynamic_test

View file

@ -441,7 +441,6 @@ AG_GST_CHECK_PLUGIN(audiobuffersplit)
AG_GST_CHECK_PLUGIN(audiofxbad)
AG_GST_CHECK_PLUGIN(audiolatency)
AG_GST_CHECK_PLUGIN(audiomixmatrix)
AG_GST_CHECK_PLUGIN(compositor)
AG_GST_CHECK_PLUGIN(audiovisualizers)
AG_GST_CHECK_PLUGIN(autoconvert)
AG_GST_CHECK_PLUGIN(bayer)
@ -2578,7 +2577,6 @@ gst/videosignal/Makefile
gst/vmnc/Makefile
gst/y4m/Makefile
gst/yadif/Makefile
gst/compositor/Makefile
gst-libs/Makefile
gst-libs/gst/Makefile
gst-libs/gst/adaptivedemux/Makefile
@ -2628,7 +2626,6 @@ tests/examples/Makefile
tests/examples/avsamplesink/Makefile
tests/examples/camerabin2/Makefile
tests/examples/codecparsers/Makefile
tests/examples/compositor/Makefile
tests/examples/directfb/Makefile
tests/examples/audiomixmatrix/Makefile
tests/examples/ipcpipeline/Makefile

View file

@ -54,7 +54,6 @@
<xi:include href="xml/element-coloreffects.xml" />
<xi:include href="xml/element-combdetect.xml" />
<xi:include href="xml/element-compare.xml" />
<xi:include href="xml/element-compositor.xml" />
<xi:include href="xml/element-curlfilesink.xml" />
<xi:include href="xml/element-curlftpsink.xml" />
<xi:include href="xml/element-curlhttpsink.xml" />
@ -310,7 +309,6 @@
<xi:include href="xml/plugin-chromaprint.xml" />
<xi:include href="xml/plugin-coloreffects.xml" />
<xi:include href="xml/plugin-colormanagement.xml" />
<xi:include href="xml/plugin-compositor.xml" />
<xi:include href="xml/plugin-curl.xml" />
<xi:include href="xml/plugin-dashdemux.xml" />
<xi:include href="xml/plugin-dc1394.xml" />

View file

@ -629,23 +629,6 @@ GST_TYPE_COMPARE
gst_compare_get_type
</SECTION>
<SECTION>
<FILE>element-compositor</FILE>
<TITLE>compositor</TITLE>
GstCompositor
GstCompositorBackground
<SUBSECTION Standard>
GstCompositorClass
GST_COMPOSITOR
GST_COMPOSITOR_CAST
GST_IS_COMPOSITOR
GST_COMPOSITOR_CLASS
GST_IS_COMPOSITOR_CLASS
GST_TYPE_COMPOSITOR
<SUBSECTION Private>
gst_compositor_get_type
</SECTION>
<SECTION>
<FILE>element-curlfilesink</FILE>
<TITLE>curlfilesink</TITLE>

View file

@ -67070,16 +67070,6 @@ Gestures in the defined region of interest will emit messages.</BLURB>
<DEFAULT>NULL</DEFAULT>
</ARG>
<ARG>
<NAME>GstCompositor::background</NAME>
<TYPE>GstCompositorBackground</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>Background</NICK>
<BLURB>Background type.</BLURB>
<DEFAULT>Checker pattern</DEFAULT>
</ARG>
<ARG>
<NAME>GstGLVideoMixer::background</NAME>
<TYPE>GstGLVideoMixerBackground</TYPE>

View file

@ -19,7 +19,6 @@ GObject
GstAggregator
GstMXFMux
GstVideoAggregator
GstCompositor
GstGLBaseMixer
GstGLMixer
GstGLMosaic

View file

@ -20,7 +20,6 @@ GstCameraBin GstChildProxy GstImplementsInterface GstColorBalance GstTagSetter
GstCameraBin GstChildProxy GstTagSetter
GstCameraBin2 GstChildProxy GstTagSetter
GstCeltEnc GstPreset GstTagSetter
GstCompositor GstChildProxy
GstCurlHttpSrc GstURIHandler
GstDashDemux GstChildProxy
GstDfbVideoSink GstImplementsInterface GstNavigation GstColorBalance

View file

@ -1,34 +0,0 @@
<plugin>
<name>compositor</name>
<description>Compositor</description>
<filename>../../gst/compositor/.libs/libgstcompositor.so</filename>
<basename>libgstcompositor.so</basename>
<version>1.15.0.1</version>
<license>LGPL</license>
<source>gst-plugins-bad</source>
<package>GStreamer Bad Plug-ins git</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>compositor</name>
<longname>Compositor</longname>
<class>Filter/Editor/Video/Compositor</class>
<description>Composite multiple video streams</description>
<author>Wim Taymans &lt;wim@fluendo.com&gt;, Sebastian Dröge &lt;sebastian.droege@collabora.co.uk&gt;</author>
<pads>
<caps>
<name>sink_%u</name>
<direction>sink</direction>
<presence>request</presence>
<details>video/x-raw, format=(string){ AYUV, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, YVYU, I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, RGBx, BGRx }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>video/x-raw, format=(string){ AYUV, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, YVYU, I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, RGBx, BGRx }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</details>
</caps>
</pads>
</element>
</elements>
</plugin>

View file

@ -1 +0,0 @@
compositororc.h

View file

@ -1,27 +0,0 @@
plugin_LTLIBRARIES = libgstcompositor.la
ORC_SOURCE=compositororc
include $(top_srcdir)/common/orc.mak
libgstcompositor_la_SOURCES = \
blend.c \
compositor.c
nodist_libgstcompositor_la_SOURCES = $(ORC_NODIST_SOURCES)
libgstcompositor_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(GST_CFLAGS) $(ORC_CFLAGS)
libgstcompositor_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstvideo-@GST_API_VERSION@ \
$(GST_BASE_LIBS) $(GST_LIBS) $(ORC_LIBS) $(LIBM)
libgstcompositor_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = \
blend.h \
compositor.h

File diff suppressed because it is too large Load diff

View file

@ -1,120 +0,0 @@
/*
* Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __BLEND_H__
#define __BLEND_H__
#include <gst/gst.h>
#include <gst/video/video.h>
/**
* GstCompositorBlendMode:
* @COMPOSITOR_BLEND_MODE_SOURCE: Copy source
* @COMPOSITOR_BLEND_MODE_OVER: Normal blending
* @COMPOSITOR_BLEND_MODE_ADD: Alphas are simply added,
*
* The different modes compositor can use for blending.
*/
typedef enum
{
COMPOSITOR_BLEND_MODE_SOURCE,
COMPOSITOR_BLEND_MODE_OVER,
COMPOSITOR_BLEND_MODE_ADD,
} GstCompositorBlendMode;
typedef void (*BlendFunction) (GstVideoFrame *srcframe, gint xpos, gint ypos, gdouble src_alpha, GstVideoFrame * destframe,
GstCompositorBlendMode mode);
typedef void (*FillCheckerFunction) (GstVideoFrame * frame);
typedef void (*FillColorFunction) (GstVideoFrame * frame, gint c1, gint c2, gint c3);
extern BlendFunction gst_compositor_blend_argb;
extern BlendFunction gst_compositor_blend_bgra;
#define gst_compositor_blend_ayuv gst_compositor_blend_argb
#define gst_compositor_blend_abgr gst_compositor_blend_argb
#define gst_compositor_blend_rgba gst_compositor_blend_bgra
extern BlendFunction gst_compositor_overlay_argb;
extern BlendFunction gst_compositor_overlay_bgra;
#define gst_compositor_overlay_ayuv gst_compositor_overlay_argb
#define gst_compositor_overlay_abgr gst_compositor_overlay_argb
#define gst_compositor_overlay_rgba gst_compositor_overlay_bgra
extern BlendFunction gst_compositor_blend_i420;
#define gst_compositor_blend_yv12 gst_compositor_blend_i420
extern BlendFunction gst_compositor_blend_nv12;
extern BlendFunction gst_compositor_blend_nv21;
extern BlendFunction gst_compositor_blend_y41b;
extern BlendFunction gst_compositor_blend_y42b;
extern BlendFunction gst_compositor_blend_y444;
extern BlendFunction gst_compositor_blend_rgb;
#define gst_compositor_blend_bgr gst_compositor_blend_rgb
extern BlendFunction gst_compositor_blend_rgbx;
#define gst_compositor_blend_bgrx gst_compositor_blend_rgbx
#define gst_compositor_blend_xrgb gst_compositor_blend_rgbx
#define gst_compositor_blend_xbgr gst_compositor_blend_rgbx
extern BlendFunction gst_compositor_blend_yuy2;
#define gst_compositor_blend_uyvy gst_compositor_blend_yuy2;
#define gst_compositor_blend_yvyu gst_compositor_blend_yuy2;
extern FillCheckerFunction gst_compositor_fill_checker_argb;
#define gst_compositor_fill_checker_abgr gst_compositor_fill_checker_argb
extern FillCheckerFunction gst_compositor_fill_checker_bgra;
#define gst_compositor_fill_checker_rgba gst_compositor_fill_checker_bgra
extern FillCheckerFunction gst_compositor_fill_checker_ayuv;
extern FillCheckerFunction gst_compositor_fill_checker_i420;
#define gst_compositor_fill_checker_yv12 gst_compositor_fill_checker_i420
extern FillCheckerFunction gst_compositor_fill_checker_nv12;
extern FillCheckerFunction gst_compositor_fill_checker_nv21;
extern FillCheckerFunction gst_compositor_fill_checker_y41b;
extern FillCheckerFunction gst_compositor_fill_checker_y42b;
extern FillCheckerFunction gst_compositor_fill_checker_y444;
extern FillCheckerFunction gst_compositor_fill_checker_rgb;
#define gst_compositor_fill_checker_bgr gst_compositor_fill_checker_rgb
extern FillCheckerFunction gst_compositor_fill_checker_rgbx;
#define gst_compositor_fill_checker_bgrx gst_compositor_fill_checker_rgbx
#define gst_compositor_fill_checker_xrgb gst_compositor_fill_checker_rgbx
#define gst_compositor_fill_checker_xbgr gst_compositor_fill_checker_rgbx
extern FillCheckerFunction gst_compositor_fill_checker_yuy2;
#define gst_compositor_fill_checker_yvyu gst_compositor_fill_checker_yuy2;
extern FillCheckerFunction gst_compositor_fill_checker_uyvy;
extern FillColorFunction gst_compositor_fill_color_argb;
extern FillColorFunction gst_compositor_fill_color_abgr;
extern FillColorFunction gst_compositor_fill_color_bgra;
extern FillColorFunction gst_compositor_fill_color_rgba;
extern FillColorFunction gst_compositor_fill_color_ayuv;
extern FillColorFunction gst_compositor_fill_color_i420;
extern FillColorFunction gst_compositor_fill_color_yv12;
extern FillColorFunction gst_compositor_fill_color_nv12;
#define gst_compositor_fill_color_nv21 gst_compositor_fill_color_nv12;
extern FillColorFunction gst_compositor_fill_color_y41b;
extern FillColorFunction gst_compositor_fill_color_y42b;
extern FillColorFunction gst_compositor_fill_color_y444;
extern FillColorFunction gst_compositor_fill_color_rgb;
extern FillColorFunction gst_compositor_fill_color_bgr;
extern FillColorFunction gst_compositor_fill_color_xrgb;
extern FillColorFunction gst_compositor_fill_color_xbgr;
extern FillColorFunction gst_compositor_fill_color_rgbx;
extern FillColorFunction gst_compositor_fill_color_bgrx;
extern FillColorFunction gst_compositor_fill_color_yuy2;
extern FillColorFunction gst_compositor_fill_color_yvyu;
extern FillColorFunction gst_compositor_fill_color_uyvy;
void gst_compositor_init_blend (void);
#endif /* __BLEND_H__ */

View file

@ -1,96 +0,0 @@
/* autogenerated from blendorc.orc */
#ifndef _BLENDORC_H_
#define _BLENDORC_H_
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ORC_INTEGER_TYPEDEFS_
#define _ORC_INTEGER_TYPEDEFS_
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <stdint.h>
typedef int8_t orc_int8;
typedef int16_t orc_int16;
typedef int32_t orc_int32;
typedef int64_t orc_int64;
typedef uint8_t orc_uint8;
typedef uint16_t orc_uint16;
typedef uint32_t orc_uint32;
typedef uint64_t orc_uint64;
#define ORC_UINT64_C(x) UINT64_C(x)
#elif defined(_MSC_VER)
typedef signed __int8 orc_int8;
typedef signed __int16 orc_int16;
typedef signed __int32 orc_int32;
typedef signed __int64 orc_int64;
typedef unsigned __int8 orc_uint8;
typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64)
#define inline __inline
#else
#include <limits.h>
typedef signed char orc_int8;
typedef short orc_int16;
typedef int orc_int32;
typedef unsigned char orc_uint8;
typedef unsigned short orc_uint16;
typedef unsigned int orc_uint32;
#if INT_MAX == LONG_MAX
typedef long long orc_int64;
typedef unsigned long long orc_uint64;
#define ORC_UINT64_C(x) (x##ULL)
#else
typedef long orc_int64;
typedef unsigned long orc_uint64;
#define ORC_UINT64_C(x) (x##UL)
#endif
#endif
typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;
typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32;
typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif
#ifndef ORC_RESTRICT
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4
#define ORC_RESTRICT __restrict__
#else
#define ORC_RESTRICT
#endif
#endif
#ifndef ORC_INTERNAL
#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
#define ORC_INTERNAL __attribute__((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define ORC_INTERNAL __hidden
#elif defined (__GNUC__)
#define ORC_INTERNAL __attribute__((visibility("hidden")))
#else
#define ORC_INTERNAL
#endif
#endif
void compositor_orc_splat_u32 (guint32 * ORC_RESTRICT d1, int p1, int n);
void compositor_orc_memcpy_u32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
void compositor_orc_blend_u8 (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_blend_argb (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_blend_bgra (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_overlay_argb (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_overlay_bgra (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,143 +0,0 @@
/* Generic video compositor plugin
* Copyright (C) 2008 Wim Taymans <wim@fluendo.com>
* Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_COMPOSITOR_H__
#define __GST_COMPOSITOR_H__
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoaggregator.h>
#include "blend.h"
G_BEGIN_DECLS
#define GST_TYPE_COMPOSITOR (gst_compositor_get_type())
#define GST_COMPOSITOR(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_COMPOSITOR, GstCompositor))
#define GST_COMPOSITOR_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_COMPOSITOR, GstCompositorClass))
#define GST_IS_COMPOSITOR(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_COMPOSITOR))
#define GST_IS_COMPOSITOR_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_COMPOSITOR))
#define GST_TYPE_COMPOSITOR_PAD (gst_compositor_pad_get_type())
#define GST_COMPOSITOR_PAD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_COMPOSITOR_PAD, GstCompositorPad))
#define GST_COMPOSITOR_PAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_COMPOSITOR_PAD, GstCompositorPadClass))
#define GST_IS_COMPOSITOR_PAD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_COMPOSITOR_PAD))
#define GST_IS_COMPOSITOR_PAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_COMPOSITOR_PAD))
typedef struct _GstCompositor GstCompositor;
typedef struct _GstCompositorClass GstCompositorClass;
typedef struct _GstCompositorPad GstCompositorPad;
typedef struct _GstCompositorPadClass GstCompositorPadClass;
/**
* GstCompositorBackground:
* @COMPOSITOR_BACKGROUND_CHECKER: checker pattern background
* @COMPOSITOR_BACKGROUND_BLACK: solid color black background
* @COMPOSITOR_BACKGROUND_WHITE: solid color white background
* @COMPOSITOR_BACKGROUND_TRANSPARENT: background is left transparent and layers are composited using "A OVER B" composition rules. This is only applicable to AYUV and ARGB (and variants) as it preserves the alpha channel and allows for further mixing.
*
* The different backgrounds compositor can blend over.
*/
typedef enum
{
COMPOSITOR_BACKGROUND_CHECKER,
COMPOSITOR_BACKGROUND_BLACK,
COMPOSITOR_BACKGROUND_WHITE,
COMPOSITOR_BACKGROUND_TRANSPARENT,
} GstCompositorBackground;
/**
* GstCompositorOperator:
* @COMPOSITOR_OPERATOR_SOURCE: Copy the source over the destination,
* without the destination pixels.
* @COMPOSITOR_OPERATOR_OVER: Blend the source over the destination.
* @COMPOSITOR_OPERATOR_ADD: Similar to over but add the source and
* destination alpha. Requires output with alpha
* channel.
*
* The different blending operators that can be used by compositor.
*
* See https://www.cairographics.org/operators/ for some explanation and
* visualizations.
*
*/
typedef enum
{
COMPOSITOR_OPERATOR_SOURCE,
COMPOSITOR_OPERATOR_OVER,
COMPOSITOR_OPERATOR_ADD,
} GstCompositorOperator;
/**
* GstCompositor:
*
* The opaque #GstCompositor structure.
*/
struct _GstCompositor
{
GstVideoAggregator videoaggregator;
GstCompositorBackground background;
BlendFunction blend, overlay;
FillCheckerFunction fill_checker;
FillColorFunction fill_color;
};
struct _GstCompositorClass
{
GstVideoAggregatorClass parent_class;
};
/**
* GstCompositorPad:
*
* The opaque #GstCompositorPad structure.
*/
struct _GstCompositorPad
{
GstVideoAggregatorConvertPad parent;
/* properties */
gint xpos, ypos;
gint width, height;
gdouble alpha;
GstCompositorOperator op;
};
struct _GstCompositorPadClass
{
GstVideoAggregatorConvertPadClass parent_class;
};
GType gst_compositor_get_type (void);
GType gst_compositor_pad_get_type (void);
G_END_DECLS
#endif /* __GST_COMPOSITOR_H__ */

File diff suppressed because it is too large Load diff

View file

@ -1,100 +0,0 @@
/* autogenerated from compositororc.orc */
#ifndef _COMPOSITORORC_H_
#define _COMPOSITORORC_H_
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ORC_INTEGER_TYPEDEFS_
#define _ORC_INTEGER_TYPEDEFS_
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <stdint.h>
typedef int8_t orc_int8;
typedef int16_t orc_int16;
typedef int32_t orc_int32;
typedef int64_t orc_int64;
typedef uint8_t orc_uint8;
typedef uint16_t orc_uint16;
typedef uint32_t orc_uint32;
typedef uint64_t orc_uint64;
#define ORC_UINT64_C(x) UINT64_C(x)
#elif defined(_MSC_VER)
typedef signed __int8 orc_int8;
typedef signed __int16 orc_int16;
typedef signed __int32 orc_int32;
typedef signed __int64 orc_int64;
typedef unsigned __int8 orc_uint8;
typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64)
#define inline __inline
#else
#include <limits.h>
typedef signed char orc_int8;
typedef short orc_int16;
typedef int orc_int32;
typedef unsigned char orc_uint8;
typedef unsigned short orc_uint16;
typedef unsigned int orc_uint32;
#if INT_MAX == LONG_MAX
typedef long long orc_int64;
typedef unsigned long long orc_uint64;
#define ORC_UINT64_C(x) (x##ULL)
#else
typedef long orc_int64;
typedef unsigned long orc_uint64;
#define ORC_UINT64_C(x) (x##UL)
#endif
#endif
typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;
typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32;
typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif
#ifndef ORC_RESTRICT
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4
#define ORC_RESTRICT __restrict__
#else
#define ORC_RESTRICT
#endif
#endif
#ifndef ORC_INTERNAL
#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
#define ORC_INTERNAL __attribute__((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define ORC_INTERNAL __hidden
#elif defined (__GNUC__)
#define ORC_INTERNAL __attribute__((visibility("hidden")))
#else
#define ORC_INTERNAL
#endif
#endif
void compositor_orc_splat_u32 (guint32 * ORC_RESTRICT d1, int p1, int n);
void compositor_orc_memcpy_u32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
void compositor_orc_blend_u8 (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_blend_argb (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_source_argb (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_blend_bgra (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_source_bgra (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_overlay_argb (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_overlay_argb_addition (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_overlay_bgra (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
void compositor_orc_overlay_bgra_addition (guint8 * ORC_RESTRICT d1, int d1_stride, const guint8 * ORC_RESTRICT s1, int s1_stride, int p1, int n, int m);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,425 +0,0 @@
.function compositor_orc_splat_u32
.dest 4 d1 guint32
.param 4 p1 guint32
copyl d1, p1
.function compositor_orc_memcpy_u32
.dest 4 d1 guint32
.source 4 s1 guint32
copyl d1, s1
.function compositor_orc_blend_u8
.flags 2d
.dest 1 d1 guint8
.source 1 s1 guint8
.param 2 p1
.temp 2 t1
.temp 2 t2
.const 1 c1 8
convubw t1, d1
convubw t2, s1
subw t2, t2, t1
mullw t2, t2, p1
shlw t1, t1, c1
addw t2, t1, t2
shruw t2, t2, c1
convsuswb d1, t2
.function compositor_orc_blend_argb
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 2 tw
.temp 1 tb
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.temp 8 a_wide
.const 4 a_alpha 0x000000ff
loadl t, s
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw a_wide, a
x4 mullw a_wide, a_wide, alpha
x4 div255w a_wide, a_wide
x4 convubw s_wide, t
loadl t, d
x4 convubw d_wide, t
x4 subw s_wide, s_wide, d_wide
x4 mullw s_wide, s_wide, a_wide
x4 div255w s_wide, s_wide
x4 addw d_wide, d_wide, s_wide
x4 convwb t, d_wide
orl t, t, a_alpha
storel d, t
.function compositor_orc_source_argb
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 4 t2
.temp 2 tw
.temp 1 tb
.temp 4 a
.temp 8 a_wide
.const 4 a_alpha 0x000000ff
.const 4 a_not_alpha 0xffffff00
loadl t, s
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw a_wide, a
x4 mullw a_wide, a_wide, alpha
x4 div255w a_wide, a_wide
andl t, t, a_not_alpha
x4 convwb t2, a_wide
andl t2, t2, a_alpha
orl t, t, t2
storel d, t
.function compositor_orc_blend_bgra
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 4 t2
.temp 2 tw
.temp 1 tb
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.temp 8 a_wide
.const 4 a_alpha 0xff000000
loadl t, s
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw a_wide, a
x4 mullw a_wide, a_wide, alpha
x4 div255w a_wide, a_wide
x4 convubw s_wide, t
loadl t, d
x4 convubw d_wide, t
x4 subw s_wide, s_wide, d_wide
x4 mullw s_wide, s_wide, a_wide
x4 div255w s_wide, s_wide
x4 addw d_wide, d_wide, s_wide
x4 convwb t, d_wide
orl t, t, a_alpha
storel d, t
.function compositor_orc_source_bgra
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 4 t2
.temp 2 tw
.temp 1 tb
.temp 4 a
.temp 8 a_wide
.const 4 a_alpha 0xff000000
.const 4 a_not_alpha 0x00ffffff
loadl t, s
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw a_wide, a
x4 mullw a_wide, a_wide, alpha
x4 div255w a_wide, a_wide
andl t, t, a_not_alpha
x4 convwb t2, a_wide
andl t2, t2, a_alpha
orl t, t, t2
storel d, t
.function compositor_orc_overlay_argb
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 2 tw
.temp 1 tb
.temp 8 alpha_s
.temp 8 alpha_s_inv
.temp 8 alpha_d
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.const 4 xfs 0xffffffff
.const 4 a_alpha 0x000000ff
.const 4 a_alpha_inv 0xffffff00
# calc source alpha as alpha_s = alpha_s * alpha / 255
loadl t, s
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw alpha_s, a
x4 mullw alpha_s, alpha_s, alpha
x4 div255w alpha_s, alpha_s
x4 convubw s_wide, t
x4 mullw s_wide, s_wide, alpha_s
# calc destination alpha as alpha_d = (255-alpha_s) * alpha_d / 255
loadpl a, xfs
x4 convubw alpha_s_inv, a
x4 subw alpha_s_inv, alpha_s_inv, alpha_s
loadl t, d
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw alpha_d, a
x4 mullw alpha_d, alpha_d, alpha_s_inv
x4 div255w alpha_d, alpha_d
x4 convubw d_wide, t
x4 mullw d_wide, d_wide, alpha_d
# calc final pixel as pix_d = pix_s*alpha_s + pix_d*alpha_d*(255-alpha_s)/255
x4 addw d_wide, d_wide, s_wide
# calc the final destination alpha_d = alpha_s + alpha_d * (255-alpha_s)/255
x4 addw alpha_d, alpha_d, alpha_s
# now normalize the pix_d by the final alpha to make it associative
x4 divluw, d_wide, d_wide, alpha_d
# pack the new alpha into the correct spot
x4 convwb t, d_wide
andl t, t, a_alpha_inv
x4 convwb a, alpha_d
andl a, a, a_alpha
orl t, t, a
storel d, t
.function compositor_orc_overlay_argb_addition
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 2 tw
.temp 1 tb
.temp 8 alpha_s
.temp 8 alpha_s_inv
.temp 8 alpha_factor
.temp 8 alpha_d
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.const 4 xfs 0xffffffff
.const 4 a_alpha 0x000000ff
.const 4 a_alpha_inv 0xffffff00
# calc source alpha as alpha_s = alpha_s * alpha / 255
loadl t, s
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw alpha_s, a
x4 mullw alpha_s, alpha_s, alpha
x4 div255w alpha_s, alpha_s
x4 convubw s_wide, t
x4 mullw s_wide, s_wide, alpha_s
# calc destination alpha as alpha_factor = (255-alpha_s) * alpha_factor / factor
loadpl a, xfs
x4 convubw alpha_s_inv, a
x4 subw alpha_s_inv, alpha_s_inv, alpha_s
loadl t, d
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw alpha_factor, a
x4 mullw alpha_factor, alpha_factor, alpha_s_inv
x4 div255w alpha_factor, alpha_factor
x4 convubw d_wide, t
x4 mullw d_wide, d_wide, alpha_factor
# calc final pixel as pix_d = pix_s*alpha_s + pix_d*alpha_factor*(255-alpha_s)/255
x4 addw d_wide, d_wide, s_wide
# calc the alpha factor alpha_factor = alpha_s + alpha_factor * (255-alpha_s)/255
x4 addw alpha_factor, alpha_factor, alpha_s
# now normalize the pix_d by the final alpha to make it associative
x4 divluw, d_wide, d_wide, alpha_factor
# calc the final global alpha_d = alpha_d + (alpha_s * (alpha / 255))
loadl t, d
convlw tw, t
convwb tb, tw
splatbl a, tb
x4 convubw alpha_d, a
x4 addw alpha_d, alpha_d, alpha_s
# pack the new alpha into the correct spot
x4 convwb t, d_wide
andl t, t, a_alpha_inv
x4 convwb a, alpha_d
andl a, a, a_alpha
orl t, t, a
storel d, t
.function compositor_orc_overlay_bgra
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 4 t2
.temp 2 tw
.temp 1 tb
.temp 8 alpha_s
.temp 8 alpha_s_inv
.temp 8 alpha_d
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.const 4 xfs 0xffffffff
.const 4 a_alpha 0xff000000
.const 4 a_alpha_inv 0x00ffffff
# calc source alpha as alpha_s = alpha_s * alpha / 255
loadl t, s
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw alpha_s, a
x4 mullw alpha_s, alpha_s, alpha
x4 div255w alpha_s, alpha_s
x4 convubw s_wide, t
x4 mullw s_wide, s_wide, alpha_s
# calc destination alpha as alpha_d = (255-alpha_s) * alpha_d / 255
loadpl a, xfs
x4 convubw alpha_s_inv, a
x4 subw alpha_s_inv, alpha_s_inv, alpha_s
loadl t, d
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw alpha_d, a
x4 mullw alpha_d, alpha_d, alpha_s_inv
x4 div255w alpha_d, alpha_d
x4 convubw d_wide, t
x4 mullw d_wide, d_wide, alpha_d
# calc final pixel as pix_d = pix_s*alpha_s + pix_d*alpha_d*(255-alpha_s)/255
x4 addw d_wide, d_wide, s_wide
# calc the final destination alpha_d = alpha_s + alpha_d * (255-alpha_s)/255
x4 addw alpha_d, alpha_d, alpha_s
# now normalize the pix_d by the final alpha to make it associative
x4 divluw, d_wide, d_wide, alpha_d
# pack the new alpha into the correct spot
x4 convwb t, d_wide
andl t, t, a_alpha_inv
x4 convwb a, alpha_d
andl a, a, a_alpha
orl t, t, a
storel d, t
.function compositor_orc_overlay_bgra_addition
.flags 2d
.dest 4 d guint8
.source 4 s guint8
.param 2 alpha
.temp 4 t
.temp 4 t2
.temp 2 tw
.temp 1 tb
.temp 8 alpha_s
.temp 8 alpha_s_inv
.temp 8 alpha_factor
.temp 8 alpha_d
.temp 4 a
.temp 8 d_wide
.temp 8 s_wide
.const 4 xfs 0xffffffff
.const 4 a_alpha 0xff000000
.const 4 a_alpha_inv 0x00ffffff
# calc source alpha as alpha_s = alpha_s * alpha / 255
loadl t, s
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw alpha_s, a
x4 mullw alpha_s, alpha_s, alpha
x4 div255w alpha_s, alpha_s
x4 convubw s_wide, t
x4 mullw s_wide, s_wide, alpha_s
# calc destination alpha as alpha_factor = (255-alpha_s) * alpha_factor / 255
loadpl a, xfs
x4 convubw alpha_s_inv, a
x4 subw alpha_s_inv, alpha_s_inv, alpha_s
loadl t, d
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw alpha_factor, a
x4 mullw alpha_factor, alpha_factor, alpha_s_inv
x4 div255w alpha_factor, alpha_factor
x4 convubw d_wide, t
x4 mullw d_wide, d_wide, alpha_factor
# calc final pixel as pix_d = pix_s*alpha_s + pix_d*alpha_factor*(255-alpha_s)/255
x4 addw d_wide, d_wide, s_wide
# calc the final destination alpha_factor = alpha_s + alpha_factor * (255-alpha_s)/255
x4 addw alpha_factor, alpha_factor, alpha_s
# now normalize the pix_d by the final alpha to make it associative
x4 divluw, d_wide, d_wide, alpha_factor
# calc the final global alpha_d = alpha_d + (alpha_s * (alpha / 255))
loadl t, d
shrul t2, t, 24
convlw tw, t2
convwb tb, tw
splatbl a, tb
x4 convubw alpha_d, a
x4 addw alpha_d, alpha_d, alpha_s
# pack the new alpha into the correct spot
x4 convwb t, d_wide
andl t, t, a_alpha_inv
x4 convwb a, alpha_d
andl a, a, a_alpha
orl t, t, a
storel d, t

View file

@ -1,33 +0,0 @@
compositor_sources = [
'blend.c',
'compositor.c',
]
orcsrc = 'compositororc'
if have_orcc
orc_h = custom_target(orcsrc + '.h',
input : orcsrc + '.orc',
output : orcsrc + '.h',
command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@'])
orc_c = custom_target(orcsrc + '.c',
input : orcsrc + '.orc',
output : orcsrc + '.c',
command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@'])
else
orc_h = configure_file(input : orcsrc + '-dist.h',
output : orcsrc + '.h',
copy : true)
orc_c = configure_file(input : orcsrc + '-dist.c',
output : orcsrc + '.c',
copy : true)
endif
gstcompositor = library('gstcompositor',
compositor_sources, orc_c, orc_h,
c_args : gst_plugins_bad_args,
include_directories : [configinc],
dependencies : [gstvideo_dep, gstbase_dep, orc_dep, libm],
install : true,
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstcompositor, install_dir : plugins_pkgconfig_install_dir)

View file

@ -1,7 +1,7 @@
foreach plugin : ['accurip', 'adpcmdec', 'adpcmenc', 'aiff', 'asfmux',
'audiobuffersplit', 'audiofxbad', 'audiomixmatrix',
'audiolatency', 'audiovisualizers', 'autoconvert', 'bayer',
'camerabin2', 'coloreffects', 'compositor', 'debugutils',
'camerabin2', 'coloreffects', 'debugutils',
'dvbsuboverlay', 'dvdspu', 'faceoverlay', 'festival',
'fieldanalysis', 'freeverb', 'frei0r', 'gaudieffects', 'gdp',
'geometrictransform', 'id3tag', 'inter', 'interlace',

View file

@ -16,7 +16,6 @@ option('autoconvert', type : 'feature', value : 'auto')
option('bayer', type : 'feature', value : 'auto')
option('camerabin2', type : 'feature', value : 'auto')
option('coloreffects', type : 'feature', value : 'auto')
option('compositor', type : 'feature', value : 'auto')
option('debugutils', type : 'feature', value : 'auto')
option('dvbsuboverlay', type : 'feature', value : 'auto')
option('dvdspu', type : 'feature', value : 'auto')

View file

@ -127,7 +127,7 @@ check_kate=
endif
if HAVE_ORC
check_orc = orc/bayer orc/compositor
check_orc = orc/bayer
else
check_orc =
endif
@ -269,7 +269,6 @@ check_PROGRAMS = \
elements/camerabin \
elements/gdppay \
elements/gdpdepay \
elements/compositor \
$(check_jifmux) \
elements/jpegparse \
elements/h263parse \
@ -572,12 +571,6 @@ orc/bayer.c: $(top_srcdir)/gst/bayer/gstbayerorc.orc
$(MKDIR_P) orc
$(ORCC) --test -o $@ $<
elements_compositor_LDADD = \
$(GST_PLUGINS_BASE_LIBS) $(GST_VIDEO_LIBS) $(GST_BASE_LIBS) $(LDADD)
elements_compositor_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(CFLAGS) $(AM_CFLAGS)
elements_hlsdemux_m3u8_CFLAGS = $(GST_BASE_CFLAGS) $(AM_CFLAGS) -I$(top_srcdir)/ext/hls
elements_hlsdemux_m3u8_LDADD = $(GST_BASE_LIBS) $(LDADD)
elements_hlsdemux_m3u8_SOURCES = elements/hlsdemux_m3u8.c
@ -589,15 +582,6 @@ elements_hls_demux_LDADD = \
$(GST_BASE_LIBS) $(LDADD)
elements_hls_demux_SOURCES = elements/test_http_src.c elements/test_http_src.h elements/adaptive_demux_engine.c elements/adaptive_demux_engine.h elements/adaptive_demux_common.c elements/adaptive_demux_common.h elements/hls_demux.c
orc_compositor_CFLAGS = $(ORC_CFLAGS)
orc_compositor_LDADD = $(ORC_LIBS) -lorc-test-0.4
nodist_orc_compositor_SOURCES = orc/compositor.c
orc_videobox_CFLAGS = $(ORC_CFLAGS)
orc/compositor.c: $(top_srcdir)/gst/compositor/compositororc.orc
$(MKDIR_P) orc/
$(ORCC) --test -o $@ $<
elements_webrtcbin_LDADD = \
$(top_builddir)/gst-libs/gst/webrtc/libgstwebrtc-@GST_API_VERSION@.la \
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_SDP_LIBS) $(LDADD)

View file

@ -9,7 +9,6 @@ camerabin
ccconverter
cccombiner
ccextractor
compositor
curlfilesink
curlftpsink
curlhttpsink

View file

@ -54,7 +54,6 @@ if host_machine.system() != 'windows'
[['elements/ccconverter.c']],
[['elements/cccombiner.c']],
[['elements/ccextractor.c']],
[['elements/compositor.c'], not cdata.has('HAVE_UNISTD_H')],
[['elements/curlhttpsink.c'], not curl_dep.found(), [curl_dep]],
[['elements/curlfilesink.c'],
not curl_dep.found() or not cdata.has('HAVE_UNISTD_H'), [curl_dep]],

View file

@ -58,10 +58,10 @@ playout_SOURCES = playout.c
playout_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
playout_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) $(GST_LIBS)
SUBDIRS= codecparsers compositor mpegts $(DIRECTFB_DIR) $(GTK_EXAMPLES) $(OPENCV_EXAMPLES) \
SUBDIRS= codecparsers mpegts $(DIRECTFB_DIR) $(GTK_EXAMPLES) $(OPENCV_EXAMPLES) \
$(AVSAMPLE_DIR) $(WAYLAND_DIR) $(MATRIXMIX_DIR) \
$(IPCPIPELINE_DIR) $(WEBRTC_DIR)
DIST_SUBDIRS= codecparsers compositor mpegts camerabin2 directfb mxf opencv uvch264 \
DIST_SUBDIRS= codecparsers mpegts camerabin2 directfb mxf opencv uvch264 \
avsamplesink waylandsink audiomixmatrix ipcpipeline webrtc
include $(top_srcdir)/common/parallel-subdirs.mak

View file

@ -1,5 +0,0 @@
noinst_PROGRAMS = crossfade
crossfade_SOURCES = crossfade.c
crossfade_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_CFLAGS)
crossfade_LDADD = $(GST_PLUGINS_BASE_LIBS) $(GST_CONTROLLER_LIBS) $(GST_LIBS)

View file

@ -1,133 +0,0 @@
/*
* GStreamer
* Copyright (C) 2017 Thibault Saunier <thibault.saunier@osg-samsung.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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/**
* Simple crossfade example using the compositor element.
*
* Takes two video files and crossfades them for 10 seconds and returns.
*/
#include <stdlib.h>
#include <gst/gst.h>
#include <gst/controller/gstdirectcontrolbinding.h>
#include <gst/controller/gstinterpolationcontrolsource.h>
typedef struct
{
GstElement *compositor;
guint z_order;
} VideoInfo;
static gchar *
ensure_uri (const gchar * location)
{
if (gst_uri_is_valid (location))
return g_strdup (location);
else
return gst_filename_to_uri (location, NULL);
}
static void
_pad_added_cb (GstElement * decodebin, GstPad * pad, VideoInfo * info)
{
GstPad *sinkpad =
gst_element_get_request_pad (GST_ELEMENT (info->compositor), "sink_%u");
GstControlSource *control_source;
gboolean is_last = info->z_order == 1;
control_source = gst_interpolation_control_source_new ();
gst_util_set_object_arg (G_OBJECT (sinkpad), "operator",
info->z_order == 0 ? "source" : "add");
gst_object_add_control_binding (GST_OBJECT (sinkpad),
gst_direct_control_binding_new_absolute (GST_OBJECT (sinkpad), "alpha",
control_source));
g_object_set (control_source, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
gst_timed_value_control_source_set (GST_TIMED_VALUE_CONTROL_SOURCE
(control_source), 0, is_last ? 0.0 : 1.0);
gst_timed_value_control_source_set (GST_TIMED_VALUE_CONTROL_SOURCE
(control_source), 10 * GST_SECOND, is_last ? 1.0 : 0.0);
g_object_set (sinkpad, "zorder", info->z_order, NULL);
gst_pad_link (pad, sinkpad);
g_free (info);
}
int
main (int argc, char *argv[])
{
gint i;
GstMessage *message;
GstElement *compositor, *sink, *pipeline;
GstBus *bus;
if (argc != 3) {
g_error ("Need to provide 2 input videos");
return -1;
}
gst_init (&argc, &argv);
pipeline = gst_element_factory_make ("pipeline", NULL);
compositor = gst_element_factory_make ("compositor", NULL);
sink =
gst_parse_bin_from_description ("videoconvert ! autovideosink", TRUE,
NULL);
gst_util_set_object_arg (G_OBJECT (compositor), "background", "black");
gst_bin_add_many (GST_BIN (pipeline), compositor, sink, NULL);
g_assert (gst_element_link (compositor, sink));
for (i = 1; i < 3; i++) {
gchar *uri = ensure_uri (argv[i]);
VideoInfo *info = g_malloc0 (sizeof (VideoInfo));
GstElement *uridecodebin = gst_element_factory_make ("uridecodebin", NULL);
g_object_set (uridecodebin, "uri", uri, "expose-all-streams", FALSE,
"caps", gst_caps_from_string ("video/x-raw(ANY)"), NULL);
info->compositor = compositor;
info->z_order = i - 1;
g_signal_connect (uridecodebin, "pad-added", (GCallback) _pad_added_cb,
info);
gst_bin_add (GST_BIN (pipeline), uridecodebin);
}
bus = gst_element_get_bus (pipeline);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
message =
gst_bus_timed_pop_filtered (bus, 11 * GST_SECOND,
GST_MESSAGE_EOS | GST_MESSAGE_ERROR);
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
GST_DEBUG_GRAPH_SHOW_ALL, "go");
if (message)
gst_print ("%" GST_PTR_FORMAT "\n", message);
else
gst_print ("Timeout\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
return 0;
}

View file

@ -1,15 +0,0 @@
examples = [ 'crossfade' ]
foreach example : examples
exe_name = example
src_file = '@0@.c'.format(example)
executable(exe_name,
src_file,
install: false,
include_directories : [configinc],
dependencies : [glib_dep, gst_dep, gstcontroller_dep],
c_args : ['-DHAVE_CONFIG_H=1' ],
)
endforeach

View file

@ -2,7 +2,6 @@ subdir('audiomixmatrix')
subdir('avsamplesink')
subdir('camerabin2')
subdir('codecparsers')
subdir('compositor')
subdir('directfb')
subdir('ipcpipeline')
subdir('mpegts')