hacking. Removed autoplug in the process.

Original commit message from CVS:
hacking.  Removed autoplug in the process.
This commit is contained in:
David Schleef 2003-11-12 01:33:15 +00:00
parent 4d68317c85
commit fc7f7b475a
32 changed files with 272 additions and 1018 deletions

View file

@ -19,7 +19,7 @@ then
fi
. common/gst-autogen.sh
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-failing-tests --enable-poisoning'
CONFIGURE_DEF_OPT='--disable-static --enable-maintainer-mode --enable-plugin-builddir --enable-failing-tests --enable-poisoning'
autogen_options $@

View file

@ -4,19 +4,12 @@ else
GST_LOADSAVE_DIRS = xml typefind
endif
if GST_DISABLE_AUTOPLUG
GST_AUTOPLUG_DIRS =
else
GST_AUTOPLUG_DIRS = autoplug helloworld2
endif
SUBDIRS = $(GST_AUTOPLUG_DIRS) $(GST_LOADSAVE_DIRS) \
SUBDIRS = $(GST_LOADSAVE_DIRS) \
helloworld \
queue queue2 queue3 queue4 \
launch thread plugins mixer cutter pingpong manual
DIST_SUBDIRS = autoplug \
helloworld helloworld2 \
DIST_SUBDIRS = helloworld helloworld2 \
queue queue2 queue3 queue4 \
launch thread xml plugins typefind mixer cutter pingpong manual

View file

@ -1,7 +1,7 @@
#include <gst/gst.h>
void
type_found (GstElement *typefind, GstCaps* caps)
type_found (GstElement *typefind, const GstCaps2 * caps)
{
xmlDocPtr doc;
xmlNodePtr parent;
@ -10,7 +10,8 @@ type_found (GstElement *typefind, GstCaps* caps)
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
gst_caps_save_thyself (caps, parent);
/* FIXME */
//gst_caps2_save_thyself (caps, parent);
xmlDocDump (stdout, doc);
}

View file

@ -15,14 +15,6 @@ else
GST_LOADSAVE_SRC = gstxml.c
endif
if GST_DISABLE_AUTOPLUG
GST_AUTOPLUG_SRC =
GST_AUTOPLUG_DIRS =
else
GST_AUTOPLUG_SRC = gstautoplug.c
GST_AUTOPLUG_DIRS = autoplug
endif
if GST_DISABLE_PARSE
GST_PARSE_SRC =
GST_PARSE_DIRS =
@ -75,9 +67,9 @@ else
GST_URI_SRC = gsturi.c
endif
EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = gstcpuid_i386.s gstmarshal.list gstxml.c gstparse.c gstautoplug.c gsttrace.c
EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = gstcpuid_i386.s gstmarshal.list gstxml.c gstparse.c gsttrace.c
SUBDIRS = $(GST_PARSE_DIRS) $(GST_REGISTRY_DIRS) . $(GST_AUTOPLUG_DIRS) elements schedulers $(GST_INDEX_DIRS)
SUBDIRS = $(GST_PARSE_DIRS) $(GST_REGISTRY_DIRS) . elements schedulers $(GST_INDEX_DIRS)
DIST_SUBDIRS = autoplug elements parse registries schedulers indexers
libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
@ -86,11 +78,9 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
$(GST_ENUMTYPES_SRC) \
gstobject.c \
gstatomic.c \
$(GST_AUTOPLUG_SRC) \
gstbin.c \
gstbuffer.c \
gstbufferpool-default.c \
gstcaps.c \
gstcaps2.c \
gstclock.c \
gstcpu.c \
@ -109,7 +99,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gstplugin.c \
gstpluginfeature.c \
gstprobe.c \
gstprops.c \
gstqueue.c \
gstquery.c \
gstscheduler.c \
@ -148,11 +137,9 @@ gst_headers = \
gst.h \
gstatomic.h \
gstobject.h \
gstautoplug.h \
gstbin.h \
gstbuffer.h \
gstbufferpool-default.h \
gstcaps.h \
gstcaps2.h \
gstclock.h \
gstcompat.h \
@ -173,7 +160,6 @@ gst_headers = \
gstplugin.h \
gstpluginfeature.h \
gstprobe.h \
gstprops.h \
gstqueue.h \
gstquery.h \
gstscheduler.h \

View file

@ -1,32 +1,8 @@
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = \
libgststaticautoplug.la \
libgststaticautoplugrender.la \
libgstautoplugcache.la \
libgstautoplugger.la \
libgstspider.la
libgststaticautoplug_la_SOURCES = gststaticautoplug.c
libgststaticautoplug_la_CFLAGS = $(GST_CFLAGS)
libgststaticautoplug_la_LIBADD =
libgststaticautoplug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgststaticautoplugrender_la_SOURCES = gststaticautoplugrender.c
libgststaticautoplugrender_la_CFLAGS = $(GST_CFLAGS)
libgststaticautoplugrender_la_LIBADD =
libgststaticautoplugrender_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstautoplugcache_la_SOURCES = gstautoplugcache.c
libgstautoplugcache_la_CFLAGS = $(GST_CFLAGS)
libgstautoplugcache_la_LIBADD =
libgstautoplugcache_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstautoplugger_la_SOURCES = gstautoplugger.c
libgstautoplugger_la_CFLAGS = $(GST_CFLAGS)
libgstautoplugger_la_LIBADD =
libgstautoplugger_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstspider_la_SOURCES = \
gstspider.c gstspideridentity.c \
gstsearchfuncs.c
@ -34,13 +10,9 @@ libgstspider_la_CFLAGS = $(GST_CFLAGS)
libgstspider_la_LIBADD =
libgstspider_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gststaticautoplug.h gststaticautoplugrender.h \
gstspider.h gstspideridentity.h gstsearchfuncs.h
noinst_HEADERS = gstspider.h gstsearchfuncs.h
noinst_PROGRAMS = autoplugtest spidertest
autoplugtest_CFLAGS = $(GST_CFLAGS)
autoplugtest_LDADD = $(GST_LIBS)
noinst_PROGRAMS = spidertest
spidertest_SOURCES = spidertest.c
spidertest_CFLAGS = $(GST_CFLAGS)

View file

