From d3303121c87af5f42b3d745db22e26f0a0c8eb02 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Thu, 3 May 2012 19:11:57 -0400 Subject: basecamerabin: Do not set the pad templates in the base class. It is best to let the subclass define the pad templates, this would allow the subclass to decide which caps the pads should have. --- gst/camerabin2/gstwrappercamerabinsrc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gst/camerabin2') diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index b69a08880..189d66840 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -54,6 +54,24 @@ GST_DEBUG_CATEGORY (wrapper_camera_bin_src_debug); 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); @@ -1126,6 +1144,15 @@ gst_wrapper_camera_bin_src_class_init (GstWrapperCameraBinSrcClass * klass) 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", -- cgit v1.2.3