1 /* Generic video aggregator 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_AGGREGATOR_H__
22 #define __GST_VIDEO_AGGREGATOR_H__
25 #include <gst/video/video.h>
26 #include <gst/base/gstaggregator.h>
28 #include "gstvideoaggregatorpad.h"
32 #define GST_TYPE_VIDEO_AGGREGATOR (gst_videoaggregator_get_type())
33 #define GST_VIDEO_AGGREGATOR(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_AGGREGATOR, GstVideoAggregator))
35 #define GST_VIDEO_AGGREGATOR_CLASS(klass) \
36 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_AGGREGATOR, GstVideoAggregatorClass))
37 #define GST_IS_VIDEO_AGGREGATOR(obj) \
38 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_AGGREGATOR))
39 #define GST_IS_VIDEO_AGGREGATOR_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_AGGREGATOR))
41 #define GST_VIDEO_AGGREGATOR_GET_CLASS(obj) \
42 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_VIDEO_AGGREGATOR,GstVideoAggregatorClass))
44 typedef struct _GstVideoAggregator GstVideoAggregator;
45 typedef struct _GstVideoAggregatorClass GstVideoAggregatorClass;
46 typedef struct _GstVideoAggregatorPrivate GstVideoAggregatorPrivate;
50 * @info: The #GstVideoInfo representing the currently set
53 struct _GstVideoAggregator
55 GstAggregator aggregator;
62 GstVideoAggregatorPrivate *priv;
63 gpointer _gst_reserved[GST_PADDING];
67 * GstVideoAggregatorClass:
68 * @disable_frame_conversion: Optional.
69 * Allows subclasses to disable the frame colorspace
71 * @update_info: Optional.
72 * Lets subclasses update the src #GstVideoInfo representing
73 * the src pad caps before usage.
74 * @aggregate_frames: Lets subclasses aggregate frames that are ready. Subclasses
75 * should iterate the GstElement.sinkpads and use the already
76 * mapped #GstVideoFrame from GstVideoAggregatorPad.aggregated_frame
77 * or directly use the #GstBuffer from GstVideoAggregatorPad.buffer
78 * if it needs to map the buffer in a special way. The result of the
79 * aggregation should land in @outbuffer.
80 * @get_output_buffer: Optional.
81 * Lets subclasses provide a #GstBuffer to be used as @outbuffer of
82 * the #aggregate_frames vmethod.
83 * @negotiated_caps: Optional.
84 * Notifies subclasses what caps format has been negotiated
86 struct _GstVideoAggregatorClass
89 GstAggregatorClass parent_class;
92 gboolean disable_frame_conversion;
94 gboolean (*update_info) (GstVideoAggregator * videoaggregator,
96 GstFlowReturn (*aggregate_frames) (GstVideoAggregator * videoaggregator,
97 GstBuffer * outbuffer);
98 GstFlowReturn (*get_output_buffer) (GstVideoAggregator * videoaggregator,
99 GstBuffer ** outbuffer);
100 gboolean (*negotiated_caps) (GstVideoAggregator * videoaggregator,
103 gpointer _gst_reserved[GST_PADDING];
106 GType gst_videoaggregator_get_type (void);
109 #endif /* __GST_VIDEO_AGGREGATOR_H__ */