QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
videoorientation.cpp
1 /*
2  Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3  Copyright (C) 2010 Collabora Multimedia.
4  @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
5 
6  This library is free software; you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation; either version 2.1 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #include "videoorientation.h"
20 #include <gst/video/videoorientation.h>
21 
22 namespace QGst {
23 
24 bool VideoOrientation::horizontalFlipEnabled() const
25 {
26  gboolean flipped;
27  //Ignoring the gboolean result of the function, can be tested when setting the property
28  gst_video_orientation_get_hflip(object<GstVideoOrientation>(), &flipped);
29  return flipped;
30 }
31 
32 bool VideoOrientation::verticalFlipEnabled() const
33 {
34  gboolean flipped;
35  //Ignoring the gboolean result of the function, can be tested when setting the property
36  gst_video_orientation_get_vflip(object<GstVideoOrientation>(), &flipped);
37  return flipped;
38 }
39 
40 int VideoOrientation::horizontalCenter() const
41 {
42  int center = 0;
43  //Ignoring the gboolean result of the function, can be tested when setting the property
44  gst_video_orientation_get_hcenter(object<GstVideoOrientation>(), &center);
45  return center;
46 }
47 
48 int VideoOrientation::verticalCenter() const
49 {
50  int center = 0;
51  //Ignoring the gboolean result of the function, can be tested when setting the property
52  gst_video_orientation_get_vcenter(object<GstVideoOrientation>(), &center);
53  return center;
54 }
55 
56 bool VideoOrientation::enableHorizontalFlip(bool enabled)
57 {
58  return gst_video_orientation_set_hflip(object<GstVideoOrientation>(), enabled);
59 }
60 
61 bool VideoOrientation::enableVerticalFlip(bool enabled)
62 {
63  return gst_video_orientation_set_vflip(object<GstVideoOrientation>(), enabled);
64 }
65 
66 bool VideoOrientation::setHorizontalCenter(int center)
67 {
68  return gst_video_orientation_set_hcenter(object<GstVideoOrientation>(), center);
69 }
70 
71 bool VideoOrientation::setVerticalCenter(int center)
72 {
73  return gst_video_orientation_set_hcenter(object<GstVideoOrientation>(), center);
74 }
75 
76 } //namespace QGst
77