Commit a6f4df46 authored by Stefan Kost's avatar Stefan Kost

gst/autodetect/: Implement src plugins. Little code/string cleanup in the sinks.

Original commit message from CVS:
* gst/autodetect/Makefile.am:
* gst/autodetect/gstautoaudiosink.c:
* gst/autodetect/gstautoaudiosrc.c:
* gst/autodetect/gstautoaudiosrc.h:
* gst/autodetect/gstautodetect.c:
* gst/autodetect/gstautovideosink.c:
* gst/autodetect/gstautovideosrc.c:
* gst/autodetect/gstautovideosrc.h:
Implement src plugins. Little code/string cleanup in the sinks.
Fixes #523813.
parent 40d198cf
2008-10-27 Stefan Kost <ensonic@users.sf.net>
* gst/autodetect/Makefile.am:
* gst/autodetect/gstautoaudiosink.c:
* gst/autodetect/gstautoaudiosrc.c:
* gst/autodetect/gstautoaudiosrc.h:
* gst/autodetect/gstautodetect.c:
* gst/autodetect/gstautovideosink.c:
* gst/autodetect/gstautovideosrc.c:
* gst/autodetect/gstautovideosrc.h:
Implement src plugins. Little code/string cleanup in the sinks.
Fixes #523813.
2008-10-27 Sebastian Dröge <sebastian.droege@collabora.co.uk>
Patch by: Peter Kjellerstedt <pkj at axis com>
......
......@@ -2,13 +2,17 @@ plugin_LTLIBRARIES = libgstautodetect.la
libgstautodetect_la_SOURCES = \
gstautoaudiosink.c \
gstautoaudiosrc.c \
gstautodetect.c \
gstautovideosink.c
gstautovideosink.c \
gstautovideosrc.c
libgstautodetect_la_CFLAGS = $(GST_CFLAGS)
libgstautodetect_la_LIBADD = $(GST_LIBS)
libgstautodetect_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = \
gstautoaudiosink.h \
gstautoaudiosrc.h \
gstautodetect.h \
gstautovideosink.h
gstautovideosink.h \
gstautovideosrc.h
......@@ -22,19 +22,16 @@
* SECTION:element-autoaudiosink
* @see_also: autovideosink, alsasink, osssink
*
* <refsect2>
* <para>
* autoaudiosink is an audio sink that automatically detects an appropriate
* audio sink to use. It does so by scanning the registry for all elements
* that have <quote>Sink</quote> and <quote>Audio</quote> in the class field
* of their element information, and also have a non-zero autoplugging rank.
* </para>
*
* <refsect2>
* <title>Example launch line</title>
* <para>
* <programlisting>
* |[
* gst-launch -v -m audiotestsrc ! audioconvert ! audioresample ! autoaudiosink
* </programlisting>
* </para>
* ]|
* </refsect2>
*/
......@@ -71,7 +68,7 @@ GST_ELEMENT_DETAILS ("Auto audio sink",
"Sink/Audio",
"Wrapper audio sink for automatically detected audio sink",
"Ronald Bultje <rbultje@ronald.bitfreak.net>\n"
"Jan Schmidt <thaytan@noraisin.net");
"Jan Schmidt <thaytan@noraisin.net>");
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
......@@ -349,9 +346,8 @@ gst_auto_audio_sink_detect (GstAutoAudioSink * sink)
/* find element */
GST_DEBUG_OBJECT (sink, "Creating new kid");
if (!(esink = gst_auto_audio_sink_find_best (sink))) {
return FALSE;
}
if (!(esink = gst_auto_audio_sink_find_best (sink)))
goto no_sink;
sink->kid = esink;
/* Ensure the child is brought up to the right state to match the parent
......@@ -370,6 +366,14 @@ gst_auto_audio_sink_detect (GstAutoAudioSink * sink)
GST_DEBUG_OBJECT (sink, "done changing auto audio sink");
return TRUE;
/* ERRORS */
no_sink:
{
GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL),
("Failed to find a supported audio sink"));
return FALSE;
}
}
static GstStateChangeReturn
......
This diff is collapsed.
/* GStreamer
* (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* (c) 2008 Stefan Kost <ensonic@users.sf.net>
*
* 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 __GST_AUTO_AUDIO_SRC_H__
#define __GST_AUTO_AUDIO_SRC_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_AUTO_AUDIO_SRC \
(gst_auto_audio_src_get_type ())
#define GST_AUTO_AUDIO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AUTO_AUDIO_SRC, \
GstAutoAudioSrc))
#define GST_AUTO_AUDIO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_AUTO_AUDIO_SRC, \
GstAutoAudioSrcClass))
#define GST_IS_AUTO_AUDIO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AUTO_AUDIO_SRC))
#define GST_IS_AUTO_AUDIO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_AUDIO_SRC))
typedef struct _GstAutoAudioSrc {
GstBin parent;
/* explicit pointers to stuff used */
GstPad *pad;
GstElement *kid;
GstCaps *filter_caps;
} GstAutoAudioSrc;
typedef struct _GstAutoAudioSrcClass {
GstBinClass parent_class;
} GstAutoAudioSrcClass;
GType gst_auto_audio_src_get_type (void);
G_END_DECLS
#endif /* __GST_AUTO_AUDIO_SRC_H__ */
......@@ -25,7 +25,9 @@
#include "gstautodetect.h"
#include "gstautoaudiosink.h"
#include "gstautoaudiosrc.h"
#include "gstautovideosink.h"
#include "gstautovideosrc.h"
GST_DEBUG_CATEGORY (autodetect_debug);
......@@ -37,12 +39,16 @@ plugin_init (GstPlugin * plugin)
return gst_element_register (plugin, "autovideosink",
GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_SINK) &&
gst_element_register (plugin, "autovideosrc",
GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_SRC) &&
gst_element_register (plugin, "autoaudiosink",
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SINK);
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SINK) &&
gst_element_register (plugin, "autoaudiosrc",
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SRC);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"autodetect",
"Plugin contains auto-detection plugins for video/audio outputs",
"Plugin contains auto-detection plugins for video/audio in- and outputs",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
......@@ -22,19 +22,16 @@
* SECTION:element-autovideosink
* @see_also: autoaudiosink, ximagesink, xvimagesink, sdlvideosink
*
* <refsect2>
* <para>
* autovideosink is a video sink that automatically detects an appropriate
* video sink to use. It does so by scanning the registry for all elements
* that have <quote>Sink</quote> and <quote>Video</quote> in the class field
* of their element information, and also have a non-zero autoplugging rank.
* </para>
*
* <refsect2>
* <title>Example launch line</title>
* <para>
* <programlisting>
* |[
* gst-launch -v -m videotestsrc ! autovideosink
* </programlisting>
* </para>
* ]|
* </refsect2>
*/
......@@ -72,7 +69,7 @@ GST_ELEMENT_DETAILS ("Auto video sink",
"Sink/Video",
"Wrapper video sink for automatically detected video sink",
"Ronald Bultje <rbultje@ronald.bitfreak.net>\n"
"Jan Schmidt <thaytan@noraisin.net");
"Jan Schmidt <thaytan@noraisin.net>");
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
......
This diff is collapsed.
/* GStreamer
* (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* (c) 2008 Stefan Kost <ensonic@users.sf.net>
*
* 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 __GST_AUTO_VIDEO_SRC_H__
#define __GST_AUTO_VIDEO_SRC_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_AUTO_VIDEO_SRC \
(gst_auto_video_src_get_type ())
#define GST_AUTO_VIDEO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AUTO_VIDEO_SRC, \
GstAutoVideoSrc))
#define GST_AUTO_VIDEO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_AUTO_VIDEO_SRC, \
GstAutoVideoSrcClass))
#define GST_IS_AUTO_VIDEO_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AUTO_VIDEO_SRC))
#define GST_IS_AUTO_VIDEO_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AUTO_VIDEO_SRC))
typedef struct _GstAutoVideoSrc {
GstBin parent;
/* explicit pointers to stuff used */
GstPad *pad;
GstElement *kid;
GstCaps *filter_caps;
} GstAutoVideoSrc;
typedef struct _GstAutoVideoSrcClass {
GstBinClass parent_class;
} GstAutoVideoSrcClass;
GType gst_auto_video_src_get_type (void);
G_END_DECLS
#endif /* __GST_AUTO_VIDEO_SRC_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment