3 * Copyright (C) 2006 Edgard Lima <edgard.lima@indt.org.br>
5 * gstv4l2vidorient.h: video orientation interface implementation for V4L2
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
23 #ifndef __GST_V4L2_VIDORIENT_H__
24 #define __GST_V4L2_VIDORIENT_H__
27 #include <gst/video/videoorientation.h>
29 #include "gstv4l2object.h"
33 void gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * iface);
35 gboolean gst_v4l2_video_orientation_get_hflip (GstV4l2Object *v4l2object, gboolean *flip);
36 gboolean gst_v4l2_video_orientation_get_vflip (GstV4l2Object *v4l2object, gboolean *flip);
37 gboolean gst_v4l2_video_orientation_get_hcenter (GstV4l2Object *v4l2object, gint *center);
38 gboolean gst_v4l2_video_orientation_get_vcenter (GstV4l2Object *v4l2object, gint *center);
40 gboolean gst_v4l2_video_orientation_set_hflip (GstV4l2Object *v4l2object, gboolean flip);
41 gboolean gst_v4l2_video_orientation_set_vflip (GstV4l2Object *v4l2object, gboolean flip);
42 gboolean gst_v4l2_video_orientation_set_hcenter (GstV4l2Object *v4l2object, gint center);
43 gboolean gst_v4l2_video_orientation_set_vcenter (GstV4l2Object *v4l2object, gint center);
45 #define GST_IMPLEMENT_V4L2_VIDORIENT_METHODS(Type, interface_as_function) \
48 interface_as_function ## _video_orientation_get_hflip (GstVideoOrientation *vo, gboolean *flip) \
50 Type *this = (Type*) vo; \
51 return gst_v4l2_video_orientation_get_hflip (this->v4l2object, flip); \
55 interface_as_function ## _video_orientation_get_vflip (GstVideoOrientation *vo, gboolean *flip) \
57 Type *this = (Type*) vo; \
58 return gst_v4l2_video_orientation_get_vflip (this->v4l2object, flip); \
62 interface_as_function ## _video_orientation_get_hcenter (GstVideoOrientation *vo, gint *center) \
64 Type *this = (Type*) vo; \
65 return gst_v4l2_video_orientation_get_hcenter (this->v4l2object, center); \
69 interface_as_function ## _video_orientation_get_vcenter (GstVideoOrientation *vo, gint *center) \
71 Type *this = (Type*) vo; \
72 return gst_v4l2_video_orientation_get_vcenter (this->v4l2object, center); \
76 interface_as_function ## _video_orientation_set_hflip (GstVideoOrientation *vo, gboolean flip) \
78 Type *this = (Type*) vo; \
79 return gst_v4l2_video_orientation_set_hflip (this->v4l2object, flip); \
83 interface_as_function ## _video_orientation_set_vflip (GstVideoOrientation *vo, gboolean flip) \
85 Type *this = (Type*) vo; \
86 return gst_v4l2_video_orientation_set_vflip (this->v4l2object, flip); \
90 interface_as_function ## _video_orientation_set_hcenter (GstVideoOrientation *vo, gint center) \
92 Type *this = (Type*) vo; \
93 return gst_v4l2_video_orientation_set_hcenter (this->v4l2object, center); \
97 interface_as_function ## _video_orientation_set_vcenter (GstVideoOrientation *vo, gint center) \
99 Type *this = (Type*) vo; \
100 return gst_v4l2_video_orientation_set_vcenter (this->v4l2object, center); \
104 interface_as_function ## _video_orientation_interface_init (GstVideoOrientationInterface * iface) \
106 /* default virtual functions */ \
107 iface->get_hflip = interface_as_function ## _video_orientation_get_hflip; \
108 iface->get_vflip = interface_as_function ## _video_orientation_get_vflip; \
109 iface->get_hcenter = interface_as_function ## _video_orientation_get_hcenter; \
110 iface->get_vcenter = interface_as_function ## _video_orientation_get_vcenter; \
111 iface->set_hflip = interface_as_function ## _video_orientation_set_hflip; \
112 iface->set_vflip = interface_as_function ## _video_orientation_set_vflip; \
113 iface->set_hcenter = interface_as_function ## _video_orientation_set_hcenter; \
114 iface->set_vcenter = interface_as_function ## _video_orientation_set_vcenter; \
118 #endif /* __GST_V4L2_VIDORIENT_H__ */