Commit 7d65470c authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

Remove old camerabin

parent da001be1
......@@ -147,7 +147,6 @@ if test "x$HAVE_UNISTD_H" != "xyes"; then
GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
fi
dnl used by camerabin
AC_CHECK_HEADERS([sys/time.h])
dnl used by ext/dts
......@@ -301,7 +300,7 @@ dnl *** plug-ins to include ***
dnl Non ported plugins (non-dependant, then dependant)
dnl Make sure you have a space before and after all plugins
GST_PLUGINS_NONPORTED=" aiff \
camerabin cdxaparse \
cdxaparse \
dccp faceoverlay festival \
fieldanalysis freeverb freeze frei0r gaudieffects \
hdvparse id3tag inter interlace ivfparse jpegformat jp2kdecimator \
......@@ -325,7 +324,6 @@ AG_GST_CHECK_PLUGIN(asfmux)
AG_GST_CHECK_PLUGIN(audiovisualizers)
AG_GST_CHECK_PLUGIN(autoconvert)
AG_GST_CHECK_PLUGIN(bayer)
AG_GST_CHECK_PLUGIN(camerabin)
AG_GST_CHECK_PLUGIN(camerabin2)
AG_GST_CHECK_PLUGIN(cdxaparse)
AG_GST_CHECK_PLUGIN(coloreffects)
......@@ -2013,7 +2011,6 @@ gst/asfmux/Makefile
gst/audiovisualizers/Makefile
gst/autoconvert/Makefile
gst/bayer/Makefile
gst/camerabin/Makefile
gst/camerabin2/Makefile
gst/cdxaparse/Makefile
gst/coloreffects/Makefile
......@@ -2113,7 +2110,6 @@ tests/Makefile
tests/check/Makefile
tests/files/Makefile
tests/examples/Makefile
tests/examples/camerabin/Makefile
tests/examples/camerabin2/Makefile
tests/examples/directfb/Makefile
tests/examples/mxf/Makefile
......
......@@ -115,7 +115,6 @@ EXTRA_HFILES = \
$(top_srcdir)/gst/audiovisualizers/gstspectrascope.h \
$(top_srcdir)/gst/audiovisualizers/gstsynaescope.h \
$(top_srcdir)/gst/audiovisualizers/gstwavescope.h \
$(top_srcdir)/gst/camerabin/gstcamerabin.h \
$(top_srcdir)/gst/camerabin2/gstcamerabin2.h \
$(top_srcdir)/gst/coloreffects/gstcoloreffects.h \
$(top_srcdir)/gst/dataurisrc/gstdataurisrc.h \
......
......@@ -24,7 +24,6 @@
<xi:include href="xml/element-bulge.xml" />
<xi:include href="xml/element-burn.xml" />
<xi:include href="xml/element-camerabin.xml" />
<xi:include href="xml/element-camerabin2.xml" />
<xi:include href="xml/element-celtdec.xml" />
<xi:include href="xml/element-celtenc.xml" />
<xi:include href="xml/element-chromium.xml" />
......@@ -142,7 +141,6 @@
<xi:include href="xml/plugin-bayer.xml" />
<xi:include href="xml/plugin-bz2.xml" />
<xi:include href="xml/plugin-camerabin.xml" />
<xi:include href="xml/plugin-camerabin2.xml" />
<xi:include href="xml/plugin-cdaudio.xml" />
<xi:include href="xml/plugin-cdxaparse.xml" />
<xi:include href="xml/plugin-celt.xml" />
......
......@@ -104,29 +104,14 @@ gst_burn_plugin_init
<FILE>element-camerabin</FILE>
<TITLE>camerabin</TITLE>
GstCameraBin
GstCameraBinMode
<SUBSECTION Standard>
GstCameraBinClass
GST_CAMERABIN
GST_IS_CAMERABIN
GST_TYPE_CAMERABIN
GST_CAMERABIN_CLASS
GST_IS_CAMERABIN_CLASS
gst_camerabin_get_type
</SECTION>
<SECTION>
<FILE>element-camerabin2</FILE>
<TITLE>camerabin2</TITLE>
GstCameraBin2
<SUBSECTION Standard>
GstCameraBin2Class
GST_CAMERA_BIN2
GST_IS_CAMERA_BIN2
GST_TYPE_CAMERA_BIN2
GST_CAMERA_BIN2_CLASS
GST_IS_CAMERA_BIN2_CLASS
gst_camera_bin2_get_type
GST_CAMERA_BIN
GST_IS_CAMERA_BIN
GST_TYPE_CAMERA_BIN
GST_CAMERA_BIN_CLASS
GST_IS_CAMERA_BIN_CLASS
gst_camera_bin_get_type
</SECTION>
<SECTION>
......
<plugin>
<name>camerabin</name>
<description>High level api for DC (Digital Camera) application</description>
<filename>../../gst/camerabin/.libs/libgstcamerabin.so</filename>
<basename>libgstcamerabin.so</basename>
<version>0.10.23.1</version>
<license>LGPL</license>
<source>gst-plugins-bad</source>
<package>GStreamer Bad Plug-ins git</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>camerabin</name>
<longname>Camera Bin</longname>
<class>Generic/Bin/Camera</class>
<description>Handle lot of features present in DSC</description>
<author>Nokia Corporation &lt;multimedia@maemo.org&gt;, Edgard Lima &lt;edgard.lima@indt.org.br&gt;</author>
<pads>
</pads>
</element>
</elements>
</plugin>
\ No newline at end of file
<plugin>
<name>camerabin2</name>
<description>camerabin2</description>
<filename>../../gst/camerabin2/.libs/libgstcamerabin2.so</filename>
<basename>libgstcamerabin2.so</basename>
<version>0.11.90</version>
<license>LGPL</license>
<source>gst-plugins-bad</source>
<package>GStreamer Bad Plug-ins source release</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>camerabin2</name>
<longname>CameraBin2</longname>
<class>Generic/Bin/Camera</class>
<description>CameraBin2</description>
<author>Thiago Santos &lt;thiago.sousa.santos@collabora.co.uk&gt;</author>
<pads>
</pads>
</element>
<element>
<name>viewfinderbin</name>
<longname>Viewfinder Bin</longname>
<class>Sink/Video</class>
<description>Viewfinder Bin used in camerabin2</description>
<author>Thiago Santos &lt;thiago.sousa.santos@collabora.com&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>video/x-raw</details>
</caps>
</pads>
</element>
<element>
<name>wrappercamerabinsrc</name>
<longname>Wrapper camera src element for camerabin2</longname>
<class>Source/Video</class>
<description>Wrapper camera src element for camerabin2</description>
<author>Thiago Santos &lt;thiago.sousa.santos@collabora.com&gt;</author>
<pads>
<caps>
<name>imgsrc</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>vfsrc</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
<caps>
<name>vidsrc</name>
<direction>source</direction>
<presence>always</presence>
<details>ANY</details>
</caps>
</pads>
</element>
</elements>
</plugin>
\ No newline at end of file
gstcamerabin-marshal.c
gstcamerabin-marshal.h
glib_gen_prefix = __gst_camerabin
glib_gen_basename = gstcamerabin
include $(top_srcdir)/common/gst-glib-gen.mak
built_sources = gstcamerabin-marshal.c
built_headers = gstcamerabin-marshal.h
BUILT_SOURCES = $(built_sources) $(built_headers)
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = gstcamerabin-marshal.list
plugin_LTLIBRARIES = libgstcamerabin.la
libgstcamerabin_la_SOURCES = gstcamerabin.c \
gstcamerabincolorbalance.c \
gstinputselector.c \
camerabinimage.c \
camerabinvideo.c \
camerabingeneral.c \
camerabinpreview.c \
gstcamerabin-enum.c
nodist_libgstcamerabin_la_SOURCES = $(built_sources)
libgstcamerabin_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_CFLAGS) $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \
-DGST_USE_UNSTABLE_API
libgstcamerabin_la_LIBADD = \
$(top_builddir)/gst-libs/gst/interfaces/libgstphotography-$(GST_API_VERSION).la \
$(GST_LIBS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
-lgstinterfaces-$(GST_API_VERSION) -lgsttag-$(GST_API_VERSION)
libgstcamerabin_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstcamerabin_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = gstcamerabin.h \
gstcamerabincolorbalance.h \
gstinputselector.h \
camerabinimage.h \
camerabinvideo.h \
camerabindebug.h \
camerabingeneral.h \
camerabinpreview.h \
gstcamerabin-enum.h
Android.mk: Makefile.am $(BUILT_SOURCES)
androgenizer \
-:PROJECT libgstcamerabin -:SHARED libgstcamerabin \
-:TAGS eng debug \
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
-:SOURCES $(libgstcamerabin_la_SOURCES) \
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstcamerabin_la_CFLAGS) \
-:LDFLAGS $(libgstcamerabin_la_LDFLAGS) \
$(libgstcamerabin_la_LIBADD) \
-ldl \
-:LIBFILTER_STATIC gstphotography-@GST_API_VERSION@ \
gstbasecamerabinsrc-@GST_API_VERSION@ \
-:PASSTHROUGH LOCAL_ARM_MODE:=arm \
LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \
> $@
= Cleanups =
* often two g_object_set for same object one after the other
* use GST_*_OBJECT () more often
* there are two gst_element_set_state() one after each other
= Renaming =
* internal use of img->image, vid->video
= Refactorisation =
* gstcamerabin:gst_camerabin_rewrite_tags
- sounds fishy, should use normal tagsetter method
- gst_camerabin_rewrite_tags_to_bin(9 why don't we just send a tag-event?
* file-name property
- supplying an already opened filedeskriptor would be more safe
- need to check what filesink does if the file exists and cannot be overwritten
* imagbin
- we want async operation here (especialy for burst mode capture)
- right now, its a bit fragile as we muck with locked_state
- main problem is that the location for filesink can only be set in NULL/READY
and we need to do that sync'ed with the dataflow. we can't use multifilesink
as it does a file per pad_push
- one problem of the current approach is that we can't have an image in e.g,
postprocessing while anotherone is beeing saved
- we could use a pool of imagebins:
- configure one (set filename)
- push_buffer
- on eos, put it back to the pool
- for this we need to check that we can have multiple instances of e.g.
dsp jpeg encoders
/*
* GStreamer
* Copyright (C) 2010 Nokia Corporation <multimedia@maemo.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __CAMERABIN_DEBUG_H_
#define __CAMERABIN_DEBUG_H_
#include <gst/gst.h>
/* debug logging category */
GST_DEBUG_CATEGORY_EXTERN (gst_camerabin_debug);
#define GST_CAT_DEFAULT gst_camerabin_debug
#endif /* #ifndef __CAMERABIN_DEBUG_H_ */
/*
* GStreamer
* Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION:camerabingeneral
* @short_description: helper functions for #GstCameraBin and it's modules
*
* Common helper functions for #GstCameraBin, #GstCameraBinImage and
* #GstCameraBinVideo.
*
*/
#include <string.h>
#include <glib.h>
#include "camerabingeneral.h"
#include "gstinputselector.h"
GST_DEBUG_CATEGORY (gst_camerabin_debug);
/**
* gst_camerabin_add_element:
* @bin: add an element to this bin
* @new_elem: new element to be added
*
* Adds given element to given @bin. Looks for an unconnected src pad
* from the @bin and links the element to it. Raises an error if adding
* or linking failed. Unrefs the element in the case of an error.
*
* Returns: %TRUE if adding and linking succeeded, %FALSE otherwise.
*/
gboolean
gst_camerabin_add_element (GstBin * bin, GstElement * new_elem)
{
gboolean ret;
g_return_val_if_fail (bin, FALSE);
g_return_val_if_fail (new_elem, FALSE);
ret = gst_camerabin_try_add_element (bin, new_elem);
if (!ret) {
gchar *elem_name = gst_element_get_name (new_elem);
GST_ELEMENT_ERROR (bin, CORE, NEGOTIATION, (NULL),
("linking %s failed", elem_name));
g_free (elem_name);
gst_object_unref (new_elem);
}
return ret;
}
/**
* gst_camerabin_try_add_element:
* @bin: tries adding an element to this bin
* @new_elem: new element to be added
*
* Adds given element to given @bin. Looks for an unconnected src pad
* from the @bin and links the element to it.
*
* Returns: %TRUE if adding and linking succeeded, %FALSE otherwise.
*/
gboolean
gst_camerabin_try_add_element (GstBin * bin, GstElement * new_elem)
{
GstPad *bin_pad;
GstElement *bin_elem;
gboolean ret = TRUE;
g_return_val_if_fail (bin, FALSE);
g_return_val_if_fail (new_elem, FALSE);
/* Get pads for linking */
bin_pad = gst_bin_find_unlinked_pad (bin, GST_PAD_SRC);
/* Add to bin */
gst_bin_add (GST_BIN (bin), new_elem);
/* Link, if unconnected pad was found, otherwise just add it to bin */
if (bin_pad) {
GST_DEBUG_OBJECT (bin, "linking %s to %s:%s", GST_OBJECT_NAME (new_elem),
GST_DEBUG_PAD_NAME (bin_pad));
bin_elem = gst_pad_get_parent_element (bin_pad);
gst_object_unref (bin_pad);
if (!gst_element_link_pads_full (bin_elem, NULL, new_elem, NULL,
GST_PAD_LINK_CHECK_CAPS)) {
gst_object_ref (new_elem);
gst_bin_remove (bin, new_elem);
ret = FALSE;
}
gst_object_unref (bin_elem);
} else {
GST_INFO_OBJECT (bin, "no unlinked source pad in bin");
}
return ret;
}
/**
* gst_camerabin_create_and_add_element:
* @bin: tries adding an element to this bin
* @elem_name: name of the element to be created
* @instance_name: name of the instance of the element to be created
*
* Creates an element according to given name and
* adds it to given @bin. Looks for an unconnected src pad
* from the @bin and links the element to it.
*
* Returns: pointer to the new element if successful, NULL otherwise.
*/
GstElement *
gst_camerabin_create_and_add_element (GstBin * bin, const gchar * elem_name,
const gchar * instance_name)
{
GstElement *new_elem;
g_return_val_if_fail (bin, FALSE);
g_return_val_if_fail (elem_name, FALSE);
if (strcmp (elem_name, "input-selector") == 0) {
/* we ship our own copy of input-selector because we still use the
* "select-all" property which was removed when input-selector was
* moved to core */
new_elem = g_object_new (GST_TYPE_INPUT_SELECTOR, NULL);
} else {
new_elem = gst_element_factory_make (elem_name, NULL);
}
if (!new_elem) {
GST_ELEMENT_ERROR (bin, CORE, MISSING_PLUGIN, (NULL),
("could not create \"%s\" element.", elem_name));
} else if (!gst_camerabin_add_element (bin, new_elem)) {
new_elem = NULL;
}
return new_elem;
}
/* try to change the state of an element. This function returns the element when
* the state change could be performed. When this function returns NULL an error
* occured and the element is unreffed if @unref is TRUE. */
static GstElement *
try_element (GstElement * bin, GstElement * element, gboolean unref)
{
GstStateChangeReturn ret;
if (element) {
ret = gst_element_set_state (element, GST_STATE_READY);
if (ret == GST_STATE_CHANGE_FAILURE) {
GST_DEBUG_OBJECT (bin, "failed state change..");
gst_element_set_state (element, GST_STATE_NULL);
if (unref)
gst_object_unref (element);
element = NULL;
}
}
return element;
}
GstElement *
gst_camerabin_setup_default_element (GstBin * bin, GstElement * user_elem,
const gchar * auto_elem_name, const gchar * default_elem_name)
{
GstElement *elem;
if (user_elem) {
GST_DEBUG_OBJECT (bin, "trying configured element");
elem = try_element (GST_ELEMENT_CAST (bin), user_elem, FALSE);
} else {
/* only try fallback if no specific sink was chosen */
GST_DEBUG_OBJECT (bin, "trying %s", auto_elem_name);
elem = gst_element_factory_make (auto_elem_name, NULL);
elem = try_element (GST_ELEMENT_CAST (bin), elem, TRUE);
if (elem == NULL) {
/* if default sink from config.h is different then try it too */
if (strcmp (default_elem_name, auto_elem_name)) {
GST_DEBUG_OBJECT (bin, "trying %s", default_elem_name);
elem = gst_element_factory_make (default_elem_name, NULL);
elem = try_element (GST_ELEMENT_CAST (bin), elem, TRUE);
}
}
}
return elem;
}
/**
* gst_camerabin_remove_elements_from_bin:
* @bin: removes all elements from this bin
*
* Removes all elements from this @bin.
*/
void
gst_camerabin_remove_elements_from_bin (GstBin * bin)
{
GstIterator *iter = NULL;
gpointer data = NULL;
GstElement *elem = NULL;
gboolean done = FALSE;
iter = gst_bin_iterate_elements (bin);
while (!done) {
switch (gst_iterator_next (iter, &data)) {
case GST_ITERATOR_OK:
elem = GST_ELEMENT (data);
gst_bin_remove (bin, elem);
gst_element_set_state (GST_ELEMENT (elem), GST_STATE_NULL);
/* Iterator increased the element refcount, so unref */
gst_object_unref (elem);
break;
case GST_ITERATOR_RESYNC:
gst_iterator_resync (iter);
break;
case GST_ITERATOR_ERROR:
GST_WARNING_OBJECT (bin, "error in iterating elements");
done = TRUE;
break;
case GST_ITERATOR_DONE:
done = TRUE;
break;
}
}
gst_iterator_free (iter);
}
/**
* gst_camerabin_drop_eos_probe:
* @pad: pad receiving the event
* @event: received event
* @u_data: not used
*
* Event probe that drop all eos events.
*
* Returns: FALSE to drop the event, TRUE otherwise
*/
gboolean
gst_camerabin_drop_eos_probe (GstPad * pad, GstEvent * event, gpointer u_data)
{
gboolean ret = TRUE;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
GST_DEBUG ("dropping eos in %s:%s", GST_DEBUG_PAD_NAME (pad));
ret = FALSE;
break;
default:
break;
}
return ret;
}
/*
* GStreamer
* Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __CAMERABIN_GENERAL_H_
#define __CAMERABIN_GENERAL_H_
#include <gst/gst.h>
gboolean gst_camerabin_try_add_element (GstBin * bin, GstElement * new_elem);
gboolean gst_camerabin_add_element (GstBin * bin, GstElement * new_elem);
GstElement *gst_camerabin_create_and_add_element (GstBin * bin, const gchar * elem_name, const gchar * instance_name);
GstElement * gst_camerabin_setup_default_element (GstBin * bin, GstElement *user_elem, const gchar *auto_elem_name, const gchar *default_elem_name);
void gst_camerabin_remove_elements_from_bin (GstBin * bin);
gboolean gst_camerabin_drop_eos_probe (GstPad * pad, GstEvent * event, gpointer u_data);
#endif /* #ifndef __CAMERABIN_GENERAL_H_ */
This diff is collapsed.
/*
* GStreamer
* Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __CAMERABIN_IMAGE_H__