summaryrefslogtreecommitdiff
path: root/gst/camerabin2/gstwrappercamerabinsrc.h
blob: b2f4c7ae6f1b5f240a85d05baf608d1fc023d11d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * GStreamer
 * Copyright (C) 2010 Texas Instruments, Inc
 * Copyright (C) 2010 Thiago Santos <thiago.sousa.santos@collabora.co.uk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


#ifndef __GST_WRAPPER_CAMERA_BIN_SRC_H__
#define __GST_WRAPPER_CAMERA_BIN_SRC_H__

#include <gst/gst.h>
#include <gst/basecamerabinsrc/gstbasecamerasrc.h>
#include "camerabingeneral.h"

G_BEGIN_DECLS
#define GST_TYPE_WRAPPER_CAMERA_BIN_SRC \
  (gst_wrapper_camera_bin_src_get_type())
#define GST_WRAPPER_CAMERA_BIN_SRC(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WRAPPER_CAMERA_BIN_SRC,GstWrapperCameraBinSrc))
#define GST_WRAPPER_CAMERA_BIN_SRC_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WRAPPER_CAMERA_BIN_SRC,GstWrapperCameraBinSrcClass))
#define GST_IS_WRAPPER_CAMERA_BIN_SRC(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WRAPPER_CAMERA_BIN_SRC))
#define GST_IS_WRAPPER_CAMERA_BIN_SRC_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WRAPPER_CAMERA_BIN_SRC))
    GType gst_wrapper_camera_bin_src_get_type (void);

typedef struct _GstWrapperCameraBinSrc GstWrapperCameraBinSrc;
typedef struct _GstWrapperCameraBinSrcClass GstWrapperCameraBinSrcClass;

enum GstVideoRecordingStatus {
  GST_VIDEO_RECORDING_STATUS_DONE,
  GST_VIDEO_RECORDING_STATUS_STARTING,
  GST_VIDEO_RECORDING_STATUS_RUNNING,
  GST_VIDEO_RECORDING_STATUS_FINISHING
};


/**
 * GstWrapperCameraBinSrc:
 *
 */
struct _GstWrapperCameraBinSrc
{
  GstBaseCameraSrc parent;

  GstCameraBinMode mode;

  GstPad *vfsrc;
  GstPad *imgsrc;
  GstPad *vidsrc;

  /* video recording controls */
  gint video_rec_status;

  /* image capture controls */
  gint image_capture_count;

  /* source elements */
  GstElement *src_vid_src;
  GstElement *src_filter;
  GstElement *src_zoom_crop;
  GstElement *src_zoom_scale;
  GstElement *src_zoom_filter;
  GstElement *output_selector;

  gboolean elements_created;

  guint src_event_probe_id;

  GstPad *outsel_imgpad;
  GstPad *outsel_vidpad;

  GstPadEventFunction srcpad_event_func;

  /* Application configurable elements */
  GstElement *app_vid_src;

  /* Caps that videosrc supports */
  GstCaps *allowed_caps;

  /* Optional base crop for frames. Used to crop frames e.g.
     due to wrong aspect ratio, before the crop related to zooming. */
  gint base_crop_top;
  gint base_crop_bottom;
  gint base_crop_left;
  gint base_crop_right;

  /* Caps applied to capsfilters when in view finder mode */
  GstCaps *view_finder_caps;

  /* Caps applied to capsfilters when taking still image */
  GstCaps *image_capture_caps;
  gboolean image_renegotiate;
  gboolean video_renegotiate;

  /* Preview convert pipeline */
  GstCameraBinPreviewPipelineData *preview_pipeline;
  gboolean post_previews;
  GstCaps *preview_caps;
  GstElement *preview_filter;
  gboolean preview_filter_changed;
};


/**
 * GstWrapperCameraBinSrcClass:
 *
 */
struct _GstWrapperCameraBinSrcClass
{
  GstBaseCameraSrcClass parent;
};

gboolean gst_wrapper_camera_bin_src_plugin_init (GstPlugin * plugin);

#endif /* __GST_WRAPPER_CAMERA_BIN_SRC_H__ */