1 /* |
|
2 * GStreamer |
|
3 * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org> |
|
4 * |
|
5 * This library is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU Library General Public |
|
7 * License as published by the Free Software Foundation; either |
|
8 * version 2 of the License, or (at your option) any later version. |
|
9 * |
|
10 * This library is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 * Library General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU Library General Public |
|
16 * License along with this library; if not, write to the |
|
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
18 * Boston, MA 02111-1307, USA. |
|
19 */ |
|
20 |
|
21 #ifndef __CAMERABIN_VIDEO_H__ |
|
22 #define __CAMERABIN_VIDEO_H__ |
|
23 |
|
24 #include <gst/gstbin.h> |
|
25 |
|
26 G_BEGIN_DECLS |
|
27 |
|
28 //#define USE_TIMEOVERLAY 1 |
|
29 |
|
30 #define ARG_DEFAULT_MUTE FALSE |
|
31 |
|
32 #define GST_TYPE_CAMERABIN_VIDEO (gst_camerabin_video_get_type()) |
|
33 #define GST_CAMERABIN_VIDEO_CAST(obj) ((GstCameraBinVideo*)(obj)) |
|
34 #define GST_CAMERABIN_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CAMERABIN_VIDEO,GstCameraBinVideo)) |
|
35 #define GST_CAMERABIN_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CAMERABIN_VIDEO,GstCameraBinVideoClass)) |
|
36 #define GST_IS_CAMERABIN_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CAMERABIN_VIDEO)) |
|
37 #define GST_IS_CAMERABIN_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CAMERABIN_VIDEO)) |
|
38 |
|
39 /** |
|
40 * GstCameraBinVideo: |
|
41 * |
|
42 * The opaque #GstCameraBinVideo structure. |
|
43 */ |
|
44 |
|
45 typedef struct _GstCameraBinVideo GstCameraBinVideo; |
|
46 typedef struct _GstCameraBinVideoClass GstCameraBinVideoClass; |
|
47 |
|
48 struct _GstCameraBinVideo |
|
49 { |
|
50 GstBin parent; |
|
51 |
|
52 GString *filename; |
|
53 |
|
54 /* A/V timestamp rewriting */ |
|
55 guint64 adjust_ts_video; |
|
56 guint64 last_ts_video; |
|
57 gboolean calculate_adjust_ts_video; |
|
58 |
|
59 guint64 adjust_ts_aud; |
|
60 guint64 last_ts_aud; |
|
61 gboolean calculate_adjust_ts_aud; |
|
62 |
|
63 /* Sink and src pads of video bin */ |
|
64 GstPad *sinkpad; |
|
65 GstPad *srcpad; |
|
66 |
|
67 /* Tee src pads leading to video encoder and view finder */ |
|
68 GstPad *tee_video_srcpad; |
|
69 GstPad *tee_vf_srcpad; |
|
70 |
|
71 /* User set elements */ |
|
72 GstElement *user_post; /* Video post processing */ |
|
73 GstElement *user_vid_enc; |
|
74 GstElement *user_aud_enc; |
|
75 GstElement *user_aud_src; |
|
76 GstElement *user_mux; |
|
77 |
|
78 /* Other elements */ |
|
79 GstElement *aud_src; /* Audio source */ |
|
80 GstElement *sink; /* Sink for recorded video */ |
|
81 GstElement *tee; /* Split output to view finder and recording sink */ |
|
82 GstElement *volume; /* Volume for muting */ |
|
83 GstElement *video_queue; /* Buffer for raw video frames */ |
|
84 GstElement *vid_enc; /* Video encoder */ |
|
85 GstElement *aud_enc; /* Audio encoder */ |
|
86 GstElement *muxer; /* Muxer */ |
|
87 |
|
88 GstEvent *pending_eos; |
|
89 }; |
|
90 |
|
91 struct _GstCameraBinVideoClass |
|
92 { |
|
93 GstBinClass parent_class; |
|
94 }; |
|
95 |
|
96 GType gst_camerabin_video_get_type (void); |
|
97 |
|
98 /* |
|
99 * external function prototypes |
|
100 */ |
|
101 |
|
102 void gst_camerabin_video_set_mute (GstCameraBinVideo * vid, gboolean mute); |
|
103 |
|
104 void gst_camerabin_video_set_post (GstCameraBinVideo * vid, GstElement * post); |
|
105 |
|
106 void |
|
107 gst_camerabin_video_set_video_enc (GstCameraBinVideo * vid, |
|
108 GstElement * video_enc); |
|
109 |
|
110 void |
|
111 gst_camerabin_video_set_audio_enc (GstCameraBinVideo * vid, |
|
112 GstElement * audio_enc); |
|
113 |
|
114 void |
|
115 gst_camerabin_video_set_muxer (GstCameraBinVideo * vid, GstElement * muxer); |
|
116 |
|
117 void |
|
118 gst_camerabin_video_set_audio_src (GstCameraBinVideo * vid, |
|
119 GstElement * audio_src); |
|
120 |
|
121 |
|
122 gboolean gst_camerabin_video_get_mute (GstCameraBinVideo * vid); |
|
123 |
|
124 GstElement *gst_camerabin_video_get_post (GstCameraBinVideo * vid); |
|
125 |
|
126 GstElement *gst_camerabin_video_get_video_enc (GstCameraBinVideo * vid); |
|
127 |
|
128 GstElement *gst_camerabin_video_get_audio_enc (GstCameraBinVideo * vid); |
|
129 |
|
130 GstElement *gst_camerabin_video_get_muxer (GstCameraBinVideo * vid); |
|
131 |
|
132 GstElement *gst_camerabin_video_get_audio_src (GstCameraBinVideo * vid); |
|
133 |
|
134 G_END_DECLS |
|
135 |
|
136 #endif /* #ifndef __CAMERABIN_VIDEO_H__ */ |
|