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., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef __GST_VIDEO_MIXER2_H__
22 #define __GST_VIDEO_MIXER2_H__
25 #include <gst/video/video.h>
28 #include <gst/base/gstcollectpads.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 */
80 /* Lock to prevent two src setcaps from happening at the same time */
83 /* Sink pads using Collect Pads 2*/
84 GstCollectPads *collect;
86 /* sinkpads, a GSList of GstVideoMixer2Pads */
89 /* Next available sinkpad index */
96 GstCaps *current_caps;
99 gboolean newseg_pending;
100 gboolean flush_stop_pending;
102 GstVideoMixer2Background background;
104 /* Current downstream segment */
106 GstClockTime ts_offset;
111 GstClockTime earliest_time;
112 guint64 qos_processed, qos_dropped;
114 BlendFunction blend, overlay;
115 FillCheckerFunction fill_checker;
116 FillColorFunction fill_color;
118 gboolean send_stream_start;
121 struct _GstVideoMixer2Class
123 GstElementClass parent_class;
126 GType gst_videomixer2_get_type (void);
129 #endif /* __GST_VIDEO_MIXER2_H__ */