tools/gst-typefind.c: Update, add copyright block.
authorAndy Wingo <wingo@pobox.com>
Fri, 15 Jul 2005 11:04:18 +0000 (11:04 +0000)
committerAndy Wingo <wingo@pobox.com>
Fri, 15 Jul 2005 11:04:18 +0000 (11:04 +0000)
Original commit message from CVS:
2005-07-15  Andy Wingo  <wingo@pobox.com>

* tools/gst-typefind.c: Update, add copyright block.

* gst/base/gstbasesrc.c (gst_base_src_default_negotiate):
Normalize and truncate caps before fixation.

* gst/gstcaps.h:
* gst/gstcaps.c (gst_caps_truncate): New function, destructively
discards all but the first structure from its argument.

73 files changed:
ChangeLog
docs/gst/tmpl/gst.sgml
docs/gst/tmpl/gstbasesink.sgml
docs/gst/tmpl/gstbasesrc.sgml
docs/gst/tmpl/gstbasetransform.sgml
docs/gst/tmpl/gstbin.sgml
docs/gst/tmpl/gstbuffer.sgml
docs/gst/tmpl/gstcaps.sgml
docs/gst/tmpl/gstclock.sgml
docs/gst/tmpl/gstcompat.sgml
docs/gst/tmpl/gstconfig.sgml
docs/gst/tmpl/gstelement.sgml
docs/gst/tmpl/gstelementdetails.sgml
docs/gst/tmpl/gstelementfactory.sgml
docs/gst/tmpl/gstenumtypes.sgml
docs/gst/tmpl/gsterror.sgml
docs/gst/tmpl/gstevent.sgml
docs/gst/tmpl/gstfakesink.sgml
docs/gst/tmpl/gstfakesrc.sgml
docs/gst/tmpl/gstfilesink.sgml
docs/gst/tmpl/gstfilesrc.sgml
docs/gst/tmpl/gstfilter.sgml
docs/gst/tmpl/gstformat.sgml
docs/gst/tmpl/gstghostpad.sgml
docs/gst/tmpl/gstimplementsinterface.sgml
docs/gst/tmpl/gstindex.sgml
docs/gst/tmpl/gstindexfactory.sgml
docs/gst/tmpl/gstinfo.sgml
docs/gst/tmpl/gstiterator.sgml
docs/gst/tmpl/gstmacros.sgml
docs/gst/tmpl/gstmemchunk.sgml
docs/gst/tmpl/gstminiobject.sgml
docs/gst/tmpl/gstobject.sgml
docs/gst/tmpl/gstpad.sgml
docs/gst/tmpl/gstpadtemplate.sgml
docs/gst/tmpl/gstparse.sgml
docs/gst/tmpl/gstpipeline.sgml
docs/gst/tmpl/gstplugin.sgml
docs/gst/tmpl/gstpluginfeature.sgml
docs/gst/tmpl/gstquery.sgml
docs/gst/tmpl/gstqueue.sgml
docs/gst/tmpl/gstregistry.sgml
docs/gst/tmpl/gstregistrypool.sgml
docs/gst/tmpl/gstscheduler.sgml
docs/gst/tmpl/gstschedulerfactory.sgml
docs/gst/tmpl/gststructure.sgml
docs/gst/tmpl/gstsystemclock.sgml
docs/gst/tmpl/gsttaglist.sgml
docs/gst/tmpl/gsttagsetter.sgml
docs/gst/tmpl/gsttrace.sgml
docs/gst/tmpl/gsttrashstack.sgml
docs/gst/tmpl/gsttypefind.sgml
docs/gst/tmpl/gsttypefindfactory.sgml
docs/gst/tmpl/gsttypes.sgml
docs/gst/tmpl/gsturihandler.sgml
docs/gst/tmpl/gsturitype.sgml
docs/gst/tmpl/gstutils.sgml
docs/gst/tmpl/gstvalue.sgml
docs/gst/tmpl/gstversion.sgml
docs/gst/tmpl/gstxml.sgml
docs/libs/tmpl/gstcontrol.sgml
docs/libs/tmpl/gstdataprotocol.sgml
docs/libs/tmpl/gstdparam.sgml
docs/libs/tmpl/gstdplinint.sgml
docs/libs/tmpl/gstdpman.sgml
docs/libs/tmpl/gstdpsmooth.sgml
docs/libs/tmpl/gstgetbits.sgml
docs/libs/tmpl/gstunitconvert.sgml
gst/base/gstbasesrc.c
gst/gstcaps.c
gst/gstcaps.h
libs/gst/base/gstbasesrc.c
tools/gst-typefind.c