@ -58,9 +58,9 @@ struct _GstAutoplugger {
GstPad *typefind_sinkpad;
GstPad *sinkpadpeer, *srcpadpeer;
GstCaps *sinkcaps, *srccaps;
GstCaps2 *sinkcaps, *srccaps;
GstCaps *sinktemplatecaps;
GstCaps2 *sinktemplatecaps;
GstAutoplug *autoplug;
GstElement *autobin;
@ -93,8 +93,8 @@ static void gst_autoplugger_get_property (GObject *object, guint prop_id, GVa
/*
static void gst_autoplugger_external_sink_caps_changed (GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger);
static void gst_autoplugger_external_src_caps_changed (GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger);
static void gst_autoplugger_external_sink_caps_changed (GstPad *pad, GstCaps2 *caps, GstAutoplugger *autoplugger);
static void gst_autoplugger_external_src_caps_changed (GstPad *pad, GstCaps2 *caps, GstAutoplugger *autoplugger);
*/
static void gst_autoplugger_external_sink_caps_nego_failed (GstPad *pad, gboolean *result, GstAutoplugger *autoplugger);
static void gst_autoplugger_external_src_caps_nego_failed (GstPad *pad, gboolean *result, GstAutoplugger *autoplugger);
@ -104,7 +104,7 @@ static void gst_autoplugger_external_src_linked (GstPad *pad, GstPad *peerpad,
*/
static void gst_autoplugger_cache_first_buffer (GstElement *element,GstBuffer *buf,GstAutoplugger *autoplugger);
static void gst_autoplugger_cache_empty (GstElement *element, GstAutoplugger *autoplugger);
static void gst_autoplugger_type_find_have_type (GstElement *element, GstCaps *caps, GstAutoplugger *autoplugger);
static void gst_autoplugger_type_find_have_type (GstElement *element, GstCaps2 *caps, GstAutoplugger *autoplugger);
static GstElementClass *parent_class = NULL;
/*static guint gst_autoplugger_signals[LAST_SIGNAL] = { 0 };*/
@ -213,7 +213,7 @@ G_GNUC_UNUSED static void
gst_autoplugger_external_sink_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger)
{
GstPadTemplate *peertemplate;
GstCaps *peercaps, *peertemplatecaps;
GstCaps2 *peercaps, *peertemplatecaps;
GST_INFO ("have cache:sink linked");*/
/* autoplugger->sinkpadpeer = peerpad; */
@ -222,13 +222,13 @@ gst_autoplugger_external_sink_linked(GstPad *pad, GstPad *peerpad, GstAutoplugge
peercaps = GST_PAD_CAPS(autoplugger->sinkpadpeer);
if (peercaps)
GST_INFO ("there are some caps on this pad's peer: %s",
gst_caps_get_mime(peercaps));
gst_caps2_get_mime(peercaps));
peertemplate = GST_PAD_PAD_TEMPLATE(autoplugger->sinkpadpeer);
if (peertemplate) {
peertemplatecaps = GST_PAD_TEMPLATE_CAPS(peertemplate);
if (peertemplatecaps) {
GST_INFO ("there are some caps on this pad's peer's padtemplate %s",
gst_caps_get_mime(peertemplatecaps));
gst_caps2_get_mime(peertemplatecaps));
}
}
}
@ -238,7 +238,7 @@ G_GNUC_UNUSED static void
gst_autoplugger_external_src_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger *autoplugger)
{
GstPadTemplate *peertemplate;
GstCaps *peercaps, *peertemplatecaps;
GstCaps2 *peercaps, *peertemplatecaps;
GST_INFO ("have cache:src linked");*/
/* autoplugger->srcpadpeer = peerpad; */
@ -247,13 +247,13 @@ gst_autoplugger_external_src_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger
peercaps = GST_PAD_CAPS(autoplugger->srcpadpeer);
if (peercaps)
GST_INFO ("there are some caps on this pad's peer: %s",
gst_caps_get_mime(peercaps));
gst_caps2_get_mime(peercaps));
peertemplate = GST_PAD_PAD_TEMPLATE(autoplugger->srcpadpeer);
if (peertemplate) {
peertemplatecaps = GST_PAD_TEMPLATE_CAPS(peertemplate);
if (peertemplatecaps) {
GST_INFO ("there are some caps on this pad's peer's padtemplate %s",
gst_caps_get_mime(peertemplatecaps));
gst_caps2_get_mime(peertemplatecaps));
autoplugger->sinktemplatecaps = peertemplatecaps;*/
/* GST_DEBUG ("turning on caps nego proxying in cache"); */
/* gtk_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);*/
@ -265,31 +265,31 @@ gst_autoplugger_external_src_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger
/*
static void
gst_autoplugger_external_sink_caps_changed(GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger)
gst_autoplugger_external_sink_caps_changed(GstPad *pad, GstCaps2 *caps, GstAutoplugger *autoplugger)
{
GST_INFO ("have cache:sink caps of %s\n",gst_caps_get_mime(caps));
GST_INFO ("have cache:sink caps of %s\n",gst_caps2_get_mime(caps));
autoplugger->sinkcaps = caps;
}
static void
gst_autoplugger_external_src_caps_changed(GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger)
gst_autoplugger_external_src_caps_changed(GstPad *pad, GstCaps2 *caps, GstAutoplugger *autoplugger)
{
GST_INFO ("have cache:src caps of %s\n",gst_caps_get_mime(caps));
GST_INFO ("have cache:src caps of %s\n",gst_caps2_get_mime(caps));
autoplugger->srccaps = caps;
}
*/
static gboolean
gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps *srccaps,GstCaps *sinkcaps)
gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps2 *srccaps,GstCaps2 *sinkcaps)
{
GstPad *sinkpad;
sinkpad = GST_PAD(GST_PAD_PEER(srcpad));
GST_DEBUG ("unlinking %s:%s and %s:%s to autoplug between them",
GST_DEBUG_PAD_NAME(srcpad),GST_DEBUG_PAD_NAME(sinkpad));
GST_DEBUG ("srcpadcaps are of type %s",gst_caps_get_mime(srccaps));
GST_DEBUG ("sinkpadcaps are of type %s",gst_caps_get_mime(sinkcaps));
GST_DEBUG ("srcpadcaps are of type %s",gst_caps2_get_mime(srccaps));
GST_DEBUG ("sinkpadcaps are of type %s",gst_caps2_get_mime(sinkcaps));
/* unlink the pads */
GST_DEBUG ("unlinking the pads that will be joined by an autobin");
@ -333,9 +333,9 @@ gst_autoplugger_external_sink_caps_nego_failed(GstPad *pad, gboolean *result, Gs
{
GstPad *srcpad_peer;
GstPadTemplate *srcpad_peer_template;
GstCaps *srcpad_peer_caps;
GstCaps2 *srcpad_peer_caps;
GstPad *sinkpad_peer;
GstCaps *sinkpad_peer_caps;
GstCaps2 *sinkpad_peer_caps;
GST_INFO ("have caps nego failure on sinkpad %s:%s!!!",GST_DEBUG_PAD_NAME(pad));
@ -370,10 +370,10 @@ gst_autoplugger_external_sink_caps_nego_failed(GstPad *pad, gboolean *result, Gs
static void
gst_autoplugger_external_src_caps_nego_failed(GstPad *pad, gboolean *result, GstAutoplugger *autoplugger)
{
GstCaps *srcpad_caps;
GstCaps2 *srcpad_caps;
GstPad *srcpad_peer;
GstPadTemplate *srcpad_peer_template;
GstCaps *srcpad_peer_caps;
GstCaps2 *srcpad_peer_caps;
GST_INFO ("have caps nego failure on srcpad %s:%s!!!",GST_DEBUG_PAD_NAME(pad));
@ -443,9 +443,9 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger)
}
static void
gst_autoplugger_type_find_have_type(GstElement *element, GstCaps *caps, GstAutoplugger *autoplugger)
gst_autoplugger_type_find_have_type(GstElement *element, GstCaps2 *caps, GstAutoplugger *autoplugger)
{
GST_INFO ("typefind claims to have a type: %s",gst_caps_get_mime(caps));
GST_INFO ("typefind claims to have a type: %s",gst_caps2_get_mime(caps));
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));

View file

@ -58,23 +58,23 @@ g_list_free_list_and_elements (GList *list)
* Returns: TRUE, if both caps intersect.
*/
gboolean
gst_autoplug_caps_intersect (GstCaps *src, GstCaps *sink)
gst_autoplug_caps_intersect (const GstCaps2 *src, const GstCaps2 *sink)
{
GstCaps *caps;
GstCaps2 *caps;
/* if there are no caps, we can link */
if ((src == NULL) && (sink == NULL))
return TRUE;
/* get an intersection */
caps = gst_caps_intersect (src, sink);
caps = gst_caps2_intersect (src, sink);
/* if the caps can't link, there is no intersection */
if (caps == NULL)
return FALSE;
/* hurrah, we can link, now remove the intersection */
gst_caps_unref (caps);
gst_caps2_free (caps);
return TRUE;
}
@ -88,7 +88,7 @@ gst_autoplug_caps_intersect (GstCaps *src, GstCaps *sink)
* Returns: #GstPadTemplate that can connect to the given caps
*/
GstPadTemplate *
gst_autoplug_can_connect_src (GstElementFactory *fac, GstCaps *src)
gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps2 *src)
{
GList *templs;
@ -117,7 +117,7 @@ gst_autoplug_can_connect_src (GstElementFactory *fac, GstCaps *src)
* Returns: #GstPadTemplate that can connect to the given caps
*/
GstPadTemplate *
gst_autoplug_can_connect_sink (GstElementFactory *fac, GstCaps *sink)
gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps2 *sink)
{
GList *templs;
@ -125,7 +125,7 @@ gst_autoplug_can_connect_sink (GstElementFactory *fac, GstCaps *sink)
while (templs)
{
GstCaps *caps = GST_PAD_TEMPLATE_CAPS (templs->data);
GstCaps2 *caps = GST_PAD_TEMPLATE_CAPS (templs->data);
if ((GST_PAD_TEMPLATE_DIRECTION (templs->data) == GST_PAD_SRC) &&
gst_autoplug_caps_intersect (caps, sink))
{
@ -320,8 +320,8 @@ gst_autoplug_factories_at_most_templates(GList *factories, GstPadDirection dir,
*/
/**
* gst_autoplug_sp:
* @src_caps: a #GstCaps to plug from.
* @sink_caps: the #GstCaps to plug to.
* @src_caps: a #GstCaps2 to plug from.
* @sink_caps: the #GstCaps2 to plug to.
* @factories: a #GList containing all allowed #GstElementFactory entries.
*
* Finds the shortest path of elements that together make up a possible
@ -331,7 +331,7 @@ gst_autoplug_factories_at_most_templates(GList *factories, GstPadDirection dir,
* to get the shortest path.
*/
GList *
gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
gst_autoplug_sp (const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, GList *factories)
{
GList *factory_nodes = NULL;
guint curcost = GST_AUTOPLUG_MAX_COST; /* below this cost, there is no path */
@ -340,11 +340,9 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
g_return_val_if_fail (srccaps != NULL, NULL);
g_return_val_if_fail (sinkcaps != NULL, NULL);
GST_INFO ("attempting to autoplug via shortest path from %s to %s",
gst_caps_get_mime (srccaps), gst_caps_get_mime (sinkcaps));
GST_INFO ("attempting to autoplug via shortest path from %s to %s",
gst_caps2_to_string(srccaps), gst_caps2_to_string(sinkcaps));
gst_caps_debug (srccaps, "source caps");
gst_caps_debug (sinkcaps, "sink caps");
/* wrap all factories as GstAutoplugNode
* initialize the cost */
while (factories)

View file

@ -40,9 +40,9 @@ struct _GstAutoplugNode {
};
/* helper functions */
gboolean gst_autoplug_caps_intersect (GstCaps *src, GstCaps *sink);
GstPadTemplate * gst_autoplug_can_connect_src (GstElementFactory *fac, GstCaps *src);
GstPadTemplate * gst_autoplug_can_connect_sink (GstElementFactory *fac, GstCaps *sink);
gboolean gst_autoplug_caps_intersect (const GstCaps2 *src, const GstCaps2 *sink);
GstPadTemplate * gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps2 *src);
GstPadTemplate * gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps2 *sink);
GstPadTemplate * gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest);
gboolean gst_autoplug_factory_has_direction (GstElementFactory *fac, GstPadDirection dir);
#define gst_autoplug_factory_has_sink(fac) gst_autoplug_factory_has_direction((fac), GST_PAD_SINK)
@ -59,6 +59,6 @@ GList * gst_autoplug_factories_filters_with_sink_caps(GList *factories);
GList * gst_autoplug_factories_at_most_templates(GList *factories, GstPadDirection dir, guint maxtemplates);
/* shortest path algorithm */
GList * gst_autoplug_sp (GstCaps *src_caps, GstCaps *sink_caps, GList *factories);
GList * gst_autoplug_sp (const GstCaps2 *src_caps, const GstCaps2 *sink_caps, GList *factories);
#endif /* __GST_SEARCHFUNCS_H__ */

View file

@ -73,8 +73,8 @@ static void gst_spider_identity_init (GstSpiderIdentity *spider_identity);
/* functions set in pads, elements and stuff */
static void gst_spider_identity_chain (GstPad *pad, GstBuffer *buf);
static GstElementStateReturn gst_spider_identity_change_state (GstElement *element);
static GstPadLinkReturn gst_spider_identity_link (GstPad *pad, GstCaps *caps);
static GstCaps * gst_spider_identity_getcaps (GstPad *pad, GstCaps *caps);
static GstPadLinkReturn gst_spider_identity_link (GstPad *pad, const GstCaps2 *caps);
static GstCaps2 * gst_spider_identity_getcaps (GstPad *pad, const GstCaps2 *caps);
/* loop functions */
static void gst_spider_identity_dumb_loop (GstSpiderIdentity *ident);
static void gst_spider_identity_src_loop (GstSpiderIdentity *ident);
@ -227,7 +227,7 @@ gst_spider_identity_new_sink (gchar *name)
/* shamelessly stolen from gstqueue.c to get proxy links */
static GstPadLinkReturn
gst_spider_identity_link (GstPad *pad, GstCaps *caps)
gst_spider_identity_link (GstPad *pad, const GstCaps2 *caps)
{
GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
GstPad *otherpad;
@ -243,8 +243,8 @@ gst_spider_identity_link (GstPad *pad, GstCaps *caps)
return GST_PAD_LINK_OK;
}
static GstCaps*
gst_spider_identity_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2*
gst_spider_identity_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
GstPad *otherpad;
@ -413,7 +413,7 @@ gst_spider_identity_src_loop (GstSpiderIdentity *ident)
typedef struct {
GstBuffer *buffer;
guint best_probability;
GstCaps *caps;
GstCaps2 *caps;
} SpiderTypeFind;
guint8 *
spider_find_peek (gpointer data, gint64 offset, guint size)
@ -431,16 +431,16 @@ spider_find_peek (gpointer data, gint64 offset, guint size)
}
}
static void
spider_find_suggest (gpointer data, guint probability, GstCaps *caps)
spider_find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
{
SpiderTypeFind *find = (SpiderTypeFind *) data;
G_GNUC_UNUSED gchar *caps_str;
caps_str = gst_caps_to_string (caps);
caps_str = gst_caps2_to_string (caps);
GST_INFO ("suggest %u, %s", probability, caps_str);
g_free (caps_str);
if (probability > find->best_probability) {
gst_caps_replace (&find->caps, caps);
gst_caps2_replace (&find->caps, caps);
find->best_probability = probability;
}
}
@ -462,8 +462,8 @@ gst_spider_identity_sink_loop_type_finding (GstSpiderIdentity *ident)
find.buffer = GST_BUFFER (data);
/* maybe there are already valid caps now? */
if ((find.caps = gst_pad_get_caps (ident->sink)) != NULL) {
gst_caps_ref (find.caps); /* it's unrefed later below */
find.caps = gst_pad_get_caps (ident->sink);
if (find.caps != NULL) {
goto plug;
}
@ -502,8 +502,8 @@ end:
plug:
GST_INFO ("typefind function found caps");
g_assert (gst_pad_try_set_caps (ident->src, find.caps) > 0);
gst_caps_debug (find.caps, "spider starting caps");
gst_caps_unref (find.caps);
gst_caps2_debug (find.caps, "spider starting caps");
gst_caps2_free (find.caps);
if (type_list)
g_list_free (type_list);

View file

@ -53,7 +53,7 @@ struct _GstSpiderIdentity {
gboolean plugged;
/* Caps from typefinding */
GstCaps *caps;
GstCaps2 *caps;
};

View file

@ -40,7 +40,7 @@ typedef const GList* (*GstAutoplugListFunction) (gpointer data);
static void gst_static_autoplug_class_init (GstStaticAutoplugClass *klass);
static void gst_static_autoplug_init (GstStaticAutoplug *autoplug);
static GList* gst_autoplug_func (gpointer src, gpointer sink,
static GList* gst_autoplug_func (const gpointer src, const gpointer sink,
GstAutoplugListFunction list_function,
GstAutoplugCostFunction cost_function,
gpointer data);
@ -48,7 +48,7 @@ static GList* gst_autoplug_func (gpointer src, gpointer sink,
static GstElement* gst_static_autoplug_to_caps (GstAutoplug *autoplug,
GstCaps *srccaps, GstCaps *sinkcaps, va_list args);
const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, va_list args);
static GstAutoplugClass *parent_class = NULL;
@ -135,7 +135,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
if (srctemp->direction == GST_PAD_SRC &&
desttemp->direction == GST_PAD_SINK) {
if (gst_caps_is_always_compatible (gst_pad_template_get_caps (srctemp),
if (gst_caps2_is_always_compatible (gst_pad_template_get_caps (srctemp),
gst_pad_template_get_caps (desttemp))) {
GST_DEBUG ("factory \"%s\" can link with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
@ -169,7 +169,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
if (gst_pad_get_direction(sinkpad) == GST_PAD_SINK &&
!GST_PAD_IS_LINKED(sinkpad))
{
if (gst_caps_is_always_compatible (gst_pad_get_caps(pad), gst_pad_get_caps(sinkpad))) {
if (gst_caps2_is_always_compatible (gst_pad_get_caps(pad), gst_pad_get_caps(sinkpad))) {
gst_pad_link(pad, sinkpad);
GST_DEBUG ("gstpipeline: autolink pad \"%s\" in element %s <-> ", GST_PAD_NAME (pad),
GST_ELEMENT_NAME(src));
@ -193,7 +193,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
typedef struct {
GstElement *result;
GstCaps *endcap;
GstCaps2 *endcap;
gint i;
} dynamic_pad_struct;
@ -211,7 +211,7 @@ autoplug_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (pad);
pads = g_list_next (pads);
if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (templ), info->endcap)) {
if (gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (templ), info->endcap)) {
gchar *name;
name = g_strdup_printf ("src_%02d", info->i);
@ -256,8 +256,8 @@ gst_autoplug_element_factory_get_list (gpointer data)
}
typedef struct {
GstCaps *src;
GstCaps *sink;
const GstCaps2 *src;
const GstCaps2 *sink;
} caps_struct;
#define IS_CAPS(cap) (((cap) == caps->src) || (cap) == caps->sink)
@ -269,13 +269,13 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
gboolean res;
if (IS_CAPS (src) && IS_CAPS (dest)) {
res = gst_caps_is_always_compatible ((GstCaps *)src, (GstCaps *)dest);
res = gst_caps2_is_always_compatible ((GstCaps2 *)src, (GstCaps2 *)dest);
}
else if (IS_CAPS (src)) {
res = gst_element_factory_can_sink_caps ((GstElementFactory *)dest, (GstCaps *)src);
res = gst_element_factory_can_sink_caps ((GstElementFactory *)dest, (GstCaps2 *)src);
}
else if (IS_CAPS (dest)) {
res = gst_element_factory_can_src_caps ((GstElementFactory *)src, (GstCaps *)dest);
res = gst_element_factory_can_src_caps ((GstElementFactory *)src, (GstCaps2 *)dest);
}
else {
res = gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest);
@ -288,10 +288,10 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
}
static GstElement*
gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, va_list args)
gst_static_autoplug_to_caps (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, va_list args)
{
caps_struct caps;
GstCaps *capslist;
const GstCaps2 *capslist;
GstElement *result = NULL, *srcelement = NULL;
GList **factories;
GList *chains = NULL;
@ -315,20 +315,21 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
GST_INFO ("autoplugging two caps structures");
elements = gst_autoplug_func (caps.src, caps.sink,
gst_autoplug_element_factory_get_list,
gst_autoplug_caps_find_cost,
&caps);
elements = gst_autoplug_func ((const gpointer) caps.src,
(const gpointer)caps.sink,
gst_autoplug_element_factory_get_list,
gst_autoplug_caps_find_cost,
&caps);
if (elements) {
chains = g_list_append (chains, elements);
endcaps = g_list_append (endcaps, capslist);
endcaps = g_list_append (endcaps, (gpointer) capslist);
numsinks++;
}
else {
}
capslist = va_arg (args, GstCaps *);
capslist = va_arg (args, GstCaps2 *);
}
/*
@ -410,7 +411,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
GstPad *pad = GST_PAD (pads->data);
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (pad);
if (gst_caps_is_always_compatible (srccaps, GST_PAD_TEMPLATE_CAPS (templ))) {
if (gst_caps2_is_always_compatible (srccaps, GST_PAD_TEMPLATE_CAPS (templ))) {
gst_element_add_ghost_pad (result, pad, "sink");
break;
}
@ -463,7 +464,7 @@ differ:
* find a suitable pad to turn into a ghostpad
*/
{
GstCaps *endcap = (GstCaps *)(endcaps->data);
GstCaps2 *endcap = (GstCaps2 *)(endcaps->data);
const GList *pads = gst_element_get_pad_list (thesrcelement);
gboolean have_pad = FALSE;
endcaps = g_list_next (endcaps);
@ -475,7 +476,7 @@ differ:
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (pad);
pads = g_list_next (pads);
if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (templ), endcap)) {
if (gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (templ), endcap)) {
gchar *name;
name = g_strdup_printf ("src_%02d", i);
@ -586,7 +587,7 @@ gst_autoplug_dequeue (GList *queue, gpointer *iNode, gint *iDist, gpointer *iPre
}
static GList*
gst_autoplug_func (gpointer src, gpointer sink,
gst_autoplug_func (const gpointer src, const gpointer sink,
GstAutoplugListFunction list_function,
GstAutoplugCostFunction cost_function,
gpointer data)

View file

@ -40,7 +40,7 @@ typedef GList* (*GstAutoplugListFunction) (gpointer data);
static void gst_static_autoplug_render_class_init (GstStaticAutoplugRenderClass *klass);
static void gst_static_autoplug_render_init (GstStaticAutoplugRender *autoplug);
static GList* gst_autoplug_func (gpointer src, gpointer sink,
static GList* gst_autoplug_func (const gpointer src, const gpointer sink,
GstAutoplugListFunction list_function,
GstAutoplugCostFunction cost_function,
gpointer data);
@ -48,7 +48,7 @@ static GList* gst_autoplug_func (gpointer src, gpointer sink,
static GstElement* gst_static_autoplug_to_render (GstAutoplug *autoplug,
GstCaps *srccaps, GstElement *target, va_list args);
const GstCaps2 *srccaps, GstElement *target, va_list args);
static GstAutoplugClass *parent_class = NULL;
@ -122,7 +122,7 @@ GST_PLUGIN_DEFINE (
)
static GstPadTemplate*
gst_autoplug_match_caps (GstElementFactory *factory, GstPadDirection direction, GstCaps *caps)
gst_autoplug_match_caps (GstElementFactory *factory, GstPadDirection direction, const GstCaps2 *caps)
{
GList *templates;
@ -132,11 +132,11 @@ gst_autoplug_match_caps (GstElementFactory *factory, GstPadDirection direction,
GstPadTemplate *template = (GstPadTemplate *)templates->data;
if (template->direction == direction && direction == GST_PAD_SRC) {
if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (template), caps))
if (gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (template), caps))
return template;
}
else if (template->direction == direction && direction == GST_PAD_SINK) {
if (gst_caps_is_always_compatible (caps, GST_PAD_TEMPLATE_CAPS (template)))
if (gst_caps2_is_always_compatible (caps, GST_PAD_TEMPLATE_CAPS (template)))
return template;
}
templates = g_list_next (templates);
@ -165,7 +165,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
desttemps = g_list_next (desttemps);
if (desttemp->direction == GST_PAD_SINK && desttemp->presence != GST_PAD_REQUEST) {
if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (srctemp), GST_PAD_TEMPLATE_CAPS (desttemp))) {
if (gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (srctemp), GST_PAD_TEMPLATE_CAPS (desttemp))) {
GST_DEBUG ("factory \"%s\" can link with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return TRUE;
@ -255,8 +255,8 @@ gst_autoplug_element_factory_get_list (gpointer data)
}
typedef struct {
GstCaps *src;
GstCaps *sink;
const GstCaps2 *src;
const GstCaps2 *sink;
} caps_struct;
#define IS_CAPS(cap) (((cap) == caps->src) || (cap) == caps->sink)
@ -267,12 +267,12 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
gboolean res;
if (IS_CAPS (src) && IS_CAPS (dest)) {
res = gst_caps_is_always_compatible ((GstCaps *)src, (GstCaps *)dest);
res = gst_caps2_is_always_compatible ((GstCaps2 *)src, (GstCaps2 *)dest);
}
else if (IS_CAPS (src)) {
GstPadTemplate *templ;
templ = gst_autoplug_match_caps ((GstElementFactory *)dest, GST_PAD_SINK, (GstCaps *)src);
templ = gst_autoplug_match_caps ((GstElementFactory *)dest, GST_PAD_SINK, (GstCaps2 *)src);
if (templ && templ->presence != GST_PAD_REQUEST)
res = TRUE;
@ -283,7 +283,7 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
else if (IS_CAPS (dest)) {
GstPadTemplate *templ;
templ = gst_autoplug_match_caps ((GstElementFactory *)src, GST_PAD_SRC, (GstCaps *)dest);
templ = gst_autoplug_match_caps ((GstElementFactory *)src, GST_PAD_SRC, (GstCaps2 *)dest);
if (templ && templ->presence != GST_PAD_REQUEST)
res = TRUE;
@ -302,7 +302,8 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
}
static GstElement*
gst_static_autoplug_to_render (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, va_list args)
gst_static_autoplug_to_render (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, va_list args)
{
caps_struct caps;
GstElement *targetelement;
@ -337,7 +338,7 @@ gst_static_autoplug_to_render (GstAutoplug *autoplug, GstCaps *srccaps, GstEleme
GST_INFO ("autoplugging two caps structures");
elements = gst_autoplug_func (caps.src, caps.sink,
elements = gst_autoplug_func ((gpointer)caps.src, (gpointer)caps.sink,
gst_autoplug_element_factory_get_list,
gst_autoplug_caps_find_cost,
&caps);
@ -421,7 +422,7 @@ next:
GstPad *pad = GST_PAD (pads->data);
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (pad);
if (gst_caps_is_always_compatible (srccaps, GST_PAD_TEMPLATE_CAPS (templ))) {
if (gst_caps2_is_always_compatible (srccaps, GST_PAD_TEMPLATE_CAPS (templ))) {
gst_element_add_ghost_pad (result, pad, "sink");
break;
}
@ -604,7 +605,7 @@ gst_autoplug_dequeue (GList *queue, gpointer *iNode, gint *iDist, gpointer *iPre
}
static GList*
gst_autoplug_func (gpointer src, gpointer sink,
gst_autoplug_func (const gpointer src, const gpointer sink,
GstAutoplugListFunction list_function,
GstAutoplugCostFunction cost_function,
gpointer data)

View file

@ -507,9 +507,6 @@ init_post (void)
gst_scheduler_factory_get_type ();
gst_type_find_factory_get_type ();
gst_bin_get_type ();
#ifndef GST_DISABLE_AUTOPLUG
gst_autoplug_factory_get_type ();
#endif /* GST_DISABLE_AUTOPLUG */
#ifndef GST_DISABLE_INDEX
gst_index_factory_get_type ();
#endif /* GST_DISABLE_INDEX */
@ -528,8 +525,6 @@ init_post (void)
_gst_cpu_initialize (_gst_enable_cpu_opt);
_gst_structure_initialize ();
_gst_value_initialize ();
_gst_props_initialize ();
_gst_caps_initialize ();
_gst_caps2_initialize ();
_gst_plugin_initialize ();
_gst_event_initialize ();

View file

@ -42,11 +42,8 @@
#include <gst/gstpipeline.h>
#include <gst/gstthread.h>
#include <gst/gsttypefind.h>
#include <gst/gstautoplug.h>
#include <gst/gstcaps.h>
#include <gst/gstcaps2.h>
#include <gst/gststructure.h>
#include <gst/gstprops.h>
#include <gst/gstplugin.h>
#include <gst/gsturi.h>
#include <gst/gsturitype.h>

View file

@ -1,389 +0,0 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstautoplug.c: Autoplugging of pipelines
*
* 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.
*/
#include "gst_private.h"
#include <gst/gstconfig.h>
#include "gstautoplug.h"
#include "gstregistrypool.h"
#include "gstinfo.h"
enum {
NEW_OBJECT,
LAST_SIGNAL
};
enum {
ARG_0,
/* FILL ME */
};
static void gst_autoplug_class_init (GstAutoplugClass *klass);
static void gst_autoplug_init (GstAutoplug *autoplug);
static GstObjectClass *parent_class = NULL;
static guint gst_autoplug_signals[LAST_SIGNAL] = { 0 };
GType gst_autoplug_get_type(void)
{
static GType autoplug_type = 0;
if (!autoplug_type) {
static const GTypeInfo autoplug_info = {
sizeof(GstAutoplugClass),
NULL,
NULL,
(GClassInitFunc)gst_autoplug_class_init,
NULL,
NULL,
sizeof(GstAutoplug),
4,
(GInstanceInitFunc)gst_autoplug_init,
NULL
};
autoplug_type = g_type_register_static (GST_TYPE_OBJECT, "GstAutoplug", &autoplug_info, G_TYPE_FLAG_ABSTRACT);
}
return autoplug_type;
}
static void
gst_autoplug_class_init(GstAutoplugClass *klass)
{
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
gobject_class = (GObjectClass*) klass;
gstobject_class = (GstObjectClass*) klass;
parent_class = g_type_class_ref (GST_TYPE_OBJECT);
gst_autoplug_signals[NEW_OBJECT] =
g_signal_new ("new_object", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstAutoplugClass, new_object), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
GST_TYPE_OBJECT);
}
static void gst_autoplug_init(GstAutoplug *autoplug)
{
}
/**
* gst_autoplug_signal_new_object:
* @autoplug: The autoplugger to emit the signal
* @object: The object that is passed to the signal
*
* Emit a new_object signal. autopluggers are supposed to
* emit this signal whenever a new object has been added to
* the autoplugged pipeline.
*
*/
void
gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object)
{
g_signal_emit (G_OBJECT (autoplug), gst_autoplug_signals[NEW_OBJECT], 0, object);
}
/**
* gst_autoplug_to_caps:
* @autoplug: The autoplugger performing the autoplugging.
* @srccaps: The source capabilities.
* @sinkcaps: The target capabilities.
* @...: more target capabilities.
*
* Perform the autoplugging procedure on the given autoplugger.
* The src caps will be connected to the sink caps.
*
* Returns: A new #GstElement that connects the src caps to the sink caps.
*/
GstElement*
gst_autoplug_to_caps (GstAutoplug *autoplug, const GstCaps2 *srccaps,
const GstCaps2 *sinkcaps, ...)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
va_list args;
va_start (args, sinkcaps);
oclass = GST_AUTOPLUG_CLASS (G_OBJECT_GET_CLASS(autoplug));
if (oclass->autoplug_to_caps)
element = (oclass->autoplug_to_caps) (autoplug, srccaps, sinkcaps, args);
va_end (args);
return element;
}
/**
* gst_autoplug_to_caps_valist:
* @autoplug: The autoplugger performing the autoplugging.
* @srccaps: The source capabilities.
* @sinkcaps: The target capabilities.
* @va_list: more target capabilities.
*
* Perform the autoplugging procedure on the given autoplugger.
* The src caps will be connected to the sink caps.
*
* Returns: A new #GstElement that connects the src caps to the sink caps.
*/
GstElement*
gst_autoplug_to_caps_valist (GstAutoplug *autoplug, const GstCaps2 *srccaps,
const GstCaps2 *sinkcaps, va_list args)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
oclass = GST_AUTOPLUG_CLASS (G_OBJECT_GET_CLASS(autoplug));
if (oclass->autoplug_to_caps)
element = (oclass->autoplug_to_caps) (autoplug, srccaps, sinkcaps, args);
return element;
}
/**
* gst_autoplug_to_renderers:
* @autoplug: The autoplugger performing the autoplugging.
* @srccaps: The source capabilities.
* @target: The target element.
* @...: more target elements.
*
* Perform the autoplugging procedure on the given autoplugger.
* The src caps will be connected to the target elements.
*
* Returns: A new #GstElement that connects the src caps to the target elements.
*/
GstElement*
gst_autoplug_to_renderers (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, ...)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
va_list args;
va_start (args, target);
oclass = GST_AUTOPLUG_CLASS (G_OBJECT_GET_CLASS(autoplug));
if (oclass->autoplug_to_renderers)
element = (oclass->autoplug_to_renderers) (autoplug, srccaps, target, args);
va_end (args);
return element;
}
/**
* gst_autoplug_to_renderers_valist:
* @autoplug: The autoplugger performing the autoplugging.
* @srccaps: The source capabilities.
* @target: The target element.
* @va_list: more target elements.
*
* Perform the autoplugging procedure on the given autoplugger.
* The src caps will be connected to the target elements.
*
* Returns: A new #GstElement that connects the src caps to the target elements.
*/
GstElement*
gst_autoplug_to_renderers_valist (GstAutoplug *autoplug,
const GstCaps2 *srccaps, GstElement *target, va_list args)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
oclass = GST_AUTOPLUG_CLASS (G_OBJECT_GET_CLASS(autoplug));
if (oclass->autoplug_to_renderers)
element = (oclass->autoplug_to_renderers) (autoplug, srccaps, target, args);
return element;
}
static void gst_autoplug_factory_class_init (GstAutoplugFactoryClass *klass);
static void gst_autoplug_factory_init (GstAutoplugFactory *factory);
static GstPluginFeatureClass *factory_parent_class = NULL;
/* static guint gst_autoplug_factory_signals[LAST_SIGNAL] = { 0 }; */
GType
gst_autoplug_factory_get_type (void)
{
static GType autoplugfactory_type = 0;
if (!autoplugfactory_type) {
static const GTypeInfo autoplugfactory_info = {
sizeof (GstAutoplugFactoryClass),
NULL,
NULL,
(GClassInitFunc) gst_autoplug_factory_class_init,
NULL,
NULL,
sizeof(GstAutoplugFactory),
0,
(GInstanceInitFunc) gst_autoplug_factory_init,
NULL
};
autoplugfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
"GstAutoplugFactory", &autoplugfactory_info, 0);
}
return autoplugfactory_type;
}
static void
gst_autoplug_factory_class_init (GstAutoplugFactoryClass *klass)
{
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
GstPluginFeatureClass *gstpluginfeature_class;
gobject_class = (GObjectClass*)klass;
gstobject_class = (GstObjectClass*)klass;
gstpluginfeature_class = (GstPluginFeatureClass*) klass;
factory_parent_class = g_type_class_ref (GST_TYPE_PLUGIN_FEATURE);
}
static void
gst_autoplug_factory_init (GstAutoplugFactory *factory)
{
}
/**
* gst_autoplug_factory_new:
* @name: name of autoplugfactory to create
* @longdesc: long description of autoplugfactory to create
* @type: the gtk type of the GstAutoplug element of this factory
*
* Create a new autoplugfactory with the given parameters
*
* Returns: a new #GstAutoplugFactory.
*/
GstAutoplugFactory*
gst_autoplug_factory_new (const gchar *name, const gchar *longdesc, GType type)
{
GstAutoplugFactory *factory;
g_return_val_if_fail(name != NULL, NULL);
factory = gst_autoplug_factory_find (name);
if (!factory) {
factory = GST_AUTOPLUG_FACTORY (g_object_new (GST_TYPE_AUTOPLUG_FACTORY, NULL));
}
GST_PLUGIN_FEATURE_NAME (factory) = g_strdup (name);
if (factory->longdesc)
g_free (factory->longdesc);
factory->longdesc = g_strdup (longdesc);
factory->type = type;
return factory;
}
/**
* gst_autoplug_factory_destroy:
* @factory: factory to destroy
*
* Removes the autoplug from the global list.
*/
void
gst_autoplug_factory_destroy (GstAutoplugFactory *factory)
{
g_return_if_fail (factory != NULL);
/* we don't free the struct bacause someone might have a handle to it.. */
}
/**
* gst_autoplug_factory_find:
* @name: name of autoplugfactory to find
*
* Search for an autoplugfactory of the given name.
*
* Returns: #GstAutoplugFactory if found, NULL otherwise
*/
GstAutoplugFactory*
gst_autoplug_factory_find (const gchar *name)
{
GstPluginFeature *feature;
g_return_val_if_fail (name != NULL, NULL);
GST_DEBUG ("gstautoplug: find \"%s\"", name);
feature = gst_registry_pool_find_feature (name, GST_TYPE_AUTOPLUG_FACTORY);
if (feature)
return GST_AUTOPLUG_FACTORY (feature);
return NULL;
}
/**
* gst_autoplug_factory_create:
* @factory: the factory used to create the instance
*
* Create a new #GstAutoplug instance from the
* given autoplugfactory.
*
* Returns: A new #GstAutoplug instance.
*/
GstAutoplug*
gst_autoplug_factory_create (GstAutoplugFactory *factory)
{
GstAutoplug *new = NULL;
g_return_val_if_fail (factory != NULL, NULL);
if (gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory))) {
g_return_val_if_fail (factory->type != 0, NULL);
new = GST_AUTOPLUG (g_object_new(factory->type,NULL));
}
return new;
}
/**
* gst_autoplug_factory_make:
* @name: the name of the factory used to create the instance
*
* Create a new #GstAutoplug instance from the
* autoplugfactory with the given name.
*
* Returns: A new #GstAutoplug instance.
*/
GstAutoplug*
gst_autoplug_factory_make (const gchar *name)
{
GstAutoplugFactory *factory;
g_return_val_if_fail (name != NULL, NULL);
factory = gst_autoplug_factory_find (name);
if (factory == NULL)
return NULL;
return gst_autoplug_factory_create (factory);
}

View file

@ -1,148 +0,0 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstautoplug.h: Header for autoplugging functionality
*
* 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_AUTOPLUG_H__
#define __GST_AUTOPLUG_H__
#ifndef GST_DISABLE_AUTOPLUG
#include <gst/gstelement.h>
G_BEGIN_DECLS
#define GST_TYPE_AUTOPLUG \
(gst_autoplug_get_type())
#define GST_AUTOPLUG(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUG,GstAutoplug))
#define GST_AUTOPLUG_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUG,GstAutoplugClass))
#define GST_IS_AUTOPLUG(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUG))
#define GST_IS_AUTOPLUG_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUG))
typedef struct _GstAutoplug GstAutoplug;
typedef struct _GstAutoplugClass GstAutoplugClass;
typedef enum {
GST_AUTOPLUG_TO_CAPS = GST_OBJECT_FLAG_LAST,
GST_AUTOPLUG_TO_RENDERER,
GST_AUTOPLUG_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8
} GstAutoplugFlags;
struct _GstAutoplug {
GstObject object;
GST_OBJECT_PADDING
};
struct _GstAutoplugClass {
GstObjectClass parent_class;
/* signal callbacks */
void (*new_object) (GstAutoplug *autoplug, GstObject *object);
/* perform the autoplugging */
GstElement* (*autoplug_to_caps) (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, va_list args);
GstElement* (*autoplug_to_renderers) (GstAutoplug *autoplug, const GstCaps2 *srccaps, GstElement *target, va_list args);
GST_CLASS_PADDING
};
GType gst_autoplug_get_type (void);
void gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object);
GstElement* gst_autoplug_to_caps (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, ...);
GstElement* gst_autoplug_to_caps_valist (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, va_list args);
GstElement* gst_autoplug_to_renderers (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, ...);
GstElement* gst_autoplug_to_renderers_valist (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, va_list args);
/*
* creating autopluggers
*
*/
#define GST_TYPE_AUTOPLUG_FACTORY \
(gst_autoplug_factory_get_type())
#define GST_AUTOPLUG_FACTORY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUG_FACTORY,GstAutoplugFactory))
#define GST_AUTOPLUG_FACTORY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUG_FACTORY,GstAutoplugFactoryClass))
#define GST_IS_AUTOPLUG_FACTORY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUG_FACTORY))
#define GST_IS_AUTOPLUG_FACTORY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUG_FACTORY))
typedef struct _GstAutoplugFactory GstAutoplugFactory;
typedef struct _GstAutoplugFactoryClass GstAutoplugFactoryClass;
struct _GstAutoplugFactory {
GstPluginFeature feature;
gchar *longdesc; /* long description of the autoplugger (well, don't overdo it..) */
GType type; /* unique GType of the autoplugger */
};
struct _GstAutoplugFactoryClass {
GstPluginFeatureClass parent;
};
GType gst_autoplug_factory_get_type (void);
GstAutoplugFactory* gst_autoplug_factory_new (const gchar *name, const gchar *longdesc, GType type);
void gst_autoplug_factory_destroy (GstAutoplugFactory *factory);
GstAutoplugFactory* gst_autoplug_factory_find (const gchar *name);
GstAutoplug* gst_autoplug_factory_create (GstAutoplugFactory *factory);
GstAutoplug* gst_autoplug_factory_make (const gchar *name);
G_END_DECLS
#else /* GST_DISABLE_AUTOPLUG */
#pragma GCC poison gst_autoplug_get_type
#pragma GCC poison gst_autoplug_signal_new_object
#pragma GCC poison gst_autoplug_to_caps
#pragma GCC poison gst_autoplug_to_renderers
#pragma GCC poison gst_autoplug_factory_get_type
#pragma GCC poison gst_autoplug_factory_new
#pragma GCC poison gst_autoplug_factory_destroy
#pragma GCC poison gst_autoplug_factory_find
#pragma GCC poison gst_autoplug_factory_get_list
#pragma GCC poison gst_autoplug_factory_create
#pragma GCC poison gst_autoplug_factory_make
#endif /* GST_DISABLE_AUTOPLUG */
#endif /* __GST_AUTOPLUG_H__ */

View file

@ -36,10 +36,12 @@ extern GType _gst_caps_type;
#define GST_TYPE_CAPS (_gst_caps_type)
#if 0
typedef enum {
GST_CAPS_UNUSED = (1 << 0), /* unused flag */
GST_CAPS_FLOATING = (1 << 1) /* caps is floating */
} GstCapsFlags;
#endif
#define GST_CAPS(caps) ((GstCaps *)(caps))

View file

@ -91,6 +91,7 @@ GstCaps2 *gst_caps2_load_thyself (xmlNodePtr parent);
void gst_caps2_replace (GstCaps2 **caps, const GstCaps2 *newcaps);
gchar *gst_caps2_to_string (const GstCaps2 *caps);
GstCaps2 *gst_caps2_from_string (const gchar *string);
void gst_caps2_debug (const GstCaps2 *caps, const gchar *string);
G_END_DECLS

View file

@ -1844,7 +1844,7 @@ gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps)
* returns a floating caps, so use gst_caps2_free to get rid of
* it.
*/
const GstCaps2*
GstCaps2*
gst_pad_get_caps (GstPad *pad)
{
GstRealPad *realpad;
@ -1857,11 +1857,9 @@ gst_pad_get_caps (GstPad *pad)
GST_CAT_DEBUG (GST_CAT_CAPS, "get pad caps of %s:%s (%p)",
GST_DEBUG_PAD_NAME (realpad), realpad);
/* note that we will not _ref the caps here as this function might be
* called recursively */
if (GST_PAD_CAPS (realpad)) {
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad real caps %p", GST_PAD_CAPS (realpad));
return GST_PAD_CAPS (realpad);
return gst_caps2_copy (GST_PAD_CAPS (realpad));
}
else if GST_RPAD_GETCAPSFUNC (realpad) {
GstCaps2 *caps;
@ -1875,7 +1873,7 @@ gst_pad_get_caps (GstPad *pad)
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad);
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad template %p with caps %p",
templ, GST_PAD_TEMPLATE_CAPS (templ));
return GST_PAD_TEMPLATE_CAPS (templ);
return gst_caps2_copy (GST_PAD_TEMPLATE_CAPS (templ));
}
GST_CAT_DEBUG (GST_CAT_CAPS, "pad has no caps");

View file

@ -454,7 +454,7 @@ void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
GstPad* gst_pad_get_peer (GstPad *pad);
/* capsnego functions */
const GstCaps2* gst_pad_get_caps (GstPad *pad);
GstCaps2* gst_pad_get_caps (GstPad *pad);
const GstCaps2* gst_pad_get_pad_template_caps (GstPad *pad);
GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, const GstCaps2 *caps);
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);

