4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>
8 * This library is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the
10 * Free Software Foundation; either version 2.1 of the License, or (at your option)
13 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 * License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, write to the Free Software Foundation, Inc., 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef __GST_ENCODE_BIN_H__
25 #define __GST_ENCODE_BIN_H__
28 #include <gst/base/gstcollectpads.h>
29 #include <gst/riff/riff-ids.h>
33 #define GST_CAT_DEFAULT gst_encode_bin_debug
35 #define GST_TYPE_ENCODE_BIN_PROFILE (gst_encode_bin_profile_get_type())
36 GType gst_encode_bin_profile_get_type (void);
38 #define GST_TYPE_ENCODE_BIN (gst_encode_bin_get_type())
39 #define GST_ENCODE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODE_BIN,GstEncodeBin))
40 #define GST_ENCODE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ENCODE_BIN,GstEncodeBinClass))
41 #define GST_IS_ENCODE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODE_BIN))
42 #define GST_IS_ENCODE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ENCODE_BIN))
44 #define GST_ENCODE_BIN_GET_LOCK(encodebin) (((GstEncodeBin*)encodebin)->mutex)
45 #define GST_ENCODE_BIN_LOCK(encodebin) g_mutex_lock (GST_ENCODE_BIN_GET_LOCK(encodebin))
46 #define GST_ENCODE_BIN_UNLOCK(encodebin) g_mutex_unlock (GST_ENCODE_BIN_GET_LOCK(encodebin))
49 #define GST_ENCODE_BIN_SIGNAL_ENABLE
51 typedef struct _GstEncodeBinPad {
52 GstCollectData *collect;
62 typedef struct _GstEncodeBin GstEncodeBin;
63 typedef struct _GstEncodeBinClass GstEncodeBinClass;
67 GstBin bin; /* we extend GstBin */
73 GstPad *video_sinkpad;
74 GstPad *audio_sinkpad;
75 GstPad *image_sinkpad;
76 GstPad *mux_audio_sinkpad;
77 GstPad *mux_video_sinkpad;
79 /* sinkpads, video first */
82 /* video restricted to 1 pad */
83 guint video_pads, audio_pads;
99 gboolean auto_audio_convert;
100 gboolean auto_audio_resample;
101 gboolean auto_color_space;
104 gboolean use_video_toggle;
105 gboolean use_venc_queue;
106 gboolean use_aenc_queue;
108 GstElement *audio_queue;
109 GstElement *video_queue;
110 GstElement *video_encode_queue;
111 GstElement *audio_encode_queue;
112 GstElement *image_queue;
114 GstElement *audio_encode;
115 GstElement *video_encode;
116 GstElement *image_encode;
118 GstElement *vcapsfilter;
119 GstElement *acapsfilter;
120 GstElement *icapsfilter;
122 GstElement *video_toggle;
123 GstElement *image_toggle;
124 GstElement *color_space;
125 GstElement *audio_conv;
126 GstElement *audio_sample;
130 /* pause/resume variables */
131 GstClockTime paused_time; /* pipeline time when pausing */
132 GstClockTime total_offset_time; /* delayed time which is due to pause */
133 gulong vsink_probeid;
134 gulong vsink_hs_probeid;
135 gulong asink_probeid;
140 struct _GstEncodeBinClass
142 GstBinClass parent_class;
144 #ifdef GST_ENCODE_BIN_SIGNAL_ENABLE
145 /* signal we fire when stream block/pause function called */
146 void (*stream_block) (GstElement * element, gboolean result);
147 void (*stream_unblock) (GstElement * element, gboolean result);
148 void (*stream_pause) (GstElement * element, gboolean result);
149 void (*stream_resume) (GstElement * element, gboolean result);
154 GType gst_encode_bin_get_type (void);
159 #endif /* __GST_ENCODE_BIN_H__ */