1 /* Generic video mixer plugin
2 * Copyright (C) 2008 Wim Taymans <wim@fluendo.com>
3 * Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __GST_VIDEO_MIXER2_H__
22 #define __GST_VIDEO_MIXER2_H__
25 #include <gst/video/video.h>
28 #include <gst/base/gstcollectpads2.h>
32 #define GST_TYPE_VIDEO_MIXER2 (gst_videomixer2_get_type())
33 #define GST_VIDEO_MIXER2(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_MIXER2, GstVideoMixer2))
35 #define GST_VIDEO_MIXER2_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_MIXER2, GstVideoMixer2Class))
37 #define GST_IS_VIDEO_MIXER2(obj) \
38 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_MIXER2))
39 #define GST_IS_VIDEO_MIXER2_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_MIXER2))
42 typedef struct _GstVideoMixer2 GstVideoMixer2;
43 typedef struct _GstVideoMixer2Class GstVideoMixer2Class;
46 * GstVideoMixer2Background:
47 * @VIDEO_MIXER2_BACKGROUND_CHECKER: checker pattern background
48 * @VIDEO_MIXER2_BACKGROUND_BLACK: solid color black background
49 * @VIDEO_MIXER2_BACKGROUND_WHITE: solid color white background
50 * @VIDEO_MIXER2_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.
52 * The different backgrounds videomixer can blend over.
56 VIDEO_MIXER2_BACKGROUND_CHECKER,
57 VIDEO_MIXER2_BACKGROUND_BLACK,
58 VIDEO_MIXER2_BACKGROUND_WHITE,
59 VIDEO_MIXER2_BACKGROUND_TRANSPARENT,
61 GstVideoMixer2Background;
66 * The opaque #GstVideoMixer2 structure.
68 struct _GstVideoMixer2
77 /* Lock to prevent the state to change while blending */
79 /* Sink pads using Collect Pads 2*/
80 GstCollectPads2 *collect;
82 /* sinkpads, a GSList of GstVideoMixer2Pads */
85 /* Next available sinkpad index */
89 GstVideoFormat format;
96 gboolean newseg_pending;
97 gboolean flush_stop_pending;
99 GstVideoMixer2Background background;
101 /* Current downstream segment */
103 GstClockTime ts_offset;
108 GstClockTime earliest_time;
109 guint64 qos_processed, qos_dropped;
111 BlendFunction blend, overlay;
112 FillCheckerFunction fill_checker;
113 FillColorFunction fill_color;
116 struct _GstVideoMixer2Class
118 GstElementClass parent_class;
121 GType gst_videomixer2_get_type (void);
122 gboolean gst_videomixer2_register (GstPlugin * plugin);
125 #endif /* __GST_VIDEO_MIXER2_H__ */