View file

@ -37,6 +37,7 @@ extern GType _gst_props_type;
#define GST_TYPE_PROPS (_gst_props_type)
#if 0
typedef enum {
GST_PROPS_END_TYPE = 0,
@ -57,6 +58,7 @@ typedef enum {
GST_PROPS_LAST_TYPE = GST_PROPS_END_TYPE + 16
} GstPropsType;
#endif
#define GST_MAKE_FOURCC(a,b,c,d) (guint32)((a)|(b)<<8|(c)<<16|(d)<<24)
#define GST_STR_FOURCC(f) (guint32)(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))

View file

@ -265,7 +265,6 @@ gst_util_set_object_arg (GObject * object, const gchar * name, const gchar * val
*/
#include "gstpad.h"
#include "gstprops.h"
static void
string_append_indent (GString * str, gint count)
@ -276,6 +275,7 @@ string_append_indent (GString * str, gint count)
g_string_append_c (str, ' ');
}
#if 0
static void
gst_print_props (GString *buf, gint indent, GList *props, gboolean showname)
{
@ -371,6 +371,7 @@ gst_print_props (GString *buf, gint indent, GList *props, gboolean showname)
}
}
}
#endif
/**
* gst_print_pad_caps:

View file

@ -147,7 +147,7 @@ gst_value_lcopy_int_range (const GValue *value, guint n_collect_values,
void
gst_value_set_int_range (GValue *value, int start, int end)
{
g_return_if_fail (GST_VALUE_HOLDS_FOURCC (value));
g_return_if_fail (GST_VALUE_HOLDS_INT_RANGE (value));
value->data[0].v_long = start;
value->data[1].v_long = end;
@ -156,7 +156,7 @@ gst_value_set_int_range (GValue *value, int start, int end)
int
gst_value_get_int_range_min (const GValue *value)
{
g_return_val_if_fail (GST_VALUE_HOLDS_FOURCC (value), 0);
g_return_val_if_fail (GST_VALUE_HOLDS_INT_RANGE (value), 0);
return value->data[0].v_long;
}
@ -164,11 +164,100 @@ gst_value_get_int_range_min (const GValue *value)
int
gst_value_get_int_range_max (const GValue *value)
{
g_return_val_if_fail (GST_VALUE_HOLDS_FOURCC (value), 0);
g_return_val_if_fail (GST_VALUE_HOLDS_INT_RANGE (value), 0);
return value->data[1].v_long;
}
/* double range */
static void
gst_value_init_double_range (GValue *value)
{
value->data[0].v_double = 0;
value->data[1].v_double = 0;
}
static void
gst_value_copy_double_range (const GValue *src_value, GValue *dest_value)
{
dest_value->data[0].v_double = src_value->data[0].v_double;
dest_value->data[1].v_double = src_value->data[1].v_double;
}
static gchar *
gst_value_collect_double_range (GValue *value, guint n_collect_values,
GTypeCValue *collect_values, guint collect_flags)
{
/* FIXME */
value->data[0].v_double = collect_values[0].v_double;
value->data[1].v_double = collect_values[1].v_double;
return NULL;
}
static gchar *
gst_value_lcopy_double_range (const GValue *value, guint n_collect_values,
GTypeCValue *collect_values, guint collect_flags)
{
guint32 *double_range_p = collect_values[0].v_pointer;
/* FIXME */
if (!double_range_p)
return g_strdup_printf ("value location for `%s' passed as NULL",
G_VALUE_TYPE_NAME (value));
*double_range_p = value->data[0].v_double;
return NULL;
}
void
gst_value_set_double_range (GValue *value, double start, double end)
{
g_return_if_fail (GST_VALUE_HOLDS_DOUBLE_RANGE (value));
value->data[0].v_double = start;
value->data[1].v_double = end;
}
double
gst_value_get_double_range_min (const GValue *value)
{
g_return_val_if_fail (GST_VALUE_HOLDS_DOUBLE_RANGE (value), 0);
return value->data[0].v_double;
}
double
gst_value_get_double_range_max (const GValue *value)
{
g_return_val_if_fail (GST_VALUE_HOLDS_DOUBLE_RANGE (value), 0);
return value->data[1].v_double;
}
/* GstCaps */
void
gst_value_set_caps (GValue *value, const GstCaps2 *caps)
{
g_return_if_fail (GST_VALUE_HOLDS_CAPS (value));
value->data[0].v_pointer = gst_caps2_copy (caps);
}
const GstCaps2 *
gst_value_get_caps (const GValue *value)
{
g_return_val_if_fail (GST_VALUE_HOLDS_CAPS (value), 0);
return value->data[0].v_pointer;
}
/* fourcc */
static void
gst_value_transform_fourcc_string (const GValue *src_value,
GValue *dest_value)
@ -461,6 +550,21 @@ _gst_value_initialize (void)
gst_type_int_range = g_type_register_static (G_TYPE_BOXED, "GstIntRange", &info, 0);
}
{
static const GTypeValueTable value_table = {
gst_value_init_double_range,
NULL,
gst_value_copy_double_range,
NULL,
"i",
gst_value_collect_double_range,
"p",
gst_value_lcopy_double_range
};
info.value_table = &value_table;
gst_type_double_range = g_type_register_static (G_TYPE_BOXED, "GstIntRange", &info, 0);
}
g_value_register_transform_func (GST_TYPE_FOURCC, G_TYPE_STRING,
gst_value_transform_fourcc_string);
g_value_register_transform_func (GST_TYPE_INT_RANGE, G_TYPE_STRING,

View file

@ -31,7 +31,20 @@ typedef int (* GstValueUnionFunc) (GValue *dest, const GValue *value1,
typedef int (* GstValueIntersectFunc) (GValue *dest, const GValue *value1,
const GValue *value2);
#define GST_VALUE_HOLDS_FOURCC(x) TRUE
#define GST_MAKE_FOURCC(a,b,c,d) (guint32)((a)|(b)<<8|(c)<<16|(d)<<24)
#define GST_STR_FOURCC(f) (guint32)(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))
#define GST_FOURCC_FORMAT "%c%c%c%c"
#define GST_FOURCC_ARGS(fourcc) \
((gchar) ((fourcc) &0xff)), \
((gchar) (((fourcc)>>8 )&0xff)), \
((gchar) (((fourcc)>>16)&0xff)), \
((gchar) (((fourcc)>>24)&0xff))
#define GST_VALUE_HOLDS_FOURCC(x) (G_VALUE_TYPE(x) == gst_type_fourcc)
#define GST_VALUE_HOLDS_INT_RANGE(x) (G_VALUE_TYPE(x) == gst_type_int_range)
#define GST_VALUE_HOLDS_DOUBLE_RANGE(x) (G_VALUE_TYPE(x) == gst_type_double_range)
#define GST_VALUE_HOLDS_CAPS(x) TRUE /* FIXME */
#define GST_TYPE_FOURCC gst_type_fourcc
#define GST_TYPE_INT_RANGE gst_type_int_range
@ -54,8 +67,11 @@ int gst_value_get_int_range_min (const GValue *value);
int gst_value_get_int_range_max (const GValue *value);
void gst_value_set_double_range (GValue *value, double start, double end);
double gst_value_get_double_range_start (const GValue *value);
double gst_value_get_double_range_end (const GValue *value);
double gst_value_get_double_range_min (const GValue *value);
double gst_value_get_double_range_max (const GValue *value);
const GstCaps2 *gst_value_get_caps (const GValue *value);
void gst_value_set_caps (GValue *calue, const GstCaps2 *caps);
void _gst_value_initialize (void);

View file

@ -36,7 +36,6 @@
#include <gst/gstelement.h>
#include <gst/gsttypefind.h>
#include <gst/gstscheduler.h>
#include <gst/gstautoplug.h>
#include <gst/gsturi.h>
#include <gst/gstinfo.h>
@ -775,6 +774,7 @@ gst_xml_registry_parse_scheduler_factory (GMarkupParseContext *context, const gc
return TRUE;
}
#if 0
static gboolean
gst_xml_registry_parse_autoplug_factory (GMarkupParseContext *context, const gchar *tag, const gchar *text,
gsize text_len, GstXMLRegistry *registry, GError **error)
@ -789,6 +789,7 @@ gst_xml_registry_parse_autoplug_factory (GMarkupParseContext *context, const gch
}
return TRUE;
}
#endif
static gboolean
gst_xml_registry_parse_index_factory (GMarkupParseContext *context, const gchar *tag, const gchar *text,
@ -942,9 +943,11 @@ gst_xml_registry_start_element (GMarkupParseContext *context,
xmlregistry->parser = gst_xml_registry_parse_scheduler_factory;
GST_SCHEDULER_FACTORY (feature)->type = 0;
}
#if 0
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
xmlregistry->parser = gst_xml_registry_parse_autoplug_factory;
}
#endif
else if (GST_IS_INDEX_FACTORY (feature)) {
xmlregistry->parser = gst_xml_registry_parse_index_factory;
}
@ -1530,9 +1533,11 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe
else if (GST_IS_SCHEDULER_FACTORY (feature)) {
PUT_ESCAPED ("longdesc", GST_SCHEDULER_FACTORY (feature)->longdesc);
}
#if 0
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
PUT_ESCAPED ("longdesc", GST_AUTOPLUG_FACTORY (feature)->longdesc);
}
#endif
else if (GST_IS_INDEX_FACTORY (feature)) {
PUT_ESCAPED ("longdesc", GST_INDEX_FACTORY (feature)->longdesc);
}

