0c1b28b1fb4822157e1904516e4dc21741954f2d
[platform/upstream/gstreamer.git] / subprojects / gst-editing-services / ges / gstframepositioner.h
1 /* GStreamer
2  * Copyright (C) 2013 Mathieu Duponchelle <mduponchelle1@gmail.com>
3  *
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.
8  *
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.
13  *
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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef _GST_FRAME_POSITIONNER_H_
21 #define _GST_FRAME_POSITIONNER_H_
22
23 #include <gst/base/gstbasetransform.h>
24 #include <ges/ges-track-element.h>
25 #include <ges/ges-track.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_TYPE_FRAME_POSITIONNER   (gst_frame_positioner_get_type())
30 #define GST_FRAME_POSITIONNER(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FRAME_POSITIONNER,GstFramePositioner))
31 #define GST_FRAME_POSITIONNER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FRAME_POSITIONNER,GstFramePositionerClass))
32 #define GST_IS_FRAME_POSITIONNER(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FRAME_POSITIONNER))
33 #define GST_IS_FRAME_POSITIONNER_CLASS(obj)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FRAME_POSITIONNER))
34
35 typedef struct _GstFramePositioner GstFramePositioner;
36 typedef struct _GstFramePositionerClass GstFramePositionerClass;
37 typedef struct _GstFramePositionerMeta GstFramePositionerMeta;
38
39 struct _GstFramePositioner
40 {
41   GstBaseTransform base_framepositioner;
42
43   GstElement *capsfilter;
44
45   GESTrackElement *track_source;
46   GESTrack *current_track;
47
48   gboolean scale_in_compositor;
49   gdouble alpha;
50   gdouble posx;
51   gdouble posy;
52   guint zorder;
53   gdouble width;
54   gdouble height;
55   gint operator;
56   gint natural_width;
57   gint natural_height;
58   gint track_width;
59   gint track_height;
60   gint fps_n;
61   gint fps_d;
62
63   gint par_n;
64   gint par_d;
65
66   gboolean user_positioned;
67
68   /*  This should never be made public, no padding needed */
69 };
70
71 struct _GstFramePositionerClass
72 {
73   GstBaseTransformClass base_framepositioner_class;
74 };
75
76 struct _GstFramePositionerMeta {
77   GstMeta meta;
78
79   gdouble alpha;
80   gint posx;
81   gint posy;
82   gint height;
83   gint width;
84   guint zorder;
85   gint operator;
86 };
87
88 G_GNUC_INTERNAL void ges_frame_positioner_set_source_and_filter (GstFramePositioner *pos,
89                                                   GESTrackElement *trksrc,
90                                                   GstElement *capsfilter);
91 G_GNUC_INTERNAL GType gst_frame_positioner_get_type (void);
92 G_GNUC_INTERNAL GType
93 gst_frame_positioner_meta_api_get_type (void);
94
95 G_END_DECLS
96
97 #endif