3 * Copyright (C) 2006 Edgard Lima <edgard.lima@indt.org.br>
5 * gstv4l2vidorient.c: 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.
29 #include "gstv4l2vidorient.h"
30 #include "gstv4l2object.h"
31 #include "v4l2_calls.h"
33 GST_DEBUG_CATEGORY_STATIC (v4l2vo_debug);
34 #define GST_CAT_DEFAULT v4l2vo_debug
37 gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * iface)
39 GST_DEBUG_CATEGORY_INIT (v4l2vo_debug, "v4l2vo", 0,
40 "V4L2 VideoOrientation interface debugging");
45 gst_v4l2_video_orientation_get_hflip (GstV4l2Object * v4l2object,
49 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_HFLIP, flip);
53 gst_v4l2_video_orientation_get_vflip (GstV4l2Object * v4l2object,
56 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_VFLIP, flip);
59 /* named hcenter because of historical v4l2 naming */
61 gst_v4l2_video_orientation_get_hcenter (GstV4l2Object * v4l2object,
64 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_PAN_RESET, center);
67 /* named vcenter because of historical v4l2 naming */
69 gst_v4l2_video_orientation_get_vcenter (GstV4l2Object * v4l2object,
72 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_TILT_RESET, center);
76 gst_v4l2_video_orientation_set_hflip (GstV4l2Object * v4l2object, gboolean flip)
78 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_HFLIP, flip);
82 gst_v4l2_video_orientation_set_vflip (GstV4l2Object * v4l2object, gboolean flip)
84 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_VFLIP, flip);
88 gst_v4l2_video_orientation_set_hcenter (GstV4l2Object * v4l2object, gint center)
90 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_PAN_RESET, center);
94 gst_v4l2_video_orientation_set_vcenter (GstV4l2Object * v4l2object, gint center)
96 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_TILT_RESET, center);