1 /* 2 * Copyright (C) 2010 Ole André Vadla Ravnås <oleavr@soundrop.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_AVF_VIDEO_SRC_H__ 21 #define __GST_AVF_VIDEO_SRC_H__ 22 23 #import <AVFoundation/AVFoundation.h> 24 #include <gst/base/gstpushsrc.h> 25 26 G_BEGIN_DECLS 27 28 #define GST_TYPE_AVF_VIDEO_SRC \ 29 (gst_avf_video_src_get_type ()) 30 #define GST_AVF_VIDEO_SRC(obj) \ 31 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AVF_VIDEO_SRC, GstAVFVideoSrc)) 32 #define GST_AVF_VIDEO_SRC_CAST(obj) \ 33 ((GstAVFVideoSrc *) (obj)) 34 #define GST_AVF_VIDEO_SRC_CLASS(klass) \ 35 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_AVF_VIDEO_SRC, GstAVFVideoSrcClass)) 36 #define GST_AVF_VIDEO_SRC_IMPL(obj) \ 37 ((__bridge GstAVFVideoSrcImpl *) GST_AVF_VIDEO_SRC_CAST (obj)->impl) 38 #define GST_IS_AVF_VIDEO_SRC(obj) \ 39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AVF_VIDEO_SRC)) 40 #define GST_IS_AVF_VIDEO_SRC_CLASS(klass) \ 41 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AVF_VIDEO_SRC)) 42 43 typedef struct _GstAVFVideoSrc GstAVFVideoSrc; 44 typedef struct _GstAVFVideoSrcClass GstAVFVideoSrcClass; 45 46 typedef enum 47 { 48 GST_AVF_VIDEO_SOURCE_POSITION_DEFAULT, 49 GST_AVF_VIDEO_SOURCE_POSITION_FRONT, 50 GST_AVF_VIDEO_SOURCE_POSITION_BACK, 51 } GstAVFVideoSourcePosition; 52 53 typedef enum 54 { 55 GST_AVF_VIDEO_SOURCE_ORIENTATION_DEFAULT, 56 GST_AVF_VIDEO_SOURCE_ORIENTATION_PORTRAIT, 57 GST_AVF_VIDEO_SOURCE_ORIENTATION_PORTRAIT_UPSIDE_DOWN, 58 GST_AVF_VIDEO_SOURCE_ORIENTATION_LANDSCAPE_RIGHT, 59 GST_AVF_VIDEO_SOURCE_ORIENTATION_LANDSCAPE_LEFT, 60 } GstAVFVideoSourceOrientation; 61 62 typedef enum 63 { 64 GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_DEFAULT, 65 GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_BUILT_IN_WIDE_ANGLE_CAMERA, 66 GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_BUILT_IN_TELEPHOTO_CAMERA, 67 GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_BUILT_IN_DUAL_CAMERA, 68 } GstAVFVideoSourceDeviceType; 69 70 struct _GstAVFVideoSrc 71 { 72 GstPushSrc push_src; 73 74 /* NOTE: ARC no longer allows Objective-C pointers in structs. */ 75 /* Instead, use gpointer with explicit __bridge_* calls */ 76 gpointer impl; 77 }; 78 79 struct _GstAVFVideoSrcClass 80 { 81 GstPushSrcClass parent_class; 82 }; 83 84 GType gst_avf_video_src_get_type (void); 85 86 GstCaps *gst_av_capture_device_get_caps (AVCaptureDevice *device, AVCaptureVideoDataOutput *output, GstAVFVideoSourceOrientation orientation); 87 88 G_END_DECLS 89 90 #endif /* __GST_AVF_VIDEO_SRC_H__ */ 91