/**
* SECTION:element-basecamerasrc
*
- * Base class for the camera source bin used by camerabin for capture.
+ * Base class for the camera source bin used by camerabin for capture.
* Sophisticated camera hardware can derive from this baseclass and map the
* features to this interface.
*
* During construct_pipeline() vmethod a subclass can add several elements into
* the bin and expose 3 srcs pads as ghostpads implementing the 3 pad templates.
*
+ * However the subclass is responsable for adding the pad templates for the
+ * source pads and they must be named "vidsrc", "imgsrc" and "vfsrc". The pad
+ * templates should be installed in the subclass' class_init function, like so:
+ * |[
+ * static void
+ * my_element_class_init (GstMyElementClass *klass)
+ * {
+ * GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
+ * // pad templates should be a #GstStaticPadTemplate with direction
+ * // #GST_PAD_SRC and name "vidsrc", "imgsrc" and "vfsrc"
+ * gst_element_class_add_static_pad_template (gstelement_class,
+ * &vidsrc_template);
+ * gst_element_class_add_static_pad_template (gstelement_class,
+ * &imgsrc_template);
+ * gst_element_class_add_static_pad_template (gstelement_class,
+ * &vfsrc_template);
+ * // see #GstElementDetails
+ * gst_element_class_set_details (gstelement_class, &details);
+ * }
+ * ]|
+ *
* It is also possible to add regular pads from the subclass and implement the
* dataflow methods on these pads. This way all functionality can be implemneted
* directly in the subclass without extra elements.
*
- * The src will receive the capture mode from #GstCameraBin2 on the
+ * The src will receive the capture mode from #GstCameraBin2 on the
* #GstBaseCameraSrc:mode property. Possible capture modes are defined in
* #GstCameraBinMode.
*/
#define parent_class gst_base_camera_src_parent_class
G_DEFINE_TYPE (GstBaseCameraSrc, gst_base_camera_src, GST_TYPE_BIN);
-static GstStaticPadTemplate vfsrc_template =
-GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME,
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS_ANY);
-
-static GstStaticPadTemplate imgsrc_template =
-GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_IMAGE_PAD_NAME,
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS_ANY);
-
-static GstStaticPadTemplate vidsrc_template =
-GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME,
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS_ANY);
/* NOTE: we could provide a vmethod for derived class to overload to provide
* it's own implementation of interface.. but in all cases I can think of at
gst_element_class_set_details_simple (gstelement_class,
"Base class for camerabin src bin", "Source/Video",
"Abstracts capture device for camerabin2", "Rob Clark <rob@ti.com>");
-
- gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&vfsrc_template));
-
- gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&imgsrc_template));
-
- gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&vidsrc_template));
}
static void
G_DEFINE_TYPE (GstWrapperCameraBinSrc, gst_wrapper_camera_bin_src,
GST_TYPE_BASE_CAMERA_SRC);
+static GstStaticPadTemplate vfsrc_template =
+GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME,
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate imgsrc_template =
+GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_IMAGE_PAD_NAME,
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS_ANY);
+
+static GstStaticPadTemplate vidsrc_template =
+GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME,
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS_ANY);
+
static void set_capsfilter_caps (GstWrapperCameraBinSrc * self,
GstCaps * new_caps);
GST_DEBUG_CATEGORY_INIT (wrapper_camera_bin_src_debug, "wrappercamerabinsrc",
0, "wrapper camera src");
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&vfsrc_template));
+
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&imgsrc_template));
+
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&vidsrc_template));
+
gst_element_class_set_details_simple (gstelement_class,
"Wrapper camera src element for camerabin2", "Source/Video",
"Wrapper camera src element for camerabin2",