index 9227c14..922b7b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-07-15  Andy Wingo  <wingo@pobox.com>
+
+       * tools/gst-typefind.c: Update, add copyright block.
+
+       * gst/base/gstbasesrc.c (gst_base_src_default_negotiate):
+       Normalize and truncate caps before fixation.
+
+       * gst/gstcaps.h:
+       * gst/gstcaps.c (gst_caps_truncate): New function, destructively
+       discards all but the first structure from its argument.
+
 2005-07-15  Wim Taymans  <wim@fluendo.com>
 
        * gst/base/gstbasetransform.c: (gst_base_transform_init),
index eb88667..fc6631a 100644 (file)
@@ -87,6 +87,9 @@ Check out both <ulink url="http://www.cse.ogi.edu/sysl/">OGI's
 pipeline</ulink> and Microsoft's DirectShow for some background.
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION gst_init ##### -->
 <para>
 
index 4ba69f2..429222d 100644 (file)
@@ -14,6 +14,9 @@ GstBaseSink
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstBaseSink ##### -->
 <para>
 
index 949ef42..0fa71a6 100644 (file)
@@ -14,6 +14,9 @@ GstBaseSrc
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstBaseSrc ##### -->
 <para>
 
index a9eaaa2..4ae5603 100644 (file)
@@ -14,6 +14,9 @@ GstBaseTransform
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstBaseTransform ##### -->
 <para>
 
@@ -28,8 +31,10 @@ GstBaseTransform
 @parent_class: 
 @transform_caps: 
 @set_caps: 
+@get_size: 
 @start: 
 @stop: 
 @event: 
 @transform: 
+@transform_ip: 
 
index 2007814..18938a4 100644 (file)
@@ -55,6 +55,9 @@ clock providers in the bin.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstBin ##### -->
 <para>
 
index a8c176f..08d3c89 100644 (file)
@@ -85,6 +85,9 @@ Last reviewed on August 12th, 2004 (0.8.5)
 #GstPad, #GstMiniObject
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstBuffer ##### -->
 <para>
 The basic structure of a buffer.
index 853fd34..9149a47 100644 (file)
@@ -14,6 +14,9 @@ Structure describing sets of media formats
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstCaps ##### -->
 <para>
 
index 052fe05..231085a 100644 (file)
@@ -22,6 +22,9 @@ a good measure of the current playback time in the pipeline.
 #GstSystemClock
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstClock ##### -->
 <para>
 
index 16c29cd..402c11c 100644 (file)
@@ -16,3 +16,6 @@ This can be done in CFLAGS for compiling old code.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
index ed05367..6e71764 100644 (file)
@@ -37,6 +37,9 @@ If a subsystem is disabled in GStreamer, a value is defined in
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### MACRO GST_DISABLE_LOADSAVE_REGISTRY ##### -->
 <para>
 
index 4d89a8e..a474d06 100644 (file)
@@ -65,6 +65,9 @@ and gst_element_set_clock().  You can wait for the clock to reach a given
 
 <!-- basic object functions -->
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstElement ##### -->
 <para>
 
index 8c57fce..757ebbc 100644 (file)
@@ -14,6 +14,9 @@ Defines public information about a #GstElement
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstElementDetails ##### -->
 <para>
 This struct is used to define public information about the element.  It
index 5e74564..c68b5b4 100644 (file)
@@ -54,6 +54,9 @@ so that the autopluggers can select a plugin more appropriatly
 #GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstElementFactory ##### -->
 <para>
 
index e9361f1..52ba68c 100644 (file)
@@ -14,3 +14,6 @@ all gstreamer core related enumerations
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
index 661024e..7dd7e26 100644 (file)
@@ -14,6 +14,9 @@ Categorized error messages
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstCoreError ##### -->
 <para>
 
@@ -82,6 +85,7 @@ Categorized error messages
 @GST_STREAM_ERROR_DEMUX: 
 @GST_STREAM_ERROR_MUX: 
 @GST_STREAM_ERROR_FORMAT: 
+@GST_STREAM_ERROR_STOPPED: 
 @GST_STREAM_ERROR_NUM_ERRORS: 
 
 <!-- ##### MACRO GST_CORE_ERROR ##### -->
index b5ed1b9..d47b398 100644 (file)
@@ -27,6 +27,9 @@ gst_event_new_flush() creates a new flush event.
 #GstPad, #GstElement
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstEvent ##### -->
 <para>
 
index 7755271..bbf1d94 100644 (file)
@@ -14,6 +14,9 @@ GstFakeSink
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstFakeSink ##### -->
 <para>
 
index e78986e..9acacf2 100644 (file)
@@ -14,6 +14,9 @@ GstFakeSrc
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstFakeSrc ##### -->
 <para>
 
index e3bd8dd..9ec2717 100644 (file)
@@ -14,6 +14,9 @@ GstFileSink
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstFileSink ##### -->
 <para>
 
index e7d7274..806b545 100644 (file)
@@ -14,6 +14,9 @@ GstFileSrc
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstFileSrc ##### -->
 <para>
 
index 8f5a2fe..49932ee 100644 (file)
@@ -17,6 +17,9 @@ on its own.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### USER_FUNCTION GstFilterFunc ##### -->
 <para>
 
index dc3c284..353899a 100644 (file)
@@ -15,6 +15,9 @@ formats can be used to perform seeking or conversions/query operations.
 #GstPad, #GstElement
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstFormat ##### -->
 <para>
 Standard predefined formats
index 0fdd2b2..c760eed 100644 (file)
@@ -14,6 +14,9 @@ Pseudo link pads
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstGhostPad ##### -->
 <para>
 
index 5683450..df7fb5f 100644 (file)
@@ -14,6 +14,9 @@ Core interface implemented by #GstElements that allows runtime querying of inter
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstImplementsInterface ##### -->
 <para>
 
index 74254d5..1eac0ee 100644 (file)
@@ -15,6 +15,9 @@ in a pipeline.
 #GstIndexFactory
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstIndex ##### -->
 <para>
 
index f458efd..7c86974 100644 (file)
@@ -14,6 +14,9 @@ GstIndexFactory is used to dynamically create GstIndex implementations.
 #GstIndex
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstIndexFactory ##### -->
 <para>
 The GstIndexFactory object
index be07e23..d2d2d58 100644 (file)
@@ -68,6 +68,9 @@ categories. These are explained at GST_DEBUG_CATEGORY_INIT().
 and environment variables that affect the debugging output.
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstDebugLevel ##### -->
 <para>
 The level defines the importance of a debugging message. The more important a 
index 307d499..9bc68df 100644 (file)
@@ -14,6 +14,9 @@ GstIterator
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstIterator ##### -->
 <para>
 
index 49b0cc6..8149bca 100644 (file)
@@ -14,3 +14,6 @@ various portabillity helper macros
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
index af74215..8ce3af2 100644 (file)
@@ -21,6 +21,9 @@ The GstMemChunk is used to allocate critical resources for #GstBuffer and
 #GstBuffer, #GstEvent, #GstData
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstMemChunk ##### -->
 <para>
 The memchunk structure
index 5481e39..ff0a8f1 100644 (file)
@@ -14,6 +14,9 @@ GstMiniObject
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstMiniObject ##### -->
 <para>
 
index ab9e443..583afec 100644 (file)
@@ -67,6 +67,9 @@ object.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstObject ##### -->
 <para>
 
index 2b2c7cd..45bdc5e 100644 (file)
@@ -57,6 +57,9 @@ Last reviewed on December 13th, 2002 (0.5.0.1)
 #GstPadTemplate, #GstElement, #GstEvent
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstPad ##### -->
 <para>
 
index 1ff9a28..060a3d1 100644 (file)
@@ -73,6 +73,9 @@ The following example shows you how to add the padtemplate to an elementfactory:
 #GstPad, #GstElementFactory
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstPadTemplate ##### -->
 <para>
 The padtemplate object.
