basecamerabinsrc: remove redundant functions
authorThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 22 Dec 2011 18:19:05 +0000 (15:19 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 22 Dec 2011 19:17:56 +0000 (16:17 -0300)
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
gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c
gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h
gst/camerabin2/gstwrappercamerabinsrc.c

index 7cae6a2..ff8c782 100644 (file)
@@ -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 \
index 81d7b2c..09995b8 100644 (file)
@@ -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 <rob@ti.com>");
 
-  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);
index 9cd5a00..9d63e2d 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * GStreamer
  * Copyright (C) 2010 Texas Instruments, Inc
+ * Copyright (C) 2011 Thiago Santos <thiago.sousa.santos@collabora.com>
  *
  * 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 <gst/gst.h>
 #include <gst/gstbin.h>
-#include <gst/interfaces/photography.h>
-#include <gst/interfaces/colorbalance.h>
 #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);
index 5c8d2d1..1fc71c0 100644 (file)
@@ -31,6 +31,8 @@
 #  include <config.h>
 #endif
 
+#include <gst/interfaces/photography.h>
+
 #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) {