View file

@ -23,7 +23,6 @@
#define __GST_DPARAM_H__
#include <gst/gstobject.h>
#include <gst/gstprops.h>
#include "dparamcommon.h"
G_BEGIN_DECLS

View file

@ -23,7 +23,6 @@
#define __GST_DPMAN_H__
#include <gst/gstobject.h>
#include <gst/gstprops.h>
#include <gst/control/dparamcommon.h>
#include <gst/control/dparam.h>
#include <gst/control/unitconvert.h>

View file

@ -4,19 +4,12 @@ else
GST_LOADSAVE_DIRS = xml typefind
endif
if GST_DISABLE_AUTOPLUG
GST_AUTOPLUG_DIRS =
else
GST_AUTOPLUG_DIRS = autoplug helloworld2
endif
SUBDIRS = $(GST_AUTOPLUG_DIRS) $(GST_LOADSAVE_DIRS) \
SUBDIRS = $(GST_LOADSAVE_DIRS) \
helloworld \
queue queue2 queue3 queue4 \
launch thread plugins mixer cutter pingpong manual
DIST_SUBDIRS = autoplug \
helloworld helloworld2 \
DIST_SUBDIRS = helloworld helloworld2 \
queue queue2 queue3 queue4 \
launch thread xml plugins typefind mixer cutter pingpong manual

