From 36fbb8eea444820c53cbc477bd4b5ac8809784d1 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 22 Dec 2011 15:19:05 -0300 Subject: [PATCH] basecamerabinsrc: remove redundant functions gst_bin_get_by_interface should be enough for applications. Haven't seen anyone using those other than wrappercamerabinsrc. --- gst-libs/gst/basecamerabinsrc/Makefile.am | 3 -- gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c | 54 +----------------------- gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h | 6 +-- gst/camerabin2/gstwrappercamerabinsrc.c | 10 ++++- 4 files changed, 10 insertions(+), 63 deletions(-) diff --git a/gst-libs/gst/basecamerabinsrc/Makefile.am b/gst-libs/gst/basecamerabinsrc/Makefile.am index 7cae6a2..ff8c782 100644 --- a/gst-libs/gst/basecamerabinsrc/Makefile.am +++ b/gst-libs/gst/basecamerabinsrc/Makefile.am @@ -20,8 +20,6 @@ libgstbasecamerabinsrc_@GST_MAJORMINOR@_la_CFLAGS = \ -DGST_USE_UNSTABLE_API \ $(GST_CFLAGS) libgstbasecamerabinsrc_@GST_MAJORMINOR@_la_LIBADD = \ - $(top_builddir)/gst-libs/gst/interfaces/libgstphotography-@GST_MAJORMINOR@.la \ - $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-$(GST_MAJORMINOR) \ -lgstapp-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_LIBS) libgstbasecamerabinsrc_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) @@ -35,7 +33,6 @@ Android.mk: Makefile.am -:LDFLAGS $(libgstbasecamerabinsrc_@GST_MAJORMINOR@_la_LDFLAGS) \ $(libgstbasecamerabinsrc_@GST_MAJORMINOR@_la_LIBADD) \ -ldl \ - -:LIBFILTER_STATIC gstphotography-@GST_MAJORMINOR@ \ -:HEADER_TARGET gstreamer-@GST_MAJORMINOR@/gst/basecamerabinsrc \ -:HEADERS $(libgstbasecamerabinsrcinclude_HEADERS) \ -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c index 81d7b2c..09995b8 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c @@ -111,57 +111,6 @@ GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME, */ /** - * gst_base_camera_src_get_photography: - * @self: the camerasrc bin - * - * Get object implementing photography interface, if there is one. Otherwise - * returns NULL. - */ -GstPhotography * -gst_base_camera_src_get_photography (GstBaseCameraSrc * self) -{ - GstElement *elem; - - if (GST_IS_PHOTOGRAPHY (self)) { - elem = GST_ELEMENT (self); - } else { - elem = gst_bin_get_by_interface (GST_BIN (self), GST_TYPE_PHOTOGRAPHY); - } - - if (elem) { - return GST_PHOTOGRAPHY (elem); - } - - return NULL; -} - - -/** - * gst_base_camera_src_get_colorbalance: - * @self: the camerasrc bin - * - * Get object implementing colorbalance interface, if there is one. Otherwise - * returns NULL. - */ -GstColorBalance * -gst_base_camera_src_get_color_balance (GstBaseCameraSrc * self) -{ - GstElement *elem; - - if (GST_IS_COLOR_BALANCE (self)) { - elem = GST_ELEMENT (self); - } else { - elem = gst_bin_get_by_interface (GST_BIN (self), GST_TYPE_COLOR_BALANCE); - } - - if (elem) { - return GST_COLOR_BALANCE (self); - } - - return NULL; -} - -/** * gst_base_camera_src_set_mode: * @self: the camerasrc bin * @mode: the mode @@ -491,8 +440,7 @@ gst_base_camera_src_base_init (gpointer g_class) "Base class for camerabin src bin", "Source/Video", "Abstracts capture device for camerabin2", "Rob Clark "); - gst_element_class_add_static_pad_template (gstelement_class, - &vfsrc_template); + gst_element_class_add_static_pad_template (gstelement_class, &vfsrc_template); gst_element_class_add_static_pad_template (gstelement_class, &imgsrc_template); diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h index 9cd5a00..9d63e2d 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h @@ -1,6 +1,7 @@ /* * GStreamer * Copyright (C) 2010 Texas Instruments, Inc + * Copyright (C) 2011 Thiago Santos * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -29,8 +30,6 @@ #include #include -#include -#include #include "gstcamerabin-enum.h" #include "gstcamerabinpreview.h" @@ -131,9 +130,6 @@ struct _GstBaseCameraSrcClass #define MAX_ZOOM 10.0f #define ZOOM_1X MIN_ZOOM -GstPhotography * gst_base_camera_src_get_photography (GstBaseCameraSrc *self); -GstColorBalance * gst_base_camera_src_get_color_balance (GstBaseCameraSrc *self); - gboolean gst_base_camera_src_set_mode (GstBaseCameraSrc *self, GstCameraBinMode mode); void gst_base_camera_src_setup_zoom (GstBaseCameraSrc * self); void gst_base_camera_src_setup_preview (GstBaseCameraSrc * self, GstCaps * preview_caps); diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 5c8d2d1..1fc71c0 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -31,6 +31,8 @@ # include #endif +#include + #include "gstwrappercamerabinsrc.h" #include "camerabingeneral.h" @@ -703,7 +705,9 @@ static gboolean start_image_capture (GstWrapperCameraBinSrc * self) { GstBaseCameraSrc *bcamsrc = GST_BASE_CAMERA_SRC (self); - GstPhotography *photography = gst_base_camera_src_get_photography (bcamsrc); + GstPhotography *photography = + (GstPhotography *) gst_bin_get_by_interface (GST_BIN_CAST (bcamsrc), + GST_TYPE_PHOTOGRAPHY); gboolean ret = FALSE; GstCaps *caps; @@ -744,7 +748,9 @@ static gboolean gst_wrapper_camera_bin_src_set_mode (GstBaseCameraSrc * bcamsrc, GstCameraBinMode mode) { - GstPhotography *photography = gst_base_camera_src_get_photography (bcamsrc); + GstPhotography *photography = + (GstPhotography *) gst_bin_get_by_interface (GST_BIN_CAST (bcamsrc), + GST_TYPE_PHOTOGRAPHY); GstWrapperCameraBinSrc *self = GST_WRAPPER_CAMERA_BIN_SRC (bcamsrc); if (self->output_selector) { -- 2.7.4