1 /* Generic video mixer plugin
2 * Copyright (C) 2008 Wim Taymans <wim@fluendo.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_VIDEO_MIXER_H__
21 #define __GST_VIDEO_MIXER_H__
24 #include <gst/video/video.h>
25 #include "videomixerpad.h"
30 #define GST_TYPE_VIDEO_MIXER (gst_videomixer_get_type())
31 #define GST_VIDEO_MIXER(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_MIXER, GstVideoMixer))
33 #define GST_VIDEO_MIXER_CLASS(klass) \
34 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_MIXER, GstVideoMixerClass))
35 #define GST_IS_VIDEO_MIXER(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_MIXER))
37 #define GST_IS_VIDEO_MIXER_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_MIXER))
40 typedef struct _GstVideoMixer GstVideoMixer;
41 typedef struct _GstVideoMixerClass GstVideoMixerClass;
44 * GstVideoMixerBackground:
45 * @VIDEO_MIXER_BACKGROUND_CHECKER: checker pattern background
46 * @VIDEO_MIXER_BACKGROUND_BLACK: solid color black background
47 * @VIDEO_MIXER_BACKGROUND_WHITE: solid color white background
48 * @VIDEO_MIXER_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.
50 * The different backgrounds videomixer can blend over.
54 VIDEO_MIXER_BACKGROUND_CHECKER,
55 VIDEO_MIXER_BACKGROUND_BLACK,
56 VIDEO_MIXER_BACKGROUND_WHITE,
57 VIDEO_MIXER_BACKGROUND_TRANSPARENT,
59 GstVideoMixerBackground;
64 * The opaque #GstVideoMixer structure.
73 /* Lock to prevent the state to change while blending */
75 /* Sink pads using Collect Pads from core's base library */
76 GstCollectPads *collect;
77 /* sinkpads, a GSList of GstVideoMixerPads */
83 GstClockTime last_duration;
86 GstVideoMixerPad *master;
90 gint in_width, in_height;
91 gint out_width, out_height;
95 GstVideoMixerBackground background;
103 /* Next available sinkpad index */
106 /* sink event handling */
107 GstPadEventFunction collect_event;
108 guint64 segment_position;
110 /* Current downstream segment */
115 GstClockTime earliest_time;
117 BlendFunction blend, overlay;
118 FillCheckerFunction fill_checker;
119 FillColorFunction fill_color;
121 gboolean flush_stop_pending;
124 struct _GstVideoMixerClass
126 GstElementClass parent_class;
129 GType gst_video_mixer_get_type (void);
132 #endif /* __GST_VIDEO_MIXER_H__ */