index 5b70820..e43a2da 100644 (file)
@@ -14,6 +14,9 @@ get a pipeline from a text pipeline description
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION gst_parse_error_quark ##### -->
 <para>
 
index bbd6ecd..74912fa 100644 (file)
@@ -21,6 +21,9 @@ the pipeline, use gst_object_unref() to free its resources.
 #GstBin
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstPipeline ##### -->
 <para>
 
index cd93138..17a0ae7 100644 (file)
@@ -35,6 +35,9 @@ to bring the plugin into memory.
 #GstPluginFeature, #GstType, #GstAutoplug, #GstElementFactory
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION gst_plugin_error_quark ##### -->
 <para>
 Get the error quark
index 6395293..96a2e5e 100644 (file)
@@ -14,6 +14,9 @@ This is a base class for anything that can be added to a #GstPlugin.
 #GstPlugin
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstPluginFeature ##### -->
 <para>
 
index eb2f4bb..efea5bc 100644 (file)
@@ -15,6 +15,9 @@ Query types can be used to perform queries on pads and elements.
 #GstPad, #GstElement
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstQueryType ##### -->
 <para>
 Standard predefined Query types
index 71ce9c5..3d2a500 100644 (file)
@@ -25,6 +25,9 @@ The queue blocks by default.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstQueue ##### -->
 <para>
 
index a554aee..be6b381 100644 (file)
@@ -15,3 +15,6 @@ All registries build the #GstRegistryPool.
 #GstPlugin, #GstPluginFeature
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
index 82b21c6..99de4f9 100644 (file)
@@ -15,6 +15,9 @@ the system.
 GstRegistry
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION gst_registry_pool_list ##### -->
 <para>
 
index 47803f1..2be2185 100644 (file)
@@ -14,6 +14,9 @@ This is a base class for custom schedulers.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstScheduler ##### -->
 <para>
 
index a9a5313..bda06b0 100644 (file)
@@ -31,6 +31,9 @@ Use gst_scheduler_factory_destroy() to remove the factory from the global list.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstSchedulerFactory ##### -->
 <para>
 
index bdff185..d9d15e5 100644 (file)
@@ -14,6 +14,9 @@ Generic structure containing fields of names and values
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstStructure ##### -->
 <para>
 
index 714c32c..71c56fd 100644 (file)
@@ -15,6 +15,9 @@ system time.
 #GstClock
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstSystemClock ##### -->
 <para>
 
index 64559f8..2164017 100644 (file)
@@ -14,6 +14,9 @@ List of tags and values used to describe media metadata
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF GstTagList ##### -->
 <para>
 
index 4c55270..d80b667 100644 (file)
@@ -14,6 +14,9 @@ Element interface that allows setting and retrieval of media metadata
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstTagSetter ##### -->
 <para>
 
index 6ccaa79..b08a807 100644 (file)
@@ -14,6 +14,9 @@ Tracing functionality
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstTrace ##### -->
 <para>
 
index 81bb80f..27eeeeb 100644 (file)
@@ -14,6 +14,9 @@ gsttrashstack
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstTrashStack ##### -->
 <para>
 
index d729fd0..eb4ab7e 100644 (file)
@@ -14,6 +14,9 @@ typefinding subsystem
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstTypeFind ##### -->
 <para>
 
index 9aea96a..0ec2797 100644 (file)
@@ -67,6 +67,9 @@ the given data. You can get quite a bit more complicated than that though.
 <link linkend="gstreamer-Writing-typefind-functions">Writing typefind functions</link>
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstTypeFindFactory ##### -->
 <para>
 Object that stores information about a typefind function
index c83b048..58aaf1f 100644 (file)
@@ -14,6 +14,9 @@ various global enums and constants
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstElementState ##### -->
 <para>
 These contants describe the state a #GstElement is in and transition scheduled for the #GstElement (the pending state).
index fb5512f..7a3b021 100644 (file)
@@ -15,6 +15,9 @@ and the element property that can handle a given URI.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstURIHandler ##### -->
 <para>
 
index 99e0afc..1c2391c 100644 (file)
@@ -14,6 +14,9 @@ describes URI types
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstURIType ##### -->
 <para>
 
index 44b2c6d..6d7d55a 100644 (file)
@@ -14,6 +14,9 @@ various utility functions
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION gst_util_set_value_from_string ##### -->
 <para>
 
