ff78e3b5b8f02fdef559ca37d16dbfbed3d55855
[platform/upstream/gst-editing-services.git] / 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 natural_width;
56   gint natural_height;
57   gint track_width;
58   gint track_height;
59   gint fps_n;
60   gint fps_d;
61
62   gint par_n;
63   gint par_d;
64
65   gboolean user_positioned;
66
67   /*  This should never be made public, no padding needed */
68 };
69
70 struct _GstFramePositionerClass
71 {
72   GstBaseTransformClass base_framepositioner_class;
73 };
74
75 struct _GstFramePositionerMeta {
76   GstMeta meta;
77
78   gdouble alpha;
79   gint posx;
80   gint posy;
81   gint height;
82   gint width;
83   guint zorder;
84 };
85
86 G_GNUC_INTERNAL void ges_frame_positioner_set_source_and_filter (GstFramePositioner *pos,
87                                                   GESTrackElement *trksrc,
88                                                   GstElement *capsfilter);
89 G_GNUC_INTERNAL GType gst_frame_positioner_get_type (void);
90 G_GNUC_INTERNAL GType
91 gst_frame_positioner_meta_api_get_type (void);
92
93 G_END_DECLS
94
95 #endif