gst_bin_get_by_interface should be enough for applications.
Haven't seen anyone using those other than wrappercamerabinsrc.
-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)
-: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 \
*/
/**
- * 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
"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);
/*
* 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
#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"
#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);
# include <config.h>
#endif
+#include <gst/interfaces/photography.h>
+
#include "gstwrappercamerabinsrc.h"
#include "camerabingeneral.h"
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;
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) {