index 26bfc0c..97e3caa 100644 (file)
@@ -14,6 +14,9 @@ GValue implementations specific to GStreamer
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### MACRO GST_MAKE_FOURCC ##### -->
 <para>
 will transform four characters into a host-endiannness guint32 fourcc:
index d6bcdfc..4a17d3c 100644 (file)
@@ -15,6 +15,9 @@ The version macros get defined by including "gst/gst.h".
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### MACRO GST_VERSION_MAJOR ##### -->
 <para>
 The major version of GStreamer at compile time
index 056f62e..4ae6709 100644 (file)
@@ -14,6 +14,9 @@ XML save/restore operations of pipelines
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstXML ##### -->
 <para>
 
index 7439c42..f41c436 100644 (file)
@@ -73,6 +73,9 @@ This allows the manager to interupt processing to apply new control values.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION gst_control_init ##### -->
 <para>
 
index 0cd1515..1bb87c8 100644 (file)
@@ -27,6 +27,9 @@ network connections also need a protocol to do this.
 #GstBuffer, #GstCaps, #GstEvent
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM GstDPHeaderFlag ##### -->
 <para>
 
index 8a28a82..7726db6 100644 (file)
@@ -15,6 +15,9 @@ Subclasses of this do more advanced updates like smoothing parameter changes.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstDParam ##### -->
 <para>
 
index ca453e1..c76ea7d 100644 (file)
@@ -14,6 +14,9 @@ linear interpolation dynamic parameter
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstDParamLinInterp ##### -->
 <para>
 
index a600e0e..52ce531 100644 (file)
@@ -20,6 +20,9 @@ are for applications that use elements with dparams.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstDParamManager ##### -->
 <para>
 
index bfd5e83..17dd2a5 100644 (file)
@@ -14,6 +14,9 @@ realtime smoothed dynamic parameter
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstDParamSmooth ##### -->
 <para>
 
index 1d107d6..e3e087a 100644 (file)
@@ -14,6 +14,9 @@ accelerated routines for getting bits from a data stream.
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT gst_getbits_t ##### -->
 <para>
 
index e06b2e4..71efed7 100644 (file)
@@ -14,6 +14,9 @@ conversion between units of measurement
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT GstUnitConvert ##### -->
 <para>
 
index 429dc30..1794109 100644 (file)
@@ -785,7 +785,13 @@ gst_base_src_default_negotiate (GstBaseSrc * basesrc)
     caps = thiscaps;
   }
   if (caps) {
-    caps = gst_caps_make_writable (caps);
+    GstCaps *normalized;
+
+    normalized = gst_caps_make_writable (caps);
+    gst_caps_unref (caps);
+    caps = normalized;
+    gst_caps_truncate (caps);
+
     gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps);
     GST_DEBUG ("fixated to: %" GST_PTR_FORMAT, caps);
 
index 0afa857..e77442d 100644 (file)
@@ -568,6 +568,27 @@ gst_caps_copy_nth (const GstCaps * caps, gint nth)
   return newcaps;
 }
 
