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., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
29 #include "gstv4l2vidorient.h"
30 #include "gstv4l2object.h"
31 #include "v4l2_calls.h"
32 #include "v4l2src_calls.h"
34 GST_DEBUG_CATEGORY_STATIC (v4l2vo_debug);
35 #define GST_CAT_DEFAULT v4l2vo_debug
37 /* Those are deprecated calls that have been replaced */
38 #ifndef V4L2_CID_HCENTER
39 #define V4L2_CID_HCENTER V4L2_CID_PAN_RESET
41 #ifndef V4L2_CID_VCENTER
42 #define V4L2_CID_VCENTER V4L2_CID_TILT_RESET
46 gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * klass)
48 GST_DEBUG_CATEGORY_INIT (v4l2vo_debug, "v4l2vo", 0,
49 "V4L2 VideoOrientation interface debugging");
54 gst_v4l2_video_orientation_get_hflip (GstV4l2Object * v4l2object,
58 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_HFLIP, flip);
62 gst_v4l2_video_orientation_get_vflip (GstV4l2Object * v4l2object,
65 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_VFLIP, flip);
69 gst_v4l2_video_orientation_get_hcenter (GstV4l2Object * v4l2object,
72 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_HCENTER, center);
76 gst_v4l2_video_orientation_get_vcenter (GstV4l2Object * v4l2object,
79 return gst_v4l2_get_attribute (v4l2object, V4L2_CID_VCENTER, center);
83 gst_v4l2_video_orientation_set_hflip (GstV4l2Object * v4l2object, gboolean flip)
85 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_HFLIP, flip);
89 gst_v4l2_video_orientation_set_vflip (GstV4l2Object * v4l2object, gboolean flip)
91 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_VFLIP, flip);
95 gst_v4l2_video_orientation_set_hcenter (GstV4l2Object * v4l2object, gint center)
97 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_HCENTER, center);
101 gst_v4l2_video_orientation_set_vcenter (GstV4l2Object * v4l2object, gint center)
103 return gst_v4l2_set_attribute (v4l2object, V4L2_CID_VCENTER, center);