basecamerabinsrc: remove redundant functions

gst_bin_get_by_interface should be enough for applications.
Haven't seen anyone using those other than wrappercamerabinsrc.
This commit is contained in:
Thiago Santos 2011-12-22 15:19:05 -03:00
parent d9e13c4268
commit 36fbb8eea4
4 changed files with 10 additions and 63 deletions

View 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 \

View file

@ -110,57 +110,6 @@ GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIDEO_PAD_NAME,
* be implementing the interface..
*/
/**
* 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
@ -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);

View 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);

View 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) {