+/**     
+ * gst_caps_truncate:   
+ * @caps: the @GstCaps to truncate
+ *      
+ * Destructively discard all but the first structure from @caps. Useful when
+ * fixating. @caps must be writable.
+ */
+void
+gst_caps_truncate (GstCaps * caps)
+{
+  gint i;
+
+  g_return_if_fail (GST_IS_CAPS (caps));
+  g_return_if_fail (IS_WRITABLE (caps));
+
+  i = caps->structs->len - 1;
+
+  while (i > 0)
+    gst_caps_remove_structure (caps, i--);
+}
+
 /**
  * gst_caps_set_simple:
  * @caps: the @GstCaps to set
index c15f558..462fe2b 100644 (file)
@@ -109,6 +109,7 @@ int                      gst_caps_get_size                              (const G
 GstStructure *           gst_caps_get_structure                         (const GstCaps *caps,
                                                                         int            index);
 GstCaps *               gst_caps_copy_nth                              (const GstCaps * caps, gint nth);
+void                    gst_caps_truncate                              (GstCaps * caps);
 void                     gst_caps_set_simple                            (GstCaps       *caps,
                                                                         char          *field, ...);
 void                     gst_caps_set_simple_valist                     (GstCaps       *caps,
index 429dc30..1794109 100644 (file)
@@ -785,7 +785,13 @@ gst_base_src_default_negotiate (GstBaseSrc * basesrc)
     caps = thiscaps;
   }
   if (caps) {
-    caps = gst_caps_make_writable (caps);
+    GstCaps *normalized;
+
+    normalized = gst_caps_make_writable (caps);
+    gst_caps_unref (caps);
+    caps = normalized;
+    gst_caps_truncate (caps);
+
     gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps);
     GST_DEBUG ("fixated to: %" GST_PTR_FORMAT, caps);
 
index b3fe66c..9d79fdb 100644 (file)
@@ -1,3 +1,27 @@
+/* GStreamer
+ * Copyright (C) 2003 Thomas Vander Stichele <thomas@apestaart.org>
+ *               2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ *               2005 Andy Wingo <wingo@pobox.com>
+ *
+ * gst-typefind.c: Use GStreamer to find the type of a file
+ *
+ * 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.
+ */
+
+
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
 #endif
 #include <locale.h>
 #include <gst/gst.h>
 
-/*
- * find the type of a media file and display it's properties
- **/
-
-gboolean FOUND = FALSE;
-gchar *filename = NULL;
 
-void
-gst_caps_print (const char *filename, const GstCaps * caps)
-{
-  gchar *caps_str = gst_caps_to_string (caps);
+char *filename = NULL;
 
-  g_print ("%s - %s\n", filename, caps_str);
-  g_free (caps_str);
-}
 
 void
 have_type_handler (GstElement * typefind, guint probability,
     const GstCaps * caps, gpointer unused)
 {
-  gst_caps_print (filename, caps);
-  FOUND = TRUE;
+  gchar *caps_str;
+
+  caps_str = gst_caps_to_string (caps);
+  g_print ("%s - %s\n", filename, caps_str);
+  g_free (caps_str);
 }
 
 int
@@ -36,7 +51,7 @@ main (int argc, char *argv[])
 {
   guint i = 1;
   GstElement *pipeline;
-  GstElement *source, *typefind;
+  GstElement *source, *typefind, *fakesink;
 
   setlocale (LC_ALL, "");
 
@@ -48,32 +63,41 @@ main (int argc, char *argv[])
   }
 
   pipeline = gst_pipeline_new (NULL);
+
+  /* don't hang too long trying to preroll */
+  g_object_set (pipeline, "play-timeout", (gint64) 0.25 * GST_SECOND, NULL);
+
   source = gst_element_factory_make ("filesrc", "source");
   g_assert (GST_IS_ELEMENT (source));
   typefind = gst_element_factory_make ("typefind", "typefind");
   g_assert (GST_IS_ELEMENT (typefind));
-  gst_bin_add (GST_BIN (pipeline), source);
-  gst_bin_add (GST_BIN (pipeline), typefind);
-  gst_pad_link (gst_element_get_pad (source, "src"),
-      gst_element_get_pad (typefind, "sink"));
+  fakesink = gst_element_factory_make ("fakesink", "fakesink");
+  g_assert (GST_IS_ELEMENT (typefind));
+
+  gst_bin_add_many (GST_BIN (pipeline), source, typefind, fakesink, NULL);
+  gst_element_link_many (source, typefind, fakesink, NULL);
+
   g_signal_connect (G_OBJECT (typefind), "have-type",
       G_CALLBACK (have_type_handler), NULL);
 
   while (i < argc) {
-    FOUND = FALSE;
-    gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
+    GstElementStateReturn sret;
+
     filename = argv[i];
     g_object_set (source, "location", filename, NULL);
-    /* set to play */
-    gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
 
-    while (!FOUND) {
-    }
-    if (!FOUND) {
+    /* typefind will only commit to PAUSED if it actually finds a type;
+     * otherwise the state change fails */
+    sret = gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED);
+
+    if (sret != GST_STATE_SUCCESS)
       g_print ("%s - No type found\n", argv[i]);
-    }
+
+    gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
+
     i++;
   }
-  g_object_unref (pipeline);
+
+  gst_object_unref (pipeline);
   return 0;
 }