View file

@ -1,7 +1,7 @@
#include <gst/gst.h>
void
type_found (GstElement *typefind, GstCaps* caps)
type_found (GstElement *typefind, const GstCaps2 * caps)
{
xmlDocPtr doc;
xmlNodePtr parent;
@ -10,7 +10,8 @@ type_found (GstElement *typefind, GstCaps* caps)
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
gst_caps_save_thyself (caps, parent);
/* FIXME */
//gst_caps2_save_thyself (caps, parent);
xmlDocDump (stdout, doc);
}

View file

@ -7,127 +7,13 @@
#include <string.h>
static void
print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
print_caps (const GstCaps2 *caps, const gchar *pfx)
{
GstPropsType type;
char *s;
if (showname)
g_print("%s%-20.20s: ", pfx, gst_props_entry_get_name (prop));
else
g_print(pfx);
type = gst_props_entry_get_props_type (prop);
switch (type) {
case GST_PROPS_INT_TYPE:
{
gint val;
gst_props_entry_get_int (prop, &val);
g_print("Integer: %d\n", val);
break;
}
case GST_PROPS_INT_RANGE_TYPE:
{
gint min, max;
gst_props_entry_get_int_range (prop, &min, &max);
g_print("Integer range: %d - %d\n", min, max);
break;
}
case GST_PROPS_FLOAT_TYPE:
{
gfloat val;
gst_props_entry_get_float (prop, &val);
g_print("Float: %g\n", val);
break;
}
case GST_PROPS_FLOAT_RANGE_TYPE:
{
gfloat min, max;
gst_props_entry_get_float_range (prop, &min, &max);
g_print("Float range: %g - %g\n", min, max);
break;
}
case GST_PROPS_BOOLEAN_TYPE:
{
gboolean val;
gst_props_entry_get_boolean (prop, &val);
g_print("Boolean: %s\n", val ? "TRUE" : "FALSE");
break;
}
case GST_PROPS_STRING_TYPE:
{
const gchar *val;
gst_props_entry_get_string (prop, &val);
g_print("String: \"%s\"\n", val);
break;
}
case GST_PROPS_FOURCC_TYPE:
{
guint32 val;
gst_props_entry_get_fourcc_int (prop, &val);
g_print("FourCC: '%c%c%c%c'\n",
(gchar)( val & 0xff),
(gchar)((val >> 8) & 0xff),
(gchar)((val >> 16) & 0xff),
(gchar)((val >> 24) & 0xff));
break;
}
case GST_PROPS_LIST_TYPE:
{
const GList *list;
gchar *longprefix;
gst_props_entry_get_list (prop, &list);
g_print ("List:\n");
longprefix = g_strdup_printf ("%s ", pfx);
while (list) {
GstPropsEntry *listentry;
listentry = (GstPropsEntry*) (list->data);
print_prop (listentry, FALSE, longprefix);
list = g_list_next (list);
}
g_free (longprefix);
break;
}
default:
g_print("unknown props %d\n", type);
}
}
static void
print_props (GstProps *properties, const gchar *pfx)
{
GList *props;
GstPropsEntry *prop;
props = properties->properties;
while (props) {
prop = (GstPropsEntry*)(props->data);
props = g_list_next(props);
print_prop(prop,TRUE,pfx);
}
}
static void
print_caps (GstCaps *caps, const gchar *pfx)
{
while (caps) {
g_print ("%s'%s': (%sfixed)\n", pfx, caps->name, (GST_CAPS_IS_FIXED (caps) ? "" : "NOT "));
g_print ("%s MIME type: '%s':\n", pfx, gst_caps_get_mime (caps));
if (caps->properties) {
gchar *prefix = g_strdup_printf ("%s ", pfx);
print_props(caps->properties, prefix);
g_free (prefix);
}
caps = caps->next;
}
s = gst_caps2_to_string (caps);
g_print ("%s%s\n", pfx, s);
g_free(s);
}
static void
@ -352,8 +238,8 @@ print_element_properties (GstElement *element)
if (param->value_type == GST_TYPE_URI) {
g_print("%-23.23s URI", "");
}
if (param->value_type == GST_TYPE_CAPS) {
GstCaps *caps = g_value_peek_pointer (&value);
if (param->value_type == GST_TYPE_CAPS2) {
const GstCaps2 *caps = gst_value_get_caps (&value);
if (!caps)
g_print("%-23.23s Caps (NULL)", "");
@ -835,15 +721,6 @@ print_element_list (void)
g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory) ,factory->details.longname);
}
#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature);
g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#endif
#ifndef GST_DISABLE_INDEX
else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
@ -901,7 +778,6 @@ print_plugin_info (GstPlugin *plugin)
GList *features;
gint num_features = 0;
gint num_elements = 0;
gint num_autoplug = 0;
gint num_types = 0;
gint num_schedulers = 0;
gint num_indexes = 0;
@ -933,15 +809,6 @@ print_plugin_info (GstPlugin *plugin)
factory->details.longname);
num_elements++;
}
#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature);
g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
num_autoplug++;
}
#endif
#ifndef GST_DISABLE_INDEX
else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
@ -985,8 +852,6 @@ print_plugin_info (GstPlugin *plugin)
g_print ("\n %d features:\n", num_features);
if (num_elements > 0)
g_print (" +-- %d elements\n", num_elements);
if (num_autoplug > 0)
g_print (" +-- %d autopluggers\n", num_autoplug);
if (num_types > 0)
g_print (" +-- %d types\n", num_types);
if (num_schedulers > 0)
@ -1055,14 +920,6 @@ main (int argc, char *argv[])
g_print ("%s: an index\n", argv[1]);
return 0;
}
#endif
#ifndef GST_DISABLE_AUTOPLUG
feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_AUTOPLUG_FACTORY);
if (feature) {
g_print ("%s: an autoplugger\n", argv[1]);
return 0;
}
#endif
feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_TYPE_FIND_FACTORY);

View file

@ -15,15 +15,15 @@ gboolean FOUND = FALSE;
gchar *filename = NULL;
void
gst_caps_print (const char *filename, GstCaps *caps)
gst_caps_print (const char *filename, const GstCaps2 *caps)
{
gchar *caps_str = gst_caps_to_string (caps);
gchar *caps_str = gst_caps2_to_string (caps);
g_print ("%s - %s\n", filename, caps_str);
g_free (caps_str);
}
void
have_type_handler (GstElement *typefind, guint probability, GstCaps *caps, gpointer unused)
have_type_handler (GstElement *typefind, guint probability, const GstCaps2 *caps, gpointer unused)
{
gst_caps_print (filename, caps);
FOUND = TRUE;

View file

@ -46,124 +46,13 @@ G_STMT_START{ \
#endif
static void
print_prop (GstPropsEntry *prop, gint pfx)
{
GstPropsType type;
type = gst_props_entry_get_props_type (prop);
switch (type) {
case GST_PROPS_INT_TYPE:
{
gint val;
gst_props_entry_get_int (prop, &val);
PUT_STRING (pfx, "<int name=\"%s\" value=\"%d\"/>",
gst_props_entry_get_name (prop), val);
break;
}
case GST_PROPS_INT_RANGE_TYPE:
{
gint min, max;
gst_props_entry_get_int_range (prop, &min, &max);
PUT_STRING (pfx, "<range name=\"%s\" min=\"%d\" max=\"%d\"/>",
gst_props_entry_get_name (prop), min, max);
break;
}
case GST_PROPS_FLOAT_TYPE:
{
gfloat val;
gst_props_entry_get_float (prop, &val);
PUT_STRING (pfx, "<float name=\"%s\" value=\"%f\"/>",
gst_props_entry_get_name (prop), val);
break;
}
case GST_PROPS_FLOAT_RANGE_TYPE:
{
gfloat min, max;
gst_props_entry_get_float_range (prop, &min, &max);
PUT_STRING (pfx, "<floatrange name=\"%s\" min=\"%f\" max=\"%f\"/>",
gst_props_entry_get_name (prop), min, max);
break;
}
case GST_PROPS_BOOLEAN_TYPE:
{
gboolean val;
gst_props_entry_get_boolean (prop, &val);
PUT_STRING (pfx, "<boolean name=\"%s\" value=\"%s\"/>",
gst_props_entry_get_name (prop), val ? "true" : "false");
break;
}
case GST_PROPS_STRING_TYPE:
{
const gchar *val;
gst_props_entry_get_string (prop, &val);
PUT_STRING (pfx, "<string name=\"%s\" value=\"%s\"/>",
gst_props_entry_get_name (prop), val);
break;
}
case GST_PROPS_FOURCC_TYPE:
{
guint32 val;
gst_props_entry_get_fourcc_int (prop, &val);
PUT_STRING (pfx, "<!--%c%c%c%c-->",
(gchar)( val & 0xff),
(gchar)((val >> 8) & 0xff),
(gchar)((val >> 16) & 0xff),
(gchar)((val >> 24) & 0xff));
PUT_STRING (pfx, "<fourcc name=\"%s\" hexvalue=\"%08x\"/>",
gst_props_entry_get_name (prop), val);
break;
}
case GST_PROPS_LIST_TYPE:
{
const GList *list;
gst_props_entry_get_list (prop, &list);
PUT_STRING (pfx, "<list name=\"%s\">", gst_props_entry_get_name (prop));
while (list) {
GstPropsEntry *listentry;
listentry = (GstPropsEntry*) (list->data);
print_prop (listentry, pfx + 1);
list = g_list_next (list);
}
PUT_END_TAG (pfx, "list");
break;
}
default:
break;
}
}
static void
print_props (GstProps *properties, gint pfx)
{
GList *props;
GstPropsEntry *prop;
props = properties->properties;
if (!props)
return;
PUT_START_TAG (pfx, "properties");
while (props) {
prop = (GstPropsEntry*) (props->data);
props = g_list_next (props);
print_prop (prop, pfx + 1);
}
PUT_END_TAG (pfx, "properties");
}
static void
print_caps (GstCaps *caps, gint pfx)
print_caps (const GstCaps2 *caps, gint pfx)
{
if (!caps)
return;
/* FIXME */
#if 0
PUT_START_TAG (pfx, "capscomp");
while (caps) {
@ -180,6 +69,7 @@ print_caps (GstCaps *caps, gint pfx)
caps = caps->next;
}
PUT_END_TAG (pfx, "capscomp");
#endif
}
static void
@ -393,8 +283,10 @@ print_element_properties (GstElement *element, gint pfx)
break;
}
default:
#if 0
/* FIXME */
if (param->value_type == GST_TYPE_CAPS) {
GstCaps *caps = g_value_peek_pointer (&value);
GstCaps2 *caps = g_value_peek_pointer (&value);
if (!caps)
PUT_ESCAPED (pfx + 2, "default", "NULL");
@ -402,6 +294,9 @@ print_element_properties (GstElement *element, gint pfx)
print_caps (caps, 2);
}
}
#else
if (0) { }
#endif
else if (G_IS_PARAM_SPEC_ENUM (param)) {
GEnumValue *values;
guint j = 0;
@ -828,15 +723,6 @@ print_element_list (void)
g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory) ,factory->details.longname);
}
#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature);
g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#endif
#ifndef GST_DISABLE_INDEX
else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
@ -926,15 +812,6 @@ print_plugin_info (GstPlugin *plugin)
factory->details.longname);
num_elements++;
}
#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature);
g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
num_autoplug++;
}
#endif
#ifndef GST_DISABLE_INDEX
else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
@ -1052,14 +929,6 @@ main (int argc, char *argv[])
g_print ("%s: an index\n", argv[1]);
return 0;
}
#endif
#ifndef GST_DISABLE_AUTOPLUG
feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_AUTOPLUG_FACTORY);
if (feature) {
g_print ("%s: an autoplugger\n", argv[1]);
return 0;
}
#endif
feature = gst_registry_pool_find_feature (argv[1],
GST_TYPE_TYPE_FIND_FACTORY);